vendor: 6,072 bytes, lines 1-9
1var IT=n=>{throw TypeError(n)};var I_=(n,e,t)=>e.has(n)||IT("Cannot "+t);var te=(n,e,t)=>(I_(n,e,"read from private field"),t?t.call(n):e.get(n)),Tt=(n,e,t)=>e.has(n)?IT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),ot=(n,e,t,r)=>(I_(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),$t=(n,e,t)=>(I_(n,e,"access private method"),t);var Mg=(n,e,t,r)=>({set _(i){ot(n,e,i,t)},get _(){return te(n,e,r)}});function FU(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in n)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();function S2(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var CP={exports:{}},Qv={},NP={exports:{}},en={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var rm=Symbol.for("react.element"),DU=Symbol.for("react.portal"),kU=Symbol.for("react.fragment"),LU=Symbol.for("react.strict_mode"),jU=Symbol.for("react.profiler"),OU=Symbol.for("react.provider"),UU=Symbol.for("react.context"),BU=Symbol.for("react.forward_ref"),zU=Symbol.for("react.suspense"),VU=Symbol.for("react.memo"),HU=Symbol.for("react.lazy"),FT=Symbol.iterator;function WU(n){return n===null||typeof n!="object"?null:(n=FT&&n[FT]||n["@@iterator"],typeof n=="function"?n:null)}var RP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},PP=Object.assign,IP={};function Th(n,e,t){this.props=n,this.context=e,this.refs=IP,this.updater=t||RP}Th.prototype.isReactComponent={};Th.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=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,n,e,"setState")};Th.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function FP(){}FP.prototype=Th.prototype;function E2(n,e,t){this.props=n,this.context=e,this.refs=IP,this.updater=t||RP}var M2=E2.prototype=new FP;M2.constructor=E2;PP(M2,Th.prototype);M2.isPureReactComponent=!0;var DT=Array.isArray,DP=Object.prototype.hasOwnProperty,A2={current:null},kP={key:!0,ref:!0,__self:!0,__source:!0};function LP(n,e,t){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)DP.call(e,r)&&!kP.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=t;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];i.children=c}if(n&&n.defaultProps)for(r in a=n.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:rm,type:n,key:s,ref:o,props:i,_owner:A2.current}}function GU(n,e){return{$$typeof:rm,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function T2(n){return typeof n=="object"&&n!==null&&n.$$typeof===rm}function $U(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var kT=/\/+/g;function F_(n,e){return typeof n=="object"&&n!==null&&n.key!=null?$U(""+n.key):e.toString(36)}function $x(n,e,t,r,i){var s=typeof n;(s==="undefined"||s==="boolean")&&(n=null);var o=!1;if(n===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(n.$$typeof){case rm:case DU:o=!0}}if(o)return o=n,i=i(o),n=r===""?"."+F_(o,0):r,DT(i)?(t="",n!=null&&(t=n.replace(kT,"$&/")+"/"),$x(i,e,t,"",function(u){return u})):i!=null&&(T2(i)&&(i=GU(i,t+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(kT,"$&/")+"/")+n)),e.push(i)),1;if(o=0,r=r===""?".":r+":",DT(n))for(var a=0;a<n.length;a++){s=n[a];var c=r+F_(s,a);o+=$x(s,e,t,c,i)}else if(c=WU(n),typeof c=="function")for(n=c.call(n),a=0;!(s=n.next()).done;)s=s.value,c=r+F_(s,a++),o+=$x(s,e,t,c,i);else if(s==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Ag(n,e,t){if(n==null)return n;var r=[],i=0;return $x(n,r,"","",function(s){return e.call(t,s,i++)}),r}function XU(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var gi={current:null},Xx={transition:null},qU={ReactCurrentDispatcher:gi,ReactCurrentBatchConfig:Xx,ReactCurrentOwner:A2};function jP(){throw Error("act(...) is not supported in production builds of React.")}en.Children={map:Ag,forEach:function(n,e,t){Ag(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return Ag(n,function(){e++}),e},toArray:function(n){return Ag(n,function(e){return e})||[]},only:function(n){if(!T2(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};en.Component=Th;en.Fragment=kU;en.Profiler=jU;
vendor: 9,122 bytes, lines 9-33
9en.PureComponent=E2;en.StrictMode=LU;en.Suspense=zU;en.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qU;en.act=jP;en.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var r=PP({},n.props),i=n.key,s=n.ref,o=n._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=A2.current),e.key!==void 0&&(i=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(c in e)DP.call(e,c)&&!kP.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&a!==void 0?a[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=t;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:rm,type:n.type,key:i,ref:s,props:r,_owner:o}};en.createContext=function(n){return n={$$typeof:UU,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:OU,_context:n},n.Consumer=n};en.createElement=LP;en.createFactory=function(n){var e=LP.bind(null,n);return e.type=n,e};en.createRef=function(){return{current:null}};en.forwardRef=function(n){return{$$typeof:BU,render:n}};en.isValidElement=T2;en.lazy=function(n){return{$$typeof:HU,_payload:{_status:-1,_result:n},_init:XU}};en.memo=function(n,e){return{$$typeof:VU,type:n,compare:e===void 0?null:e}};en.startTransition=function(n){var e=Xx.transition;Xx.transition={};try{n()}finally{Xx.transition=e}};en.unstable_act=jP;en.useCallback=function(n,e){return gi.current.useCallback(n,e)};en.useContext=function(n){return gi.current.useContext(n)};en.useDebugValue=function(){};en.useDeferredValue=function(n){return gi.current.useDeferredValue(n)};en.useEffect=function(n,e){return gi.current.useEffect(n,e)};en.useId=function(){return gi.current.useId()};en.useImperativeHandle=function(n,e,t){return gi.current.useImperativeHandle(n,e,t)};en.useInsertionEffect=function(n,e){return gi.current.useInsertionEffect(n,e)};en.useLayoutEffect=function(n,e){return gi.current.useLayoutEffect(n,e)};en.useMemo=function(n,e){return gi.current.useMemo(n,e)};en.useReducer=function(n,e,t){return gi.current.useReducer(n,e,t)};en.useRef=function(n){return gi.current.useRef(n)};en.useState=function(n){return gi.current.useState(n)};en.useSyncExternalStore=function(n,e,t){return gi.current.useSyncExternalStore(n,e,t)};en.useTransition=function(){return gi.current.useTransition()};en.version="18.3.1";NP.exports=en;var T=NP.exports;const Ot=S2(T),OP=FU({__proto__:null,default:Ot},[T]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var YU=T,KU=Symbol.for("react.element"),ZU=Symbol.for("react.fragment"),QU=Object.prototype.hasOwnProperty,JU=YU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,e6={key:!0,ref:!0,__self:!0,__source:!0};function UP(n,e,t){var r,i={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)QU.call(e,r)&&!e6.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:KU,type:n,key:s,ref:o,props:i,_owner:JU.current}}Qv.Fragment=ZU;Qv.jsx=UP;Qv.jsxs=UP;CP.exports=Qv;var l=CP.exports,BP={exports:{}},us={},zP={exports:{}},VP={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(n){function e(j,$){var K=j.length;j.push($);e:for(;0<K;){var re=K-1>>>1,xe=j[re];if(0<i(xe,$))j[re]=$,j[K]=xe,K=re;else break e}}function t(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var $=j[0],K=j.pop();if(K!==$){j[0]=K;e:for(var re=0,xe=j.length,Ce=xe>>>1;re<Ce;){var ce=2*(re+1)-1,_e=j[ce],Re=ce+1,pe=j[Re];if(0>i(_e,K))Re<xe&&0>i(pe,_e)?(j[re]=pe,j[Re]=K,re=Re):(j[re]=_e,j[ce]=K,re=ce);else if(Re<xe&&0>i(pe,K))j[re]=pe,j[Re]=K,re=Re;else break e}}return $}function i(j,$){var K=j.sortIndex-$.sortIndex;return K!==0?K:j.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var c=[],u=[],f=1,p=null,m=3,x=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(j){for(var $=t(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=j)r(u),$.sortIndex=$.expirationTime,e(c,$);else break;$=t(u)}}function M(j){if(_=!1,S(j),!v)if(t(c)!==null)v=!0,Y(A);else{var $=t(u);$!==null&&ne(M,$.startTime-j)}}function A(j,$){v=!1,_&&(_=!1,g(L),L=-1),x=!0;var K=m;try{for(S($),p=t(c);p!==null&&(!(p.expirationTime>$)||j&&!D());){var re=p.callback;if(typeof re=="function"){p.callback=null,m=p.priorityLevel;var xe=re(p.expirationTime<=$);$=n.unstable_now(),typeof xe=="function"?p.callback=xe:p===t(c)&&r(c),S($)}else r(c);p=t(c)}if(p!==null)var Ce=!0;else{var ce=t(u);ce!==null&&ne(M,ce.startTime-$),Ce=!1}return Ce}finally{p=null,m=K,x=!1}}var R=!1,F=null,L=-1,N=5,I=-1;function D(){return!(n.unstable_now()-I<N)}function O(){if(F!==null){var j=n.unstable_now();I=j;var $=!0;try{$=F(!0,j)}finally{$?U():(R=!1,F=null)}}else R=!1}var U;if(typeof b=="function")U=function(){b(O)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,Z=V.port2;V.port1.onmessage=O,U=function(){Z.postMessage(null)}}else U=function(){y(O,0)};function Y(j){F=j,R||(R=!0,U())}function ne(j,$){L=y(function(){j(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_continueExecution=function(){v||x||(v=!0,Y(A))},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return m},n.unstable_getFirstCallbackNode=function(){return t(c)},n.unstable_next=function(j){switch(m){case 1:case 2:case 3:var $=3;break;default:$=m}var K=m;m=$;try{return j()}finally{m=K}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(j,$){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var K=m;m=j;try{return $()}finally{m=K}},n.unstable_scheduleCallback=function(j,$,K){var re=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?re+K:re):K=re,j){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=K+xe,j={id:f++,callback:$,priorityLevel:j,startTime:K,expirationTime:xe,sortIndex:-1},K>re?(j.sortIndex=K,e(u,j),t(c)===null&&j===t(u)&&(_?(g(L),L=-1):_=!0,ne(M,K-re))):(j.sortIndex=xe,e(c,j),v||x||(v=!0,Y(A))),j},n.unstable_shouldYield=D,n.unstable_wrapCallback=function(j){var $=m;return function(){var K=m;m=$;try{return j.apply(this,arguments)}finally{m=K}}}})(VP);zP.exports=VP;var t6=zP.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var n6=T,as=t6;function ke(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var HP=new Set,mp={};function mu(n,e){nh(n,e),nh(n+"Capture",e)}function nh(n,e){for(mp[n]=e,n=0;n<e.length;n++)HP.add(e[n])}var wa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sb=Object.prototype.hasOwnProperty,r6=/^[: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]*$/,LT={},jT={};function i6(n){return Sb.call(jT,n)?!0:Sb.call(LT,n)?!1:r6.test(n)?jT[n]=!0:(LT[n]=!0,!1)}function s6(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function o6(n,e,t,r){if(e===null||typeof e>"u"||s6(n,e,t,r))return!0;
vendor: 5,200 bytes, lines 33-34
33if(r)return!1;if(t!==null)switch(t.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 xi(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Or={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Or[n]=new xi(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Or[e]=new xi(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Or[n]=new xi(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Or[n]=new xi(n,2,!1,n,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(n){Or[n]=new xi(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Or[n]=new xi(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Or[n]=new xi(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Or[n]=new xi(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Or[n]=new xi(n,5,!1,n.toLowerCase(),null,!1,!1)});var C2=/[\-:]([a-z])/g;function N2(n){return n[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(n){var e=n.replace(C2,N2);Or[e]=new xi(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(C2,N2);Or[e]=new xi(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(C2,N2);Or[e]=new xi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Or[n]=new xi(n,1,!1,n.toLowerCase(),null,!1,!1)});Or.xlinkHref=new xi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Or[n]=new xi(n,1,!1,n.toLowerCase(),null,!0,!0)});function R2(n,e,t,r){var i=Or.hasOwnProperty(e)?Or[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(o6(e,t,i,r)&&(t=null),r||i===null?i6(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):i.mustUseProperty?n[i.propertyName]=t===null?i.type===3?!1:"":t:(e=i.attributeName,r=i.attributeNamespace,t===null?n.removeAttribute(e):(i=i.type,t=i===3||i===4&&t===!0?"":""+t,r?n.setAttributeNS(r,e,t):n.setAttribute(e,t))))}var Ia=n6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Tg=Symbol.for("react.element"),dd=Symbol.for("react.portal"),hd=Symbol.for("react.fragment"),P2=Symbol.for("react.strict_mode"),Eb=Symbol.for("react.profiler"),WP=Symbol.for("react.provider"),GP=Symbol.for("react.context"),I2=Symbol.for("react.forward_ref"),Mb=Symbol.for("react.suspense"),Ab=Symbol.for("react.suspense_list"),F2=Symbol.for("react.memo"),nl=Symbol.for("react.lazy"),$P=Symbol.for("react.offscreen"),OT=Symbol.iterator;function af(n){return n===null||typeof n!="object"?null:(n=OT&&n[OT]||n["@@iterator"],typeof n=="function"?n:null)}var Vn=Object.assign,D_;function kf(n){if(D_===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);D_=e&&e[1]||""}return` 34`+D_+n}var k_=!1;function L_(n,e){if(!n||k_)return"";k_=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(n,[],e)}else{try{e.call()}catch(u){r=u}n.call(e.prototype)}else{try{throw Error()}catch(u){r=u}n()}}
vendor: 5,039 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(` 35`),s=r.stack.split(` 36`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var c=` 37`+i[o].replace(" at new "," at ");return n.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",n.displayName)),c}while(1<=o&&0<=a);break}}}finally{k_=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?kf(n):""}function a6(n){switch(n.tag){case 5:return kf(n.type);case 16:return kf("Lazy");case 13:return kf("Suspense");case 19:return kf("SuspenseList");case 0:case 2:case 15:return n=L_(n.type,!1),n;case 11:return n=L_(n.type.render,!1),n;case 1:return n=L_(n.type,!0),n;default:return""}}function Tb(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case hd:return"Fragment";case dd:return"Portal";case Eb:return"Profiler";case P2:return"StrictMode";case Mb:return"Suspense";case Ab:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case GP:return(n.displayName||"Context")+".Consumer";case WP:return(n._context.displayName||"Context")+".Provider";case I2:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case F2:return e=n.displayName||null,e!==null?e:Tb(n.type)||"Memo";case nl:e=n._payload,n=n._init;try{return Tb(n(e))}catch{}}return null}function l6(n){var e=n.type;switch(n.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 n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Tb(e);case 8:return e===P2?"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(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function XP(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function c6(n){var e=XP(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Cg(n){n._valueTracker||(n._valueTracker=c6(n))}function qP(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=XP(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function y0(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Cb(n,e){var t=e.checked;return Vn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function UT(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Il(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function YP(n,e){e=e.checked,e!=null&&R2(n,"checked",e,!1)}function Nb(n,e){YP(n,e);var t=Il(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?Rb(n,e.type,t):e.hasOwnProperty("defaultValue")&&Rb(n,e.type,Il(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function BT(n,e,t){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=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function Rb(n,e,t){(e!=="number"||y0(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Lf=Array.isArray;function Cd(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i<t.length;i++)e["$"+t[i]]=!0;for(t=0;t<n.length;t++)i=e.hasOwnProperty("$"+n[t].value),n[t].selected!==i&&(n[t].selected=i),i&&r&&(n[t].defaultSelected=!0)}
vendor: 9,230 bytes, line 37
37else{for(t=""+Il(t),e=null,i=0;i<n.length;i++){if(n[i].value===t){n[i].selected=!0,r&&(n[i].defaultSelected=!0);return}e!==null||n[i].disabled||(e=n[i])}e!==null&&(e.selected=!0)}}function Pb(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ke(91));return Vn({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function zT(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(ke(92));if(Lf(t)){if(1<t.length)throw Error(ke(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Il(t)}}function KP(n,e){var t=Il(e.value),r=Il(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),r!=null&&(n.defaultValue=""+r)}function VT(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function ZP(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ib(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?ZP(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var Ng,QP=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,r,i){MSApp.execUnsafeLocalFunction(function(){return n(e,t,r,i)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(Ng=Ng||document.createElement("div"),Ng.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Ng.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function gp(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Xf={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},u6=["Webkit","ms","Moz","O"];Object.keys(Xf).forEach(function(n){u6.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Xf[e]=Xf[n]})});function JP(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Xf.hasOwnProperty(n)&&Xf[n]?(""+e).trim():e+"px"}function eI(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=JP(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var d6=Vn({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 Fb(n,e){if(e){if(d6[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ke(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ke(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ke(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ke(62))}}function Db(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kb=null;function D2(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Lb=null,Nd=null,Rd=null;function HT(n){if(n=om(n)){if(typeof Lb!="function")throw Error(ke(280));var e=n.stateNode;e&&(e=ry(e),Lb(n.stateNode,n.type,e))}}function tI(n){Nd?Rd?Rd.push(n):Rd=[n]:Nd=n}function nI(){if(Nd){var n=Nd,e=Rd;if(Rd=Nd=null,HT(n),e)for(n=0;n<e.length;n++)HT(e[n])}}function rI(n,e){return n(e)}function iI(){}var j_=!1;function sI(n,e,t){if(j_)return n(e,t);j_=!0;try{return rI(n,e,t)}finally{j_=!1,(Nd!==null||Rd!==null)&&(iI(),nI())}}function xp(n,e){var t=n.stateNode;if(t===null)return null;var r=ry(t);if(r===null)return null;t=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(n=n.type,r=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!r;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(ke(231,e,typeof t));return t}var jb=!1;if(wa)try{var lf={};Object.defineProperty(lf,"passive",{get:function(){jb=!0}}),window.addEventListener("test",lf,lf),window.removeEventListener("test",lf,lf)}catch{jb=!1}function h6(n,e,t,r,i,s,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(t,u)}catch(f){this.onError(f)}}var qf=!1,_0=null,w0=!1,Ob=null,f6={onError:function(n){qf=!0,_0=n}};function p6(n,e,t,r,i,s,o,a,c){qf=!1,_0=null,h6.apply(f6,arguments)}function m6(n,e,t,r,i,s,o,a,c){if(p6.apply(this,arguments),qf){if(qf){var u=_0;qf=!1,_0=null}else throw Error(ke(198));w0||(w0=!0,Ob=u)}}function gu(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function oI(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function WT(n){if(gu(n)!==n)throw Error(ke(188))}function g6(n){var e=n.alternate;if(!e){if(e=gu(n),e===null)throw Error(ke(188));return e!==n?null:n}for(var t=n,r=e;;){var i=t.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){t=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return WT(i),n;if(s===r)return WT(i),e;s=s.sibling}throw Error(ke(188))}if(t.return!==r.return)t=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===t){o=!0,t=i,r=s;break}if(a===r){o=!0,r=i,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,r=i;break}if(a===r){o=!0,r=s,t=i;break}a=a.sibling}if(!o)throw Error(ke(189))}}if(t.alternate!==r)throw Error(ke(190))}if(t.tag!==3)throw Error(ke(188));return t.stateNode.current===t?n:e}function aI(n){return n=g6(n),n!==null?lI(n):null}function lI(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=lI(n);if(e!==null)return e;n=n.sibling}return null}var cI=as.unstable_scheduleCallback,GT=as.unstable_cancelCallback,x6=as.unstable_shouldYield,v6=as.unstable_requestPaint,er=as.unstable_now,y6=as.unstable_getCurrentPriorityLevel,k2=as.unstable_ImmediatePriority,uI=as.unstable_UserBlockingPriority,b0=as.unstable_NormalPriority,_6=as.unstable_LowPriority,dI=as.unstable_IdlePriority,Jv=null,No=null;function w6(n){if(No&&typeof No.onCommitFiberRoot=="function")try{No.onCommitFiberRoot(Jv,n,void 0,(n.current.flags&128)===128)}catch{}}var eo=Math.clz32?Math.clz32:E6,b6=Math.log,S6=Math.LN2;function E6(n){return n>>>=0,n===0?32:31-(b6(n)/S6|0)|0}var Rg=64,Pg=4194304;function jf(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function S0(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=jf(a):(s&=o,s!==0&&(r=jf(s)))}else o=t&~i,o!==0?r=jf(o):s!==0&&(r=jf(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0<e;)t=31-eo(e),i=1<<t,r|=n[t],e&=~i;return r}function M6(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function A6(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-eo(s),a=1<<o,c=i[o];c===-1?(!(a&t)||a&r)&&(i[o]=M6(a,e)):c<=e&&(n.expiredLanes|=a),s&=~a}}function Ub(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function hI(){var n=Rg;return Rg<<=1,!(Rg&4194240)&&(Rg=64),n}function O_(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function im(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-eo(e),n[e]=t}function T6(n,e){var t=n.pendingLanes&~e;
vendor: 2,499 bytes, line 37
37n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0<t;){var i=31-eo(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function L2(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-eo(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var bn=0;function fI(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var pI,j2,mI,gI,xI,Bb=!1,Ig=[],bl=null,Sl=null,El=null,vp=new Map,yp=new Map,sl=[],C6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function $T(n,e){switch(n){case"focusin":case"focusout":bl=null;break;case"dragenter":case"dragleave":Sl=null;break;case"mouseover":case"mouseout":El=null;break;case"pointerover":case"pointerout":vp.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":yp.delete(e.pointerId)}}function cf(n,e,t,r,i,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=om(e),e!==null&&j2(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function N6(n,e,t,r,i){switch(e){case"focusin":return bl=cf(bl,n,e,t,r,i),!0;case"dragenter":return Sl=cf(Sl,n,e,t,r,i),!0;case"mouseover":return El=cf(El,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return vp.set(s,cf(vp.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,yp.set(s,cf(yp.get(s)||null,n,e,t,r,i)),!0}return!1}function vI(n){var e=Nc(n.target);if(e!==null){var t=gu(e);if(t!==null){if(e=t.tag,e===13){if(e=oI(t),e!==null){n.blockedOn=e,xI(n.priority,function(){mI(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function qx(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=zb(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);kb=r,t.target.dispatchEvent(r),kb=null}else return e=om(t),e!==null&&j2(e),n.blockedOn=t,!1;e.shift()}return!0}function XT(n,e,t){qx(n)&&t.delete(e)}function R6(){Bb=!1,bl!==null&&qx(bl)&&(bl=null),Sl!==null&&qx(Sl)&&(Sl=null),El!==null&&qx(El)&&(El=null),vp.forEach(XT),yp.forEac
vendor: 13,603 bytes, line 37
37h(XT)}function uf(n,e){n.blockedOn===e&&(n.blockedOn=null,Bb||(Bb=!0,as.unstable_scheduleCallback(as.unstable_NormalPriority,R6)))}function _p(n){function e(i){return uf(i,n)}if(0<Ig.length){uf(Ig[0],n);for(var t=1;t<Ig.length;t++){var r=Ig[t];r.blockedOn===n&&(r.blockedOn=null)}}for(bl!==null&&uf(bl,n),Sl!==null&&uf(Sl,n),El!==null&&uf(El,n),vp.forEach(e),yp.forEach(e),t=0;t<sl.length;t++)r=sl[t],r.blockedOn===n&&(r.blockedOn=null);for(;0<sl.length&&(t=sl[0],t.blockedOn===null);)vI(t),t.blockedOn===null&&sl.shift()}var Pd=Ia.ReactCurrentBatchConfig,E0=!0;function P6(n,e,t,r){var i=bn,s=Pd.transition;Pd.transition=null;try{bn=1,O2(n,e,t,r)}finally{bn=i,Pd.transition=s}}function I6(n,e,t,r){var i=bn,s=Pd.transition;Pd.transition=null;try{bn=4,O2(n,e,t,r)}finally{bn=i,Pd.transition=s}}function O2(n,e,t,r){if(E0){var i=zb(n,e,t,r);if(i===null)q_(n,e,r,M0,t),$T(n,r);else if(N6(i,n,e,t,r))r.stopPropagation();else if($T(n,r),e&4&&-1<C6.indexOf(n)){for(;i!==null;){var s=om(i);if(s!==null&&pI(s),s=zb(n,e,t,r),s===null&&q_(n,e,r,M0,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else q_(n,e,r,null,t)}}var M0=null;function zb(n,e,t,r){if(M0=null,n=D2(r),n=Nc(n),n!==null)if(e=gu(n),e===null)n=null;else if(t=e.tag,t===13){if(n=oI(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return M0=n,null}function yI(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(y6()){case k2:return 1;case uI:return 4;case b0:case _6:return 16;case dI:return 536870912;default:return 16}default:return 16}}var vl=null,U2=null,Yx=null;function _I(){if(Yx)return Yx;var n,e=U2,t=e.length,r,i="value"in vl?vl.value:vl.textContent,s=i.length;for(n=0;n<t&&e[n]===i[n];n++);var o=t-n;for(r=1;r<=o&&e[t-r]===i[s-r];r++);return Yx=i.slice(n,1<r?1-r:void 0)}function Kx(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function Fg(){return!0}function qT(){return!1}function ds(n){function e(t,r,i,s,o){this._reactName=t,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Fg:qT,this.isPropagationStopped=qT,this}return Vn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=Fg)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=Fg)},persist:function(){},isPersistent:Fg}),e}var Ch={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},B2=ds(Ch),sm=Vn({},Ch,{view:0,detail:0}),F6=ds(sm),U_,B_,df,ey=Vn({},sm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:z2,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==df&&(df&&n.type==="mousemove"?(U_=n.screenX-df.screenX,B_=n.screenY-df.screenY):B_=U_=0,df=n),U_)},movementY:function(n){return"movementY"in n?n.movementY:B_}}),YT=ds(ey),D6=Vn({},ey,{dataTransfer:0}),k6=ds(D6),L6=Vn({},sm,{relatedTarget:0}),z_=ds(L6),j6=Vn({},Ch,{animationName:0,elapsedTime:0,pseudoElement:0}),O6=ds(j6),U6=Vn({},Ch,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),B6=ds(U6),z6=Vn({},Ch,{data:0}),KT=ds(z6),V6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},H6={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},W6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function G6(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=W6[n])?!!e[n]:!1}function z2(){return G6}var $6=Vn({},sm,{key:function(n){if(n.key){var e=V6[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Kx(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?H6[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:z2,charCode:function(n){return n.type==="keypress"?Kx(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Kx(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),X6=ds($6),q6=Vn({},ey,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ZT=ds(q6),Y6=Vn({},sm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:z2}),K6=ds(Y6),Z6=Vn({},Ch,{propertyName:0,elapsedTime:0,pseudoElement:0}),Q6=ds(Z6),J6=Vn({},ey,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),eB=ds(J6),tB=[9,13,27,32],V2=wa&&"CompositionEvent"in window,Yf=null;wa&&"documentMode"in document&&(Yf=document.documentMode);var nB=wa&&"TextEvent"in window&&!Yf,wI=wa&&(!V2||Yf&&8<Yf&&11>=Yf),QT=" ",JT=!1;function bI(n,e){switch(n){case"keyup":return tB.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function SI(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var fd=!1;function rB(n,e){switch(n){case"compositionend":return SI(e);case"keypress":return e.which!==32?null:(JT=!0,QT);case"textInput":return n=e.data,n===QT&&JT?null:n;default:return null}}function iB(n,e){if(fd)return n==="compositionend"||!V2&&bI(n,e)?(n=_I(),Yx=U2=vl=null,fd=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return wI&&e.locale!=="ko"?null:e.data;default:return null}}var sB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function eC(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!sB[n.type]:e==="textarea"}function EI(n,e,t,r){tI(r),e=A0(e,"onChange"),0<e.length&&(t=new B2("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var Kf=null,wp=null;function oB(n){kI(n,0)}function ty(n){var e=gd(n);if(qP(e))return n}function aB(n,e){if(n==="change")return e}var MI=!1;if(wa){var V_;if(wa){var H_="oninput"in document;if(!H_){var tC=document.createElement("div");tC.setAttribute("oninput","return;"),H_=typeof tC.oninput=="function"}V_=H_}else V_=!1;MI=V_&&(!document.documentMode||9<document.documentMode)}function nC(){Kf&&(Kf.detachEvent("onpropertychange",AI),wp=Kf=null)}function AI(n){if(n.propertyName==="value"&&ty(wp)){var e=[];EI(e,wp,n,D2(n)),sI(oB,e)}}function lB(n,e,t){n==="focusin"?(nC(),Kf=e,wp=t,Kf.attachEvent("onpropertychange",AI)):n==="focusout"&&nC()}function cB(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ty(wp)}function uB(n,e){if(n==="click")return ty(e)}function dB(n,e){if(n==="input"||n==="change")return ty(e)}function hB(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var no=typeof Object.is=="function"?Object.is:hB;function bp(n,e){if(no(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var i=t[r];if(!Sb.call(e,i)||!no(n[i],e[i]))return!1}return!0}function rC(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function iC(n,e){var t=rC(n);n=0;for(var r;t;){if(t.nodeType===3){if(r=n+t.textContent.length,n<=e&&r>=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=rC(t)}}function TI(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?TI(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function CI(){for(var n=window,e=y0();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=y0(n.document)}return e}function H2(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function fB(n){var e=CI(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&TI(t.ownerDocument.documentElement,t)){if(r!==null&&H2(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=iC(t,s);var o=iC(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var pB=wa&&"documentMode"in document&&11>=document.documentMode,pd=null,Vb=null,Zf=null,Hb=!1;function sC(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;Hb||pd==null||pd!==y0(r)||(r=pd,"selectionStart"in r&&H2(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}),Zf&&bp(Zf,r)||(Zf=r,r=A0(Vb,"onSelect"),0<r.length&&(e=new B2("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=pd)))}function Dg(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var md={animationend:Dg("Animation","AnimationEnd"),animationiteration:Dg("Animation","AnimationIteration"),animationstart:Dg("Animation","AnimationStart"),transitionend:Dg("Transition","TransitionEnd")},W_={},NI={};wa&&(NI=document.createElement("div").style,"AnimationEvent"in window||(delete md.animationend.animation,delete md.animationiteration.animation,delete md.animationstart.animation),"TransitionEvent"in window||delete md.transitionend.transition);function ny(n){if(W_[n])return W_[n];if(!md[n])return n;var e=md[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in NI)return W_[n]=e[t];return n}var RI=ny("animationend"),PI=ny("animationiteration"),II=ny("animationstart"),FI=ny("transitionend"),DI=new Map,oC="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Vl(n,e){DI.set(n,e),mu(e,[n])}for(var G_=0;G_<oC.length;G_++){var $_=oC[G_],mB=$_.toLowerCase(),gB=$_[0].toUpperCase()+$_.slice(1);
vendor: 5,251 bytes, line 37
37Vl(mB,"on"+gB)}Vl(RI,"onAnimationEnd");Vl(PI,"onAnimationIteration");Vl(II,"onAnimationStart");Vl("dblclick","onDoubleClick");Vl("focusin","onFocus");Vl("focusout","onBlur");Vl(FI,"onTransitionEnd");nh("onMouseEnter",["mouseout","mouseover"]);nh("onMouseLeave",["mouseout","mouseover"]);nh("onPointerEnter",["pointerout","pointerover"]);nh("onPointerLeave",["pointerout","pointerover"]);mu("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));mu("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mu("onBeforeInput",["compositionend","keypress","textInput","paste"]);mu("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mu("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mu("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Of="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xB=new Set("cancel close invalid load scroll toggle".split(" ").concat(Of));function aC(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,m6(r,e,void 0,n),n.currentTarget=null}function kI(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var r=n[t],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==s&&i.isPropagationStopped())break e;aC(i,a,u),s=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,u=a.currentTarget,a=a.listener,c!==s&&i.isPropagationStopped())break e;aC(i,a,u),s=c}}}if(w0)throw n=Ob,w0=!1,Ob=null,n}function Pn(n,e){var t=e[qb];t===void 0&&(t=e[qb]=new Set);var r=n+"__bubble";t.has(r)||(LI(e,n,2,!1),t.add(r))}function X_(n,e,t){var r=0;e&&(r|=4),LI(t,n,r,e)}var kg="_reactListening"+Math.random().toString(36).slice(2);function Sp(n){if(!n[kg]){n[kg]=!0,HP.forEach(function(t){t!=="selectionchange"&&(xB.has(t)||X_(t,!1,n),X_(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[kg]||(e[kg]=!0,X_("selectionchange",!1,e))}}function LI(n,e,t,r){switch(yI(e)){case 1:var i=P6;break;case 4:i=I6;break;default:i=O2}t=i.bind(null,e,t,n),i=void 0,!jb||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?n.addEventListener(e,t,{capture:!0,passive:i}):n.addEventListener(e,t,!0):i!==void 0?n.addEventListener(e,t,{passive:i}):n.addEventListener(e,t,!1)}function q_(n,e,t,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Nc(a),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}a=a.parentNode}}r=r.return}sI(function(){var u=s,f=D2(t),p=[];e:{var m=DI.get(n);if(m!==void 0){var x=B2,v=n;switch(n){case"keypress":if(Kx(t)===0)break e;case"keydown":case"keyup":x=X6;break;case"focusin":v="focus",x=z_;break;case"focusout":v="blur",x=z_;break;case"beforeblur":case"afterblur":x=z_;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=YT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=k6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=K6;break;case RI:case PI:case II:x=O6;break;case FI:x=Q6;break;case"scroll":x=F6;break;case"wheel":x=eB;break;case"copy":case"cut":case"paste":x=B6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=ZT}var _=(e&4)!==0,y=!_&&n==="scroll",g=_?m!==null?m+"Capture":null:m;_=[];for(var b=u,S;b!==null;){S=b;var M=S.stateNode;if(S.tag===5&&M!==null&&(S=M,g!==null&&(M=xp(b,g),M!=null&&_.push(Ep(b,M,S)))),y)break;b=b.return}0<_.length&&(m=new x(m,v,null,t,f),p.push({event:m,listeners:_}))}}if(!(e&7)){e:{if(m=n==="mouseover"||n==="pointerover",x=n==="mouseout"||n==="pointerout",m&&t!==kb&&(v=t.relatedTarget||t.fromElement)&&(Nc(v)||v[ba]))break e;if((x||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,x?(v=t.relatedTarget||t.toElement,x=u,v=v?Nc(v):null,v!==null&&(y=gu(v),v!==y||v.tag!==5&&v.tag!==6)&&(v=null)):(x=null,v=u),x!==v)){if(_=YT,M="onMouseLeave",g="onMouseEnter",b="mouse",(n==="pointerout"||n==="pointerover")&&(_=ZT,M="onPointerLeave",g="onPointerEnter",b="pointer"),y=x==null?m:gd(x),S=v==null?m:gd(v),m=new _(M,b+"leave",x,t,f),m.target=y,m.relatedTarget=S,M=null,Nc(f)===u&&(_=new _(g,b+"enter",v,t,f),_.target=S,_.relatedTarget=y,M=_),y=M,x&&v)t:{for(_=x,g=v,b=0,S=_;S;S=ju(S))b++;for(S=0,M=g;M;M=ju(M))S++;for(;0<b-S;)_=ju(_),b--;for(;0<S-b;)g=ju(g),S--;for(;b--;){if(_===g||g!==null&&_===g.alternate)break t;_=ju(_),g=ju(g)}_=null}else _=null;x!==null&&lC(p,m,x,_,!1),v!==null&&y!==null&&lC(p,y,v,_,!0)}}
vendor: 8,353 bytes, lines 37-38
37e:{if(m=u?gd(u):window,x=m.nodeName&&m.nodeName.toLowerCase(),x==="select"||x==="input"&&m.type==="file")var A=aB;else if(eC(m))if(MI)A=dB;else{A=cB;var R=lB}else(x=m.nodeName)&&x.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(A=uB);if(A&&(A=A(n,u))){EI(p,A,t,f);break e}R&&R(n,m,u),n==="focusout"&&(R=m._wrapperState)&&R.controlled&&m.type==="number"&&Rb(m,"number",m.value)}switch(R=u?gd(u):window,n){case"focusin":(eC(R)||R.contentEditable==="true")&&(pd=R,Vb=u,Zf=null);break;case"focusout":Zf=Vb=pd=null;break;case"mousedown":Hb=!0;break;case"contextmenu":case"mouseup":case"dragend":Hb=!1,sC(p,t,f);break;case"selectionchange":if(pB)break;case"keydown":case"keyup":sC(p,t,f)}var F;if(V2)e:{switch(n){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else fd?bI(n,t)&&(L="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(L="onCompositionStart");L&&(wI&&t.locale!=="ko"&&(fd||L!=="onCompositionStart"?L==="onCompositionEnd"&&fd&&(F=_I()):(vl=f,U2="value"in vl?vl.value:vl.textContent,fd=!0)),R=A0(u,L),0<R.length&&(L=new KT(L,n,null,t,f),p.push({event:L,listeners:R}),F?L.data=F:(F=SI(t),F!==null&&(L.data=F)))),(F=nB?rB(n,t):iB(n,t))&&(u=A0(u,"onBeforeInput"),0<u.length&&(f=new KT("onBeforeInput","beforeinput",null,t,f),p.push({event:f,listeners:u}),f.data=F))}kI(p,e)})}function Ep(n,e,t){return{instance:n,listener:e,currentTarget:t}}function A0(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=xp(n,t),s!=null&&r.unshift(Ep(n,s,i)),s=xp(n,e),s!=null&&r.push(Ep(n,s,i))),n=n.return}return r}function ju(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function lC(n,e,t,r,i){for(var s=e._reactName,o=[];t!==null&&t!==r;){var a=t,c=a.alternate,u=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&u!==null&&(a=u,i?(c=xp(t,s),c!=null&&o.unshift(Ep(t,c,a))):i||(c=xp(t,s),c!=null&&o.push(Ep(t,c,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var vB=/\r\n?/g,yB=/\u0000|\uFFFD/g;function cC(n){return(typeof n=="string"?n:""+n).replace(vB,` 38`).replace(yB,"")}function Lg(n,e,t){if(e=cC(e),cC(n)!==e&&t)throw Error(ke(425))}function T0(){}var Wb=null,Gb=null;function $b(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Xb=typeof setTimeout=="function"?setTimeout:void 0,_B=typeof clearTimeout=="function"?clearTimeout:void 0,uC=typeof Promise=="function"?Promise:void 0,wB=typeof queueMicrotask=="function"?queueMicrotask:typeof uC<"u"?function(n){return uC.resolve(null).then(n).catch(bB)}:Xb;function bB(n){setTimeout(function(){throw n})}function Y_(n,e){var t=e,r=0;do{var i=t.nextSibling;if(n.removeChild(t),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(r===0){n.removeChild(i),_p(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);_p(e)}function Ml(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function dC(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var Nh=Math.random().toString(36).slice(2),Mo="__reactFiber$"+Nh,Mp="__reactProps$"+Nh,ba="__reactContainer$"+Nh,qb="__reactEvents$"+Nh,SB="__reactListeners$"+Nh,EB="__reactHandles$"+Nh;function Nc(n){var e=n[Mo];if(e)return e;for(var t=n.parentNode;t;){if(e=t[ba]||t[Mo]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=dC(n);n!==null;){if(t=n[Mo])return t;n=dC(n)}return e}n=t,t=n.parentNode}return null}function om(n){return n=n[Mo]||n[ba],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function gd(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(ke(33))}function ry(n){return n[Mp]||null}var Yb=[],xd=-1;function Hl(n){return{current:n}}function Fn(n){0>xd||(n.current=Yb[xd],Yb[xd]=null,xd--)}function Cn(n,e){xd++,Yb[xd]=n.current,n.current=e}var Fl={},ei=Hl(Fl),ji=Hl(!1),Kc=Fl;function rh(n,e){var t=n.type.contextTypes;if(!t)return Fl;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Oi(n){return n=n.childContextTypes,n!=null}function C0(){Fn(ji),Fn(ei)}function hC(n,e,t){if(ei.current!==Fl)throw Error(ke(168));Cn(ei,e),Cn(ji,t)}function jI(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(ke(108,l6(n)||"Unknown",i));return Vn({},t,r)}function N0(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Fl,Kc=ei.current,Cn(ei,n),Cn(ji,ji.current),!0}function fC(n,e,t){var r=n.stateNode;if(!r)throw Error(ke(169));t?(n=jI(n,e,Kc),r.__reactInternalMemoizedMergedChildContext=n,Fn(ji),Fn(ei),Cn(ei,n)):Fn(ji),Cn(ji,t)}var aa=null,iy=!1,K_=!1;function OI(n){aa===null?aa=[n]:aa.push(n)}function MB(n){iy=!0,OI(n)}function Wl(){if(!K_&&aa!==null){K_=!0;var n=0,e=bn;try{var t=aa;for(bn=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}aa=null,iy=!1}catch(i){throw aa!==null&&(aa=aa.slice(n+1)),cI(k2,Wl),i}finally{bn=e,K_=!1}}return null}var vd=[],yd=0,R0=null,P0=0,Es=[],Ms=0,Zc=null,ha=1,fa="";function bc(n,e){vd[yd++]=P0,vd[yd++]=R0,R0=n,P0=e}function UI(n,e,t){Es[Ms++]=ha,Es[Ms++]=fa,Es[Ms++]=Zc,Zc=n;var r=ha;n=fa;var i=32-eo(r)-1;r&=~(1<<i),t+=1;var s=32-eo(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ha=1<<32-eo(e)+i|t<<i|r,fa=s+n}else ha=1<<s|t<<i|r,fa=n}function W2(n){n.return!==null&&(bc(n,1),UI(n,1,0))}function G2(n){for(;n===R0;)R0=vd[--yd],vd[yd]=null,P0=vd[--yd],vd[yd]=null;for(;n===Zc;)Zc=Es[--Ms],Es[Ms]=null,fa=Es[--Ms],Es[Ms]=null,ha=Es[--Ms],Es[Ms]=null}var is=null,rs=null,Ln=!1,qs=null;function BI(n,e){var t=Cs(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function pC(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,is=n,rs=Ml(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,is=n,rs=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=Zc!==null?{id:ha,overflow:fa}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=Cs(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,is=n,rs=null,!0):!1;default:return!1}}function Kb(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Zb(n){if(Ln){var e=rs;if(e){var t=e;if(!pC(n,e)){if(Kb(n))throw Error(ke(418));e=Ml(t.nextSibling);var r=is;e&&pC(n,e)?BI(r,t):(n.flags=n.flags&-4097|2,Ln=!1,is=n)}}else{if(Kb(n))throw Error(ke(418));n.flags=n.flags&-4097|2,Ln=!1,is=n}}}function mC(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;is=n}function jg(n){if(n!==is)return!1;if(!Ln)return mC(n),Ln=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!$b(n.type,n.memoizedProps)),e&&(e=rs)){if(Kb(n))throw zI(),Error(ke(418));for(;e;)BI(n,e),e=Ml(e.nextSibling)}if(mC(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(ke(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){rs=Ml(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}rs=null}}else rs=is?Ml(n.stateNode.nextSibling):null;return!0}function zI(){for(var n=rs;n;)n=Ml(n.nextSibling)}function ih(){rs=is=null,Ln=!1}function $2(n){qs===null?qs=[n]:qs.push(n)}var AB=Ia.ReactCurrentBatchConfig;function hf(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(ke(309));var r=t.stateNode}if(!r)throw Error(ke(147,n));var i=r,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}
vendor: 4,136 bytes, line 38
38if(typeof n!="string")throw Error(ke(284));if(!t._owner)throw Error(ke(290,n))}return n}function Og(n,e){throw n=Object.prototype.toString.call(e),Error(ke(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function gC(n){var e=n._init;return e(n._payload)}function VI(n){function e(g,b){if(n){var S=g.deletions;S===null?(g.deletions=[b],g.flags|=16):S.push(b)}}function t(g,b){if(!n)return null;for(;b!==null;)e(g,b),b=b.sibling;return null}function r(g,b){for(g=new Map;b!==null;)b.key!==null?g.set(b.key,b):g.set(b.index,b),b=b.sibling;return g}function i(g,b){return g=Nl(g,b),g.index=0,g.sibling=null,g}function s(g,b,S){return g.index=S,n?(S=g.alternate,S!==null?(S=S.index,S<b?(g.flags|=2,b):S):(g.flags|=2,b)):(g.flags|=1048576,b)}function o(g){return n&&g.alternate===null&&(g.flags|=2),g}function a(g,b,S,M){return b===null||b.tag!==6?(b=rw(S,g.mode,M),b.return=g,b):(b=i(b,S),b.return=g,b)}function c(g,b,S,M){var A=S.type;return A===hd?f(g,b,S.props.children,M,S.key):b!==null&&(b.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===nl&&gC(A)===b.type)?(M=i(b,S.props),M.ref=hf(g,b,S),M.return=g,M):(M=r0(S.type,S.key,S.props,null,g.mode,M),M.ref=hf(g,b,S),M.return=g,M)}function u(g,b,S,M){return b===null||b.tag!==4||b.stateNode.containerInfo!==S.containerInfo||b.stateNode.implementation!==S.implementation?(b=iw(S,g.mode,M),b.return=g,b):(b=i(b,S.children||[]),b.return=g,b)}function f(g,b,S,M,A){return b===null||b.tag!==7?(b=Wc(S,g.mode,M,A),b.return=g,b):(b=i(b,S),b.return=g,b)}function p(g,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return b=rw(""+b,g.mode,S),b.return=g,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Tg:return S=r0(b.type,b.key,b.props,null,g.mode,S),S.ref=hf(g,null,b),S.return=g,S;case dd:return b=iw(b,g.mode,S),b.return=g,b;case nl:var M=b._init;return p(g,M(b._payload),S)}if(Lf(b)||af(b))return b=Wc(b,g.mode,S,null),b.return=g,b;Og(g,b)}return null}function m(g,b,S,M){var A=b!==null?b.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return A!==null?null:a(g,b,""+S,M);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Tg:return S.key===A?c(g,b,S,M):null;case dd:return S.key===A?u(g,b,S,M):null;case nl:return A=S._init,m(g,b,A(S._payload),M)}if(Lf(S)||af(S))return A!==null?null:f(g,b,S,M,null);Og(g,S)}return null}function x(g,b,S,M,A){if(typeof M=="string"&&M!==""||typeof M=="number")return g=g.get(S)||null,a(b,g,""+M,A);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case Tg:return g=g.get(M.key===null?S:M.key)||null,c(b,g,M,A);case dd:return g=g.get(M.key===null?S:M.key)||null,u(b,g,M,A);case nl:var R=M._init;return x(g,b,S,R(M._payload),A)}if(Lf(M)||af(M))return g=g.get(S)||null,f(b,g,M,A,null);Og(b,M)}return null}function v(g,b,S,M){for(var A=null,R=null,F=b,L=b=0,N=null;F!==null&&L<S.length;L++){F.index>L?(N=F,F=null):N=F.sibling;var I=m(g,F,S[L],M);if(I===null){F===null&&(F=N);break}n&&F&&I.alternate===null&&e(g,F),b=s(I,b,L),R===null?A=I:R.sibling=I,R=I,F=N}if(L===S.length)return t(g,F),Ln&&bc(g,L),A;if(F===null){for(;L<S.length;L++)F=p(g,S[L],M),F!==null&&(b=s(F,b,L),R===null?A=F:R.sibling=F,R=F);return Ln&&bc(g,L),A}for(F=r(g,F);L<S.length;L++)N=x(F,g,L,S[L],M),N!==null&&(n&&N.alternate!==null&&F.delete(N.key===null?L:N.key),b=s(N,b,L),R===null?A=N:R.sibling=N,R=N);return n&&F.forEach(function(D){return e(g,D)}),Ln&&bc(g,L),A}function _(g,b,S,M){var A=af(S);if(typeof A!="function")throw Error(ke(150));if(S=A.call(S),S==null)throw Error(ke(151));for(var R=A=null,F=b,L=b=0,N=null,I=S.next();F!==null&&!I.done;L++,I=S.next()){F.index>L?(N=F,F=null):N=F.sibling;var D=m(g,F,I.value,M);if(D===null){F===null&&(F=N);break}n&&F&&D.alternate===null&&e(g,F),b=s(D,b,L),R===null?A=D:R.sibling=D,R=D,F=N}if(I.done)return t(g,F),Ln&&bc(g,L),A;if(F===null){for(;!I.done;L++,I=S.next())I=p(g,I.value,M),I!==null&&(b=s(I,b,L),R===null?A=I:R.sibling=I,R=I);return Ln&&bc(g,L),A}for(F=r(g,F);!I.done;L++,I=S.next())I=x(F,g,L,I.value,M),I!==null&&(n&&I.alternate!==null&&F.delete(I.key===null?L:I.key),b=s(I,b,L),R===null?A=I:R.sibling=I,R=I);return n&&F.forEach(function(O){return e(g,O)}
vendor: 9,753 bytes, line 38
38),Ln&&bc(g,L),A}function y(g,b,S,M){if(typeof S=="object"&&S!==null&&S.type===hd&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Tg:e:{for(var A=S.key,R=b;R!==null;){if(R.key===A){if(A=S.type,A===hd){if(R.tag===7){t(g,R.sibling),b=i(R,S.props.children),b.return=g,g=b;break e}}else if(R.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===nl&&gC(A)===R.type){t(g,R.sibling),b=i(R,S.props),b.ref=hf(g,R,S),b.return=g,g=b;break e}t(g,R);break}else e(g,R);R=R.sibling}S.type===hd?(b=Wc(S.props.children,g.mode,M,S.key),b.return=g,g=b):(M=r0(S.type,S.key,S.props,null,g.mode,M),M.ref=hf(g,b,S),M.return=g,g=M)}return o(g);case dd:e:{for(R=S.key;b!==null;){if(b.key===R)if(b.tag===4&&b.stateNode.containerInfo===S.containerInfo&&b.stateNode.implementation===S.implementation){t(g,b.sibling),b=i(b,S.children||[]),b.return=g,g=b;break e}else{t(g,b);break}else e(g,b);b=b.sibling}b=iw(S,g.mode,M),b.return=g,g=b}return o(g);case nl:return R=S._init,y(g,b,R(S._payload),M)}if(Lf(S))return v(g,b,S,M);if(af(S))return _(g,b,S,M);Og(g,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,b!==null&&b.tag===6?(t(g,b.sibling),b=i(b,S),b.return=g,g=b):(t(g,b),b=rw(S,g.mode,M),b.return=g,g=b),o(g)):t(g,b)}return y}var sh=VI(!0),HI=VI(!1),I0=Hl(null),F0=null,_d=null,X2=null;function q2(){X2=_d=F0=null}function Y2(n){var e=I0.current;Fn(I0),n._currentValue=e}function Qb(n,e,t){for(;n!==null;){var r=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),n===t)break;n=n.return}}function Id(n,e){F0=n,X2=_d=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(ki=!0),n.firstContext=null)}function Is(n){var e=n._currentValue;if(X2!==n)if(n={context:n,memoizedValue:e,next:null},_d===null){if(F0===null)throw Error(ke(308));_d=n,F0.dependencies={lanes:0,firstContext:n}}else _d=_d.next=n;return e}var Rc=null;function K2(n){Rc===null?Rc=[n]:Rc.push(n)}function WI(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,K2(e)):(t.next=i.next,i.next=t),e.interleaved=t,Sa(n,r)}function Sa(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var rl=!1;function Z2(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function GI(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function ga(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Al(n,e,t){var r=n.updateQueue;if(r===null)return null;if(r=r.shared,un&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Sa(n,t)}return i=r.interleaved,i===null?(e.next=e,K2(r)):(e.next=i.next,i.next=e),r.interleaved=e,Sa(n,t)}function Zx(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,L2(n,t)}}function xC(n,e){var t=n.updateQueue,r=n.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var i=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?i=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?i=s=e:s=s.next=e}else i=s=e;t={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function D0(n,e,t,r){var i=n.updateQueue;rl=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var f=n.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=c))}if(s!==null){var p=i.baseState;o=0,f=u=c=null,a=s;do{var m=a.lane,x=a.eventTime;if((r&m)===m){f!==null&&(f=f.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=n,_=a;switch(m=e,x=t,_.tag){case 1:if(v=_.payload,typeof v=="function"){p=v.call(x,p,m);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=_.payload,m=typeof v=="function"?v.call(x,p,m):v,m==null)break e;p=Vn({},p,m);break e;case 2:rl=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,m=i.effects,m===null?i.effects=[a]:m.push(a))}else x={eventTime:x,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(u=f=x,c=p):f=f.next=x,o|=m;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;m=a,a=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(f===null&&(c=p),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Jc|=o,n.lanes=o,n.memoizedState=p}}function vC(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var r=n[e],i=r.callback;if(i!==null){if(r.callback=null,r=t,typeof i!="function")throw Error(ke(191,i));i.call(r)}}}var am={},Ro=Hl(am),Ap=Hl(am),Tp=Hl(am);function Pc(n){if(n===am)throw Error(ke(174));return n}function Q2(n,e){switch(Cn(Tp,e),Cn(Ap,n),Cn(Ro,am),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Ib(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=Ib(e,n)}Fn(Ro),Cn(Ro,e)}function oh(){Fn(Ro),Fn(Ap),Fn(Tp)}function $I(n){Pc(Tp.current);var e=Pc(Ro.current),t=Ib(e,n.type);e!==t&&(Cn(Ap,n),Cn(Ro,t))}function J2(n){Ap.current===n&&(Fn(Ro),Fn(Ap))}var On=Hl(0);function k0(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Z_=[];function eE(){for(var n=0;n<Z_.length;n++)Z_[n]._workInProgressVersionPrimary=null;Z_.length=0}var Qx=Ia.ReactCurrentDispatcher,Q_=Ia.ReactCurrentBatchConfig,Qc=0,zn=null,pr=null,Tr=null,L0=!1,Qf=!1,Cp=0,TB=0;function Wr(){throw Error(ke(321))}function tE(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!no(n[t],e[t]))return!1;return!0}function nE(n,e,t,r,i,s){if(Qc=s,zn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Qx.current=n===null||n.memoizedState===null?PB:IB,n=t(r,i),Qf){s=0;do{if(Qf=!1,Cp=0,25<=s)throw Error(ke(301));s+=1,Tr=pr=null,e.updateQueue=null,Qx.current=FB,n=t(r,i)}while(Qf)}if(Qx.current=j0,e=pr!==null&&pr.next!==null,Qc=0,Tr=pr=zn=null,L0=!1,e)throw Error(ke(300));return n}function rE(){var n=Cp!==0;return Cp=0,n}function _o(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tr===null?zn.memoizedState=Tr=n:Tr=Tr.next=n,Tr}function Fs(){if(pr===null){var n=zn.alternate;n=n!==null?n.memoizedState:null}else n=pr.next;var e=Tr===null?zn.memoizedState:Tr.next;if(e!==null)Tr=e,pr=n;else{if(n===null)throw Error(ke(310));pr=n,n={memoizedState:pr.memoizedState,baseState:pr.baseState,baseQueue:pr.baseQueue,queue:pr.queue,next:null},Tr===null?zn.memoizedState=Tr=n:Tr=Tr.next=n}return Tr}function Np(n,e){return typeof e=="function"?e(n):e}function J_(n){var e=Fs(),t=e.queue;if(t===null)throw Error(ke(311));t.lastRenderedReducer=n;var r=pr,i=r.baseQueue,s=t.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,t.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,c=null,u=s;do{var f=u.lane;if((Qc&f)===f)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:n(r,u.action);else{var p={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=p,o=r):c=c.next=p,zn.lanes|=f,Jc|=f}u=u.next}while(u!==null&&u!==s);c===null?o=r:c.next=a,no(r,e.memoizedState)||(ki=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=c,t.lastRenderedState=r}if(n=t.interleaved,n!==null){i=n;do s=i.lane,zn.lanes|=s,Jc|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function ew(n){var e=Fs(),t=e.queue;if(t===null)throw Error(ke(311));t.lastRenderedReducer=n;var r=t.dispatch,i=t.pending,s=e.memoizedState;if(i!==null){t.pending=null;var o=i=i.next;do s=n(s,o.action),o=o.next;while(o!==i);no(s,e.memoizedState)||(ki=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function XI(){}function qI(n,e){var t=zn,r=Fs(),i=e(),s=!no(r.memoizedState,i);if(s&&(r.memoizedState=i,ki=!0),r=r.queue,iE(ZI.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||Tr!==null&&Tr.memoizedState.tag&1){if(t.flags|=2048,Rp(9,KI.bind(null,t,r,i,e),void 0,null),Cr===null)throw Error(ke(349));Qc&30||YI(t,e,i)}return i}function YI(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=zn.updateQueue,e===null?(e={lastEffect:null,stores:null},zn.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function KI(n,e,t,r){e.value=t,e.getSnapshot=r,QI(e)&&JI(n)}function ZI(n,e,t){return t(function(){QI(e)&&JI(n)})}function QI(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!no(n,t)}catch{return!0}}function JI(n){var e=Sa(n,1);e!==null&&to(e,n,1,-1)}function yC(n){var e=_o();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Np,lastRenderedState:n}
vendor: 5,026 bytes, line 38
38,e.queue=n,n=n.dispatch=RB.bind(null,zn,n),[e.memoizedState,n]}function Rp(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=zn.updateQueue,e===null?(e={lastEffect:null,stores:null},zn.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(r=t.next,t.next=n,n.next=r,e.lastEffect=n)),n}function e4(){return Fs().memoizedState}function Jx(n,e,t,r){var i=_o();zn.flags|=n,i.memoizedState=Rp(1|e,t,void 0,r===void 0?null:r)}function sy(n,e,t,r){var i=Fs();r=r===void 0?null:r;var s=void 0;if(pr!==null){var o=pr.memoizedState;if(s=o.destroy,r!==null&&tE(r,o.deps)){i.memoizedState=Rp(e,t,s,r);return}}zn.flags|=n,i.memoizedState=Rp(1|e,t,s,r)}function _C(n,e){return Jx(8390656,8,n,e)}function iE(n,e){return sy(2048,8,n,e)}function t4(n,e){return sy(4,2,n,e)}function n4(n,e){return sy(4,4,n,e)}function r4(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function i4(n,e,t){return t=t!=null?t.concat([n]):null,sy(4,4,r4.bind(null,e,n),t)}function sE(){}function s4(n,e){var t=Fs();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&tE(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function o4(n,e){var t=Fs();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&tE(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function a4(n,e,t){return Qc&21?(no(t,e)||(t=hI(),zn.lanes|=t,Jc|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,ki=!0),n.memoizedState=t)}function CB(n,e){var t=bn;bn=t!==0&&4>t?t:4,n(!0);var r=Q_.transition;Q_.transition={};try{n(!1),e()}finally{bn=t,Q_.transition=r}}function l4(){return Fs().memoizedState}function NB(n,e,t){var r=Cl(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},c4(n))u4(e,t);else if(t=WI(n,e,t,r),t!==null){var i=pi();to(t,n,r,i),d4(t,e,r)}}function RB(n,e,t){var r=Cl(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(c4(n))u4(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,no(a,o)){var c=e.interleaved;c===null?(i.next=i,K2(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}t=WI(n,e,i,r),t!==null&&(i=pi(),to(t,n,r,i),d4(t,e,r))}}function c4(n){var e=n.alternate;return n===zn||e!==null&&e===zn}function u4(n,e){Qf=L0=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function d4(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,L2(n,t)}}var j0={readContext:Is,useCallback:Wr,useContext:Wr,useEffect:Wr,useImperativeHandle:Wr,useInsertionEffect:Wr,useLayoutEffect:Wr,useMemo:Wr,useReducer:Wr,useRef:Wr,useState:Wr,useDebugValue:Wr,useDeferredValue:Wr,useTransition:Wr,useMutableSource:Wr,useSyncExternalStore:Wr,useId:Wr,unstable_isNewReconciler:!1},PB={readContext:Is,useCallback:function(n,e){return _o().memoizedState=[n,e===void 0?null:e],n},useContext:Is,useEffect:_C,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Jx(4194308,4,r4.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Jx(4194308,4,n,e)},useInsertionEffect:function(n,e){return Jx(4,2,n,e)},useMemo:function(n,e){var t=_o();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=_o();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=NB.bind(null,zn,n),[r.memoizedState,n]},useRef:function(n){var e=_o();return n={current:n},e.memoizedState=n},useState:yC,useDebugValue:sE,useDeferredValue:function(n){return _o().memoizedState=n},useTransition:function(){var n=yC(!1),e=n[0];return n=CB.bind(null,n[1]),_o().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=zn,i=_o();if(Ln){if(t===void 0)throw Error(ke(407));t=t()}else{if(t=e(),Cr===null)throw Error(ke(349));Qc&30||YI(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,_C(ZI.bind(null,r,s,n),[n]),r.flags|=2048,Rp(9,KI.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=_o(),e=Cr.identifierPrefix;if(Ln){var t=fa,r=ha;t=(r&~(1<<32-eo(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=Cp++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=TB++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},IB={readContext:Is,useCallback:s4,useContext:Is,useEffect:iE,useImperativeHandle:i4,useInsertionEffect:t4,useLayoutEffect:n4,useMemo:o4,useReducer:J_,useRef:e4,useState:function(){return J_(Np)},useDebugValue:sE,useDeferredValue:function(n){var e=Fs();return a4(e,pr.memoizedState,n)},useTransition:function(){var n=J_(Np)[0],e=Fs().memoizedState;return[n,e]},useMutableSource:XI,useSyncExternalStore:qI,useId:l4,unstable_isNewReconciler:!1},FB={readContext:Is,useCallback:s4,useContext:Is,useEffect:iE,useImperativeHandle:i4,useInsertionEffect:t4,useLayoutEffect:n4,useMemo:o4,useReducer:ew,useRef
vendor: 5,969 bytes, lines 38-40
38:e4,useState:function(){return ew(Np)},useDebugValue:sE,useDeferredValue:function(n){var e=Fs();return pr===null?e.memoizedState=n:a4(e,pr.memoizedState,n)},useTransition:function(){var n=ew(Np)[0],e=Fs().memoizedState;return[n,e]},useMutableSource:XI,useSyncExternalStore:qI,useId:l4,unstable_isNewReconciler:!1};function Ws(n,e){if(n&&n.defaultProps){e=Vn({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}function Jb(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:Vn({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var oy={isMounted:function(n){return(n=n._reactInternals)?gu(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=pi(),i=Cl(n),s=ga(r,i);s.payload=e,t!=null&&(s.callback=t),e=Al(n,s,i),e!==null&&(to(e,n,i,r),Zx(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=pi(),i=Cl(n),s=ga(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Al(n,s,i),e!==null&&(to(e,n,i,r),Zx(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=pi(),r=Cl(n),i=ga(t,r);i.tag=2,e!=null&&(i.callback=e),e=Al(n,i,r),e!==null&&(to(e,n,r,t),Zx(e,n,r))}};function wC(n,e,t,r,i,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!bp(t,r)||!bp(i,s):!0}function h4(n,e,t){var r=!1,i=Fl,s=e.contextType;return typeof s=="object"&&s!==null?s=Is(s):(i=Oi(e)?Kc:ei.current,r=e.contextTypes,s=(r=r!=null)?rh(n,i):Fl),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=oy,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function bC(n,e,t,r){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,r),e.state!==n&&oy.enqueueReplaceState(e,e.state,null)}function eS(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs={},Z2(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Is(s):(s=Oi(e)?Kc:ei.current,i.context=rh(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Jb(n,e,s,t),i.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&oy.enqueueReplaceState(i,i.state,null),D0(n,t,i,r),i.state=n.memoizedState),typeof i.componentDidMount=="function"&&(n.flags|=4194308)}function ah(n,e){try{var t="",r=e;do t+=a6(r),r=r.return;while(r);var i=t}catch(s){i=` 39Error generating stack: `+s.message+` 40`+s.stack}return{value:n,source:e,stack:i,digest:null}}function tw(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function tS(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var DB=typeof WeakMap=="function"?WeakMap:Map;function f4(n,e,t){t=ga(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){U0||(U0=!0,dS=r),tS(n,e)},t}function p4(n,e,t){t=ga(-1,t),t.tag=3;var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;t.payload=function(){return r(i)},t.callback=function(){tS(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){tS(n,e),typeof r!="function"&&(Tl===null?Tl=new Set([this]):Tl.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function SC(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new DB;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(t)||(i.add(t),n=qB.bind(null,n,e,t),e.then(n,n))}function EC(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function MC(n,e,t,r,i){return n.mode&1?(n.flags|=65536,n.lanes=i,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=ga(-1,1),e.tag=2,Al(t,e,1))),t.lanes|=1),n)}var kB=Ia.ReactCurrentOwner,ki=!1;function di(n,e,t,r){e.child=n===null?HI(e,null,t,r):sh(e,n.child,t,r)}function AC(n,e,t,r,i){t=t.render;var s=e.ref;return Id(e,i),r=nE(n,e,t,r,s,i),t=rE(),n!==null&&!ki?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,Ea(n,e,i)):(Ln&&t&&W2(e),e.flags|=1,di(n,e,r,i),e.child)}function TC(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!fE(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,m4(n,e,s,r,i)):(n=r0(t.type,null,r,e,e.mode,i),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&i)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:bp,t(o,r)&&n.ref===e.ref)return Ea(n,e,i)}return e.flags|=1,n=Nl(s,r),n.ref=e.ref,n.return=e,e.child=n}function m4(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(bp(s,r)&&n.ref===e.ref)if(ki=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(ki=!0);else return e.lanes=n.lanes,Ea(n,e,i)}return nS(n,e,t,r,i)}function g4(n,e,t){var r=e.pendingProps,i=r.children,s=n!==null?n.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Cn(bd,Zi),Zi|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Cn(bd,Zi),Zi|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,Cn(bd,Zi),Zi|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,Cn(bd,Zi),Zi|=r;return di(n,e,i,t),e.child}function x4(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}
vendor: 8,515 bytes, line 40
40function nS(n,e,t,r,i){var s=Oi(t)?Kc:ei.current;return s=rh(e,s),Id(e,i),t=nE(n,e,t,r,s,i),r=rE(),n!==null&&!ki?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,Ea(n,e,i)):(Ln&&r&&W2(e),e.flags|=1,di(n,e,t,i),e.child)}function CC(n,e,t,r,i){if(Oi(t)){var s=!0;N0(e)}else s=!1;if(Id(e,i),e.stateNode===null)e0(n,e),h4(e,t,r),eS(e,t,r,i),r=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,u=t.contextType;typeof u=="object"&&u!==null?u=Is(u):(u=Oi(t)?Kc:ei.current,u=rh(e,u));var f=t.getDerivedStateFromProps,p=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==u)&&bC(e,o,r,u),rl=!1;var m=e.memoizedState;o.state=m,D0(e,r,o,i),c=e.memoizedState,a!==r||m!==c||ji.current||rl?(typeof f=="function"&&(Jb(e,t,f,r),c=e.memoizedState),(a=rl||wC(e,t,a,r,m,c,u))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),o.props=r,o.state=c,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,GI(n,e),a=e.memoizedProps,u=e.type===e.elementType?a:Ws(e.type,a),o.props=u,p=e.pendingProps,m=o.context,c=t.contextType,typeof c=="object"&&c!==null?c=Is(c):(c=Oi(t)?Kc:ei.current,c=rh(e,c));var x=t.getDerivedStateFromProps;(f=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==p||m!==c)&&bC(e,o,r,c),rl=!1,m=e.memoizedState,o.state=m,D0(e,r,o,i);var v=e.memoizedState;a!==p||m!==v||ji.current||rl?(typeof x=="function"&&(Jb(e,t,x,r),v=e.memoizedState),(u=rl||wC(e,t,u,r,m,v,c)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&m===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&m===n.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),o.props=r,o.state=v,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&m===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&m===n.memoizedState||(e.flags|=1024),r=!1)}return rS(n,e,t,r,s,i)}function rS(n,e,t,r,i,s){x4(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&fC(e,t,!1),Ea(n,e,s);r=e.stateNode,kB.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=sh(e,n.child,null,s),e.child=sh(e,null,a,s)):di(n,e,a,s),e.memoizedState=r.state,i&&fC(e,t,!0),e.child}function v4(n){var e=n.stateNode;e.pendingContext?hC(n,e.pendingContext,e.pendingContext!==e.context):e.context&&hC(n,e.context,!1),Q2(n,e.containerInfo)}function NC(n,e,t,r,i){return ih(),$2(i),e.flags|=256,di(n,e,t,r),e.child}var iS={dehydrated:null,treeContext:null,retryLane:0};function sS(n){return{baseLanes:n,cachePool:null,transitions:null}}function y4(n,e,t){var r=e.pendingProps,i=On.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(i|=1),Cn(On,i&1),n===null)return Zb(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,n=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=cy(o,r,0,null),n=Wc(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=sS(t),e.memoizedState=iS,n):oE(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return LB(n,e,o,r,a,i,t);if(s){s=r.fallback,o=e.mode,i=n.child,a=i.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=Nl(i,c),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Nl(a,s):(s=Wc(s,o,t,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=n.child.memoizedState,o=o===null?sS(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=iS,r}return s=n.child,n=s.sibling,r=Nl(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=t),r.return=e,r.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=r,e.memoizedState=null,r}function oE(n,e){return e=cy({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function Ug(n,e,t,r){return r!==null&&$2(r),sh(e,n.child,null,t),n=oE(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function LB(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=tw(Error(ke(422))),Ug(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=cy({mode:"visible",children:r.children},i,0,null),s=Wc(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&sh(e,n.child,null,o),e.child.memoizedState=sS(o),e.memoizedState=iS,s);if(!(e.mode&1))return Ug(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(ke(419)),r=tw(s,r,void 0),Ug(n,e,o,r)}if(a=(o&n.childLanes)!==0,ki||a){if(r=Cr,r!==null){switch(o&-o){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|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Sa(n,i),to(r,n,i,-1))}return hE(),r=tw(Error(ke(421))),Ug(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=YB.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,rs=Ml(i.nextSibling),is=e,Ln=!0,qs=null,n!==null&&(Es[Ms++]=ha,Es[Ms++]=fa,Es[Ms++]=Zc,ha=n.id,fa=n.overflow,Zc=e),e=oE(e,r.children),e.flags|=4096,e)}function RC(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),Qb(n.return,e,t)}function nw(n,e,t,r,i){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=t,s.tailMode=i)}function _4(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(di(n,e,r.children,t),r=On.current,r&2)r=r&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&RC(n,t,e);else if(n.tag===19)RC(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}r&=1}if(Cn(On,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(t=e.child,i=null;t!==null;)n=t.alternate,n!==null&&k0(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),nw(e,!1,i,t,s);break;case"backwards":for(t=null,i=e.child,e.child=null;i!==null;){if(n=i.alternate,n!==null&&k0(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}nw(e,!0,t,null,s);break;case"together":nw(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function e0(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function Ea(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),Jc|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(ke(153));if(e.child!==null){for(n=e.child,t=Nl(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=Nl(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function jB(n,e,t){switch(e.tag){case 3:v4(e),ih();break;case 5:$I(e);break;case 1:Oi(e.type)&&N0(e);break;case 4:Q2(e,e.stateNode.containerInfo);break;
vendor: 4,414 bytes, line 40
40case 10:var r=e.type._context,i=e.memoizedProps.value;Cn(I0,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Cn(On,On.current&1),e.flags|=128,null):t&e.child.childLanes?y4(n,e,t):(Cn(On,On.current&1),n=Ea(n,e,t),n!==null?n.sibling:null);Cn(On,On.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return _4(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Cn(On,On.current),r)break;return null;case 22:case 23:return e.lanes=0,g4(n,e,t)}return Ea(n,e,t)}var w4,oS,b4,S4;w4=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};oS=function(){};b4=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Pc(Ro.current);var s=null;switch(t){case"input":i=Cb(n,i),r=Cb(n,r),s=[];break;case"select":i=Vn({},i,{value:void 0}),r=Vn({},r,{value:void 0}),s=[];break;case"textarea":i=Pb(n,i),r=Pb(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=T0)}Fb(t,r);var o;t=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(mp.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(t||(t={}),t[o]=c[o])}else t||(s||(s=[]),s.push(u,t)),t=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(mp.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Pn("scroll",n),s||a===c||(s=[])):(s=s||[]).push(u,c))}t&&(s=s||[]).push("style",t);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};S4=function(n,e,t,r){t!==r&&(e.flags|=4)};function ff(n,e){if(!Ln)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:r.sibling=null}}function Gr(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,r=0;if(e)for(var i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=n,i=i.sibling;else for(i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=n,i=i.sibling;return n.subtreeFlags|=r,n.childLanes=t,e}function OB(n,e,t){var r=e.pendingProps;switch(G2(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gr(e),null;case 1:return Oi(e.type)&&C0(),Gr(e),null;case 3:return r=e.stateNode,oh(),Fn(ji),Fn(ei),eE(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(jg(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,qs!==null&&(pS(qs),qs=null))),oS(n,e),Gr(e),null;case 5:J2(e);var i=Pc(Tp.current);if(t=e.type,n!==null&&e.stateNode!=null)b4(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(ke(166));return Gr(e),null}if(n=Pc(Ro.current),jg(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[Mo]=e,r[Mp]=s,n=(e.mode&1)!==0,t){case"dialog":Pn("cancel",r),Pn("close",r);break;case"iframe":case"object":case"embed":Pn("load",r);break;case"video":case"audio":for(i=0;i<Of.length;i++)Pn(Of[i],r);break;case"source":Pn("error",r);break;case"img":case"image":case"link":Pn("error",r),Pn("load",r);break;case"details":Pn("toggle",r);break;case"input":UT(r,s),Pn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Pn("invalid",r);break;case"textarea":zT(r,s),Pn("invalid",r)}Fb(t,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];
vendor: 31,373 bytes, line 40
40o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Lg(r.textContent,a,n),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Lg(r.textContent,a,n),i=["children",""+a]):mp.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Pn("scroll",r)}switch(t){case"input":Cg(r),BT(r,s,!0);break;case"textarea":Cg(r),VT(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=T0)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=ZP(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[Mo]=e,n[Mp]=r,w4(n,e,!1,!1),e.stateNode=n;e:{switch(o=Db(t,r),t){case"dialog":Pn("cancel",n),Pn("close",n),i=r;break;case"iframe":case"object":case"embed":Pn("load",n),i=r;break;case"video":case"audio":for(i=0;i<Of.length;i++)Pn(Of[i],n);i=r;break;case"source":Pn("error",n),i=r;break;case"img":case"image":case"link":Pn("error",n),Pn("load",n),i=r;break;case"details":Pn("toggle",n),i=r;break;case"input":UT(n,r),i=Cb(n,r),Pn("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=Vn({},r,{value:void 0}),Pn("invalid",n);break;case"textarea":zT(n,r),i=Pb(n,r),Pn("invalid",n);break;default:i=r}Fb(t,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var c=a[s];s==="style"?eI(n,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&QP(n,c)):s==="children"?typeof c=="string"?(t!=="textarea"||c!=="")&&gp(n,c):typeof c=="number"&&gp(n,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(mp.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Pn("scroll",n):c!=null&&R2(n,s,c,o))}switch(t){case"input":Cg(n),BT(n,r,!1);break;case"textarea":Cg(n),VT(n);break;case"option":r.value!=null&&n.setAttribute("value",""+Il(r.value));break;case"select":n.multiple=!!r.multiple,s=r.value,s!=null?Cd(n,!!r.multiple,s,!1):r.defaultValue!=null&&Cd(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=T0)}switch(t){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Gr(e),null;case 6:if(n&&e.stateNode!=null)S4(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(ke(166));if(t=Pc(Tp.current),Pc(Ro.current),jg(e)){if(r=e.stateNode,t=e.memoizedProps,r[Mo]=e,(s=r.nodeValue!==t)&&(n=is,n!==null))switch(n.tag){case 3:Lg(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Lg(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[Mo]=e,e.stateNode=r}return Gr(e),null;case 13:if(Fn(On),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Ln&&rs!==null&&e.mode&1&&!(e.flags&128))zI(),ih(),e.flags|=98560,s=!1;else if(s=jg(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(ke(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(ke(317));s[Mo]=e}else ih(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Gr(e),s=!1}else qs!==null&&(pS(qs),qs=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(r=r!==null,r!==(n!==null&&n.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(n===null||On.current&1?gr===0&&(gr=3):hE())),e.updateQueue!==null&&(e.flags|=4),Gr(e),null);case 4:return oh(),oS(n,e),n===null&&Sp(e.stateNode.containerInfo),Gr(e),null;case 10:return Y2(e.type._context),Gr(e),null;case 17:return Oi(e.type)&&C0(),Gr(e),null;case 19:if(Fn(On),s=e.memoizedState,s===null)return Gr(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)ff(s,!1);else{if(gr!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=k0(n),o!==null){for(e.flags|=128,ff(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=t,t=e.child;t!==null;)s=t,n=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Cn(On,On.current&1|2),e.child}n=n.sibling}s.tail!==null&&er()>lh&&(e.flags|=128,r=!0,ff(s,!1),e.lanes=4194304)}else{if(!r)if(n=k0(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),ff(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ln)return Gr(e),null}else 2*er()-s.renderingStartTime>lh&&t!==1073741824&&(e.flags|=128,r=!0,ff(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=er(),e.sibling=null,t=On.current,Cn(On,r?t&1|2:t&1),e):(Gr(e),null);case 22:case 23:return dE(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Zi&1073741824&&(Gr(e),e.subtreeFlags&6&&(e.flags|=8192)):Gr(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function UB(n,e){switch(G2(e),e.tag){case 1:return Oi(e.type)&&C0(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return oh(),Fn(ji),Fn(ei),eE(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return J2(e),null;case 13:if(Fn(On),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));ih()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Fn(On),null;case 4:return oh(),null;case 10:return Y2(e.type._context),null;case 22:case 23:return dE(),null;case 24:return null;default:return null}}var Bg=!1,Kr=!1,BB=typeof WeakSet=="function"?WeakSet:Set,ut=null;function wd(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){Xn(n,e,r)}else t.current=null}function aS(n,e,t){try{t()}catch(r){Xn(n,e,r)}}var PC=!1;function zB(n,e){if(Wb=E0,n=CI(),H2(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,c=-1,u=0,f=0,p=n,m=null;t:for(;;){for(var x;p!==t||i!==0&&p.nodeType!==3||(a=o+i),p!==s||r!==0&&p.nodeType!==3||(c=o+r),p.nodeType===3&&(o+=p.nodeValue.length),(x=p.firstChild)!==null;)m=p,p=x;for(;;){if(p===n)break t;if(m===t&&++u===i&&(a=o),m===s&&++f===r&&(c=o),(x=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=x}t=a===-1||c===-1?null:{start:a,end:c}}else t=null}t=t||{start:0,end:0}}else t=null;for(Gb={focusedElem:n,selectionRange:t},E0=!1,ut=e;ut!==null;)if(e=ut,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,ut=n;else for(;ut!==null;){e=ut;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var _=v.memoizedProps,y=v.memoizedState,g=e.stateNode,b=g.getSnapshotBeforeUpdate(e.elementType===e.type?_:Ws(e.type,_),y);g.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(M){Xn(e,e.return,M)}if(n=e.sibling,n!==null){n.return=e.return,ut=n;break}ut=e.return}return v=PC,PC=!1,v}function Jf(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&aS(e,t,s)}i=i.next}while(i!==r)}}function ay(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function lS(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function E4(n){var e=n.alternate;e!==null&&(n.alternate=null,E4(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Mo],delete e[Mp],delete e[qb],delete e[SB],delete e[EB])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function M4(n){return n.tag===5||n.tag===3||n.tag===4}function IC(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||M4(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function cS(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=T0));else if(r!==4&&(n=n.child,n!==null))for(cS(n,e,t),n=n.sibling;n!==null;)cS(n,e,t),n=n.sibling}function uS(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(uS(n,e,t),n=n.sibling;n!==null;)uS(n,e,t),n=n.sibling}var Fr=null,Xs=!1;function Wa(n,e,t){for(t=t.child;t!==null;)A4(n,e,t),t=t.sibling}function A4(n,e,t){if(No&&typeof No.onCommitFiberUnmount=="function")try{No.onCommitFiberUnmount(Jv,t)}catch{}switch(t.tag){case 5:Kr||wd(t,e);case 6:var r=Fr,i=Xs;Fr=null,Wa(n,e,t),Fr=r,Xs=i,Fr!==null&&(Xs?(n=Fr,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Fr.removeChild(t.stateNode));break;case 18:Fr!==null&&(Xs?(n=Fr,t=t.stateNode,n.nodeType===8?Y_(n.parentNode,t):n.nodeType===1&&Y_(n,t),_p(n)):Y_(Fr,t.stateNode));break;case 4:r=Fr,i=Xs,Fr=t.stateNode.containerInfo,Xs=!0,Wa(n,e,t),Fr=r,Xs=i;break;case 0:case 11:case 14:case 15:if(!Kr&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&aS(t,e,o),i=i.next}while(i!==r)}Wa(n,e,t);break;case 1:if(!Kr&&(wd(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){Xn(t,e,a)}Wa(n,e,t);break;case 21:Wa(n,e,t);break;case 22:t.mode&1?(Kr=(r=Kr)||t.memoizedState!==null,Wa(n,e,t),Kr=r):Wa(n,e,t);break;default:Wa(n,e,t)}}function FC(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new BB),e.forEach(function(r){var i=KB.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Us(n,e){var t=e.deletions;if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Fr=a.stateNode,Xs=!1;break e;case 3:Fr=a.stateNode.containerInfo,Xs=!0;break e;case 4:Fr=a.stateNode.containerInfo,Xs=!0;break e}a=a.return}if(Fr===null)throw Error(ke(160));A4(s,o,i),Fr=null,Xs=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Xn(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)T4(e,n),e=e.sibling}function T4(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Us(e,n),xo(n),r&4){try{Jf(3,n,n.return),ay(3,n)}catch(_){Xn(n,n.return,_)}try{Jf(5,n,n.return)}catch(_){Xn(n,n.return,_)}}break;case 1:Us(e,n),xo(n),r&512&&t!==null&&wd(t,t.return);break;case 5:if(Us(e,n),xo(n),r&512&&t!==null&&wd(t,t.return),n.flags&32){var i=n.stateNode;try{gp(i,"")}catch(_){Xn(n,n.return,_)}}if(r&4&&(i=n.stateNode,i!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,c=n.updateQueue;if(n.updateQueue=null,c!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&YP(i,s),Db(a,o);var u=Db(a,s);for(o=0;o<c.length;o+=2){var f=c[o],p=c[o+1];f==="style"?eI(i,p):f==="dangerouslySetInnerHTML"?QP(i,p):f==="children"?gp(i,p):R2(i,f,p,u)}switch(a){case"input":Nb(i,s);break;case"textarea":KP(i,s);break;case"select":var m=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var x=s.value;x!=null?Cd(i,!!s.multiple,x,!1):m!==!!s.multiple&&(s.defaultValue!=null?Cd(i,!!s.multiple,s.defaultValue,!0):Cd(i,!!s.multiple,s.multiple?[]:"",!1))}i[Mp]=s}catch(_){Xn(n,n.return,_)}}break;case 6:if(Us(e,n),xo(n),r&4){if(n.stateNode===null)throw Error(ke(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(_){Xn(n,n.return,_)}}break;case 3:if(Us(e,n),xo(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{_p(e.containerInfo)}catch(_){Xn(n,n.return,_)}break;case 4:Us(e,n),xo(n);break;case 13:Us(e,n),xo(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(cE=er())),r&4&&FC(n);break;case 22:if(f=t!==null&&t.memoizedState!==null,n.mode&1?(Kr=(u=Kr)||f,Us(e,n),Kr=u):Us(e,n),xo(n),r&8192){if(u=n.memoizedState!==null,(n.stateNode.isHidden=u)&&!f&&n.mode&1)for(ut=n,f=n.child;f!==null;){for(p=ut=f;ut!==null;){switch(m=ut,x=m.child,m.tag){case 0:case 11:case 14:case 15:Jf(4,m,m.return);break;case 1:wd(m,m.return);var v=m.stateNode;if(typeof v.componentWillUnmount=="function"){r=m,t=m.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(_){Xn(r,t,_)}}break;case 5:wd(m,m.return);break;case 22:if(m.memoizedState!==null){kC(p);continue}}x!==null?(x.return=m,ut=x):kC(p)}f=f.sibling}e:for(f=null,p=n;;){if(p.tag===5){if(f===null){f=p;try{i=p.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=p.stateNode,c=p.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=JP("display",o))}catch(_){Xn(n,n.return,_)}}}else if(p.tag===6){if(f===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(_){Xn(n,n.return,_)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===n)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===n)break e;for(;p.sibling===null;){if(p.return===null||p.return===n)break e;f===p&&(f=null),p=p.return}f===p&&(f=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Us(e,n),xo(n),r&4&&FC(n);break;case 21:break;default:Us(e,n),xo(n)}}function xo(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(M4(t)){var r=t;break e}t=t.return}throw Error(ke(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(gp(i,""),r.flags&=-33);var s=IC(n);uS(n,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=IC(n);cS(n,a,o);break;default:throw Error(ke(161))}}catch(c){Xn(n,n.return,c)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function VB(n,e,t){ut=n,C4(n)}function C4(n,e,t){for(var r=(n.mode&1)!==0;ut!==null;){var i=ut,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Bg;if(!o){var a=i.alternate,c=a!==null&&a.memoizedState!==null||Kr;a=Bg;var u=Kr;if(Bg=o,(Kr=c)&&!u)for(ut=i;ut!==null;)o=ut,c=o.child,o.tag===22&&o.memoizedState!==null?LC(i):c!==null?(c.return=o,ut=c):LC(i);for(;s!==null;)ut=s,C4(s),s=s.sibling;ut=i,Bg=a,Kr=u}DC(n)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ut=s):DC(n)}}function DC(n){for(;ut!==null;){var e=ut;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Kr||ay(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Kr)if(t===null)r.componentDidMount();else{var i=e.elementType===e.type?t.memoizedProps:Ws(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&vC(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}vC(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&t.focus();break;case"img":c.src&&(t.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var p=f.dehydrated;p!==null&&_p(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ke(163))}Kr||e.flags&512&&lS(e)}catch(m){Xn(e,e.return,m)}}if(e===n){ut=null;break}if(t=e.sibling,t!==null){t.return=e.return,ut=t;break}ut=e.return}}function kC(n){for(;ut!==null;){var e=ut;if(e===n){ut=null;break}var t=e.sibling;if(t!==null){t.return=e.return,ut=t;break}ut=e.return}}function LC(n){for(;ut!==null;){var e=ut;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{ay(4,e)}catch(c){Xn(e,t,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(c){Xn(e,i,c)}}var s=e.return;try{lS(e)}catch(c){Xn(e,s,c)}break;case 5:var o=e.return;try{lS(e)}catch(c){Xn(e,o,c)}}}catch(c){Xn(e,e.return,c)}if(e===n){ut=null;break}var a=e.sibling;if(a!==null){a.return=e.return,ut=a;break}ut=e.return}}var HB=Math.ceil,O0=Ia.ReactCurrentDispatcher,aE=Ia.ReactCurrentOwner,Ps=Ia.ReactCurrentBatchConfig,un=0,Cr=null,lr=null,kr=0,Zi=0,bd=Hl(0),gr=0,Pp=null,Jc=0,ly=0,lE=0,ep=null,Pi=null,cE=0,lh=1/0,oa=null,U0=!1,dS=null,Tl=null,zg=!1,yl=null,B0=0,tp=0,hS=null,t0=-1,n0=0;function pi(){return un&6?er():t0!==-1?t0:t0=er()}function Cl(n){return n.mode&1?un&2&&kr!==0?kr&-kr:AB.transition!==null?(n0===0&&(n0=hI()),n0):(n=bn,n!==0||(n=window.event,n=n===void 0?16:yI(n.type)),n):1}function to(n,e,t,r){if(50<tp)throw tp=0,hS=null,Error(ke(185));im(n,t,r),(!(un&2)||n!==Cr)&&(n===Cr&&(!(un&2)&&(ly|=t),gr===4&&ol(n,kr)),Ui(n,r),t===1&&un===0&&!(e.mode&1)&&(lh=er()+500,iy&&Wl()))}function Ui(n,e){var t=n.callbackNode;A6(n,e);var r=S0(n,n===Cr?kr:0);if(r===0)t!==null&>(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&>(t),e===1)n.tag===0?MB(jC.bind(null,n)):OI(jC.bind(null,n)),wB(function(){!(un&6)&&Wl()}),t=null;else{switch(fI(r)){case 1:t=k2;break;case 4:t=uI;break;case 16:t=b0;break;case 536870912:t=dI;break;default:t=b0}t=L4(t,N4.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function N4(n,e){if(t0=-1,n0=0,un&6)throw Error(ke(327));var t=n.callbackNode;if(Fd()&&n.callbackNode!==t)return null;var r=S0(n,n===Cr?kr:0);if(r===0)return null;if(r&30||r&n.expiredLanes||e)e=z0(n,r);else{e=r;var i=un;un|=2;var s=P4();(Cr!==n||kr!==e)&&(oa=null,lh=er()+500,Hc(n,e));do try{$B();break}catch(a){R4(n,a)}while(!0);q2(),O0.current=s,un=i,lr!==null?e=0:(Cr=null,kr=0,e=gr)}if(e!==0){if(e===2&&(i=Ub(n),i!==0&&(r=i,e=fS(n,i))),e===1)throw t=Pp,Hc(n,0),ol(n,r),Ui(n,er()),t;if(e===6)ol(n,r);else{if(i=n.current.alternate,!(r&30)&&!WB(i)&&(e=z0(n,r),e===2&&(s=Ub(n),s!==0&&(r=s,e=fS(n,s))),e===1))throw t=Pp,Hc(n,0),ol(n,r),Ui(n,er()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(ke(345));case 2:Sc(n,Pi,oa);break;case 3:if(ol(n,r),(r&130023424)===r&&(e=cE+500-er(),10<e)){if(S0(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){pi(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=Xb(Sc.bind(null,n,Pi,oa),e);break}Sc(n,Pi,oa);break;case 4:if(ol(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var o=31-eo(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=er()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*HB(r/1960))-r,10<r){n.timeoutHandle=Xb(Sc.bind(null,n,Pi,oa),r);break}Sc(n,Pi,oa);break;case 5:Sc(n,Pi,oa);break;default:throw Error(ke(329))}}}return Ui(n,er()),n.callbackNode===t?N4.bind(null,n):null}function fS(n,e){var t=ep;return n.current.memoizedState.isDehydrated&&(Hc(n,e).flags|=256),n=z0(n,e),n!==2&&(e=Pi,Pi=t,e!==null&&pS(e)),n}function pS(n){Pi===null?Pi=n:Pi.push.apply(Pi,n)}function WB(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var r=0;r<t.length;r++){var i=t[r],s=i.getSnapshot;i=i.value;try{if(!no(s(),i))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ol(n,e){for(e&=~lE,e&=~ly,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-eo(e),r=1<<t;n[t]=-1,e&=~r}}function jC(n){if(un&6)throw Error(ke(327));Fd();var e=S0(n,0);if(!(e&1))return Ui(n,er()),null;var t=z0(n,e);if(n.tag!==0&&t===2){var r=Ub(n);r!==0&&(e=r,t=fS(n,r))}if(t===1)throw t=Pp,Hc(n,0),ol(n,e),Ui(n,er()),t;if(t===6)throw Error(ke(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,Sc(n,Pi,oa),Ui(n,er()),null}function uE(n,e){var t=un;un|=1;try{return n(e)}finally{un=t,un===0&&(lh=er()+500,iy&&Wl())}}function eu(n){yl!==null&&yl.tag===0&&!(un&6)&&Fd();var e=un;un|=1;var t=Ps.transition,r=bn;try{if(Ps.transition=null,bn=1,n)return n()}finally{bn=r,Ps.transition=t,un=e,!(un&6)&&Wl()}}function dE(){Zi=bd.current,Fn(bd)}function Hc(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,_B(t)),lr!==null)for(t=lr.return;t!==null;){var r=t;switch(G2(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&C0();break;case 3:oh(),Fn(ji),Fn(ei),eE();break;case 5:J2(r);break;case 4:oh();break;case 13:Fn(On);break;case 19:Fn(On);break;case 10:Y2(r.type._context);break;case 22:case 23:dE()}t=t.return}if(Cr=n,lr=n=Nl(n.current,null),kr=Zi=e,gr=0,Pp=null,lE=ly=Jc=0,Pi=ep=null,Rc!==null){for(e=0;e<Rc.length;e++)if(t=Rc[e],r=t.interleaved,r!==null){t.interleaved=null;var i=r.next,s=t.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}t.pending=r}Rc=null}return n}function R4(n,e){do{var t=lr;try{if(q2(),Qx.current=j0,L0){for(var r=zn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}L0=!1}if(Qc=0,Tr=pr=zn=null,Qf=!1,Cp=0,aE.current=null,t===null||t.return===null){gr=1,Pp=e,lr=null;break}e:{var s=n,o=t.return,a=t,c=e;if(e=kr,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=a,p=f.tag;if(!(f.mode&1)&&(p===0||p===11||p===15)){var m=f.alternate;m?(f.updateQueue=m.updateQueue,f.memoizedState=m.memoizedState,f.lanes=m.lanes):(f.updateQueue=null,f.memoizedState=null)}var x=EC(o);if(x!==null){x.flags&=-257,MC(x,o,a,s,e),x.mode&1&&SC(s,u,e),e=x,c=u;var v=e.updateQueue;if(v===null){var _=new Set;_.add(c),e.updateQueue=_}else v.add(c);break e}else{if(!(e&1)){SC(s,u,e),hE();break e}c=Error(ke(426))}}else if(Ln&&a.mode&1){var y=EC(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),MC(y,o,a,s,e),$2(ah(c,a));break e}}s=c=ah(c,a),gr!==4&&(gr=2),ep===null?ep=[s]:ep.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var g=f4(s,c,e);xC(s,g);break e;case 1:a=c;var b=s.type,S=s.stateNode;if(!(s.flags&128)&&(typeof b.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Tl===null||!Tl.has(S)))){s.flags|=65536,e&=-e,s.lanes|=e;var M=p4(s,a,e);xC(s,M);break e}}s=s.return}while(s!==null)}F4(t)}catch(A){e=A,lr===t&&t!==null&&(lr=t=t.return);continue}break}while(!0)}function P4(){var n=O0.current;return O0.current=j0,n===null?j0:n}function hE(){(gr===0||gr===3||gr===2)&&(gr=4),Cr===null||!(Jc&268435455)&&!(ly&268435455)||ol(Cr,kr)}function z0(n,e){var t=un;un|=2;var r=P4();(Cr!==n||kr!==e)&&(oa=null,Hc(n,e));do try{GB();break}catch(i){R4(n,i)}while(!0);if(q2(),un=t,O0.current=r,lr!==null)throw Error(ke(261));return Cr=null,kr=0,gr}function GB(){for(;lr!==null;)I4(lr)}function $B(){for(;lr!==null&&!x6();)I4(lr)}function I4(n){var e=k4(n.alternate,n,Zi);n.memoizedProps=n.pendingProps,e===null?F4(n):lr=e,aE.current=null}function F4(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=UB(t,e),t!==null){t.flags&=32767,lr=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{gr=6,lr=null;return}}else if(t=OB(t,e,Zi),t!==null){lr=t;return}if(e=e.sibling,e!==null){lr=e;return}lr=e=n}while(e!==null);gr===0&&(gr=5)}function Sc(n,e,t){var r=bn,i=Ps.transition;try{Ps.transition=null,bn=1,XB(n,e,t,r)}finally{Ps.transition=i,bn=r}return null}function XB(n,e,t,r){do Fd();while(yl!==null);if(un&6)throw Error(ke(327));t=n.finishedWork;var i=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(ke(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(T6(n,s),n===Cr&&(lr=Cr=null,kr=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||zg||(zg=!0,L4(b0,function(){return Fd(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=Ps.transition,Ps.transition=null;var o=bn;bn=1;var a=un;un|=4,aE.current=null,zB(n,t),T4(t,n),fB(Gb),E0=!!Wb,Gb=Wb=null,n.current=t,VB(t),v6(),un=a,bn=o,Ps.transition=s}else n.current=t;if(zg&&(zg=!1,yl=n,B0=i),s=n.pendingLanes,s===0&&(Tl=null),w6(t.stateNode),Ui(n,er()),e!==null)for(r=n.onRecoverableError,t=0;t<e.length;t++)i=e[t],r(i.value,{componentStack:i.stack,digest:i.digest});if(U0)throw U0=!1,n=dS,dS=null,n;return B0&1&&n.tag!==0&&Fd(),s=n.pendingLanes,s&1?n===hS?tp++:(tp=0,hS=n):tp=0,Wl(),null}function Fd(){if(yl!==null){var n=fI(B0),e=Ps.transition,t=bn;try{if(Ps.transition=null,bn=16>n?16:n,yl===null)var r=!1;else{if(n=yl,yl=null,B0=0,un&6)throw Error(ke(331));var i=un;for(un|=4,ut=n.current;ut!==null;){var s=ut,o=s.child;if(ut.flags&16){var a=s.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(ut=u;ut!==null;){var f=ut;switch(f.tag){case 0:case 11:case 15:Jf(8,f,s)}var p=f.child;if(p!==null)p.return=f,ut=p;else for(;ut!==null;){f=ut;var m=f.sibling,x=f.return;if(E4(f),f===u){ut=null;break}if(m!==null){m.return=x,ut=m;break}ut=x}}}var v=s.alternate;if(v!==null){var _=v.child;if(_!==null){v.child=null;do{var y=_.sibling;_.sibling=null,_=y}while(_!==null)}}ut=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ut=o;else e:for(;ut!==null;){if(s=ut,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Jf(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,ut=g;break e}ut=s.return}}var b=n.current;for(ut=b;ut!==null;){o=ut;var S=o.child;if(o.subtreeFlags&2064&&S!==null)S.return=o,ut=S;else e:for(o=b;ut!==null;){if(a=ut,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ay(9,a)}}catch(A){Xn(a,a.return,A)}if(a===o){ut=null;break e}var M=a.sibling;if(M!==null){M.return=a.return,ut=M;break e}ut=a.return}}if(un=i,Wl(),No&&typeof No.onPostCommitFiberRoot=="function")try{No.onPostCommitFiberRoot(Jv,n)}catch{}r=!0}return r}finally{bn=t,Ps.transition=e}}return!1}function OC(n,e,t){e=ah(t,e),e=f4(n,e,1),n=Al(n,e,1),e=pi(),n!==null&&(im(n,1,e),Ui(n,e))}function Xn(n,e,t){if(n.tag===3)OC(n,n,t);else for(;e!==null;){if(e.tag===3){OC(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Tl===null||!Tl.has(r))){n=ah(t,n),n=p4(e,n,1),e=Al(e,n,1),n=pi(),e!==null&&(im(e,1,n),Ui(e,n));break}}e=e.return}}function qB(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=pi(),n.pingedLanes|=n.suspendedLanes&t,Cr===n&&(kr&t)===t&&(gr===4||gr===3&&(kr&130023424)===kr&&500>er()-cE?Hc(n,0):lE|=t),Ui(n,e)}function D4(n,e){e===0&&(n.mode&1?(e=Pg,Pg<<=1,!(Pg&130023424)&&(Pg=4194304)):e=1);var t=pi();n=Sa(n,e),n!==null&&(im(n,e,t),Ui(n,t))}function YB(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),D4(n,t)}function KB(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(ke(314))}r!==null&&r.delete(e),D4(n,t)}var k4;k4=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||ji.current)ki=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return ki=!1,jB(n,e,t);ki=!!(n.flags&131072)}else ki=!1,Ln&&e.flags&1048576&&UI(e,P0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;e0(n,e),n=e.pendingProps;var i=rh(e,ei.current);Id(e,t),i=nE(null,e,r,n,i,t);var s=rE();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,Oi(r)?(s=!0,N0(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Z2(e),i.updater=oy,e.stateNode=i,i._reactInternals=e,eS(e,r,n,t),e=rS(null,e,r,!0,s,t)):(e.tag=0,Ln&&s&&W2(e),di(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(e0(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=QB(r),n=Ws(r,n),i){case 0:e=nS(null,e,r,n,t);break e;case 1:e=CC(null,e,r,n,t);break e;case 11:e=AC(null,e,r,n,t);break e;case 14:e=TC(null,e,r,Ws(r.type,n),t);break e}throw Error(ke(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ws(r,i),nS(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ws(r,i),CC(n,e,r,i,t);case 3:e:{if(v4(e),n===null)throw Error(ke(387));r=e.pendingProps,s=e.memoizedState,i=s.element,GI(n,e),D0(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=ah(Error(ke(423)),e),e=NC(n,e,r,t,i);break e}else if(r!==i){i=ah(Error(ke(424)),e),e=NC(n,e,r,t,i);break e}else for(rs=Ml(e.stateNode.containerInfo.firstChild),is=e,Ln=!0,qs=null,t=HI(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(ih(),r===i){e=Ea(n,e,t);break e}di(n,e,r,t)}e=e.child}return e;case 5:return $I(e),n===null&&Zb(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,$b(r,i)?o=null:s!==null&&$b(r,s)&&(e.flags|=32),x4(n,e),di(n,e,o,t),e.child;case 6:return n===null&&Zb(e),null;case 13:return y4(n,e,t);case 4:return Q2(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=sh(e,null,r,t):di(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ws(r,i),AC(n,e,r,i,t);case 7:return di(n,e,e.pendingProps,t),e.child;case 8:return di(n,e,e.pendingProps.children,t),e.child;case 12:return di(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Cn(I0,r._currentValue),r._currentValue=o,s!==null)if(no(s.value,o)){if(s.children===i.children&&!ji.current){e=Ea(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=ga(-1,t&-t),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}s.lanes|=t,c=s.alternate,c!==null&&(c.lanes|=t),Qb(s.return,t,e),a.lanes|=t;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ke(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Qb(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}di(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Id(e,t),i=Is(i),r=r(i),e.flags|=1,di(n,e,r,t),e.child;case 14:return r=e.type,i=Ws(r,e.pendingProps),i=Ws(r.type,i),TC(n,e,r,i,t);
vendor: 4,516 bytes, line 40
40case 15:return m4(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ws(r,i),e0(n,e),e.tag=1,Oi(r)?(n=!0,N0(e)):n=!1,Id(e,t),h4(e,r,i),eS(e,r,i,t),rS(null,e,r,!0,n,t);case 19:return _4(n,e,t);case 22:return g4(n,e,t)}throw Error(ke(156,e.tag))};function L4(n,e){return cI(n,e)}function ZB(n,e,t,r){this.tag=n,this.key=t,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 Cs(n,e,t,r){return new ZB(n,e,t,r)}function fE(n){return n=n.prototype,!(!n||!n.isReactComponent)}function QB(n){if(typeof n=="function")return fE(n)?1:0;if(n!=null){if(n=n.$$typeof,n===I2)return 11;if(n===F2)return 14}return 2}function Nl(n,e){var t=n.alternate;return t===null?(t=Cs(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function r0(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")fE(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case hd:return Wc(t.children,i,s,e);case P2:o=8,i|=8;break;case Eb:return n=Cs(12,t,e,i|2),n.elementType=Eb,n.lanes=s,n;case Mb:return n=Cs(13,t,e,i),n.elementType=Mb,n.lanes=s,n;case Ab:return n=Cs(19,t,e,i),n.elementType=Ab,n.lanes=s,n;case $P:return cy(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case WP:o=10;break e;case GP:o=9;break e;case I2:o=11;break e;case F2:o=14;break e;case nl:o=16,r=null;break e}throw Error(ke(130,n==null?n:typeof n,""))}return e=Cs(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function Wc(n,e,t,r){return n=Cs(7,n,r,e),n.lanes=t,n}function cy(n,e,t,r){return n=Cs(22,n,r,e),n.elementType=$P,n.lanes=t,n.stateNode={isHidden:!1},n}function rw(n,e,t){return n=Cs(6,n,null,e),n.lanes=t,n}function iw(n,e,t){return e=Cs(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function JB(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=O_(0),this.expirationTimes=O_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=O_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function pE(n,e,t,r,i,s,o,a,c){return n=new JB(n,e,t,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Cs(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Z2(s),n}function e9(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:dd,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function j4(n){if(!n)return Fl;n=n._reactInternals;e:{if(gu(n)!==n||n.tag!==1)throw Error(ke(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Oi(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(ke(171))}if(n.tag===1){var t=n.type;if(Oi(t))return jI(n,t,e)}return e}function O4(n,e,t,r,i,s,o,a,c){return n=pE(t,r,!0,n,i,s,o,a,c),n.context=j4(null),t=n.current,r=pi(),i=Cl(t),s=ga(r,i),s.callback=e??null,Al(t,s,i),n.current.lanes=i,im(n,i,r),Ui(n,r),n}function uy(n,e,t,r){var i=e.current,s=pi(),o=Cl(i);return t=j4(t),e.context===null?e.context=t:e.pendingContext=t,e=ga(s,o),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=Al(i,e,o),n!==null&&(to(n,i,o,s),Zx(n,i,o)),o}function V0(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function UC(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}
vendor: 5,163 bytes, line 40
40function mE(n,e){UC(n,e),(n=n.alternate)&&UC(n,e)}function t9(){return null}var U4=typeof reportError=="function"?reportError:function(n){console.error(n)};function gE(n){this._internalRoot=n}dy.prototype.render=gE.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(ke(409));uy(n,e,null,null)};dy.prototype.unmount=gE.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;eu(function(){uy(null,n,null,null)}),e[ba]=null}};function dy(n){this._internalRoot=n}dy.prototype.unstable_scheduleHydration=function(n){if(n){var e=gI();n={blockedOn:null,target:n,priority:e};for(var t=0;t<sl.length&&e!==0&&e<sl[t].priority;t++);sl.splice(t,0,n),t===0&&vI(n)}};function xE(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function hy(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function BC(){}function n9(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=V0(o);s.call(u)}}var o=O4(e,r,n,0,null,!1,!1,"",BC);return n._reactRootContainer=o,n[ba]=o.current,Sp(n.nodeType===8?n.parentNode:n),eu(),o}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=V0(c);a.call(u)}}var c=pE(n,0,!1,null,null,!1,!1,"",BC);return n._reactRootContainer=c,n[ba]=c.current,Sp(n.nodeType===8?n.parentNode:n),eu(function(){uy(e,c,t,r)}),c}function fy(n,e,t,r,i){var s=t._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var c=V0(o);a.call(c)}}uy(e,o,n,i)}else o=n9(t,e,n,i,r);return V0(o)}pI=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=jf(e.pendingLanes);t!==0&&(L2(e,t|1),Ui(e,er()),!(un&6)&&(lh=er()+500,Wl()))}break;case 13:eu(function(){var r=Sa(n,1);if(r!==null){var i=pi();to(r,n,1,i)}}),mE(n,1)}};j2=function(n){if(n.tag===13){var e=Sa(n,134217728);if(e!==null){var t=pi();to(e,n,134217728,t)}mE(n,134217728)}};mI=function(n){if(n.tag===13){var e=Cl(n),t=Sa(n,e);if(t!==null){var r=pi();to(t,n,e,r)}mE(n,e)}};gI=function(){return bn};xI=function(n,e){var t=bn;try{return bn=n,e()}finally{bn=t}};Lb=function(n,e,t){switch(e){case"input":if(Nb(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var r=t[e];if(r!==n&&r.form===n.form){var i=ry(r);if(!i)throw Error(ke(90));qP(r),Nb(r,i)}}}break;case"textarea":KP(n,t);break;case"select":e=t.value,e!=null&&Cd(n,!!t.multiple,e,!1)}};rI=uE;iI=eu;var r9={usingClientEntryPoint:!1,Events:[om,gd,ry,tI,nI,uE]},pf={findFiberByHostInstance:Nc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},i9={bundleType:pf.bundleType,version:pf.version,rendererPackageName:pf.rendererPackageName,rendererConfig:pf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ia.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=aI(n),n===null?null:n.stateNode},findFiberByHostInstance:pf.findFiberByHostInstance||t9,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vg.isDisabled&&Vg.supportsFiber)try{Jv=Vg.inject(i9),No=Vg}catch{}}us.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r9;us.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xE(e))throw Error(ke(200));return e9(n,e,null,t)};us.createRoot=function(n,e){if(!xE(n))throw Error(ke(299));var t=!1,r="",i=U4;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=pE(n,1,!1,null,null,t,!1,r,i),n[ba]=e.current,Sp(n.nodeType===8?n.parentNode:n),new gE(e)};us.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(ke(188)):(n=Object.keys(n).join(","),Error(ke(268,n)));return n=aI(e),n=n===null?null:n.stateNode,n};us.flushSync=function(n){return eu(n)};us.hydrate=function(n,e,t){if(!hy(e))throw Error(ke(200));return fy(null,n,e,!0,t)};us.hydrateRoot=function(n,e,t){if(!xE(n))throw Error(ke(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",o=U4;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=O4(e,null,n,1,t??null,i,!1,s,o),n[ba]=e.current,Sp(n),r)for(n=0;n<r.length;n++)t=r[n],i=t._getVersion,i=i(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,i]:e.mutableSourceEagerHydrationData.push(t,i);return new dy(e)};us.render=function(n,e,t){if(!hy(e))throw Error(ke(200));return fy(null,n,e,!1,t)};
40us.unmountComponentAtNode=function(n){if(!hy(n))throw Error(ke(40));return n._reactRootContainer?(eu(function(){fy(null,null,n,!1,function(){n._reactRootContainer=null,n[ba]=null})}),!0):!1};us.unstable_batchedUpdates=uE;us.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!hy(t))throw Error(ke(200));if(n==null||n._reactInternals===void 0)throw Error(ke(38));return fy(n,e,t,!1,r)};us.version="18.3.1-next-f1338f8080-20240426";function B4(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(B4)}catch(n){console.error(n)}}B4(),BP.exports=us;var xu=BP.exports;const s9=S2(xu);var vE,zC=xu;vE=zC.createRoot,zC.hydrateRoot;const o9="modulepreload",a9=function(n){return"/"+n},VC={},yE=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(t.map(c=>{if(c=a9(c),c in VC)return;VC[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":o9,u||(p.as="script"),p.crossOrigin="",p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((m,x)=>{p.addEventListener("load",m),p.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function l9(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,r,i,s,o=[],a="",c=n.split("/");for(c[0]||c.shift();i=c.shift();)t=i[0],t==="*"?(o.push(t),a+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):t===":"?(r=i.indexOf("?",1),s=i.indexOf(".",1),o.push(i.substring(1,~r?r:~s?s:i.length)),a+=~r&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(a+=(~r?"?":"")+"\\"+i.substring(s))):a+="/"+i;return{keys:o,pattern:new RegExp("^"+a+(e?"(?=$|/)":"/?$"),"i")}}var z4={exports:{}},V4={};/** 41 * @license React 42 * use-sync-external-store-shim.production.min.js 43 * 44 * Copyright (c) Facebook, Inc. and its affiliates. 45 * 46 * This source code is licensed under the MIT license found in the 47 * LICENSE file in the root directory of this source tree. 48 */var ch=T;function c9(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var u9=typeof Object.is=="function"?Object.is:c9,d9=ch.useState,h9=ch.useEffect,f9=ch.useLayoutEffect,p9=ch.useDebugValue;function m9(n,e){var t=e(),r=d9({inst:{value:t,getSnapshot:e}}),i=r[0].inst,s=r[1];return f9(function(){i.value=t,i.getSnapshot=e,sw(i)&&s({inst:i})},[n,t,e]),h9(function(){return sw(i)&&s({inst:i}),n(function(){sw(i)&&s({inst:i})})},[n]),p9(t),t}function sw(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!u9(n,t)}catch{return!0}}function g9(n,e){return e()}var x9=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g9:m9;V4.useSyncExternalStore=ch.useSyncExternalStore!==void 0?ch.useSyncExternalStore:x9;z4.exports=V4;var v9=z4.exports;const y9=OP.useInsertionEffect,_9=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H4=_9?T.useLayoutEffect:T.useEffect,w9=y9||H4,_E=n=>{const e=T.useRef([n,(...t)=>e[0](...t)]).current;return w9(()=>{e[0]=n}),e[1]},b9="popstate",wE="pushState",bE="replaceState",S9="hashchange",HC=[b9,wE,bE,S9],E9=n=>{for(const e of HC)addEventListener(e,n);return()=>{for(const e of HC)removeEventListener(e,n)}},W4=(n,e)=>v9.useSyncExternalStore(E9,n,e),M9=()=>location.search,A9=({ssrSearch:n=""}={})=>W4(M9,()=>n),WC=()=>location.pathname,T9=({ssrPath:n}={})=>W4(WC,n?()=>n:WC),C9=(n,{replace:e=!1,state:t=null}={})=>history[e?bE:wE](t,"",n),N9=(n={})=>[T9(n),C9],GC=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[GC]>"u"){for(const n of[wE,bE]){const e=history[n];history[n]=function(){const t=e.apply(this,arguments),r=new Event(n);return r.arguments=arguments,dispatchEvent(r),t}}Object.defineProperty(window,GC,{value:!0})}const R9=(n,e)=>e.toLowerCase().indexOf(n.toLowerCase())?"~"+e:e.slice(n.length)||"/",G4=(n="")=>n==="/"?"":n,P9=(n,e)=>n[0]==="~"?n.slice(1):G4(e)+n,I9=(n="",e)=>R9($C(G4(n)),$C(e)),$C=n=>{try{return decodeURI(n)}catch{return n}},$4={hook:N9,searchHook:A9,parser:l9,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:n=>n},X4=T.createContext($4),Rh=()=>T.useContext(X4),q4={},Y4=T.createContext(q4),K4=()=>T.useContext(Y4),py=n=>{const[e,t]=n.hook(n);return[I9(n.base,e),_E((r,i)=>t(P9(r,n.base),i))]},Bi=()=>py(Rh()),SE=(n,e,t,r)=>{const{pattern:i,keys:s}=e instanceof RegExp?{keys:!1,pattern:e}:n(e||"*",r),o=i.exec(t)||[],[a,...c]=o;return a!==void 0?[!0,(()=>{const u=s!==!1?Object.fromEntries(s.map((p,m)=>[p,c[m]])):o.groups;let f={...c};return u&&Object.assign(f,u),f})(),...r?[a]:[]]:[!1,null]},Z4=n=>SE(Rh().parser,n,Bi()[0]),F9=({children:n,...e})=>{var f,p;const t=Rh(),r=e.hook?$4:t;let i=r;const[s,o]=((f=e.ssrPath)==null?void 0:f.split("?"))??[];o&&(e.ssrSearch=o,e.ssrPath=s),e.hrefs=e.hrefs??((p=e.hook)==null?void 0:p.hrefs);let a=T.useRef({}),c=a.current,u=c;for(let m in r){const x=m==="base"?r[m]+(e[m]||""):e[m]||r[m];c===u&&x!==u[m]&&(a.current=u={...u}),u[m]=x,x!==r[m]&&(i=u)}return T.createElement(X4.Provider,{value:i,children:n})},XC=({children:n,component:e},t)=>e?T.createElement(e,{params:t}):typeof n=="function"?n(t):n,D9=n=>{let e=T.useRef(q4),t=e.current;for(const r in n)n[r]!==t[r]&&(t=n);return Object.keys(n).length===0&&(t=n),e.current=t},on=({path:n,nest:e,match:t,...r})=>{const i=Rh(),[s]=py(i),[o,a,c]=t??SE(i.parser,n,s,e),u=D9({...K4(),...a}
48);if(!o)return null;const f=c?T.createElement(F9,{base:c},XC(r,u)):XC(r,u);return T.createElement(Y4.Provider,{value:u,children:f})},Pt=T.forwardRef((n,e)=>{const t=Rh(),[r,i]=py(t),{to:s="",href:o=s,onClick:a,asChild:c,children:u,className:f,replace:p,state:m,...x}=n,v=_E(y=>{y.ctrlKey||y.metaKey||y.altKey||y.shiftKey||y.button!==0||(a==null||a(y),y.defaultPrevented||(y.preventDefault(),i(o,n)))}),_=t.hrefs(o[0]==="~"?o.slice(1):t.base+o,t);return c&&T.isValidElement(u)?T.cloneElement(u,{onClick:v,href:_}):T.createElement("a",{...x,onClick:v,href:_,className:f!=null&&f.call?f(r===o):f,children:u,ref:e})}),Q4=n=>Array.isArray(n)?n.flatMap(e=>Q4(e&&e.type===T.Fragment?e.props.children:e)):[n],J4=({children:n,location:e})=>{const t=Rh(),[r]=py(t);for(const i of Q4(n)){let s=0;if(T.isValidElement(i)&&(s=SE(t.parser,i.props.path,e||r,i.props.nest))[0])return T.cloneElement(i,{match:s})}return null},k9=n=>{const{to:e,href:t=e}=n,[,r]=Bi(),i=_E(()=>r(e||t,n));return H4(()=>{i()},[]),null};var Ph=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tu=typeof window>"u"||"Deno"in globalThis;function Ss(){}function L9(n,e){return typeof n=="function"?n(e):n}function mS(n){return typeof n=="number"&&n>=0&&n!==1/0}function eF(n,e){return Math.max(n+(e||0)-Date.now(),0)}function Dd(n,e){return typeof n=="function"?n(e):n}function Ys(n,e){return typeof n=="function"?n(e):n}function qC(n,e){const{type:t="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=n;if(o){if(r){if(e.queryHash!==EE(o,e.options))return!1}else if(!Ip(e.queryKey,o))return!1}if(t!=="all"){const c=e.isActive();if(t==="active"&&!c||t==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function YC(n,e){const{exact:t,status:r,predicate:i,mutationKey:s}=n;if(s){if(!e.options.mutationKey)return!1;if(t){if(nu(e.options.mutationKey)!==nu(s))return!1}else if(!Ip(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function EE(n,e){return((e==null?void 0:e.queryKeyHashFn)||nu)(n)}function nu(n){return JSON.stringify(n,(e,t)=>gS(t)?Object.keys(t).sort().reduce((r,i)=>(r[i]=t[i],r),{}):t)}function Ip(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?!Object.keys(e).some(t=>!Ip(n[t],e[t])):!1}function tF(n,e){if(n===e)return n;const t=KC(n)&&KC(e);if(t||gS(n)&&gS(e)){const r=t?n:Object.keys(n),i=r.length,s=t?e:Object.keys(e),o=s.length,a=t?[]:{};let c=0;for(let u=0;u<o;u++){const f=t?u:s[u];(!t&&r.includes(f)||t)&&n[f]===void 0&&e[f]===void 0?(a[f]=void 0,c++):(a[f]=tF(n[f],e[f]),a[f]===n[f]&&n[f]!==void 0&&c++)}return i===o&&c===i?n:a}return e}function H0(n,e){if(!e||Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}function KC(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function gS(n){if(!ZC(n))return!1;const e=n.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!ZC(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function ZC(n){return Object.prototype.toString.call(n)==="[object Object]"}function j9(n){return new Promise(e=>{setTimeout(e,n)})}function xS(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?tF(n,e):e}function O9(n,e,t=0){const r=[...n,e];return t&&r.length>t?r.slice(1):r}function U9(n,e,t=0){const r=[e,...n];return t&&r.length>t?r.slice(0,-1):r}var ME=Symbol();function nF(n,e){return!n.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!n.queryFn||n.queryFn===ME?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}var Lc,cl,Hd,vP,B9=(vP=class extends Ph{constructor(){super();Tt(this,Lc);Tt(this,cl);Tt(this,Hd);ot(this,Hd,e=>{if(!tu&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){te(this,cl)||this.setEventListener(te(this,Hd))}onUnsubscribe(){var e;this.hasListeners()||((e=te(this,cl))==null||e.call(this),ot(this,cl,void 0))}setEventListener(e){var t;ot(this,Hd,e),(t=te(this,cl))==null||t.call(this),ot(this,cl,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){te(this,Lc)!==e&&(ot(this,Lc,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 36,076 bytes, line 48
48this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof te(this,Lc)=="boolean"?te(this,Lc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Lc=new WeakMap,cl=new WeakMap,Hd=new WeakMap,vP),AE=new B9,Wd,ul,Gd,yP,z9=(yP=class extends Ph{constructor(){super();Tt(this,Wd,!0);Tt(this,ul);Tt(this,Gd);ot(this,Gd,e=>{if(!tu&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){te(this,ul)||this.setEventListener(te(this,Gd))}onUnsubscribe(){var e;this.hasListeners()||((e=te(this,ul))==null||e.call(this),ot(this,ul,void 0))}setEventListener(e){var t;ot(this,Gd,e),(t=te(this,ul))==null||t.call(this),ot(this,ul,e(this.setOnline.bind(this)))}setOnline(e){te(this,Wd)!==e&&(ot(this,Wd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return te(this,Wd)}},Wd=new WeakMap,ul=new WeakMap,Gd=new WeakMap,yP),W0=new z9;function vS(){let n,e;const t=new Promise((i,s)=>{n=i,e=s});t.status="pending",t.catch(()=>{});function r(i){Object.assign(t,i),delete t.resolve,delete t.reject}return t.resolve=i=>{r({status:"fulfilled",value:i}),n(i)},t.reject=i=>{r({status:"rejected",reason:i}),e(i)},t}function V9(n){return Math.min(1e3*2**n,3e4)}function rF(n){return(n??"online")==="online"?W0.isOnline():!0}var iF=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function ow(n){return n instanceof iF}function sF(n){let e=!1,t=0,r=!1,i;const s=vS(),o=_=>{var y;r||(m(new iF(_)),(y=n.abort)==null||y.call(n))},a=()=>{e=!0},c=()=>{e=!1},u=()=>AE.isFocused()&&(n.networkMode==="always"||W0.isOnline())&&n.canRun(),f=()=>rF(n.networkMode)&&n.canRun(),p=_=>{var y;r||(r=!0,(y=n.onSuccess)==null||y.call(n,_),i==null||i(),s.resolve(_))},m=_=>{var y;r||(r=!0,(y=n.onError)==null||y.call(n,_),i==null||i(),s.reject(_))},x=()=>new Promise(_=>{var y;i=g=>{(r||u())&&_(g)},(y=n.onPause)==null||y.call(n)}).then(()=>{var _;i=void 0,r||(_=n.onContinue)==null||_.call(n)}),v=()=>{if(r)return;let _;const y=t===0?n.initialPromise:void 0;try{_=y??n.fn()}catch(g){_=Promise.reject(g)}Promise.resolve(_).then(p).catch(g=>{var R;if(r)return;const b=n.retry??(tu?0:3),S=n.retryDelay??V9,M=typeof S=="function"?S(t,g):S,A=b===!0||typeof b=="number"&&t<b||typeof b=="function"&&b(t,g);if(e||!A){m(g);return}t++,(R=n.onFail)==null||R.call(n,t,g),j9(M).then(()=>u()?void 0:x()).then(()=>{e?m(g):v()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:c,canStart:f,start:()=>(f()?v():x().then(v),s)}}function H9(){let n=[],e=0,t=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{e?n.push(a):i(()=>{t(a)})},o=()=>{const a=n;n=[],a.length&&i(()=>{r(()=>{a.forEach(c=>{t(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{t=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var mr=H9(),jc,_P,oF=(_P=class{constructor(){Tt(this,jc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mS(this.gcTime)&&ot(this,jc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(tu?1/0:5*60*1e3))}clearGcTimeout(){te(this,jc)&&(clearTimeout(te(this,jc)),ot(this,jc,void 0))}},jc=new WeakMap,_P),$d,Xd,bs,Yr,Jp,Oc,$s,ia,wP,W9=(wP=class extends oF{constructor(e){super();Tt(this,$s);Tt(this,$d);Tt(this,Xd);Tt(this,bs);Tt(this,Yr);Tt(this,Jp);Tt(this,Oc);ot(this,Oc,!1),ot(this,Jp,e.defaultOptions),this.setOptions(e.options),this.observers=[],ot(this,bs,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ot(this,$d,G9(this.options)),this.state=e.state??te(this,$d),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=te(this,Yr))==null?void 0:e.promise}setOptions(e){this.options={...te(this,Jp),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&te(this,bs).remove(this)}setData(e,t){const r=xS(this.state.data,e,this.options);return $t(this,$s,ia).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(e,t){$t(this,$s,ia).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var r,i;const t=(r=te(this,Yr))==null?void 0:r.promise;return(i=te(this,Yr))==null||i.cancel(e),t?t.then(Ss).catch(Ss):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(te(this,$d))}isActive(){return this.observers.some(e=>Ys(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ME||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!eF(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=te(this,Yr))==null||t.continue()}onOnline(){var t;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=te(this,Yr))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),te(this,bs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(te(this,Yr)&&(te(this,Oc)?te(this,Yr).cancel({revert:!0}):te(this,Yr).cancelRetry()),this.scheduleGc()),te(this,bs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$t(this,$s,ia).call(this,{type:"invalidate"})}fetch(e,t){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(te(this,Yr))return te(this,Yr).continueRetry(),te(this,Yr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(ot(this,Oc,!0),r.signal)})},s=()=>{const p=nF(this.options,t),m={queryKey:this.queryKey,meta:this.meta};return i(m),ot(this,Oc,!1),this.options.persister?this.options.persister(p,m,this):p(m)},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(c=this.options.behavior)==null||c.onFetch(o,this),ot(this,Xd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&$t(this,$s,ia).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const a=p=>{var m,x,v,_;ow(p)&&p.silent||$t(this,$s,ia).call(this,{type:"error",error:p}),ow(p)||((x=(m=te(this,bs).config).onError)==null||x.call(m,p,this),(_=(v=te(this,bs).config).onSettled)==null||_.call(v,this.state.data,p,this)),this.scheduleGc()};return ot(this,Yr,sF({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,x,v,_;if(p===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(y){a(y);return}(x=(m=te(this,bs).config).onSuccess)==null||x.call(m,p,this),(_=(v=te(this,bs).config).onSettled)==null||_.call(v,p,this.state.error,this),this.scheduleGc()},onError:a,onFail:(p,m)=>{$t(this,$s,ia).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{$t(this,$s,ia).call(this,{type:"pause"})},onContinue:()=>{$t(this,$s,ia).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),te(this,Yr).start()}},$d=new WeakMap,Xd=new WeakMap,bs=new WeakMap,Yr=new WeakMap,Jp=new WeakMap,Oc=new WeakMap,$s=new WeakSet,ia=function(e){const t=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,...aF(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 ow(i)&&i.revert&&te(this,Xd)?{...te(this,Xd),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=t(this.state),mr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),te(this,bs).notify({query:this,type:"updated",action:e})})},wP);function aF(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rF(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function G9(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=e!==void 0,r=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var wo,bP,$9=(bP=class extends Ph{constructor(e={}){super();Tt(this,wo);this.config=e,ot(this,wo,new Map)}build(e,t,r){const i=t.queryKey,s=t.queryHash??EE(i,t);let o=this.get(s);return o||(o=new W9({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){te(this,wo).has(e.queryHash)||(te(this,wo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=te(this,wo).get(e.queryHash);t&&(e.destroy(),t===e&&te(this,wo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){mr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return te(this,wo).get(e)}getAll(){return[...te(this,wo).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>qC(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>qC(e,r)):t}notify(e){mr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){mr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){mr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},wo=new WeakMap,bP),bo,li,Uc,So,el,SP,X9=(SP=class extends oF{constructor(e){super();Tt(this,So);Tt(this,bo);Tt(this,li);Tt(this,Uc);this.mutationId=e.mutationId,ot(this,li,e.mutationCache),ot(this,bo,[]),this.state=e.state||lF(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){te(this,bo).includes(e)||(te(this,bo).push(e),this.clearGcTimeout(),te(this,li).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ot(this,bo,te(this,bo).filter(t=>t!==e)),this.scheduleGc(),te(this,li).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){te(this,bo).length||(this.state.status==="pending"?this.scheduleGc():te(this,li).remove(this))}continue(){var e;return((e=te(this,Uc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,u,f,p,m,x,v,_,y,g,b,S,M,A,R,F;ot(this,Uc,sF({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(L,N)=>{$t(this,So,el).call(this,{type:"failed",failureCount:L,error:N})},onPause:()=>{$t(this,So,el).call(this,{type:"pause"})},onContinue:()=>{$t(this,So,el).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>te(this,li).canRun(this)}));const t=this.state.status==="pending",r=!te(this,Uc).canStart();try{if(!t){$t(this,So,el).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=te(this,li).config).onMutate)==null?void 0:s.call(i,e,this));const N=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));N!==this.state.context&&$t(this,So,el).call(this,{type:"pending",context:N,variables:e,isPaused:r})}const L=await te(this,Uc).start();return await((u=(c=te(this,li).config).onSuccess)==null?void 0:u.call(c,L,e,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,L,e,this.state.context)),await((x=(m=te(this,li).config).onSettled)==null?void 0:x.call(m,L,null,this.state.variables,this.state.context,this)),await((_=(v=this.options).onSettled)==null?void 0:_.call(v,L,null,e,this.state.context)),$t(this,So,el).call(this,{type:"success",data:L}),L}catch(L){try{throw await((g=(y=te(this,li).config).onError)==null?void 0:g.call(y,L,e,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,L,e,this.state.context)),await((A=(M=te(this,li).config).onSettled)==null?void 0:A.call(M,void 0,L,this.state.variables,this.state.context,this)),await((F=(R=this.options).onSettled)==null?void 0:F.call(R,void 0,L,e,this.state.context)),L}finally{$t(this,So,el).call(this,{type:"error",error:L})}}finally{te(this,li).runNext(this)}}},bo=new WeakMap,li=new WeakMap,Uc=new WeakMap,So=new WeakSet,el=function(e){const t=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=t(this.state),mr.batch(()=>{te(this,bo).forEach(r=>{r.onMutationUpdate(e)}),te(this,li).notify({mutation:this,type:"updated",action:e})})},SP);function lF(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ki,em,EP,q9=(EP=class extends Ph{constructor(e={}){super();Tt(this,Ki);Tt(this,em);this.config=e,ot(this,Ki,new Map),ot(this,em,Date.now())}build(e,t,r){const i=new X9({mutationCache:this,mutationId:++Mg(this,em)._,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){const t=Hg(e),r=te(this,Ki).get(t)??[];r.push(e),te(this,Ki).set(t,r),this.notify({type:"added",mutation:e})}remove(e){var r;const t=Hg(e);if(te(this,Ki).has(t)){const i=(r=te(this,Ki).get(t))==null?void 0:r.filter(s=>s!==e);i&&(i.length===0?te(this,Ki).delete(t):te(this,Ki).set(t,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const t=(r=te(this,Ki).get(Hg(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!t||t===e}runNext(e){var r;const t=(r=te(this,Ki).get(Hg(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(t==null?void 0:t.continue())??Promise.resolve()}clear(){mr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...te(this,Ki).values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(r=>YC(t,r))}findAll(e={}){return this.getAll().filter(t=>YC(e,t))}notify(e){mr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return mr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ss))))}},Ki=new WeakMap,em=new WeakMap,EP);function Hg(n){var e;return((e=n.options.scope)==null?void 0:e.id)??String(n.mutationId)}function QC(n){return{onFetch:(e,t)=>{var f,p,m,x,v;const r=e.options,i=(m=(p=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,s=((x=e.state.data)==null?void 0:x.pages)||[],o=((v=e.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let _=!1;const y=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(e.signal.aborted?_=!0:e.signal.addEventListener("abort",()=>{_=!0}),e.signal)})},g=nF(e.options,e.fetchOptions),b=async(S,M,A)=>{if(_)return Promise.reject();if(M==null&&S.pages.length)return Promise.resolve(S);const R={queryKey:e.queryKey,pageParam:M,direction:A?"backward":"forward",meta:e.options.meta};y(R);const F=await g(R),{maxPages:L}=e.options,N=A?U9:O9;return{pages:N(S.pages,F,L),pageParams:N(S.pageParams,M,L)}};if(i&&s.length){const S=i==="backward",M=S?Y9:JC,A={pages:s,pageParams:o},R=M(r,A);a=await b(A,R,S)}else{const S=n??s.length;do{const M=c===0?o[0]??r.initialPageParam:JC(r,a);if(c>0&&M==null)break;a=await b(a,M),c++}while(c<S)}return a};e.options.persister?e.fetchFn=()=>{var _,y;return(y=(_=e.options).persister)==null?void 0:y.call(_,u,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=u}}}function JC(n,{pages:e,pageParams:t}){const r=e.length-1;return e.length>0?n.getNextPageParam(e[r],e,t[r],t):void 0}function Y9(n,{pages:e,pageParams:t}){var r;return e.length>0?(r=n.getPreviousPageParam)==null?void 0:r.call(n,e[0],e,t[0],t):void 0}var Gn,dl,hl,qd,Yd,fl,Kd,Zd,MP,K9=(MP=class{constructor(n={}){Tt(this,Gn);Tt(this,dl);Tt(this,hl);Tt(this,qd);Tt(this,Yd);Tt(this,fl);Tt(this,Kd);Tt(this,Zd);ot(this,Gn,n.queryCache||new $9),ot(this,dl,n.mutationCache||new q9),ot(this,hl,n.defaultOptions||{}),ot(this,qd,new Map),ot(this,Yd,new Map),ot(this,fl,0)}mount(){Mg(this,fl)._++,te(this,fl)===1&&(ot(this,Kd,AE.subscribe(async n=>{n&&(await this.resumePausedMutations(),te(this,Gn).onFocus())})),ot(this,Zd,W0.subscribe(async n=>{n&&(await this.resumePausedMutations(),te(this,Gn).onOnline())})))}unmount(){var n,e;Mg(this,fl)._--,te(this,fl)===0&&((n=te(this,Kd))==null||n.call(this),ot(this,Kd,void 0),(e=te(this,Zd))==null||e.call(this),ot(this,Zd,void 0))}isFetching(n){return te(this,Gn).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return te(this,dl).findAll({...n,status:"pending"}).length}getQueryData(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=te(this,Gn).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(n){const e=this.getQueryData(n.queryKey);if(e===void 0)return this.fetchQuery(n);{const t=this.defaultQueryOptions(n),r=te(this,Gn).build(this,t);return n.revalidateIfStale&&r.isStaleByTime(Dd(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(e)}}getQueriesData(n){return te(this,Gn).findAll(n).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(n,e,t){const r=this.defaultQueryOptions({queryKey:n}),i=te(this,Gn).get(r.queryHash),s=i==null?void 0:i.state.data,o=L9(e,s);if(o!==void 0)return te(this,Gn).build(this,r).setData(o,{...t,manual:!0})}setQueriesData(n,e,t){return mr.batch(()=>te(this,Gn).findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,e,t)]))}getQueryState(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=te(this,Gn).get(e.queryHash))==null?void 0:t.state}removeQueries(n){const e=te(this,Gn);mr.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=te(this,Gn),r={type:"active",...n};return mr.batch(()=>(t.findAll(n).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(n={},e={}){const t={revert:!0,...e},r=mr.batch(()=>te(this,Gn).findAll(n).map(i=>i.cancel(t)));return Promise.all(r).then(Ss).catch(Ss)}invalidateQueries(n={},e={}){return mr.batch(()=>{if(te(this,Gn).findAll(n).forEach(r=>{r.invalidate()}),n.refetchType==="none")return Promise.resolve();const t={...n,type:n.refetchType??n.type??"active"};return this.refetchQueries(t,e)})}refetchQueries(n={},e){const t={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=mr.batch(()=>te(this,Gn).findAll(n).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,t);return t.throwOnError||(s=s.catch(Ss)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ss)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const t=te(this,Gn).build(this,e);return t.isStaleByTime(Dd(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Ss).catch(Ss)}fetchInfiniteQuery(n){return n.behavior=QC(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Ss).catch(Ss)}ensureInfiniteQueryData(n){return n.behavior=QC(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return W0.isOnline()?te(this,dl).resumePausedMutations():Promise.resolve()}getQueryCache(){return te(this,Gn)}getMutationCache(){return te(this,dl)}getDefaultOptions(){return te(this,hl)}setDefaultOptions(n){ot(this,hl,n)}setQueryDefaults(n,e){te(this,qd).set(nu(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...te(this,qd).values()];let t={};return e.forEach(r=>{Ip(n,r.queryKey)&&(t={...t,...r.defaultOptions})}),t}setMutationDefaults(n,e){te(this,Yd).set(nu(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...te(this,Yd).values()];let t={};return e.forEach(r=>{Ip(n,r.mutationKey)&&(t={...t,...r.defaultOptions})}),t}defaultQueryOptions(n){if(n._defaulted)return n;const e={...te(this,hl).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=EE(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.enabled!==!0&&e.queryFn===ME&&(e.enabled=!1),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...te(this,hl).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){te(this,Gn).clear(),te(this,dl).clear()}},Gn=new WeakMap,dl=new WeakMap,hl=new WeakMap,qd=new WeakMap,Yd=new WeakMap,fl=new WeakMap,Kd=new WeakMap,Zd=new WeakMap,MP),Ci,rn,tm,ci,Bc,Qd,pl,Eo,nm,Jd,eh,zc,Vc,ml,th,_n,Uf,yS,_S,wS,bS,SS,ES,MS,cF,AP,Z9=(AP=class extends Ph{constructor(e,t){super();Tt(this,_n);Tt(this,Ci);Tt(this,rn);Tt(this,tm);Tt(this,ci);Tt(this,Bc);Tt(this,Qd);Tt(this,pl);Tt(this,Eo);Tt(this,nm);Tt(this,Jd);Tt(this,eh);Tt(this,zc);Tt(this,Vc);Tt(this,ml);Tt(this,th,new Set);this.options=t,ot(this,Ci,e),ot(this,Eo,null),ot(this,pl,vS()),this.options.experimental_prefetchInRender||te(this,pl).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(te(this,rn).addObserver(this),e3(te(this,rn),this.options)?$t(this,_n,Uf).call(this):this.updateResult(),$t(this,_n,bS).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return AS(te(this,rn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return AS(te(this,rn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$t(this,_n,SS).call(this),$t(this,_n,ES).call(this),te(this,rn).removeObserver(this)}setOptions(e,t){const r=this.options,i=te(this,rn);if(this.options=te(this,Ci).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ys(this.options.enabled,te(this,rn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");$t(this,_n,MS).call(this),te(this,rn).setOptions(this.options),r._defaulted&&!H0(this.options,r)&&te(this,Ci).getQueryCache().notify({type:"observerOptionsUpdated",query:te(this,rn),observer:this});const s=this.hasListeners();s&&t3(te(this,rn),i,this.options,r)&&$t(this,_n,Uf).call(this),this.updateResult(t),s&&(te(this,rn)!==i||Ys(this.options.enabled,te(this,rn))!==Ys(r.enabled,te(this,rn))||Dd(this.options.staleTime,te(this,rn))!==Dd(r.staleTime,te(this,rn)))&&$t(this,_n,yS).call(this);const o=$t(this,_n,_S).call(this);s&&(te(this,rn)!==i||Ys(this.options.enabled,te(this,rn))!==Ys(r.enabled,te(this,rn))||o!==te(this,ml))&&$t(this,_n,wS).call(this,o)}getOptimisticResult(e){const t=te(this,Ci).getQueryCache().build(te(this,Ci),e),r=this.createResult(t,e);return J9(this,r)&&(ot(this,ci,r),ot(this,Qd,this.options),ot(this,Bc,te(this,rn).state)),r}getCurrentResult(){return te(this,ci)}trackResult(e,t){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),t==null||t(i),e[i])})}),r}trackProp(e){te(this,th).add(e)}getCurrentQuery(){return te(this,rn)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=te(this,Ci).defaultQueryOptions(e),r=te(this,Ci).getQueryCache().build(te(this,Ci),t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return $t(this,_n,Uf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),te(this,ci)))}createResult(e,t){var L;const r=te(this,rn),i=this.options,s=te(this,ci),o=te(this,Bc),a=te(this,Qd),u=e!==r?e.state:te(this,tm),{state:f}=e;let p={...f},m=!1,x;if(t._optimisticResults){const N=this.hasListeners(),I=!N&&e3(e,t),D=N&&t3(e,r,t,i);(I||D)&&(p={...p,...aF(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:_,status:y}=p;if(t.select&&p.data!==void 0)if(s&&p.data===(o==null?void 0:o.data)&&t.select===te(this,nm))x=te(this,Jd);else try{ot(this,nm,t.select),x=t.select(p.data),x=xS(s==null?void 0:s.data,x,t),ot(this,Jd,x),ot(this,Eo,null)}catch(N){ot(this,Eo,N)}else x=p.data;if(t.placeholderData!==void 0&&x===void 0&&y==="pending"){let N;if(s!=null&&s.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData))N=s.data;else if(N=typeof t.placeholderData=="function"?t.placeholderData((L=te(this,eh))==null?void 0:L.state.data,te(this,eh)):t.placeholderData,t.select&&N!==void 0)try{N=t.select(N),ot(this,Eo,null)}catch(I){ot(this,Eo,I)}N!==void 0&&(y="success",x=xS(s==null?void 0:s.data,N,t),m=!0)}te(this,Eo)&&(v=te(this,Eo),x=te(this,Jd),_=Date.now(),y="error");const g=p.fetchStatus==="fetching",b=y==="pending",S=y==="error",M=b&&g,A=x!==void 0,F={status:y,fetchStatus:p.fetchStatus,isPending:b,isSuccess:y==="success",isError:S,isInitialLoading:M,isLoading:M,data:x,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!b,isLoadingError:S&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&A,isStale:TE(e,t),refetch:this.refetch,promise:te(this,pl)};if(this.options.experimental_prefetchInRender){const N=O=>{F.status==="error"?O.reject(F.error):F.data!==void 0&&O.resolve(F.data)},I=()=>{const O=ot(this,pl,F.promise=vS());N(O)},D=te(this,pl);switch(D.status){case"pending":e.queryHash===r.queryHash&&N(D);break;case"fulfilled":(F.status==="error"||F.data!==D.value)&&I();break;case"rejected":(F.status!=="error"||F.error!==D.reason)&&I();break}}return F}updateResult(e){const t=te(this,ci),r=this.createResult(te(this,rn),this.options);if(ot(this,Bc,te(this,rn).state),ot(this,Qd,this.options),te(this,Bc).data!==void 0&&ot(this,eh,te(this,rn)),H0(r,t))return;ot(this,ci,r);const i={},s=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!te(this,th).size)return!0;const c=new Set(a??te(this,th));return this.options.throwOnError&&c.add("error"),Object.keys(te(this,ci)).some(u=>{const f=u;return te(this,ci)[f]!==t[f]&&c.has(f)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),$t(this,_n,cF).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$t(this,_n,bS).call(this)}},Ci=new WeakMap,rn=new WeakMap,tm=new WeakMap,ci=new WeakMap,Bc=new WeakMap,Qd=new WeakMap,pl=new WeakMap,Eo=new WeakMap,nm=new WeakMap,Jd=new WeakMap,eh=new WeakMap,zc=new WeakMap,Vc=new WeakMap,ml=new WeakMap,th=new WeakMap,_n=new WeakSet,Uf=function(e){$t(this,_n,MS).call(this);let t=te(this,rn).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(Ss)),t},yS=function(){$t(this,_n,SS).call(this);const e=Dd(this.options.staleTime,te(this,rn));if(tu||te(this,ci).isStale||!mS(e))return;const r=eF(te(this,ci).dataUpdatedAt,e)+1;ot(this,zc,setTimeout(()=>{te(this,ci).isStale||this.updateResult()},r))},_S=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(te(this,rn)):this.options.refetchInterval)??!1},wS=function(e){$t(this,_n,ES).call(this),ot(this,ml,e),!(tu||Ys(this.options.enabled,te(this,rn))===!1||!mS(te(this,ml))||te(this,ml)===0)&&ot(this,Vc,setInterval(()=>{(this.options.refetchIntervalInBackground||AE.isFocused())&&$t(this,_n,Uf).call(this)},te(this,ml)))},bS=function(){$t(this,_n,yS).call(this),$t(this,_n,wS).call(this,$t(this,_n,_S).call(this))},SS=function(){te(this,zc)&&(clearTimeout(te(this,zc)),ot(this,zc,void 0))},ES=function(){te(this,Vc)&&(clearInterval(te(this,Vc)),ot(this,Vc,void 0))},MS=function(){const e=te(this,Ci).getQueryCache().build(te(this,Ci),this.options);if(e===te(this,rn))return;const t=te(this,rn);ot(this,rn,e),ot(this,tm,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))},cF=function(e){mr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(te(this,ci))}),te(this,Ci).getQueryCache().notify({query:te(this,rn),type:"observerResultsUpdated"})})},AP);function Q9(n,e){return Ys(e.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&e.retryOnMount===!1)}function e3(n,e){return Q9(n,e)||n.state.data!==void 0&&AS(n,e,e.refetchOnMount)}function AS(n,e,t){if(Ys(e.enabled,n)!==!1){const r=typeof t=="function"?t(n):t;return r==="always"||r!==!1&&TE(n,e)}return!1}function t3(n,e,t,r){return(n!==e||Ys(r.enabled,n)===!1)&&(!t.suspense||n.state.status!=="error")&&TE(n,t)}function TE(n,e){return Ys(e.enabled,n)!==!1&&n.isStaleByTime(Dd(e.staleTime,n))}function J9(n,e){return!H0(n.getCurrentResult(),e)}var gl,xl,Ni,ca,_a,i0,TS,TP,ez=(TP=class extends Ph{constructor(t,r){super();Tt(this,_a);Tt(this,gl);Tt(this,xl);Tt(this,Ni);Tt(this,ca);ot(this,gl,t),this.setOptions(r),this.bindMethods(),$t(this,_a,i0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const r=this.options;this.options=te(this,gl).defaultMutationOptions(t),H0(this.options,r)||te(this,gl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:te(this,Ni),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&nu(r.mutationKey)!==nu(this.options.mutationKey)?this.reset():((i=te(this,Ni))==null?void 0:i.state.status)==="pending"&&te(this,Ni).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=te(this,Ni))==null||t.removeObserver(this)}onMutationUpdate(t){$t(this,_a,i0).call(this),$t(this,_a,TS).call(this,t)}getCurrentResult(){return te(this,xl)}reset(){var t;(t=te(this,Ni))==null||t.removeObserver(this),ot(this,Ni,void 0),$t(this,_a,i0).call(this),$t(this,_a,TS).call(this)}mutate(t,r){var i;return ot(this,ca,r),(i=te(this,Ni))==null||i.removeObserver(this),ot(this,Ni,te(this,gl).getMutationCache().build(te(this,gl),this.options)),te(this,Ni).addObserver(this),te(this,Ni).execute(t)}},gl=new WeakMap,xl=new WeakMap,Ni=new WeakMap,ca=new WeakMap,_a=new WeakSet,i0=function(){var r;const t=((r=te(this,Ni))==null?void 0:r.state)??lF();ot(this,xl,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},TS=function(t){mr.batch(()=>{var r,i,s,o,a,c,u,f;if(te(this,ca)&&this.hasListeners()){const p=te(this,xl).variables,m=te(this,xl).context;(t==null?void 0:t.type)==="success"?((i=(r=te(this,ca)).onSuccess)==null||i.call(r,t.data,p,m),(o=(s=te(this,ca)).onSettled)==null||o.call(s,t.data,null,p,m)):(t==null?void 0:t.type)==="error"&&((c=(a=te(this,ca)).onError)==null||c.call(a,t.error,p,m),(f=(u=te(this,ca)).onSettled)==null||f.call(u,void 0,t.error,p,m))}this.listeners.forEach(p=>{p(te(this,xl))})})},TP),uF=T.createContext(void 0),hs=n=>{const e=T.useContext(uF);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},dF=({client:n,children:e})=>(T.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),l.jsx(uF.Provider,{value:n,children:e})),hF=T.createContext(!1),tz=()=>T.useContext(hF);hF.Provider;function nz(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var rz=T.createContext(nz()),iz=()=>T.useContext(rz);function fF(n,e){return typeof n=="function"?n(...e):!!n}function CS(){}var sz=(n,e)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(e.isReset()||(n.retryOnMount=!1))},oz=n=>{T.useEffect(()=>{n.clearReset()},[n])},az=({result:n,errorResetBoundary:e,throwOnError:t,query:r})=>n.isError&&!e.isReset()&&!n.isFetching&&r&&fF(t,[n.error,r]),lz=n=>{n.suspense&&(n.staleTime===void 0&&(n.staleTime=1e3),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3)))},cz=(n,e)=>n.isLoading&&n.isFetching&&!e,uz=(n,e)=>(n==null?void 0:n.suspense)&&e.isPending,n3=(n,e,t)=>e.fetchOptimistic(n).catch(()=>{t.clearReset()});function dz(n,e,t){var f,p,m,x,v;const r=hs(),i=tz(),s=iz(),o=r.defaultQueryOptions(n);(p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,o),o._optimisticResults=i?"isRestoring":"optimistic",lz(o),sz(o,s),oz(s);const a=!r.getQueryCache().get(o.queryHash),[c]=T.useState(()=>new e(r,o)),u=c.getOptimisticResult(o);if(T.useSyncExternalStore(T.useCallback(_=>{const y=i?CS:c.subscribe(mr.batchCalls(_));return c.updateResult(),y},[c,i]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),T.useEffect(()=>{c.setOptions(o,{listeners:!1})},[o,c]),uz(o,u))throw n3(o,c,s);if(az({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw u.error;if((x=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||x.call(m,o,u),o.experimental_prefetchInRender&&!tu&&cz(u,i)){const _=a?n3(o,c,s):(v=r.getQueryCache().get(o.queryHash))==null?void 0:v.promise;_==null||_.catch(CS).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function Nt(n,e){return dz(n,Z9)}function ti(n,e){const t=hs(),[r]=T.useState(()=>new ez(t,n));T.useEffect(()=>{r.setOptions(n)},[r,n]);const i=T.useSyncExternalStore(T.useCallback(o=>r.subscribe(mr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=T.useCallback((o,a)=>{r.mutate(o,a).catch(CS)},[r]);if(i.error&&fF(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}async function pF(n){if(!n.ok){const e=await n.text()||n.statusText;throw new Error(`${n.status}: ${e}`)}}async function Lo(n,e,t){const r=await fetch(e,{method:n,headers:t?{"Content-Type":"application/json"}:{},body:t?JSON.stringify(t):void 0,credentials:"include"});return await pF(r),r}const hz=({on401:n})=>async({queryKey:e})=>{try{const t=e[0];if(t.includes("/api/spotify/"))try{const i=await fetch(t,{credentials:"include",headers:{"Content-Type":"application/json"}});return i.ok?await i.json():(console.log(`Spotify API error: ${i.status}`),null)}catch(i){return console.log("Error fetching from Spotify API:",i),null}const r=await fetch(t,{credentials:"include",headers:{"Content-Type":"application/json"}});return n==="returnNull"&&r.status===401?null:(await pF(r),await r.json())}catch(t){if(typeof e[0]=="string"&&e[0].includes("/api/spotify/"))return console.log("Handled Spotify API error:",t),null;throw t}}
48,mF=new K9({defaultOptions:{queries:{queryFn:hz({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0,retry:!1},mutations:{retry:!1}}}),fz=1,pz=1e6;let aw=0;function mz(){return aw=(aw+1)%Number.MAX_SAFE_INTEGER,aw.toString()}const lw=new Map,r3=n=>{if(lw.has(n))return;const e=setTimeout(()=>{lw.delete(n),np({type:"REMOVE_TOAST",toastId:n})},pz);lw.set(n,e)},gz=(n,e)=>{switch(e.type){case"ADD_TOAST":return{...n,toasts:[e.toast,...n.toasts].slice(0,fz)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=e;return t?r3(t):n.toasts.forEach(r=>{r3(r.id)}),{...n,toasts:n.toasts.map(r=>r.id===t||t===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(t=>t.id!==e.toastId)}}},s0=[];let o0={toasts:[]};function np(n){o0=gz(o0,n),s0.forEach(e=>{e(o0)})}function xz({...n}){const e=mz(),t=i=>np({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>np({type:"DISMISS_TOAST",toastId:e});return np({type:"ADD_TOAST",toast:{...n,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:t}}function Mn(){const[n,e]=T.useState(o0);return T.useEffect(()=>(s0.push(e),()=>{const t=s0.indexOf(e);t>-1&&s0.splice(t,1)}),[n]),{...n,toast:xz,dismiss:t=>np({type:"DISMISS_TOAST",toastId:t})}}function At(n,e,{checkForDefaultPrevented:t=!0}={}){return function(i){if(n==null||n(i),t===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function i3(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function gF(...n){return e=>{let t=!1;const r=n.map(i=>{const s=i3(i,e);return!t&&typeof s=="function"&&(t=!0),s});if(t)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():i3(n[i],null)}}}}function Tn(...n){return T.useCallback(gF(...n),n)}function vz(n,e){const t=T.createContext(e),r=s=>{const{children:o,...a}=s,c=T.useMemo(()=>a,Object.values(a));return l.jsx(t.Provider,{value:c,children:o})};r.displayName=n+"Provider";function i(s){const o=T.useContext(t);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${n}\``)}return[r,i]}function Uo(n,e=[]){let t=[];function r(s,o){const a=T.createContext(o),c=t.length;t=[...t,o];const u=p=>{var g;const{scope:m,children:x,...v}=p,_=((g=m==null?void 0:m[n])==null?void 0:g[c])||a,y=T.useMemo(()=>v,Object.values(v));return l.jsx(_.Provider,{value:y,children:x})};u.displayName=s+"Provider";function f(p,m){var _;const x=((_=m==null?void 0:m[n])==null?void 0:_[c])||a,v=T.useContext(x);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[u,f]}const i=()=>{const s=t.map(o=>T.createContext(o));return function(a){const c=(a==null?void 0:a[n])||s;return T.useMemo(()=>({[`__scope${n}`]:{...a,[n]:c}}),[a,c])}};return i.scopeName=n,[r,yz(i,...e)]}function yz(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const p=c(s)[`__scope${u}`];return{...a,...p}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function uh(n){const e=_z(n),t=T.forwardRef((r,i)=>{const{children:s,...o}=r,a=T.Children.toArray(s),c=a.find(bz);if(c){const u=c.props.children,f=a.map(p=>p===c?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:p);return l.jsx(e,{...o,ref:i,children:T.isValidElement(u)?T.cloneElement(u,void 0,f):null})}return l.jsx(e,{...o,ref:i,children:s})});return t.displayName=`${n}.Slot`,t}var xF=uh("Slot");function _z(n){const e=T.forwardRef((t,r)=>{const{children:i,...s}=t;if(T.isValidElement(i)){const o=Ez(i),a=Sz(s,i.props);return i.type!==T.Fragment&&(a.ref=r?gF(r,o):o),T.cloneElement(i,a)}return T.Children.count(i)>1?T.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var vF=Symbol("radix.slottable");function wz(n){const e=({children:t})=>l.jsx(l.Fragment,{children:t});return e.displayName=`${n}.Slottable`,e.__radixId=vF,e}function bz(n){return T.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===vF}function Sz(n,e){const t={...e};for(const r in e){const i=n[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?t[r]=(...a)=>{s(...a),i(...a)}:i&&(t[r]=i):r==="style"?t[r]={...i,...s}
vendor: 8,225 bytes, line 48
48:r==="className"&&(t[r]=[i,s].filter(Boolean).join(" "))}return{...n,...t}}function Ez(n){var r,i;let e=(r=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=(i=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}function CE(n){const e=n+"CollectionProvider",[t,r]=Uo(e),[i,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),o=_=>{const{scope:y,children:g}=_,b=Ot.useRef(null),S=Ot.useRef(new Map).current;return l.jsx(i,{scope:y,itemMap:S,collectionRef:b,children:g})};o.displayName=e;const a=n+"CollectionSlot",c=uh(a),u=Ot.forwardRef((_,y)=>{const{scope:g,children:b}=_,S=s(a,g),M=Tn(y,S.collectionRef);return l.jsx(c,{ref:M,children:b})});u.displayName=a;const f=n+"CollectionItemSlot",p="data-radix-collection-item",m=uh(f),x=Ot.forwardRef((_,y)=>{const{scope:g,children:b,...S}=_,M=Ot.useRef(null),A=Tn(y,M),R=s(f,g);return Ot.useEffect(()=>(R.itemMap.set(M,{ref:M,...S}),()=>void R.itemMap.delete(M))),l.jsx(m,{[p]:"",ref:A,children:b})});x.displayName=f;function v(_){const y=s(n+"CollectionConsumer",_);return Ot.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const S=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((R,F)=>S.indexOf(R.ref.current)-S.indexOf(F.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:x},v,r]}var Mz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Dt=Mz.reduce((n,e)=>{const t=uh(`Primitive.${e}`),r=T.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function yF(n,e){n&&xu.flushSync(()=>n.dispatchEvent(e))}function zi(n){const e=T.useRef(n);return T.useEffect(()=>{e.current=n}),T.useMemo(()=>(...t)=>{var r;return(r=e.current)==null?void 0:r.call(e,...t)},[])}function Az(n,e=globalThis==null?void 0:globalThis.document){const t=zi(n);T.useEffect(()=>{const r=i=>{i.key==="Escape"&&t(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[t,e])}var Tz="DismissableLayer",NS="dismissableLayer.update",Cz="dismissableLayer.pointerDownOutside",Nz="dismissableLayer.focusOutside",s3,_F=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lm=T.forwardRef((n,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=n,u=T.useContext(_F),[f,p]=T.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=T.useState({}),v=Tn(e,F=>p(F)),_=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=_.indexOf(y),b=f?_.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,M=b>=g,A=Pz(F=>{const L=F.target,N=[...u.branches].some(I=>I.contains(L));!M||N||(i==null||i(F),o==null||o(F),F.defaultPrevented||a==null||a())},m),R=Iz(F=>{const L=F.target;[...u.branches].some(I=>I.contains(L))||(s==null||s(F),o==null||o(F),F.defaultPrevented||a==null||a())},m);return Az(F=>{b===u.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),T.useEffect(()=>{if(f)return t&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(s3=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),o3(),()=>{t&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=s3)}},[f,m,t,u]),T.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),o3())},[f,u]),T.useEffect(()=>{const F=()=>x({});return document.addEventListener(NS,F),()=>document.removeEventListener(NS,F)},[]),l.jsx(Dt.div,{...c,ref:v,style:{pointerEvents:S?M?"auto":"none":void 0,...n.style},onFocusCapture:At(n.onFocusCapture,R.onFocusCapture),onBlurCapture:At(n.onBlurCapture,R.onBlurCapture),onPointerDownCapture:At(n.onPointerDownCapture,A.onPointerDownCapture)})});lm.displayName=Tz;var Rz="DismissableLayerBranch",wF=T.forwardRef((n,e)=>{const t=T.useContext(_F),r=T.useRef(null),i=Tn(e,r);return T.useEffect(()=>{const s=r.current;if(s)return t.branches.add(s),()=>{t.branches.delete(s)}},[t.branches]),l.jsx(Dt.div,{...n,ref:i})});wF.displayName=Rz;function Pz(n,e=globalThis==null?void 0:globalThis.document){const t=zi(n),r=T.useRef(!1),i=T.useRef(()=>{});return T.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){bF(Cz,t,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,t]),{onPointerDownCapture:()=>r.current=!0}}function Iz(n,e=globalThis==null?void 0:globalThis.document){const t=zi(n),r=T.useRef(!1);return T.useEffect(()=>{const i=s=>{s.target&&!r.current&&bF(Nz,t,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function o3(){const n=new CustomEvent(NS);document.dispatchEvent(n)}function bF(n,e,t,{discrete:r}){const i=t.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?yF(i,s):i.dispatchEvent(s)}var Fz=lm,Dz=wF,ni=globalThis!=null&&globalThis.document?T.useLayoutEffect:()=>{},kz="Portal",my=T.forwardRef((n,e)=>{var a;const{container:t,...r}=n,[i,s]=T.useState(!1);ni(()=>s(!0),[]);const o=t||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?s9.createPortal(l.jsx(Dt.div,{...r,ref:e}),o):null});my.displayName=kz;function Lz(n,e){return T.useReducer((t,r)=>e[t][r]??t,n)}var Gl=n=>{const{present:e,children:t}=n,r=jz(e),i=typeof t=="function"?t({present:r.isPresent}):T.Children.only(t),s=Tn(r.ref,Oz(i));return typeof t=="function"||r.isPresent?T.cloneElement(i,{ref:s}):null};Gl.displayName="Presence";function jz(n){const[e,t]=T.useState(),r=T.useRef({}),i=T.useRef(n),s=T.useRef("none"),o=n?"mounted":"unmounted",[a,c]=Lz(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const u=Wg(r.current);s.current=a==="mounted"?u:"none"},[a]),ni(()=>{const u=r.current,f=i.current;if(f!==n){const m=s.current,x=Wg(u);n?c("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&m!==x?"ANIMATION_OUT":"UNMOUNT"),i.current=n}},[n,c]),ni(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,p=x=>{const _=Wg(r.current).includes(x.animationName);if(x.target===e&&_&&(c("ANIMATION_END"),!i.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},m=x=>{x.target===e&&(s.current=Wg(r.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",p),e.addEventListener("animationend",p),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",p),e.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:T.useCallback(u=>{u&&(r.current=getComputedStyle(u)),t(u)},[])}}function Wg(n){return(n==null?void 0:n.animationName)||"none"}function Oz(n){var r,i;let e=(r=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=(i=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}function Dl({prop:n,defaultProp:e,onChange:t=()=>{}}){const[r,i]=Uz({defaultProp:e,onChange:t}
48),s=n!==void 0,o=s?n:r,a=zi(t),c=T.useCallback(u=>{if(s){const p=typeof u=="function"?u(n):u;p!==n&&a(p)}else i(u)},[s,n,i,a]);return[o,c]}function Uz({defaultProp:n,onChange:e}){const t=T.useState(n),[r]=t,i=T.useRef(r),s=zi(e);return T.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),t}var Bz="VisuallyHidden",cm=T.forwardRef((n,e)=>l.jsx(Dt.span,{...n,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...n.style}}));cm.displayName=Bz;var zz=cm,NE="ToastProvider",[RE,Vz,Hz]=CE("Toast"),[SF,rie]=Uo("Toast",[Hz]),[Wz,gy]=SF(NE),EF=n=>{const{__scopeToast:e,label:t="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=n,[a,c]=T.useState(null),[u,f]=T.useState(0),p=T.useRef(!1),m=T.useRef(!1);return t.trim()||console.error(`Invalid prop \`label\` supplied to \`${NE}\`. Expected non-empty \`string\`.`),l.jsx(RE.Provider,{scope:e,children:l.jsx(Wz,{scope:e,label:t,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:c,onToastAdd:T.useCallback(()=>f(x=>x+1),[]),onToastRemove:T.useCallback(()=>f(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:o})})};EF.displayName=NE;var MF="ToastViewport",Gz=["F8"],RS="toast.viewportPause",PS="toast.viewportResume",AF=T.forwardRef((n,e)=>{const{__scopeToast:t,hotkey:r=Gz,label:i="Notifications ({hotkey})",...s}=n,o=gy(MF,t),a=Vz(t),c=T.useRef(null),u=T.useRef(null),f=T.useRef(null),p=T.useRef(null),m=Tn(e,p,o.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;T.useEffect(()=>{const y=g=>{var S;r.length!==0&&r.every(M=>g[M]||g.code===M)&&((S=p.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),T.useEffect(()=>{const y=c.current,g=p.current;if(v&&y&&g){const b=()=>{if(!o.isClosePausedRef.current){const R=new CustomEvent(RS);g.dispatchEvent(R),o.isClosePausedRef.current=!0}},S=()=>{if(o.isClosePausedRef.current){const R=new CustomEvent(PS);g.dispatchEvent(R),o.isClosePausedRef.current=!1}},M=R=>{!y.contains(R.relatedTarget)&&S()},A=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",M),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",A),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",M),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[v,o.isClosePausedRef]);const _=T.useCallback(({tabbingDirection:y})=>{const b=a().map(S=>{const M=S.ref.current,A=[M,...i8(M)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return T.useEffect(()=>{const y=p.current;if(y){const g=b=>{var A,R,F;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const L=document.activeElement,N=b.shiftKey;if(b.target===y&&N){(A=u.current)==null||A.focus();return}const O=_({tabbingDirection:N?"backwards":"forwards"}),U=O.findIndex(V=>V===L);cw(O.slice(U+1))?b.preventDefault():N?(R=u.current)==null||R.focus():(F=f.current)==null||F.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[a,_]),l.jsxs(Dz,{ref:c,role:"region","aria-label":i.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(IS,{ref:u,onFocusFromOutsideViewport:()=>{const y=_({tabbingDirection:"forwards"});cw(y)}}),l.jsx(RE.Slot,{scope:t,children:l.jsx(Dt.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(IS,{ref:f,onFocusFromOutsideViewport:()=>{const y=_({tabbingDirection:"backwards"});cw(y)}})]})});AF.displayName=MF;var TF="ToastFocusProxy",IS=T.forwardRef((n,e)=>{const{__scopeToast:t,onFocusFromOutsideViewport:r,...i}=n,s=gy(TF,t);return l.jsx(cm,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});IS.displayName=TF;var xy="Toast",$z="toast.swipeStart",Xz="toast.swipeMove",qz="toast.swipeCancel",Yz="toast.swipeEnd",CF=T.forwardRef((n,e)=>{const{forceMount:t,open:r,defaultOpen:i,onOpenChange:s,...o}=n,[a=!0,c]=Dl({prop:r,defaultProp:i,onChange:s});return l.jsx(Gl,{present:t||a,children:l.jsx(Qz,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:zi(n.onPause),onResume:zi(n.onResume),onSwipeStart:At(n.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:At(n.onSwipeMove,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:At(n.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:At(n.onSwipeEnd,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),c(!1)})})})});CF.displayName=xy;var[Kz,Zz]=SF(xy,{onClose(){}}),Qz=T.forwardRef((n,e)=>{const{__scopeToast:t,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:m,onSwipeEnd:x,...v}
48=n,_=gy(xy,t),[y,g]=T.useState(null),b=Tn(e,V=>g(V)),S=T.useRef(null),M=T.useRef(null),A=i||_.duration,R=T.useRef(0),F=T.useRef(A),L=T.useRef(0),{onToastAdd:N,onToastRemove:I}=_,D=zi(()=>{var Z;(y==null?void 0:y.contains(document.activeElement))&&((Z=_.viewport)==null||Z.focus()),o()}),O=T.useCallback(V=>{!V||V===1/0||(window.clearTimeout(L.current),R.current=new Date().getTime(),L.current=window.setTimeout(D,V))},[D]);T.useEffect(()=>{const V=_.viewport;if(V){const Z=()=>{O(F.current),u==null||u()},Y=()=>{const ne=new Date().getTime()-R.current;F.current=F.current-ne,window.clearTimeout(L.current),c==null||c()};return V.addEventListener(RS,Y),V.addEventListener(PS,Z),()=>{V.removeEventListener(RS,Y),V.removeEventListener(PS,Z)}}},[_.viewport,A,c,u,O]),T.useEffect(()=>{s&&!_.isClosePausedRef.current&&O(A)},[s,A,_.isClosePausedRef,O]),T.useEffect(()=>(N(),()=>I()),[N,I]);const U=T.useMemo(()=>y?kF(y):null,[y]);return _.viewport?l.jsxs(l.Fragment,{children:[U&&l.jsx(Jz,{__scopeToast:t,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),l.jsx(Kz,{scope:t,onClose:D,children:xu.createPortal(l.jsx(RE.ItemSlot,{scope:t,children:l.jsx(Fz,{asChild:!0,onEscapeKeyDown:At(a,()=>{_.isFocusedToastEscapeKeyDownRef.current||D(),_.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(Dt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":_.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:At(n.onKeyDown,V=>{V.key==="Escape"&&(a==null||a(V.nativeEvent),V.nativeEvent.defaultPrevented||(_.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:At(n.onPointerDown,V=>{V.button===0&&(S.current={x:V.clientX,y:V.clientY})}),onPointerMove:At(n.onPointerMove,V=>{if(!S.current)return;const Z=V.clientX-S.current.x,Y=V.clientY-S.current.y,ne=!!M.current,j=["left","right"].includes(_.swipeDirection),$=["left","up"].includes(_.swipeDirection)?Math.min:Math.max,K=j?$(0,Z):0,re=j?0:$(0,Y),xe=V.pointerType==="touch"?10:2,Ce={x:K,y:re},ce={originalEvent:V,delta:Ce};ne?(M.current=Ce,Gg(Xz,p,ce,{discrete:!1})):a3(Ce,_.swipeDirection,xe)?(M.current=Ce,Gg($z,f,ce,{discrete:!1}),V.target.setPointerCapture(V.pointerId)):(Math.abs(Z)>xe||Math.abs(Y)>xe)&&(S.current=null)}),onPointerUp:At(n.onPointerUp,V=>{const Z=M.current,Y=V.target;if(Y.hasPointerCapture(V.pointerId)&&Y.releasePointerCapture(V.pointerId),M.current=null,S.current=null,Z){const ne=V.currentTarget,j={originalEvent:V,delta:Z};a3(Z,_.swipeDirection,_.swipeThreshold)?Gg(Yz,x,j,{discrete:!0}):Gg(qz,m,j,{discrete:!0}),ne.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),_.viewport)})]}):null}),Jz=n=>{const{__scopeToast:e,children:t,...r}=n,i=gy(xy,e),[s,o]=T.useState(!1),[a,c]=T.useState(!1);return n8(()=>o(!0)),T.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:l.jsx(my,{asChild:!0,children:l.jsx(cm,{...r,children:s&&l.jsxs(l.Fragment,{children:[i.label," ",t]})})})},e8="ToastTitle",NF=T.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return l.jsx(Dt.div,{...r,ref:e})});NF.displayName=e8;var t8="ToastDescription",RF=T.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return l.jsx(Dt.div,{...r,ref:e})});RF.displayName=t8;var PF="ToastAction",IF=T.forwardRef((n,e)=>{const{altText:t,...r}=n;return t.trim()?l.jsx(DF,{altText:t,asChild:!0,children:l.jsx(PE,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${PF}\`. Expected non-empty \`string\`.`),null)});IF.displayName=PF;var FF="ToastClose",PE=T.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n,i=Zz(FF,t);return l.jsx(DF,{asChild:!0,children:l.jsx(Dt.button,{type:"button",...r,ref:e,onClick:At(n.onClick,i.onClose)})})});PE.displayName=FF;var DF=T.forwardRef((n,e)=>{const{__scopeToast:t,altText:r,...i}=n;return l.jsx(Dt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function kF(n){const e=[];return Array.from(n.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),r8(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...kF(r))}}),e}function Gg(n,e,t,{discrete:r}){const i=t.originalEvent.currentTarget,s=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?yF(i,s):i.dispatchEvent(s)}var a3=(n,e,t=0)=>{const r=Math.abs(n.x),i=Math.abs(n.y),s=r>i;return e==="left"||e==="right"?s&&r>t:!s&&i>t};function n8(n=()=>{}){const e=zi(n);ni(()=>{let t=0,r=0;return t=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(r)}},[e])}function r8(n){return n.nodeType===n.ELEMENT_NODE}function i8(n){const e=[],t=document.createTreeWalker(n,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(;t.nextNode();)e.push(t.currentNode);return e}function cw(n){const e=document.activeElement;return n.some(t=>t===e?!0:(t.focus(),document.activeElement!==e))}var s8=EF,LF=AF,jF=CF,OF=NF,UF=RF,BF=IF,zF=PE;function VF(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=VF(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function HF(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=VF(n))&&(r&&(r+=" "),r+=e);return r}const l3=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,c3=HF,vy=(n,e)=>t=>{var r;if((e==null?void 0:e.variants)==null)return c3(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(u=>{const f=t==null?void 0:t[u],p=s==null?void 0:s[u];if(f===null)return null;const m=l3(f)||l3(p);return i[u][m]}),a=t&&Object.entries(t).reduce((u,f)=>{let[p,m]=f;return m===void 0||(u[p]=m),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:p,className:m,...x}=f;return Object.entries(x).every(v=>{let[_,y]=v;return Array.isArray(y)?y.includes({...s,...a}[_]):{...s,...a}[_]===y})?[...u,p,m]:u},[]);return c3(n,o,c,t==null?void 0:t.class,t==null?void 0:t.className)};/** 49 * @license lucide-react v0.453.0 - ISC 50 * 51 * This source code is licensed under the ISC license. 52 * See the LICENSE file in the root directory of this source tree. 53 */const o8=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),WF=(...n)=>n.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ");/** 54 * @license lucide-react v0.453.0 - ISC 55 * 56 * This source code is licensed under the ISC license. 57 * See the LICENSE file in the root directory of this source tree. 58 */var a8={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"};/** 59 * @license lucide-react v0.453.0 - ISC 60 * 61 * This source code is licensed under the ISC license. 62 * See the LICENSE file in the root directory of this source tree. 63 */const l8=T.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},c)=>T.createElement("svg",{ref:c,...a8,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:WF("lucide",i),...a},[...o.map(([u,f])=>T.createElement(u,f)),...Array.isArray(s)?s:[s]]));/** 64 * @license lucide-react v0.453.0 - ISC 65 * 66 * This source code is licensed under the ISC license. 67 * See the LICENSE file in the root directory of this source tree. 68 */const Xt=(n,e)=>{const t=T.forwardRef(({className:r,...i},s)=>T.createElement(l8,{ref:s,iconNode:e,className:WF(`lucide-${o8(n)}`,r),...i}));return t.displayName=`${n}`,t};/** 69 * @license lucide-react v0.453.0 - ISC 70 * 71 * This source code is licensed under the ISC license. 72 * See the LICENSE file in the root directory of this source tree. 73 */const c8=Xt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 74 * @license lucide-react v0.453.0 - ISC 75 * 76 * This source code is licensed under the ISC license. 77 * See the LICENSE file in the root directory of this source tree. 78 */const u3=Xt("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 79 * @license lucide-react v0.453.0 - ISC 80 * 81 * This source code is licensed under the ISC license. 82 * See the LICENSE file in the root directory of this source tree. 83 */const kd=Xt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 84 * @license lucide-react v0.453.0 - ISC 85 * 86 * This source code is licensed under the ISC license. 87 * See the LICENSE file in the root directory of this source tree. 88 */const GF=Xt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 89 * @license lucide-react v0.453.0 - ISC 90 * 91 * This source code is licensed under the ISC license. 92 * See the LICENSE file in the root directory of this source tree. 93 */const $F=Xt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 94 * @license lucide-react v0.453.0 - ISC 95 * 96 * This source code is licensed under the ISC license. 97 * See the LICENSE file in the root directory of this source tree. 98 */const u8=Xt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 99 * @license lucide-react v0.453.0 - ISC 100 * 101 * This source code is licensed under the ISC license. 102 * See the LICENSE file in the root directory of this source tree. 103 */const d8=Xt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 104 * @license lucide-react v0.453.0 - ISC 105 * 106 * This source code is licensed under the ISC license. 107 * See the LICENSE file in the root directory of this source tree. 108 */const XF=Xt("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"}]]);/** 109 * @license lucide-react v0.453.0 - ISC 110 * 111 * This source code is licensed under the ISC license. 112 * See the LICENSE file in the root directory of this source tree. 113 */const h8=Xt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 114 * @license lucide-react v0.453.0 - ISC 115 * 116 * This source code is licensed under the ISC license. 117 * See the LICENSE file in the root directory of this source tree. 118 */const qF=Xt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 119 * @license lucide-react v0.453.0 - ISC 120 * 121 * This source code is licensed under the ISC license. 122 * See the LICENSE file in the root directory of this source tree.
123 */const f8=Xt("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"}]]);/** 124 * @license lucide-react v0.453.0 - ISC 125 * 126 * This source code is licensed under the ISC license. 127 * See the LICENSE file in the root directory of this source tree. 128 */const FS=Xt("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"}]]);/** 129 * @license lucide-react v0.453.0 - ISC 130 * 131 * This source code is licensed under the ISC license. 132 * See the LICENSE file in the root directory of this source tree. 133 */const DS=Xt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 134 * @license lucide-react v0.453.0 - ISC 135 * 136 * This source code is licensed under the ISC license. 137 * See the LICENSE file in the root directory of this source tree. 138 */const G0=Xt("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 139 * @license lucide-react v0.453.0 - ISC 140 * 141 * This source code is licensed under the ISC license. 142 * See the LICENSE file in the root directory of this source tree. 143 */const p8=Xt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 144 * @license lucide-react v0.453.0 - ISC 145 * 146 * This source code is licensed under the ISC license. 147 * See the LICENSE file in the root directory of this source tree. 148 */const m8=Xt("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/** 149 * @license lucide-react v0.453.0 - ISC 150 * 151 * This source code is licensed under the ISC license. 152 * See the LICENSE file in the root directory of this source tree. 153 */const g8=Xt("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 154 * @license lucide-react v0.453.0 - ISC 155 * 156 * This source code is licensed under the ISC license. 157 * See the LICENSE file in the root directory of this source tree. 158 */const x8=Xt("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** 159 * @license lucide-react v0.453.0 - ISC 160 * 161 * This source code is licensed under the ISC license. 162 * See the LICENSE file in the root directory of this source tree. 163 */const ru=Xt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 164 * @license lucide-react v0.453.0 - ISC 165 * 166 * This source code is licensed under the ISC license. 167 * See the LICENSE file in the root directory of this source tree. 168 */const YF=Xt("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 169 * @license lucide-react v0.453.0 - ISC 170 * 171 * This source code is licensed under the ISC license. 172 * See the LICENSE file in the root directory of this source tree. 173 */const As=Xt("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** 174 * @license lucide-react v0.453.0 - ISC 175 * 176 * This source code is licensed under the ISC license. 177 * See the LICENSE file in the root directory of this source tree. 178 */const KF=Xt("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 179 * @license lucide-react v0.453.0 - ISC 180 * 181 * This source code is licensed under the ISC license. 182 * See the LICENSE file in the root directory of this source tree. 183 */const $0=Xt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 184 * @license lucide-react v0.453.0 - ISC 185 * 186 * This source code is licensed under the ISC license. 187 * See the LICENSE file in the root directory of this source tree. 188 */const v8=Xt("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** 189 * @license lucide-react v0.453.0 - ISC 190 * 191 * This source code is licensed under the ISC license. 192 * See the LICENSE file in the root directory of this source tree. 193 */const y8=Xt("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** 194 * @license lucide-react v0.453.0 - ISC 195 * 196 * This source code is licensed under the ISC license. 197 * See the LICENSE file in the root directory of this source tree. 198 */const _8=Xt("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"}]]);/** 199 * @license lucide-react v0.453.0 - ISC 200 * 201 * This source code is licensed under the ISC license. 202 * See the LICENSE file in the root directory of this source tree. 203 */const w8=Xt("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 204 * @license lucide-react v0.453.0 - ISC 205 * 206 * This source code is licensed under the ISC license. 207 * See the LICENSE file in the root directory of this source tree. 208 */const d3=Xt("Shield",[["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",ke
208y:"oel41y"}]]);/** 209 * @license lucide-react v0.453.0 - ISC 210 * 211 * This source code is licensed under the ISC license. 212 * See the LICENSE file in the root directory of this source tree. 213 */const b8=Xt("Shuffle",[["path",{d:"M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22",key:"1wmou1"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 6h1.9c1.5 0 2.9.9 3.6 2.2",key:"10bdb2"}],["path",{d:"M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8",key:"vgxac0"}],["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}]]);/** 214 * @license lucide-react v0.453.0 - ISC 215 * 216 * This source code is licensed under the ISC license. 217 * See the LICENSE file in the root directory of this source tree. 218 */const S8=Xt("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/** 219 * @license lucide-react v0.453.0 - ISC 220 * 221 * This source code is licensed under the ISC license. 222 * See the LICENSE file in the root directory of this source tree. 223 */const E8=Xt("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** 224 * @license lucide-react v0.453.0 - ISC 225 * 226 * This source code is licensed under the ISC license. 227 * See the LICENSE file in the root directory of this source tree. 228 */const uw=Xt("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 229 * @license lucide-react v0.453.0 - ISC 230 * 231 * This source code is licensed under the ISC license. 232 * See the LICENSE file in the root directory of this source tree. 233 */const M8=Xt("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 234 * @license lucide-react v0.453.0 - ISC 235 * 236 * This source code is licensed under the ISC license. 237 * See the LICENSE file in the root directory of this source tree. 238 */const A8=Xt("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** 239 * @license lucide-react v0.453.0 - ISC 240 * 241 * This source code is licensed under the ISC license. 242 * See the LICENSE file in the root directory of this source tree. 243 */const T8=Xt("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"}]]);/** 244 * @license lucide-react v0.453.0 - ISC 245 * 246 * This source code is licensed under the ISC license. 247 * See the LICENSE file in the root directory of this source tree. 248 */const h3=Xt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 249 * @license lucide-react v0.453.0 - ISC 250 * 251 * This source code is licensed under the ISC license. 252 * See the LICENSE file in the root directory of this source tree. 253 */const C8=Xt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 254 * @license lucide-react v0.453.0 - ISC 255 * 256 * This source code is licensed under the ISC license. 257 * See the LICENSE file in the root directory of this source tree. 258 */const N8=Xt("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"}]]);/** 259 * @license lucide-react v0.453.0 - ISC 260 * 261 * This source code is licensed under the ISC license. 262 * See the LICENSE file in the root directory of this source tree. 263 */const yy=Xt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 8,468 bytes, lines 263-268
263],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 264 * @license lucide-react v0.453.0 - ISC 265 * 266 * This source code is licensed under the ISC license. 267 * See the LICENSE file in the root directory of this source tree. 268 */const R8=Xt("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),IE="-",P8=n=>{const e=F8(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{const a=o.split(IE);return a[0]===""&&a.length!==1&&a.shift(),ZF(a,e)||I8(o)},getConflictingClassGroupIds:(o,a)=>{const c=t[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},ZF=(n,e)=>{var o;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),i=r?ZF(n.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=n.join(IE);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},f3=/^\[(.+)\]$/,I8=n=>{if(f3.test(n)){const e=f3.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},F8=n=>{const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return k8(Object.entries(n.classGroups),t).forEach(([s,o])=>{kS(o,r,s,e)}),r},kS=(n,e,t,r)=>{n.forEach(i=>{if(typeof i=="string"){const s=i===""?e:p3(e,i);s.classGroupId=t;return}if(typeof i=="function"){if(D8(i)){kS(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([s,o])=>{kS(o,p3(e,s),t,r)})})},p3=(n,e)=>{let t=n;return e.split(IE).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},D8=n=>n.isThemeGetter,k8=(n,e)=>e?n.map(([t,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[t,i]}):n,L8=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const i=(s,o)=>{t.set(s,o),e++,e>n&&(e=0,r=t,t=new Map)};return{get(s){let o=t.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){t.has(s)?t.set(s,o):i(s,o)}}},QF="!",j8=n=>{const{separator:e,experimentalParseClassName:t}=n,r=e.length===1,i=e[0],s=e.length,o=a=>{const c=[];let u=0,f=0,p;for(let y=0;y<a.length;y++){let g=a[y];if(u===0){if(g===i&&(r||a.slice(y,y+s)===e)){c.push(a.slice(f,y)),f=y+s;continue}if(g==="/"){p=y;continue}}g==="["?u++:g==="]"&&u--}const m=c.length===0?a:a.substring(f),x=m.startsWith(QF),v=x?m.substring(1):m,_=p&&p>f?p-f:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:_}};return t?a=>t({className:a,parseClassName:o}):o},O8=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e},U8=n=>({cache:L8(n.cacheSize),parseClassName:j8(n),...P8(n)}),B8=/\s+/,z8=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=n.trim().split(B8);let a="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:f,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:x}=t(u);let v=!!x,_=r(v?m.substring(0,x):m);if(!_){if(!v){a=u+(a.length>0?" "+a:a);continue}if(_=r(m),!_){a=u+(a.length>0?" "+a:a);continue}v=!1}const y=O8(f).join(":"),g=p?y+QF:y,b=g+_;if(s.includes(b))continue;s.push(b);const S=i(_,v);for(let M=0;M<S.length;++M){const A=S[M];s.push(g+A)}a=u+(a.length>0?" "+a:a)}return a};function V8(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=JF(e))&&(r&&(r+=" "),r+=t);return r}const JF=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=JF(n[r]))&&(t&&(t+=" "),t+=e);return t};function H8(n,...e){let t,r,i,s=o;function o(c){const u=e.reduce((f,p)=>p(f),n());return t=U8(u),r=t.cache.get,i=t.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const f=z8(c,t);return i(c,f),f}return function(){return s(V8.apply(null,arguments))}}const Rn=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},eD=/^\[(?:([a-z-]+):)?(.+)\]$/i,W8=/^\d+\/\d+$/,G8=new Set(["px","full","screen"]),$8=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,X8=/\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$/,q8=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Y8=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,K8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ko=n=>Ld(n)||G8.has(n)||W8.test(n),Ga=n=>Ih(n,"length",iV),Ld=n=>!!n&&!Number.isNaN(Number(n)),dw=n=>Ih(n,"number",Ld),mf=n=>!!n&&Number.isInteger(Number(n)),Z8=n=>n.endsWith("%")&&Ld(n.slice(0,-1)),Vt=n=>eD.test(n),$a=n=>$8.test(n),Q8=new Set(["length","size","percentage"]),J8=n=>Ih(n,Q8,tD),eV=n=>Ih(n,"position",tD),tV=new Set(["image","url"]),nV=n=>Ih(n,tV,oV),rV=n=>Ih(n,"",sV),gf=()=>!0,Ih=(n,e,t)=>{const r=eD.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1},iV=n=>X8.test(n)&&!q8.test(n),tD=()=>!1,sV=n=>Y8.test(n),oV=n=>K8.test(n),aV=()=>{const n=Rn("colors"),e=Rn("spacing"),t=Rn("blur"),r=Rn("brightness"),i=Rn("borderColor"),s=Rn("borderRadius"),o=Rn("borderSpacing"),a=Rn("borderWidth"),c=Rn("contrast"),u=Rn("grayscale"),f=Rn("hueRotate"),p=Rn("invert"),m=Rn("gap"),x=Rn("gradientColorStops"),v=Rn("gradientColorStopPositions"),_=Rn("inset"),y=Rn("margin"),g=Rn("opacity"),b=Rn("padding"),S=Rn("saturate"),M=Rn("scale"),A=Rn("sepia"),R=Rn("skew"),F=Rn("space"),L=Rn("translate"),N=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",Vt,e],O=()=>[Vt,e],U=()=>["",Ko,Ga],V=()=>["auto",Ld,Vt],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",Vt],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[Ld,Vt];return{cacheSize:500,separator:":",theme:{colors:[gf],spacing:[Ko,Ga],blur:["none","",$a,Vt],brightness:re(),borderColor:[n],borderRadius:["none","","full",$a,Vt],borderSpacing:O(),borderWidth:U(),contrast:re(),grayscale:$(),hueRotate:re(),invert:$(),gap:O(),gradientColorStops:[n],gradientColorStopPositions:[Z8,Ga],inset:D(),margin:D(),opacity:re(),padding:O(),saturate:re(),scale:re(),sepia:$(),skew:re(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",Vt]}],container:["container"],columns:[{columns:[$a]}],"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:[...Z(),Vt]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mf,Vt]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Vt]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",mf,Vt]}],"grid-cols":[{"grid-cols":[gf]}],"col-start-end":[{col:["auto",{span:["full",mf,Vt]},Vt]}],"col-start":[{"col-start":V()}
vendor: 9,129 bytes, line 268
268],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[gf]}],"row-start-end":[{row:["auto",{span:[mf,Vt]},Vt]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Vt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Vt]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Vt,e]}],"min-w":[{"min-w":[Vt,e,"min","max","fit"]}],"max-w":[{"max-w":[Vt,e,"none","full","min","max","fit","prose",{screen:[$a]},$a]}],h:[{h:[Vt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Vt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Vt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Vt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",$a,Ga]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dw]}],"font-family":[{font:[gf]}],"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",Vt]}],"line-clamp":[{"line-clamp":["none",Ld,dw]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ko,Vt]}],"list-image":[{"list-image":["none",Vt]}],"list-style-type":[{list:["none","disc","decimal",Vt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ko,Ga]}],"underline-offset":[{"underline-offset":["auto",Ko,Vt]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Vt]}],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",Vt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),eV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",J8]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nV]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Y()}],"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:["",...Y()]}],"outline-offset":[{"outline-offset":[Ko,Vt]}],"outline-w":[{outline:[Ko,Ga]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Ko,Ga]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",$a,rV]}],"shadow-color":[{shadow:[gf]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",$a,Vt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[p]}],saturate:[{saturate:[S]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Vt]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",Vt]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",Vt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[mf,Vt]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Vt]}],accent:[{accent:["auto",n]}],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",Vt]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}
vendor: 4,942 bytes, line 268
268],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Vt]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Ko,Ga,dw]}],stroke:[{stroke:[n,"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"]}}},lV=H8(aV);function Ct(...n){return lV(HF(n))}const cV=s8,nD=T.forwardRef(({className:n,...e},t)=>l.jsx(LF,{ref:t,className:Ct("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]",n),...e}));nD.displayName=LF.displayName;const uV=vy("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"}}),rD=T.forwardRef(({className:n,variant:e,...t},r)=>l.jsx(jF,{ref:r,className:Ct(uV({variant:e}),n),...t}));rD.displayName=jF.displayName;const dV=T.forwardRef(({className:n,...e},t)=>l.jsx(BF,{ref:t,className:Ct("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",n),...e}));dV.displayName=BF.displayName;const iD=T.forwardRef(({className:n,...e},t)=>l.jsx(zF,{ref:t,className:Ct("absolute right-2 top-2 rounded-md p-1 text-foreground
vendor: 4,162 bytes, line 268
268/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",n),"toast-close":"",...e,children:l.jsx(yy,{className:"h-4 w-4"})}));iD.displayName=zF.displayName;const sD=T.forwardRef(({className:n,...e},t)=>l.jsx(OF,{ref:t,className:Ct("text-sm font-semibold",n),...e}));sD.displayName=OF.displayName;const oD=T.forwardRef(({className:n,...e},t)=>l.jsx(UF,{ref:t,className:Ct("text-sm opacity-90",n),...e}));oD.displayName=UF.displayName;function hV(){const{toasts:n}=Mn();return l.jsxs(cV,{children:[n.map(function({id:e,title:t,description:r,action:i,...s}){return l.jsxs(rD,{...s,children:[l.jsxs("div",{className:"grid gap-1",children:[t&&l.jsx(sD,{children:t}),r&&l.jsx(oD,{children:r})]}),i,l.jsx(iD,{})]},e)}),l.jsx(nD,{})]})}var fV=OP[" useId ".trim().toString()]||(()=>{}),pV=0;function xa(n){const[e,t]=T.useState(fV());return ni(()=>{t(r=>r??String(pV++))},[n]),e?`radix-${e}`:""}const mV=["top","right","bottom","left"],kl=Math.min,Ji=Math.max,X0=Math.round,$g=Math.floor,Po=n=>({x:n,y:n}),gV={left:"right",right:"left",bottom:"top",top:"bottom"},xV={start:"end",end:"start"};function LS(n,e,t){return Ji(n,kl(e,t))}function Ma(n,e){return typeof n=="function"?n(e):n}function Aa(n){return n.split("-")[0]}function Fh(n){return n.split("-")[1]}function FE(n){return n==="x"?"y":"x"}function DE(n){return n==="y"?"height":"width"}function Ll(n){return["top","bottom"].includes(Aa(n))?"y":"x"}function kE(n){return FE(Ll(n))}function vV(n,e,t){t===void 0&&(t=!1);const r=Fh(n),i=kE(n),s=DE(i);let o=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=q0(o)),[o,q0(o)]}function yV(n){const e=q0(n);return[jS(n),e,jS(e)]}function jS(n){return n.replace(/start|end/g,e=>xV[e])}function _V(n,e,t){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(n){case"top":case"bottom":return t?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function wV(n,e,t,r){const i=Fh(n);let s=_V(Aa(n),t==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(jS)))),s}function q0(n){return n.replace(/left|right|bottom|top/g,e=>gV[e])}function bV(n){return{top:0,right:0,bottom:0,left:0,...n}}function aD(n){return typeof n!="number"?bV(n):{top:n,right:n,bottom:n,left:n}}function Y0(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function m3(n,e,t){let{reference:r,floating:i}=n;const s=Ll(e),o=kE(e),a=DE(o),c=Aa(e),u=s==="y",f=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,m=r[a]/2-i[a]/2;let x;switch(c){case"top":x={x:f,y:r.y-i.height};break;case"bottom":x={x:f,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-i.width,y:p};break;default:x={x:r.x,y:r.y}}switch(Fh(e)){case"start":x[o]-=m*(t&&u?-1:1);break;case"end":x[o]+=m*(t&&u?-1:1);break}return x}const SV=async(n,e,t)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:n,floating:e,strategy:i}),{x:f,y:p}=m3(u,r,c),m=r,x={},v=0;for(let _=0;_<a.length;_++){const{name:y,fn:g}=a[_],{x:b,y:S,data:M,reset:A}=await g({x:f,y:p,initialPlacement:r,placement:m,strategy:i,middlewareData:x,rects:u,platform:o,elements:{reference:n,floating:e}});f=b??f,p=S??p,x={...x,[y]:{...x[y],...M}},A&&v<=50&&(v++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(u=A.rects===!0?await o.getElementRects({reference:n,floating:e,strategy:i}):A.rects),{x:f,y:p}=m3(u,m,c)),_=-1)}return{x:f,y:p,placement:m,strategy:i,middlewareData:x}};async function Fp(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=n,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:x=0}=Ma(e,n),v=aD(x),y=a[m?p==="floating"?"reference":"floating":p],g=Y0(await s.getClippingRect
vendor: 8,804 bytes, line 268
268({element:(t=await(s.isElement==null?void 0:s.isElement(y)))==null||t?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:c})),b=p==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),M=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},A=Y0(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:c}):b);return{top:(g.top-A.top+v.top)/M.y,bottom:(A.bottom-g.bottom+v.bottom)/M.y,left:(g.left-A.left+v.left)/M.x,right:(A.right-g.right+v.right)/M.x}}const EV=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:u,padding:f=0}=Ma(n,e)||{};if(u==null)return{};const p=aD(f),m={x:t,y:r},x=kE(i),v=DE(x),_=await o.getDimensions(u),y=x==="y",g=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",M=s.reference[v]+s.reference[x]-m[x]-s.floating[v],A=m[x]-s.reference[x],R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let F=R?R[S]:0;(!F||!await(o.isElement==null?void 0:o.isElement(R)))&&(F=a.floating[S]||s.floating[v]);const L=M/2-A/2,N=F/2-_[v]/2-1,I=kl(p[g],N),D=kl(p[b],N),O=I,U=F-_[v]-D,V=F/2-_[v]/2+L,Z=LS(O,V,U),Y=!c.arrow&&Fh(i)!=null&&V!==Z&&s.reference[v]/2-(V<O?I:D)-_[v]/2<0,ne=Y?V<O?V-O:V-U:0;return{[x]:m[x]+ne,data:{[x]:Z,centerOffset:V-Z-ne,...Y&&{alignmentOffset:ne}},reset:Y}}}),MV=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:_=!0,...y}=Ma(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const g=Aa(i),b=Ll(a),S=Aa(a)===a,M=await(c.isRTL==null?void 0:c.isRTL(u.floating)),A=m||(S||!_?[q0(a)]:yV(a)),R=v!=="none";!m&&R&&A.push(...wV(a,_,v,M));const F=[a,...A],L=await Fp(e,y),N=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&N.push(L[g]),p){const V=vV(i,o,M);N.push(L[V[0]],L[V[1]])}if(I=[...I,{placement:i,overflows:N}],!N.every(V=>V<=0)){var D,O;const V=(((D=s.flip)==null?void 0:D.index)||0)+1,Z=F[V];if(Z)return{data:{index:V,overflows:I},reset:{placement:Z}};let Y=(O=I.filter(ne=>ne.overflows[0]<=0).sort((ne,j)=>ne.overflows[1]-j.overflows[1])[0])==null?void 0:O.placement;if(!Y)switch(x){case"bestFit":{var U;const ne=(U=I.filter(j=>{if(R){const $=Ll(j.placement);return $===b||$==="y"}return!0}).map(j=>[j.placement,j.overflows.filter($=>$>0).reduce(($,K)=>$+K,0)]).sort((j,$)=>j[1]-$[1])[0])==null?void 0:U[0];ne&&(Y=ne);break}case"initialPlacement":Y=a;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};function g3(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function x3(n){return mV.some(e=>n[e]>=0)}const AV=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=Ma(n,e);switch(r){case"referenceHidden":{const s=await Fp(e,{...i,elementContext:"reference"}),o=g3(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:x3(o)}}}case"escaped":{const s=await Fp(e,{...i,altBoundary:!0}),o=g3(s,t.floating);return{data:{escapedOffsets:o,escaped:x3(o)}}}default:return{}}}}};async function TV(n,e){const{placement:t,platform:r,elements:i}=n,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Aa(t),a=Fh(t),c=Ll(t)==="y",u=["left","top"].includes(o)?-1:1,f=s&&c?-1:1,p=Ma(e,n);let{mainAxis:m,crossAxis:x,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof v=="number"&&(x=a==="end"?v*-1:v),c?{x:x*f,y:m*u}:{x:m*u,y:x*f}}const CV=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await TV(e,n);return o===((t=a.offset)==null?void 0:t.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},NV=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:g,y:b}=y;return{x:g,y:b}}},...c}=Ma(n,e),u={x:t,y:r},f=await Fp(e,c),p=Ll(Aa(i)),m=FE(p);let x=u[m],v=u[p];if(s){const y=m==="y"?"top":"left",g=m==="y"?"bottom":"right",b=x+f[y],S=x-f[g];x=LS(b,x,S)}if(o){const y=p==="y"?"top":"left",g=p==="y"?"bottom":"right",b=v+f[y],S=v-f[g];v=LS(b,v,S)}const _=a.fn({...e,[m]:x,[p]:v});return{..._,data:{x:_.x-t,y:_.y-r,enabled:{[m]:s,[p]:o}}}}}},RV=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Ma(n,e),f={x:t,y:r},p=Ll(i),m=FE(p);let x=f[m],v=f[p];const _=Ma(a,e),y=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(c){const S=m==="y"?"height":"width",M=s.reference[m]-s.floating[S]+y.mainAxis,A=s.reference[m]+s.reference[S]-y.mainAxis;x<M?x=M:x>A&&(x=A)}if(u){var g,b;const S=m==="y"?"width":"height",M=["top","left"].includes(Aa(i)),A=s.reference[p]-s.floating[S]+(M&&((g=o.offset)==null?void 0:g[p])||0)+(M?0:y.crossAxis),R=s.reference[p]+s.reference[S]+(M?0:((b=o.offset)==null?void 0:b[p])||0)-(M?y.crossAxis:0);v<A?v=A:v>R&&(v=R)}return{[m]:x,[p]:v}}}},PV=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:c=()=>{},...u}=Ma(n,e),f=await Fp(e,u),p=Aa(i),m=Fh(i),x=Ll(i)==="y",{width:v,height:_}=s.floating;let y,g;p==="top"||p==="bottom"?(y=p,g=m===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(g=p,y=m==="end"?"top":"bottom");const b=_-f.top-f.bottom,S=v-f.left-f.right,M=kl(_-f[y],b),A=kl(v-f[g],S),R=!e.middlewareData.shift;let F=M,L=A;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(L=S),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(F=b),R&&!m){const I=Ji(f.left,0),D=Ji(f.right,0),O=Ji(f.top,0),U=Ji(f.bottom,0);x?L=v-2*(I!==0||D!==0?I+D:Ji(f.left,f.right)):F=_-2*(O!==0||U!==0?O+U:Ji(f.top,f.bottom))}await c({...e,availableWidth:L,availableHeight:F});const N=await o.getDimensions(a.floating);return v!==N.width||_!==N.height?{reset:{rects:!0}}:{}}}};function _y(){return typeof window<"u"}function Dh(n){return lD(n)?(n.nodeName||"").toLowerCase():"#document"}function ss(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Bo(n){var e;return(e=(lD(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function lD(n){return _y()?n instanceof Node||n instanceof ss(n).Node:!1}function ro(n){return _y()?n instanceof Element||n instanceof ss(n).Element:!1}function jo(n){return _y()?n instanceof HTMLElement||n instanceof ss(n).HTMLElement:!1}function v3(n){return!_y()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof ss(n).ShadowRoot}function um(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=io(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function IV(n){return["table","td","th"].includes(Dh(n))}function wy(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function LE(n){const e=jE(),t=ro(n)?io(n):n;return["transform","translate","scale","rotate","perspective"].some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function FV(n){let e=jl(n);for(;jo(e)&&!dh(e);){if(LE(e))return e;if(wy(e))return null;e=jl(e)}return null}function jE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function dh(n){return["html","body","#document"].includes(Dh(n))}function io(n){return ss(n).getComputedStyle(n)}function by(n){return ro(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function jl(n){if(Dh(n)==="html")return n;const e=n.assignedSlot||n.parentNode||v3(n)&&n.host||Bo(n);return v3(e)?e.host:e}function cD(n){const e=jl(n);return dh(e)?n.ownerDocument?n.ownerDocument.body:n.body:jo(e)&&um(e)?e:cD(e)}function Dp(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=cD(n),s=i===((r=n.ownerDocument)==null?void 0:r.body),o=ss(i);if(s){const a=OS(o);
vendor: 7,338 bytes, line 268
268return e.concat(o,o.visualViewport||[],um(i)?i:[],a&&t?Dp(a):[])}return e.concat(i,Dp(i,[],t))}function OS(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function uD(n){const e=io(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=jo(n),s=i?n.offsetWidth:t,o=i?n.offsetHeight:r,a=X0(t)!==s||X0(r)!==o;return a&&(t=s,r=o),{width:t,height:r,$:a}}function OE(n){return ro(n)?n:n.contextElement}function jd(n){const e=OE(n);if(!jo(e))return Po(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:s}=uD(e);let o=(s?X0(t.width):t.width)/r,a=(s?X0(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const DV=Po(0);function dD(n){const e=ss(n);return!jE()||!e.visualViewport?DV:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function kV(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==ss(n)?!1:e}function iu(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=OE(n);let o=Po(1);e&&(r?ro(r)&&(o=jd(r)):o=jd(n));const a=kV(s,t,r)?dD(s):Po(0);let c=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,p=i.height/o.y;if(s){const m=ss(s),x=r&&ro(r)?ss(r):r;let v=m,_=OS(v);for(;_&&r&&x!==v;){const y=jd(_),g=_.getBoundingClientRect(),b=io(_),S=g.left+(_.clientLeft+parseFloat(b.paddingLeft))*y.x,M=g.top+(_.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,u*=y.y,f*=y.x,p*=y.y,c+=S,u+=M,v=ss(_),_=OS(v)}}return Y0({width:f,height:p,x:c,y:u})}function UE(n,e){const t=by(n).scrollLeft;return e?e.left+t:iu(Bo(n)).left+t}function hD(n,e,t){t===void 0&&(t=!1);const r=n.getBoundingClientRect(),i=r.left+e.scrollLeft-(t?0:UE(n,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function LV(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const s=i==="fixed",o=Bo(r),a=e?wy(e.floating):!1;if(r===o||a&&s)return t;let c={scrollLeft:0,scrollTop:0},u=Po(1);const f=Po(0),p=jo(r);if((p||!p&&!s)&&((Dh(r)!=="body"||um(o))&&(c=by(r)),jo(r))){const x=iu(r);u=jd(r),f.x=x.x+r.clientLeft,f.y=x.y+r.clientTop}const m=o&&!p&&!s?hD(o,c,!0):Po(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:t.y*u.y-c.scrollTop*u.y+f.y+m.y}}function jV(n){return Array.from(n.getClientRects())}function OV(n){const e=Bo(n),t=by(n),r=n.ownerDocument.body,i=Ji(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Ji(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-t.scrollLeft+UE(n);const a=-t.scrollTop;return io(r).direction==="rtl"&&(o+=Ji(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function UV(n,e){const t=ss(n),r=Bo(n),i=t.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const u=jE();(!u||u&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function BV(n,e){const t=iu(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,s=jo(n)?jd(n):Po(1),o=n.clientWidth*s.x,a=n.clientHeight*s.y,c=i*s.x,u=r*s.y;return{width:o,height:a,x:c,y:u}}function y3(n,e,t){let r;if(e==="viewport")r=UV(n,t);else if(e==="document")r=OV(Bo(n));else if(ro(e))r=BV(e,t);else{const i=dD(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Y0(r)}function fD(n,e){const t=jl(n);return t===e||!ro(t)||dh(t)?!1:io(t).position==="fixed"||fD(t,e)}function zV(n,e){const t=e.get(n);if(t)return t;let r=Dp(n,[],!1).filter(a=>ro(a)&&Dh(a)!=="body"),i=null;const s=io(n).position==="fixed";let o=s?jl(n):n;for(;ro(o)&&!dh(o);){const a=io(o),c=LE(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||um(o)&&!c&&fD(n,o))?r=r.filter(f=>f!==o):i=a,o=jl(o)}return e.set(n,r),r}function VV(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=[...t==="clippingAncestors"?wy(e)?[]:zV(e,this._c):[].concat(t),r],a=o[0],c=o.reduce((u,f)=>{const p=y3(e,f,i);return u.top=Ji(p.top,u.top),u.right=kl(p.right,u.right),u.bottom=kl(p.bottom,u.bottom),u.left=Ji(p.left,u.left),u},y3(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function HV(n){const{width:e,height:t}=uD(n);return{width:e,height:t}}function WV(n,e,t){const r=jo(e),i=Bo(e),s=t==="fixed",o=iu(n,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=Po(0);if(r||!r&&!s)if((Dh(e)!=="body"||um(i))&&(a=by(e)),r){const m=iu(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else i&&(c.x=UE(i));const u=i&&!r&&!s?hD(i,a):Po(0),f=o.left+a.scrollLeft-c.x-u.x,p=o.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:o.width,height:o.height}}function hw(n){return io(n).position==="static"}function _3(n,e){if(!jo(n)||io(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Bo(n)===t&&(t=t.ownerDocument.body),t}function pD(n,e){const t=ss(n);if(wy(n))return t;if(!jo(n)){let i=jl(n);for(;i&&!dh(i);){if(ro(i)&&!hw(i))return i;i=jl(i)}return t}let r=_3(n,e);for(;r&&IV(r)&&hw(r);)r=_3(r,e);return r&&dh(r)&&hw(r)&&!LE(r)?t:r||FV(n)||t}const GV=async function(n){const e=this.getOffsetParent||pD,t=this.getDimensions,r=await t(n.floating);return{reference:WV(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $V(n){return io(n).direction==="rtl"}const XV={convertOffsetParentRelativeRectToViewportRelativeRect:LV,getDocumentElement:Bo,getClippingRect:VV,getOffsetParent:pD,getElementRects:GV,getClientRects:jV,getDimensions:HV,getScale:jd,isElement:ro,isRTL:$V};function mD(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function qV(n,e){let t=null,r;const i=Bo(n);function s(){var a;clearTimeout(r),(a=t)==null||a.disconnect(),t=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=n.getBoundingClientRect(),{left:f,top:p,width:m,height:x}=u;if(a||e(),!m||!x)return;const v=$g(p),_=$g(i.clientWidth-(f+m)),y=$g(i.clientHeight-(p+x)),g=$g(f),S={rootMargin:-v+"px "+-_+"px "+-y+"px "+-g+"px",threshold:Ji(0,kl(1,c))||1};let M=!0;function A(R){const F=R[0].intersectionRatio;if(F!==c){if(!M)return o();F?o(!1,F):r=setTimeout(()=>{o(!1,1e-7)},1e3)}F===1&&!mD(u,n.getBoundingClientRect())&&o(),M=!1}try{t=new IntersectionObserver(A,{...S,root:i.ownerDocument})}catch{t=new IntersectionObserver(A,S)}t.observe(n)}return o(!0),s}function YV(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=OE(n),f=i||s?[...u?Dp(u):[],...Dp(e)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",t,{passive:!0}),s&&g.addEventListener("resize",t)});const p=u&&a?qV(u,t):null;let m=-1,x=null;o&&(x=new ResizeObserver(g=>{let[b]=g;b&&b.target===u&&x&&(x.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=x)==null||S.observe(e)})),t()}),u&&!c&&x.observe(u),x.observe(e));let v,_=c?iu(n):null;c&&y();function y(){const g=iu(n);_&&!mD(_,g)&&t(),_=g,v=requestAnimationFrame(y)}return t(),()=>{var g;f.forEach(b=>{i&&b.removeEventListener("scroll",t),s&&b.removeEventListener("resize",t)}),p==null||p(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(v)}}const KV=CV,ZV=NV,QV=MV,JV=PV,eH=AV,w3=EV,tH=RV,nH=(n,e,t)=>{const r=new Map,i={platform:XV,...t},s={...i.platform,_c:r};return SV(n,e,{...i,platform:s})};var a0=typeof document<"u"?T.useLayoutEffect:T.useEffect;function K0(n,e){if(n===e)return!0;
vendor: 4,926 bytes, line 268
268if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!K0(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!==0;){const s=i[r];if(!(s==="_owner"&&n.$$typeof)&&!K0(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function gD(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function b3(n,e){const t=gD(n);return Math.round(e*t)/t}function fw(n){const e=T.useRef(n);return a0(()=>{e.current=n}),e}function rH(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:u}=n,[f,p]=T.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[m,x]=T.useState(r);K0(m,r)||x(r);const[v,_]=T.useState(null),[y,g]=T.useState(null),b=T.useCallback(j=>{j!==R.current&&(R.current=j,_(j))},[]),S=T.useCallback(j=>{j!==F.current&&(F.current=j,g(j))},[]),M=s||v,A=o||y,R=T.useRef(null),F=T.useRef(null),L=T.useRef(f),N=c!=null,I=fw(c),D=fw(i),O=fw(u),U=T.useCallback(()=>{if(!R.current||!F.current)return;const j={placement:e,strategy:t,middleware:m};D.current&&(j.platform=D.current),nH(R.current,F.current,j).then($=>{const K={...$,isPositioned:O.current!==!1};V.current&&!K0(L.current,K)&&(L.current=K,xu.flushSync(()=>{p(K)}))})},[m,e,t,D,O]);a0(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,p(j=>({...j,isPositioned:!1})))},[u]);const V=T.useRef(!1);a0(()=>(V.current=!0,()=>{V.current=!1}),[]),a0(()=>{if(M&&(R.current=M),A&&(F.current=A),M&&A){if(I.current)return I.current(M,A,U);U()}},[M,A,U,I,N]);const Z=T.useMemo(()=>({reference:R,floating:F,setReference:b,setFloating:S}),[b,S]),Y=T.useMemo(()=>({reference:M,floating:A}),[M,A]),ne=T.useMemo(()=>{const j={position:t,left:0,top:0};if(!Y.floating)return j;const $=b3(Y.floating,f.x),K=b3(Y.floating,f.y);return a?{...j,transform:"translate("+$+"px, "+K+"px)",...gD(Y.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:$,top:K}},[t,a,Y.floating,f.x,f.y]);return T.useMemo(()=>({...f,update:U,refs:Z,elements:Y,floatingStyles:ne}),[f,U,Z,Y,ne])}const iH=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:r,padding:i}=typeof n=="function"?n(t):n;return r&&e(r)?r.current!=null?w3({element:r.current,padding:i}).fn(t):{}:r?w3({element:r,padding:i}).fn(t):{}}}},sH=(n,e)=>({...KV(n),options:[n,e]}),oH=(n,e)=>({...ZV(n),options:[n,e]}),aH=(n,e)=>({...tH(n),options:[n,e]}),lH=(n,e)=>({...QV(n),options:[n,e]}),cH=(n,e)=>({...JV(n),options:[n,e]}),uH=(n,e)=>({...eH(n),options:[n,e]}),dH=(n,e)=>({...iH(n),options:[n,e]});var hH="Arrow",xD=T.forwardRef((n,e)=>{const{children:t,width:r=10,height:i=5,...s}=n;return l.jsx(Dt.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});xD.displayName=hH;var fH=xD;function vD(n){const[e,t]=T.useState(void 0);return ni(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,a=u.blockSize}else o=n.offsetWidth,a=n.offsetHeight;t({width:o,height:a})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}else t(void 0)},[n]),e}var BE="Popper",[yD,Sy]=Uo(BE),[pH,_D]=yD(BE),wD=n=>{const{__scopePopper:e,children:t}=n,[r,i]=T.useState(null);return l.jsx(pH,{scope:e,anchor:r,onAnchorChange:i,children:t})};wD.displayName=BE;var bD="PopperAnchor",SD=T.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,s=_D(bD,t),o=T.useRef(null),a=Tn(e,o);return T.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:l.jsx(Dt.div,{...i,ref:a})});SD.displayName=bD;var zE="PopperContent",[mH,gH]=yD(zE),ED=T.forwardRef((n,e)=>{var pe,je,nt,Pe,Ie,He;const{__scopePopper:t,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:x="optimized",onPlaced:v,..._}=n,y=_D(zE,t),[g,b]=T.useState(null),S=Tn(e,ze=>b(ze)),[M,A]=T.useState(null),R=vD(M),F=(R==null?void 0:R.width)??0,L=(R==null?void 0:R.height)??0,N=r+(s!=="center"?"-"+s:""),I=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(u)?u:[u],O=D.length>0,U={padding:I,boundary:D.filter(vH),altBoundary:O},{refs:V,floatingStyles:Z,placement:Y,isPositioned:ne,middlewareData:j}=rH({strategy:"fixed",placement:N,whileElementsMounted:(...ze)=>YV(...ze,{animationFrame:x==="always"}
vendor: 6,818 bytes, line 268
268),elements:{reference:y.anchor},middleware:[sH({mainAxis:i+L,alignmentAxis:o}),c&&oH({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?aH():void 0,...U}),c&&lH({...U}),cH({...U,apply:({elements:ze,rects:H,availableWidth:Fe,availableHeight:Ae})=>{const{width:Te,height:be}=H.reference,Ke=ze.floating.style;Ke.setProperty("--radix-popper-available-width",`${Fe}px`),Ke.setProperty("--radix-popper-available-height",`${Ae}px`),Ke.setProperty("--radix-popper-anchor-width",`${Te}px`),Ke.setProperty("--radix-popper-anchor-height",`${be}px`)}}),M&&dH({element:M,padding:a}),yH({arrowWidth:F,arrowHeight:L}),m&&uH({strategy:"referenceHidden",...U})]}),[$,K]=TD(Y),re=zi(v);ni(()=>{ne&&(re==null||re())},[ne,re]);const xe=(pe=j.arrow)==null?void 0:pe.x,Ce=(je=j.arrow)==null?void 0:je.y,ce=((nt=j.arrow)==null?void 0:nt.centerOffset)!==0,[_e,Re]=T.useState();return ni(()=>{g&&Re(window.getComputedStyle(g).zIndex)},[g]),l.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:ne?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(Pe=j.transformOrigin)==null?void 0:Pe.x,(Ie=j.transformOrigin)==null?void 0:Ie.y].join(" "),...((He=j.hide)==null?void 0:He.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:l.jsx(mH,{scope:t,placedSide:$,onArrowChange:A,arrowX:xe,arrowY:Ce,shouldHideArrow:ce,children:l.jsx(Dt.div,{"data-side":$,"data-align":K,..._,ref:S,style:{..._.style,animation:ne?void 0:"none"}})})})});ED.displayName=zE;var MD="PopperArrow",xH={top:"bottom",right:"left",bottom:"top",left:"right"},AD=T.forwardRef(function(e,t){const{__scopePopper:r,...i}=e,s=gH(MD,r),o=xH[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(fH,{...i,ref:t,style:{...i.style,display:"block"}})})});AD.displayName=MD;function vH(n){return n!==null}var yH=n=>({name:"transformOrigin",options:n,fn(e){var y,g,b;const{placement:t,rects:r,middlewareData:i}=e,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:n.arrowWidth,c=o?0:n.arrowHeight,[u,f]=TD(t),p={start:"0%",center:"50%",end:"100%"}[f],m=(((g=i.arrow)==null?void 0:g.x)??0)+a/2,x=(((b=i.arrow)==null?void 0:b.y)??0)+c/2;let v="",_="";return u==="bottom"?(v=o?p:`${m}px`,_=`${-c}px`):u==="top"?(v=o?p:`${m}px`,_=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,_=o?p:`${x}px`):u==="left"&&(v=`${r.floating.width+c}px`,_=o?p:`${x}px`),{data:{x:v,y:_}}}});function TD(n){const[e,t="center"]=n.split("-");return[e,t]}var CD=wD,ND=SD,RD=ED,PD=AD,[Ey,iie]=Uo("Tooltip",[Sy]),My=Sy(),ID="TooltipProvider",_H=700,US="tooltip.open",[wH,VE]=Ey(ID),FD=n=>{const{__scopeTooltip:e,delayDuration:t=_H,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=n,o=T.useRef(!0),a=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(wH,{scope:e,isOpenDelayedRef:o,delayDuration:t,onOpen:T.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:T.useCallback(u=>{a.current=u},[]),disableHoverableContent:i,children:s})};FD.displayName=ID;var Ay="Tooltip",[bH,Ty]=Ey(Ay),DD=n=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=n,c=VE(Ay,n.__scopeTooltip),u=My(e),[f,p]=T.useState(null),m=xa(),x=T.useRef(0),v=o??c.disableHoverableContent,_=a??c.delayDuration,y=T.useRef(!1),[g=!1,b]=Dl({prop:r,defaultProp:i,onChange:F=>{F?(c.onOpen(),document.dispatchEvent(new CustomEvent(US))):c.onClose(),s==null||s(F)}}),S=T.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),M=T.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y.current=!1,b(!0)},[b]),A=T.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b(!1)},[b]),R=T.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{y.current=!0,b(!0),x.current=0},_)},[_,b]);return T.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),l.jsx(CD,{...u,children:l.jsx(bH,{scope:e,contentId:m,open:g,stateAttribute:S,trigger:f,onTriggerChange:p,onTriggerEnter:T.useCallback(()=>{c.isOpenDelayedRef.current?R():M()},[c.isOpenDelayedRef,R,M]),onTriggerLeave:T.useCallback(()=>{v?A():(window.clearTimeout(x.current),x.current=0)},[A,v]),onOpen:M,onClose:A,disableHoverableContent:v,children:t})})};DD.displayName=Ay;var BS="TooltipTrigger",kD=T.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=Ty(BS,t),s=VE(BS,t),o=My(t),a=T.useRef(null),c=Tn(e,a,i.onTriggerChange),u=T.useRef(!1),f=T.useRef(!1),p=T.useCallback(()=>u.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(ND,{asChild:!0,...o,children:l.jsx(Dt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:At(n.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:At(n.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:At(n.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:At(n.onFocus,()=>{u.current||i.onOpen()}),onBlur:At(n.onBlur,i.onClose),onClick:At(n.onClick,i.onClose)})})});kD.displayName=BS;var SH="TooltipPortal",[sie,EH]=Ey(SH,{forceMount:void 0}),hh="TooltipContent",LD=T.forwardRef((n,e)=>{const t=EH(hh,n.__scopeTooltip),{forceMount:r=t.forceMount,side:i="top",...s}=n,o=Ty(hh,n.__scopeTooltip);return l.jsx(Gl,{present:r||o.open,children:o.disableHoverableContent?l.jsx(jD,{side:i,...s,ref:e}):l.jsx(MH,{side:i,...s,ref:e})})}),MH=T.forwardRef((n,e)=>{const t=Ty(hh,n.__scopeTooltip),r=VE(hh,n.__scopeTooltip),i=T.useRef(null),s=Tn(e,i),[o,a]=T.useState(null),{trigger:c,onClose:u}=t,f=i.current,{onPointerInTransitChange:p}=r,m=T.useCallback(()=>{a(null),p(!1)},[p]),x=T.useCallback((v,_)=>{const y=v.currentTarget,g={x:v.clientX,y:v.clientY},b=RH(g,y.getBoundingClientRect()),S=PH(g,b),M=IH(_.getBoundingClientRect()),A=DH([...S,...M]);a(A),p(!0)},[p]);return T.useEffect(()=>()=>m(),[m]),T.useEffect(()=>{if(c&&f){const v=y=>x(y,f),_=y=>x(y,c);return c.addEventListener("pointerleave",v),f.addEventListener("pointerleave",_),()=>{c.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",_)}
vendor: 4,168 bytes, line 268
268}},[c,f,x,m]),T.useEffect(()=>{if(o){const v=_=>{const y=_.target,g={x:_.clientX,y:_.clientY},b=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),S=!FH(g,o);b?m():S&&(m(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,f,o,u,m]),l.jsx(jD,{...n,ref:s})}),[AH,TH]=Ey(Ay,{isInside:!1}),CH=wz("TooltipContent"),jD=T.forwardRef((n,e)=>{const{__scopeTooltip:t,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=n,c=Ty(hh,t),u=My(t),{onClose:f}=c;return T.useEffect(()=>(document.addEventListener(US,f),()=>document.removeEventListener(US,f)),[f]),T.useEffect(()=>{if(c.trigger){const p=m=>{const x=m.target;x!=null&&x.contains(c.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,f]),l.jsx(lm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:l.jsxs(RD,{"data-state":c.stateAttribute,...u,...a,ref:e,style:{...a.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:[l.jsx(CH,{children:r}),l.jsx(AH,{scope:t,isInside:!0,children:l.jsx(zz,{id:c.contentId,role:"tooltip",children:i||r})})]})})});LD.displayName=hh;var OD="TooltipArrow",NH=T.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=My(t);return TH(OD,t).isInside?null:l.jsx(PD,{...i,...r,ref:e})});NH.displayName=OD;function RH(n,e){const t=Math.abs(e.top-n.y),r=Math.abs(e.bottom-n.y),i=Math.abs(e.right-n.x),s=Math.abs(e.left-n.x);switch(Math.min(t,r,i,s)){case s:return"left";case i:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function PH(n,e,t=5){const r=[];switch(e){case"top":r.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":r.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":r.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":r.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return r}function IH(n){const{top:e,right:t,bottom:r,left:i}=n;return[{x:i,y:e},{x:t,y:e},{x:t,y:r},{x:i,y:r}]}function FH(n,e){const{x:t,y:r}=n;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,c=e[s].y,u=e[o].x,f=e[o].y;c>r!=f>r&&t<(u-a)*(r-c)/(f-c)+a&&(i=!i)}return i}function DH(n){const e=n.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),kH(e)}function kH(n){if(n.length<=1)return n.slice();const e=[];for(let r=0;r<n.length;r++){const i=n[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const t=[];for(let r=n.length-1;r>=0;r--){const i=n[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var LH=FD,jH=DD,OH=kD,UD=LD;const UH=LH,BH=jH,zH=OH,BD=T.forwardRef(({className:n,sideOffset:e=4,...t},r)=>l.jsx(UD,{ref:r,sideOffset:e,className:Ct("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 origin-[--radix-tooltip-content-transform-origin]",n),...t}));BD.displayName=UD.displayName;const qn=T.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:Ct("rounded-lg border bg-card text-card-foreground shadow-sm",n),...e}));qn.displayName="Card";const ts=T.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:Ct("flex flex-col space-y-1.5 p-6",n),...e}));
268ts.displayName="CardHeader";const ns=T.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:Ct("text-2xl font-semibold leading-none tracking-tight",n),...e}));ns.displayName="CardTitle";const zD=T.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:Ct("text-sm text-muted-foreground",n),...e}));zD.displayName="CardDescription";const tr=T.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:Ct("p-6 pt-0",n),...e}));tr.displayName="CardContent";const VD=T.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:Ct("flex items-center p-6 pt-0",n),...e}));VD.displayName="CardFooter";function VH(){return l.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:l.jsx(qn,{className:"w-full max-w-md mx-4",children:l.jsxs(tr,{className:"pt-6",children:[l.jsxs("div",{className:"flex mb-4 gap-2",children:[l.jsx(XF,{className:"h-8 w-8 text-red-500"}),l.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),l.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}class HH{async login(e){const t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)});if(!t.ok){const r=await t.json();throw new Error(r.message||"Login failed")}return t.json()}async register(e){const t=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)});if(!t.ok){const r=await t.json();throw new Error(r.message||"Registration failed")}return t.json()}async logout(){if(!(await fetch("/api/auth/logout",{method:"POST",credentials:"include"})).ok)throw new Error("Logout failed")}async getCurrentUser(){try{const e=await fetch("/api/auth/user",{credentials:"include"});if(e.status===401)return null;if(!e.ok)throw new Error("Failed to fetch user");return e.json()}catch(e){return console.error("Error fetching current user:",e),null}}async checkAdminStatus(){const e=await fetch("/api/admin/check",{credentials:"include"});return e.ok?e.json():{isAdmin:!1}}}const pw=new HH;function vi(){const n=hs(),{toast:e}=Mn(),{data:t,isLoading:r}=Nt({queryKey:["/api/auth/user"],queryFn:pw.getCurrentUser,retry:!1}),i=!!t,{data:s,isLoading:o}=Nt({queryKey:["/api/admin/check"],queryFn:pw.checkAdminStatus,retry:!1,enabled:i}),a=ti({mutationFn:pw.logout,onSuccess:()=>{n.clear(),e({title:"Signed out",description:"You have been successfully signed out."}),window.location.href="/"},onError:u=>{console.error("Logout error:",u),e({title:"Error",description:"Failed to sign out. Please try again.",variant:"destructive"})}}),c=()=>{a.mutate()};return{user:t,isLoading:r||i&&o,isAuthenticated:i,isAdmin:(s==null?void 0:s.isAdmin)||!1,logout:c,isLoggingOut:a.isPending}}const Gc="source=shadymusic",Ve={HOME:"/",ARTISTS:"/artists",ARTIST_DETAILS:n=>`/artists/${n}`,GENRES:"/genres",GENRE_DETAILS:n=>`/genres/${n}`,ERAS:"/eras",ERA_DETAILS:n=>`/eras/${n}`,SPHERE_DEMO:"/sphere-demo",ABOUT:"/about",CONTACT:"/contact",USER_PROFILE:"/user/profile",USER_FAVORITES:"/user/favorites",ADMIN:"/admin",ADMIN_SETUP:"/admin-setup",ADMIN_ARTISTS:"/admin/artists",ADMIN_REVIEWS:"/admin/reviews",ADMIN_COMMENTS:"/admin/comments",ADMIN_CUSTOMIZATION:"/admin/customization",MONETIZATION:"/shop",SPOTIFY:"/spotify",LOGIN:"/auth/login",REGISTER:"/auth/register",LOGOUT:"/api/logout"},WH=[{id:1,name:"Direct Collaboration",description:"Artists who have directly collaborated with Eminem on music"},{id:2,name:"Major Influence",description:"Artists who have cited Eminem as a major influence on their style"},{id:3,name:"Notable Influence",description:"Artists who show clear stylistic influence from Eminem"},{id:4,name:"Slight Influence",description:"Artists with subtle elements influenced by Eminem's work"}],GH=vy("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"}}),it=T.forwardRef(({className:n,variant:e,size:t,asChild:r=!1,...i},s)=>{const o=r?xF:"button";return l.jsx(o,{className:Ct(GH({variant:e,size:t,className:n})),ref:s,...i})});it.displayName="Button";function $H(){const{user:n,isAuthenticated:e,logout:t,isLoggingOut:r}=vi(),[i]=Bi(),[s,o]=T.useState(!1);Mn();const a=[{name:"Home",path:Ve.HOME},{name:"Timeline",path:"/#timeline"},{name:"Artists",path:Ve.ARTISTS},{name:"Genres",path:Ve.GENRES},{name:"Spotify",path:Ve.SPOTIFY},{name:"Shop",path:Ve.MONETIZATION},{name:"About",path:Ve.ABOUT},{name:"Contact",path:Ve.CONTACT}],c=()=>{o(!s)};return l.jsx("header",{className:"sticky top-0 z-50 bg-[#121212] border-b border-[#3D3D3D] shadow-md",children:l.jsx("div",{className:"container mx-auto px-4 py-3",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex items-center",children:l.jsxs(Pt,{href:Ve.HOME,className:"text-3xl font-heading tracking-wider flex items-center cursor-pointer",children:[l.jsx("span",{className:"text-[#FB3939]",children:"SHADY"}),l.jsx("span",{className:"text-[#F5F5F5]",children:"MUSIC"}),l.jsx("span",{className:"text-xs text-[#FB3939] ml-1 font-special",children:"®"})]})}),l.jsx("nav",{className:Ct("md:flex items-center space-x-6",s?"absolute top-16 left-0 right-0 flex flex-col space-y-3 space-x-0 bg-[#121212] p-4 border-b border-[#3D3D3D] z-50":"hidden"),children:a.map(u=>l.jsx(Pt,{href:u.path,className:Ct("nav-item font-medium text-[#F5F5F5] hover:text-[#FB3939] transition relative",i===u.path&&"active after:w-full text-[#FB3939]"),onClick:()=>o(!1),children:u.name},u.path))}),l.jsxs("div",{className:"flex items-center space-x-4",children:[e?l.jsxs(l.Fragment,{children:[l.jsx(Pt,{href:Ve.USER_FAVORITES,className:"hidden md:flex items-center text-[#F5F5F5] hover:text-[#FB3939] transition",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})})}),(n==null?void 0:n.isAdmin)&&l.jsxs(l.Fragment,{children:[l.jsx(Pt,{href:Ve.ADMIN,
268className:"hidden md:flex items-center text-[#F5F5F5] hover:text-[#FB3939] transition",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),l.jsx(Pt,{href:Ve.SPHERE_DEMO,className:"hidden md:flex items-center text-[#F5F5F5] hover:text-[#FB3939] transition",title:"3D Timeline Demo",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4"})]})})]}),l.jsx(Pt,{href:Ve.USER_PROFILE,className:"cursor-pointer",children:l.jsx("img",{src:(n==null?void 0:n.profileImageUrl)||"https://via.placeholder.com/150",alt:"User profile",className:"w-10 h-10 rounded-full object-cover border-2 border-[#FB3939]"})}),l.jsx(it,{variant:"destructive",size:"sm",className:"hidden md:block",onClick:t,disabled:r,children:r?"Signing out...":"Logout"})]}):l.jsxs(l.Fragment,{children:[l.jsx(Pt,{href:"/auth/login",children:l.jsx(it,{variant:"outline",size:"sm",className:"hidden md:block",children:"Sign In"})}),l.jsx(Pt,{href:"/auth/register",children:l.jsx(it,{variant:"destructive",size:"sm",className:"hidden md:block",children:"Sign Up"})})]}),l.jsx("button",{className:"md:hidden text-[#F5F5F5] focus:outline-none",onClick:c,"aria-label":"Toggle mobile menu",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:s?"M6 18L18 6M6 6l12 12":"M4 6h16M4 12h16M4 18h16"})})})]})]})})})}function XH(){const n=new Date().getFullYear();return l.jsx("footer",{className:"bg-[#1E1E1E] border-t border-[#2D2D2D] pt-12 pb-6",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8 mb-12",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"text-3xl font-heading tracking-wider flex items-center mb-4",children:[l.jsx("span",{className:"text-[#FB3939]",children:"SHADY"}),l.jsx("span",{className:"text-[#F5F5F5]",children:"MUSIC"}),l.jsx("span",{className:"text-xs text-[#FB3939] ml-1 font-special",children:"®"})]}),l.jsx("p",{className:"text-[#E0E0E0] text-sm mb-4",children:"The ultimate music sanctuary for shady fans and all music lovers."}),l.jsxs("div",{className:"flex space-x-4",children:[l.jsx("a",{href:"#",className:"text-[#A0A0A0] hover:text-[#FB3939] transition",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"})})}),l.jsx("a",{href:"#",className:"text-[#A0A0A0] hover:text-[#FB3939] transition",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M9 8h-3v4h3v12h5v-12h3.642l.358-4h-4v-1.667c0-.955.192-1.333 1.115-1.333h2.885v-5h-3.808c-3.596 0-5.192 1.583-5.192 4.615v3.385z"})})}),l.jsx("a",{href:"#",className:"text-[#A0A0A0] hover:text-[#FB3939] transition",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259
2680-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"})})}),l.jsx("a",{href:"#",className:"text-[#A0A0A0] hover:text-[#FB3939] transition",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M19.615 3.184c-3.604-.246-11.631-.245-15.23 0-3.897.266-4.356 2.62-4.385 8.816.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0 3.897-.266 4.356-2.62 4.385-8.816-.029-6.185-.484-8.549-4.385-8.816zm-10.615 12.816v-8l8 3.993-8 4.007z"})})})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xl font-heading text-[#F5F5F5] mb-4",children:"NAVIGATION"}),l.jsxs("ul",{className:"space-y-2",children:[l.jsx("li",{children:l.jsx(Pt,{href:Ve.HOME,className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Home"})}),l.jsx("li",{children:l.jsx(Pt,{href:Ve.ARTISTS,className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Artists"})}),l.jsx("li",{children:l.jsx(Pt,{href:Ve.GENRES,className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Genres"})}),l.jsx("li",{children:l.jsx(Pt,{href:Ve.ERAS,className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Eras"})}),l.jsx("li",{children:l.jsx(Pt,{href:Ve.ABOUT,className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"About Us"})}),l.jsx("li",{children:l.jsx(Pt,{href:Ve.CONTACT,className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Contact"})})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xl font-heading text-[#F5F5F5] mb-4",children:"RESOURCES"}),l.jsxs("ul",{className:"space-y-2",children:[l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Blog"})}),l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Playlists"})}),l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Merchandise"})}),l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Affiliate Program"})}),l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Submit an Artist"})})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xl font-heading text-[#F5F5F5] mb-4",children:"LEGAL"}),l.jsxs("ul",{className:"space-y-2",children:[l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Terms of Service"})}),l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Privacy Policy"})}),l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Cookie Policy"})}),l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"DMCA"})}),l.jsx("li",{children:l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"Accessibility"})})]})]})]}),l.jsx("div",{className:"border-t border-[#2D2D2D] pt-6 text-center",children:l.jsxs("p",{className:"text-[#A0A0A0] text-sm",children:["© ",n," ShadyMusic.com. All rights reserved."]})})]})})}function qH(n){return typeof n=="string"?n:"artist"in n&&"albumArt"in n?{id:n.id,name:n.name,artists:[{id:"",name:n.artist}],album:{id:"",name:n.album,images:[{url:n.albumArt,height:0,width:0}]},duration_ms:n.duration,external_urls:n.external_urls||{spotify:n.spotifyUrl}}:n}const YH={player:null,deviceId:null,isConnected:!1,isPremium:!1,currentTrack:null,currentTrackId:null,isPlaying:!1,playTrack:()=>{},pauseTrack:()=>{},togglePlay:()=>{},resumeTrack:()=>{},nextTrack:()=>{},previousTrack:()=>{},setProgress:()=>{},isPlayingTrack:()=>!1,volume:.5,setVolume:()=>{}},HD=T.createContext(YH),HE=()=>T.useContext(HD),KH=({children:n})=>{const[e,t]=T.useState(null),[r,i]=T.useState(null),[s,o]=T.useState(!1),[a,c]=T.useState(!1),[u,f]=T.useState(null),[p,m]=T.useState(null),[x,v]=T.useState(!1),[_,y]=T.useState(.5);T.useEffect(()=>{const O=async()=>{try{const Z=localStorage.getItem("spotify_access_token");if(!Z){console.log("No Spotify access token found. User needs to connect Spotify."),o(!1),c(!1);return}const Y=await fetch("https://api.spotify.com/v1/me",{headers:{Authorization:`Bearer ${Z}`}});if(Y.ok){const ne=await Y.json();c(ne.product==="premium"),console.log("Spotify account status:",ne.product==="premium"?"Premium":"Free")}else Y.status===401?(console.log("Spotify token expired, attempting to refresh..."),await U()):console.error("Error checking premium status:",Y.status)}catch(Z){console.error("Error checking premium status:",Z)}},U=async()=>{try{const Z=localStorage.getItem("spotify_refresh_token");if(!Z)return console.error("No refresh token available"),!1;const Y=await fetch("/api/spotify/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:Z})});if(Y.ok){const ne=await Y.json();return localStorage.setItem("spotify_access_token",ne.access_token),ne.refresh_token&&localStorage.setItem("spotify_refresh_token",ne.refresh_token),console.log("Successfully refreshed Spotify token"),!0}else return console.error("Failed to refresh token"),!1}catch(Z){return console.error("Error refreshing token:",Z),!1}};window.Spotify&&window.Spotify.PlayerSDK?(g(),O()):window.onSpotifyWebPlaybackSDKReady=()=>{g(),O()};const V=setInterval(O,5*60*1e3);return()=>{clearInterval(V),e&&e.disconnect()}},[]);const g=()=>{const O=localStorage.getItem("spotify_access_token");if(!O){console.error("No Spotify access token found");return}
268if(!window.Spotify||!window.Spotify.PlayerSDK){console.error("Spotify SDK not available");return}try{const U=new window.Spotify.PlayerSDK({name:"ShadyMusic Web Player",getOAuthToken:V=>{V(O)},volume:_});U.addListener("initialization_error",({message:V})=>{console.error("Initialization error:",V)}),U.addListener("authentication_error",({message:V})=>{console.error("Authentication error:",V),localStorage.removeItem("spotify_access_token")}),U.addListener("account_error",({message:V})=>{console.error("Account error - Premium required:",V),c(!1)}),U.addListener("playback_error",({message:V})=>{console.error("Playback error:",V)}),U.addListener("player_state_changed",V=>{if(V){f(V.track_window.current_track);const Y=V.track_window.current_track.uri.split(":").pop()||null;m(Y),v(!V.paused)}}),U.addListener("ready",({device_id:V})=>{console.log("Ready with Device ID",V),i(V),o(!0)}),U.addListener("not_ready",({device_id:V})=>{console.log("Device ID has gone offline",V),o(!1)}),U.connect().then(V=>{V?console.log("Spotify Web Playback SDK successfully connected"):console.error("Failed to connect to Spotify Web Playback SDK")}),t(U)}catch(U){console.error("Error initializing Spotify player:",U)}},b=async O=>{var Z;if(!r)return;const U=qH(O),V=typeof U=="string"?U:((Z=U.external_urls)==null?void 0:Z.spotify)||"";if(!V){console.error("No valid URI provided for playback");return}try{const Y=localStorage.getItem("spotify_access_token");if(!Y)return;const ne=await fetch(`https://api.spotify.com/v1/me/player/play?device_id=${r}`,{method:"PUT",body:JSON.stringify({uris:[V]}),headers:{"Content-Type":"application/json",Authorization:`Bearer ${Y}`}});if(ne.ok){const j=V.split(":").pop()||null;m(j)}else if(ne.status===404)console.error("No active device found. Make sure Spotify is open.");else{const j=await ne.text();console.error("Error playing track:",j)}}catch(Y){console.error("Error playing track:",Y)}},S=async()=>{if(r)try{const O=localStorage.getItem("spotify_access_token");if(!O)return;const U=await fetch(`https://api.spotify.com/v1/me/player/pause?device_id=${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${O}`}});if(!U.ok){const V=await U.text();console.error("Error pausing track:",V)}}catch(O){console.error("Error pausing track:",O)}},D={player:e,deviceId:r,isConnected:s,isPremium:a,currentTrack:u,currentTrackId:p,isPlaying:x,playTrack:b,pauseTrack:S,togglePlay:()=>{x?S():e&&e.resume()},resumeTrack:async()=>{if(r)try{const O=localStorage.getItem("spotify_access_token");if(!O)return;const U=await fetch(`https://api.spotify.com/v1/me/player/play?device_id=${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${O}`}});if(!U.ok){const V=await U.text();console.error("Error resuming track:",V)}}catch(O){console.error("Error resuming track:",O)}},nextTrack:async()=>{if(r)try{const O=localStorage.getItem("spotify_access_token");if(!O)return;const U=await fetch(`https://api.spotify.com/v1/me/player/next?device_id=${r}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${O}`}});if(!U.ok){const V=await U.text();console.error("Error skipping to next track:",V)}}catch(O){console.error("Error skipping to next track:",O)}},previousTrack:async()=>{if(r)try{const O=localStorage.getItem("spotify_access_token");if(!O)return;const U=await fetch(`https://api.spotify.com/v1/me/player/previous?device_id=${r}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${O}`}});if(!U.ok){const V=await U.text();console.error("Error skipping to previous track:",V)}}catch(O){console.error("Error skipping to previous track:",O)}},setProgress:async O=>{if(r)try{const U=localStorage.getItem("spotify_access_token");if(!U)return;const V=await fetch(`https://api.spotify.com/v1/me/player/seek?position_ms=${O}&device_id=${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${U}`}});if(!V.ok){const Z=await V.text();console.error("Error setting track position:",Z)}}catch(U){console.error("Error setting track position:",U)}},isPlayingTrack:O=>!O||!p?!1:x&&p===O,volume:_,setVolume:O=>{e&&e.setVolume(O),y(O)}};return l.jsx(HD.Provider,{value:D,children:n})},ZH=T.createContext(void 0);function QH({children:n}){const[e,t]=T.useState(null),[r,i]=T.useState(!1),s=T.useRef(null),{toast:o}=Mn(),a=T.useCallback(()=>
268{if(s.current){const u=s.current;u.onended=null,u.onerror=null,u.oncanplaythrough=null,u.pause(),u.src&&u.src!==""&&!u.src.endsWith("/null")&&u.src!==window.location.href&&(u.src=""),u.load(),s.current=null}i(!1),t(null)},[]),c=T.useCallback((u,f,p)=>{console.log("AudioPlayerContext: playAudio called with:",{url:u,trackName:f,artistName:p}),(window.location.hostname.includes("replit")||window.location.hostname.includes("gitpod")||window.location.hostname.includes("codespace")||navigator.userAgent.includes("Headless"))&&console.log("ð Container environment detected - Audio will appear to play but no sound output available"),a();const x=new Audio(u);s.current=x,x.preload="auto",x.volume=.7,x.crossOrigin="anonymous",console.log("AudioPlayerContext: Created audio element:",{url:u,volume:x.volume,muted:x.muted,readyState:x.readyState,networkState:x.networkState}),x.addEventListener("loadstart",()=>console.log("Audio: loadstart")),x.addEventListener("loadeddata",()=>console.log("Audio: loadeddata")),x.addEventListener("loadedmetadata",()=>console.log("Audio: loadedmetadata",{duration:x.duration,volume:x.volume,muted:x.muted})),x.addEventListener("canplay",()=>console.log("Audio: canplay")),x.addEventListener("canplaythrough",()=>console.log("Audio: canplaythrough")),x.addEventListener("playing",()=>console.log("Audio: playing event fired")),x.addEventListener("pause",()=>console.log("Audio: pause event fired")),x.addEventListener("volumechange",()=>console.log("Audio: volume changed to",x.volume));const v=()=>{i(!1),t(null),s.current===x&&(x.onended=null,x.onerror=null,s.current=null)},_=y=>{if(console.error("Primary audio playback error:",y,x.error),s.current===x&&(x.onended=null,x.onerror=null),s.current===x){s.current=null;const g=new Audio;s.current=g,g.crossOrigin="anonymous",g.preload="auto";const b=()=>{i(!1),t(null),s.current===g&&(g.onended=null,g.onerror=null,g.oncanplaythrough=null,s.current=null)},S=A=>{console.error("Fallback audio playback error:",A,g.error),i(!1),t(null),s.current===g&&(g.onended=null,g.onerror=null,g.oncanplaythrough=null,s.current=null),o({title:"Playback Error",description:"Could not play this track. Try another one.",variant:"destructive"})},M=()=>{s.current===g&&(g.play().then(()=>{s.current===g&&(i(!0),t({name:f,artist:p}),o({title:"Now Playing",description:`${f} by ${p}`}))}).catch(A=>{console.error("Final playback error (fallback play promise):",A),s.current===g&&S(new Event("play_promise_rejection_fallback"))}),g.oncanplaythrough=null)};g.onended=b,g.onerror=A=>S(A),g.oncanplaythrough=M,g.src=u}else console.warn("Primary audio error for an audio element that is no longer the current one. No fallback attempted.")};x.onended=v,x.onerror=y=>_(y),x.play().then(()=>{s.current===x&&(console.log("AudioPlayerContext: Play promise resolved successfully:",{trackName:f,artistName:p,url:u,currentTime:x.currentTime,volume:x.volume,muted:x.muted,paused:x.paused,ended:x.ended}),i(!0),t({name:f,artist:p}),o({title:"Now Playing",description:`${f} by ${p}`}))}).catch(y=>{console.error("Error playing primary audio (promise):",y),console.error("Audio element state:",{readyState:x.readyState,networkState:x.networkState,error:x.error,src:x.src,volume:x.volume,muted:x.muted}),s.current===x&&!r&&_(new Event("play_promise_rejection_primary"))})},[o,a]);return l.jsx(ZH.Provider,{value:{playAudio:c,stopAllAudio:a,currentTrack:e,isPlaying:r},children:n})}const WD=T.createContext(void 0);function JH({children:n}){const[e,t]=T.useState(null),[r,i]=T.useState(!1),[s,o]=T.useState([]),[a,c]=T.useState(0),u=S=>{if(t(S),s.find(M=>M.id===S.id))c(s.findIndex(M=>M.id===S.id));else{const M=[...s,S];o(M),c(M.length-1)}},f=()=>{e&&i(!0)},p=()=>{i(!1)},m=()=>{r?p():f()},x=()=>{if(s.length>0){const S=(a+1)%s.length;c(S),t(s[S]),r&&i(!0)}},v=()=>{if(s.length>0){const S=a===0?s.length-1:a-1;c(S),t(s[S]),r&&i(!0)}},_=S=>{console.log("Seeking to:",S)},y=S=>{console.log("Volume changed to:",S)},g=S=>{s.find(M=>M.id===S.id)||o([...s,S])},b=S=>{o(S),S.length>0&&(c(0),t(S[0]))};return l.jsx(WD.Provider,{value:{currentTrack:e,isPlaying:r,playlist:s,currentIndex:a,setCurrentTrack:u,play:f,pause:p,togglePlayPause:m,next:x,previous:v,seek:_,setVolume:y,addToPlaylist:g,setPlaylist:b},children:n})}function GD(){const n=T.useContext(WD);if(n===void 0)throw new Error("useMusicPlayer must be used within a MusicPlayerProvider");return n}function e7({currentTrack:n,isPlaying:e,onPlayPause:t,onNext:r,onPrevious:i,onSeek:s,onVolumeChange:o,className:a=""}){const[c,u]=T.useState(0),[f,p]=T.useState(180),[m,x]=T.useState(.7),[v,_]=T.useState(!1),[y,g]=T.useState(!1),[b,S]=T.useState("off"),[M,A]=T.useState(!1),R=T.useRef(null),F=T.useRef();T.useEffect(()=>{let D;return e&&(D=setInterval(()=>{u(O=>O>=f?0:O+1)},1e3)),()=>clearInterval(D)},[e,f]),T.useEffect(()=>{if(!R.current)return;const D=R.current,O=D.getContext("2d");if(!O)return;const U=()=>{const V=D.width,Z=D.height;if(O.fillStyle="#121212",O.fillRect(0,0,V,Z),e){const ne=V/80;for(let j=0;j<80;
268j++){const $=Date.now()*.003,K=j/80*8+1,re=Math.sin($*K)*.5+.5,xe=Math.sin($*2+j)*.3+.7,Ce=re*xe*Z*.8,ce=O.createLinearGradient(0,Z,0,Z-Ce),_e=j/80*60+340;ce.addColorStop(0,`hsl(${_e}, 100%, 60%)`),ce.addColorStop(.5,`hsl(${_e}, 80%, 70%)`),ce.addColorStop(1,`hsl(${_e+20}, 90%, 80%)`),O.fillStyle=ce,O.fillRect(j*ne,Z-Ce,ne-1,Ce)}}else{O.fillStyle="#2D2D2D";for(let Y=0;Y<80;Y++){const ne=Math.random()*15+5,j=V/80*Y;O.fillRect(j,Z-ne,2,ne)}}F.current=requestAnimationFrame(U)};return U(),()=>{F.current&&cancelAnimationFrame(F.current)}},[e]);const L=D=>{const O=Math.floor(D/60),U=Math.floor(D%60);return`${O}:${U.toString().padStart(2,"0")}`},N=D=>{const O=D.currentTarget.getBoundingClientRect(),V=(D.clientX-O.left)/O.width*f;u(V),s==null||s(V)},I=D=>{const O=parseFloat(D.target.value);x(O),o==null||o(O)};return n?l.jsxs("div",{className:`fixed bottom-0 left-0 right-0 bg-gradient-to-t from-[#0A0A0A] via-[#1A1A1A] to-[#1A1A1A]/95 border-t border-[#2D2D2D] backdrop-blur-xl shadow-2xl ${a}`,children:[l.jsx("canvas",{ref:R,width:typeof window<"u"?window.innerWidth:1200,height:60,className:"absolute top-0 left-0 w-full opacity-70"}),l.jsx("div",{className:"relative z-10 container mx-auto px-4 py-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-4 flex-1 min-w-0",children:[l.jsxs("div",{className:"relative group",children:[l.jsx("img",{src:n.imageUrl||"https://cdn-icons-png.flaticon.com/512/26/26805.png",alt:n.title,className:`w-14 h-14 rounded-lg object-cover shadow-lg transition-all duration-300 ${e?"animate-pulse scale-105 shadow-[#FB3939]/30":""}`}),e&&l.jsx("div",{className:"absolute inset-0 rounded-lg bg-[#FB3939]/20 animate-pulse"})]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h4",{className:"text-[#F5F5F5] font-medium truncate text-sm",children:n.title}),l.jsx("p",{className:"text-[#A0A0A0] text-xs truncate",children:n.artist}),n.album&&l.jsx("p",{className:"text-[#666] text-xs truncate",children:n.album})]}),l.jsx("button",{onClick:()=>_(!v),className:`transition-all duration-300 transform hover:scale-110 ${v?"text-[#FB3939]":"text-[#A0A0A0] hover:text-[#FB3939]"}`,children:l.jsx(G0,{className:`w-5 h-5 ${v?"fill-current":""}`})})]}),l.jsxs("div",{className:"flex flex-col items-center space-y-2 flex-1 max-w-md",children:[l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx("button",{onClick:()=>g(!y),className:`transition-all duration-300 transform hover:scale-110 ${y?"text-[#FB3939]":"text-[#A0A0A0] hover:text-[#F5F5F5]"}`,children:l.jsx(b8,{className:"w-4 h-4"})}),l.jsx("button",{onClick:i,className:"text-[#A0A0A0] hover:text-[#F5F5F5] transition-all duration-300 transform hover:scale-110",children:l.jsx(S8,{className:"w-5 h-5"})}),l.jsx("button",{onClick:t,className:"bg-[#FB3939] hover:bg-[#FF4757] text-white rounded-full p-3 transition-all duration-300 transform hover:scale-110 shadow-lg hover:shadow-[#FB3939]/50",children:e?l.jsx(KF,{className:"w-6 h-6"}):l.jsx($0,{className:"w-6 h-6 ml-1"})}),l.jsx("button",{onClick:r,className:"text-[#A0A0A0] hover:text-[#F5F5F5] transition-all duration-300 transform hover:scale-110",children:l.jsx(E8,{className:"w-5 h-5"})}),l.jsxs("button",{onClick:()=>S(b==="off"?"all":b==="all"?"one":"off"),className:`transition-all duration-300 transform hover:scale-110 relative ${b!=="off"?"text-[#FB3939]":"text-[#A0A0A0] hover:text-[#F5F5F5]"}`,children:[l.jsx(y8,{className:"w-4 h-4"}),b==="one"&&l.jsx("span",{className:"absolute -top-1 -right-1 w-2 h-2 bg-[#FB3939] rounded-full"})]})]}),l.jsxs("div",{className:"flex items-center space-x-2 w-full max-w-md",children:[l.jsx("span",{className:"text-xs text-[#A0A0A0] min-w-[35px]",children:L(c)}),l.jsx("div",{className:"flex-1 h-2 bg-[#2D2D2D] rounded-full cursor-pointer group",onClick:N,children:l.jsx("div",{className:"h-full bg-gradient-to-r from-[#FB3939] to-[#FF6B6B] rounded-full transition-all duration-150 group-hover:h-3 relative",style:{width:`${c/f*100}%`},children:l.jsx("div",{className:"absolute right-0 top-1/2 transform translate-x-1/2 -translate-y-1/2 w-3 h-3 bg-white rounded-full opacity-0 group-hover:opacity-100 transition-opacity shadow-lg"})})}),l.jsx("span",{className:"text-xs text-[#A0A0A0] min-w-[35px]",children:L(f)})]})]}),l.jsxs("div",{className:"flex items-center space-x-2 flex-1 justify-end",children:[l.jsx("button",{onClick:()=>A(!M),className:"text-[#A0A0A0] hover:text-[#F5F5F5] transition-all duration-300 transform hover:scale-110",children:l.jsx(N8,{className:"w-5 h-5"})}),M&&l.jsx("div",{className:"flex items-center space-x-2 animate-in slide-in-from-right-2 duration-300",children:l.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:m,onChange:I,className:"w-20 h-1 bg-[#2D2D2D] rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #FB3939 0%, #FB3939 ${m*100}%, #2D2D2D ${m*100}%, #2D2D2D 100%)`}})})]})]})})]}):l.jsx("div",{className:`fixed bottom-0 left-0 right-0 bg-gradient-to-t from-[#0A0A0A] to-[#1A1A1A] border-t border-[#2D2D2D] backdrop-blur-lg ${a}`,children:l.jsx("div",{className:"container mx-auto px-4 py-6",children:l.jsxs("div",{className:"text-center text-[#A0A0A0]",children:[l.jsx("div",{className:"flex items-center justify-center mb-2",children:l.jsx("div",{className:"w-8 h-8 rounded-full bg-[#2D2D2D] flex items-center justify-center",children:l.jsx($0,{className:"w-4 h-4"})})}),l.jsx("p",{className:"text-sm",children:"Select a track to start playing"})]})})})}function t7(){const{currentTrack:n,isPlaying:e,togglePlayPause:t,next:r,previous:i,seek:s,setVolume:o}=GD();return l.jsx(e7,{currentTrack:n||void 0,isPlaying:e,onPlayPause:t,onNext:r,onPrevious:i,onSeek:s,onVolumeChange:o})}const Sn=T.forwardRef(({className:n,type:e,...t},r)=>l.jsx("input",{type:e,className:Ct("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",n),ref:r,...t}));Sn.displayName="Input";function n7(n=768){const[e,t]=T.useState(!1);return T.useEffect(()=>{const r=()=>{t(window.innerWidth<n)};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[n]),e}function Cy({placeholder:n="Search artists, genres, or eras...",className:e="",searchPath:t=Ve.ARTISTS}){const[r,i]=T.useState(""),[s,o]=Bi(),a=T.useRef(null),c=n7(),u=p=>{p.preventDefault(),r.trim()&&o(`${t}?q=${encodeURIComponent(r.trim())}`)},f=p=>{p.key==="Enter"&&u(p)};return T.useEffect(()=>{!c&&a.current&&a.current.focus()},[c]),l.jsx("form",{onSubmit:u,className:`relative ${e}`,children:l.jsxs("div",{className:"max-w-3xl mx-auto bg-[#1E1E1E] bg-opacity-90 rounded-full overflow-hidden border border-[#3D3D3D] p-1 flex items-center",children:[l.jsx(Sn,{ref:a,type:"search",placeholder:n,className:"w-full bg-transparent text-[#F5F5F5] px-6 py-3 focus:outline-none border-none focus:ring-0 rounded-full",value:r,onChange:p=>i(p.target.value),onKeyDown:f}),l.jsxs(it,{type:"submit",className:"bg-[#FB3939] hover:bg-opacity-90 transition text-white rounded-full px-6 py-3 flex items-center",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),!c&&"Search"]})]})})}function r7(){return l.jsxs("section",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 z-0 bg-gradient-to-b from-[rgba(0,0,0,0.7)] to-[#121212]"}),l.jsx("div",{className:"absolute inset-0 z-0",children:l.jsx("div",{className:"w-full h-full",style:{background:"linear-gradient(135deg, #540000 0%, #121212 100%)",backgroundSize:"cover",backgroundPosition:"center"}})}),l.jsxs("div",{className:"relative z-10 container mx-auto px-4 py-20 md:py-28 text-center",children:[l.jsx("span",{className:"inline-block bg-[#FB3939] text-white px-3 py-1 rounded-md mb-4 font-medium",children:"Interactive Biography"}),l.jsxs("h1",{className:"text-4xl md:text-6xl lg:text-7xl font-heading tracking-wider mb-4 text-white",children:["THE ",l.jsx("span",{className:"text-[#FB3939] font-bold",children:"EMINEM"})," TIMELINE"]}),l.jsxs("p",{className:"text-lg md:text-xl text-[#F5F5F5] max-w-3xl mx-auto mb-8",children:["Journey through Marshall Mathers' life story - from Detroit streets to global superstardom -",l.jsx("span",{className:"text-[#FB3939] font-bold",children:" explore the events that shaped a legend"})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-4 mb-8",children:[l.jsx("a",{href:"#timeline",children:l.jsx(it,{className:"bg-[#FB3939] hover:bg-[#d82d2d] px-6 py-3 text-lg",children:"Explore 3D Timeline"})}),l.jsx(Pt,{href:"/artists",children:l.jsx(it,{variant:"outline",className:"border-white text-white hover:bg-white/10 px-6 py-3 text-lg",children:"Discover Influenced Artists"})})]}),l.jsx(Cy,{placeholder:"Search biographical eras and events...",searchPath:Ve.ERAS})]})]})}function su({rating:n,maxRating:e=5,size:t="md",interactive:r=!1,onChange:i,reviewCount:s}){const[o,a]=T.useState(0),c={sm:"text-xs",md:"text-sm",lg:"text-base"},u=x=>{r&&i&&i(x)},f=x=>{r&&a(x)},p=()=>{r&&a(0)},m=()=>{const x=[],v=o>0?o:n;for(let _=1;_<=e;_++){const y=_<=v;x.push(l.jsx("span",{className:Ct("star transition-transform duration-200",y?"text-[#F59E0B]":"text-[#A0A0A0]",r&&"curs
268or-pointer hover:scale-110"),onClick:()=>u(_),onMouseEnter:()=>f(_),onMouseLeave:p,role:r?"button":"presentation","aria-label":r?`Rate ${_} out of ${e}`:`Rating: ${_} out of ${e}`,children:"â
"},_))}return x};return l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:Ct("rating-stars flex",c[t]),children:m()}),s!==void 0&&l.jsxs("span",{className:"text-[#A0A0A0] text-sm ml-2",children:["(",s," ",s===1?"review":"reviews",")"]})]})}function WE({id:n,name:e,slug:t,imageUrl:r,bio:i,genres:s,eras:o,rating:a=0,reviewCount:c=0}){const{isAuthenticated:u}=vi(),{toast:f}=Mn(),p=hs(),{data:m,isLoading:x}=Nt({queryKey:[`/api/artists/${n}/favorite`],enabled:u}),v=m==null?void 0:m.isFavorited,_=ti({mutationFn:async()=>(await Lo("POST",`/api/artists/${n}/favorite`)).json(),onSuccess:()=>{p.invalidateQueries({queryKey:[`/api/artists/${n}/favorite`]}),p.invalidateQueries({queryKey:["/api/user/favorites"]}),f({title:v?"Removed from favorites":"Added to favorites",description:v?`${e} has been removed from your favorites.`:`${e} has been added to your favorites.`,variant:"default"})},onError:g=>{f({title:"Error",description:"Failed to update favorites. Please try again.",variant:"destructive"})}}),y=g=>{if(g.preventDefault(),g.stopPropagation(),!u){f({title:"Authentication required",description:"Please sign in to add artists to your favorites.",variant:"destructive"});return}_.mutate()};return l.jsxs("div",{className:"artist-card bg-[#1E1E1E] rounded-2xl overflow-hidden border border-[#2D2D2D] hover:border-[#FB3939] hover:shadow-2xl hover:shadow-[#FB3939]/20 transform hover:-translate-y-2 transition-all duration-500 shadow-lg group",children:[l.jsxs("div",{className:"h-56 overflow-hidden bg-[#121212] relative",children:[l.jsx("img",{src:r||"https://cdn-icons-png.flaticon.com/512/26/26805.png",alt:e,className:"w-full h-full object-cover transform group-hover:scale-110 transition-transform duration-700 ease-out",onError:g=>{g.currentTarget.onerror=null,g.currentTarget.src="https://cdn-icons-png.flaticon.com/512/26/26805.png"}}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),l.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-500 transform scale-75 group-hover:scale-100",children:l.jsx("div",{className:"bg-[#FB3939]/90 rounded-full p-4 backdrop-blur-sm animate-pulse",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})})})]}),l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("h3",{className:"text-xl font-heading text-[#F5F5F5] group-hover:text-white transition-colors duration-300",children:e.toUpperCase()}),l.jsx("button",{className:`transition-all duration-300 transform hover:scale-110 ${v?"text-[#FB3939]":"text-[#A0A0A0] hover:text-[#FB3939]"}`,onClick:y,disabled:_.isPending||x,"aria-label":v?"Remove from favorites":"Add to favorites",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`h-6 w-6 transition-all duration-300 ${v?"animate-pulse":""}`,fill:v?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})})})]}),l.jsx("div",{className:"mb-3",children:l.jsx(su,{rating:a,reviewCount:c})}),l.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[s.slice(0,3).map((g,b)=>l.jsx("span",{className:"genre-tag text-xs bg-[#2D2D2D] text-[#E0E0E0] rounded-full px-3 py-1 hover:bg-[#FB3939] hover:text-white transition-all duration-300 transform hover:scale-105 cursor-pointer",style:{animationDelay:`${b*100}ms`},children:g.name},g.id)),o.slice(0,1).map((g,b)=>l.jsx("span",{className:"genre-tag text-xs bg-[#2D2D2D] text-[#E0E0E0] rounded-full px-3 py-1 hover:bg-[#FB3939] hover:text-white transition-all duration-300 transform hover:scale-105 cursor-pointer",style:{animationDelay:`${(s.length+b)*100}ms`},children:g.name},g.id))]}),l.jsx("p",{className:"text-sm text-[#E0E0E0] mb-4 line-clamp-2 group-hover:text-[#F5F5F5] transition-colors duration-300",children:i}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx(Pt,{href:Ve.ARTIST_DETAILS(t),className:"text-[#3A86FF] hover:text-[#FB3939] transition-all duration-300 text-sm font-medium transform hover:scale-105 hover:translate-x-1",children:"View Profile â"}),l.jsxs("div",{className:"flex space-x-3",children:[l.jsx("a",{href:`https://open.spotify.com/search/${encodeURIComponent(e)}?${Gc}`,target:"_blank",rel:"noopener noreferrer",className:"text-[#A0A0A0] hover:text-[#1DB954] transition-all duration-300 transform hover:scale-125 hover:-translate-y-1 p-1 rounded-full hover:bg-[#1DB954]/10","aria-label":`Listen to ${e} on Spotify`,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.66.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"})})}),l.jsx("a",{href:`https://music.apple.com/search?term=${encodeURIComponent(e)}&${Gc}`,target:"_blank",rel:"noopener noreferrer",className:"text-[#A0A0A0] hover:text-[#FB233B] transition-all duration-300 transform hover:scale-125 hover:-translate-y-1 p-1 rounded-full hover:bg-[#FB233B]/10","aria-label":`Listen to ${e} on Apple Music`,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M23.906 12.946c0 2.408-1.096 4.417-2.701 5.826-1.693 1.526-3.204 1.141-4.725.377-1.492-.758-2.022-.639-3.01.118-1.216.954-2.41 1.05-3.641.096C8.335 18.178 6.99 15.94 6.99 12.5c0-3.084 1.704-5.262 4.335-5.26 1.097-.022 1.935.53 2.647.927.714.403 1.26.642 2.016.014 1.407-1.252 3.44-1.2 4.965.126 1.705 1.462 2.938 3.756 2.953 4.639zM12.452.266c.15 1.296-.392 2.587-1.166 3.499-.899 1.028-2.397 1.827-3.886 1.738C7.113 3.809 8.054 2.419 9.05 1.59 10.096.7 11.67.039 12.452.266z"})})})]})]})]})]})}function yn({className:n,...e}){return l.jsx("div",{className:Ct("animate-pulse rounded-md bg-muted",n),...e})}function i7(){const{data:n=[],isLoading:e,error:t}=Nt({queryKey:["/api/artists"],queryFn:async()=>{const r=await fetch("/api/artists?featured=true");if(!r.ok)throw new Error("Failed to fetch featured artists");return r.json()}});return e?l.jsx("section",{className:"bg-[#121212] py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5]",children:["FEATURED ",l.jsx("span",{className:"text-[#FB3939]",children:"ARTISTS"})]}),l.jsxs(Pt,{href:Ve.ARTISTS,className:"text-[#3A86FF] hover:text-[#FB3939] transition flex items-center",children:["View all",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})})]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:[...Array(4)].map((r,i)=>l.jsxs("div",{className:"bg-[#1E1E1E] rounded-2xl overflow-hidden border border-[#2D2D2D] shadow-lg",children:[l.jsx(yn,{className:"h-56 w-full bg-[#2D2D2D]"}),l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx(yn,{className:"h-6 w-40 bg-[#2D2D2D]"}),l.jsx(yn,{className:"h-6 w-6 rounded-full bg-[#2D2D2D]"})]}),l.jsx(yn,{className:"h-4 w-32 mb-3 bg-[#2D2D2D]"}),l.jsxs("div",{className:"flex gap-2 mb-3",children:[l.jsx(yn,{className:"h-6 w-16 rounded-full bg-[#2D2D2D]"}),l.jsx(yn,{className:"h-6 w-16 rounded-full bg-[#2D2D2D]"}),l.jsx(yn,{className:"h-6 w-16 rounded-full bg-[#2D2D2D]"})]}),l.jsx(yn,{className:"h-10 w-full mb-4 bg-[#2D2D2D]"}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx(yn,{className:"h-4 w-24 bg-[#2D2D2D]"}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(yn,{className:"h-5 w-5 rounded-full bg-[#2D2D2D]"}),l.jsx(yn,{className:"h-5 w-5 rounded-full bg-[#2D2D2D]"})]})]})]})]},i))})]})}):t?l.jsx("section",{className:"bg-[#121212] py-12",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"text-center",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5] mb-4",children:["FEATURED ",l.jsx("span",{className:"text-[#FB3939]",children:"ARTISTS"})]}),l.jsx("p",{className:"text-[#E0E0E0]",children:"Unable to load featured artists. Please try again later."})]})})}):l.jsx("section",{className:"bg-[#121212] py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsxs("div",{children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5]",children:["EMINEM'S ",l.jsx("span",{className:"text-[#FB3939]",children:"INFLUENCE"})]}),l.jsx("p",{className:"text-[#A0A0A0] mt-2",children:"Artists directly shaped by the Rap God's legacy"})]}),l.jsxs(Pt,{href:Ve.ARTISTS,className:"text-[#FB3939] hover:text-[#d82d2d] transition flex items-center",children:["Explore all artists",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})})]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:n.length>0?n.map(r=>l.jsx(WE,{id:r.id,name:r.name,slug:r.slug,imageUrl:r.imageUrl||`/api/spotify/search?name=${encodeURIComponent(r.name)}&image_only=true`,bio:r.bio||"No biography available.",genres:r.genres||[],eras:r.eras||[],rating:r.rating||0,reviewCount:r.reviewCount||0},r.id)):l.jsx("div",{className:"col-span-full text-center py-8",children:l.jsx("p",{className:"text-[#E0E0E0]",children:"No featured artists available."})})})]})})}function $D({id:n,name:e,imageUrl:t,artistCount:r}){return l.jsxs(Pt,{href:`${Ve.GENRES}/${n}`,className:"relative overflow-hidden rounded-xl h-32 md:h-48 group cursor-pointer",children:[l.jsx("img",{src:t,alt:e,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#121212] to-transparent"}),l.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:[l.jsx("h3",{className:"text-xl md:text-2xl font-heading text-[#F5F5F5]",children:e.toUpperCase()}),l.jsxs("p",{className:"text-xs text-[#E0E0E0] mt-1",children:[r," ",r===1?"Artist":"Artists"]})]}),l.jsx("div",{className:"absolute inset-0 bg-[#FB3939] bg-opacity-30 opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})}function s7(){const{data:n=[],isLoading:e,error:t}=Nt({queryKey:["/api/genres"]});if(e)return l.jsx("section",{className:"bg-[#1E1E1E] py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-10",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5]",children:["EXPLORE BY ",l.jsx("span",{className:"text-[#FB3939]",children:"GENRE"})]}),l.jsx("div",{className:"w-24 h-5",children:l.jsx(yn,{className:"w-full h-full bg-[#2D2D2D]"})})]}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[...Array(6)].map((i,s)=>l.jsx("div",{className:"relative overflow-hidden rounded-xl h-32 md:h-48",children:l.jsx(yn,{className:"w-full h-full bg-[#2D2D2D]"})},s))})]})});if(t)return l.jsx("section",{className:"bg-[#1E1E1E] py-12",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"text-center",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5] mb-4",children:["EXPLORE BY ",l.jsx("span",{className:"text-[#FB3939]",children:"GENRE"})]}),l.jsx("p",{className:"text-[#E0E0E0]",children:"Unable to load genres. Please try again later."})]})})});const r=["https://images.unsplash.com/photo-1501281668745-f7f57925c3b4?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","https://images.unsplash.com/photo-1505740420928-5e560c06d30e?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","https://images.unsplash.com/photo-1514525253161-7a46d19cd819?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","https://images.unsplash.com/photo-1470225620780-dba8ba36b745?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","https://images.unsplash.com/photo-1511671
268782779-c97d3d27a1d4?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400"];return l.jsx("section",{className:"bg-[#1E1E1E] py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-10",children:[l.jsxs("div",{children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5]",children:["EMINEM'S ",l.jsx("span",{className:"text-[#FB3939]",children:"GENRES"})]}),l.jsx("p",{className:"text-[#A0A0A0] mt-2",children:"Explore the musical styles that shaped the Rap God's legacy"})]}),l.jsxs(Pt,{href:Ve.GENRES,className:"text-[#FB3939] hover:text-[#d82d2d] transition flex items-center",children:["View all genres",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})})]})]}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:n.length>0?n.slice(0,6).map((i,s)=>l.jsx($D,{id:i.id,name:i.name,imageUrl:i.imageUrl||r[s%r.length],artistCount:i.artistCount||0},i.id)):l.jsx("div",{className:"col-span-full text-center py-8",children:l.jsx("p",{className:"text-[#E0E0E0]",children:"No genres available."})})})]})})}function XD({id:n,name:e,description:t,startYear:r,endYear:i,imageUrl:s,artistCount:o}){const a=r&&i?`${r} - ${i}`:r?`${r} - Present`:i?`Until ${i}`:"",c=r&&i?i-r+1:null;return l.jsxs(Pt,{href:`${Ve.ERAS}/${n}`,className:"block relative overflow-hidden rounded-xl group cursor-pointer transition-all duration-300 hover:scale-[1.02] hover:shadow-2xl",children:[l.jsxs("div",{className:"relative h-80",children:[l.jsx("img",{src:s,alt:e,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#121212] via-[#121212]/60 to-transparent"}),a&&l.jsx("div",{className:"absolute top-4 right-4 bg-[#FB3939] text-white px-3 py-1 rounded-full text-sm font-bold shadow-lg",children:a}),c&&l.jsxs("div",{className:"absolute top-4 left-4 bg-black/60 text-white px-3 py-1 rounded-full text-xs font-medium backdrop-blur-sm",children:[c," years"]})]}),l.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-6",children:[l.jsx("h3",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] mb-2 group-hover:text-[#FB3939] transition-colors",children:e}),t&&l.jsx("p",{className:"text-sm text-[#E0E0E0] leading-relaxed mb-3 line-clamp-2",children:t}),l.jsxs("div",{className:"flex items-center justify-between text-xs text-[#A0A0A0]",children:[l.jsxs("div",{className:"flex items-center space-x-4",children:[a&&l.jsxs("div",{className:"flex items-center",children:[l.jsx(kd,{className:"w-3 h-3 mr-1"}),a]}),c&&l.jsxs("div",{className:"flex items-center",children:[l.jsx(YF,{className:"w-3 h-3 mr-1"}),c," years"]})]}),l.jsx("div",{className:"text-[#FB3939] font-medium",children:"View Timeline â"})]})]}),l.jsx("div",{className:"absolute inset-0 border-2 border-transparent group-hover:border-[#FB3939]/50 transition-all duration-300 rounded-xl"})]})}function o7(){const{data:n=[],isLoading:e,error:t}=Nt({queryKey:["/api/eras"]});if(e)return l.jsx("section",{className:"bg-[#121212] py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-10",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5]",children:["EXPLORE BY ",l.jsx("span",{className:"text-[#FB3939]",children:"ERA"})]}),l.jsx("div",{className:"w-24 h-5",children:l.jsx(yn,{className:"w-full h-full bg-[#2D2D2D]"})})]}),l.jsx("div",{className:"flex flex-col md:flex-row gap-4 md:h-64",children:[...Array(4)].map((i,s)=>l.jsx("div",{className:"flex-1 relative overflow-hidden rounded-xl",children:l.jsx(yn,{className:"w-full h-full bg-[#2D2D2D]"})},s))})]})});if(t)return l.jsx("section",{className:"bg-[#121212] py-12",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"text-center",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5] mb-4",children:["EXPLORE BY ",l.jsx("span",{className:"text-[#FB3939]",children:"ERA"})]}),l.jsx("p",{className:"text-[#E0E0E0]",children:"Unable to load eras. Please try again later."})]})})});const r=["https://images.unsplash.com/photo-1542323228-002ac256e7b8?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&h=400","https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&h=400","https://images.unsplash.com/photo-1549834125-82d3c48159a3?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&h=400","https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&h=400"];return l.jsx("section",{className:"bg-[#121212] py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-10",children:[l.jsxs("div",{children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5]",children:["BIOGRAPHICAL ",l.jsx("span",{className:"text-[#FB3939]",children:"TIMELINE"})]}),l.jsx("p",{className:"text-[#A0A0A0] mt-2",children:"Journey through Marshall Mathers' life story - from childhood struggles to becoming the rap icon"})]}),l.jsxs(Pt,{href:Ve.ERAS,className:"text-[#FB3939] hover:text-[#d82d2d] transition flex items-center font-medium",children:["Explore Full Timeline",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})})]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:n.length>0?n.sort((i,s)=>(i.startYear||0)-(s.startYear||0)).slice(0,4).map((i,s)=>l.jsx(XD,{id:i.id,name:i.name,description:i.description||"",startYear:i.startYear,endYear:i.endYear,imageUrl:i.imageUrl||r[s%r.length],artistCount:i.artistCount||0},i.id)):l.jsx("div",{className:"w-full text-center py-8",children:l.jsx("p",{className:"text-[#E0E0E0]",children:"No eras available."})})})]})})}/** 269 * @license 270 * Copyright 2010-2025 Three.js Authors 271 * SPDX-License-Identifier: MIT 272 */const Ny="176",Ec={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Mc={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qD=0,zS=1,YD=2,a7=3,KD=0,Ry=1,rp=2,Gs=3,Ta=0,mi=1,Ts=2,va=0,$c=1,VS=2,HS=3,WS=4,ZD=5,al=100,QD=101,JD=102,ek=103,tk=104,nk=200,rk=201,ik=202,sk=203,Z0=204,Q0=205,ok=206,ak=207,lk=208,ck=209,uk=210,dk=211,hk=212,fk=213,pk=214,J0=0,ev=1,tv=2,ou=3,nv=4,rv=5,iv=6,sv=7,dm=0,mk=1,gk=2,Io=0,xk=1,vk=2,yk=3,GE=4,_k=5,wk=6,bk=7,GS="attached",Sk="detached",Py=300,Ca=301,Ol=302,kp=303,Lp=304,kh=306,jp=1e3,Ns=1001,Op=1002,Lr=1003,$E=1004,l7=1004,Sd=1005,c7=1005,xr=1006,ip=1007,u7=1007,To=1008,d7=1008,Ds=1009,XE=1010,qE=1011,fh=1012,Iy=1013,Na=1014,Li=1015,Lh=1016,Fy=1017,Dy=1018,ph=1020,YE=35902,KE=1021,ZE=1022,Zr=1023,mh=1026,gh=1027,ky=1028,hm=1029,QE=1030,Ly=1031,h7=1032,jy=1033,sp=33776,op=33777,ap=33778,lp=33779,ov=35840,av=35841,lv=35842,cv=35843,uv=36196,dv=37492,hv=37496,fv=37808,pv=37809,mv=37810,gv=37811,xv=37812,vv=37813,yv=37814,_v=37815,wv=37816,bv=37817,Sv=37818,Ev=37819,Mv=37820,Av=37821,cp=36492,Tv=36494,Cv=36495,JE=36283,Nv=36284,Rv=36285,Pv=36286,Ek=2200,Mk=2201,Ak=2202,Up=2300,Iv=2301,l0=2302,Ic=2400,Fc=2401,Bp=2402,Oy=2500,eM=2501,f7=0,p7=1,m7=2,Tk=3200,Ck=3201,g7=3202,x7=3203,$l=0,Nk=1,ua="",Ri="srgb",au="srgb-linear",zp="linear",wn="srgb",v7=0,Ac=7680,y7=7681,_7=7682,w7=7683,b7=34055,S7=34056,E7=5386,M7=512,A7=513,T7=514,C7=515,N7=516,R7=517,P7=518,$S=519,Rk=512,Pk=513,Ik=514,tM=515,Fk=516,Dk=517,kk=518,Lk=519,Vp=35044,I7=35048,F7=35040,D7=35045,k7=35049,L7=35041,j7=35046,O7=35050,U7=35042,B7="100",XS="300 es",Rs=2e3,Hp=2001,z7={COMPUTE:"compute",RENDER:"render"},V7={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},H7={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FLAT_FIRST:"flat first",FLAT_EITHER:"flat either"};let zo=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const r=t[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}};const $r=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","5
2725","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let S3=1234567;const Xc=Math.PI/180,xh=180/Math.PI;function os(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return($r[n&255]+$r[n>>8&255]+$r[n>>16&255]+$r[n>>24&255]+"-"+$r[e&255]+$r[e>>8&255]+"-"+$r[e>>16&15|64]+$r[e>>24&255]+"-"+$r[t&63|128]+$r[t>>8&255]+"-"+$r[t>>16&255]+$r[t>>24&255]+$r[r&255]+$r[r>>8&255]+$r[r>>16&255]+$r[r>>24&255]).toLowerCase()}function It(n,e,t){return Math.max(e,Math.min(t,n))}function nM(n,e){return(n%e+e)%e}function W7(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function G7(n,e,t){return n!==e?(t-n)/(e-n):0}function up(n,e,t){return(1-t)*n+t*e}function $7(n,e,t,r){return up(n,e,1-Math.exp(-t*r))}function X7(n,e=1){return e-Math.abs(nM(n,e*2)-e)}function q7(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Y7(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function K7(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Z7(n,e){return n+Math.random()*(e-n)}function Q7(n){return n*(.5-Math.random())}function J7(n){n!==void 0&&(S3=n);let e=S3+=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 eW(n){return n*Xc}function tW(n){return n*xh}function nW(n){return(n&n-1)===0&&n!==0}function rW(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function iW(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function sW(n,e,t,r,i){const s=Math.cos,o=Math.sin,a=s(t/2),c=o(t/2),u=s((e+r)/2),f=o((e+r)/2),p=s((e-r)/2),m=o((e-r)/2),x=s((r-e)/2),v=o((r-e)/2);switch(i){case"XYX":n.set(a*f,c*p,c*m,a*u);break;case"YZY":n.set(c*m,a*f,c*p,a*u);break;case"ZXZ":n.set(c*p,c*m,a*f,a*u);break;case"XZX":n.set(a*f,c*v,c*x,a*u);break;case"YXY":n.set(c*x,a*f,c*v,a*u);break;case"ZYZ":n.set(c*v,c*x,a*f,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function fi(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ut(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const oW={DEG2RAD:Xc,RAD2DEG:xh,generateUUID:os,clamp:It,euclideanModulo:nM,mapLinear:W7,inverseLerp:G7,lerp:up,damp:$7,pingpong:X7,smoothstep:q7,smootherstep:Y7,randInt:K7,randFloat:Z7,randFloatSpread:Q7,seededRandom:J7,degToRad:eW,radToDeg:tW,isPowerOfTwo:nW,ceilPowerOfTwo:rW,floorPowerOfTwo:iW,setQuaternionFromProperEuler:sW,normalize:Ut,denormalize:fi};class Se{constructor(e=0,t=0){Se.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 4,760 bytes, line 272
272sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.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 t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+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,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,t))}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 t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class jt{constructor(e,t,r,i,s,o,a,c,u){jt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,i,s,o,a,c,u)}set(e,t,r,i,s,o,a,c,u){const f=this.elements;return f[0]=e,f[1]=i,f[2]=a,f[3]=t,f[4]=s,f[5]=c,f[6]=r,f[7]=o,f[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[3],c=r[6],u=r[1],f=r[4],p=r[7],m=r[2],x=r[5],v=r[8],_=i[0],y=i[3],g=i[6],b=i[1],S=i[4],M=i[7],A=i[2],R=i[5],F=i[8];return s[0]=o*_+a*b+c*A,s[3]=o*y+a*S+c*R,s[6]=o*g+a*M+c*F,s[1]=u*_+f*b+p*A,s[4]=u*y+f*S+p*R,s[7]=u*g+f*M+p*F,s[2]=m*_+x*b+v*A,s[5]=m*y+x*S+v*R,s[8]=m*g+x*M+v*F,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8];return t*o*f-t*a*u-r*s*f+r*a*c+i*s*u-i*o*c}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8],p=f*o-a*u,m=a*c-f*s,x=u*s-o*c,v=t*p+r*m+i*x;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/v;return e[0]=p*_,e[1]=(i*u-f*r)*_,e[2]=(a*r-i*o)*_,e[3]=m*_,e[4]=(f*t-i*c)*_,e[5]=(i*s-a*t)*_,e[6]=x*_,e[7]=(r*c-u*t)*_,e[8]=(o*t-r*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,s,o,a){const c=Math.cos(s),u=Math.sin(s);return this.set(r*c,r*u,-r*(c*o+u*a)+o+e,-i*u,i*c,-i*(-u*o+c*a)+a+t,0,0,1),this}
vendor: 6,478 bytes, line 272
272scale(e,t){return this.premultiply(mw.makeScale(e,t)),this}rotate(e){return this.premultiply(mw.makeRotation(-e)),this}translate(e,t){return this.premultiply(mw.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const mw=new jt;function jk(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const aW={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Ed(n,e){return new aW[n](e)}function Wp(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Ok(){const n=Wp("canvas");return n.style.display="block",n}const E3={};function c0(n){n in E3||(E3[n]=!0,console.warn(n))}function lW(n,e,t){return new Promise(function(r,i){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:i();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:r()}}setTimeout(s,t)})}function cW(n){const e=n.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 uW(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const M3=new jt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),A3=new jt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function dW(){const n={enabled:!0,workingColorSpace:au,spaces:{},convert:function(i,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===wn&&(i.r=ya(i.r),i.g=ya(i.g),i.b=ya(i.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wn&&(i.r=Od(i.r),i.g=Od(i.g),i.b=Od(i.b))),i},fromWorkingColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},toWorkingColorSpace:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===ua?zp:this.spaces[i].transfer},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,o){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],r=[.3127,.329];return n.define({[au]:{primaries:e,whitePoint:r,transfer:zp,toXYZ:M3,fromXYZ:A3,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Ri},outputColorSpaceConfig:{drawingBufferColorSpace:Ri}},[Ri]:{primaries:e,whitePoint:r,transfer:wn,toXYZ:M3,fromXYZ:A3,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Ri}}}),n}const an=dW();function ya(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Od(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ou;class Uk{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{Ou===void 0&&(Ou=Wp("canvas")),Ou.width=e.width,Ou.height=e.height;const i=Ou.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=Ou}return r.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Wp("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=ya(s[o]/255)*255;return r.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let r=0;r<t.length;r++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[r]=Math.floor(ya(t[r]/255)*255):t[r]=ya(t[r]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let hW=0;class _l{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hW++}),this.uuid=os(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(gw(i[o].image)):s.push(gw(i[o]))}else s=gw(i);r.url=s}return t||(e.images[this.uuid]=r),r}}function gw(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Uk.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let fW=0;class Yn extends zo{constructor(e=Yn.DEFAULT_IMAGE,t=Yn.DEFAULT_MAPPING,r=Ns,i=Ns,s=xr,o=To,a=Zr,c=Ds,u=Yn.DEFAULT_ANISOTROPY,f=ua){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:fW++}),this.uuid=os(),this.name="",this.source=new _l(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=c,this.offset=new Se(0,0),this.repeat=new Se(1,1),this.center=new Se(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new jt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace
vendor: 4,111 bytes, line 272
272=f,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}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)}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.isTextureArray=e.isTextureArray,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.6,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),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Py)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case jp:e.x=e.x-Math.floor(e.x);break;case Ns:e.x=e.x<0?0:1;break;case Op: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 jp:e.y=e.y-Math.floor(e.y);break;case Ns:e.y=e.y<0?0:1;break;case Op: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++}}Yn.DEFAULT_IMAGE=null;Yn.DEFAULT_MAPPING=Py;Yn.DEFAULT_ANISOTROPY=1;class cn{constructor(e=0,t=0,r=0,i=1){cn.prototype.isVector4=!0,this.x=e,this.y=t,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,t,r,i){return this.x=e,this.y=t,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}
vendor: 6,586 bytes, line 272
272sub(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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.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 t=this.x,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*r+o[11]*i+o[15]*s,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 t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,s;const c=e.elements,u=c[0],f=c[4],p=c[8],m=c[1],x=c[5],v=c[9],_=c[2],y=c[6],g=c[10];if(Math.abs(f-m)<.01&&Math.abs(p-_)<.01&&Math.abs(v-y)<.01){if(Math.abs(f+m)<.1&&Math.abs(p+_)<.1&&Math.abs(v+y)<.1&&Math.abs(u+x+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const S=(u+1)/2,M=(x+1)/2,A=(g+1)/2,R=(f+m)/4,F=(p+_)/4,L=(v+y)/4;return S>M&&S>A?S<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(S),i=R/r,s=F/r):M>A?M<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(M),r=R/i,s=L/i):A<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(A),r=F/s,i=L/s),this.set(r,i,s,t),this}let b=Math.sqrt((y-v)*(y-v)+(p-_)*(p-_)+(m-f)*(m-f));return Math.abs(b)<.001&&(b=1),this.x=(y-v)/b,this.y=(p-_)/b,this.z=(m-f)/b,this.w=Math.acos((u+x+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[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,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this.z=It(this.z,e.z,t.z),this.w=It(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this.z=It(this.z,e,t),this.w=It(this.w,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,t))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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 Uy extends zo{constructor(e=1,t=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=r.depth?r.depth:1,this.scissor=new cn(0,0,e,t),this.scissorTest=!1,this.viewport=new cn(0,0,e,t);const i={width:e,height:t,depth:this.depth};r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:xr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},r);const s=new Yn(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace);s.flipY=!1,s.generateMipmaps=r.generateMipmaps,s.internalFormat=r.internalFormat,this.textures=[];const o=r.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.resolveDepthBuffer=r.resolveDepthBuffer,this.resolveStencilBuffer=r.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=r.depthTexture,this.samples=r.samples,this.multiview=r.multiview}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=r;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}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 t=0,r=e.textures.length;t<r;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new _l(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Oo extends Uy{constructor(e=1,t=1,r={}
vendor: 4,507 bytes, line 272
272){super(e,t,r),this.isWebGLRenderTarget=!0}}class fm extends Yn{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Lr,this.minFilter=Lr,this.wrapR=Ns,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class pW extends Oo{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new fm(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class By extends Yn{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Lr,this.minFilter=Lr,this.wrapR=Ns,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class mW extends Oo{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new By(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class Qr{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,s,o,a){let c=r[i+0],u=r[i+1],f=r[i+2],p=r[i+3];const m=s[o+0],x=s[o+1],v=s[o+2],_=s[o+3];if(a===0){e[t+0]=c,e[t+1]=u,e[t+2]=f,e[t+3]=p;return}if(a===1){e[t+0]=m,e[t+1]=x,e[t+2]=v,e[t+3]=_;return}if(p!==_||c!==m||u!==x||f!==v){let y=1-a;const g=c*m+u*x+f*v+p*_,b=g>=0?1:-1,S=1-g*g;if(S>Number.EPSILON){const A=Math.sqrt(S),R=Math.atan2(A,g*b);y=Math.sin(y*R)/A,a=Math.sin(a*R)/A}const M=a*b;if(c=c*y+m*M,u=u*y+x*M,f=f*y+v*M,p=p*y+_*M,y===1-a){const A=1/Math.sqrt(c*c+u*u+f*f+p*p);c*=A,u*=A,f*=A,p*=A}}e[t]=c,e[t+1]=u,e[t+2]=f,e[t+3]=p}static multiplyQuaternionsFlat(e,t,r,i,s,o){const a=r[i],c=r[i+1],u=r[i+2],f=r[i+3],p=s[o],m=s[o+1],x=s[o+2],v=s[o+3];return e[t]=a*v+f*p+c*x-u*m,e[t+1]=c*v+f*m+u*p-a*x,e[t+2]=u*v+f*x+a*m-c*p,e[t+3]=f*v-a*p-c*m-u*x,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,t,r,i){return this._x=e,this._y=t,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,t=!0){const r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,c=Math.sin,u=a(r/2),f=a(i/2),p=a(s/2),m=c(r/2),x=c(i/2),v=c(s/2);switch(o){case"XYZ":this._x=m*f*p+u*x*v,this._y=u*x*p-m*f*v,this._z=u*f*v+m*x*p,this._w=u*f*p-m*x*v;break;case"YXZ":this._x=m*f*p+u*x*v,this._y=u*x*p-m*f*v,this._z=u*f*v-m*x*p,this._w=u*f*p+m*x*v;break;case"ZXY":this._x=m*f*p-u*x*v,this._y=u*x*p+m*f*v,this._z=u*f*v+m*x*p,this._w=u*f*p-m*x*v;break;case"ZYX":this._x=m*f*p-u*x*v,this._y=u*x*p+m*f*v,this._z=u*f*v-m*x*p,this._w=u*f*p+m*x*v;break;case"YZX":this._x=m*f*p+u*x*v,this._y=u*x*p+m*f*v,this._z=u*f*v-m*x*p,this._w=u*f*p-m*x*v;break;case"XZY":this._x=m*f*p-u*x*v,this._y=u*x*p-m*f*v,this._z=u*f*v+m*x*p,this._w=u*f*p+m*x*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/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 t=e.elements,r=t[0],i=t[4],s=t[8],o=t[1],a=t[5],c=t[9],u=t[2],f=t[6],p=t[10],m=r+a+p;if(m>0){const x=.5/Math.sqrt(m+1);this._w=.25/x,this._x=(f-c)*x,this._y=(s-u)*x,this._z=(o-i)*x}else if(r>a&&r>p){const x=2*Math.sqrt(1+r-a-p);this._w=(f-c)/x,this._x=.25*x,this._y=(i+o)/x,this._z=(s+u)/x}else if(a>p){const x=2*Math.sqrt(1+a-r-p);this._w=(s-u)/x,this._x=(i+o)/x,this._y=.25*x,this._z=(c+f)/x}else{const x=2*Math.sqrt(1+p-r-a);this._w=(o-i)/x,this._x=(s+u)/x,this._y=(c+f)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.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*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}
vendor: 5,609 bytes, line 272
272conjugate(){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,t){const r=e._x,i=e._y,s=e._z,o=e._w,a=t._x,c=t._y,u=t._z,f=t._w;return this._x=r*f+o*a+i*u-s*c,this._y=i*f+o*c+s*a-r*u,this._z=s*f+o*u+r*c-i*a,this._w=o*f-r*a-i*c-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+r*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=r,this._y=i,this._z=s,this;const c=1-a*a;if(c<=Number.EPSILON){const x=1-t;return this._w=x*o+t*this._w,this._x=x*r+t*this._x,this._y=x*i+t*this._y,this._z=x*s+t*this._z,this.normalize(),this}const u=Math.sqrt(c),f=Math.atan2(u,a),p=Math.sin((1-t)*f)/u,m=Math.sin(t*f)/u;return this._w=o*p+this._w*m,this._x=r*p+this._x*m,this._y=i*p+this._y*m,this._z=s*p+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),s=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),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 G{constructor(e=0,t=0,r=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.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,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(T3.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(T3.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,c=e.w,u=2*(o*i-a*r),f=2*(a*t-s*i),p=2*(s*r-o*t);return this.x=t+c*u+o*p-a*f,this.y=r+c*f+a*u-s*p,this.z=i+c*p+s*f-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[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,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this.z=It(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this.z=It(this.z,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,t))}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}
vendor: 4,943 bytes, line 272
272round(){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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,o=t.x,a=t.y,c=t.z;return this.x=i*c-s*a,this.y=s*o-r*c,this.z=r*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return xw.copy(this).projectOnVector(e),this.sub(xw)}reflect(e){return this.sub(xw.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+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,t,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const xw=new G,T3=new Qr;class Jr{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(Bs.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,r=e.count;t<r;t++)this.expandByPoint(Bs.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=Bs.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0){const s=r.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,Bs):Bs.fromBufferAttribute(s,o),Bs.applyMatrix4(e.matrixWorld),this.expandByPoint(Bs);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Xg.copy(e.boundingBox)):(r.boun
vendor: 4,487 bytes, line 272
272dingBox===null&&r.computeBoundingBox(),Xg.copy(r.boundingBox)),Xg.applyMatrix4(e.matrixWorld),this.union(Xg)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return e.x>=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,t){return t.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,Bs),Bs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(xf),qg.subVectors(this.max,xf),Uu.subVectors(e.a,xf),Bu.subVectors(e.b,xf),zu.subVectors(e.c,xf),Xa.subVectors(Bu,Uu),qa.subVectors(zu,Bu),lc.subVectors(Uu,zu);let t=[0,-Xa.z,Xa.y,0,-qa.z,qa.y,0,-lc.z,lc.y,Xa.z,0,-Xa.x,qa.z,0,-qa.x,lc.z,0,-lc.x,-Xa.y,Xa.x,0,-qa.y,qa.x,0,-lc.y,lc.x,0];return!vw(t,Uu,Bu,zu,qg)||(t=[1,0,0,0,1,0,0,0,1],!vw(t,Uu,Bu,zu,qg))?!1:(Yg.crossVectors(Xa,qa),t=[Yg.x,Yg.y,Yg.z],vw(t,Uu,Bu,zu,qg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Bs).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:(Zo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Zo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Zo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Zo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Zo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Zo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Zo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Zo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Zo),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)}}const Zo=[new G,new G,new G,new G,new G,new G,new G,new G],Bs=new G,Xg=new Jr,Uu=new G,Bu=new G,zu=new G,Xa=new G,qa=new G,lc=new G,xf=new G,qg=new G,Yg=new G,cc=new G;function vw(n,e,t,r,i){for(let s=0,o=n.length-3;s<=o;s+=3){cc.fromArray(n,s);const a=i.x*Math.abs(cc.x)+i.y*Math.abs(cc.y)+i.z*Math.abs(cc.z),c=e.dot(cc),u=t.dot(cc),f=r.dot(cc);if(Math.max(-Math.max(c,u,f),Math.min(c,u,f))>a)return!1}return!0}const gW=new Jr,vf=new G,yw=new G;class jr{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):gW.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,r.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}
vendor: 17,984 bytes, line 272
272applyMatrix4(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;vf.subVectors(e,this.center);const t=vf.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(vf,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):(yw.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(vf.copy(e.center).add(yw)),this.expandByPoint(vf.copy(e.center).sub(yw))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Qo=new G,_w=new G,Kg=new G,Ya=new G,ww=new G,Zg=new G,bw=new G;class vu{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.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,Qo)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Qo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Qo.copy(this.origin).addScaledVector(this.direction,t),Qo.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){_w.copy(e).add(t).multiplyScalar(.5),Kg.copy(t).sub(e).normalize(),Ya.copy(this.origin).sub(_w);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Kg),a=Ya.dot(this.direction),c=-Ya.dot(Kg),u=Ya.lengthSq(),f=Math.abs(1-o*o);let p,m,x,v;if(f>0)if(p=o*c-a,m=o*a-c,v=s*f,p>=0)if(m>=-v)if(m<=v){const _=1/f;p*=_,m*=_,x=p*(p+o*m+2*a)+m*(o*p+m+2*c)+u}else m=s,p=Math.max(0,-(o*m+a)),x=-p*p+m*(m+2*c)+u;else m=-s,p=Math.max(0,-(o*m+a)),x=-p*p+m*(m+2*c)+u;else m<=-v?(p=Math.max(0,-(-o*s+a)),m=p>0?-s:Math.min(Math.max(-s,-c),s),x=-p*p+m*(m+2*c)+u):m<=v?(p=0,m=Math.min(Math.max(-s,-c),s),x=m*(m+2*c)+u):(p=Math.max(0,-(o*s+a)),m=p>0?s:Math.min(Math.max(-s,-c),s),x=-p*p+m*(m+2*c)+u);else m=o>0?-s:s,p=Math.max(0,-(o*m+a)),x=-p*p+m*(m+2*c)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(_w).addScaledVector(Kg,m),x}intersectSphere(e,t){Qo.subVectors(e.center,this.origin);const r=Qo.dot(this.direction),i=Qo.dot(Qo)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,c=r+o;return c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,o,a,c;const u=1/this.direction.x,f=1/this.direction.y,p=1/this.direction.z,m=this.origin;return u>=0?(r=(e.min.x-m.x)*u,i=(e.max.x-m.x)*u):(r=(e.max.x-m.x)*u,i=(e.min.x-m.x)*u),f>=0?(s=(e.min.y-m.y)*f,o=(e.max.y-m.y)*f):(s=(e.max.y-m.y)*f,o=(e.min.y-m.y)*f),r>o||s>i||((s>r||isNaN(r))&&(r=s),(o<i||isNaN(i))&&(i=o),p>=0?(a=(e.min.z-m.z)*p,c=(e.max.z-m.z)*p):(a=(e.max.z-m.z)*p,c=(e.min.z-m.z)*p),r>c||a>i)||((a>r||r!==r)&&(r=a),(c<i||i!==i)&&(i=c),i<0)?null:this.at(r>=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,Qo)!==null}intersectTriangle(e,t,r,i,s){ww.subVectors(t,e),Zg.subVectors(r,e),bw.crossVectors(ww,Zg);let o=this.direction.dot(bw),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ya.subVectors(this.origin,e);const c=a*this.direction.dot(Zg.crossVectors(Ya,Zg));if(c<0)return null;const u=a*this.direction.dot(ww.cross(Ya));if(u<0||c+u>o)return null;const f=-a*Ya.dot(bw);return f<0?null:this.at(f/o,s)}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 Rt{constructor(e,t,r,i,s,o,a,c,u,f,p,m,x,v,_,y){Rt.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,t,r,i,s,o,a,c,u,f,p,m,x,v,_,y)}set(e,t,r,i,s,o,a,c,u,f,p,m,x,v,_,y){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=c,g[2]=u,g[6]=f,g[10]=p,g[14]=m,g[3]=x,g[7]=v,g[11]=_,g[15]=y,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 Rt().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/Vu.setFromMatrixColumn(e,0).length(),s=1/Vu.setFromMatrixColumn(e,1).length(),o=1/Vu.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),c=Math.cos(i),u=Math.sin(i),f=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const m=o*f,x=o*p,v=a*f,_=a*p;t[0]=c*f,t[4]=-c*p,t[8]=u,t[1]=x+v*u,t[5]=m-_*u,t[9]=-a*c,t[2]=_-m*u,t[6]=v+x*u,t[10]=o*c}else if(e.order==="YXZ"){const m=c*f,x=c*p,v=u*f,_=u*p;t[0]=m+_*a,t[4]=v*a-x,t[8]=o*u,t[1]=o*p,t[5]=o*f,t[9]=-a,t[2]=x*a-v,t[6]=_+m*a,t[10]=o*c}else if(e.order==="ZXY"){const m=c*f,x=c*p,v=u*f,_=u*p;t[0]=m-_*a,t[4]=-o*p,t[8]=v+x*a,t[1]=x+v*a,t[5]=o*f,t[9]=_-m*a,t[2]=-o*u,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const m=o*f,x=o*p,v=a*f,_=a*p;t[0]=c*f,t[4]=v*u-x,t[8]=m*u+_,t[1]=c*p,t[5]=_*u+m,t[9]=x*u-v,t[2]=-u,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const m=o*c,x=o*u,v=a*c,_=a*u;t[0]=c*f,t[4]=_-m*p,t[8]=v*p+x,t[1]=p,t[5]=o*f,t[9]=-a*f,t[2]=-u*f,t[6]=x*p+v,t[10]=m-_*p}else if(e.order==="XZY"){const m=o*c,x=o*u,v=a*c,_=a*u;t[0]=c*f,t[4]=-p,t[8]=u*f,t[1]=m*p+_,t[5]=o*f,t[9]=x*p-v,t[2]=v*p-x,t[6]=a*f,t[10]=_*p+m}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(xW,e,vW)}lookAt(e,t,r){const i=this.elements;return qi.subVectors(e,t),qi.lengthSq()===0&&(qi.z=1),qi.normalize(),Ka.crossVectors(r,qi),Ka.lengthSq()===0&&(Math.abs(r.z)===1?qi.x+=1e-4:qi.z+=1e-4,qi.normalize(),Ka.crossVectors(r,qi)),Ka.normalize(),Qg.crossVectors(qi,Ka),i[0]=Ka.x,i[4]=Qg.x,i[8]=qi.x,i[1]=Ka.y,i[5]=Qg.y,i[9]=qi.y,i[2]=Ka.z,i[6]=Qg.z,i[10]=qi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[4],c=r[8],u=r[12],f=r[1],p=r[5],m=r[9],x=r[13],v=r[2],_=r[6],y=r[10],g=r[14],b=r[3],S=r[7],M=r[11],A=r[15],R=i[0],F=i[4],L=i[8],N=i[12],I=i[1],D=i[5],O=i[9],U=i[13],V=i[2],Z=i[6],Y=i[10],ne=i[14],j=i[3],$=i[7],K=i[11],re=i[15];return s[0]=o*R+a*I+c*V+u*j,s[4]=o*F+a*D+c*Z+u*$,s[8]=o*L+a*O+c*Y+u*K,s[12]=o*N+a*U+c*ne+u*re,s[1]=f*R+p*I+m*V+x*j,s[5]=f*F+p*D+m*Z+x*$,s[9]=f*L+p*O+m*Y+x*K,s[13]=f*N+p*U+m*ne+x*re,s[2]=v*R+_*I+y*V+g*j,s[6]=v*F+_*D+y*Z+g*$,s[10]=v*L+_*O+y*Y+g*K,s[14]=v*N+_*U+y*ne+g*re,s[3]=b*R+S*I+M*V+A*j,s[7]=b*F+S*D+M*Z+A*$,s[11]=b*L+S*O+M*Y+A*K,s[15]=b*N+S*U+M*ne+A*re,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],c=e[9],u=e[13],f=e[2],p=e[6],m=e[10],x=e[14],v=e[3],_=e[7],y=e[11],g=e[15];return v*(+s*c*p-i*u*p-s*a*m+r*u*m+i*a*x-r*c*x)+_*(+t*c*x-t*u*m+s*o*m-i*o*x+i*u*f-s*c*f)+y*(+t*u*p-t*a*x-s*o*p+r*o*x+s*a*f-r*u*f)+g*(-i*a*f-t*c*p+t*a*m+i*o*p-r*o*m+r*c*f)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,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]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8],p=e[9],m=e[10],x=e[11],v=e[12],_=e[13],y=e[14],g=e[15],b=p*y*u-_*m*u+_*c*x-a*y*x-p*c*g+a*m*g,S=v*m*u-f*y*u-v*c*x+o*y*x+f*c*g-o*m*g,M=f*_*u-v*p*u+v*a*x-o*_*x-f*a*g+o*p*g,A=v*p*c-f*_*c-v*a*m+o*_*m+f*a*y-o*p*y,R=t*b+r*S+i*M+s*A;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const F=1/R;return e[0]=b*F,e[1]=(_*m*s-p*y*s-_*i*x+r*y*x+p*i*g-r*m*g)*F,e[2]=(a*y*s-_*c*s+_*i*u-r*y*u-a*i*g+r*c*g)*F,e[3]=(p*c*s-a*m*s-p*i*u+r*m*u+a*i*x-r*c*x)*F,e[4]=S*F,e[5]=(f*y*s-v*m*s+v*i*x-t*y*x-f*i*g+t*m*g)*F,e[6]=(v*c*s-o*y*s-v*i*u+t*y*u+o*i*g-t*c*g)*F,e[7]=(o*m*s-f*c*s+f*i*u-t*m*u-o*i*x+t*c*x)*F,e[8]=M*F,e[9]=(v*p*s-f*_*s-v*r*x+t*_*x+f*r*g-t*p*g)*F,e[10]=(o*_*s-v*a*s+v*r*u-t*_*u-o*r*g+t*a*g)*F,e[11]=(f*a*s-o*p*s-f*r*u+t*p*u+o*r*x-t*a*x)*F,e[12]=A*F,e[13]=(f*_*i-v*p*i+v*r*m-t*_*m-f*r*y+t*p*y)*F,e[14]=(v*a*i-o*_*i-v*r*c+t*_*c+o*r*y-t*a*y)*F,e[15]=(o*p*i-f*a*i+f*r*c-t*p*c-o*r*m+t*a*m)*F,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=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(t,r,i))}makeTranslation(e,t,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,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,o=e.x,a=e.y,c=e.z,u=s*o,f=s*a;return this.set(u*o+r,u*a-i*c,u*c+i*a,0,u*a+i*c,f*a+r,f*c-i*o,0,u*c-i*a,f*c+i*o,s*c*c+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,o=t._y,a=t._z,c=t._w,u=s+s,f=o+o,p=a+a,m=s*u,x=s*f,v=s*p,_=o*f,y=o*p,g=a*p,b=c*u,S=c*f,M=c*p,A=r.x,R=r.y,F=r.z;return i[0]=(1-(_+g))*A,i[1]=(x+M)*A,i[2]=(v-S)*A,i[3]=0,i[4]=(x-M)*R,i[5]=(1-(m+g))*R,i[6]=(y+b)*R,i[7]=0,i[8]=(v+S)*F,i[9]=(y-b)*F,i[10]=(1-(m+_))*F,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let s=Vu.set(i[0],i[1],i[2]).length();const o=Vu.set(i[4],i[5],i[6]).length(),a=Vu.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zs.copy(this);const u=1/s,f=1/o,p=1/a;return zs.elements[0]*=u,zs.elements[1]*=u,zs.elements[2]*=u,zs.elements[4]*=f,zs.elements[5]*=f,zs.elements[6]*=f,zs.elements[8]*=p,zs.elements[9]*=p,zs.elements[10]*=p,t.setFromRotationMatrix(zs),r.x=s,r.y=o,r.z=a,this}makePerspective(e,t,r,i,s,o,a=Rs){const c=this.elements,u=2*s/(t-e),f=2*s/(r-i),p=(t+e)/(t-e),m=(r+i)/(r-i);let x,v;if(a===Rs)x=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Hp)x=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=p,c[12]=0,c[1]=0,c[5]=f,c[9]=m,c[13]=0,c[2]=0,c[6]=0,c[10]=x,c[14]=v,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,r,i,s,o,a=Rs){const c=this.elements,u=1/(t-e),f=1/(r-i),p=1/(o-s),m=(t+e)*u,x=(r+i)*f;let v,_;if(a===Rs)v=(o+s)*p,_=-2*p;else if(a===Hp)v=s*p,_=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*u,c[4]=0,c[8]=0,c[12]=-m,c[1]=0,c[5]=2*f,c[9]=0,c[13]=-x,c[2]=0,c[6]=0,c[10]=_,c[14]=-v,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const Vu=new G,zs=new Rt,xW=new G(0,0,0),vW=new G(1,1,1),Ka=new G,Qg=new G,qi=new G,C3=new Rt,N3=new Qr;class ls{constructor(e=0,t=0,r=0,i=ls.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,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,t,r,i=this._order){return this._x=e,this._y=t,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,t=this._order,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],c=i[1],u=i[5],f=i[9],p=i[2],m=i[6],x=i[10];switch(t){case"XYZ":this._y=Math.asin(It(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-f,x),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,u),this._z=0);break;case"YXZ":this._x=Math.asin(-It(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(a,x),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(It(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,x),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-It(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,x),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(It(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-f,u),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(a,x));break;case"XZY":this._z=Math.asin(-It(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,u),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-f,x),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return C3.makeRotationFromQuaternion(e),this.setFromRotationMatrix(C3,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return N3.setFromEuler(this),this.setFromQuaternion(N3,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+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}}ls.DEFAULT_ORDER="XYZ";class qc{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let yW=0;const R3=new G,Hu=new Qr,Jo=new Rt,Jg=new G,yf=new G,_W=new G,wW=new Qr,P3=new G(1,0,0),I3=new G(0,1,0),F3=new G(0,0,1),D3={type:"added"},bW={type:"removed"},Wu={type:"childadded",child:null},Sw={type:"childremoved",child:null};class dn extends zo{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:yW++}),this.uuid=os(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=dn.DEFAULT_UP.clone();const e=new G,t=new ls,r=new Qr,i=new G(1,1,1);function s(){r.setFromEuler(t,!1)}function o(){t.setFromQuaternion(r,void 0,!1)}t._onChange(s),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Rt},normalMatrix:{value:new jt}}),this.matrix=new Rt,this.matrixWorld=new Rt,this.matrixAutoUpdate=dn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=dn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new qc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}
vendor: 4,289 bytes, line 272
272setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Hu.setFromAxisAngle(e,t),this.quaternion.multiply(Hu),this}rotateOnWorldAxis(e,t){return Hu.setFromAxisAngle(e,t),this.quaternion.premultiply(Hu),this}rotateX(e){return this.rotateOnAxis(P3,e)}rotateY(e){return this.rotateOnAxis(I3,e)}rotateZ(e){return this.rotateOnAxis(F3,e)}translateOnAxis(e,t){return R3.copy(e).applyQuaternion(this.quaternion),this.position.add(R3.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(P3,e)}translateY(e){return this.translateOnAxis(I3,e)}translateZ(e){return this.translateOnAxis(F3,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Jo.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?Jg.copy(e):Jg.set(e,t,r);const i=this.parent;this.updateWorldMatrix(!0,!1),yf.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Jo.lookAt(yf,Jg,this.up):Jo.lookAt(Jg,yf,this.up),this.quaternion.setFromRotationMatrix(Jo),i&&(Jo.extractRotation(i.matrixWorld),Hu.setFromRotationMatrix(Jo),this.quaternion.premultiply(Hu.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(D3),Wu.child=e,this.dispatchEvent(Wu),Wu.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(bW),Sw.child=e,this.dispatchEvent(Sw),Sw.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Jo.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Jo.multiply(e.parent.matrixWorld)),e.applyMatrix4(Jo),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(D3),Wu.child=e,this.dispatchEvent(Wu),Wu.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,i=this.children.length;r<i;r++){const o=this.children[r].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,r=[]){this[e]===t&&r.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,t,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(yf,e,_W),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(yf,wW,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].updateMatrixWorld(e)}updateWorldMatrix(e,t){const r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix
vendor: 5,293 bytes, line 272
272):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(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(a=>({...a,boundingBox:a.boundingBox?{min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}:void 0,boundingSphere:a.boundingSphere?{radius:a.boundingSphere.radius,center:a.boundingSphere.center.toArray()}:void 0})),i.instanceInfo=this._instanceInfo.map(a=>({...a})),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={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function s(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.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=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const c=a.shapes;if(Array.isArray(c))for(let u=0,f=c.length;u<f;u++){const p=c[u];s(e.shapes,p)}else s(e.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let c=0,u=this.material.length;c<u;c++)a.push(s(e.materials,this.material[c]));i.material=a}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const c=this.animations[a];i.animations.push(s(e.animations,c))}}if(t){const a=o(e.geometries),c=o(e.materials),u=o(e.textures),f=o(e.images),p=o(e.shapes),m=o(e.skeletons),x=o(e.animations),v=o(e.nodes);a.length>0&&(r.geometries=a),c.length>0&&(r.materials=c),u.length>0&&(r.textures=u),f.length>0&&(r.images=f),p.length>0&&(r.shapes=p),m.length>0&&(r.skeletons=m),x.length>0&&(r.animations=x),v.length>0&&(r.nodes=v)}return r.object=i,r;function o(a){const c=[];for(const u in a){const f=a[u];delete f.metadata,c.push(f)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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)),t===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}dn.DEFAULT_UP=new G(0,1,0);dn.DEFAULT_MATRIX_AUTO_UPDATE=!0;dn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Vs=new G,ea=new G,Ew=new G,ta=new G,Gu=new G,$u=new G,k3=new G,Mw=new G,Aw=new G,Tw=new G,Cw=new cn,Nw=new cn,Rw=new cn;class Ii{constructor(e=new G,t=new G,r=new G){this.a=e,this.b=t,this.c=r}
vendor: 8,801 bytes, line 272
272static getNormal(e,t,r,i){i.subVectors(r,t),Vs.subVectors(e,t),i.cross(Vs);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){Vs.subVectors(i,t),ea.subVectors(r,t),Ew.subVectors(e,t);const o=Vs.dot(Vs),a=Vs.dot(ea),c=Vs.dot(Ew),u=ea.dot(ea),f=ea.dot(Ew),p=o*u-a*a;if(p===0)return s.set(0,0,0),null;const m=1/p,x=(u*c-a*f)*m,v=(o*f-a*c)*m;return s.set(1-x-v,v,x)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,ta)===null?!1:ta.x>=0&&ta.y>=0&&ta.x+ta.y<=1}static getInterpolation(e,t,r,i,s,o,a,c){return this.getBarycoord(e,t,r,i,ta)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(s,ta.x),c.addScaledVector(o,ta.y),c.addScaledVector(a,ta.z),c)}static getInterpolatedAttribute(e,t,r,i,s,o){return Cw.setScalar(0),Nw.setScalar(0),Rw.setScalar(0),Cw.fromBufferAttribute(e,t),Nw.fromBufferAttribute(e,r),Rw.fromBufferAttribute(e,i),o.setScalar(0),o.addScaledVector(Cw,s.x),o.addScaledVector(Nw,s.y),o.addScaledVector(Rw,s.z),o}static isFrontFacing(e,t,r,i){return Vs.subVectors(r,t),ea.subVectors(e,t),Vs.cross(ea).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),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 Vs.subVectors(this.c,this.b),ea.subVectors(this.a,this.b),Vs.cross(ea).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ii.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ii.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,i,s){return Ii.getInterpolation(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return Ii.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ii.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let o,a;Gu.subVectors(i,r),$u.subVectors(s,r),Mw.subVectors(e,r);const c=Gu.dot(Mw),u=$u.dot(Mw);if(c<=0&&u<=0)return t.copy(r);Aw.subVectors(e,i);const f=Gu.dot(Aw),p=$u.dot(Aw);if(f>=0&&p<=f)return t.copy(i);const m=c*p-f*u;if(m<=0&&c>=0&&f<=0)return o=c/(c-f),t.copy(r).addScaledVector(Gu,o);Tw.subVectors(e,s);const x=Gu.dot(Tw),v=$u.dot(Tw);if(v>=0&&x<=v)return t.copy(s);const _=x*u-c*v;if(_<=0&&u>=0&&v<=0)return a=u/(u-v),t.copy(r).addScaledVector($u,a);const y=f*v-x*p;if(y<=0&&p-f>=0&&x-v>=0)return k3.subVectors(s,i),a=(p-f)/(p-f+(x-v)),t.copy(i).addScaledVector(k3,a);const g=1/(y+_+m);return o=_*g,a=m*g,t.copy(r).addScaledVector(Gu,o).addScaledVector($u,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Bk={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},Za={h:0,s:0,l:0},ex={h:0,s:0,l:0};function Pw(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class at{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===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,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ri){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,an.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=an.workingColorSpace){return this.r=e,this.g=t,this.b=r,an.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=an.workingColorSpace){if(e=nM(e,1),t=It(t,0,1),r=It(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,o=2*r-s;this.r=Pw(o,s,e+1/3),this.g=Pw(o,s,e),this.b=Pw(o,s,e-1/3)}return an.toWorkingColorSpace(this,i),this}setStyle(e,t=Ri){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ri){const r=Bk[e.toLowerCase()];return r!==void 0?this.setHex(r,t):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=ya(e.r),this.g=ya(e.g),this.b=ya(e.b),this}copyLinearToSRGB(e){return this.r=Od(e.r),this.g=Od(e.g),this.b=Od(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ri){return an.fromWorkingColorSpace(Xr.copy(this),e),Math.round(It(Xr.r*255,0,255))*65536+Math.round(It(Xr.g*255,0,255))*256+Math.round(It(Xr.b*255,0,255))}getHexString(e=Ri){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=an.workingColorSpace){an.fromWorkingColorSpace(Xr.copy(this),t);
vendor: 19,030 bytes, line 272
272const r=Xr.r,i=Xr.g,s=Xr.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let c,u;const f=(a+o)/2;if(a===o)c=0,u=0;else{const p=o-a;switch(u=f<=.5?p/(o+a):p/(2-o-a),o){case r:c=(i-s)/p+(i<s?6:0);break;case i:c=(s-r)/p+2;break;case s:c=(r-i)/p+4;break}c/=6}return e.h=c,e.s=u,e.l=f,e}getRGB(e,t=an.workingColorSpace){return an.fromWorkingColorSpace(Xr.copy(this),t),e.r=Xr.r,e.g=Xr.g,e.b=Xr.b,e}getStyle(e=Ri){an.fromWorkingColorSpace(Xr.copy(this),e);const t=Xr.r,r=Xr.g,i=Xr.b;return e!==Ri?`color(${e} ${t.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(r*255)},${Math.round(i*255)})`}offsetHSL(e,t,r){return this.getHSL(Za),this.setHSL(Za.h+e,Za.s+t,Za.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Za),e.getHSL(ex);const r=up(Za.h,ex.h,t),i=up(Za.s,ex.s,t),s=up(Za.l,ex.l,t);return this.setHSL(r,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,r=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*r+s[6]*i,this.g=s[1]*t+s[4]*r+s[7]*i,this.b=s[2]*t+s[5]*r+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Xr=new at;at.NAMES=Bk;let SW=0;class ri extends zo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:SW++}),this.uuid=os(),this.name="",this.type="Material",this.blending=$c,this.side=Ta,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Z0,this.blendDst=Q0,this.blendEquation=al,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new at(0,0,0),this.blendAlpha=0,this.depthFunc=ou,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=$S,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ac,this.stencilZFail=Ac,this.stencilZPass=Ac,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' 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[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,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!==$c&&(r.blending=this.blending),this.side!==Ta&&(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!==Z0&&(r.blendSrc=this.blendSrc),this.blendDst!==Q0&&(r.blendDst=this.blendDst),this.blendEquation!==al&&(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!==ou&&(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!==$S&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ac&&(r.stencilFail=this.stencilFail),this.stencilZFail!==Ac&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==Ac&&(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(s){const o=[];for(const a in s){const c=s[a];delete c.metadata,o.push(c)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}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 t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].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 Xl extends ri{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new at(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 ls,this.combine=dm,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 da=EW();function EW(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),r=new Uint32Array(512),i=new Uint32Array(512);for(let c=0;c<256;++c){const u=c-127;u<-27?(r[c]=0,r[c|256]=32768,i[c]=24,i[c|256]=24):u<-14?(r[c]=1024>>-u-14,r[c|256]=1024>>-u-14|32768,i[c]=-u-1,i[c|256]=-u-1):u<=15?(r[c]=u+15<<10,r[c|256]=u+15<<10|32768,i[c]=13,i[c|256]=13):u<128?(r[c]=31744,r[c|256]=64512,i[c]=24,i[c|256]=24):(r[c]=31744,r[c|256]=64512,i[c]=13,i[c|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let c=1;c<1024;++c){let u=c<<13,f=0;for(;!(u&8388608);)u<<=1,f-=8388608;u&=-8388609,f+=947912704,s[c]=u|f}for(let c=1024;c<2048;++c)s[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(a[c]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function Ti(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=It(n,-65504,65504),da.floatView[0]=n;const e=da.uint32View[0],t=e>>23&511;return da.baseTable[t]+((e&8388607)>>da.shiftTable[t])}function Bf(n){const e=n>>10;return da.uint32View[0]=da.mantissaTable[da.offsetTable[e]+(n&1023)]+da.exponentTable[e],da.floatView[0]}class MW{static toHalfFloat(e){return Ti(e)}static fromHalfFloat(e){return Bf(e)}}const or=new G,tx=new Se;let AW=0;class En{constructor(e,t,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:AW++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=Vp,this.updateRanges=[],this.gpuType=Li,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}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,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,r=this.count;t<r;t++)tx.fromBufferAttribute(this,t),tx.applyMatrix3(e),this.setXY(t,tx.x,tx.y);else if(this.itemSize===3)for(let t=0,r=this.count;t<r;t++)or.fromBufferAttribute(this,t),or.applyMatrix3(e),this.setXYZ(t,or.x,or.y,or.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)or.fromBufferAttribute(this,t),or.applyMatrix4(e),this.setXYZ(t,or.x,or.y,or.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)or.fromBufferAttribute(this,t),or.applyNormalMatrix(e),this.setXYZ(t,or.x,or.y,or.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)or.fromBufferAttribute(this,t),or.transformDirection(e),this.setXYZ(t,or.x,or.y,or.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let r=this.array[e*this.itemSize+t];return this.normalized&&(r=fi(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=Ut(r,this.array)),this.array[e*this.itemSize+t]=r,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=fi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=fi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=fi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=fi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array),i=Ut(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array),i=Ut(i,this.array),s=Ut(s,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=s,this}
vendor: 4,268 bytes, line 272
272onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Vp&&(e.usage=this.usage),e}}class TW extends En{constructor(e,t,r){super(new Int8Array(e),t,r)}}class CW extends En{constructor(e,t,r){super(new Uint8Array(e),t,r)}}class NW extends En{constructor(e,t,r){super(new Uint8ClampedArray(e),t,r)}}class RW extends En{constructor(e,t,r){super(new Int16Array(e),t,r)}}class rM extends En{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class PW extends En{constructor(e,t,r){super(new Int32Array(e),t,r)}}class iM extends En{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class IW extends En{constructor(e,t,r){super(new Uint16Array(e),t,r),this.isFloat16BufferAttribute=!0}getX(e){let t=Bf(this.array[e*this.itemSize]);return this.normalized&&(t=fi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize]=Ti(t),this}getY(e){let t=Bf(this.array[e*this.itemSize+1]);return this.normalized&&(t=fi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+1]=Ti(t),this}getZ(e){let t=Bf(this.array[e*this.itemSize+2]);return this.normalized&&(t=fi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+2]=Ti(t),this}getW(e){let t=Bf(this.array[e*this.itemSize+3]);return this.normalized&&(t=fi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+3]=Ti(t),this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array)),this.array[e+0]=Ti(t),this.array[e+1]=Ti(r),this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array),i=Ut(i,this.array)),this.array[e+0]=Ti(t),this.array[e+1]=Ti(r),this.array[e+2]=Ti(i),this}setXYZW(e,t,r,i,s){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array),i=Ut(i,this.array),s=Ut(s,this.array)),this.array[e+0]=Ti(t),this.array[e+1]=Ti(r),this.array[e+2]=Ti(i),this.array[e+3]=Ti(s),this}}class ht extends En{constructor(e,t,r){super(new Float32Array(e),t,r)}}let FW=0;const ws=new Rt,Iw=new dn,Xu=new G,Yi=new Jr,_f=new Jr,Er=new G;class zt extends zo{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:FW++}),this.uuid=os(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(jk(e)?iM:rM)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const s=new jt().getNormalMatrix(e);r.applyNormalMatrix(s),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ws.makeRotationFromQuaternion(e),this.applyMatrix4(ws),this}rotateX(e){return ws.makeRotationX(e),this.applyMatrix4(ws),this}rotateY(e){return ws.makeRotationY(e),this.applyMatrix4(ws),this}rotateZ(e){return ws.makeRotationZ(e),this.applyMatrix4(ws),this}translate(e,t,r){return ws.makeTranslation(e,t,r),this.applyMatrix4(ws),this}scale(e,t,r){return ws.makeScale(e,t,r),this.applyMatrix4(ws),this}lookAt(e){return Iw.lookAt(e),Iw.updateMatrix(),this.applyMatrix4(Iw.matrix
vendor: 6,541 bytes, line 272
272),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Xu).negate(),this.translate(Xu.x,Xu.y,Xu.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const r=[];for(let i=0,s=e.length;i<s;i++){const o=e[i];r.push(o.x,o.y,o.z||0)}this.setAttribute("position",new ht(r,3))}else{const r=Math.min(e.length,t.count);for(let i=0;i<r;i++){const s=e[i];t.setXYZ(i,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Jr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new G(-1/0,-1/0,-1/0),new G(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let r=0,i=t.length;r<i;r++){const s=t[r];Yi.setFromBufferAttribute(s),this.morphTargetsRelative?(Er.addVectors(this.boundingBox.min,Yi.min),this.boundingBox.expandByPoint(Er),Er.addVectors(this.boundingBox.max,Yi.max),this.boundingBox.expandByPoint(Er)):(this.boundingBox.expandByPoint(Yi.min),this.boundingBox.expandByPoint(Yi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new jr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new G,1/0);return}if(e){const r=this.boundingSphere.center;if(Yi.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];_f.setFromBufferAttribute(a),this.morphTargetsRelative?(Er.addVectors(Yi.min,_f.min),Yi.expandByPoint(Er),Er.addVectors(Yi.max,_f.max),Yi.expandByPoint(Er)):(Yi.expandByPoint(_f.min),Yi.expandByPoint(_f.max))}Yi.getCenter(r);let i=0;for(let s=0,o=e.count;s<o;s++)Er.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(Er));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],c=this.morphTargetsRelative;for(let u=0,f=a.count;u<f;u++)Er.fromBufferAttribute(a,u),c&&(Xu.fromBufferAttribute(e,u),Er.add(Xu)),i=Math.max(i,r.distanceToSquared(Er))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new En(new Float32Array(4*r.count),4));const o=this.getAttribute("tangent"),a=[],c=[];for(let L=0;L<r.count;L++)a[L]=new G,c[L]=new G;const u=new G,f=new G,p=new G,m=new Se,x=new Se,v=new Se,_=new G,y=new G;function g(L,N,I){u.fromBufferAttribute(r,L),f.fromBufferAttribute(r,N),p.fromBufferAttribute(r,I),m.fromBufferAttribute(s,L),x.fromBufferAttribute(s,N),v.fromBufferAttribute(s,I),f.sub(u),p.sub(u),x.sub(m),v.sub(m);const D=1/(x.x*v.y-v.x*x.y);isFinite(D)&&(_.copy(f).multiplyScalar(v.y).addScaledVector(p,-x.y).multiplyScalar(D),y.copy(p).multiplyScalar(x.x).addScaledVector(f,-v.x).multiplyScalar(D),a[L].add(_),a[N].add(_),a[I].add(_),c[L].add(y),c[N].add(y),c[I].add(y))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let L=0,N=b.length;L<N;++L){const I=b[L],D=I.start,O=I.count;for(let U=D,V=D+O;U<V;U+=3)g(e.getX(U+0),e.getX(U+1),e.getX(U+2))}const S=new G,M=new G,A=new G,R=new G;function F(L){A.fromBufferAttribute(i,L),R.copy(A);const N=a[L];S.copy(N),S.sub(A.multiplyScalar(A.dot(N))).normalize(),M.crossVectors(R,N);const D=M.dot(c[L])<0?-1:1;o.setXYZW(L,S.x,S.y,S.z,D)}for(let L=0,N=b.length;L<N;++L){const I=b[L],D=I.start,O=I.count;for(let U=D,V=D+O;U<V;U+=3)F(e.getX(U+0)),F(e.getX(U+1)),F(e.getX(U+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new En(new Float32Array(t.count*3),3),this.setAttribute("normal",r);else for(let m=0,x=r.count;m<x;m++)r.setXYZ(m,0,0,0);const i=new G,s=new G,o=new G,a=new G,c=new G,u=new G,f=new G,p=new G;if(e)for(let m=0,x=e.count;m<x;m+=3){const v=e.getX(m+0),_=e.getX(m+1),y=e.getX(m+2);i.fromBufferAttribute(t,v),s.fromBufferAttribute(t,_),o.fromBufferAttribute(t,y),f.subVectors(o,s),p.subVectors(i,s),f.cross(p),a.fromBufferAttribute(r,v),c.fromBufferAttribute(r,_),u.fromBufferAttribute(r,y),a.add(f),c.add(f),u.add(f),r.setXYZ(v,a.x,a.y,a.z),r.setXYZ(_,c.x,c.y,c.z),r.setXYZ(y,u.x,u.y,u.z)}else for(let m=0,x=t.count;m<x;m+=3)i.fromBufferAttribute(t,m+0),s.fromBufferAttribute(t,m+1),o.fromBufferAttribute(t,m+2),f.subVectors(o,s),p.subVectors(i,s),f.cross(p),r.setXYZ(m+0,f.x,f.y,f.z),r.setXYZ(m+1,f.x,f.y,f.z),r.setXYZ(m+2,f.x,f.y,f.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)Er.fromBufferAttribute(e,t),Er.normalize(),e.setXYZ(t,Er.x,Er.y,Er.z)}toNonIndexed(){function e(a,c){const u=a.array,f=a.itemSize,p=a.normalized,m=new u.constructor(c.length*f);let x=0,v=0;for(let _=0,y=c.length;_<y;_++){a.isInterleavedBufferAttribute?x=c[_]*a.data.stride+a.offset:x=c[_]*f;for(let g=0;g<f;g++)m[v++]=u[x++]}return new En(m,f,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new zt,r=this.index.array,i=this.attributes;for(const a in i){const c=i[a],u=e(c,r);t.setAttribute(a,u)}const s=this.morphAttributes;for(const a in s){const c=[],u=s[a];for(let f=0,p=u.length;f<p;f++){const m=u[f],x=e(m,r);c.push(x)}t.morphAttributes[a]=c}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,c=o.length;a<c;a++){const u=o[a];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 4,405 bytes, line 272
272if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const u in c)c[u]!==void 0&&(e[u]=c[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const c in r){const u=r[c];e.data.attributes[c]=u.toJSON(e.data)}const i={};let s=!1;for(const c in this.morphAttributes){const u=this.morphAttributes[c],f=[];for(let p=0,m=u.length;p<m;p++){const x=u[p];f.push(x.toJSON(e.data))}f.length>0&&(i[c]=f,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),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 t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const u in i){const f=i[u];this.setAttribute(u,f.clone(t))}const s=e.morphAttributes;for(const u in s){const f=[],p=s[u];for(let m=0,x=p.length;m<x;m++)f.push(p[m].clone(t));this.morphAttributes[u]=f}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,f=o.length;u<f;u++){const p=o[u];this.addGroup(p.start,p.count,p.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const L3=new Rt,uc=new vu,nx=new jr,j3=new G,rx=new G,ix=new G,sx=new G,Fw=new G,ox=new G,O3=new G,ax=new G;class cr extends dn{constructor(e=new zt,t=new Xl){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const r=this.geometry,i=r.attributes.position,s=r.morphAttributes.position,o=r.morphTargetsRelative;t.fromBufferAttribute(i,e);const a=this.morphTargetInfluences;if(s&&a){ox.set(0,0,0);for(let c=0,u=s.length;c<u;c++){const f=a[c],p=s[c];f!==0&&(Fw.fromBufferAttribute(p,e),o?ox.addScaledVector(Fw,f):ox.addScaledVector(Fw.sub(t),f))}t.add(ox)}return t}raycast(e,t){const r=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(r.boundingSphere===null&&r.computeBoundingSphere(),nx.copy(r.boundingSphere),nx.applyMatrix4(s),uc.copy(e.ray).recast(e.near),!(nx.containsPoint(uc.origin)===!1&&(uc.intersectSphere(nx,j3)===null||uc.origin.distanceToSquared(j3)>(e.far-e.near)**2))&&(L3.copy(s).invert(),uc.copy(e.ray).applyMatrix4(L3),!(r.boundingBox!==null&&uc.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,uc)))}_computeIntersections(e,t,r){let i;const s=this.geometry,o=this.material,a=s.index,c=s.attributes.position,u=s.attributes.uv,f=s.attributes.uv1,p=s.attributes.normal,m=s.groups,x=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,_=m.length;v<_;v++){const y=m[v],g=o[y.materialIndex],b=Math.max(y.start,x.start),S=Math.min(a.count,Math.min(y.start+y.count,x.start+x.count));for(let M=b,A=S;M<A;M+=3){const R=a.getX(M),F=a.getX(M+1),L=a.getX(M+2);i=lx(this,g,e,r,u,f,p,R,F,L),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=y.materialIndex,t.push(i))}}else{const v=Math.max(0,x.start),_=Math.min(a.count,x.start+x.count);for(let y=v,g=_;y<g;y+=3){const b=a.getX(y),S=a.getX(y+1),M=a.getX(y+2);
vendor: 7,074 bytes, lines 272-276
272i=lx(this,o,e,r,u,f,p,b,S,M),i&&(i.faceIndex=Math.floor(y/3),t.push(i))}}else if(c!==void 0)if(Array.isArray(o))for(let v=0,_=m.length;v<_;v++){const y=m[v],g=o[y.materialIndex],b=Math.max(y.start,x.start),S=Math.min(c.count,Math.min(y.start+y.count,x.start+x.count));for(let M=b,A=S;M<A;M+=3){const R=M,F=M+1,L=M+2;i=lx(this,g,e,r,u,f,p,R,F,L),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=y.materialIndex,t.push(i))}}else{const v=Math.max(0,x.start),_=Math.min(c.count,x.start+x.count);for(let y=v,g=_;y<g;y+=3){const b=y,S=y+1,M=y+2;i=lx(this,o,e,r,u,f,p,b,S,M),i&&(i.faceIndex=Math.floor(y/3),t.push(i))}}}}function DW(n,e,t,r,i,s,o,a){let c;if(e.side===mi?c=r.intersectTriangle(o,s,i,!0,a):c=r.intersectTriangle(i,s,o,e.side===Ta,a),c===null)return null;ax.copy(a),ax.applyMatrix4(n.matrixWorld);const u=t.ray.origin.distanceTo(ax);return u<t.near||u>t.far?null:{distance:u,point:ax.clone(),object:n}}function lx(n,e,t,r,i,s,o,a,c,u){n.getVertexPosition(a,rx),n.getVertexPosition(c,ix),n.getVertexPosition(u,sx);const f=DW(n,e,t,r,rx,ix,sx,O3);if(f){const p=new G;Ii.getBarycoord(O3,rx,ix,sx,p),i&&(f.uv=Ii.getInterpolatedAttribute(i,a,c,u,p,new Se)),s&&(f.uv1=Ii.getInterpolatedAttribute(s,a,c,u,p,new Se)),o&&(f.normal=Ii.getInterpolatedAttribute(o,a,c,u,p,new G),f.normal.dot(r.direction)>0&&f.normal.multiplyScalar(-1));const m={a,b:c,c:u,normal:new G,materialIndex:0};Ii.getNormal(rx,ix,sx,m.normal),f.face=m,f.barycoord=p}return f}class yu extends zt{constructor(e=1,t=1,r=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const c=[],u=[],f=[],p=[];let m=0,x=0;v("z","y","x",-1,-1,r,t,e,o,s,0),v("z","y","x",1,-1,r,t,-e,o,s,1),v("x","z","y",1,1,e,r,t,i,o,2),v("x","z","y",1,-1,e,r,-t,i,o,3),v("x","y","z",1,-1,e,t,r,i,s,4),v("x","y","z",-1,-1,e,t,-r,i,s,5),this.setIndex(c),this.setAttribute("position",new ht(u,3)),this.setAttribute("normal",new ht(f,3)),this.setAttribute("uv",new ht(p,2));function v(_,y,g,b,S,M,A,R,F,L,N){const I=M/F,D=A/L,O=M/2,U=A/2,V=R/2,Z=F+1,Y=L+1;let ne=0,j=0;const $=new G;for(let K=0;K<Y;K++){const re=K*D-U;for(let xe=0;xe<Z;xe++){const Ce=xe*I-O;$[_]=Ce*b,$[y]=re*S,$[g]=V,u.push($.x,$.y,$.z),$[_]=0,$[y]=0,$[g]=R>0?1:-1,f.push($.x,$.y,$.z),p.push(xe/F),p.push(1-K/L),ne+=1}}for(let K=0;K<L;K++)for(let re=0;re<F;re++){const xe=m+re+Z*K,Ce=m+re+Z*(K+1),ce=m+(re+1)+Z*(K+1),_e=m+(re+1)+Z*K;c.push(xe,Ce,_e),c.push(Ce,ce,_e),j+=6}a.addGroup(x,j,N),x+=j,m+=ne}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new yu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function vh(n){const e={};for(const t in n){e[t]={};for(const r in n[t]){const i=n[t][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][r]=null):e[t][r]=i.clone():Array.isArray(i)?e[t][r]=i.slice():e[t][r]=i}}return e}function ai(n){const e={};for(let t=0;t<n.length;t++){const r=vh(n[t]);for(const i in r)e[i]=r[i]}return e}function kW(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function zk(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:an.workingColorSpace}const Vk={clone:vh,merge:ai};var LW=`void main() { 273 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 274}`,jW=`void main() { 275 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 276}`;class so extends ri{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=LW,this.fragmentShader=jW,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=vh(e.uniforms),this.uniformsGroups=kW(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 t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class pm extends dn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Rt,this.projectionMatrix=new Rt,this.projectionMatrixInverse=new Rt,this.coordinateSystem=Rs}copy(e,t){return super.copy(e,t),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,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Qa=new G,U3=new Se,B3=new Se;class Un extends pm{constructor(e=50,t=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=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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 t=.5*this.getFilmHeight()/e;this.fov=xh*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Xc*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 22,556 bytes, lines 276-311
276getEffectiveFOV(){return xh*2*Math.atan(Math.tan(Xc*.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,t,r){Qa.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Qa.x,Qa.y).multiplyScalar(-e/Qa.z),Qa.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(Qa.x,Qa.y).multiplyScalar(-e/Qa.z)}getViewSize(e,t){return this.getViewBounds(e,U3,B3),t.subVectors(B3,U3)}setViewOffset(e,t,r,i,s,o){this.aspect=e/t,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=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Xc*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,u=o.fullHeight;s+=o.offsetX*i/c,t-=o.offsetY*r/u,i*=o.width/c,r*=o.height/u}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const qu=-90,Yu=1;class Hk extends dn{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Un(qu,Yu,e,t);i.layers=this.layers,this.add(i);const s=new Un(qu,Yu,e,t);s.layers=this.layers,this.add(s);const o=new Un(qu,Yu,e,t);o.layers=this.layers,this.add(o);const a=new Un(qu,Yu,e,t);a.layers=this.layers,this.add(a);const c=new Un(qu,Yu,e,t);c.layers=this.layers,this.add(c);const u=new Un(qu,Yu,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,i,s,o,a,c]=t;for(const u of t)this.remove(u);if(e===Rs)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===Hp)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,c,u,f]=this.children,p=e.getRenderTarget(),m=e.getActiveCubeFace(),x=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const _=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(t,s),e.setRenderTarget(r,1,i),e.render(t,o),e.setRenderTarget(r,2,i),e.render(t,a),e.setRenderTarget(r,3,i),e.render(t,c),e.setRenderTarget(r,4,i),e.render(t,u),r.texture.generateMipmaps=_,e.setRenderTarget(r,5,i),e.render(t,f),e.setRenderTarget(p,m,x),e.xr.enabled=v,r.texture.needsPMREMUpdate=!0}}class mm extends Yn{constructor(e=[],t=Ca,r,i,s,o,a,c,u,f){super(e,t,r,i,s,o,a,c,u,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Wk extends Oo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new mm(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:xr}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` 277 278 varying vec3 vWorldDirection; 279 280 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 281 282 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 283 284 } 285 286 void main() { 287 288 vWorldDirection = transformDirection( position, modelMatrix ); 289 290 #include <begin_vertex> 291 #include <project_vertex> 292 293 } 294 `,fragmentShader:` 295 296 uniform sampler2D tEquirect; 297 298 varying vec3 vWorldDirection; 299 300 #include <common> 301 302 void main() { 303 304 vec3 direction = normalize( vWorldDirection ); 305 306 vec2 sampleUV = equirectUv( direction ); 307 308 gl_FragColor = texture2D( tEquirect, sampleUV ); 309 310 } 311 `},i=new yu(5,5,5),s=new so({name:"CubemapFromEquirect",uniforms:vh(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:mi,blending:va});s.uniforms.tEquirect.value=t;const o=new cr(i,s),a=t.minFilter;return t.minFilter===To&&(t.minFilter=xr),new Hk(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,r=!0,i=!0){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,i);e.setRenderTarget(s)}}let Md=class extends dn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const OW={type:"move"};class u0{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Md,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 Md,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Md,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),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 t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,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,t,r){let i=null,s=null,o=null;const a=this._targetRay,c=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,r),g=this._getHandJoint(u,_);y!==null&&(g.matrix.fromArray(y.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=y.radius),g.visible=y!==null}const f=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],m=f.position.distanceTo(p.position),x=.02,v=.005;u.inputState.pinching&&m>x+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&m<=x-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(OW)))}return a!==null&&(a.visible=i!==null),c!==null&&(c.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new Md;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class zy{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new at(e),this.density=t}clone(){return new zy(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Vy{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new at(e),this.near=t,this.far=r}clone(){return new Vy(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class sM extends dn{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 ls,this.environmentIntensity=1,this.environmentRotation=new ls,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),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 t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Hy{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Vp,this.updateRanges=[],this.version=0,this.uuid=os()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}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,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[r+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=os()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=os()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const oi=new G;class lu{constructor(e,t,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)oi.fromBufferAttribute(this,t),oi.applyMatrix4(e),this.setXYZ(t,oi.x,oi.y,oi.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)oi.fromBufferAttribute(this,t),oi.applyNormalMatrix(e),this.setXYZ(t,oi.x,oi.y,oi.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)oi.fromBufferAttribute(this,t),oi.transformDirection(e),this.setXYZ(t,oi.x,oi.y,oi.z);return this}getComponent(e,t){let r=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(r=fi(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=Ut(r,this.array)),this.data.array[e*this.data.stride+this.offset+t]=r,this}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=fi(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=fi(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=fi(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=fi(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array),i=Ut(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),r=Ut(r,this.array),i=Ut(i,this.array),s=Ut(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new En(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new lu(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class oM extends ri{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new at(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Ku;const wf=new G,Zu=new G,Qu=new G,Ju=new Se,bf=new Se,Gk=new Rt,cx=new G,Sf=new G,ux=new G,z3=new Se,Dw=new Se,V3=new Se;class $k extends dn{constructor(e=new oM){if(super(),this.isSprite=!0,this.type="Sprite",Ku===void 0){Ku=new zt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),r=new Hy(t,5);Ku.setIndex([0,1,2,0,2,3]),Ku.setAttribute("position",new lu(r,3,0,!1)),Ku.setAttribute("uv",new lu(r,2,3,!1))}this.geometry=Ku,this.material=e,this.center=new Se(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Zu.setFromMatrixScale(this.matrixWorld),Gk.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Qu.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Zu.multiplyScalar(-Qu.z);const r=this.material.rotation;let i,s;r!==0&&(s=Math.cos(r),i=Math.sin(r));const o=this.center;dx(cx.set(-.5,-.5,0),Qu,o,Zu,i,s),dx(Sf.set(.5,-.5,0),Qu,o,Zu,i,s),dx(ux.set(.5,.5,0),Qu,o,Zu,i,s),z3.set(0,0),Dw.set(1,0),V3.set(1,1);let a=e.ray.intersectTriangle(cx,Sf,ux,!1,wf);if(a===null&&(dx(Sf.set(-.5,.5,0),Qu,o,Zu,i,s),Dw.set(0,1),a=e.ray.intersectTriangle(cx,ux,Sf,!1,wf),a===null))return;const c=e.ray.origin.distanceTo(wf);c<e.near||c>e.far||t.push({distance:c,point:wf.clone(),uv:Ii.getInterpolation(wf,cx,Sf,ux,z3,Dw,V3,new Se),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function dx(n,e,t,r,i,s){Ju.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(bf.x=s*Ju.x-i*Ju.y,bf.y=i*Ju.x+s*Ju.y):bf.copy(Ju),n.copy(e),n.x+=bf.x,n.y+=bf.y,n.applyMatrix4(Gk)}const hx=new G,H3=new G;class Xk extends dn{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let r=0,i=t.length;r<i;r++){const s=t[r];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,r=0){t=Math.abs(t);const i=this.levels;let s;for(s=0;s<i.length&&!(t<i[s].distance);s++);return i.splice(s,0,{distance:t,hysteresis:r,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let r=0;r<t.length;r++)if(t[r].distance===e){const i=t.splice(r,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let r,i;for(r=1,i=t.length;r<i;r++){let s=t[r].distance;if(t[r].object.visible&&(s-=s*t[r].hysteresis),e<s)break}return t[r-1].object}return null}raycast(e,t){if(this.levels.length>0){hx.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(hx);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){hx.setFromMatrixPosition(e.matrixWorld),H3.setFromMatrixPosition(this.matrixWorld);const r=hx.distanceTo(H3)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i<s;i++){let o=t[i].distance;if(t[i].object.visible&&(o-=o*t[i].hysteresis),r>=o)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<s;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const r=this.levels;for(let i=0,s=r.length;i<s;i++){const o=r[i];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}}const W3=new G,G3=new cn,$3=new cn,UW=new G,X3=new Rt,fx=new G,kw=new jr,q3=new Rt,Lw=new vu;class qk extends cr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=GS,this.bindMatrix=new Rt,this.bindMatrixInverse=new Rt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Jr),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)this.getVertexPosition(r,fx),this.boundingBox.expandByPoint(fx)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new jr),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)this.getVertexPosition(r,fx),this.boundingSphere.expandByPoint(fx)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const r=this.material,i=this.matrixWorld;r!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),kw.copy(this.boundingSphere),kw.applyMatrix4(i),e.ray.intersectsSphere(kw)!==!1&&(q3.copy(i).invert(),Lw.copy(e.ray).applyMatrix4(q3),!(this.boundingBox!==null&&Lw.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Lw)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new cn,t=this.geometry.attributes.skinWeight;for(let r=0,i=t.count;r<i;r++){e.fromBufferAttribute(t,r);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===GS?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Sk?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}
vendor: 7,288 bytes, line 311
311applyBoneTransform(e,t){const r=this.skeleton,i=this.geometry;G3.fromBufferAttribute(i.attributes.skinIndex,e),$3.fromBufferAttribute(i.attributes.skinWeight,e),W3.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=$3.getComponent(s);if(o!==0){const a=G3.getComponent(s);X3.multiplyMatrices(r.bones[a].matrixWorld,r.boneInverses[a]),t.addScaledVector(UW.copy(W3).applyMatrix4(X3),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class aM extends dn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Fo extends Yn{constructor(e=null,t=1,r=1,i,s,o,a,c,u=Lr,f=Lr,p,m){super(null,o,a,c,u,f,i,s,p,m),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Y3=new Rt,BW=new Rt;class Wy{constructor(e=[],t=[]){this.uuid=os(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,i=this.bones.length;r<i;r++)this.boneInverses.push(new Rt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const r=new Rt;this.bones[e]&&r.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&r.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){const e=this.bones,t=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:BW;Y3.multiplyMatrices(a,t[s]),Y3.toArray(r,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Wy(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const r=new Fo(t,e,e,Zr,Li);return r.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=r,this}getBoneByName(e){for(let t=0,r=this.bones.length;t<r;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let r=0,i=e.bones.length;r<i;r++){const s=e.bones[r];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new aM),this.bones.push(o),this.boneInverses.push(new Rt().fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,r=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const a=r[i];e.boneInverses.push(a.toArray())}return e}}class yh extends En{constructor(e,t,r,i=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const ed=new Rt,K3=new Rt,px=[],Z3=new Jr,zW=new Rt,Ef=new cr,Mf=new jr;class Yk extends cr{constructor(e,t,r){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new yh(new Float32Array(r*16),16),this.instanceColor=null,this.morphTexture=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<r;i++)this.setMatrixAt(i,zW)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Jr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,ed),Z3.copy(e.boundingBox).applyMatrix4(ed),this.boundingBox.union(Z3)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new jr),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,ed),Mf.copy(e.boundingSphere).applyMatrix4(ed),this.boundingSphere.union(Mf)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const r=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=r.length+1,o=e*s+1;for(let a=0;a<r.length;a++)r[a]=i[o+a]}raycast(e,t){const r=this.matrixWorld,i=this.count;if(Ef.geometry=this.geometry,Ef.material=this.material,Ef.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Mf.copy(this.boundingSphere),Mf.applyMatrix4(r),e.ray.intersectsSphere(Mf)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,ed),K3.multiplyMatrices(r,ed),Ef.matrixWorld=K3,Ef.raycast(e,px);for(let o=0,a=px.length;o<a;o++){const c=px[o];c.instanceId=s,c.object=this,t.push(c)}px.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new yh(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const r=t.morphTargetInfluences,i=r.length+1;this.morphTexture===null&&(this.morphTexture=new Fo(new Float32Array(i*this.count),i,this.count,ky,Li));const s=this.morphTexture.source.data.data;let o=0;for(let u=0;u<r.length;u++)o+=r[u];const a=this.geometry.morphTargetsRelative?1:1-o,c=i*e;s[c]=a,s.set(r,c+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const jw=new G,VW=new G,HW=new jt;class la{constructor(e=new G(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=jw.subVectors(r,t).cross(VW.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(jw),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;
vendor: 4,747 bytes, line 311
311const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>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,t){const r=t||HW.getNormalMatrix(e),i=this.coplanarPoint(jw).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),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 dc=new jr,mx=new G;class jh{constructor(e=new la,t=new la,r=new la,i=new la,s=new la,o=new la){this.planes=[e,t,r,i,s,o]}set(e,t,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=Rs){const r=this.planes,i=e.elements,s=i[0],o=i[1],a=i[2],c=i[3],u=i[4],f=i[5],p=i[6],m=i[7],x=i[8],v=i[9],_=i[10],y=i[11],g=i[12],b=i[13],S=i[14],M=i[15];if(r[0].setComponents(c-s,m-u,y-x,M-g).normalize(),r[1].setComponents(c+s,m+u,y+x,M+g).normalize(),r[2].setComponents(c+o,m+f,y+v,M+b).normalize(),r[3].setComponents(c-o,m-f,y-v,M-b).normalize(),r[4].setComponents(c-a,m-p,y-_,M-S).normalize(),t===Rs)r[5].setComponents(c+a,m+p,y+_,M+S).normalize();else if(t===Hp)r[5].setComponents(a,p,_,S).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),dc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),dc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(dc)}intersectsSprite(e){return dc.center.set(0,0,0),dc.radius=.7071067811865476,dc.applyMatrix4(e.matrixWorld),this.intersectsSphere(dc)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const i=t[r];if(mx.x=i.normal.x>0?e.max.x:e.min.x,mx.y=i.normal.y>0?e.max.y:e.min.y,mx.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(mx)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const vo=new Rt,yo=new jh;class Gy{constructor(){this.coordinateSystem=Rs}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let r=0;r<t.cameras.length;r++){const i=t.cameras[r];if(vo.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),yo.setFromProjectionMatrix(vo,this.coordinateSystem),yo.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let r=0;r<t.cameras.length;r++){const i=t.cameras[r];if(vo.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),yo.setFromProjectionMatrix(vo,this.coordinateSystem),yo.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let r=0;r<t.cameras.length;r++){const i=t.cameras[r];if(vo.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),yo.setFromProjectionMatrix(vo,this.coordinateSystem),yo.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let r=0;r<t.cameras.length;r++){const i=t.cameras[r];if(vo.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),yo.setFromProjectionMatrix(vo,this.coordinateSystem),yo.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let r=0;r<t.cameras.length;r++){const i=t.cameras[r];if(vo.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),yo.setFromProjectionMatrix(vo,this.coordinateSystem),yo.containsPoint(e))return!0}return!1}clone(){return new Gy}}function Ow(n,e){return n-e}function WW(n,e){return n.z-e.z}function GW(n,e){return e.z-n.z}class $W{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,r,i){const s=this.pool,o=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const a=s[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=r,a.index=i}reset(){this.list.length=0,this.index=0}}const Ai=new Rt,XW=new at(1,1,1),Q3=new jh,qW=new Gy,gx=new Jr,hc=new jr,Af=new G,J3=new G,YW=new G,Uw=new $W,qr=new cr,xx=[];function KW(n,e,t=0){const r=e.itemSize;
311if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const i=n.count;for(let s=0;s<i;s++)for(let o=0;o<r;o++)e.setComponent(s+t,o,n.getComponent(s,o))}else e.array.set(n.array,t*r);e.needsUpdate=!0}function fc(n,e){if(n.constructor!==e.constructor){const t=Math.min(n.length,e.length);for(let r=0;r<t;r++)e[r]=n[r]}else{const t=Math.min(n.length,e.length);e.set(new n.constructor(n.buffer,0,t))}}class Kk extends cr{constructor(e,t,r=t*2,i){super(new zt,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=r,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),r=new Fo(t,e,e,Zr,Li);this._matricesTexture=r}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),r=new Fo(t,e,e,hm,Na);this._indirectTexture=r}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),r=new Fo(t,e,e,Zr,Li);r.colorSpace=an.workingColorSpace,this._colorsTexture=r}_initializeGeometry(e){const t=this.geometry,r=this._maxVertexCount,i=this._maxIndexCount;if(this._geometryInitialized===!1){for(const s in e.attributes){const o=e.getAttribute(s),{array:a,itemSize:c,normalized:u}=o,f=new a.constructor(r*c),p=new En(f,c,u);t.setAttribute(s,p)}if(e.getIndex()!==null){const s=r>65535?new Uint32Array(i):new Uint16Array(i);t.setIndex(new En(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const r in t.attributes){if(!e.hasAttribute(r))throw new Error(`THREE.BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),s=t.getAttribute(r);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Jr);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let r=0,i=t.length;r<i;r++){if(t[r].active===!1)continue;const s=t[r].geometryIndex;this.getMatrixAt(r,Ai),this.getBoundingBoxAt(s,gx).applyMatrix4(Ai),e.union(gx)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new jr);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let r=0,i=t.length;r<i;r++){if(t[r].active===!1)continue;const s=t[r].geometryIndex;this.getMatrixAt(r,Ai),this.getBoundingSphereAt(s,hc).applyMatrix4(Ai),e.union(hc)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const r={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Ow),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=r):(i=this._instanceInfo.length,this._instanceInfo.push(r));const s=this._matricesTexture;Ai.identity().toArray(s.image.data,i*16),s.needsUpdate=!0;const o=this._colorsTexture;return o&&(XW.toArray(o.image.data,i*4),o.needsUpdate=!0),this._visibilityChanged=!0,i}
vendor: 10,106 bytes, line 311
311addGeometry(e,t=-1,r=-1){this._initializeGeometry(e),this._validateGeometry(e);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=r===-1?o.count:r),i.indexStart!==-1&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let c;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Ow),c=this._availableGeometryIds.shift(),s[c]=i):(c=this._geometryCount,this._geometryCount++,s.push(i)),this.setGeometryAt(c,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,c}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const r=this.geometry,i=r.getIndex()!==null,s=r.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(i&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const c=a.vertexStart,u=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const f in r.attributes){const p=t.getAttribute(f),m=r.getAttribute(f);KW(p,m,c);const x=p.itemSize;for(let v=p.count,_=u;v<_;v++){const y=c+v;for(let g=0;g<x;g++)m.setComponent(y,g,0)}m.needsUpdate=!0,m.addUpdateRange(c*x,u*x)}if(i){const f=a.indexStart,p=a.reservedIndexCount;a.indexCount=t.getIndex().count;for(let m=0;m<o.count;m++)s.setX(f+m,c+o.getX(m));for(let m=o.count,x=p;m<x;m++)s.setX(f+m,c);s.needsUpdate=!0,s.addUpdateRange(f,a.reservedIndexCount)}return a.start=i?a.indexStart:a.vertexStart,a.count=i?a.indexCount:a.vertexCount,a.boundingBox=null,t.boundingBox!==null&&(a.boundingBox=t.boundingBox.clone()),a.boundingSphere=null,t.boundingSphere!==null&&(a.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const r=this._instanceInfo;for(let i=0,s=r.length;i<s;i++)r[i].active&&r[i].geometryIndex===e&&this.deleteInstance(i);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const r=this._geometryInfo,i=r.map((o,a)=>a).sort((o,a)=>r[o].vertexStart-r[a].vertexStart),s=this.geometry;for(let o=0,a=r.length;o<a;o++){const c=i[o],u=r[c];if(u.active!==!1){if(s.index!==null){if(u.indexStart!==t){const{indexStart:f,vertexStart:p,reservedIndexCount:m}=u,x=s.index,v=x.array,_=e-p;for(let y=f;y<f+m;y++)v[y]=v[y]+_;x.array.copyWithin(t,f,f+m),x.addUpdateRange(t,m),u.indexStart=t}t+=u.reservedIndexCount}if(u.vertexStart!==e){const{vertexStart:f,reservedVertexCount:p}=u,m=s.attributes;for(const x in m){const v=m[x],{array:_,itemSize:y}=v;_.copyWithin(e*y,f*y,(f+p)*y),v.addUpdateRange(e*y,p*y)}u.vertexStart=e}e+=u.reservedVertexCount,u.start=s.index?u.indexStart:u.vertexStart,this._nextIndexStart=s.index?u.indexStart+u.reservedIndexCount:0,this._nextVertexStart=u.vertexStart+u.reservedVertexCount}}return this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const r=this.geometry,i=this._geometryInfo[e];if(i.boundingBox===null){const s=new Jr,o=r.index,a=r.attributes.position;for(let c=i.start,u=i.start+i.count;c<u;c++){let f=c;o&&(f=o.getX(f)),s.expandByPoint(Af.fromBufferAttribute(a,f))}i.boundingBox=s}return t.copy(i.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const r=this.geometry,i=this._geometryInfo[e];if(i.boundingSphere===null){const s=new jr;this.getBoundingBoxAt(e,gx),gx.getCenter(s.center);const o=r.index,a=r.attributes.position;let c=0;for(let u=i.start,f=i.start+i.count;u<f;u++){let p=u;o&&(p=o.getX(p)),Af.fromBufferAttribute(a,p),c=Math.max(c,s.center.distanceToSquared(Af))}s.radius=Math.sqrt(c),i.boundingSphere=s}return t.copy(i.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const r=this._matricesTexture,i=this._matricesTexture.image.data;return t.toArray(i,e*16),r.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const r=this._geometryInfo[e];return t.vertexStart=r.vertexStart,t.vertexCount=r.vertexCount,t.reservedVertexCount=r.reservedVertexCount,t.indexStart=r.indexStart,t.indexCount=r.indexCount,t.reservedIndexCount=r.reservedIndexCount,t.start=r.start,t.count=r.count,t}setInstanceCount(e){const t=this._availableInstanceIds,r=this._instanceInfo;for(t.sort(Ow);t[t.length-1]===r.length;)r.pop(),t.pop();if(e<r.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const i=new Int32Array(e),s=new Int32Array(e);fc(this._multiDrawCounts,i),fc(this._multiDrawStarts,s),this._multiDrawCounts=i,this._multiDrawStarts=s,this._maxInstanceCount=e;const o=this._indirectTexture,a=this._matricesTexture,c=this._colorsTexture;o.dispose(),this._initIndirectTexture(),fc(o.image.data,this._indirectTexture.image.data),a.dispose(),this._initMatricesTexture(),fc(a.image.data,this._matricesTexture.image.data),c&&(c.dispose(),this._initColorsTexture(),fc(c.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const r=[...this._geometryInfo].filter(a=>a.active);if(Math.max(...r.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...r.map(c=>c.indexStart+c.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new zt,this._initializeGeometry(s));const o=this.geometry;s.index&&fc(s.index.array,o.index.array);for(const a in s.attributes)fc(s.attributes[a].array,o.attributes[a].array)}raycast(e,t){const r=this._instanceInfo,i=this._geometryInfo,s=this.matrixWorld,o=this.geometry;qr.material=this.material,qr.geometry.index=o.index,qr.geometry.attributes=o.attributes,qr.geometry.boundingBox===null&&(qr.geometry.boundingBox=new Jr),qr.geometry.boundingSphere===null&&(qr.geometry.boundingSphere=new jr);for(let a=0,c=r.length;a<c;a++){if(!r[a].visible||!r[a].active)continue;const u=r[a].geometryIndex,f=i[u];qr.geometry.setDrawRange(f.start,f.count),this.getMatrixAt(a,qr.matrixWorld).premultiply(s),this.getBoundingBoxAt(u,qr.geometry.boundingBox),this.getBoundingSphereAt(u,qr.geometry.boundingSphere),qr.raycast(e,xx);for(let p=0,m=xx.length;p<m;p++){const x=xx[p];x.object=this,x.batchId=a,t.push(x)}xx.length=0}qr.material=null,qr.geometry.index=null,qr.geometry.attributes={},qr.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,r,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=i.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,c=this._instanceInfo,u=this._multiDrawStarts,f=this._multiDrawCounts,p=this._geometryInfo,m=this.perObjectFrustumCulled,x=this._indirectTexture,v=x.image.data,_=r.
vendor: 4,382 bytes, line 311
311isArrayCamera?qW:Q3;m&&!r.isArrayCamera&&(Ai.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),Q3.setFromProjectionMatrix(Ai,e.coordinateSystem));let y=0;if(this.sortObjects){Ai.copy(this.matrixWorld).invert(),Af.setFromMatrixPosition(r.matrixWorld).applyMatrix4(Ai),J3.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(Ai);for(let S=0,M=c.length;S<M;S++)if(c[S].visible&&c[S].active){const A=c[S].geometryIndex;this.getMatrixAt(S,Ai),this.getBoundingSphereAt(A,hc).applyMatrix4(Ai);let R=!1;if(m&&(R=!_.intersectsSphere(hc,r)),!R){const F=p[A],L=YW.subVectors(hc.center,Af).dot(J3);Uw.push(F.start,F.count,L,S)}}const g=Uw.list,b=this.customSort;b===null?g.sort(s.transparent?GW:WW):b.call(this,g,r);for(let S=0,M=g.length;S<M;S++){const A=g[S];u[y]=A.start*a,f[y]=A.count,v[y]=A.index,y++}Uw.reset()}else for(let g=0,b=c.length;g<b;g++)if(c[g].visible&&c[g].active){const S=c[g].geometryIndex;let M=!1;if(m&&(this.getMatrixAt(g,Ai),this.getBoundingSphereAt(S,hc).applyMatrix4(Ai),M=!_.intersectsSphere(hc,r)),!M){const A=p[S];u[y]=A.start*a,f[y]=A.count,v[y]=g,y++}}x.needsUpdate=!0,this._multiDrawCount=y,this._visibilityChanged=!1}onBeforeShadow(e,t,r,i,s,o){this.onBeforeRender(e,null,i,s,o)}}class yi extends ri{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new at(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 Fv=new G,Dv=new G,eN=new Rt,Tf=new vu,vx=new jr,Bw=new G,tN=new G;class Ul extends dn{constructor(e=new zt,t=new yi){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),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 t=e.attributes.position,r=[0];for(let i=1,s=t.count;i<s;i++)Fv.fromBufferAttribute(t,i-1),Dv.fromBufferAttribute(t,i),r[i]=r[i-1],r[i]+=Fv.distanceTo(Dv);e.setAttribute("lineDistance",new ht(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),vx.copy(r.boundingSphere),vx.applyMatrix4(i),vx.radius+=s,e.ray.intersectsSphere(vx)===!1)return;eN.copy(i).invert(),Tf.copy(e.ray).applyMatrix4(eN);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=a*a,u=this.isLineSegments?2:1,f=r.index,m=r.attributes.position;if(f!==null){const x=Math.max(0,o.start),v=Math.min(f.count,o.start+o.count);for(let _=x,y=v-1;_<y;_+=u){const g=f.getX(_),b=f.getX(_+1),S=yx(this,e,Tf,c,g,b,_);S&&t.push(S)}if(this.isLineLoop){const _=f.getX(v-1),y=f.getX(x),g=yx(this,e,Tf,c,_,y,v-1);g&&t.push(g)}}else{const x=Math.max(0,o.start),v=Math.min(m.count,o.start+o.count);for(let _=x,y=v-1;_<y;_+=u){const g=yx(this,e,Tf,c,_,_+1,_);g&&t.push(g)}if(this.isLineLoop){const _=yx(this,e,Tf,c,v-1,x,v-1);_&&t.push(_)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function yx(n,e,t,r,i,s,o){const a=n.geometry.attributes.position;if(Fv.fromBufferAttribute(a,i),Dv.fromBufferAttribute(a,s),t.distanceSqToSegment(Fv,Dv,Bw,tN)>r)return;Bw.applyMatrix4(n.matrixWorld);const u=e.ray.origin.distanceTo(Bw);if(!(u<e.near||u>e.far))return{distance:u,point:tN.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const nN=new G,rN=new G;class Vo extends Ul{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[];for(let i=0,s=t.count;i<s;i+=2)nN.fromBufferAttribute(t,i),rN.fromBufferAttribute(t,i+1),r[i]=i===0?0:r[i-1],r[
vendor: 4,935 bytes, line 311
311i+1]=r[i]+nN.distanceTo(rN);e.setAttribute("lineDistance",new ht(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Zk extends Ul{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class lM extends ri{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new at(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const iN=new Rt,qS=new vu,_x=new jr,wx=new G;class Qk extends dn{constructor(e=new zt,t=new lM){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),_x.copy(r.boundingSphere),_x.applyMatrix4(i),_x.radius+=s,e.ray.intersectsSphere(_x)===!1)return;iN.copy(i).invert(),qS.copy(e.ray).applyMatrix4(iN);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=a*a,u=r.index,p=r.attributes.position;if(u!==null){const m=Math.max(0,o.start),x=Math.min(u.count,o.start+o.count);for(let v=m,_=x;v<_;v++){const y=u.getX(v);wx.fromBufferAttribute(p,y),sN(wx,y,c,i,e,t,this)}}else{const m=Math.max(0,o.start),x=Math.min(p.count,o.start+o.count);for(let v=m,_=x;v<_;v++)wx.fromBufferAttribute(p,v),sN(wx,v,c,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function sN(n,e,t,r,i,s,o){const a=qS.distanceSqToPoint(n);if(a<t){const c=new G;qS.closestPointToPoint(n,c),c.applyMatrix4(r);const u=i.ray.origin.distanceTo(c);if(u<i.near||u>i.far)return;s.push({distance:u,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class Jk extends Yn{constructor(e,t,r,i,s=xr,o=xr,a,c,u){super(e,t,r,i,s,o,a,c,u),this.isVideoTexture=!0,this.generateMipmaps=!1;const f=this;function p(){f.needsUpdate=!0,e.requestVideoFrameCallback(p)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(p)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class ZW extends Jk{constructor(e,t,r,i,s,o,a,c){super({},e,t,r,i,s,o,a,c),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class QW extends Yn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Lr,this.minFilter=Lr,this.generateMipmaps=!1,this.needsUpdate=!0}}class $y extends Yn{constructor(e,t,r,i,s,o,a,c,u,f,p,m){super(null,o,a,c,u,f,i,s,p,m),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class JW extends $y{constructor(e,t,r,i,s,o){super(e,t,r,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ns,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class eG extends $y{constructor(e,t,r){super(void 0,e[0].width,e[0].height,t,r,Ca),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class cM extends Yn{constructor(e,t,r,i,s,o,a,c,u){super(e,t,r,i,s,o,a,c,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Xy extends Yn{constructor(e,t,r=Na,i,s,o,a=Lr,c=Lr,u,f=mh){if(f!==mh&&f!==gh)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,i,s,o,a,c,f,r,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new _l(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class tG extends Xy{constructor(e=1,t=1,r=1){super(e,t),this.isDepthArrayTexture=!0,this.image={width:e,height:t,depth:r},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class qy extends zt{constructor(e=1,t=1,r=4,i=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radiu
vendor: 2,829 bytes, line 311
311s:e,height:t,capSegments:r,radialSegments:i,heightSegments:s},t=Math.max(0,t),r=Math.max(1,Math.floor(r)),i=Math.max(3,Math.floor(i)),s=Math.max(1,Math.floor(s));const o=[],a=[],c=[],u=[],f=t/2,p=Math.PI/2*e,m=t,x=2*p+m,v=r*2+s,_=i+1,y=new G,g=new G;for(let b=0;b<=v;b++){let S=0,M=0,A=0,R=0;if(b<=r){const N=b/r,I=N*Math.PI/2;M=-f-e*Math.cos(I),A=e*Math.sin(I),R=-e*Math.cos(I),S=N*p}else if(b<=r+s){const N=(b-r)/s;M=-f+N*t,A=e,R=0,S=p+N*m}else{const N=(b-r-s)/r,I=N*Math.PI/2;M=f+e*Math.sin(I),A=e*Math.cos(I),R=e*Math.sin(I),S=p+m+N*p}const F=Math.max(0,Math.min(1,S/x));let L=0;b===0?L=.5/i:b===v&&(L=-.5/i);for(let N=0;N<=i;N++){const I=N/i,D=I*Math.PI*2,O=Math.sin(D),U=Math.cos(D);g.x=-A*U,g.y=M,g.z=A*O,a.push(g.x,g.y,g.z),y.set(-A*U,R,A*O),y.normalize(),c.push(y.x,y.y,y.z),u.push(I+L,F)}if(b>0){const N=(b-1)*_;for(let I=0;I<i;I++){const D=N+I,O=N+I+1,U=b*_+I,V=b*_+I+1;o.push(D,O,U),o.push(O,V,U)}}}this.setIndex(o),this.setAttribute("position",new ht(a,3)),this.setAttribute("normal",new ht(c,3)),this.setAttribute("uv",new ht(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qy(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class Yy extends zt{constructor(e=1,t=32,r=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:i},t=Math.max(3,t);const s=[],o=[],a=[],c=[],u=new G,f=new Se;o.push(0,0,0),a.push(0,0,1),c.push(.5,.5);for(let p=0,m=3;p<=t;p++,m+=3){const x=r+p/t*i;u.x=e*Math.cos(x),u.y=e*Math.sin(x),o.push(u.x,u.y,u.z),a.push(0,0,1),f.x=(o[m]/e+1)/2,f.y=(o[m+1]/e+1)/2,c.push(f.x,f.y)}for(let p=1;p<=t;p++)s.push(p,p+1,0);this.setIndex(s),this.setAttribute("position",new ht(o,3)),this.setAttribute("normal",new ht(a,3)),this.setAttribute("uv",new ht(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Yy(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class gm extends zt{constructor(e=1,t=1,r=1,i=32,s=1,o=!1,a=0,c=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:c};const u=this;i=Math.floor(i),s=Math.floor(s);const f=[],p=[],m=[],x=[];let v=0;const _=[],y=r/2;let g=0;b(),o===!1&&(e>0&&S(!0),t>0&&S(!1)),this.setIndex(f),this.setAttribute("position",new ht(p,3)),this.setAttribute("normal",new ht(m,3)),this.setAttribute("uv",new ht(x,2));function b(){const M=new G,A=new G;let R=0;const F=(t-e)/r;for(let L=0;L<=s;L++){const N=[],I=L/s,D=I*(t-e)+e;for(let O=0;O<=i;O++){const U=O/i,V=U*c+a,Z=Math.sin(V),Y=Math.cos(V);A.x=D*Z,A.y=-I*r+y,A.z=D*Y,p.push(A.x,A.y,A.z),M.set(Z,F,Y).normalize(),m.push(M.x,M.y,M.z),x.push(U,1-I),N.push(v++)}_.push(N)}for(let L=0;L<i;
vendor: 13,910 bytes, line 311
311L++)for(let N=0;N<s;N++){const I=_[N][L],D=_[N+1][L],O=_[N+1][L+1],U=_[N][L+1];(e>0||N!==0)&&(f.push(I,D,U),R+=3),(t>0||N!==s-1)&&(f.push(D,O,U),R+=3)}u.addGroup(g,R,0),g+=R}function S(M){const A=v,R=new Se,F=new G;let L=0;const N=M===!0?e:t,I=M===!0?1:-1;for(let O=1;O<=i;O++)p.push(0,y*I,0),m.push(0,I,0),x.push(.5,.5),v++;const D=v;for(let O=0;O<=i;O++){const V=O/i*c+a,Z=Math.cos(V),Y=Math.sin(V);F.x=N*Y,F.y=y*I,F.z=N*Z,p.push(F.x,F.y,F.z),m.push(0,I,0),R.x=Z*.5+.5,R.y=Y*.5*I+.5,x.push(R.x,R.y),v++}for(let O=0;O<i;O++){const U=A+O,V=D+O;M===!0?f.push(V,V+1,U):f.push(V+1,V,U),L+=3}u.addGroup(g,L,M===!0?1:2),g+=L}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new gm(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class xm extends gm{constructor(e=1,t=1,r=32,i=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,r,i,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new xm(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ql extends zt{constructor(e=[],t=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:i};const s=[],o=[];a(i),u(r),f(),this.setAttribute("position",new ht(s,3)),this.setAttribute("normal",new ht(s.slice(),3)),this.setAttribute("uv",new ht(o,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function a(b){const S=new G,M=new G,A=new G;for(let R=0;R<t.length;R+=3)x(t[R+0],S),x(t[R+1],M),x(t[R+2],A),c(S,M,A,b)}function c(b,S,M,A){const R=A+1,F=[];for(let L=0;L<=R;L++){F[L]=[];const N=b.clone().lerp(M,L/R),I=S.clone().lerp(M,L/R),D=R-L;for(let O=0;O<=D;O++)O===0&&L===R?F[L][O]=N:F[L][O]=N.clone().lerp(I,O/D)}for(let L=0;L<R;L++)for(let N=0;N<2*(R-L)-1;N++){const I=Math.floor(N/2);N%2===0?(m(F[L][I+1]),m(F[L+1][I]),m(F[L][I])):(m(F[L][I+1]),m(F[L+1][I+1]),m(F[L+1][I]))}}function u(b){const S=new G;for(let M=0;M<s.length;M+=3)S.x=s[M+0],S.y=s[M+1],S.z=s[M+2],S.normalize().multiplyScalar(b),s[M+0]=S.x,s[M+1]=S.y,s[M+2]=S.z}function f(){const b=new G;for(let S=0;S<s.length;S+=3){b.x=s[S+0],b.y=s[S+1],b.z=s[S+2];const M=y(b)/2/Math.PI+.5,A=g(b)/Math.PI+.5;o.push(M,1-A)}v(),p()}function p(){for(let b=0;b<o.length;b+=6){const S=o[b+0],M=o[b+2],A=o[b+4],R=Math.max(S,M,A),F=Math.min(S,M,A);R>.9&&F<.1&&(S<.2&&(o[b+0]+=1),M<.2&&(o[b+2]+=1),A<.2&&(o[b+4]+=1))}}function m(b){s.push(b.x,b.y,b.z)}function x(b,S){const M=b*3;S.x=e[M+0],S.y=e[M+1],S.z=e[M+2]}function v(){const b=new G,S=new G,M=new G,A=new G,R=new Se,F=new Se,L=new Se;for(let N=0,I=0;N<s.length;N+=9,I+=6){b.set(s[N+0],s[N+1],s[N+2]),S.set(s[N+3],s[N+4],s[N+5]),M.set(s[N+6],s[N+7],s[N+8]),R.set(o[I+0],o[I+1]),F.set(o[I+2],o[I+3]),L.set(o[I+4],o[I+5]),A.copy(b).add(S).add(M).divideScalar(3);const D=y(A);_(R,I+0,b,D),_(F,I+2,S,D),_(L,I+4,M,D)}}function _(b,S,M,A){A<0&&b.x===1&&(o[S]=b.x-1),M.x===0&&M.z===0&&(o[S]=A/2/Math.PI+.5)}function y(b){return Math.atan2(b.z,-b.x)}function g(b){return Math.atan2(-b.y,Math.sqrt(b.x*b.x+b.z*b.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ql(e.vertices,e.indices,e.radius,e.details)}}class Ky extends ql{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,i=1/r,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Ky(e.radius,e.detail)}}const bx=new G,Sx=new G,zw=new G,Ex=new Ii;class eL extends zt{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),s=Math.cos(Xc*t),o=e.getIndex(),a=e.getAttribute("position"),c=o?o.count:a.count,u=[0,0,0],f=["a","b","c"],p=new Array(3),m={},x=[];for(let v=0;v<c;v+=3){o?(u[0]=o.getX(v),u[1]=o.getX(v+1),u[2]=o.getX(v+2)):(u[0]=v,u[1]=v+1,u[2]=v+2);const{a:_,b:y,c:g}=Ex;if(_.fromBufferAttribute(a,u[0]),y.fromBufferAttribute(a,u[1]),g.fromBufferAttribute(a,u[2]),Ex.getNormal(zw),p[0]=`${Math.round(_.x*i)},${Math.round(_.y*i)},${Math.round(_.z*i)}`,p[1]=`${Math.round(y.x*i)},${Math.round(y.y*i)},${Math.round(y.z*i)}`,p[2]=`${Math.round(g.x*i)},${Math.round(g.y*i)},${Math.round(g.z*i)}`,!(p[0]===p[1]||p[1]===p[2]||p[2]===p[0]))for(let b=0;b<3;b++){const S=(b+1)%3,M=p[b],A=p[S],R=Ex[f[b]],F=Ex[f[S]],L=`${M}_${A}`,N=`${A}_${M}`;N in m&&m[N]?(zw.dot(m[N].normal)<=s&&(x.push(R.x,R.y,R.z),x.push(F.x,F.y,F.z)),m[N]=null):L in m||(m[L]={index0:u[b],index1:u[S],normal:zw.clone()})}}for(const v in m)if(m[v]){const{index0:_,index1:y}=m[v];bx.fromBufferAttribute(a,_),Sx.fromBufferAttribute(a,y),x.push(bx.x,bx.y,bx.z),x.push(Sx.x,Sx.y,Sx.z)}this.setAttribute("position",new ht(x,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class oo{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const r=this.getLengths();let i=0;const s=r.length;let o;t?o=t:o=e*r[s-1];let a=0,c=s-1,u;for(;a<=c;)if(i=Math.floor(a+(c-a)/2),u=r[i]-o,u<0)a=i+1;else if(u>0)c=i-1;else{c=i;break}if(i=c,r[i]===o)return i/(s-1);const f=r[i],m=r[i+1]-f,x=(o-f)/m;return(i+x)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),a=this.getPoint(s),c=t||(o.isVector2?new Se:new G);return c.copy(a).sub(o).normalize(),c}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t=!1){const r=new G,i=[],s=[],o=[],a=new G,c=new Rt;for(let x=0;x<=e;x++){const v=x/e;i[x]=this.getTangentAt(v,new G)}s[0]=new G,o[0]=new G;let u=Number.MAX_VALUE;const f=Math.abs(i[0].x),p=Math.abs(i[0].y),m=Math.abs(i[0].z);f<=u&&(u=f,r.set(1,0,0)),p<=u&&(u=p,r.set(0,1,0)),m<=u&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let x=1;x<=e;x++){if(s[x]=s[x-1].clone(),o[x]=o[x-1].clone(),a.crossVectors(i[x-1],i[x]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(It(i[x-1].dot(i[x]),-1,1));s[x].applyMatrix4(c.makeRotationAxis(a,v))}o[x].crossVectors(i[x],s[x])}if(t===!0){let x=Math.acos(It(s[0].dot(s[e]),-1,1));x/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(x=-x);for(let v=1;v<=e;v++)s[v].applyMatrix4(c.makeRotationAxis(i[v],x*v)),o[v].crossVectors(i[v],s[v])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Zy extends oo{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,a=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=c}getPoint(e,t=new Se){const r=t,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(o?s=0:s=i),this.aClockwise===!0&&!o&&(s===i?s=-i:s=s-i);const a=this.aStartAngle+e*s;let c=this.aX+this.xRadius*Math.cos(a),u=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const f=Math.cos(this.aRotation),p=Math.sin(this.aRotation),m=c-this.aX,x=u-this.aY;c=m*f-x*p+this.aX,u=m*p+x*f+this.aY}return r.set(c,u)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class tL extends Zy{constructor(e,t,r,i,s,o){super(e,t,r,r,i,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function uM(){let n=0,e=0,t=0,r=0;function i(s,o,a,c){n=s,e=a,t=-3*s+3*o-2*a-c,r=2*s-2*o+a+c}return{initCatmullRom:function(s,o,a,c,u){i(o,a,u*(a-s),u*(c-o))},initNonuniformCatmullRom:function(s,o,a,c,u,f,p){let m=(o-s)/u-(a-s)/(u+f)+(a-o)/f,x=(a-o)/f-(c-o)/(f+p)+(c-a)/p;m*=f,x*=f,i(o,a,m,x)},calc:function(s){const o=s*s,a=o*s;return n+e*s+t*o+r*a}}}const Mx=new G,Vw=new uM,Hw=new uM,Ww=new uM;class nL extends oo{constructor(e=[],t=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=i}getPoint(e,t=new G){const r=t,i=this.points,s=i.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),c=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:c===0&&a===s-1&&(a=s-2,c=1);let u,f;this.closed||a>0?u=i[(a-1)%s]:(Mx.subVectors(i[0],i[1]).add(i[0]),u=Mx);const p=i[a%s],m=i[(a+1)%s];if(this.closed||a+2<s?f=i[(a+2)%s]:(Mx.subVectors(i[s-1],i[s-2]).add(i[s-1]),f=Mx),this.curveType==="centripetal"||this.curveType==="chordal"){const x=this.curveType==="chordal"?.5:.25;let v=Math.pow(u.distanceToSquared(p),x),_=Math.pow(p.distanceToSquared(m),x),y=Math.pow(m.distanceToSquared(f),x);_<1e-4&&(_=1),v<1e-4&&(v=_),y<1e-4&&(y=_),Vw.initNonuniformCatmullRom(u.x,p.x,m.x,f.x,v,_,y),Hw.initNonuniformCatmullRom(u.y,p.y,m.y,f.y,v,_,y),Ww.initNonuniformCatmullRom(u.z,p.z,m.z,f.z,v,_,y)}else this.curveType==="catmullrom"&&(Vw.initCatmullRom(u.x,p.x,m.x,f.x,this.tension),Hw.initCatmullRom(u.y,p.y,m.y,f.y,this.tension),Ww.initCatmullRom(u.z,p.z,m.z,f.z,this.tension));return r.set(Vw.calc(c),Hw.calc(c),Ww.calc(c)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new G().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function oN(n,e,t,r,i){const s=(r-e)*.5,o=(i-t)*.5,a=n*n,c=n*a;return(2*t-2*r+s+o)*c+(-3*t+3*r-2*s-o)*a+s*n+t}function nG(n,e){const t=1-n;return t*t*e}function rG(n,e){return 2*(1-n)*n*e}function iG(n,e){return n*n*e}function dp(n,e,t,r){return nG(n,e)+rG(n,t)+iG(n,r)}function sG(n,e){const t=1-n;return t*t*t*e}function oG(n,e){const t=1-n;return 3*t*t*n*e}function aG(n,e){return 3*(1-n)*n*n*e}function lG(n,e){return n*n*n*e}function hp(n,e,t,r,i){return sG(n,e)+oG(n,t)+aG(n,r)+lG(n,i)}class dM extends oo{constructor(e=new Se,t=new Se,r=new Se,i=new Se){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new Se){const r=t,i=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set(hp(e,i.x,s.x,o.x,a.x),hp(e,i.y,s.y,o.y,a.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class rL extends oo{constructor(e=new G,t=new G,r=new G,i=new G){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new G){const r=t,i=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set(hp(e,i.x,s.x,o.x,a.x),hp(e,i.y,s.y,o.y,a.y),hp(e,i.z,s.z,o.z,a.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class hM extends oo{constructor(e=new Se,t=new Se){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Se){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 13,956 bytes, line 311
311getTangent(e,t=new Se){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class iL extends oo{constructor(e=new G,t=new G){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new G){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new G){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class fM extends oo{constructor(e=new Se,t=new Se,r=new Se){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new Se){const r=t,i=this.v0,s=this.v1,o=this.v2;return r.set(dp(e,i.x,s.x,o.x),dp(e,i.y,s.y,o.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class pM extends oo{constructor(e=new G,t=new G,r=new G){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new G){const r=t,i=this.v0,s=this.v1,o=this.v2;return r.set(dp(e,i.x,s.x,o.x),dp(e,i.y,s.y,o.y),dp(e,i.z,s.z,o.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class mM extends oo{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Se){const r=t,i=this.points,s=(i.length-1)*e,o=Math.floor(s),a=s-o,c=i[o===0?o:o-1],u=i[o],f=i[o>i.length-2?i.length-1:o+1],p=i[o>i.length-3?i.length-1:o+2];return r.set(oN(a,c.x,u.x,f.x,p.x),oN(a,c.y,u.y,f.y,p.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new Se().fromArray(i))}return this}}var kv=Object.freeze({__proto__:null,ArcCurve:tL,CatmullRomCurve3:nL,CubicBezierCurve:dM,CubicBezierCurve3:rL,EllipseCurve:Zy,LineCurve:hM,LineCurve3:iL,QuadraticBezierCurve:fM,QuadraticBezierCurve3:pM,SplineCurve:mM});class sL extends oo{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const r=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new kv[r](t,e))}return this}getPoint(e,t){const r=e*this.getLength(),i=this.getCurveLengths();let s=0;for(;s<i.length;){if(i[s]>=r){const o=i[s]-r,a=this.curves[s],c=a.getLength(),u=c===0?0:1-o/c;return a.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r<i;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let r;for(let i=0,s=this.curves;i<s.length;i++){const o=s[i],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,c=o.getPoints(a);for(let u=0;u<c.length;u++){const f=c[u];r&&r.equals(f)||(t.push(f),r=f)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(new kv[i.type]().fromJSON(i))}return this}}class Lv extends sL{constructor(e){super(),this.type="Path",this.currentPoint=new Se,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const r=new hM(this.currentPoint.clone(),new Se(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,i){const s=new fM(this.currentPoint.clone(),new Se(e,t),new Se(r,i));return this.curves.push(s),this.currentPoint.set(r,i),this}bezierCurveTo(e,t,r,i,s,o){const a=new dM(this.currentPoint.clone(),new Se(e,t),new Se(r,i),new Se(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),r=new mM(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,i,s,o){const a=this.currentPoint.x,c=this.currentPoint.y;return this.absarc(e+a,t+c,r,i,s,o),this}absarc(e,t,r,i,s,o){return this.absellipse(e,t,r,r,i,s,o),this}ellipse(e,t,r,i,s,o,a,c){const u=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+u,t+f,r,i,s,o,a,c),this}absellipse(e,t,r,i,s,o,a,c){const u=new Zy(e,t,r,i,s,o,a,c);if(this.curves.length>0){const p=u.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(u);const f=u.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Yc extends Lv{constructor(e){super(e),this.uuid=os(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,i=this.holes.length;r<i;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(new Lv().fromJSON(i))}return this}}function cG(n,e,t=2){const r=e&&e.length,i=r?e[0]*t:n.length;let s=oL(n,0,i,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,c,u;if(r&&(s=pG(n,e,s,t)),n.length>80*t){a=1/0,c=1/0;let f=-1/0,p=-1/0;for(let m=t;m<i;m+=t){const x=n[m],v=n[m+1];x<a&&(a=x),v<c&&(c=v),x>f&&(f=x),v>p&&(p=v)}u=Math.max(f-a,p-c),u=u!==0?32767/u:0}return Gp(s,o,t,a,c,u,0),o}function oL(n,e,t,r,i){let s;if(i===MG(n,e,t,r)>0)for(let o=e;o<t;o+=r)s=aN(o/r|0,n[o],n[o+1],s);else for(let o=t-r;o>=e;o-=r)s=aN(o/r|0,n[o],n[o+1],s);return s&&_h(s,s.next)&&(Xp(s),s=s.next),s}function cu(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(_h(t,t.next)||Bn(t.prev,t,t.next)===0)){if(Xp(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Gp(n,e,t,r,i,s,o){if(!n)return;!o&&s&&yG(n,r,i,s);let a=n;for(;n.prev!==n.next;){const c=n.prev,u=n.next;if(s?dG(n,r,i,s):uG(n)){e.push(c.i,n.i,u.i),Xp(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=hG(cu(n),e),Gp(n,e,t,r,i,s,2)):o===2&&fG(n,e,t,r,i,s):Gp(cu(n),e,t,r,i,s,1);break}}}function uG(n){const e=n.prev,t=n,r=n.next;if(Bn(e,t,r)>=0)return!1;const i=e.x,s=t.x,o=r.x,a=e.y,c=t.y,u=r.y,f=Math.min(i,s,o),p=Math.min(a,c,u),m=Math.max(i,s,o),x=Math.max(a,c,u);let v=r.next;for(;v!==e;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=x&&zf(i,a,s,c,o,u,v.x,v.y)&&Bn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function dG(n,e,t,r){const i=n.prev,s=n,o=n.next;if(Bn(i,s,o)>=0)return!1;const a=i.x,c=s.x,u=o.x,f=i.y,p=s.y,m=o.y,x=Math.min(a,c,u),v=Math.min(f,p,m),_=Math.max(a,c,u),y=Math.max(f,p,m),g=YS(x,v,e,t,r),b=YS(_,y,e,t,r);let S=n.prevZ,M=n.nextZ;for(;S&&S.z>=g&&M&&M.z<=b;){if(S.x>=x&&S.x<=_&&S.y>=v&&S.y<=y&&S!==i&&S!==o&&zf(a,f,c,p,u,m,S.x,S.y)&&Bn(S.prev,S,S.next)>=0||(S=S.prevZ,M.x>=x&&M.x<=_&&M.y>=v&&M.y<=y&&M!==i&&M!==o&&zf(a,f,c,p,u,m,M.x,M.y)&&Bn(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;S&&S.z>=g;){if(S.x>=x&&S.x<=_&&S.y>=v&&S.y<=y&&S!==i&&S!==o&&zf(a,f,c,p,u,m,S.x,S.y)&&Bn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;M&&M.z<=b;){if(M.x>=x&&M.x<=_&&M.y>=v&&M.y<=y&&M!==i&&M!==o&&zf(a,f,c,p,u,m,M.x,M.y)&&Bn(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function hG(n,e){let t=n;do{const r=t.prev,i=t.next.next;!_h(r,i)&&lL(r,t,t.next,i)&&$p(r,i)&&$p(i,r)&&(e.push(r.i,t.i,i.i),Xp(t),Xp(t.next),t=n=i),t=t.next}while(t!==n);return cu(t)}function fG(n,e,t,r,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&bG(o,a)){let c=cL(o,a);o=cu(o,o.next),c=cu(c,c.next),Gp(o,e,t,r,i,s,0),Gp(c,e,t,r,i,s,0);return}a=a.next}o=o.next}while(o!==n)}function pG(n,e,t,r){const i=[];for(let s=0,o=e.length;s<o;s++){const a=e[s]*r,c=s<o-1?e[s+1]*r:n.length,u=oL(n,a,c,r,!1);u===u.next&&(u.steiner=!0),i.push(wG(u))}i.sort(mG);for(let s=0;s<i.length;s++)t=gG(i[s],t);return t}function mG(n,e){let t=n.x-e.x;if(t===0&&(t=n.y-e.y,t===0)){const r=(n.next.y-n.y)/(n.next.x-n.x),i=(e.next.y-e.y)/(e.next.x-e.x);t=r-i}return t}function gG(n,e){const t=xG(n,e);if(!t)return e;const r=cL(t,n);return cu(r,r.next),cu(t,t.next)}function xG(n,e){let t=e;const r=n.x,i=n.y;let s=-1/0,o;if(_h(n,t))return t;do{if(_h(n,t.next))return t.next;if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const p=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=r&&p>s&&(s=p,o=t.x<t.next.x?t:t.next,p===r))return o}t=t.next}while(t!==e);if(!o)return null;const a=o,c=o.x,u=o.y;let f=1/0;t=o;do{if(r>=t.x&&t.x>=c&&r!==t.x&&aL(i<u?r:s,i,c,u,i<u?s:r,i,t.x,t.y)){const p=Math.abs(i-t.y)/(r-t.x);$p(t,n)&&(p<f||p===f&&(t.x>o.x||t.x===o.x&&vG(o,t)))&&(o=t,f=p)}t=t.next}while(t!==a);return o}function vG(n,e){return Bn(n.prev,n,e.prev)<0&&Bn(e.next,n,n.next)<0}function yG(n,e,t,r){let i=n;do i.z===0&&(i.z=YS(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,_G(i)}function _G(n){let e,t=1;do{let r=n,i;n=null;let s=null;for(e=0;r;){e++;let o=r,a=0;for(let u=0;u<t&&(a++,o=o.nextZ,!!o);u++);let c=t;for(;a>0||c>0&&o;)a!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,a--):(i=o,o=o.nextZ,c--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;r=o}s.nextZ=null,t*=2}while(e>1);return n}function YS(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function wG(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function aL(n,e,t,r,i,s,o,a){return(i-o)*(e-a)>=(n-o)*(s-a)&&(n-o)*(r-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(i-o)*(r-a)}function zf(n,e,t,r,i,s,o,a){return!(n===o&&e===a)&&aL(n,e,t,r,i,s,o,a)}function bG(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!SG(n,e)&&($p(n,e)&&$p(e,n)&&EG(n,e)&&(Bn(n.prev,n,e.prev)||Bn(n,e.prev,e))||_h(n,e)&&Bn(n.prev,n,n.next)>0&&Bn(e.prev,e,e.next)>0)}function Bn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function _h(n,e){return n.x===e.x&&n.y===e.y}function lL(n,e,t,r){const i=Tx(Bn(n,e,t)),s=Tx(Bn(n,e,r)),o=Tx(Bn(t,r,n)),a=Tx(Bn(t,r,e));return!!(i!==s&&o!==a||i===0&&Ax(n,t,e)||s===0&&Ax(n,r,e)||o===0&&Ax(t,n,r)||a===0&&Ax(t,e,r))}function Ax(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Tx(n){return n>0?1:n<0?-1:0}function SG(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&lL(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function $p(n,e){return Bn(n.prev,n,n.next)<0?Bn(n,e,n.next)>=0&&Bn(n,n.prev,e)>=0:Bn(n,e,n.prev)<0||Bn(n,n.next,e)<0}function EG(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function cL(n,e){const t=KS(n.i,n.x,n.y),r=KS(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function aN(n,e,t,r){const i=KS(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Xp(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function KS(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function MG(n,e,t,r){let i=0;for(let s=e,o=t-r;s<t;s+=r)i+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return i}class AG{static triangulate(e,t,r=2){return cG(e,t,r)}}class Js{static area(e){const t=e.length;let r=0;for(let i=t-1,s=0;s<t;i=s++)r+=e[i].x*e[s].y-e[s].x*e[i].y;return r*.5}static isClockWise(e){return Js.area(e)<0}
vendor: 58,470 bytes, line 311
311static triangulateShape(e,t){const r=[],i=[],s=[];lN(e),cN(r,e);let o=e.length;t.forEach(lN);for(let c=0;c<t.length;c++)i.push(o),o+=t[c].length,cN(r,t[c]);const a=AG.triangulate(r,i);for(let c=0;c<a.length;c+=3)s.push(a.slice(c,c+3));return s}}function lN(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function cN(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Qy extends zt{constructor(e=new Yc([new Se(.5,.5),new Se(-.5,.5),new Se(-.5,-.5),new Se(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const r=this,i=[],s=[];for(let a=0,c=e.length;a<c;a++){const u=e[a];o(u)}this.setAttribute("position",new ht(i,3)),this.setAttribute("uv",new ht(s,2)),this.computeVertexNormals();function o(a){const c=[],u=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1,p=t.depth!==void 0?t.depth:1;let m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,x=t.bevelThickness!==void 0?t.bevelThickness:.2,v=t.bevelSize!==void 0?t.bevelSize:x-.1,_=t.bevelOffset!==void 0?t.bevelOffset:0,y=t.bevelSegments!==void 0?t.bevelSegments:3;const g=t.extrudePath,b=t.UVGenerator!==void 0?t.UVGenerator:TG;let S,M=!1,A,R,F,L;g&&(S=g.getSpacedPoints(f),M=!0,m=!1,A=g.computeFrenetFrames(f,!1),R=new G,F=new G,L=new G),m||(y=0,x=0,v=0,_=0);const N=a.extractPoints(u);let I=N.shape;const D=N.holes;if(!Js.isClockWise(I)){I=I.reverse();for(let H=0,Fe=D.length;H<Fe;H++){const Ae=D[H];Js.isClockWise(Ae)&&(D[H]=Ae.reverse())}}function U(H){const Ae=10000000000000001e-36;let Te=H[0];for(let be=1;be<=H.length;be++){const Ke=be%H.length,Ne=H[Ke],W=Ne.x-Te.x,P=Ne.y-Te.y,B=W*W+P*P,q=Math.max(Math.abs(Ne.x),Math.abs(Ne.y),Math.abs(Te.x),Math.abs(Te.y)),se=Ae*q*q;if(B<=se){H.splice(Ke,1),be--;continue}Te=Ne}}U(I),D.forEach(U);const V=D.length,Z=I;for(let H=0;H<V;H++){const Fe=D[H];I=I.concat(Fe)}function Y(H,Fe,Ae){return Fe||console.error("THREE.ExtrudeGeometry: vec does not exist"),H.clone().addScaledVector(Fe,Ae)}const ne=I.length;function j(H,Fe,Ae){let Te,be,Ke;const Ne=H.x-Fe.x,W=H.y-Fe.y,P=Ae.x-H.x,B=Ae.y-H.y,q=Ne*Ne+W*W,se=Ne*B-W*P;if(Math.abs(se)>Number.EPSILON){const J=Math.sqrt(q),ue=Math.sqrt(P*P+B*B),me=Fe.x-W/J,Oe=Fe.y+Ne/J,Ze=Ae.x-B/ue,Me=Ae.y+P/ue,Je=((Ze-me)*B-(Me-Oe)*P)/(Ne*B-W*P);Te=me+Ne*Je-H.x,be=Oe+W*Je-H.y;const gt=Te*Te+be*be;if(gt<=2)return new Se(Te,be);Ke=Math.sqrt(gt/2)}else{let J=!1;Ne>Number.EPSILON?P>Number.EPSILON&&(J=!0):Ne<-Number.EPSILON?P<-Number.EPSILON&&(J=!0):Math.sign(W)===Math.sign(B)&&(J=!0),J?(Te=-W,be=Ne,Ke=Math.sqrt(q)):(Te=Ne,be=W,Ke=Math.sqrt(q/2))}return new Se(Te/Ke,be/Ke)}const $=[];for(let H=0,Fe=Z.length,Ae=Fe-1,Te=H+1;H<Fe;H++,Ae++,Te++)Ae===Fe&&(Ae=0),Te===Fe&&(Te=0),$[H]=j(Z[H],Z[Ae],Z[Te]);const K=[];let re,xe=$.concat();for(let H=0,Fe=V;H<Fe;H++){const Ae=D[H];re=[];for(let Te=0,be=Ae.length,Ke=be-1,Ne=Te+1;Te<be;Te++,Ke++,Ne++)Ke===be&&(Ke=0),Ne===be&&(Ne=0),re[Te]=j(Ae[Te],Ae[Ke],Ae[Ne]);K.push(re),xe=xe.concat(re)}let Ce;if(y===0)Ce=Js.triangulateShape(Z,D);else{const H=[],Fe=[];for(let Ae=0;Ae<y;Ae++){const Te=Ae/y,be=x*Math.cos(Te*Math.PI/2),Ke=v*Math.sin(Te*Math.PI/2)+_;for(let Ne=0,W=Z.length;Ne<W;Ne++){const P=Y(Z[Ne],$[Ne],Ke);nt(P.x,P.y,-be),Te===0&&H.push(P)}for(let Ne=0,W=V;Ne<W;Ne++){const P=D[Ne];re=K[Ne];const B=[];for(let q=0,se=P.length;q<se;q++){const J=Y(P[q],re[q],Ke);nt(J.x,J.y,-be),Te===0&&B.push(J)}Te===0&&Fe.push(B)}}Ce=Js.triangulateShape(H,Fe)}const ce=Ce.length,_e=v+_;for(let H=0;H<ne;H++){const Fe=m?Y(I[H],xe[H],_e):I[H];M?(F.copy(A.normals[0]).multiplyScalar(Fe.x),R.copy(A.binormals[0]).multiplyScalar(Fe.y),L.copy(S[0]).add(F).add(R),nt(L.x,L.y,L.z)):nt(Fe.x,Fe.y,0)}for(let H=1;H<=f;H++)for(let Fe=0;Fe<ne;Fe++){const Ae=m?Y(I[Fe],xe[Fe],_e):I[Fe];M?(F.copy(A.normals[H]).multiplyScalar(Ae.x),R.copy(A.binormals[H]).multiplyScalar(Ae.y),L.copy(S[H]).add(F).add(R),nt(L.x,L.y,L.z)):nt(Ae.x,Ae.y,p/f*H)}for(let H=y-1;H>=0;H--){const Fe=H/y,Ae=x*Math.cos(Fe*Math.PI/2),Te=v*Math.sin(Fe*Math.PI/2)+_;for(let be=0,Ke=Z.length;be<Ke;be++){const Ne=Y(Z[be],$[be],Te);nt(Ne.x,Ne.y,p+Ae)}for(let be=0,Ke=D.length;be<Ke;be++){const Ne=D[be];re=K[be];for(let W=0,P=Ne.length;W<P;W++){const B=Y(Ne[W],re[W],Te);M?nt(B.x,B.y+S[f-1].y,S[f-1].x+Ae):nt(B.x,B.y,p+Ae)}}}Re(),pe();function Re(){const H=i.length/3;if(m){let Fe=0,Ae=ne*Fe;for(let Te=0;Te<ce;Te++){const be=Ce[Te];Pe(be[2]+Ae,be[1]+Ae,be[0]+Ae)}Fe=f+y*2,Ae=ne*Fe;for(let Te=0;Te<ce;Te++){const be=Ce[Te];Pe(be[0]+Ae,be[1]+Ae,be[2]+Ae)}}else{for(let Fe=0;Fe<ce;Fe++){const Ae=Ce[Fe];Pe(Ae[2],Ae[1],Ae[0])}for(let Fe=0;Fe<ce;Fe++){const Ae=Ce[Fe];Pe(Ae[0]+ne*f,Ae[1]+ne*f,Ae[2]+ne*f)}}r.addGroup(H,i.length/3-H,0)}function pe(){const H=i.length/3;let Fe=0;je(Z,Fe),Fe+=Z.length;for(let Ae=0,Te=D.length;Ae<Te;Ae++){const be=D[Ae];je(be,Fe),Fe+=be.length}r.addGroup(H,i.length/3-H,1)}function je(H,Fe){let Ae=H.length;for(;--Ae>=0;){const Te=Ae;let be=Ae-1;be<0&&(be=H.length-1);for(let Ke=0,Ne=f+y*2;Ke<Ne;Ke++){const W=ne*Ke,P=ne*(Ke+1),B=Fe+Te+W,q=Fe+be+W,se=Fe+be+P,J=Fe+Te+P;Ie(B,q,se,J)}}}function nt(H,Fe,Ae){c.push(H),c.push(Fe),c.push(Ae)}function Pe(H,Fe,Ae){He(H),He(Fe),He(Ae);const Te=i.length/3,be=b.generateTopUV(r,i,Te-3,Te-2,Te-1);ze(be[0]),ze(be[1]),ze(be[2])}function Ie(H,Fe,Ae,Te){He(H),He(Fe),He(Te),He(Fe),He(Ae),He(Te);const be=i.length/3,Ke=b.generateSideWallUV(r,i,be-6,be-3,be-2,be-1);ze(Ke[0]),ze(Ke[1]),ze(Ke[3]),ze(Ke[1]),ze(Ke[2]),ze(Ke[3])}function He(H){i.push(c[H*3+0]),i.push(c[H*3+1]),i.push(c[H*3+2])}function ze(H){s.push(H.x),s.push(H.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,r=this.parameters.options;return CG(t,r,e)}static fromJSON(e,t){const r=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];r.push(a)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new kv[i.type]().fromJSON(i)),new Qy(r,e.options)}}const TG={generateTopUV:function(n,e,t,r,i){const s=e[t*3],o=e[t*3+1],a=e[r*3],c=e[r*3+1],u=e[i*3],f=e[i*3+1];return[new Se(s,o),new Se(a,c),new Se(u,f)]},generateSideWallUV:function(n,e,t,r,i,s){const o=e[t*3],a=e[t*3+1],c=e[t*3+2],u=e[r*3],f=e[r*3+1],p=e[r*3+2],m=e[i*3],x=e[i*3+1],v=e[i*3+2],_=e[s*3],y=e[s*3+1],g=e[s*3+2];return Math.abs(a-f)<Math.abs(o-u)?[new Se(o,1-c),new Se(u,1-p),new Se(m,1-v),new Se(_,1-g)]:[new Se(a,1-c),new Se(f,1-p),new Se(x,1-v),new Se(y,1-g)]}};function CG(n,e,t){if(t.shapes=[],Array.isArray(n))for(let r=0,i=n.length;r<i;r++){const s=n[r];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Jy extends ql{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,i=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(i,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Jy(e.radius,e.detail)}}class e1 extends zt{constructor(e=[new Se(0,-.5),new Se(.5,0),new Se(0,.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=It(i,0,Math.PI*2);const s=[],o=[],a=[],c=[],u=[],f=1/t,p=new G,m=new Se,x=new G,v=new G,_=new G;let y=0,g=0;for(let b=0;b<=e.length-1;b++)switch(b){case 0:y=e[b+1].x-e[b].x,g=e[b+1].y-e[b].y,x.x=g*1,x.y=-y,x.z=g*0,_.copy(x),x.normalize(),c.push(x.x,x.y,x.z);break;case e.length-1:c.push(_.x,_.y,_.z);break;default:y=e[b+1].x-e[b].x,g=e[b+1].y-e[b].y,x.x=g*1,x.y=-y,x.z=g*0,v.copy(x),x.x+=_.x,x.y+=_.y,x.z+=_.z,x.normalize(),c.push(x.x,x.y,x.z),_.copy(v)}for(let b=0;b<=t;b++){const S=r+b*f*i,M=Math.sin(S),A=Math.cos(S);for(let R=0;R<=e.length-1;R++){p.x=e[R].x*M,p.y=e[R].y,p.z=e[R].x*A,o.push(p.x,p.y,p.z),m.x=b/t,m.y=R/(e.length-1),a.push(m.x,m.y);const F=c[3*R+0]*M,L=c[3*R+1],N=c[3*R+0]*A;u.push(F,L,N)}}for(let b=0;b<t;b++)for(let S=0;S<e.length-1;S++){const M=S+b*e.length,A=M,R=M+e.length,F=M+e.length+1,L=M+1;s.push(A,R,L),s.push(F,L,R)}this.setIndex(s),this.setAttribute("position",new ht(o,3)),this.setAttribute("uv",new ht(a,2)),this.setAttribute("normal",new ht(u,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new e1(e.points,e.segments,e.phiStart,e.phiLength)}}class vm extends ql{constructor(e=1,t=0){const r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(r,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new vm(e.radius,e.detail)}}class Oh extends zt{constructor(e=1,t=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};const s=e/2,o=t/2,a=Math.floor(r),c=Math.floor(i),u=a+1,f=c+1,p=e/a,m=t/c,x=[],v=[],_=[],y=[];for(let g=0;g<f;g++){const b=g*m-o;for(let S=0;S<u;S++){const M=S*p-s;v.push(M,-b,0),_.push(0,0,1),y.push(S/a),y.push(1-g/c)}}for(let g=0;g<c;g++)for(let b=0;b<a;b++){const S=b+u*g,M=b+u*(g+1),A=b+1+u*(g+1),R=b+1+u*g;x.push(S,M,R),x.push(M,A,R)}this.setIndex(x),this.setAttribute("position",new ht(v,3)),this.setAttribute("normal",new ht(_,3)),this.setAttribute("uv",new ht(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Oh(e.width,e.height,e.widthSegments,e.heightSegments)}}class t1 extends zt{constructor(e=.5,t=1,r=32,i=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:i,thetaStart:s,thetaLength:o},r=Math.max(3,r),i=Math.max(1,i);const a=[],c=[],u=[],f=[];let p=e;const m=(t-e)/i,x=new G,v=new Se;for(let _=0;_<=i;_++){for(let y=0;y<=r;y++){const g=s+y/r*o;x.x=p*Math.cos(g),x.y=p*Math.sin(g),c.push(x.x,x.y,x.z),u.push(0,0,1),v.x=(x.x/t+1)/2,v.y=(x.y/t+1)/2,f.push(v.x,v.y)}p+=m}for(let _=0;_<i;_++){const y=_*(r+1);for(let g=0;g<r;g++){const b=g+y,S=b,M=b+r+1,A=b+r+2,R=b+1;a.push(S,M,R),a.push(M,A,R)}}this.setIndex(a),this.setAttribute("position",new ht(c,3)),this.setAttribute("normal",new ht(u,3)),this.setAttribute("uv",new ht(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new t1(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class n1 extends zt{constructor(e=new Yc([new Se(0,.5),new Se(-.5,-.5),new Se(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const r=[],i=[],s=[],o=[];let a=0,c=0;if(Array.isArray(e)===!1)u(e);else for(let f=0;f<e.length;f++)u(e[f]),this.addGroup(a,c,f),a+=c,c=0;this.setIndex(r),this.setAttribute("position",new ht(i,3)),this.setAttribute("normal",new ht(s,3)),this.setAttribute("uv",new ht(o,2));function u(f){const p=i.length/3,m=f.extractPoints(t);let x=m.shape;const v=m.holes;Js.isClockWise(x)===!1&&(x=x.reverse());for(let y=0,g=v.length;y<g;y++){const b=v[y];Js.isClockWise(b)===!0&&(v[y]=b.reverse())}const _=Js.triangulateShape(x,v);for(let y=0,g=v.length;y<g;y++){const b=v[y];x=x.concat(b)}for(let y=0,g=x.length;y<g;y++){const b=x[y];i.push(b.x,b.y,0),s.push(0,0,1),o.push(b.x,b.y)}for(let y=0,g=_.length;y<g;y++){const b=_[y],S=b[0]+p,M=b[1]+p,A=b[2]+p;r.push(S,M,A),c+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return NG(t,e)}static fromJSON(e,t){const r=[];for(let i=0,s=e.shapes.length;i<s;i++){const o=t[e.shapes[i]];r.push(o)}return new n1(r,e.curveSegments)}}function NG(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const i=n[t];e.shapes.push(i.uuid)}else e.shapes.push(n.uuid);return e}class ym extends zt{constructor(e=1,t=32,r=16,i=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:i,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));const c=Math.min(o+a,Math.PI);let u=0;const f=[],p=new G,m=new G,x=[],v=[],_=[],y=[];for(let g=0;g<=r;g++){const b=[],S=g/r;let M=0;g===0&&o===0?M=.5/t:g===r&&c===Math.PI&&(M=-.5/t);for(let A=0;A<=t;A++){const R=A/t;p.x=-e*Math.cos(i+R*s)*Math.sin(o+S*a),p.y=e*Math.cos(o+S*a),p.z=e*Math.sin(i+R*s)*Math.sin(o+S*a),v.push(p.x,p.y,p.z),m.copy(p).normalize(),_.push(m.x,m.y,m.z),y.push(R+M,1-S),b.push(u++)}f.push(b)}for(let g=0;g<r;g++)for(let b=0;b<t;b++){const S=f[g][b+1],M=f[g][b],A=f[g+1][b],R=f[g+1][b+1];(g!==0||o>0)&&x.push(S,M,R),(g!==r-1||c<Math.PI)&&x.push(M,A,R)}this.setIndex(x),this.setAttribute("position",new ht(v,3)),this.setAttribute("normal",new ht(_,3)),this.setAttribute("uv",new ht(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ym(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class r1 extends ql{constructor(e=1,t=0){const r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(r,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new r1(e.radius,e.detail)}}class i1 extends zt{constructor(e=1,t=.4,r=12,i=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:i,arc:s},r=Math.floor(r),i=Math.floor(i);const o=[],a=[],c=[],u=[],f=new G,p=new G,m=new G;for(let x=0;x<=r;x++)for(let v=0;v<=i;v++){const _=v/i*s,y=x/r*Math.PI*2;p.x=(e+t*Math.cos(y))*Math.cos(_),p.y=(e+t*Math.cos(y))*Math.sin(_),p.z=t*Math.sin(y),a.push(p.x,p.y,p.z),f.x=e*Math.cos(_),f.y=e*Math.sin(_),m.subVectors(p,f).normalize(),c.push(m.x,m.y,m.z),u.push(v/i),u.push(x/r)}for(let x=1;x<=r;x++)for(let v=1;v<=i;v++){const _=(i+1)*x+v-1,y=(i+1)*(x-1)+v-1,g=(i+1)*(x-1)+v,b=(i+1)*x+v;o.push(_,y,b),o.push(y,g,b)}this.setIndex(o),this.setAttribute("position",new ht(a,3)),this.setAttribute("normal",new ht(c,3)),this.setAttribute("uv",new ht(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new i1(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class s1 extends zt{constructor(e=1,t=.4,r=64,i=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:i,p:s,q:o},r=Math.floor(r),i=Math.floor(i);const a=[],c=[],u=[],f=[],p=new G,m=new G,x=new G,v=new G,_=new G,y=new G,g=new G;for(let S=0;S<=r;++S){const M=S/r*s*Math.PI*2;b(M,s,o,e,x),b(M+.01,s,o,e,v),y.subVectors(v,x),g.addVectors(v,x),_.crossVectors(y,g),g.crossVectors(_,y),_.normalize(),g.normalize();for(let A=0;A<=i;++A){const R=A/i*Math.PI*2,F=-t*Math.cos(R),L=t*Math.sin(R);p.x=x.x+(F*g.x+L*_.x),p.y=x.y+(F*g.y+L*_.y),p.z=x.z+(F*g.z+L*_.z),c.push(p.x,p.y,p.z),m.subVectors(p,x).normalize(),u.push(m.x,m.y,m.z),f.push(S/r),f.push(A/i)}}for(let S=1;S<=r;S++)for(let M=1;M<=i;M++){const A=(i+1)*(S-1)+(M-1),R=(i+1)*S+(M-1),F=(i+1)*S+M,L=(i+1)*(S-1)+M;a.push(A,R,L),a.push(R,F,L)}this.setIndex(a),this.setAttribute("position",new ht(c,3)),this.setAttribute("normal",new ht(u,3)),this.setAttribute("uv",new ht(f,2));function b(S,M,A,R,F){const L=Math.cos(S),N=Math.sin(S),I=A/M*S,D=Math.cos(I);F.x=R*(2+D)*.5*L,F.y=R*(2+D)*N*.5,F.z=R*Math.sin(I)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new s1(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class o1 extends zt{constructor(e=new pM(new G(-1,-1,0),new G(-1,1,0),new G(1,1,0)),t=64,r=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:i,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new G,c=new G,u=new Se;let f=new G;const p=[],m=[],x=[],v=[];_(),this.setIndex(v),this.setAttribute("position",new ht(p,3)),this.setAttribute("normal",new ht(m,3)),this.setAttribute("uv",new ht(x,2));function _(){for(let S=0;S<t;S++)y(S);y(s===!1?t:0),b(),g()}function y(S){f=e.getPointAt(S/t,f);const M=o.normals[S],A=o.binormals[S];for(let R=0;R<=i;R++){const F=R/i*Math.PI*2,L=Math.sin(F),N=-Math.cos(F);c.x=N*M.x+L*A.x,c.y=N*M.y+L*A.y,c.z=N*M.z+L*A.z,c.normalize(),m.push(c.x,c.y,c.z),a.x=f.x+r*c.x,a.y=f.y+r*c.y,a.z=f.z+r*c.z,p.push(a.x,a.y,a.z)}}function g(){for(let S=1;S<=t;S++)for(let M=1;M<=i;M++){const A=(i+1)*(S-1)+(M-1),R=(i+1)*S+(M-1),F=(i+1)*S+M,L=(i+1)*(S-1)+M;v.push(A,R,L),v.push(R,F,L)}}function b(){for(let S=0;S<=t;S++)for(let M=0;M<=i;M++)u.x=S/t,u.y=M/i,x.push(u.x,u.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new o1(new kv[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class uL extends zt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],r=new Set,i=new G,s=new G;if(e.index!==null){const o=e.attributes.position,a=e.index;let c=e.groups;c.length===0&&(c=[{start:0,count:a.count,materialIndex:0}]);for(let u=0,f=c.length;u<f;++u){const p=c[u],m=p.start,x=p.count;for(let v=m,_=m+x;v<_;v+=3)for(let y=0;y<3;y++){const g=a.getX(v+y),b=a.getX(v+(y+1)%3);i.fromBufferAttribute(o,g),s.fromBufferAttribute(o,b),uN(i,s,r)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,c=o.count/3;a<c;a++)for(let u=0;u<3;u++){const f=3*a+u,p=3*a+(u+1)%3;i.fromBufferAttribute(o,f),s.fromBufferAttribute(o,p),uN(i,s,r)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new ht(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function uN(n,e,t){const r=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(r)===!0||t.has(i)===!0?!1:(t.add(r),t.add(i),!0)}var dN=Object.freeze({__proto__:null,BoxGeometry:yu,CapsuleGeometry:qy,CircleGeometry:Yy,ConeGeometry:xm,CylinderGeometry:gm,DodecahedronGeometry:Ky,EdgesGeometry:eL,ExtrudeGeometry:Qy,IcosahedronGeometry:Jy,LatheGeometry:e1,OctahedronGeometry:vm,PlaneGeometry:Oh,PolyhedronGeometry:ql,RingGeometry:t1,ShapeGeometry:n1,SphereGeometry:ym,TetrahedronGeometry:r1,TorusGeometry:i1,TorusKnotGeometry:s1,TubeGeometry:o1,WireframeGeometry:uL});class dL extends ri{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new at(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class hL extends so{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class gM extends ri{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new at(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new at(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$l,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ls,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,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 fL extends gM{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Se(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return It(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new at(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new at(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new at(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=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 pL extends ri{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new at(16777215),this.specular=new at(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new at(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$l,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ls,this.combine=dm,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 mL extends ri{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new at(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new at(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$l,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class gL extends ri{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$l,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class xL extends ri{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new at(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new at(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$l,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ls,this.combine=dm,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 xM extends ri{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Tk,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 vM extends ri{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}}class vL extends ri{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new at(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$l,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class yL extends yi{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Dc(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function _L(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function wL(n){function e(i,s){return n[i]-n[s]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function ZS(n,e,t){const r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){const a=t[s]*e;for(let c=0;c!==e;++c)i[o++]=n[a+c]}return i}function yM(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push(...o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)}function RG(n,e,t,r,i=30){const s=n.clone();s.name=e;const o=[];for(let c=0;c<s.tracks.length;++c){const u=s.tracks[c],f=u.getValueSize(),p=[],m=[];for(let x=0;x<u.times.length;++x){const v=u.times[x]*i;if(!(v<t||v>=r)){p.push(u.times[x]);for(let _=0;_<f;++_)m.push(u.values[x*f+_])}}p.length!==0&&(u.times=Dc(p,u.times.constructor),u.values=Dc(m,u.values.constructor),o.push(u))}s.tracks=o;let a=1/0;for(let c=0;c<s.tracks.length;++c)a>s.tracks[c].times[0]&&(a=s.tracks[c].times[0]);for(let c=0;c<s.tracks.length;++c)s.tracks[c].shift(-1*a);return s.resetDuration(),s}function PG(n,e=0,t=n,r=30){r<=0&&(r=30);const i=t.tracks.length,s=e/r;for(let o=0;o<i;++o){const a=t.tracks[o],c=a.ValueTypeName;if(c==="bool"||c==="string")continue;const u=n.tracks.find(function(g){return g.name===a.name&&g.ValueTypeName===c});if(u===void 0)continue;let f=0;const p=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=p/3);let m=0;const x=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=x/3);const v=a.times.length-1;let _;if(s<=a.times[0]){const g=f,b=p-f;_=a.values.slice(g,b)}else if(s>=a.times[v]){const g=v*p+f,b=g+p-f;_=a.values.slice(g,b)}else{const g=a.createInterpolant(),b=f,S=p-f;g.evaluate(s),_=g.resultBuffer.slice(b,S)}c==="quaternion"&&new Qr().fromArray(_).normalize().conjugate().toArray(_);const y=u.times.length;for(let g=0;g<y;++g){const b=g*x+m;if(c==="quaternion")Qr.multiplyQuaternionsFlat(u.values,b,_,0,u.values,b);else{const S=x-m*2;for(let M=0;M<S;++M)u.values[b+M]-=_[M]}}}return n.blendMode=eM,n}class IG{static convertArray(e,t){return Dc(e,t)}static isTypedArray(e){return _L(e)}static getKeyframeOrder(e){return wL(e)}static sortedArray(e,t,r){return ZS(e,t,r)}static flattenJSON(e,t,r,i){yM(e,t,r,i)}static subclip(e,t,r,i,s=30){return RG(e,t,r,i,s)}static makeClipAdditive(e,t=0,r=e,i=30){return PG(e,t,r,i)}}class _m{constructor(e,t,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,i=t[r],s=t[r-1];e:{t:{let o;n:{r:if(!(e<i)){for(let a=r+2;;){if(i===void 0){if(e<s)break r;return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===a)break;if(s=i,i=t[++r],e<i)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(r=2,s=a);for(let c=r-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===c)break;if(i=s,s=t[--r-1],e>=s)break t}o=r,r=0;break n}break e}for(;r<o;){const a=r+o>>>1;e<t[a]?o=a:r=a+1}if(i=t[r],s=t[r-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,s,i)}return this.interpolate_(r,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=r[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class bL extends _m{constructor(e,t,r,i){super(e,t,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Ic,endingEnd:Ic}}intervalChanged_(e,t,r){const i=this.parameterPositions;let s=e-2,o=e+1,a=i[s],c=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case Fc:s=e,a=2*t-r;break;case Bp:s=i.length-2,a=t+i[s]-i[s+1];break;default:s=e,a=r}if(c===void 0)switch(this.getSettings_().endingEnd){case Fc:o=e,c=2*r-t;break;case Bp:o=1,c=r+i[1]-i[0];break;default:o=e-1,c=t}const u=(r-t)*.5,f=this.valueSize;this._weightPrev=u/(t-a),this._weightNext=u/(c-r),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,u=c-a,f=this._offsetPrev,p=this._offsetNext,m=this._weightPrev,x=this._weightNext,v=(r-t)/(i-t),_=v*v,y=_*v,g=-m*y+2*m*_-m*v,b=(1+m)*y+(-1.5-2*m)*_+(-.5+m)*v+1,S=(-1-x)*y+(1.5+x)*_+.5*v,M=x*y-x*_;for(let A=0;A!==a;++A)s[A]=g*o[f+A]+b*o[u+A]+S*o[c+A]+M*o[p+A];return s}}class _M extends _m{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,u=c-a,f=(r-t)/(i-t),p=1-f;for(let m=0;m!==a;++m)s[m]=o[u+m]*p+o[c+m]*f;return s}}class SL extends _m{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class ks{constructor(e,t,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Dc(t,this.TimeBufferType),this.values=Dc(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:Dc(e.times,Array),values:Dc(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new SL(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new _M(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new bL(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Up:t=this.InterpolantFactoryMethodDiscrete;break;case Iv:t=this.InterpolantFactoryMethodLinear;break;case l0:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Up;case this.InterpolantFactoryMethodLinear:return Iv;case this.InterpolantFactoryMethodSmooth:return l0}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]*=e}return this}trim(e,t){const r=this.times,i=r.length;let s=0,o=i-1;for(;s!==i&&r[s]<e;)++s;for(;o!==-1&&r[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=r.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const c=r[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(i!==void 0&&_L(i))for(let a=0,c=i.length;a!==c;++a){const u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===l0,s=e.length-1;let o=1;for(let a=1;a<s;++a){let c=!1;const u=e[a],f=e[a+1];if(u!==f&&(a!==1||u!==e[0]))if(i)c=!0;else{const p=a*r,m=p-r,x=p+r;for(let v=0;v!==r;++v){const _=t[p+v];if(_!==t[m+v]||_!==t[x+v]){c=!0;break}}}if(c){if(a!==o){e[o]=e[a];const p=a*r,m=o*r;for(let x=0;x!==r;++x)t[m+x]=t[p+x]}++o}}if(s>0){e[o]=e[s];for(let a=s*r,c=o*r,u=0;u!==r;++u)t[c+u]=t[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}ks.prototype.ValueTypeName="";ks.prototype.TimeBufferType=Float32Array;ks.prototype.ValueBufferType=Float32Array;ks.prototype.DefaultInterpolation=Iv;class _u extends ks{constructor(e,t,r){super(e,t,r)}}_u.prototype.ValueTypeName="bool";_u.prototype.ValueBufferType=Array;_u.prototype.DefaultInterpolation=Up;_u.prototype.InterpolantFactoryMethodLinear=void 0;_u.prototype.InterpolantFactoryMethodSmooth=void 0;class wM extends ks{constructor(e,t,r,i){super(e,t,r,i)}}wM.prototype.ValueTypeName="color";class qp extends ks{constructor(e,t,r,i){super(e,t,r,i)}}qp.prototype.ValueTypeName="number";class EL extends _m{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(r-t)/(i-t);let u=e*a;for(let f=u+a;u!==f;u+=4)Qr.slerpFlat(s,0,o,u-a,o,u,c);return s}}class wm extends ks{constructor(e,t,r,i){super(e,t,r,i)}InterpolantFactoryMethodLinear(e){return new EL(this.times,this.values,this.getValueSize(),e)}}wm.prototype.ValueTypeName="quaternion";wm.prototype.InterpolantFactoryMethodSmooth=void 0;class wu extends ks{constructor(e,t,r){super(e,t,r)}}wu.prototype.ValueTypeName="string";wu.prototype.ValueBufferType=Array;wu.prototype.DefaultInterpolation=Up;wu.prototype.InterpolantFactoryMethodLinear=void 0;wu.prototype.InterpolantFactoryMethodSmooth=void 0;class Yp extends ks{constructor(e,t,r,i){super(e,t,r,i)}}Yp.prototype.ValueTypeName="vector";class Kp{constructor(e="",t=-1,r=[],i=Oy){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=os(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(DG(r[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(ks.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const s=t.length,o=[];for(let a=0;a<s;a++){let c=[],u=[];c.push((a+s-1)%s,a,(a+1)%s),u.push(0,1,0);const f=wL(c);c=ZS(c,1,f),u=ZS(u,1,f),!i&&c[0]===0&&(c.push(s),u.push(u[0])),o.push(new qp(".morphTargetInfluences["+t[a].name+"]",c,u).scale(1/r))}return new this(e,-1,o)}static findByName(e,t){let r=e;if(!Array.isArray(e)){const i=e;r=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<r.length;i++)if(r[i].name===t)return r[i];return null}static CreateClipsFromMorphTargetSequences(e,t,r){const i={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,c=e.length;a<c;a++){const u=e[a],f=u.name.match(s);if(f&&f.length>1){const p=f[1];let m=i[p];m||(i[p]=m=[]),m.push(u)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,r));return o}static parseAnimation(e,t){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(p,m,x,v,_){if(x.length!==0){const y=[],g=[];yM(x,y,g,v),y.length!==0&&_.push(new p(m,y,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const u=e.hierarchy||[];for(let p=0;p<u.length;p++){const m=u[p].keys;if(!(!m||m.length===0))if(m[0].morphTargets){const x={};let v;for(v=0;v<m.length;v++)if(m[v].morphTargets)for(let _=0;_<m[v].morphTargets.length;_++)x[m[v].morphTargets[_]]=-1;for(const _ in x){const y=[],g=[];for(let b=0;b!==m[v].morphTargets.length;++b){const S=m[v];y.push(S.time),g.push(S.morphTarget===_?1:0)}i.push(new qp(".morphTargetInfluence["+_+"]",y,g))}c=x.length*o}else{const x=".bones["+t[p].name+"]";r(Yp,x+".position",m,"pos",i),r(wm,x+".quaternion",m,"rot",i),r(Yp,x+".scale",m,"scl",i)}}return i.length===0?null:new this(s,c,i,a)}resetDuration(){const e=this.tracks;let t=0;for(let r=0,i=e.length;r!==i;++r){const s=this.tracks[r];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function FG(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return qp;case"vector":case"vector2":case"vector3":case"vector4":return Yp;case"color":return wM;case"quaternion":return wm;case"bool":case"boolean":return _u;case"string":return wu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function DG(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=FG(n.type);if(n.times===void 0){const t=[],r=[];yM(n.keys,t,r,"value"),n.times=t,n.values=r}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const pa={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class bM{constructor(e,t,r){const i=this;let s=!1,o=0,a=0,c;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(f){a++,s===!1&&i.onStart!==void 0&&i.onStart(f,o,a),s=!0},this.itemEnd=function(f){o++,i.onProgress!==void 0&&i.onProgress(f,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(f){i.onError!==void 0&&i.onError(f)},this.resolveURL=function(f){return c?c(f):f},this.setURLModifier=function(f){return c=f,this},this.addHandler=function(f,p){return u.push(f,p),this},this.removeHandler=function(f){const p=u.indexOf(f);return p!==-1&&u.splice(p,2),this},this.getHandler=function(f){for(let p=0,m=u.length;p<m;p+=2){const x=u[p],v=u[p+1];if(x.global&&(x.lastIndex=0),x.test(f))return v}return null}}}const ML=new bM;class Vi{constructor(e){this.manager=e!==void 0?e:ML,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const r=this;return new Promise(function(i,s){r.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Vi.DEFAULT_MATERIAL_NAME="__DEFAULT";const na={};class kG extends Error{constructor(e,t){super(e),this.response=t}}class Ra extends Vi{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=pa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(na[e]!==void 0){na[e].push({onLoad:t,onProgress:r,onError:i});return}na[e]=[],na[e].push({onLoad:t,onProgress:r,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const f=na[e],p=u.body.getReader(),m=u.headers.get("X-File-Size")||u.headers.get("Content-Length"),x=m?parseInt(m):0,v=x!==0;let _=0;const y=new ReadableStream({start(g){b();function b(){p.read().then(({done:S,value:M})=>{if(S)g.close();else{_+=M.byteLength;const A=new ProgressEvent("progress",{lengthComputable:v,loaded:_,total:x});for(let R=0,F=f.length;R<F;R++){const L=f[R];L.onProgress&&L.onProgress(A)}g.enqueue(M),b()}},S=>{g.error(S)})}}});return new Response(y)}else throw new kG(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(c){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(f=>new DOMParser().parseFromString(f,a));case"json":return u.json();default:if(a==="")return u.text();{const p=/charset="?([^;"\s]*)"?/i.exec(a),m=p&&p[1]?p[1].toLowerCase():void 0,x=new TextDecoder(m);return u.arrayBuffer().then(v=>x.decode(v))}}}).then(u=>{pa.add(e,u);const f=na[e];delete na[e];for(let p=0,m=f.length;p<m;p++){const x=f[p];x.onLoad&&x.onLoad(u)}}).catch(u=>{const f=na[e];if(f===void 0)throw this.manager.itemError(e),u;delete na[e];for(let p=0,m=f.length;p<m;p++){const x=f[p];x.onError&&x.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class LG extends Vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Ra(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){const t=[];for(let r=0;r<e.length;r++){const i=Kp.parse(e[r]);t.push(i)}return t}}class jG extends Vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=[],a=new $y,c=new Ra(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(s.withCredentials);let u=0;function f(p){c.load(e[p],function(m){const x=s.parse(m,!0);o[p]={width:x.width,height:x.height,format:x.format,mipmaps:x.mipmaps},u+=1,u===6&&(x.mipmapCount===1&&(a.minFilter=xr),a.image=o,a.format=x.format,a.needsUpdate=!0,t&&t(a))},r,i)}if(Array.isArray(e))for(let p=0,m=e.length;p<m;++p)f(p);else c.load(e,function(p){const m=s.parse(p,!0);if(m.isCubemap){const x=m.mipmaps.length/m.mipmapCount;for(let v=0;v<x;v++){o[v]={mipmaps:[]};for(let _=0;_<m.mipmapCount;_++)o[v].mipmaps.push(m.mipmaps[v*m.mipmapCount+_]),o[v].format=m.format,o[v].width=m.width,o[v].height=m.height}a.image=o}else a.image.width=m.width,a.image.height=m.height,a.mipmaps=m.mipmaps;m.mipmapCount===1&&(a.minFilter=xr),a.format=m.format,a.needsUpdate=!0,t&&t(a)},r,i);return a}}class Zp extends Vi{constructor(e){super(e)}load(e,t,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=pa.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=Wp("img");function c(){f(),pa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function u(p){f(),i&&i(p),s.manager.itemError(e),s.manager.itemEnd(e)}function f(){a.removeEventListener("load",c,!1),a.removeEventListener("error",u,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class OG extends Vi{constructor(e){super(e)}load(e,t,r,i){const s=new mm;s.colorSpace=Ri;const o=new Zp(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function c(u){o.load(e[u],function(f){s.images[u]=f,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,i)}for(let u=0;u<e.length;++u)c(u);return s}}class UG extends Vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Fo,a=new Ra(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(c){let u;try{u=s.parse(c)}catch(f){if(i!==void 0)i(f);else{console.error(f);return}}u.image!==void 0?o.image=u.image:u.data!==void 0&&(o.image.width=u.width,o.image.height=u.height,o.image.data=u.data),o.wrapS=u.wrapS!==void 0?u.wrapS:Ns,o.wrapT=u.wrapT!==void 0?u.wrapT:Ns,o.magFilter=u.magFilter!==void 0?u.magFilter:xr,o.minFilter=u.minFilter!==void 0?u.minFilter:xr,o.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(o.colorSpace=u.colorSpace),u.flipY!==void 0&&(o.flipY=u.flipY),u.format!==void 0&&(o.format=u.format),u.type!==void 0&&(o.type=u.type),u.mipmaps!==void 0&&(o.mipmaps=u.mipmaps,o.minFilter=To),u.mipmapCount===1&&(o.minFilter=xr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},r,i),o}}class BG extends Vi{constructor(e){super(e)}load(e,t,r,i){const s=new Yn,o=new Zp(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},r,i),s}}class Yl extends dn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new at(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class AL extends Yl{constructor(e,t,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(dn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new at(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Gw=new Rt,hN=new G,fN=new G;class SM{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Se(512,512),this.mapType=Ds,this.map=null,this.mapPass=null,this.matrix=new Rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new jh,this._frameExtents=new Se(1,1),this._viewportCount=1,this._viewports=[new cn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;hN.setFromMatrixPosition(e.matrixWorld),t.position.copy(hN),fN.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(fN),t.updateMatrixWorld(),Gw.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Gw),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(Gw)}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 zG extends SM{constructor(){super(new Un(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=xh*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(r!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=r,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class TL extends Yl{constructor(e,t,r=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(dn.DEFAULT_UP),this.updateMatrix(),this.target=new dn,this.distance=r,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new zG}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),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 pN=new Rt,Cf=new G,$w=new G;class VG extends SM{constructor(){super(new Un(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Se(4,2),this._viewportCount=6,this._viewports=[new cn(2,1,1,1),new cn(0,1,1,1),new cn(3,1,1,1),new cn(1,1,1,1),new cn(3,0,1,1),new cn(1,0,1,1)],this._cubeDirections=[new G(1,0,0),new G(-1,0,0),new G(0,0,1),new G(0,0,-1),new G(0,1,0),new G(0,-1,0)],this._cubeUps=[new G(0,1,0),new G(0,1,0),new G(0,1,0),new G(0,1,0),new G(0,0,1),new G(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,i=this.matrix,s=e.distance||r.far;s!==r.far&&(r.far=s,r.updateProjectionMatrix()),Cf.setFromMatrixPosition(e.matrixWorld),r.position.copy(Cf),$w.copy(r.position),$w.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt($w),r.updateMatrixWorld(),i.makeTranslation(-Cf.x,-Cf.y,-Cf.z),pN.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(pN)}}class CL extends Yl{constructor(e,t,r=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new VG}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Do extends pm{constructor(e=-1,t=1,r=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
311phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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,t,r,i,s,o){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=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,o=r+e,a=i+t,c=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,a-=f*this.view.offsetY,c=a-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class HG extends SM{constructor(){super(new Do(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class NL extends Yl{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(dn.DEFAULT_UP),this.updateMatrix(),this.target=new dn,this.shadow=new HG}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class RL extends Yl{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class PL extends Yl{constructor(e,t,r=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=r,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class IL{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new G)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const r=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*i),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*r),t.addScaledVector(o[4],1.092548*(r*i)),t.addScaledVector(o[5],1.092548*(i*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(r*s)),t.addScaledVector(o[8],.546274*(r*r-i*i)),t}getIrradianceAt(e,t){const r=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*i),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*r),t.addScaledVector(o[4],2*.429043*r*i),t.addScaledVector(o[5],2*.429043*i*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*r*s),t.addScaledVector(o[8],.429043*(r*r-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const r=e.x,i=e.y,s=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*s,t[3]=.488603*r,t[4]=1.092548*r*i,t[5]=1.092548*i*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*r*s,t[8]=.546274*(r*r-i*i)}}class FL extends Yl{constructor(e=new IL,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class a1 extends Vi{constructor(e){super(e),this.textures={}}load(e,t,r,i){const s=this,o=new Ra(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){const t=this.textures;function r(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const i=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new at().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(i.dispersion=e.dispersion),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(i.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(i.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(i.depthFunc=e.depthFunc),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(i.blendSrc=e.blendSrc),e.blendDst!==void 0&&(i.blendDst=e.blendDst),e.blendEquation!==void 0&&(i.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(i.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(i.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(i.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&i.blendColor!==void 0&&i.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(i.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.wireframe
vendor: 44,507 bytes, line 311
311!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==void 0&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(i.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new at().setHex(o.value);break;case"v2":i.uniforms[s].value=new Se().fromArray(o.value);break;case"v3":i.uniforms[s].value=new G().fromArray(o.value);break;case"v4":i.uniforms[s].value=new cn().fromArray(o.value);break;case"m3":i.uniforms[s].value=new jt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new Rt().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new Se().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Se().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return a1.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:dL,SpriteMaterial:oM,RawShaderMaterial:hL,ShaderMaterial:so,PointsMaterial:lM,MeshPhysicalMaterial:fL,MeshStandardMaterial:gM,MeshPhongMaterial:pL,MeshToonMaterial:mL,MeshNormalMaterial:gL,MeshLambertMaterial:xL,MeshDepthMaterial:xM,MeshDistanceMaterial:vM,MeshBasicMaterial:Xl,MeshMatcapMaterial:vL,LineDashedMaterial:yL,LineBasicMaterial:yi,Material:ri};return new t[e]}}class QS{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class DL extends zt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class kL extends Vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Ra(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){const t={},r={};function i(x,v){if(t[v]!==void 0)return t[v];const y=x.interleavedBuffers[v],g=s(x,y.buffer),b=Ed(y.type,g),S=new Hy(b,y.stride);return S.uuid=y.uuid,t[v]=S,S}function s(x,v){if(r[v]!==void 0)return r[v];const y=x.arrayBuffers[v],g=new Uint32Array(y).buffer;return r[v]=g,g}const o=e.isInstancedBufferGeometry?new DL:new zt,a=e.data.index;if(a!==void 0){const x=Ed(a.type,a.array);o.setIndex(new En(x,1))}const c=e.data.attributes;for(const x in c){const v=c[x];let _;if(v.isInterleavedBufferAttribute){const y=i(e.data,v.data);_=new lu(y,v.itemSize,v.offset,v.normalized)}else{const y=Ed(v.type,v.array),g=v.isInstancedBufferAttribute?yh:En;_=new g(y,v.itemSize,v.normalized)}v.name!==void 0&&(_.name=v.name),v.usage!==void 0&&_.setUsage(v.usage),o.setAttribute(x,_)}const u=e.data.morphAttributes;if(u)for(const x in u){const v=u[x],_=[];for(let y=0,g=v.length;y<g;y++){const b=v[y];let S;if(b.isInterleavedBufferAttribute){const M=i(e.data,b.data);S=new lu(M,b.itemSize,b.offset,b.normalized)}else{const M=Ed(b.type,b.array);S=new En(M,b.itemSize,b.normalized)}b.name!==void 0&&(S.name=b.name),_.push(S)}o.morphAttributes[x]=_}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const p=e.data.groups||e.data.drawcalls||e.data.offsets;if(p!==void 0)for(let x=0,v=p.length;x!==v;++x){const _=p[x];o.addGroup(_.start,_.count,_.materialIndex)}const m=e.data.boundingSphere;if(m!==void 0){const x=new G;m.center!==void 0&&x.fromArray(m.center),o.boundingSphere=new jr(x,m.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class WG extends Vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=this.path===""?QS.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new Ra(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(c){let u=null;try{u=JSON.parse(c)}catch(p){i!==void 0&&i(p),console.error("THREE:ObjectLoader: Can't parse "+e+".",p.message);return}const f=u.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){i!==void 0&&i(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(u,t)},r,i)}async loadAsync(e,t){const r=this,i=this.path===""?QS.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const s=new Ra(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),a=JSON.parse(o),c=a.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await r.parseAsync(a)}parse(e,t){const r=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,i),o=this.parseImages(e.images,function(){t!==void 0&&t(u)}),a=this.parseTextures(e.textures,o),c=this.parseMaterials(e.materials,a),u=this.parseObject(e.object,s,c,a,r),f=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,f),this.bindLightTargets(u),t!==void 0){let p=!1;for(const m in o)if(o[m].data instanceof HTMLImageElement){p=!0;break}p===!1&&t(u)}return u}async parseAsync(e){const t=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),c=this.parseObject(e.object,i,a,o,t),u=this.parseSkeletons(e.skeletons,c);return this.bindSkeletons(c,u),this.bindLightTargets(c),c}parseShapes(e){const t={};if(e!==void 0)for(let r=0,i=e.length;r<i;r++){const s=new Yc().fromJSON(e[r]);t[s.uuid]=s}return t}parseSkeletons(e,t){const r={},i={};if(t.traverse(function(s){s.isBone&&(i[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=new Wy().fromJSON(e[s],i);r[a.uuid]=a}return r}parseGeometries(e,t){const r={};if(e!==void 0){const i=new kL;for(let s=0,o=e.length;s<o;s++){let a;const c=e[s];switch(c.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(c);break;default:c.type in dN?a=dN[c.type].fromJSON(c,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${c.type}"`)}a.uuid=c.uuid,c.name!==void 0&&(a.name=c.name),c.userData!==void 0&&(a.userData=c.userData),r[c.uuid]=a}}return r}parseMaterials(e,t){const r={},i={};if(e!==void 0){const s=new a1;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const c=e[o];r[c.uuid]===void 0&&(r[c.uuid]=s.parse(c)),i[c.uuid]=r[c.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let r=0;r<e.length;r++){const i=e[r],s=Kp.parse(i);t[s.uuid]=s}return t}parseImages(e,t){const r=this,i={};let s;function o(c){return r.manager.itemStart(c),s.load(c,function(){r.manager.itemEnd(c)},void 0,function(){r.manager.itemError(c),r.manager.itemEnd(c)})}function a(c){if(typeof c=="string"){const u=c,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u)?u:r.resourcePath+u;return o(f)}else return c.data?{data:Ed(c.type,c.data),width:c.width,height:c.height}:null}if(e!==void 0&&e.length>0){const c=new bM(t);s=new Zp(c),s.setCrossOrigin(this.crossOrigin);for(let u=0,f=e.length;u<f;u++){const p=e[u],m=p.url;if(Array.isArray(m)){const x=[];for(let v=0,_=m.length;v<_;v++){const y=m[v],g=a(y);g!==null&&(g instanceof HTMLImageElement?x.push(g):x.push(new Fo(g.data,g.width,g.height)))}i[p.uuid]=new _l(x)}else{const x=a(p.url);i[p.uuid]=new _l(x)}}}return i}async parseImagesAsync(e){const t=this,r={};let i;async function s(o){if(typeof o=="string"){const a=o,c=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await i.loadAsync(c)}else return o.data?{data:Ed(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){i=new Zp(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const c=e[o],u=c.url;if(Array.isArray(u)){const f=[];for(let p=0,m=u.length;p<m;p++){const x=u[p],v=await s(x);v!==null&&(v instanceof HTMLImageElement?f.push(v):f.push(new Fo(v.data,v.width,v.height)))}r[c.uuid]=new _l(f)}else{const f=await s(c.url);r[c.uuid]=new _l(f)}}}return r}parseTextures(e,t){function r(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const i={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=e[s];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const c=t[a.image],u=c.data;let f;Array.isArray(u)?(f=new mm,u.length===6&&(f.needsUpdate=!0)):(u&&u.data?f=new Fo:f=new Yn,u&&(f.needsUpdate=!0)),f.source=c,f.uuid=a.uuid,a.name!==void 0&&(f.name=a.name),a.mapping!==void 0&&(f.mapping=r(a.mapping,GG)),a.channel!==void 0&&(f.channel=a.channel),a.offset!==void 0&&f.offset.fromArray(a.offset),a.repeat!==void 0&&f.repeat.fromArray(a.repeat),a.center!==void 0&&f.center.fromArray(a.center),a.rotation!==void 0&&(f.rotation=a.rotation),a.wrap!==void 0&&(f.wrapS=r(a.wrap[0],mN),f.wrapT=r(a.wrap[1],mN)),a.format!==void 0&&(f.format=a.format),a.internalFormat!==void 0&&(f.internalFormat=a.internalFormat),a.type!==void 0&&(f.type=a.type),a.colorSpace!==void 0&&(f.colorSpace=a.colorSpace),a.minFilter!==void 0&&(f.minFilter=r(a.minFilter,gN)),a.magFilter!==void 0&&(f.magFilter=r(a.magFilter,gN)),a.anisotropy!==void 0&&(f.anisotropy=a.anisotropy),a.flipY!==void 0&&(f.flipY=a.flipY),a.generateMipmaps!==void 0&&(f.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(f.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(f.unpackAlignment=a.unpackAlignment),a.compareFunction!==void 0&&(f.compareFunction=a.compareFunction),a.userData!==void 0&&(f.userData=a.userData),i[a.uuid]=f}return i}parseObject(e,t,r,i,s){let o;function a(m){return t[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",m),t[m]}function c(m){if(m!==void 0){if(Array.isArray(m)){const x=[];for(let v=0,_=m.length;v<_;v++){const y=m[v];r[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),x.push(r[y])}return x}return r[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",m),r[m]}}function u(m){return i[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",m),i[m]}let f,p;switch(e.type){case"Scene":o=new sM,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new at(e.background):o.background=u(e.background)),e.environment!==void 0&&(o.environment=u(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new Vy(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new zy(e.fog.color,e.fog.density)),e.fog.name!==""&&(o.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(o.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(o.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&o.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(o.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&o.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":o=new Un(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new Do(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new RL(e.color,e.intensity);break;case"DirectionalLight":o=new NL(e.color,e.intensity),o.target=e.target||"";break;case"PointLight":o=new CL(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new PL(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new TL(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),o.target=e.target||"";break;case"HemisphereLight":o=new AL(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new FL().fromJSON(e);break;case"SkinnedMesh":f=a(e.geometry),p=c(e.material),o=new qk(f,p),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=a(e.geometry),p=c(e.material),o=new cr(f,p);break;case"InstancedMesh":f=a(e.geometry),p=c(e.material);const m=e.count,x=e.instanceMatrix,v=e.instanceColor;o=new Yk(f,p,m),o.instanceMatrix=new yh(new Float32Array(x.array),16),v!==void 0&&(o.instanceColor=new yh(new Float32Array(v.array),v.itemSize));break;case"BatchedMesh":f=a(e.geometry),p=c(e.material),o=new Kk(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,p),o.geometry=f,o.perObjectFrustumCulled=e.perObjectFrustumCulled,o.sortObjects=e.sortObjects,o._drawRanges=e.drawRanges,o._reservedRanges=e.reservedRanges,o._geometryInfo=e.geometryInfo.map(_=>{let y=null,g=null;return _.boundingBox!==void 0&&(y=new Jr,y.min.fromArray(_.boundingBox.min),y.max.fromArray(_.boundingBox.max)),_.boundingSphere!==void 0&&(g=new jr,g.radius=_.boundingSphere.radius,g.center.fromArray(_.boundingSphere.center)),{..._,boundingBox:y,boundingSphere:g}}),o._instanceInfo=e.instanceInfo,o._availableInstanceIds=e._availableInstanceIds,o._availableGeometryIds=e._availableGeometryIds,o._nextIndexStart=e.nextIndexStart,o._nextVertexStart=e.nextVertexStart,o._geometryCount=e.geometryCount,o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._matricesTexture=u(e.matricesTexture.uuid),o._indirectTexture=u(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=u(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(o.boundingSphere=new jr,o.boundingSphere.center.fromArray(e.boundingSphere.center),o.boundingSphere.radius=e.boundingSphere.radius),e.boundingBox!==void 0&&(o.boundingBox=new Jr,o.boundingBox.min.fromArray(e.boundingBox.min),o.boundingBox.max.fromArray(e.boundingBox.max));break;case"LOD":o=new Xk;break;case"Line":o=new Ul(a(e.geometry),c(e.material));break;case"LineLoop":o=new Zk(a(e.geometry),c(e.material));break;case"LineSegments":o=new Vo(a(e.geometry),c(e.material));break;case"PointCloud":case"Points":o=new Qk(a(e.geometry),c(e.material));break;case"Sprite":o=new $k(c(e.material));break;case"Group":o=new Md;break;case"Bone":o=new aM;break;default:o=new dn}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const m=e.children;for(let x=0;x<m.length;x++)o.add(this.parseObject(m[x],t,r,i,s))}if(e.animations!==void 0){const m=e.animations;for(let x=0;x<m.length;x++){const v=m[x];o.animations.push(s[v])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const m=e.levels;for(let x=0;x<m.length;x++){const v=m[x],_=o.getObjectByProperty("uuid",v.object);_!==void 0&&o.addLevel(_,v.distance,v.hysteresis)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(r){if(r.isSkinnedMesh===!0&&r.skeleton!==void 0){const i=t[r.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",r.skeleton):r.bind(i,r.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const r=t.target,i=e.getObjectByProperty("uuid",r);i!==void 0?t.target=i:t.target=new dn}})}}const GG={UVMapping:Py,CubeReflectionMapping:Ca,CubeRefractionMapping:Ol,EquirectangularReflectionMapping:kp,EquirectangularRefractionMapping:Lp,CubeUVReflectionMapping:kh},mN={RepeatWrapping:jp,ClampToEdgeWrapping:Ns,MirroredRepeatWrapping:Op},gN={NearestFilter:Lr,NearestMipmapNearestFilter:$E,NearestMipmapLinearFilter:Sd,LinearFilter:xr,LinearMipmapNearestFilter:ip,LinearMipmapLinearFilter:To};class $G extends Vi{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,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=pa.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const c=fetch(e,a).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return pa.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),pa.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});pa.add(e,c),s.manager.itemStart(e)}}let Cx;class EM{static getContext(){return Cx===void 0&&(Cx=new(window.AudioContext||window.webkitAudioContext)),Cx}static setContext(e){Cx=e}}class XG extends Vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Ra(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(c){try{const u=c.slice(0);EM.getContext().decodeAudioData(u,function(p){t(p)}).catch(a)}catch(u){a(u)}},r,i);function a(c){i?i(c):console.error(c),s.manager.itemError(e)}}}const xN=new Rt,vN=new Rt,pc=new Rt;class qG{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Un,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Un,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,pc.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(Xc*t.fov*.5)/t.zoom;let a,c;vN.elements[12]=-i,xN.elements[12]=i,a=-o*t.aspect+s,c=o*t.aspect+s,pc.elements[0]=2*t.near/(c-a),pc.elements[8]=(c+a)/(c-a),this.cameraL.projectionMatrix.copy(pc),a=-o*t.aspect-s,c=o*t.aspect-s,pc.elements[0]=2*t.near/(c-a),pc.elements[8]=(c+a)/(c-a),this.cameraR.projectionMatrix.copy(pc)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(vN),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(xN)}}class LL extends Un{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class MM{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=yN(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=yN();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function yN(){return performance.now()}const mc=new G,_N=new Qr,YG=new G,gc=new G;class KG extends dn{constructor(){super(),this.type="AudioListener",this.context=EM.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new MM}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(mc,_N,YG),gc.set(0,0,-1).applyQuaternion(_N),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(mc.x,i),t.positionY.linearRampToValueAtTime(mc.y,i),t.positionZ.linearRampToValueAtTime(mc.z,i),t.forwardX.linearRampToValueAtTime(gc.x,i),t.forwardY.linearRampToValueAtTime(gc.y,i),t.forwardZ.linearRampToValueAtTime(gc.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(mc.x,mc.y,mc.z),t.setOrientation(gc.x,gc.y,gc.z,r.x,r.y,r.z)}}let jL=class extends dn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(console.warn("THREE.Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}};const xc=new G,wN=new Qr,ZG=new G,vc=new G;class QG extends jL{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,r){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=r,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(xc,wN,ZG),vc.set(0,0,1).applyQuaternion(wN);const t=this.panner;if(t.positionX){const r=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(xc.x,r),t.positionY.linearRampToValueAtTime(xc.y,r),t.positionZ.linearRampToValueAtTime(xc.z,r),t.orientationX.linearRampToValueAtTime(vc.x,r),t.orientationY.linearRampToValueAtTime(vc.y,r),t.orientationZ.linearRampToValueAtTime(vc.z,r)}else t.setPosition(xc.x,xc.y,xc.z),t.setOrientation(vc.x,vc.y,vc.z)}}class JG{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let r=0;r<t.length;r++)e+=t[r];return e/t.length}}class OL{constructor(e,t,r){this.binding=e,this.valueSize=r;let i,s,o;switch(t){case"quaternion":i=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(r*6),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(r*5);break;default:i=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(r*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const r=this.buffer,i=this.valueSize,s=e*i+i;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==i;++a)r[s+a]=r[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(r,s,0,a,i)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,r=this.valueSize,i=r*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,r=this.buffer,i=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const c=t*this._origIndex;this._mixBufferRegion(r,i,c,1-s,t)}o>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let c=t,u=t+t;c!==u;++c)if(r[c]!==r[c+t]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,i,s){if(i>=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){Qr.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){const o=this._workIndex*s;Qr.multiplyQuaternionsFlat(e,o,e,t,e,r),Qr.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){const o=1-i;for(let a=0;a!==s;++a){const c=t+a;e[c]=e[c]*o+e[r+a]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[r+o]*i}}}const AM="\\[\\]\\.:\\/",e$=new RegExp("["+AM+"]","g"),TM="[^"+AM+"]",t$="[^"+AM.replace("\\.","")+"]",n$=/((?:WC+[\/:])*)/.source.replace("WC",TM),r$=/(WCOD+)?/.source.replace("WCOD",t$),i$=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",TM),s$=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",TM),o$=new RegExp("^"+n$+r$+i$+s$+"$"),a$=["material","materials","bones","map"];class l${constructor(e,t,r){const i=r||ln.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class ln{constructor(e,t,r){this.path=t,this.parsedPath=r||ln.parseTrackName(t),this.node=ln.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new ln.Composite(e,t,r):new ln(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(e$,"")}static parseTrackName(e){const t=o$.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);a$.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const c=r(a.children);if(c)return c}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)e[t++]=r[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,r=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=ln.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let u=t.objectIndex;switch(r){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let f=0;f<e.length;f++)if(e[f].name===u){u=f;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const o=e[i];if(o===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?a=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}ln.Composite=l$;ln.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};ln.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};ln.prototype.GetterByBindingType=[ln.prototype._getValue_direct,ln.prototype._getValue_array,ln.prototype._getValue_arrayElement,ln.prototype._getValue_toArray];ln.prototype.SetterByBindingTypeAndVersioning=[[ln.prototype._setValue_direct,ln.prototype._setValue_direct_setNeedsUpdate,ln.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[ln.prototype._setValue_array,ln.prototype._setValue_array_setNeedsUpdate,ln.prototype._setValue_array_setMatrixWorldNeedsUpdate],[ln.prototype._setValue_arrayElement,ln.prototype._setValue_arrayElement_setNeedsUpdate,ln.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[ln.prototype._setValue_fromArray,ln.prototype._setValue_fromArray_setNeedsUpdate,ln.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class c${constructor(){this.isAnimationObjectGroup=!0,this.uuid=os(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let r=0,i=arguments.length;r!==i;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,r=this._paths,i=this._parsedPaths,s=this._bindings,o=s.length;let a,c=e.length,u=this.nCachedObjects_;for(let f=0,p=arguments.length;f!==p;++f){const m=arguments[f],x=m.uuid;let v=t[x];if(v===void 0){v=c++,t[x]=v,e.push(m);for(let _=0,y=o;_!==y;++_)s[_].push(new ln(m,r[_],i[_]))}else if(v<u){a=e[v];const _=--u,y=e[_];t[y.uuid]=v,e[v]=y,t[x]=_,e[_]=m;for(let g=0,b=o;g!==b;++g){const S=s[g],M=S[_];let A=S[v];S[v]=M,A===void 0&&(A=new ln(m,r[g],i[g])),S[_]=A}}else e[v]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastru
311cture when reloading scenes.")}this.nCachedObjects_=u}remove(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const c=arguments[o],u=c.uuid,f=t[u];if(f!==void 0&&f>=s){const p=s++,m=e[p];t[m.uuid]=f,e[f]=m,t[u]=p,e[p]=c;for(let x=0,v=i;x!==v;++x){const _=r[x],y=_[p],g=_[f];_[f]=y,_[p]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,c=arguments.length;a!==c;++a){const u=arguments[a],f=u.uuid,p=t[f];if(p!==void 0)if(delete t[f],p<s){const m=--s,x=e[m],v=--o,_=e[v];t[x.uuid]=p,e[p]=x,t[_.uuid]=m,e[m]=_,e.pop();for(let y=0,g=i;y!==g;++y){const b=r[y],S=b[m],M=b[v];b[p]=S,b[m]=M,b.pop()}}else{const m=--o,x=e[m];m>0&&(t[x.uuid]=p),e[p]=x,e.pop();for(let v=0,_=i;v!==_;++v){const y=r[v];y[p]=y[m],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const r=this._bindingsIndicesByPath;let i=r[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,a=this._parsedPaths,c=this._objects,u=c.length,f=this.nCachedObjects_,p=new Array(u);i=s.length,r[e]=i,o.push(e),a.push(t),s.push(p);for(let m=f,x=c.length;m!==x;++m){const v=c[m];p[m]=new ln(v,e,t)}return p}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,c=o[a],u=e[a];t[u]=r,o[r]=c,o.pop(),s[r]=s[a],s.pop(),i[r]=i[a],i.pop()}}}class UL{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),c={endingStart:Ic,endingEnd:Ic};for(let u=0;u!==o;++u){const f=s[u].createInterpolant(null);a[u]=f,f.settings=c}this._interpolantSettings=c,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Mk,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r=!1){if(e.fadeOut(t),this.fadeIn(t),r===!0){const i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r=!1){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const i=this._mixer,s=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const c=a.parameterPositions,u=a.sampleValues;return c[0]=s,c[1]=s+r,u[0]=e/o,u[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}
vendor: 11,114 bytes, line 311
311_update(e,t,r,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const c=(e-s)*r;c<0||r===0?t=0:(this._startTime=null,t=r*c)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const c=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case eM:for(let f=0,p=c.length;f!==p;++f)c[f].evaluate(o),u[f].accumulateAdditive(a);break;case Oy:default:for(let f=0,p=c.length;f!==p;++f)c[f].evaluate(o),u[f].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let i=this.time+e,s=this._loopCount;const o=r===Ak;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===Ek){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){const i=this._interpolantSettings;r?(i.endingStart=Fc,i.endingEnd=Fc):(e?i.endingStart=this.zeroSlopeAtStart?Fc:Ic:i.endingStart=Bp,t?i.endingEnd=this.zeroSlopeAtEnd?Fc:Ic:i.endingEnd=Bp)}_scheduleFading(e,t,r){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,c=o.sampleValues;return a[0]=s,c[0]=t,a[1]=s+e,c[1]=r,this}}const u$=new Float32Array(1);class d$ extends zo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,c=r.uuid,u=this._bindingsByRootAndName;let f=u[c];f===void 0&&(f={},u[c]=f);for(let p=0;p!==s;++p){const m=i[p],x=m.name;let v=f[x];if(v!==void 0)++v.referenceCount,o[p]=v;else{if(v=o[p],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,c,x));continue}const _=t&&t._propertyBindings[p].binding.parsedPath;v=new OL(ln.create(r,x,_),m.ValueTypeName,m.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,c,x),o[p]=v}a[p].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,r){const i=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=i.length,i.push(e),o.actionByRoot[r]=e}_removeInactiveAction(e){const t=this._actions,r=t[t.length-1],i=e._cacheIndex;r._cacheIndex=i,t[i]=r,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],c=a.knownActions,u=c[c.length-1],f=e._byClipCacheIndex;u._byClipCacheIndex=f,c[f]=u,c.pop(),e._byClipCacheIndex=null;const p=a.actionByRoot,m=(e._localRoot||this._root).uuid;delete p[m],c.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,r=e._cacheIndex,i=this._nActiveActions++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_takeBackAction(e){const t=this._actions,r=e._cacheIndex,i=--this._nActiveActions,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_addInactiveBinding(e,t,r){const i=this._bindingsByRootAndName,s=this._bindings;let o=i[t];o===void 0&&(o={},i[t]=o),o[r]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,r=e.binding,i=r.rootNode.uuid,s=r.path,o=this._bindingsByRootAndName,a=o[i],c=t[t.length-1],u=e._cacheIndex;c._cacheIndex=u,t[u]=c,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[i]}_lendBinding(e){const t=this._bindings,r=e._cacheIndex,i=this._nActiveBindings++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_takeBackBinding(e){const t=this._bindings,r=e._cacheIndex,i=--this._nActiveBindings,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let r=e[t];return r===void 0&&(r=new _M(new Float32Array(2),new Float32Array(2),1,u$),r.__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){const t=this._controlInterpolants,r=e.__cacheIndex,i=--this._nActiveControlInterpolants,s=t[i];e.__cacheIndex=i,t[i]=e,s.__cacheIndex=r,t[r]=s}clipAction(e,t,r){const i=t||this._root,s=i.uuid;let o=typeof e=="string"?Kp.findByName(i,e):e;const a=o!==null?o.uuid:e,c=this._actionsByClip[a];let u=null;if(r===void 0&&(o!==null?r=o.blendMode:r=Oy),c!==void 0){const p=c.actionByRoot[s];if(p!==void 0&&p.blendMode===r)return p;u=c.knownActions[0],o===null&&(o=u._clip)}if(o===null)return null;const f=new UL(this,o,t,r);return this._bindAction(f,u),this._addInactiveAction(f,a,s),f}existingAction(e,t){const r=t||this._root,i=r.uuid,s=typeof e=="string"?Kp.findByName(r,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let r=t-1;r>=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let u=0;u!==r;++u)t[u]._update(i,e,s,o);const a=this._bindings,c=this._nActiveBindings;for(let u=0;u!==c;++u)a[u].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,r=e.uuid,i=this._actionsByClip,s=i[r];if(s!==void 0){const o=s.knownActions;for(let a=0,c=o.length;a!==c;++a){const u=o[a];this._deactivateAction(u);const f=u._cacheIndex,p=t[t.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,p._cacheIndex=f,t[f]=p,t.pop(),this._removeInactiveBindingsForAction(u)}delete i[r]}}uncacheRoot(e){const t=e.uuid,r=this._actionsByClip;for(const o in r){const a=r[o].actionByRoot,c=a[t];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}const i=this._bindingsByRootAndName,s=i[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const r=this.existingAction(e,t);r!==null&&(this._deactivateAction(r),this._removeInactiveAction(r))}}class h$ extends Uy{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isRenderTarget3D=!0,this.depth=r,this.texture=new By(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class f$ extends Uy{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isRenderTargetArray=!0,this.depth=r,this.texture=new fm(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class CM{constructor(e){this.value=e}clone(){return new CM(this.value.clone===void 0?this.value:this.value.clone())}}let p$=0;class m$ extends zo{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:p$++}),this.name="",this.usage=Vp,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let r=0,i=t.length;r<i;r++){const s=Array.isArray(t[r])?t[r]:[t[r]];for(let o=0;o<s.length;o++)this.uniforms.push(s[o].clone())}return this}clone(){return new this.constructor().copy(this)}}class g$ extends Hy{constructor(e,t,r=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class x${constructor(e,t,r,i,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=r,this.elementSize=i,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const bN=new Rt;class BL{constructor(e,t,r=0,i=1/0){this.ray=new vu(e,t),this.near=r,this.far=i,this.camera=null,this.layers=new qc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster:
311Unsupported camera type: "+t.type)}setFromXRController(e){return bN.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(bN),this}intersectObject(e,t=!0,r=[]){return JS(e,this,r,t),r.sort(SN),r}intersectObjects(e,t=!0,r=[]){for(let i=0,s=e.length;i<s;i++)JS(e[i],this,r,t);return r.sort(SN),r}}function SN(n,e){return n.distance-e.distance}function JS(n,e,t,r){let i=!0;if(n.layers.test(e.layers)&&n.raycast(e,t)===!1&&(i=!1),i===!0&&r===!0){const s=n.children;for(let o=0,a=s.length;o<a;o++)JS(s[o],e,t,!0)}}class e2{constructor(e=1,t=0,r=0){this.radius=e,this.phi=t,this.theta=r}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=It(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(It(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class v${constructor(e=1,t=0,r=0){this.radius=e,this.theta=t,this.y=r}set(e,t,r){return this.radius=e,this.theta=t,this.y=r,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+r*r),this.theta=Math.atan2(e,r),this.y=t,this}clone(){return new this.constructor().copy(this)}}
vendor: 8,558 bytes, line 311
311class NM{constructor(e,t,r,i){NM.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,r,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let r=0;r<4;r++)this.elements[r]=e[r+t];return this}set(e,t,r,i){const s=this.elements;return s[0]=e,s[2]=t,s[1]=r,s[3]=i,this}}const EN=new Se;class y${constructor(e=new Se(1/0,1/0),t=new Se(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=EN.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}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}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}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}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,EN).distanceTo(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}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)}}const MN=new G,Nx=new G;class _${constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){MN.subVectors(e,this.start),Nx.subVectors(this.end,this.start);const r=Nx.dot(Nx);let s=Nx.dot(MN)/r;return t&&(s=It(s,0,1)),s}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const AN=new G;class w$ extends dn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new zt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,c=32;o<c;o++,a++){const u=o/c*Math.PI*2,f=a/c*Math.PI*2;i.push(Math.cos(u),Math.sin(u),1,Math.cos(f),Math.sin(f),1)}r.setAttribute("position",new ht(i,3));const s=new yi({fog:!1,toneMapped:!1});this.cone=new Vo(r,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),AN.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(AN),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ja=new G,Rx=new Rt,Xw=new Rt;class b$ extends Vo{constructor(e){const t=zL(e),r=new zt,i=[],s=[],o=new at(0,0,1),a=new at(0,1,0);for(let u=0;u<t.length;u++){const f=t[u];f.parent&&f.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}r.setAttribute("position",new ht(i,3)),r.setAttribute("color",new ht(s,3));const c=new yi({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(r,c),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,r=this.geometry,i=r.getAttribute("position");Xw.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(Rx.multiplyMatrices(Xw,a.matrixWorld),Ja.setFromMatrixPosition(Rx),i.setXYZ(o,Ja.x,Ja.y,Ja.z),Rx.multiplyMatrices(Xw,a.parent.matrixWorld),Ja.setFromMatrixPosition(Rx),i.setXYZ(o+1,Ja.x,Ja.y,Ja.z),o+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function zL(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push(...zL(n.children[t]));return e}class S$ extends cr{constructor(e,t,r){const i=new ym(t,4,2),s=new Xl({wireframe:!0,fog:!1,toneMapped:!1});super(i,s),this.light=e,this.color=r,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const E$=new G,TN=new at,CN=new at;class M$ extends dn{constructor(e,t,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="HemisphereLightHelper";const i=new vm(t);i.rotateY(Math.PI*.5),this.material=new Xl({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),o=new Float32Array(s.count*3);i.setAttribute("color",new En(o,3)),this.add(new cr(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");TN.copy(this.light.color),CN.copy(this.light.groundColor);for(let r=0,i=t.count;r<i;r++){const s=r<i/2?TN:CN;t.setXYZ(r,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(E$.setFromMatrixPosition(this.light.matrixWorld).negate())}}class A$ extends Vo{constructor(e=10,t=10,r=4473924,i=8947848){r=new at(r),i=new at(i);const s=t/2,o=e/t,a=e/2,c=[],u=[];for(let m=0,x=0,v=-a;m<=t;m++,v+=o){c.push(-a,0,v,a,0,v),c.push(v,0,-a,v,0,a);const _=m===s?r:i;_.toArray(u,x),x+=3,_.toArray(u,x),x+=3,_.toArray(u,x),x+=3,_.toArray(u,x),x+=3}const f=new zt;f.setAttribute("position",new ht(c,3)),f.setAttribute("color",new ht(u,3));const p=new yi({vertexColors:!0,toneMapped:!1});super(f,p),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class T$ extends Vo{constructor(e=10,t=16,r=8,i=64,s=4473924,o=8947848){s=new at(s),o=new at(o);const a=[],c=[];if(t>1)for(let p=0;p<t;p++){const m=p/t*(Math.PI*2),x=Math.sin(m)*e,v=Math.cos(m)*e;a.push(0,0,0),a.push(x,0,v);const _=p&1?s:o;c.push(_.r,_.g,_.b),c.push(_.r,_.g,_.b)}for(let p=0;p<r;p++){const m=p&1?s:o,x=e-e/r*p;for(let v=0;v<i;v++){let _=v/i*(Math.PI*2),y=Math.sin(_)*x,g=Math.cos(_)*x;a.push(y,0,g),c.push(m.r,m.g,m.b),_=(v+1)/i*(Math.PI*2),y=Math.sin(_)*x,g=Math.cos(_)*x,a.push(y,0,g),c.push(m.r,m.g,m.b)}}const u=new zt;u.setAttribute("position",new ht(a,3)),u.setAttribute("color",new ht(c,3));const f=new yi({vertexColors:!0,toneMapped:!1});super(u,f),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const NN=new G,Px=new G,RN=new G;class C$ extends dn{constructor(e,t,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",t===void 0&&(t=1);let i=new zt;i.setAttribute("position",new ht([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new yi({fog:!1,toneMapped:!1});
311this.lightPlane=new Ul(i,s),this.add(this.lightPlane),i=new zt,i.setAttribute("position",new ht([0,0,0,0,0,1],3)),this.targetLine=new Ul(i,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),NN.setFromMatrixPosition(this.light.matrixWorld),Px.setFromMatrixPosition(this.light.target.matrixWorld),RN.subVectors(Px,NN),this.lightPlane.lookAt(Px),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Px),this.targetLine.scale.z=RN.length()}}const Ix=new G,Wn=new pm;class N$ extends Vo{constructor(e){const t=new zt,r=new yi({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={};a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4");function a(v,_){c(v),c(_)}function c(v){i.push(0,0,0),s.push(0,0,0),o[v]===void 0&&(o[v]=[]),o[v].push(i.length/3-1)}t.setAttribute("position",new ht(i,3)),t.setAttribute("color",new ht(s,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const u=new at(16755200),f=new at(16711680),p=new at(43775),m=new at(16777215),x=new at(3355443);this.setColors(u,f,p,m,x)}setColors(e,t,r,i,s){const a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,r.r,r.g,r.b),a.setXYZ(33,r.r,r.g,r.b),a.setXYZ(34,r.r,r.g,r.b),a.setXYZ(35,r.r,r.g,r.b),a.setXYZ(36,r.r,r.g,r.b),a.setXYZ(37,r.r,r.g,r.b),a.setXYZ(38,i.r,i.g,i.b),a.setXYZ(39,i.r,i.g,i.b),a.setXYZ(40,s.r,s.g,s.b),a.setXYZ(41,s.r,s.g,s.b),a.setXYZ(42,s.r,s.g,s.b),a.setXYZ(43,s.r,s.g,s.b),a.setXYZ(44,s.r,s.g,s.b),a.setXYZ(45,s.r,s.g,s.b),a.setXYZ(46,s.r,s.g,s.b),a.setXYZ(47,s.r,s.g,s.b),a.setXYZ(48,s.r,s.g,s.b),a.setXYZ(49,s.r,s.g,s.b),a.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,r=1,i=1;Wn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse);const s=this.camera.coordinateSystem===Rs?-1:0;Zn("c",t,e,Wn,0,0,s),Zn("t",t,e,Wn,0,0,1),Zn("n1",t,e,Wn,-1,-1,s),Zn("n2",t,e,Wn,r,-1,s),Zn("n3",t,e,Wn,-1,i,s),Zn("n4",t,e,Wn,r,i,s),Zn("f1",t,e,Wn,-1,-1,1),Zn("f2",t,e,Wn,r,-1,1),Zn("f3",t,e,Wn,-1,i,1),Zn("f4",t,e,Wn,r,i,1),Zn("u1",t,e,Wn,r*.7,i*1.1,s),Zn("u2",t,e,Wn,-1*.7,i*1.1,s),Zn("u3",t,e,Wn,0,i*2,s),Zn("cf1",t,e,Wn,-1,0,1),Zn("cf2",t,e,Wn,r,0,1),Zn("cf3",t,e,Wn,0,-1,1),Zn("cf4",t,e,Wn,0,i,1),Zn("cn1",t,e,Wn,-1,0,s),Zn("cn2",t,e,Wn,r,0,s),Zn("cn3",t,e,Wn,0,-1,s),Zn("cn4",t,e,Wn,0,i,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Zn(n,e,t,r,i,s,o){Ix.set(i,s,o).unproject(r);const a=e[n];if(a!==void 0){const c=t.getAttribute("position");for(let u=0,f=a.length;u<f;u++)c.setXYZ(a[u],Ix.x,Ix.y,Ix.z)}}const Fx=new Jr;
vendor: 5,010 bytes, line 311
311class R$ extends Vo{constructor(e,t=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),s=new zt;s.setIndex(new En(r,1)),s.setAttribute("position",new En(i,3)),super(s,new yi({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&Fx.setFromObject(this.object),Fx.isEmpty())return;const e=Fx.min,t=Fx.max,r=this.geometry.attributes.position,i=r.array;i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=e.x,i[4]=t.y,i[5]=t.z,i[6]=e.x,i[7]=e.y,i[8]=t.z,i[9]=t.x,i[10]=e.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=e.z,i[15]=e.x,i[16]=t.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=t.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class P$ extends Vo{constructor(e,t=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new zt;s.setIndex(new En(r,1)),s.setAttribute("position",new ht(i,3)),super(s,new yi({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class I$ extends Ul{constructor(e,t=1,r=16776960){const i=r,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o=new zt;o.setAttribute("position",new ht(s,3)),o.computeBoundingSphere(),super(o,new yi({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],c=new zt;c.setAttribute("position",new ht(a,3)),c.computeBoundingSphere(),this.add(new cr(c,new Xl({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const PN=new G;let Dx,qw;class F$ extends dn{constructor(e=new G(0,0,1),t=new G(0,0,0),r=1,i=16776960,s=r*.2,o=s*.2){super(),this.type="ArrowHelper",Dx===void 0&&(Dx=new zt,Dx.setAttribute("position",new ht([0,0,0,0,1,0],3)),qw=new xm(.5,1,5,1),qw.translate(0,-.5,0)),this.position.copy(t),this.line=new Ul(Dx,new yi({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new cr(qw,new Xl({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(r,s,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{PN.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(PN,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class D$ extends Vo{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new zt;i.setAttribute("position",new ht(t,3)),i.setAttribute("color",new ht(r,3));const s=new yi({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){const i=new at,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class k${constructor(){this.type="ShapePath",this.color=new at,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Lv,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const b=[];for(let S=0,M=g.length;S<M;S++){const A=g[S],R=new Yc;R.curves=A.curves,b.push(R)}return b}function r(g,b){const S=b.length;let M=!1;for(let A=S-1,R=0;R<S;A=R++){let F=b[A],L=b[R],N=L.x-F.x,I=L.y-F.y;if(Math.abs(I)>Number.EPSILON){if(I<0&&(F=b[R],N=-N,L=b[A],I=-I),g.y<F.y||g.y>L.y)continue;if(g.y===F.y){if(g.x===F.x)return!0}
vendor: 4,213 bytes, line 311
311else{const D=I*(g.x-F.x)-N*(g.y-F.y);if(D===0)return!0;if(D<0)continue;M=!M}}else{if(g.y!==F.y)continue;if(L.x<=g.x&&g.x<=F.x||F.x<=g.x&&g.x<=L.x)return!0}}return M}const i=Js.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,c;const u=[];if(s.length===1)return a=s[0],c=new Yc,c.curves=a.curves,u.push(c),u;let f=!i(s[0].getPoints());f=e?!f:f;const p=[],m=[];let x=[],v=0,_;m[v]=void 0,x[v]=[];for(let g=0,b=s.length;g<b;g++)a=s[g],_=a.getPoints(),o=i(_),o=e?!o:o,o?(!f&&m[v]&&v++,m[v]={s:new Yc,p:_},m[v].s.curves=a.curves,f&&v++,x[v]=[]):x[v].push({h:a,p:_[0]});if(!m[0])return t(s);if(m.length>1){let g=!1,b=0;for(let S=0,M=m.length;S<M;S++)p[S]=[];for(let S=0,M=m.length;S<M;S++){const A=x[S];for(let R=0;R<A.length;R++){const F=A[R];let L=!0;for(let N=0;N<m.length;N++)r(F.p,m[N].p)&&(S!==N&&b++,L?(L=!1,p[N].push(F)):g=!0);L&&p[S].push(F)}}b>0&&g===!1&&(x=p)}let y;for(let g=0,b=m.length;g<b;g++){c=m[g].s,u.push(c),y=x[g];for(let S=0,M=y.length;S<M;S++)c.holes.push(y[S].h)}return u}}class L$ extends zo{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function j$(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function O$(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function U$(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function t2(n,e,t,r){const i=B$(r);switch(t){case KE:return n*e;case ky:return n*e/i.components*i.byteLength;case hm:return n*e/i.components*i.byteLength;case QE:return n*e*2/i.components*i.byteLength;case Ly:return n*e*2/i.components*i.byteLength;case ZE:return n*e*3/i.components*i.byteLength;case Zr:return n*e*4/i.components*i.byteLength;case jy:return n*e*4/i.components*i.byteLength;case sp:case op:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case ap:case lp:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case av:case cv:return Math.max(n,16)*Math.max(e,8)/4;case ov:case lv:return Math.max(n,8)*Math.max(e,8)/2;case uv:case dv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case hv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case fv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case pv:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case mv:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case gv:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case xv:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case vv:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case yv:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case _v:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case wv:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case bv:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Sv:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Ev:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Mv:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case Av:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case cp:case Tv:case Cv:return Math.ceil(n/4)*Math.ceil(e/4)*16;case JE:case Nv:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Rv:case Pv:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function B$(n){switch(n){case Ds:case XE:return{byteLength:1,components:1};case fh:case qE:case Lh:return{byteLength:2,components:1};case Fy:case Dy:return{byteLength:2,components:4};case Na:case Iy:case Li:return{byteLength:4,components:1};case YE:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class z${static contain(e,t){return j$(e,t)}static cover(e,t){return O$(e,t)}static fill(e){return U$(e)}
vendor: 4,803 bytes, lines 311-374
311static getByteLength(e,t,r,i){return t2(e,t,r,i)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ny}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Ny);/** 312 * @license 313 * Copyright 2010-2025 Three.js Authors 314 * SPDX-License-Identifier: MIT 315 */function VL(){let n=null,e=!1,t=null,r=null;function i(s,o){t(s,o),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function V$(n){const e=new WeakMap;function t(a,c){const u=a.array,f=a.usage,p=u.byteLength,m=n.createBuffer();n.bindBuffer(c,m),n.bufferData(c,u,f),a.onUploadCallback();let x;if(u instanceof Float32Array)x=n.FLOAT;else if(u instanceof Uint16Array)a.isFloat16BufferAttribute?x=n.HALF_FLOAT:x=n.UNSIGNED_SHORT;else if(u instanceof Int16Array)x=n.SHORT;else if(u instanceof Uint32Array)x=n.UNSIGNED_INT;else if(u instanceof Int32Array)x=n.INT;else if(u instanceof Int8Array)x=n.BYTE;else if(u instanceof Uint8Array)x=n.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)x=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:m,type:x,bytesPerElement:u.BYTES_PER_ELEMENT,version:a.version,size:p}}function r(a,c,u){const f=c.array,p=c.updateRanges;if(n.bindBuffer(u,a),p.length===0)n.bufferSubData(u,0,f);else{p.sort((x,v)=>x.start-v.start);let m=0;for(let x=1;x<p.length;x++){const v=p[m],_=p[x];_.start<=v.start+v.count+1?v.count=Math.max(v.count,_.start+_.count-v.start):(++m,p[m]=_)}p.length=m+1;for(let x=0,v=p.length;x<v;x++){const _=p[x];n.bufferSubData(u,_.start*f.BYTES_PER_ELEMENT,f,_.start,_.count)}c.clearUpdateRanges()}c.onUploadCallback()}function i(a){return a.isInterleavedBufferAttribute&&(a=a.data),e.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);const c=e.get(a);c&&(n.deleteBuffer(c.buffer),e.delete(a))}function o(a,c){if(a.isInterleavedBufferAttribute&&(a=a.data),a.isGLBufferAttribute){const f=e.get(a);(!f||f.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}const u=e.get(a);if(u===void 0)e.set(a,t(a,c));else if(u.version<a.version){if(u.size!==a.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");r(u.buffer,a,c),u.version=a.version}}return{get:i,remove:s,update:o}}var H$=`#ifdef USE_ALPHAHASH 316 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 317#endif`,W$=`#ifdef USE_ALPHAHASH 318 const float ALPHA_HASH_SCALE = 0.05; 319 float hash2D( vec2 value ) { 320 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 321 } 322 float hash3D( vec3 value ) { 323 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 324 } 325 float getAlphaHashThreshold( vec3 position ) { 326 float maxDeriv = max( 327 length( dFdx( position.xyz ) ), 328 length( dFdy( position.xyz ) ) 329 ); 330 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 331 vec2 pixScales = vec2( 332 exp2( floor( log2( pixScale ) ) ), 333 exp2( ceil( log2( pixScale ) ) ) 334 ); 335 vec2 alpha = vec2( 336 hash3D( floor( pixScales.x * position.xyz ) ), 337 hash3D( floor( pixScales.y * position.xyz ) ) 338 ); 339 float lerpFactor = fract( log2( pixScale ) ); 340 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 341 float a = min( lerpFactor, 1.0 - lerpFactor ); 342 vec3 cases = vec3( 343 x * x / ( 2.0 * a * ( 1.0 - a ) ), 344 ( x - 0.5 * a ) / ( 1.0 - a ), 345 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 346 ); 347 float threshold = ( x < ( 1.0 - a ) ) 348 ? ( ( x < a ) ? cases.x : cases.y ) 349 : cases.z; 350 return clamp( threshold , 1.0e-6, 1.0 ); 351 } 352#endif`,G$=`#ifdef USE_ALPHAMAP 353 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 354#endif`,$$=`#ifdef USE_ALPHAMAP 355 uniform sampler2D alphaMap; 356#endif`,X$=`#ifdef USE_ALPHATEST 357 #ifdef ALPHA_TO_COVERAGE 358 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 359 if ( diffuseColor.a == 0.0 ) discard; 360 #else 361 if ( diffuseColor.a < alphaTest ) discard; 362 #endif 363#endif`,q$=`#ifdef USE_ALPHATEST 364 uniform float alphaTest; 365#endif`,Y$=`#ifdef USE_AOMAP 366 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 367 reflectedLight.indirectDiffuse *= ambientOcclusion; 368 #if defined( USE_CLEARCOAT ) 369 clearcoatSpecularIndirect *= ambientOcclusion; 370 #endif 371 #if defined( USE_SHEEN ) 372 sheenSpecularIndirect *= ambientOcclusion; 373 #endif 374 #if defined( USE_ENVMAP ) && defined( STANDARD )
375 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 376 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 377 #endif 378#endif`,K$=`#ifdef USE_AOMAP 379 uniform sampler2D aoMap; 380 uniform float aoMapIntensity; 381#endif`,Z$=`#ifdef USE_BATCHING 382 #if ! defined( GL_ANGLE_multi_draw ) 383 #define gl_DrawID _gl_DrawID 384 uniform int _gl_DrawID; 385 #endif 386 uniform highp sampler2D batchingTexture; 387 uniform highp usampler2D batchingIdTexture; 388 mat4 getBatchingMatrix( const in float i ) { 389 int size = textureSize( batchingTexture, 0 ).x; 390 int j = int( i ) * 4; 391 int x = j % size; 392 int y = j / size; 393 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 394 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 395 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 396 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 397 return mat4( v1, v2, v3, v4 ); 398 } 399 float getIndirectIndex( const in int i ) { 400 int size = textureSize( batchingIdTexture, 0 ).x; 401 int x = i % size; 402 int y = i / size; 403 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 404 } 405#endif 406#ifdef USE_BATCHING_COLOR 407 uniform sampler2D batchingColorTexture; 408 vec3 getBatchingColor( const in float i ) { 409 int size = textureSize( batchingColorTexture, 0 ).x; 410 int j = int( i ); 411 int x = j % size; 412 int y = j / size; 413 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb; 414 } 415#endif`,Q$=`#ifdef USE_BATCHING 416 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 417#endif`,J$=`vec3 transformed = vec3( position ); 418#ifdef USE_ALPHAHASH 419 vPosition = vec3( position ); 420#endif`,eX=`vec3 objectNormal = vec3( normal ); 421#ifdef USE_TANGENT 422 vec3 objectTangent = vec3( tangent.xyz ); 423#endif`,tX=`float G_BlinnPhong_Implicit( ) { 424 return 0.25; 425} 426float D_BlinnPhong( const in float shininess, const in float dotNH ) { 427 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 428} 429vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 430 vec3 halfDir = normalize( lightDir + viewDir ); 431 float dotNH = saturate( dot( normal, halfDir ) ); 432 float dotVH = saturate( dot( viewDir, halfDir ) ); 433 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 434 float G = G_BlinnPhong_Implicit( ); 435 float D = D_BlinnPhong( shininess, dotNH ); 436 return F * ( G * D ); 437} // validated`,nX=`#ifdef USE_IRIDESCENCE 438 const mat3 XYZ_TO_REC709 = mat3( 439 3.2404542, -0.9692660, 0.0556434, 440 -1.5371385, 1.8760108, -0.2040259, 441 -0.4985314, 0.0415560, 1.0572252 442 ); 443 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 444 vec3 sqrtF0 = sqrt( fresnel0 ); 445 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 446 } 447 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 448 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 449 } 450 float IorToFresnel0( float transmittedIor, float incidentIor ) { 451 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 452 } 453 vec3 evalSensitivity( float OPD, vec3 shift ) { 454 float phase = 2.0 * PI * OPD * 1.0e-9; 455 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 456 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 457 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 458 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 459 xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); 460 xyz /= 1.0685e-7; 461 vec3 rgb = XYZ_TO_REC709 * xyz; 462 return rgb; 463 } 464 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 465 vec3 I; 466 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 467 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 468 float cosTheta2Sq = 1.0 - sinTheta2Sq; 469 if ( cosTheta2Sq < 0.0 ) { 470 return vec3( 1.0 ); 471 } 472 float cosTheta2 = sqrt( cosTheta2Sq ); 473 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
474 float R12 = F_Schlick( R0, 1.0, cosTheta1 ); 475 float T121 = 1.0 - R12; 476 float phi12 = 0.0; 477 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 478 float phi21 = PI - phi12; 479 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 480 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 481 vec3 phi23 = vec3( 0.0 ); 482 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 483 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 484 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 485 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 486 vec3 phi = vec3( phi21 ) + phi23; 487 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 488 vec3 r123 = sqrt( R123 ); 489 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 490 vec3 C0 = R12 + Rs; 491 I = C0; 492 vec3 Cm = Rs - T121; 493 for ( int m = 1; m <= 2; ++ m ) { 494 Cm *= r123; 495 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 496 I += Cm * Sm; 497 } 498 return max( I, vec3( 0.0 ) ); 499 } 500#endif`,rX=`#ifdef USE_BUMPMAP 501 uniform sampler2D bumpMap; 502 uniform float bumpScale; 503 vec2 dHdxy_fwd() { 504 vec2 dSTdx = dFdx( vBumpMapUv ); 505 vec2 dSTdy = dFdy( vBumpMapUv ); 506 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 507 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 508 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 509 return vec2( dBx, dBy ); 510 } 511 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 512 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 513 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 514 vec3 vN = surf_norm; 515 vec3 R1 = cross( vSigmaY, vN ); 516 vec3 R2 = cross( vN, vSigmaX ); 517 float fDet = dot( vSigmaX, R1 ) * faceDirection; 518 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 519 return normalize( abs( fDet ) * surf_norm - vGrad ); 520 } 521#endif`,iX=`#if NUM_CLIPPING_PLANES > 0 522 vec4 plane; 523 #ifdef ALPHA_TO_COVERAGE 524 float distanceToPlane, distanceGradient; 525 float clipOpacity = 1.0; 526 #pragma unroll_loop_start 527 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 528 plane = clippingPlanes[ i ]; 529 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 530 distanceGradient = fwidth( distanceToPlane ) / 2.0; 531 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 532 if ( clipOpacity == 0.0 ) discard; 533 } 534 #pragma unroll_loop_end 535 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 536 float unionClipOpacity = 1.0; 537 #pragma unroll_loop_start 538 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 539 plane = clippingPlanes[ i ]; 540 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 541 distanceGradient = fwidth( distanceToPlane ) / 2.0; 542 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 543 } 544 #pragma unroll_loop_end 545 clipOpacity *= 1.0 - unionClipOpacity; 546 #endif 547 diffuseColor.a *= clipOpacity; 548 if ( diffuseColor.a == 0.0 ) discard; 549 #else 550 #pragma unroll_loop_start 551 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 552 plane = clippingPlanes[ i ]; 553 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 554 } 555 #pragma unroll_loop_end 556 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 557 bool clipped = true; 558 #pragma unroll_loop_start 559 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 560 plane = clippingPlanes[ i ]; 561 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 562 } 563 #pragma unroll_loop_end 564 if ( clipped ) discard; 565 #endif 566 #endif 567#endif`,sX=`#if NUM_CLIPPING_PLANES > 0 568 varying vec3 vClipPosition; 569 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 570#endif`,oX=`#if NUM_CLIPPING_PLANES > 0 571 varying vec3 vClipPosition; 572#endif`,aX=`#if NUM_CLIPPING_PLANES > 0 573 vClipPosition = - mvPosition.xyz; 574#endif`,lX=`#if defined( USE_COLOR_ALPHA ) 575 diffuseColor *= vColor; 576#elif defined( USE_COLOR ) 577 diffuseColor.rgb *= vColor; 578#endif`,cX=`#if defined( USE_COLOR_ALPHA ) 579 varying vec4 vColor; 580#elif defined( USE_COLOR ) 581 varying vec3 vColor; 582#endif`,uX=`#if defined( USE_COLOR_ALPHA ) 583 varying vec4 vColor; 584#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 585 varying vec3 vColor; 586#endif`,dX=`#if defined( USE_COLOR_ALPHA ) 587 vColor = vec4( 1.0 ); 588#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 589 vColor = vec3( 1.0 ); 590#endif 591#ifdef USE_COLOR 592 vColor *= color; 593#endif 594#ifdef USE_INSTANCING_COLOR 595 vColor.xyz *= instanceColor.xyz; 596#endif 597#ifdef USE_BATCHING_COLOR 598 vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); 599 vColor.xyz *= batchingColor.xyz; 600#endif`,hX=`#define PI 3.141592653589793 601#define PI2 6.283185307179586 602#define PI_HALF 1.5707963267948966 603#define RECIPROCAL_PI 0.3183098861837907 604#define RECIPROCAL_PI2 0.15915494309189535 605#define EPSILON 1e-6 606#ifndef saturate 607#define saturate( a ) clamp( a, 0.0, 1.0 ) 608#endif 609#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 610float pow2( const in float x ) { return x*x; } 611vec3 pow2( const in vec3 x ) { return x*x; } 612float pow3( const in float x ) { return x*x*x; } 613float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 614float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 615float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 616highp float rand( const in vec2 uv ) { 617 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 618 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 619 return fract( sin( sn ) * c ); 620} 621#ifdef HIGH_PRECISION 622 float precisionSafeLength( vec3 v ) { return length( v ); } 623#else 624 float precisionSafeLength( vec3 v ) { 625 float maxComponent = max3( abs( v ) ); 626 return length( v / maxComponent ) * maxComponent; 627 } 628#endif 629struct IncidentLight { 630 vec3 color; 631 vec3 direction; 632 bool visible; 633}; 634struct ReflectedLight { 635 vec3 directDiffuse; 636 vec3 directSpecular; 637 vec3 indirectDiffuse; 638 vec3 indirectSpecular; 639}; 640#ifdef USE_ALPHAHASH 641 varying vec3 vPosition; 642#endif 643vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 644 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 645} 646vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 647 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 648} 649mat3 transposeMat3( const in mat3 m ) { 650 mat3 tmp; 651 tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); 652 tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); 653 tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); 654 return tmp; 655} 656bool isPerspectiveMatrix( mat4 m ) { 657 return m[ 2 ][ 3 ] == - 1.0; 658} 659vec2 equirectUv( in vec3 dir ) { 660 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 661 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 662 return vec2( u, v ); 663}
664vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 665 return RECIPROCAL_PI * diffuseColor; 666} 667vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 668 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 669 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 670} 671float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 672 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 673 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 674} // validated`,fX=`#ifdef ENVMAP_TYPE_CUBE_UV 675 #define cubeUV_minMipLevel 4.0 676 #define cubeUV_minTileSize 16.0 677 float getFace( vec3 direction ) { 678 vec3 absDirection = abs( direction ); 679 float face = - 1.0; 680 if ( absDirection.x > absDirection.z ) { 681 if ( absDirection.x > absDirection.y ) 682 face = direction.x > 0.0 ? 0.0 : 3.0; 683 else 684 face = direction.y > 0.0 ? 1.0 : 4.0; 685 } else { 686 if ( absDirection.z > absDirection.y ) 687 face = direction.z > 0.0 ? 2.0 : 5.0; 688 else 689 face = direction.y > 0.0 ? 1.0 : 4.0; 690 } 691 return face; 692 } 693 vec2 getUV( vec3 direction, float face ) { 694 vec2 uv; 695 if ( face == 0.0 ) { 696 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 697 } else if ( face == 1.0 ) { 698 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 699 } else if ( face == 2.0 ) { 700 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 701 } else if ( face == 3.0 ) { 702 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 703 } else if ( face == 4.0 ) { 704 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 705 } else { 706 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 707 } 708 return 0.5 * ( uv + 1.0 ); 709 } 710 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 711 float face = getFace( direction ); 712 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 713 mipInt = max( mipInt, cubeUV_minMipLevel ); 714 float faceSize = exp2( mipInt ); 715 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 716 if ( face > 2.0 ) { 717 uv.y += faceSize; 718 face -= 3.0; 719 } 720 uv.x += face * faceSize; 721 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 722 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 723 uv.x *= CUBEUV_TEXEL_WIDTH; 724 uv.y *= CUBEUV_TEXEL_HEIGHT; 725 #ifdef texture2DGradEXT 726 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 727 #else 728 return texture2D( envMap, uv ).rgb; 729 #endif 730 } 731 #define cubeUV_r0 1.0 732 #define cubeUV_m0 - 2.0 733 #define cubeUV_r1 0.8 734 #define cubeUV_m1 - 1.0 735 #define cubeUV_r4 0.4 736 #define cubeUV_m4 2.0 737 #define cubeUV_r5 0.305 738 #define cubeUV_m5 3.0 739 #define cubeUV_r6 0.21 740 #define cubeUV_m6 4.0 741 float roughnessToMip( float roughness ) { 742 float mip = 0.0; 743 if ( roughness >= cubeUV_r1 ) { 744 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 745 } else if ( roughness >= cubeUV_r4 ) { 746 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 747 } else if ( roughness >= cubeUV_r5 ) { 748 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 749 } else if ( roughness >= cubeUV_r6 ) { 750 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 751 } else { 752 mip = - 2.0 * log2( 1.16 * roughness ); } 753 return mip; 754 } 755 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 756 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 757 float mipF = fract( mip ); 758 float mipInt = floor( mip ); 759 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 760 if ( mipF == 0.0 ) { 761 return vec4( color0, 1.0 ); 762 } else { 763 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 764 return vec4( mix( color0, color1, mipF ), 1.0 ); 765 } 766 } 767#endif`,pX=`vec3 transformedNormal = objectNormal; 768#ifdef USE_TANGENT 769 vec3 transformedTangent = objectTangent; 770#endif 771#ifdef USE_BATCHING 772 mat3 bm = mat3( batchingMatrix ); 773 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 774 transformedNormal = bm * transformedNormal; 775 #ifdef USE_TANGENT 776 transformedTangent = bm * transformedTangent; 777 #endif 778#endif 779#ifdef USE_INSTANCING 780 mat3 im = mat3( instanceMatrix ); 781 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 782 transformedNormal = im * transformedNormal; 783 #ifdef USE_TANGENT 784 transformedTangent = im * transformedTangent; 785 #endif 786#endif 787transformedNormal = normalMatrix * transformedNormal; 788#ifdef FLIP_SIDED 789 transformedNormal = - transformedNormal; 790#endif 791#ifdef USE_TANGENT 792 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 793 #ifdef FLIP_SIDED 794 transformedTangent = - transformedTangent; 795 #endif 796#endif`,mX=`#ifdef USE_DISPLACEMENTMAP 797 uniform sampler2D displacementMap; 798 uniform float displacementScale; 799 uniform float displacementBias; 800#endif`,gX=`#ifdef USE_DISPLACEMENTMAP 801 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
801placementBias ); 802#endif`,xX=`#ifdef USE_EMISSIVEMAP 803 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 804 #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE 805 emissiveColor = sRGBTransferEOTF( emissiveColor ); 806 #endif 807 totalEmissiveRadiance *= emissiveColor.rgb; 808#endif`,vX=`#ifdef USE_EMISSIVEMAP 809 uniform sampler2D emissiveMap; 810#endif`,yX="gl_FragColor = linearToOutputTexel( gl_FragColor );",_X=`vec4 LinearTransferOETF( in vec4 value ) { 811 return value; 812} 813vec4 sRGBTransferEOTF( in vec4 value ) { 814 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 ); 815} 816vec4 sRGBTransferOETF( in vec4 value ) { 817 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 ); 818}`,wX=`#ifdef USE_ENVMAP 819 #ifdef ENV_WORLDPOS 820 vec3 cameraToFrag; 821 if ( isOrthographic ) { 822 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 823 } else { 824 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 825 } 826 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 827 #ifdef ENVMAP_MODE_REFLECTION 828 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 829 #else 830 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 831 #endif 832 #else 833 vec3 reflectVec = vReflect; 834 #endif 835 #ifdef ENVMAP_TYPE_CUBE 836 vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 837 #else 838 vec4 envColor = vec4( 0.0 ); 839 #endif 840 #ifdef ENVMAP_BLENDING_MULTIPLY 841 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 842 #elif defined( ENVMAP_BLENDING_MIX ) 843 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 844 #elif defined( ENVMAP_BLENDING_ADD ) 845 outgoingLight += envColor.xyz * specularStrength * reflectivity; 846 #endif 847#endif`,bX=`#ifdef USE_ENVMAP 848 uniform float envMapIntensity; 849 uniform float flipEnvMap; 850 uniform mat3 envMapRotation; 851 #ifdef ENVMAP_TYPE_CUBE 852 uniform samplerCube envMap; 853 #else 854 uniform sampler2D envMap; 855 #endif 856 857#endif`,SX=`#ifdef USE_ENVMAP 858 uniform float reflectivity; 859 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 860 #define ENV_WORLDPOS 861 #endif 862 #ifdef ENV_WORLDPOS 863 varying vec3 vWorldPosition; 864 uniform float refractionRatio; 865 #else 866 varying vec3 vReflect; 867 #endif 868#endif`,EX=`#ifdef USE_ENVMAP 869 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 870 #define ENV_WORLDPOS 871 #endif 872 #ifdef ENV_WORLDPOS 873 874 varying vec3 vWorldPosition; 875 #else 876 varying vec3 vReflect; 877 uniform float refractionRatio; 878 #endif 879#endif`,MX=`#ifdef USE_ENVMAP 880 #ifdef ENV_WORLDPOS 881 vWorldPosition = worldPosition.xyz; 882 #else 883 vec3 cameraToVertex; 884 if ( isOrthographic ) { 885 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 886 } else {
887 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 888 } 889 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 890 #ifdef ENVMAP_MODE_REFLECTION 891 vReflect = reflect( cameraToVertex, worldNormal ); 892 #else 893 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 894 #endif 895 #endif 896#endif`,AX=`#ifdef USE_FOG 897 vFogDepth = - mvPosition.z; 898#endif`,TX=`#ifdef USE_FOG 899 varying float vFogDepth; 900#endif`,CX=`#ifdef USE_FOG 901 #ifdef FOG_EXP2 902 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 903 #else 904 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 905 #endif 906 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 907#endif`,NX=`#ifdef USE_FOG 908 uniform vec3 fogColor; 909 varying float vFogDepth; 910 #ifdef FOG_EXP2 911 uniform float fogDensity; 912 #else 913 uniform float fogNear; 914 uniform float fogFar; 915 #endif 916#endif`,RX=`#ifdef USE_GRADIENTMAP 917 uniform sampler2D gradientMap; 918#endif 919vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 920 float dotNL = dot( normal, lightDirection ); 921 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 922 #ifdef USE_GRADIENTMAP 923 return vec3( texture2D( gradientMap, coord ).r ); 924 #else 925 vec2 fw = fwidth( coord ) * 0.5; 926 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 927 #endif 928}`,PX=`#ifdef USE_LIGHTMAP 929 uniform sampler2D lightMap; 930 uniform float lightMapIntensity; 931#endif`,IX=`LambertMaterial material; 932material.diffuseColor = diffuseColor.rgb; 933material.specularStrength = specularStrength;`,FX=`varying vec3 vViewPosition; 934struct LambertMaterial { 935 vec3 diffuseColor; 936 float specularStrength; 937}; 938void 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 ) { 939 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 940 vec3 irradiance = dotNL * directLight.color; 941 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 942} 943void 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 ) { 944 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 945} 946#define RE_Direct RE_Direct_Lambert 947#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,DX=`uniform bool receiveShadow; 948uniform vec3 ambientLightColor; 949#if defined( USE_LIGHT_PROBES ) 950 uniform vec3 lightProbe[ 9 ]; 951#endif 952vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 953 float x = normal.x, y = normal.y, z = normal.z; 954 vec3 result = shCoefficients[ 0 ] * 0.886227; 955 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 956 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 957 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 958 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 959 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 960 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 961 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 962 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 963 return result; 964} 965vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 966 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 967 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 968 return irradiance; 969} 970vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 971 vec3 irradiance = ambientLightColor; 972 return irradiance; 973} 974float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 975 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 976 if ( cutoffDistance > 0.0 ) { 977 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 978 } 979 return distanceFalloff; 980} 981float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 982 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 983} 984#if NUM_DIR_LIGHTS > 0 985 struct DirectionalLight { 986 vec3 direction; 987 vec3 color; 988 }; 989 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 990 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 991 light.color = directionalLight.color; 992 light.direction = directionalLight.direction; 993 light.visible = true; 994 } 995#endif 996#if NUM_POINT_LIGHTS > 0 997 struct PointLight { 998 vec3 position; 999 vec3 color; 1000 float distance; 1001 float decay; 1002 }; 1003 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 1004 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 1005 vec3 lVector = pointLight.position - geometryPosition; 1006 light.direction = normalize( lVector ); 1007 float lightDistance = length( lVector ); 1008 light.color = pointLight.color; 1009 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 1010 light.visible = ( light.color != vec3( 0.0 ) ); 1011 } 1012#endif
1013#if NUM_SPOT_LIGHTS > 0 1014 struct SpotLight { 1015 vec3 position; 1016 vec3 direction; 1017 vec3 color; 1018 float distance; 1019 float decay; 1020 float coneCos; 1021 float penumbraCos; 1022 }; 1023 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 1024 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 1025 vec3 lVector = spotLight.position - geometryPosition; 1026 light.direction = normalize( lVector ); 1027 float angleCos = dot( light.direction, spotLight.direction ); 1028 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 1029 if ( spotAttenuation > 0.0 ) { 1030 float lightDistance = length( lVector ); 1031 light.color = spotLight.color * spotAttenuation; 1032 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 1033 light.visible = ( light.color != vec3( 0.0 ) ); 1034 } else { 1035 light.color = vec3( 0.0 ); 1036 light.visible = false; 1037 } 1038 } 1039#endif 1040#if NUM_RECT_AREA_LIGHTS > 0 1041 struct RectAreaLight { 1042 vec3 color; 1043 vec3 position; 1044 vec3 halfWidth; 1045 vec3 halfHeight; 1046 }; 1047 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 1048 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 1049#endif 1050#if NUM_HEMI_LIGHTS > 0 1051 struct HemisphereLight { 1052 vec3 direction; 1053 vec3 skyColor; 1054 vec3 groundColor; 1055 }; 1056 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 1057 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 1058 float dotNL = dot( normal, hemiLight.direction ); 1059 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 1060 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 1061 return irradiance; 1062 } 1063#endif`,kX=`#ifdef USE_ENVMAP 1064 vec3 getIBLIrradiance( const in vec3 normal ) { 1065 #ifdef ENVMAP_TYPE_CUBE_UV 1066 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 1067 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 1068 return PI * envMapColor.rgb * envMapIntensity; 1069 #else 1070 return vec3( 0.0 ); 1071 #endif 1072 } 1073 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 1074 #ifdef ENVMAP_TYPE_CUBE_UV 1075 vec3 reflectVec = reflect( - viewDir, normal ); 1076 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 1077 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 1078 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 1079 return envMapColor.rgb * envMapIntensity; 1080 #else 1081 return vec3( 0.0 ); 1082 #endif 1083 } 1084 #ifdef USE_ANISOTROPY 1085 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 1086 #ifdef ENVMAP_TYPE_CUBE_UV 1087 vec3 bentNormal = cross( bitangent, viewDir ); 1088 bentNormal = normalize( cross( bentNormal, bitangent ) ); 1089 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 1090 return getIBLRadiance( viewDir, bentNormal, roughness ); 1091 #else 1092 return vec3( 0.0 ); 1093 #endif 1094 } 1095 #endif 1096#endif`,LX=`ToonMaterial material; 1097material.diffuseColor = diffuseColor.rgb;`,jX=`varying vec3 vViewPosition; 1098struct ToonMaterial { 1099 vec3 diffuseColor; 1100}; 1101void 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 ) { 1102 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 1103 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1104} 1105void 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 ) { 1106 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1107} 1108#define RE_Direct RE_Direct_Toon 1109#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,OX=`BlinnPhongMaterial material; 1110material.diffuseColor = diffuseColor.rgb; 1111material.specularColor = specular; 1112material.specularShininess = shininess; 1113material.specularStrength = specularStrength;`,UX=`varying vec3 vViewPosition; 1114struct BlinnPhongMaterial { 1115 vec3 diffuseColor; 1116 vec3 specularColor; 1117 float specularShininess; 1118 float specularStrength; 1119}; 1120void 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 ) {
1121 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1122 vec3 irradiance = dotNL * directLight.color; 1123 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1124 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 1125} 1126void 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 ) { 1127 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1128} 1129#define RE_Direct RE_Direct_BlinnPhong 1130#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,BX=`PhysicalMaterial material; 1131material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 1132vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 1133float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 1134material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 1135material.roughness = min( material.roughness, 1.0 ); 1136#ifdef IOR 1137 material.ior = ior; 1138 #ifdef USE_SPECULAR 1139 float specularIntensityFactor = specularIntensity; 1140 vec3 specularColorFactor = specularColor; 1141 #ifdef USE_SPECULAR_COLORMAP 1142 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 1143 #endif 1144 #ifdef USE_SPECULAR_INTENSITYMAP 1145 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 1146 #endif 1147 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 1148 #else 1149 float specularIntensityFactor = 1.0; 1150 vec3 specularColorFactor = vec3( 1.0 ); 1151 material.specularF90 = 1.0; 1152 #endif 1153 material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 1154#else 1155 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 1156 material.specularF90 = 1.0; 1157#endif 1158#ifdef USE_CLEARCOAT 1159 material.clearcoat = clearcoat; 1160 material.clearcoatRoughness = clearcoatRoughness; 1161 material.clearcoatF0 = vec3( 0.04 ); 1162 material.clearcoatF90 = 1.0; 1163 #ifdef USE_CLEARCOATMAP 1164 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 1165 #endif 1166 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 1167 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 1168 #endif 1169 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 1170 material.clearcoatRoughness += geometryRoughness; 1171 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 1172#endif 1173#ifdef USE_DISPERSION 1174 material.dispersion = dispersion; 1175#endif 1176#ifdef USE_IRIDESCENCE 1177 material.iridescence = iridescence; 1178 material.iridescenceIOR = iridescenceIOR; 1179 #ifdef USE_IRIDESCENCEMAP 1180 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 1181 #endif 1182 #ifdef USE_IRIDESCENCE_THICKNESSMAP 1183 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 1184 #else 1185 material.iridescenceThickness = iridescenceThicknessMaximum; 1186 #endif 1187#endif 1188#ifdef USE_SHEEN 1189 material.sheenColor = sheenColor; 1190 #ifdef USE_SHEEN_COLORMAP 1191 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 1192 #endif 1193 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 1194 #ifdef USE_SHEEN_ROUGHNESSMAP 1195 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 1196 #endif 1197#endif 1198#ifdef USE_ANISOTROPY 1199 #ifdef USE_ANISOTROPYMAP 1200 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 1201 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 1202 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 1203 #else 1204 vec2 anisotropyV = anisotropyVector; 1205 #endif 1206 material.anisotropy = length( anisotropyV ); 1207 if( material.anisotropy == 0.0 ) { 1208 anisotropyV = vec2( 1.0, 0.0 ); 1209 } else { 1210 anisotropyV /= material.anisotropy; 1211 material.anisotropy = saturate( material.anisotropy ); 1212 } 1213 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
1214 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 1215 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 1216#endif`,zX
vendor: 14,687 bytes, lines 1216-1517
1216=`struct PhysicalMaterial { 1217 vec3 diffuseColor; 1218 float roughness; 1219 vec3 specularColor; 1220 float specularF90; 1221 float dispersion; 1222 #ifdef USE_CLEARCOAT 1223 float clearcoat; 1224 float clearcoatRoughness; 1225 vec3 clearcoatF0; 1226 float clearcoatF90; 1227 #endif 1228 #ifdef USE_IRIDESCENCE 1229 float iridescence; 1230 float iridescenceIOR; 1231 float iridescenceThickness; 1232 vec3 iridescenceFresnel; 1233 vec3 iridescenceF0; 1234 #endif 1235 #ifdef USE_SHEEN 1236 vec3 sheenColor; 1237 float sheenRoughness; 1238 #endif 1239 #ifdef IOR 1240 float ior; 1241 #endif 1242 #ifdef USE_TRANSMISSION 1243 float transmission; 1244 float transmissionAlpha; 1245 float thickness; 1246 float attenuationDistance; 1247 vec3 attenuationColor; 1248 #endif 1249 #ifdef USE_ANISOTROPY 1250 float anisotropy; 1251 float alphaT; 1252 vec3 anisotropyT; 1253 vec3 anisotropyB; 1254 #endif 1255}; 1256vec3 clearcoatSpecularDirect = vec3( 0.0 ); 1257vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 1258vec3 sheenSpecularDirect = vec3( 0.0 ); 1259vec3 sheenSpecularIndirect = vec3(0.0 ); 1260vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 1261 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 1262 float x2 = x * x; 1263 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 1264 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 1265} 1266float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 1267 float a2 = pow2( alpha ); 1268 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1269 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1270 return 0.5 / max( gv + gl, EPSILON ); 1271} 1272float D_GGX( const in float alpha, const in float dotNH ) { 1273 float a2 = pow2( alpha ); 1274 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1275 return RECIPROCAL_PI * a2 / pow2( denom ); 1276} 1277#ifdef USE_ANISOTROPY 1278 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 ) { 1279 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1280 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1281 float v = 0.5 / ( gv + gl ); 1282 return saturate(v); 1283 } 1284 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1285 float a2 = alphaT * alphaB; 1286 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1287 highp float v2 = dot( v, v ); 1288 float w2 = a2 / v2; 1289 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1290 } 1291#endif 1292#ifdef USE_CLEARCOAT 1293 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1294 vec3 f0 = material.clearcoatF0; 1295 float f90 = material.clearcoatF90; 1296 float roughness = material.clearcoatRoughness; 1297 float alpha = pow2( roughness ); 1298 vec3 halfDir = normalize( lightDir + viewDir ); 1299 float dotNL = saturate( dot( normal, lightDir ) ); 1300 float dotNV = saturate( dot( normal, viewDir ) ); 1301 float dotNH = saturate( dot( normal, halfDir ) ); 1302 float dotVH = saturate( dot( viewDir, halfDir ) ); 1303 vec3 F = F_Schlick( f0, f90, dotVH ); 1304 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1305 float D = D_GGX( alpha, dotNH ); 1306 return F * ( V * D ); 1307 } 1308#endif 1309vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1310 vec3 f0 = material.specularColor; 1311 float f90 = material.specularF90; 1312 float roughness = material.roughness; 1313 float alpha = pow2( roughness ); 1314 vec3 halfDir = normalize( lightDir + viewDir ); 1315 float dotNL = saturate( dot( normal, lightDir ) ); 1316 float dotNV = saturate( dot( normal, viewDir ) ); 1317 float dotNH = saturate( dot( normal, halfDir ) ); 1318 float dotVH = saturate( dot( viewDir, halfDir ) ); 1319 vec3 F = F_Schlick( f0, f90, dotVH ); 1320 #ifdef USE_IRIDESCENCE 1321 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1322 #endif 1323 #ifdef USE_ANISOTROPY 1324 float dotTL = dot( material.anisotropyT, lightDir ); 1325 float dotTV = dot( material.anisotropyT, viewDir ); 1326 float dotTH = dot( material.anisotropyT, halfDir ); 1327 float dotBL = dot( material.anisotropyB, lightDir ); 1328 float dotBV = dot( material.anisotropyB, viewDir ); 1329 float dotBH = dot( material.anisotropyB, halfDir ); 1330 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1331 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1332 #else 1333 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1334 float D = D_GGX( alpha, dotNH ); 1335 #endif 1336 return F * ( V * D ); 1337} 1338vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1339 const float LUT_SIZE = 64.0; 1340 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1341 const float LUT_BIAS = 0.5 / LUT_SIZE; 1342 float dotNV = saturate( dot( N, V ) ); 1343 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1344 uv = uv * LUT_SCALE + LUT_BIAS; 1345 return uv; 1346} 1347float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1348 float l = length( f ); 1349 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1350} 1351vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1352 float x = dot( v1, v2 ); 1353 float y = abs( x ); 1354 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1355 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1356 float v = a / b; 1357 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1358 return cross( v1, v2 ) * theta_sintheta; 1359} 1360vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1361 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1362 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1363 vec3 lightNormal = cross( v1, v2 ); 1364 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1365 vec3 T1, T2; 1366 T1 = normalize( V - N * dot( V, N ) ); 1367 T2 = - cross( N, T1 ); 1368 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 1369 vec3 coords[ 4 ]; 1370 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1371 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1372 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1373 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1374 coords[ 0 ] = normalize( coords[ 0 ] ); 1375 coords[ 1 ] = normalize( coords[ 1 ] ); 1376 coords[ 2 ] = normalize( coords[ 2 ] ); 1377 coords[ 3 ] = normalize( coords[ 3 ] ); 1378 vec3 vectorFormFactor = vec3( 0.0 ); 1379 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1380 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1381 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1382 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1383 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1384 return vec3( result ); 1385} 1386#if defined( USE_SHEEN ) 1387float D_Charlie( float roughness, float dotNH ) { 1388 float alpha = pow2( roughness ); 1389 float invAlpha = 1.0 / alpha; 1390 float cos2h = dotNH * dotNH; 1391 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1392 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1393} 1394float V_Neubelt( float dotNV, float dotNL ) { 1395 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1396} 1397vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1398 vec3 halfDir = normalize( lightDir + viewDir ); 1399 float dotNL = saturate( dot( normal, lightDir ) ); 1400 float dotNV = saturate( dot( normal, viewDir ) ); 1401 float dotNH = saturate( dot( normal, halfDir ) ); 1402 float D = D_Charlie( sheenRoughness, dotNH ); 1403 float V = V_Neubelt( dotNV, dotNL ); 1404 return sheenColor * ( D * V ); 1405} 1406#endif 1407float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1408 float dotNV = saturate( dot( normal, viewDir ) ); 1409 float r2 = roughness * roughness; 1410 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 1411 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 1412 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 1413 return saturate( DG * RECIPROCAL_PI ); 1414} 1415vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1416 float dotNV = saturate( dot( normal, viewDir ) ); 1417 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 1418 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 1419 vec4 r = roughness * c0 + c1; 1420 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 1421 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 1422 return fab; 1423} 1424vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1425 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1426 return specularColor * fab.x + specularF90 * fab.y; 1427} 1428#ifdef USE_IRIDESCENCE 1429void 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 ) { 1430#else 1431void 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 ) { 1432#endif 1433 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1434 #ifdef USE_IRIDESCENCE 1435 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1436 #else 1437 vec3 Fr = specularColor; 1438 #endif 1439 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1440 float Ess = fab.x + fab.y; 1441 float Ems = 1.0 - Ess; 1442 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1443 singleScatter += FssEss; 1444 multiScatter += Fms * Ems; 1445} 1446#if NUM_RECT_AREA_LIGHTS > 0 1447 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 ) { 1448 vec3 normal = geometryNormal; 1449 vec3 viewDir = geometryViewDir; 1450 vec3 position = geometryPosition; 1451 vec3 lightPos = rectAreaLight.position; 1452 vec3 halfWidth = rectAreaLight.halfWidth; 1453 vec3 halfHeight = rectAreaLight.halfHeight; 1454 vec3 lightColor = rectAreaLight.color; 1455 float roughness = material.roughness; 1456 vec3 rectCoords[ 4 ]; 1457 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1458 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1459 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1460 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1461 vec4 t1 = texture2D( ltc_1, uv ); 1462 vec4 t2 = texture2D( ltc_2, uv ); 1463 mat3 mInv = mat3( 1464 vec3( t1.x, 0, t1.y ), 1465 vec3( 0, 1, 0 ), 1466 vec3( t1.z, 0, t1.w ) 1467 ); 1468 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 1469 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1470 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1471 } 1472#endif 1473void 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 ) { 1474 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1475 vec3 irradiance = dotNL * directLight.color; 1476 #ifdef USE_CLEARCOAT 1477 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1478 vec3 ccIrradiance = dotNLcc * directLight.color; 1479 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1480 #endif 1481 #ifdef USE_SHEEN 1482 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1483 #endif 1484 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); 1485 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1486} 1487void 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 ) { 1488 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1489} 1490void 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) { 1491 #ifdef USE_CLEARCOAT 1492 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1493 #endif 1494 #ifdef USE_SHEEN 1495 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1496 #endif 1497 vec3 singleScattering = vec3( 0.0 ); 1498 vec3 multiScattering = vec3( 0.0 ); 1499 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1500 #ifdef USE_IRIDESCENCE 1501 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); 1502 #else 1503 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 1504 #endif 1505 vec3 totalScattering = singleScattering + multiScattering; 1506 vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); 1507 reflectedLight.indirectSpecular += radiance * singleScattering; 1508 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 1509 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 1510} 1511#define RE_Direct RE_Direct_Physical 1512#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1513#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1514#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1515float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1516 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1517}`,
1517VX=` 1518vec3 geometryPosition = - vViewPosition; 1519vec3 geometryNormal = normal; 1520vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1521vec3 geometryClearcoatNormal = vec3( 0.0 ); 1522#ifdef USE_CLEARCOAT 1523 geometryClearcoatNormal = clearcoatNormal; 1524#endif 1525#ifdef USE_IRIDESCENCE 1526 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1527 if ( material.iridescenceThickness == 0.0 ) { 1528 material.iridescence = 0.0; 1529 } else { 1530 material.iridescence = saturate( material.iridescence ); 1531 } 1532 if ( material.iridescence > 0.0 ) { 1533 material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1534 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1535 } 1536#endif 1537IncidentLight directLight; 1538#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1539 PointLight pointLight; 1540 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1541 PointLightShadow pointLightShadow; 1542 #endif 1543 #pragma unroll_loop_start 1544 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1545 pointLight = pointLights[ i ]; 1546 getPointLightInfo( pointLight, geometryPosition, directLight ); 1547 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 1548 pointLightShadow = pointLightShadows[ i ]; 1549 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1550 #endif 1551 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1552 } 1553 #pragma unroll_loop_end 1554#endif 1555#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1556 SpotLight spotLight; 1557 vec4 spotColor; 1558 vec3 spotLightCoord; 1559 bool inSpotLightMap; 1560 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1561 SpotLightShadow spotLightShadow; 1562 #endif 1563 #pragma unroll_loop_start 1564 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1565 spotLight = spotLights[ i ]; 1566 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1567 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1568 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1569 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1570 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1571 #else 1572 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1573 #endif 1574 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1575 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1576 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1577 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1578 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1579 #endif 1580 #undef SPOT_LIGHT_MAP_INDEX 1581 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1582 spotLightShadow = spotLightShadows[ i ]; 1583 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1584 #endif 1585 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1586 } 1587 #pragma unroll_loop_end 1588#endif 1589#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1590 DirectionalLight directionalLight; 1591 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1592 DirectionalLightShadow directionalLightShadow; 1593 #endif 1594 #pragma unroll_loop_start 1595 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1596 directionalLight = directionalLights[ i ]; 1597 getDirectionalLightInfo( directionalLight, directLight ); 1598 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1599 directionalLightShadow = directionalLightShadows[ i ]; 1600 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1601 #endif 1602 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1603 } 1604 #pragma unroll_loop_end 1605#endif 1606#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1607 RectAreaLight rectAreaLight; 1608 #pragma unroll_loop_start 1609 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1610 rectAreaLight = rectAreaLights[ i ]; 1611 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1612 } 1613 #pragma unroll_loop_end 1614#endif 1615#if defined( RE_IndirectDiffuse ) 1616 vec3 iblIrradiance = vec3( 0.0 ); 1617 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1618 #if defined( USE_LIGHT_PROBES ) 1619 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1620 #endif 1621 #if ( NUM_HEMI_LIGHTS > 0 ) 1622 #pragma unroll_loop_start 1623 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1624 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1625 } 1626 #pragma unroll_loop_end 1627 #endif 1628#endif 1629#if defined( RE_IndirectSpecular ) 1630 vec3 radiance = vec3( 0.0 ); 1631 vec3 clearcoatRadiance = vec3( 0.0 ); 1632#endif`,HX=`#if defined( RE_IndirectDiffuse ) 1633 #ifdef USE_LIGHTMAP 1634 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1635 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1636 irradiance += lightMapIrradiance; 1637 #endif 1638 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 1639 iblIrradiance += getIBLIrradiance( geometryNormal ); 1640 #endif 1641#endif 1642#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1643 #ifdef USE_ANISOTROPY 1644 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1645 #else 1646 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1647 #endif 1648 #ifdef USE_CLEARCOAT 1649 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1650 #endif 1651#endif`,WX=`#if defined( RE_IndirectDiffuse ) 1652 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1653#endif 1654#if defined( RE_IndirectSpecular ) 1655 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1656#endif`,GX=`#if defined( USE_LOGDEPTHBUF ) 1657 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1658#endif`,$X=`#if defined( USE_LOGDEPTHBUF ) 1659 uniform float logDepthBufFC; 1660 varying float vFragDepth; 1661 varying float vIsPerspective; 1662#endif`,XX=`#ifdef USE_LOGDEPTHBUF 1663 varying float vFragDepth; 1664 varying float vIsPerspective; 1665#endif`,qX=`#ifdef USE_LOGDEPTHBUF 1666 vFragDepth = 1.0 + gl_Position.w; 1667 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1668#endif`,YX=`#ifdef USE_MAP 1669 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1670 #ifdef DECODE_VIDEO_TEXTURE 1671 sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); 1672 #endif 1673 diffuseColor *= sampledDiffuseColor; 1674#endif`,KX=`#ifdef USE_MAP 1675 uniform sampler2D map; 1676#endif`,ZX=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1677 #if defined( USE_POINTS_UV ) 1678 vec2 uv = vUv; 1679 #else 1680 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1681 #endif 1682#endif 1683#ifdef USE_MAP 1684 diffuseColor *= texture2D( map, uv ); 1685#endif 1686#ifdef USE_ALPHAMAP 1687 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1688#endif`,QX=`#if defined( USE_POINTS_UV ) 1689 varying vec2 vUv; 1690#else 1691 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1692 uniform mat3 uvTransform; 1693 #endif 1694#endif 1695#ifdef USE_MAP 1696 uniform sampler2D map; 1697#endif 1698#ifdef USE_ALPHAMAP 1699 uniform sampler2D alphaMap; 1700#endif`,JX=`float metalnessFactor = metalness; 1701#ifdef USE_METALNESSMAP 1702 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1703 metalnessFactor *= texelMetalness.b; 1704#endif`,eq=`#ifdef USE_METALNESSMAP 1705 uniform sampler2D metalnessMap; 1706#endif`,tq=`#ifdef USE_INSTANCING_MORPH 1707 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1708 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1709 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1710 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1711 } 1712#endif`,nq=`#if defined( USE_MORPHCOLORS ) 1713 vColor *= morphTargetBaseInfluence; 1714 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1715 #if defined( USE_COLOR_ALPHA ) 1716 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1717 #elif defined( USE_COLOR ) 1718 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1719 #endif 1720 } 1721#endif`,rq=`#ifdef USE_MORPHNORMALS 1722 objectNormal *= morphTargetBaseInfluence; 1723 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1724 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1725 } 1726#endif`,iq=`#ifdef USE_MORPHTARGETS 1727 #ifndef USE_INSTANCING_MORPH 1728 uniform float morphTargetBaseInfluence; 1729 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1730 #endif 1731 uniform sampler2DArray morphTargetsTexture; 1732 uniform ivec2 morphTargetsTextureSize; 1733 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1734 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1735 int y = texelIndex / morphTargetsTextureSize.x; 1736 int x = texelIndex - y * morphTargetsTextureSize.x; 1737 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1738 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1739 } 1740#endif`,sq=`#ifdef USE_MORPHTARGETS 1741 transformed *= morphTargetBaseInfluence; 1742 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1743 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1744 } 1745#endif`,oq=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1746#ifdef FLAT_SHADED 1747 vec3 fdx = dFdx( vViewPosition ); 1748 vec3 fdy = dFdy( vViewPosition ); 1749 vec3 normal = normalize( cross( fdx, fdy ) ); 1750#else 1751 vec3 normal = normalize( vNormal ); 1752 #ifdef DOUBLE_SIDED 1753 normal *= faceDirection; 1754 #endif 1755#endif 1756#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1757 #ifdef USE_TANGENT 1758 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1759 #else 1760 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1761 #if defined( USE_NORMALMAP ) 1762 vNormalMapUv 1763 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1764 vClearcoatNormalMapUv 1765 #else 1766 vUv 1767 #endif 1768 ); 1769 #endif 1770 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1771 tbn[0] *= faceDirection; 1772 tbn[1] *= faceDirection; 1773 #endif 1774#endif 1775#ifdef USE_CLEARCOAT_NORMALMAP 1776 #ifdef USE_TANGENT 1777 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1778 #else 1779 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1780 #endif 1781 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1782 tbn2[0] *= faceDirection; 1783 tbn2[1] *= faceDirection; 1784 #endif 1785#endif 1786vec3 nonPerturbedNormal = normal;`,aq=`#ifdef USE_NORMALMAP_OBJECTSPACE 1787 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1788 #ifdef FLIP_SIDED 1789 normal = - normal; 1790 #endif 1791 #ifdef DOUBLE_SIDED 1792 normal = normal * faceDirection; 1793 #endif 1794 normal = normalize( normalMatrix * normal ); 1795#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1796 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1797 mapN.xy *= normalScale; 1798 normal = normalize( tbn * mapN ); 1799#elif defined( USE_BUMPMAP )
1800 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1801#endif`,lq=`#ifndef FLAT_SHADED 1802 varying vec3 vNormal; 1803 #ifdef USE_TANGENT 1804 varying vec3 vTangent; 1805 varying vec3 vBitangent; 1806 #endif 1807#endif`,cq=`#ifndef FLAT_SHADED 1808 varying vec3 vNormal; 1809 #ifdef USE_TANGENT 1810 varying vec3 vTangent; 1811 varying vec3 vBitangent; 1812 #endif 1813#endif`,uq=`#ifndef FLAT_SHADED 1814 vNormal = normalize( transformedNormal ); 1815 #ifdef USE_TANGENT 1816 vTangent = normalize( transformedTangent ); 1817 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1818 #endif 1819#endif`,dq=`#ifdef USE_NORMALMAP 1820 uniform sampler2D normalMap; 1821 uniform vec2 normalScale; 1822#endif 1823#ifdef USE_NORMALMAP_OBJECTSPACE 1824 uniform mat3 normalMatrix; 1825#endif 1826#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1827 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1828 vec3 q0 = dFdx( eye_pos.xyz ); 1829 vec3 q1 = dFdy( eye_pos.xyz ); 1830 vec2 st0 = dFdx( uv.st ); 1831 vec2 st1 = dFdy( uv.st ); 1832 vec3 N = surf_norm; 1833 vec3 q1perp = cross( q1, N ); 1834 vec3 q0perp = cross( N, q0 ); 1835 vec3 T = q1perp * st0.x + q0perp * st1.x; 1836 vec3 B = q1perp * st0.y + q0perp * st1.y; 1837 float det = max( dot( T, T ), dot( B, B ) ); 1838 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1839 return mat3( T * scale, B * scale, N ); 1840 } 1841#endif`,hq=`#ifdef USE_CLEARCOAT 1842 vec3 clearcoatNormal = nonPerturbedNormal; 1843#endif`,fq=`#ifdef USE_CLEARCOAT_NORMALMAP 1844 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1845 clearcoatMapN.xy *= clearcoatNormalScale; 1846 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1847#endif`,pq=`#ifdef USE_CLEARCOATMAP 1848 uniform sampler2D clearcoatMap; 1849#endif 1850#ifdef USE_CLEARCOAT_NORMALMAP 1851 uniform sampler2D clearcoatNormalMap; 1852 uniform vec2 clearcoatNormalScale; 1853#endif 1854#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1855 uniform sampler2D clearcoatRoughnessMap; 1856#endif`,mq=`#ifdef USE_IRIDESCENCEMAP 1857 uniform sampler2D iridescenceMap; 1858#endif 1859#ifdef USE_IRIDESCENCE_THICKNESSMAP 1860 uniform sampler2D iridescenceThicknessMap; 1861#endif`,gq=`#ifdef OPAQUE 1862diffuseColor.a = 1.0; 1863#endif 1864#ifdef USE_TRANSMISSION 1865diffuseColor.a *= material.transmissionAlpha; 1866#endif 1867gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,xq=`vec3 packNormalToRGB( const in vec3 normal ) { 1868 return normalize( normal ) * 0.5 + 0.5; 1869} 1870vec3 unpackRGBToNormal( const in vec3 rgb ) { 1871 return 2.0 * rgb.xyz - 1.0; 1872} 1873const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 1874const float Inv255 = 1. / 255.; 1875const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 1876const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 1877const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 1878const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 1879vec4 packDepthToRGBA( const in float v ) { 1880 if( v <= 0.0 ) 1881 return vec4( 0., 0., 0., 0. ); 1882 if( v >= 1.0 ) 1883 return vec4( 1., 1., 1., 1. ); 1884 float vuf; 1885 float af = modf( v * PackFactors.a, vuf ); 1886 float bf = modf( vuf * ShiftRight8, vuf ); 1887 float gf = modf( vuf * ShiftRight8, vuf ); 1888 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 1889} 1890vec3 packDepthToRGB( const in float v ) { 1891 if( v <= 0.0 ) 1892 return vec3( 0., 0., 0. ); 1893 if( v >= 1.0 ) 1894 return vec3( 1., 1., 1. ); 1895 float vuf; 1896 float bf = modf( v * PackFactors.b, vuf ); 1897 float gf = modf( vuf * ShiftRight8, vuf ); 1898 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 1899} 1900vec2 packDepthToRG( const in float v ) { 1901 if( v <= 0.0 ) 1902 return vec2( 0., 0. ); 1903 if( v >= 1.0 ) 1904 return vec2( 1., 1. ); 1905 float vuf; 1906 float gf = modf( v * 256., vuf ); 1907 return vec2( vuf * Inv255, gf ); 1908} 1909float unpackRGBAToDepth( const in vec4 v ) { 1910 return dot( v, UnpackFactors4 ); 1911} 1912float unpackRGBToDepth( const in vec3 v ) { 1913 return dot( v, UnpackFactors3 ); 1914} 1915float unpackRGToDepth( const in vec2 v ) { 1916 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 1917} 1918vec4 pack2HalfToRGBA( const in vec2 v ) {
1919 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1920 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1921} 1922vec2 unpackRGBATo2Half( const in vec4 v ) { 1923 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1924} 1925float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1926 return ( viewZ + near ) / ( near - far ); 1927} 1928float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1929 return depth * ( near - far ) - near; 1930} 1931float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1932 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1933} 1934float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1935 return ( near * far ) / ( ( far - near ) * depth - far ); 1936}`,vq=`#ifdef PREMULTIPLIED_ALPHA 1937 gl_FragColor.rgb *= gl_FragColor.a; 1938#endif`,yq=`vec4 mvPosition = vec4( transformed, 1.0 ); 1939#ifdef USE_BATCHING 1940 mvPosition = batchingMatrix * mvPosition; 1941#endif 1942#ifdef USE_INSTANCING 1943 mvPosition = instanceMatrix * mvPosition; 1944#endif 1945mvPosition = modelViewMatrix * mvPosition; 1946gl_Position = projectionMatrix * mvPosition;`,_q=`#ifdef DITHERING 1947 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1948#endif`,wq=`#ifdef DITHERING 1949 vec3 dithering( vec3 color ) { 1950 float grid_position = rand( gl_FragCoord.xy ); 1951 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1952 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1953 return color + dither_shift_RGB; 1954 } 1955#endif`,bq=`float roughnessFactor = roughness; 1956#ifdef USE_ROUGHNESSMAP 1957 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1958 roughnessFactor *= texelRoughness.g; 1959#endif`,Sq=`#ifdef USE_ROUGHNESSMAP 1960 uniform sampler2D roughnessMap; 1961#endif`,Eq=
vendor: 8,887 bytes, lines 1961-2147
1961`#if NUM_SPOT_LIGHT_COORDS > 0 1962 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1963#endif 1964#if NUM_SPOT_LIGHT_MAPS > 0 1965 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1966#endif 1967#ifdef USE_SHADOWMAP 1968 #if NUM_DIR_LIGHT_SHADOWS > 0 1969 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1970 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1971 struct DirectionalLightShadow { 1972 float shadowIntensity; 1973 float shadowBias; 1974 float shadowNormalBias; 1975 float shadowRadius; 1976 vec2 shadowMapSize; 1977 }; 1978 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1979 #endif 1980 #if NUM_SPOT_LIGHT_SHADOWS > 0 1981 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1982 struct SpotLightShadow { 1983 float shadowIntensity; 1984 float shadowBias; 1985 float shadowNormalBias; 1986 float shadowRadius; 1987 vec2 shadowMapSize; 1988 }; 1989 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1990 #endif 1991 #if NUM_POINT_LIGHT_SHADOWS > 0 1992 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1993 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1994 struct PointLightShadow { 1995 float shadowIntensity; 1996 float shadowBias; 1997 float shadowNormalBias; 1998 float shadowRadius; 1999 vec2 shadowMapSize; 2000 float shadowCameraNear; 2001 float shadowCameraFar; 2002 }; 2003 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2004 #endif 2005 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 2006 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 2007 } 2008 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 2009 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 2010 } 2011 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 2012 float occlusion = 1.0; 2013 vec2 distribution = texture2DDistribution( shadow, uv ); 2014 float hard_shadow = step( compare , distribution.x ); 2015 if (hard_shadow != 1.0 ) { 2016 float distance = compare - distribution.x ; 2017 float variance = max( 0.00000, distribution.y * distribution.y ); 2018 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 ); 2019 } 2020 return occlusion; 2021 } 2022 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 2023 float shadow = 1.0; 2024 shadowCoord.xyz /= shadowCoord.w; 2025 shadowCoord.z += shadowBias; 2026 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 2027 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 2028 if ( frustumTest ) { 2029 #if defined( SHADOWMAP_TYPE_PCF ) 2030 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 2031 float dx0 = - texelSize.x * shadowRadius; 2032 float dy0 = - texelSize.y * shadowRadius; 2033 float dx1 = + texelSize.x * shadowRadius; 2034 float dy1 = + texelSize.y * shadowRadius; 2035 float dx2 = dx0 / 2.0; 2036 float dy2 = dy0 / 2.0; 2037 float dx3 = dx1 / 2.0; 2038 float dy3 = dy1 / 2.0; 2039 shadow = ( 2040 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 2041 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 2042 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 2043 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 2044 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 2045 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 2046 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 2047 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 2048 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 2049 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 2050 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 2051 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 2052 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 2053 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 2054 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 2055 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 2056 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 2057 ) * ( 1.0 / 17.0 ); 2058 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 2059 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 2060 float dx = texelSize.x; 2061 float dy = texelSize.y; 2062 vec2 uv = shadowCoord.xy; 2063 vec2 f = fract( uv * shadowMapSize + 0.5 ); 2064 uv -= f * texelSize; 2065 shadow = ( 2066 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 2067 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 2068 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 2069 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 2070 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 2071 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 2072 f.x ) + 2073 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 2074 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 2075 f.x ) + 2076 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 2077 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 2078 f.y ) + 2079 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 2080 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 2081 f.y ) + 2082 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 2083 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 2084 f.x ), 2085 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 2086 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 2087 f.x ), 2088 f.y ) 2089 ) * ( 1.0 / 9.0 ); 2090 #elif defined( SHADOWMAP_TYPE_VSM ) 2091 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 2092 #else 2093 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 2094 #endif 2095 } 2096 return mix( 1.0, shadow, shadowIntensity ); 2097 } 2098 vec2 cubeToUV( vec3 v, float texelSizeY ) { 2099 vec3 absV = abs( v ); 2100 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 2101 absV *= scaleToCube; 2102 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 2103 vec2 planar = v.xy; 2104 float almostATexel = 1.5 * texelSizeY; 2105 float almostOne = 1.0 - almostATexel; 2106 if ( absV.z >= almostOne ) { 2107 if ( v.z > 0.0 ) 2108 planar.x = 4.0 - v.x; 2109 } else if ( absV.x >= almostOne ) { 2110 float signX = sign( v.x ); 2111 planar.x = v.z * signX + 2.0 * signX; 2112 } else if ( absV.y >= almostOne ) { 2113 float signY = sign( v.y ); 2114 planar.x = v.x + 2.0 * signY + 2.0; 2115 planar.y = v.z * signY - 2.0; 2116 } 2117 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 2118 } 2119 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 2120 float shadow = 1.0; 2121 vec3 lightToPosition = shadowCoord.xyz; 2122 2123 float lightToPositionLength = length( lightToPosition ); 2124 if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { 2125 float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 2126 vec3 bd3D = normalize( lightToPosition ); 2127 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 2128 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 2129 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 2130 shadow = ( 2131 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 2132 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 2133 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 2134 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 2135 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 2136 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 2137 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 2138 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 2139 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 2140 ) * ( 1.0 / 9.0 ); 2141 #else 2142 shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 2143 #endif 2144 } 2145 return mix( 1.0, shadow, shadowIntensity ); 2146 } 2147#endif`,
2147Mq=`#if NUM_SPOT_LIGHT_COORDS > 0 2148 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 2149 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 2150#endif 2151#ifdef USE_SHADOWMAP 2152 #if NUM_DIR_LIGHT_SHADOWS > 0 2153 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 2154 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 2155 struct DirectionalLightShadow { 2156 float shadowIntensity; 2157 float shadowBias; 2158 float shadowNormalBias; 2159 float shadowRadius; 2160 vec2 shadowMapSize; 2161 }; 2162 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 2163 #endif 2164 #if NUM_SPOT_LIGHT_SHADOWS > 0 2165 struct SpotLightShadow { 2166 float shadowIntensity; 2167 float shadowBias; 2168 float shadowNormalBias; 2169 float shadowRadius; 2170 vec2 shadowMapSize; 2171 }; 2172 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 2173 #endif 2174 #if NUM_POINT_LIGHT_SHADOWS > 0 2175 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 2176 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 2177 struct PointLightShadow { 2178 float shadowIntensity; 2179 float shadowBias; 2180 float shadowNormalBias; 2181 float shadowRadius; 2182 vec2 shadowMapSize; 2183 float shadowCameraNear; 2184 float shadowCameraFar; 2185 }; 2186 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2187 #endif 2188#endif`,Aq=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 2189 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 2190 vec4 shadowWorldPosition; 2191#endif 2192#if defined( USE_SHADOWMAP ) 2193 #if NUM_DIR_LIGHT_SHADOWS > 0 2194 #pragma unroll_loop_start 2195 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2196 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 2197 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 2198 } 2199 #pragma unroll_loop_end 2200 #endif 2201 #if NUM_POINT_LIGHT_SHADOWS > 0 2202 #pragma unroll_loop_start 2203 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2204 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 2205 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 2206 } 2207 #pragma unroll_loop_end 2208 #endif 2209#endif 2210#if NUM_SPOT_LIGHT_COORDS > 0 2211 #pragma unroll_loop_start 2212 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 2213 shadowWorldPosition = worldPosition; 2214 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2215 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 2216 #endif 2217 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 2218 } 2219 #pragma unroll_loop_end 2220#endif`,Tq=`float getShadowMask() { 2221 float shadow = 1.0; 2222 #ifdef USE_SHADOWMAP 2223 #if NUM_DIR_LIGHT_SHADOWS > 0 2224 DirectionalLightShadow directionalLight; 2225 #pragma unroll_loop_start 2226 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2227 directionalLight = directionalLightShadows[ i ]; 2228 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2229 } 2230 #pragma unroll_loop_end 2231 #endif 2232 #if NUM_SPOT_LIGHT_SHADOWS > 0 2233 SpotLightShadow spotLight; 2234 #pragma unroll_loop_start 2235 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 2236 spotLight = spotLightShadows[ i ]; 2237 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2238 } 2239 #pragma unroll_loop_end 2240 #endif 2241 #if NUM_POINT_LIGHT_SHADOWS > 0 2242 PointLightShadow pointLight; 2243 #pragma unroll_loop_start 2244 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2245 pointLight = pointLightShadows[ i ]; 2246 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2247 } 2248 #pragma unroll_loop_end 2249 #endif 2250 #endif 2251 return shadow; 2252}`,Cq=`#ifdef USE_SKINNING 2253 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2254 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2255 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2256 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2257#endif`,Nq=`#ifdef USE_SKINNING 2258 uniform mat4 bindMatrix; 2259 uniform mat4 bindMatrixInverse; 2260 uniform highp sampler2D boneTexture; 2261 mat4 getBoneMatrix( const in float i ) { 2262 int size = textureSize( boneTexture, 0 ).x; 2263 int j = int( i ) * 4; 2264 int x = j % size; 2265 int y = j / size; 2266 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2267 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2268 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2269 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2270 return mat4( v1, v2, v3, v4 ); 2271 } 2272#endif`,Rq=`#ifdef USE_SKINNING 2273 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2274 vec4 skinned = vec4( 0.0 ); 2275 skinned += boneMatX * skinVertex * skinWeight.x; 2276 skinned += boneMatY * skinVertex * skinWeight.y; 2277 skinned += boneMatZ * skinVertex * skinWeight.z; 2278 skinned += boneMatW * skinVertex * skinWeight.w; 2279 transformed = ( bindMatrixInverse * skinned ).xyz; 2280#endif`,Pq=`#ifdef USE_SKINNING 2281 mat4 skinMatrix = mat4( 0.0 ); 2282 skinMatrix += skinWeight.x * boneMatX; 2283 skinMatrix += skinWeight.y * boneMatY; 2284 skinMatrix += skinWeight.z * boneMatZ; 2285 skinMatrix += skinWeight.w * boneMatW; 2286 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2287 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2288 #ifdef USE_TANGENT 2289 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2290 #endif 2291#endif`,Iq=`float specularStrength; 2292#ifdef USE_SPECULARMAP 2293 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2294 specularStrength = texelSpecular.r; 2295#else 2296 specularStrength = 1.0; 2297#endif`,Fq=`#ifdef USE_SPECULARMAP 2298 uniform sampler2D specularMap; 2299#endif`,Dq=`#if defined( TONE_MAPPING ) 2300 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2301#endif`,kq=`#ifndef saturate 2302#define saturate( a ) clamp( a, 0.0, 1.0 ) 2303#endif 2304uniform float toneMappingExposure; 2305vec3 LinearToneMapping( vec3 color ) { 2306 return saturate( toneMappingExposure * color ); 2307} 2308vec3 ReinhardToneMapping( vec3 color ) { 2309 color *= toneMappingExposure; 2310 return saturate( color / ( vec3( 1.0 ) + color ) ); 2311} 2312vec3 CineonToneMapping( vec3 color ) { 2313 color *= toneMappingExposure; 2314 color = max( vec3( 0.0 ), color - 0.004 ); 2315 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2316} 2317vec3 RRTAndODTFit( vec3 v ) { 2318 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2319 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2320 return a / b; 2321} 2322vec3 ACESFilmicToneMapping( vec3 color ) { 2323 const mat3 ACESInputMat = mat3( 2324 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2325 vec3( 0.04823, 0.01566, 0.83777 ) 2326 ); 2327 const mat3 ACESOutputMat = mat3( 2328 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2329 vec3( -0.07367, -0.00605, 1.07602 ) 2330 ); 2331 color *= toneMappingExposure / 0.6; 2332 color = ACESInputMat * color; 2333 color = RRTAndODTFit( color ); 2334 color = ACESOutputMat * color; 2335 return saturate( color ); 2336} 2337const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2338 vec3( 1.6605, - 0.1246, - 0.0182 ), 2339 vec3( - 0.5876, 1.1329, - 0.1006 ), 2340 vec3( - 0.0728, - 0.0083, 1.1187 ) 2341); 2342const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2343 vec3( 0.6274, 0.0691, 0.0164 ), 2344 vec3( 0.3293, 0.9195, 0.0880 ), 2345 vec3( 0.0433, 0.0113, 0.8956 ) 2346); 2347vec3 agxDefaultContrastApprox( vec3 x ) { 2348 vec3 x2 = x * x; 2349 vec3 x4 = x2 * x2; 2350 return + 15.5 * x4 * x2 2351 - 40.14 * x4 * x 2352 + 31.96 * x4 2353 - 6.868 * x2 * x 2354 + 0.4298 * x2 2355 + 0.1191 * x 2356 - 0.00232; 2357} 2358vec3 AgXToneMapping( vec3 color ) { 2359 const mat3 AgXInsetMatrix = mat3( 2360 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2361 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2362 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2363 );
2364 const mat3 AgXOutsetMatrix = mat3( 2365 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2366 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2367 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2368 ); 2369 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2370 color *= toneMappingExposure; 2371 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2372 color = AgXInsetMatrix * color; 2373 color = max( color, 1e-10 ); color = log2( color ); 2374 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2375 color = clamp( color, 0.0, 1.0 ); 2376 color = agxDefaultContrastApprox( color ); 2377 color = AgXOutsetMatrix * color; 2378 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2379 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2380 color = clamp( color, 0.0, 1.0 ); 2381 return color; 2382} 2383vec3 NeutralToneMapping( vec3 color ) { 2384 const float StartCompression = 0.8 - 0.04; 2385 const float Desaturation = 0.15; 2386 color *= toneMappingExposure; 2387 float x = min( color.r, min( color.g, color.b ) ); 2388 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2389 color -= offset; 2390 float peak = max( color.r, max( color.g, color.b ) ); 2391 if ( peak < StartCompression ) return color; 2392 float d = 1. - StartCompression; 2393 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2394 color *= newPeak / peak; 2395 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2396 return mix( color, vec3( newPeak ), g ); 2397} 2398vec3 CustomToneMapping( vec3 color ) { return color; }`,Lq=`#ifdef USE_TRANSMISSION 2399 material.transmission = transmission; 2400 material.transmissionAlpha = 1.0; 2401 material.thickness = thickness; 2402 material.attenuationDistance = attenuationDistance; 2403 material.attenuationColor = attenuationColor; 2404 #ifdef USE_TRANSMISSIONMAP 2405 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2406 #endif 2407 #ifdef USE_THICKNESSMAP 2408 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2409 #endif 2410 vec3 pos = vWorldPosition; 2411 vec3 v = normalize( cameraPosition - pos ); 2412 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2413 vec4 transmitted = getIBLVolumeRefraction( 2414 n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, 2415 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2416 material.attenuationColor, material.attenuationDistance ); 2417 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2418 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2419#endif`,jq=`#ifdef USE_TRANSMISSION 2420 uniform float transmission; 2421 uniform float thickness; 2422 uniform float attenuationDistance; 2423 uniform vec3 attenuationColor; 2424 #ifdef USE_TRANSMISSIONMAP 2425 uniform sampler2D transmissionMap; 2426 #endif 2427 #ifdef USE_THICKNESSMAP 2428 uniform sampler2D thicknessMap; 2429 #endif 2430 uniform vec2 transmissionSamplerSize; 2431 uniform sampler2D transmissionSamplerMap; 2432 uniform mat4 modelMatrix; 2433 uniform mat4 projectionMatrix; 2434 varying vec3 vWorldPosition; 2435 float w0( float a ) { 2436 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2437 } 2438 float w1( float a ) { 2439 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2440 } 2441 float w2( float a ){ 2442 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2443 } 2444 float w3( float a ) { 2445 return ( 1.0 / 6.0 ) * ( a * a * a ); 2446 } 2447 float g0( float a ) { 2448 return w0( a ) + w1( a ); 2449 } 2450 float g1( float a ) { 2451 return w2( a ) + w3( a ); 2452 } 2453 float h0( float a ) { 2454 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2455 } 2456 float h1( float a ) { 2457 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2458 } 2459 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2460 uv = uv * texelSize.zw + 0.5; 2461 vec2 iuv = floor( uv ); 2462 vec2 fuv = fract( uv ); 2463 float g0x = g0( fuv.x ); 2464 float g1x = g1( fuv.x ); 2465 float h0x = h0( fuv.x ); 2466 float h1x = h1( fuv.x ); 2467 float h0y = h0( fuv.y ); 2468 float h1y = h1( fuv.y ); 2469 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2470 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2471 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2472 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2473 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2474 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2475 } 2476 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2477 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2478 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2479 vec2 fLodSizeInv = 1.0 / fLodSize; 2480 vec2 cLodSizeInv = 1.0 / cLodSize; 2481 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2482 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2483 return mix( fSample, cSample, fract( lod ) ); 2484 } 2485 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2486 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2487 vec3 modelScale; 2488 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2489 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2490 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2491 return normalize( refractionVector ) * thickness * modelScale; 2492 } 2493 float applyIorToRoughness( const in float roughness, const in float ior ) { 2494 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2495 } 2496 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2497 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2498 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2499 } 2500 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2501 if ( isinf( attenuationDistance ) ) { 2502 return vec3( 1.0 ); 2503 } else { 2504 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2505 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2506 } 2507 } 2508 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2509 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2510 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2511 const in vec3 attenuationColor, const in float attenuationDistance ) { 2512 vec4 transmittedLight; 2513 vec3 transmittance; 2514 #ifdef USE_DISPERSION 2515 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2516 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2517 for ( int i = 0; i < 3; i ++ ) { 2518 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2519 vec3 refractedRayExit = position + transmissionRay; 2520 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2521 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2522 refractionCoords += 1.0; 2523 refractionCoords /= 2.0; 2524 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2525 transmittedLight[ i ] = transmissionSample[ i ]; 2526 transmittedLight.a += transmissionSample.a; 2527 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2528 } 2529 transmittedLight.a /= 3.0; 2530 #else 2531 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2532 vec3 refractedRayExit = position + transmissionRay; 2533 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2534 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2535 refractionCoords += 1.0; 2536 refractionCoords /= 2.0; 2537 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2538 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2539 #endif 2540 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2541 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2542 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2543 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2544 } 2545#endif`,Oq=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2546 varying vec2 vUv; 2547#endif 2548#ifdef USE_MAP 2549 varying vec2 vMapUv; 2550#endif 2551#ifdef USE_ALPHAMAP
2552 varying vec2 vAlphaMapUv; 2553#endif 2554#ifdef USE_LIGHTMAP 2555 varying vec2 vLightMapUv; 2556#endif 2557#ifdef USE_AOMAP 2558 varying vec2 vAoMapUv; 2559#endif 2560#ifdef USE_BUMPMAP 2561 varying vec2 vBumpMapUv; 2562#endif 2563#ifdef USE_NORMALMAP 2564 varying vec2 vNormalMapUv; 2565#endif 2566#ifdef USE_EMISSIVEMAP 2567 varying vec2 vEmissiveMapUv; 2568#endif 2569#ifdef USE_METALNESSMAP 2570 varying vec2 vMetalnessMapUv; 2571#endif 2572#ifdef USE_ROUGHNESSMAP 2573 varying vec2 vRoughnessMapUv; 2574#endif 2575#ifdef USE_ANISOTROPYMAP 2576 varying vec2 vAnisotropyMapUv; 2577#endif 2578#ifdef USE_CLEARCOATMAP 2579 varying vec2 vClearcoatMapUv; 2580#endif 2581#ifdef USE_CLEARCOAT_NORMALMAP 2582 varying vec2 vClearcoatNormalMapUv; 2583#endif 2584#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2585 varying vec2 vClearcoatRoughnessMapUv; 2586#endif 2587#ifdef USE_IRIDESCENCEMAP 2588 varying vec2 vIridescenceMapUv; 2589#endif 2590#ifdef USE_IRIDESCENCE_THICKNESSMAP 2591 varying vec2 vIridescenceThicknessMapUv; 2592#endif 2593#ifdef USE_SHEEN_COLORMAP 2594 varying vec2 vSheenColorMapUv; 2595#endif 2596#ifdef USE_SHEEN_ROUGHNESSMAP 2597 varying vec2 vSheenRoughnessMapUv; 2598#endif 2599#ifdef USE_SPECULARMAP 2600 varying vec2 vSpecularMapUv; 2601#endif 2602#ifdef USE_SPECULAR_COLORMAP 2603 varying vec2 vSpecularColorMapUv; 2604#endif 2605#ifdef USE_SPECULAR_INTENSITYMAP 2606 varying vec2 vSpecularIntensityMapUv; 2607#endif 2608#ifdef USE_TRANSMISSIONMAP 2609 uniform mat3 transmissionMapTransform; 2610 varying vec2 vTransmissionMapUv; 2611#endif 2612#ifdef USE_THICKNESSMAP 2613 uniform mat3 thicknessMapTransform; 2614 varying vec2 vThicknessMapUv; 2615#endif`,Uq=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2616 varying vec2 vUv; 2617#endif 2618#ifdef USE_MAP 2619 uniform mat3 mapTransform; 2620 varying vec2 vMapUv; 2621#endif 2622#ifdef USE_ALPHAMAP 2623 uniform mat3 alphaMapTransform; 2624 varying vec2 vAlphaMapUv; 2625#endif 2626#ifdef USE_LIGHTMAP 2627 uniform mat3 lightMapTransform; 2628 varying vec2 vLightMapUv; 2629#endif 2630#ifdef USE_AOMAP 2631 uniform mat3 aoMapTransform; 2632 varying vec2 vAoMapUv; 2633#endif 2634#ifdef USE_BUMPMAP 2635 uniform mat3 bumpMapTransform; 2636 varying vec2 vBumpMapUv; 2637#endif 2638#ifdef USE_NORMALMAP 2639 uniform mat3 normalMapTransform; 2640 varying vec2 vNormalMapUv; 2641#endif 2642#ifdef USE_DISPLACEMENTMAP 2643 uniform mat3 displacementMapTransform; 2644 varying vec2 vDisplacementMapUv; 2645#endif 2646#ifdef USE_EMISSIVEMAP 2647 uniform mat3 emissiveMapTransform; 2648 varying vec2 vEmissiveMapUv; 2649#endif 2650#ifdef USE_METALNESSMAP 2651 uniform mat3 metalnessMapTransform; 2652 varying vec2 vMetalnessMapUv; 2653#endif 2654#ifdef USE_ROUGHNESSMAP 2655 uniform mat3 roughnessMapTransform; 2656 varying vec2 vRoughnessMapUv; 2657#endif 2658#ifdef USE_ANISOTROPYMAP 2659 uniform mat3 anisotropyMapTransform; 2660 varying vec2 vAnisotropyMapUv; 2661#endif 2662#ifdef USE_CLEARCOATMAP 2663 uniform mat3 clearcoatMapTransform; 2664 varying vec2 vClearcoatMapUv; 2665#endif 2666#ifdef USE_CLEARCOAT_NORMALMAP 2667 uniform mat3 clearcoatNormalMapTransform; 2668 varying vec2 vClearcoatNormalMapUv; 2669#endif 2670#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2671 uniform mat3 clearcoatRoughnessMapTransform; 2672 varying vec2 vClearcoatRoughnessMapUv; 2673#endif 2674#ifdef USE_SHEEN_COLORMAP 2675 uniform mat3 sheenColorMapTransform; 2676 varying vec2 vSheenColorMapUv; 2677#endif 2678#ifdef USE_SHEEN_ROUGHNESSMAP 2679 uniform mat3 sheenRoughnessMapTransform; 2680 varying vec2 vSheenRoughnessMapUv; 2681#endif 2682#ifdef USE_IRIDESCENCEMAP 2683 uniform mat3 iridescenceMapTransform; 2684 varying vec2 vIridescenceMapUv; 2685#endif 2686#ifdef USE_IRIDESCENCE_THICKNESSMAP 2687 uniform mat3 iridescenceThicknessMapTransform; 2688 varying vec2 vIridescenceThicknessMapUv; 2689#endif 2690#ifdef USE_SPECULARMAP 2691 uniform mat3 specularMapTransform; 2692 varying vec2 vSpecularMapUv; 2693#endif 2694#ifdef USE_SPECULAR_COLORMAP 2695 uniform mat3 specularColorMapTransform; 2696 varying vec2 vSpecularColorMapUv; 2697#endif 2698#ifdef USE_SPECULAR_INTENSITYMAP 2699 uniform mat3 specularIntensityMapTransform; 2700 varying vec2 vSpecularIntensityMapUv; 2701#endif 2702#ifdef USE_TRANSMISSIONMAP 2703 uniform mat3 transmissionMapTransform; 2704 varying vec2 vTransmissionMapUv; 2705#endif 2706#ifdef USE_THICKNESSMAP 2707 uniform mat3 thicknessMapTransform; 2708 varying vec2 vThicknessMapUv; 2709#endif`,Bq=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2710 vUv = vec3( uv, 1 ).xy; 2711#endif 2712#ifdef USE_MAP 2713 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2714#endif 2715#ifdef USE_ALPHAMAP 2716 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2717#endif 2718#ifdef USE_LIGHTMAP 2719 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2720#endif 2721#ifdef USE_AOMAP 2722 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2723#endif 2724#ifdef USE_BUMPMAP 2725 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2726#endif 2727#ifdef USE_NORMALMAP 2728 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2729#endif 2730#ifdef USE_DISPLACEMENTMAP 2731 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2732#endif 2733#ifdef USE_EMISSIVEMAP 2734 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2735#endif 2736#ifdef USE_METALNESSMAP 2737 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2738#endif 2739#ifdef USE_ROUGHNESSMAP 2740 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2741#endif 2742#ifdef USE_ANISOTROPYMAP 2743 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2744#endif 2745#ifdef USE_CLEARCOATMAP 2746 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2747#endif 2748#ifdef USE_CLEARCOAT_NORMALMAP 2749 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2750#endif 2751#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2752 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2753#endif
2754#ifdef USE_IRIDESCENCEMAP 2755 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2756#endif 2757#ifdef USE_IRIDESCENCE_THICKNESSMAP 2758 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2759#endif 2760#ifdef USE_SHEEN_COLORMAP 2761 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2762#endif 2763#ifdef USE_SHEEN_ROUGHNESSMAP 2764 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2765#endif 2766#ifdef USE_SPECULARMAP 2767 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2768#endif 2769#ifdef USE_SPECULAR_COLORMAP 2770 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2771#endif 2772#ifdef USE_SPECULAR_INTENSITYMAP 2773 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2774#endif 2775#ifdef USE_TRANSMISSIONMAP 2776 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2777#endif 2778#ifdef USE_THICKNESSMAP 2779 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2780#endif`,zq=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2781 vec4 worldPosition = vec4( transformed, 1.0 ); 2782 #ifdef USE_BATCHING 2783 worldPosition = batchingMatrix * worldPosition; 2784 #endif 2785 #ifdef USE_INSTANCING 2786 worldPosition = instanceMatrix * worldPosition; 2787 #endif 2788 worldPosition = modelMatrix * worldPosition; 2789#endif`;const Vq=`varying vec2 vUv; 2790uniform mat3 uvTransform; 2791void main() { 2792 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2793 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2794}`,Hq=`uniform sampler2D t2D; 2795uniform float backgroundIntensity; 2796varying vec2 vUv; 2797void main() { 2798 vec4 texColor = texture2D( t2D, vUv ); 2799 #ifdef DECODE_VIDEO_TEXTURE 2800 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 ); 2801 #endif 2802 texColor.rgb *= backgroundIntensity; 2803 gl_FragColor = texColor; 2804 #include <tonemapping_fragment> 2805 #include <colorspace_fragment> 2806}`,Wq=`varying vec3 vWorldDirection; 2807#include <common> 2808void main() { 2809 vWorldDirection = transformDirection( position, modelMatrix ); 2810 #include <begin_vertex> 2811 #include <project_vertex> 2812 gl_Position.z = gl_Position.w; 2813}`,Gq=`#ifdef ENVMAP_TYPE_CUBE 2814 uniform samplerCube envMap; 2815#elif defined( ENVMAP_TYPE_CUBE_UV ) 2816 uniform sampler2D envMap; 2817#endif 2818uniform float flipEnvMap; 2819uniform float backgroundBlurriness; 2820uniform float backgroundIntensity; 2821uniform mat3 backgroundRotation; 2822varying vec3 vWorldDirection; 2823#include <cube_uv_reflection_fragment> 2824void main() { 2825 #ifdef ENVMAP_TYPE_CUBE 2826 vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 2827 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2828 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2829 #else 2830 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2831 #endif 2832 texColor.rgb *= backgroundIntensity; 2833 gl_FragColor = texColor; 2834 #include <tonemapping_fragment> 2835 #include <colorspace_fragment> 2836}`,$q=`varying vec3 vWorldDirection; 2837#include <common> 2838void main() { 2839 vWorldDirection = transformDirection( position, modelMatrix ); 2840 #include <begin_vertex> 2841 #include <project_vertex> 2842 gl_Position.z = gl_Position.w; 2843}`,Xq=`uniform samplerCube tCube; 2844uniform float tFlip; 2845uniform float opacity; 2846varying vec3 vWorldDirection; 2847void main() { 2848 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2849 gl_FragColor = texColor; 2850 gl_FragColor.a *= opacity; 2851 #include <tonemapping_fragment> 2852 #include <colorspace_fragment> 2853}`,qq=`#include <common> 2854#include <batching_pars_vertex> 2855#include <uv_pars_vertex> 2856#include <displacementmap_pars_vertex> 2857#include <morphtarget_pars_vertex> 2858#include <skinning_pars_vertex> 2859#include <logdepthbuf_pars_vertex> 2860#include <clipping_planes_pars_vertex> 2861varying vec2 vHighPrecisionZW; 2862void main() { 2863 #include <uv_vertex> 2864 #include <batching_vertex> 2865 #include <skinbase_vertex> 2866 #include <morphinstance_vertex> 2867 #ifdef USE_DISPLACEMENTMAP 2868 #include <beginnormal_vertex> 2869 #include <morphnormal_vertex> 2870 #include <skinnormal_vertex> 2871 #endif 2872 #include <begin_vertex> 2873 #include <morphtarget_vertex> 2874 #include <skinning_vertex> 2875 #include <displacementmap_vertex> 2876 #include <project_vertex> 2877 #include <logdepthbuf_vertex> 2878 #include <clipping_planes_vertex> 2879 vHighPrecisionZW = gl_Position.zw; 2880}`,Yq=`#if DEPTH_PACKING == 3200 2881 uniform float opacity; 2882#endif 2883#include <common> 2884#include <packing> 2885#include <uv_pars_fragment> 2886#include <map_pars_fragment> 2887#include <alphamap_pars_fragment> 2888#include <alphatest_pars_fragment> 2889#include <alphahash_pars_fragment> 2890#include <logdepthbuf_pars_fragment> 2891#include <clipping_planes_pars_fragment> 2892varying vec2 vHighPrecisionZW; 2893void main() { 2894 vec4 diffuseColor = vec4( 1.0 ); 2895 #include <clipping_planes_fragment> 2896 #if DEPTH_PACKING == 3200 2897 diffuseColor.a = opacity; 2898 #endif 2899 #include <map_fragment> 2900 #include <alphamap_fragment> 2901 #include <alphatest_fragment> 2902 #include <alphahash_fragment> 2903 #include <logdepthbuf_fragment> 2904 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 2905 #if DEPTH_PACKING == 3200 2906 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2907 #elif DEPTH_PACKING == 3201 2908 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2909 #elif DEPTH_PACKING == 3202 2910 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 2911 #elif DEPTH_PACKING == 3203 2912 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 2913 #endif 2914}`,Kq=`#define DISTANCE 2915varying vec3 vWorldPosition; 2916#include <common> 2917#include <batching_pars_vertex> 2918#include <uv_pars_vertex> 2919#include <displacementmap_pars_vertex> 2920#include <morphtarget_pars_vertex> 2921#include <skinning_pars_vertex> 2922#include <clipping_planes_pars_vertex> 2923void main() { 2924 #include <uv_vertex> 2925 #include <batching_vertex> 2926 #include <skinbase_vertex> 2927 #include <morphinstance_vertex> 2928 #ifdef USE_DISPLACEMENTMAP 2929 #include <beginnormal_vertex> 2930 #include <morphnormal_vertex> 2931 #include <skinnormal_vertex> 2932 #endif 2933 #include <begin_vertex> 2934 #include <morphtarget_vertex> 2935 #include <skinning_vertex> 2936 #include <displacementmap_vertex> 2937 #include <project_vertex> 2938 #include <worldpos_vertex> 2939 #include <clipping_planes_vertex> 2940 vWorldPosition = worldPosition.xyz; 2941}`,Zq=`#define DISTANCE 2942uniform vec3 referencePosition; 2943uniform float nearDistance; 2944uniform float farDistance; 2945varying vec3 vWorldPosition; 2946#include <common> 2947#include <packing> 2948#include <uv_pars_fragment> 2949#include <map_pars_fragment> 2950#include <alphamap_pars_fragment> 2951#include <alphatest_pars_fragment> 2952#include <alphahash_pars_fragment> 2953#include <clipping_planes_pars_fragment> 2954void main () { 2955 vec4 diffuseColor = vec4( 1.0 ); 2956 #include <clipping_planes_fragment> 2957 #include <map_fragment> 2958 #include <alphamap_fragment> 2959 #include <alphatest_fragment> 2960 #include <alphahash_fragment> 2961 float dist = length( vWorldPosition - referencePosition ); 2962 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2963 dist = saturate( dist ); 2964 gl_FragColor = packDepthToRGBA( dist ); 2965}`,Qq=`varying vec3 vWorldDirection; 2966#include <common> 2967void main() { 2968 vWorldDirection = transformDirection( position, modelMatrix ); 2969 #include <begin_vertex> 2970 #include <project_vertex> 2971}`,Jq=`uniform sampler2D tEquirect; 2972varying vec3 vWorldDirection; 2973#include <common> 2974void main() { 2975 vec3 direction = normalize( vWorldDirection ); 2976 vec2 sampleUV = equirectUv( direction ); 2977 gl_FragColor = texture2D( tEquirect, sampleUV ); 2978 #include <tonemapping_fragment> 2979 #include <colorspace_fragment> 2980}`,eY=`uniform float scale; 2981attribute float lineDistance; 2982varying float vLineDistance; 2983#include <common> 2984#include <uv_pars_vertex> 2985#include <color_pars_vertex> 2986#include <fog_pars_vertex> 2987#include <morphtarget_pars_vertex> 2988#include <logdepthbuf_pars_vertex> 2989#include <clipping_planes_pars_vertex> 2990void main() { 2991 vLineDistance = scale * lineDistance; 2992 #include <uv_vertex> 2993 #include <color_vertex> 2994 #include <morphinstance_vertex> 2995 #include <morphcolor_vertex> 2996 #include <begin_vertex> 2997 #include <morphtarget_vertex> 2998 #include <project_vertex> 2999 #include <logdepthbuf_vertex> 3000 #include <clipping_planes_vertex> 3001 #include <fog_vertex> 3002}`,tY=`uniform vec3 diffuse; 3003uniform float opacity; 3004uniform float dashSize; 3005uniform float totalSize; 3006varying float vLineDistance; 3007#include <common> 3008#include <color_pars_fragment> 3009#include <uv_pars_fragment> 3010#include <map_pars_fragment> 3011#include <fog_pars_fragment> 3012#include <logdepthbuf_pars_fragment> 3013#include <clipping_planes_pars_fragment> 3014void main() { 3015 vec4 diffuseColor = vec4( diffuse, opacity ); 3016 #include <clipping_planes_fragment> 3017 if ( mod( vLineDistance, totalSize ) > dashSize ) { 3018 discard; 3019 } 3020 vec3 outgoingLight = vec3( 0.0 ); 3021 #include <logdepthbuf_fragment> 3022 #include <map_fragment> 3023 #include <color_fragment> 3024 outgoingLight = diffuseColor.rgb; 3025 #include <opaque_fragment> 3026 #include <tonemapping_fragment> 3027 #include <colorspace_fragment> 3028 #include <fog_fragment> 3029 #include <premultiplied_alpha_fragment> 3030}`,nY=`#include <common> 3031#include <batching_pars_vertex> 3032#include <uv_pars_vertex> 3033#include <envmap_pars_vertex> 3034#include <color_pars_vertex> 3035#include <fog_pars_vertex> 3036#include <morphtarget_pars_vertex> 3037#include <skinning_pars_vertex> 3038#include <logdepthbuf_pars_vertex> 3039#include <clipping_planes_pars_vertex> 3040void main() { 3041 #include <uv_vertex> 3042 #include <color_vertex> 3043 #include <morphinstance_vertex> 3044 #include <morphcolor_vertex> 3045 #include <batching_vertex> 3046 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 3047 #include <beginnormal_vertex> 3048 #include <morphnormal_vertex> 3049 #include <skinbase_vertex> 3050 #include <skinnormal_vertex> 3051 #include <defaultnormal_vertex> 3052 #endif 3053 #include <begin_vertex> 3054 #include <morphtarget_vertex> 3055 #include <skinning_vertex> 3056 #include <project_vertex> 3057 #include <logdepthbuf_vertex> 3058 #include <clipping_planes_vertex> 3059 #include <worldpos_vertex> 3060 #include <envmap_vertex> 3061 #include <fog_vertex> 3062}`,rY=`uniform vec3 diffuse; 3063uniform float opacity; 3064#ifndef FLAT_SHADED 3065 varying vec3 vNormal; 3066#endif 3067#include <common> 3068#include <dithering_pars_fragment> 3069#include <color_pars_fragment> 3070#include <uv_pars_fragment> 3071#include <map_pars_fragment> 3072#include <alphamap_pars_fragment> 3073#include <alphatest_pars_fragment> 3074#include <alphahash_pars_fragment> 3075#include <aomap_pars_fragment> 3076#include <lightmap_pars_fragment> 3077#include <envmap_common_pars_fragment> 3078#include <envmap_pars_fragment> 3079#include <fog_pars_fragment> 3080#include <specularmap_pars_fragment> 3081#include <logdepthbuf_pars_fragment> 3082#include <clipping_planes_pars_fragment> 3083void main() { 3084 vec4 diffuseColor = vec4( diffuse, opacity ); 3085 #include <clipping_planes_fragment> 3086 #include <logdepthbuf_fragment> 3087 #include <map_fragment> 3088 #include <color_fragment> 3089 #include <alphamap_fragment> 3090 #include <alphatest_fragment> 3091 #include <alphahash_fragment> 3092 #include <specularmap_fragment> 3093 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3094 #ifdef USE_LIGHTMAP 3095 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 3096 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 3097 #else 3098 reflectedLight.indirectDiffuse += vec3( 1.0 ); 3099 #endif 3100 #include <aomap_fragment> 3101 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 3102 vec3 outgoingLight = reflectedLight.indirectDiffuse; 3103 #include <envmap_fragment> 3104 #include <opaque_fragment> 3105 #include <tonemapping_fragment> 3106 #include <colorspace_fragment> 3107 #include <fog_fragment> 3108 #include <premultiplied_alpha_fragment> 3109 #include <dithering_fragment> 3110}`,iY=`#define LAMBERT 3111varying vec3 vViewPosition; 3112#include <common> 3113#include <batching_pars_vertex> 3114#include <uv_pars_vertex> 3115#include <displacementmap_pars_vertex> 3116#include <envmap_pars_vertex> 3117#include <color_pars_vertex> 3118#include <fog_pars_vertex> 3119#include <normal_pars_vertex> 3120#include <morphtarget_pars_vertex> 3121#include <skinning_pars_vertex> 3122#include <shadowmap_pars_vertex> 3123#include <logdepthbuf_pars_vertex> 3124#include <clipping_planes_pars_vertex> 3125void main() { 3126 #include <uv_vertex> 3127 #include <color_vertex> 3128 #include <morphinstance_vertex> 3129 #include <morphcolor_vertex> 3130 #include <batching_vertex> 3131 #include <beginnormal_vertex> 3132 #include <morphnormal_vertex> 3133 #include <skinbase_vertex> 3134 #include <skinnormal_vertex> 3135 #include <defaultnormal_vertex> 3136 #include <normal_vertex> 3137 #include <begin_vertex> 3138 #include <morphtarget_vertex> 3139 #include <skinning_vertex> 3140 #include <displacementmap_vertex> 3141 #include <project_vertex> 3142 #include <logdepthbuf_vertex> 3143 #include <clipping_planes_vertex> 3144 vViewPosition = - mvPosition.xyz; 3145 #include <worldpos_vertex> 3146 #include <envmap_vertex> 3147 #include <shadowmap_vertex> 3148 #include <fog_vertex> 3149}`,sY=`#define LAMBERT 3150uniform vec3 diffuse; 3151uniform vec3 emissive; 3152uniform float opacity; 3153#include <common> 3154#include <packing> 3155#include <dithering_pars_fragment> 3156#include <color_pars_fragment> 3157#include <uv_pars_fragment> 3158#include <map_pars_fragment> 3159#include <alphamap_pars_fragment> 3160#include <alphatest_pars_fragment> 3161#include <alphahash_pars_fragment> 3162#include <aomap_pars_fragment> 3163#include <lightmap_pars_fragment> 3164#include <emissivemap_pars_fragment> 3165#include <envmap_common_pars_fragment> 3166#include <envmap_pars_fragment> 3167#include <fog_pars_fragment> 3168#include <bsdfs> 3169#include <lights_pars_begin> 3170#include <normal_pars_fragment> 3171#include <lights_lambert_pars_fragment> 3172#include <shadowmap_pars_fragment> 3173#include <bumpmap_pars_fragment> 3174#include <normalmap_pars_fragment> 3175#include <specularmap_pars_fragment> 3176#include <logdepthbuf_pars_fragment> 3177#include <clipping_planes_pars_fragment> 3178void main() { 3179 vec4 diffuseColor = vec4( diffuse, opacity ); 3180 #include <clipping_planes_fragment> 3181 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3182 vec3 totalEmissiveRadiance = emissive; 3183 #include <logdepthbuf_fragment> 3184 #include <map_fragment> 3185 #include <color_fragment> 3186 #include <alphamap_fragment> 3187 #include <alphatest_fragment> 3188 #include <alphahash_fragment> 3189 #include <specularmap_fragment> 3190 #include <normal_fragment_begin> 3191 #include <normal_fragment_maps> 3192 #include <emissivemap_fragment> 3193 #include <lights_lambert_fragment> 3194 #include <lights_fragment_begin> 3195 #include <lights_fragment_maps> 3196 #include <lights_fragment_end> 3197 #include <aomap_fragment> 3198 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3199 #include <envmap_fragment> 3200 #include <opaque_fragment> 3201 #include <tonemapping_fragment> 3202 #include <colorspace_fragment> 3203 #include <fog_fragment> 3204 #include <premultiplied_alpha_fragment> 3205 #include <dithering_fragment> 3206}`,oY=`#define MATCAP 3207varying vec3 vViewPosition; 3208#include <common> 3209#include <batching_pars_vertex> 3210#include <uv_pars_vertex> 3211#include <color_pars_vertex> 3212#include <displacementmap_pars_vertex> 3213#include <fog_pars_vertex> 3214#include <normal_pars_vertex> 3215#include <morphtarget_pars_vertex> 3216#include <skinning_pars_vertex> 3217#include <logdepthbuf_pars_vertex> 3218#include <clipping_planes_pars_vertex> 3219void main() { 3220 #include <uv_vertex> 3221 #include <color_vertex> 3222 #include <morphinstance_vertex> 3223 #include <morphcolor_vertex> 3224 #include <batching_vertex> 3225 #include <beginnormal_vertex> 3226 #include <morphnormal_vertex> 3227 #include <skinbase_vertex> 3228 #include <skinnormal_vertex> 3229 #include <defaultnormal_vertex> 3230 #include <normal_vertex> 3231 #include <begin_vertex> 3232 #include <morphtarget_vertex> 3233 #include <skinning_vertex> 3234 #include <displacementmap_vertex> 3235 #include <project_vertex> 3236 #include <logdepthbuf_vertex> 3237 #include <clipping_planes_vertex> 3238 #include <fog_vertex> 3239 vViewPosition = - mvPosition.xyz; 3240}`,aY=`#define MATCAP 3241uniform vec3 diffuse; 3242uniform float opacity; 3243uniform sampler2D matcap; 3244varying vec3 vViewPosition; 3245#include <common> 3246#include <dithering_pars_fragment> 3247#include <color_pars_fragment> 3248#include <uv_pars_fragment> 3249#include <map_pars_fragment> 3250#include <alphamap_pars_fragment> 3251#include <alphatest_pars_fragment> 3252#include <alphahash_pars_fragment> 3253#include <fog_pars_fragment> 3254#include <normal_pars_fragment> 3255#include <bumpmap_pars_fragment> 3256#include <normalmap_pars_fragment> 3257#include <logdepthbuf_pars_fragment> 3258#include <clipping_planes_pars_fragment> 3259void main() { 3260 ve
3260c4 diffuseColor = vec4( diffuse, opacity ); 3261 #include <clipping_planes_fragment> 3262 #include <logdepthbuf_fragment> 3263 #include <map_fragment> 3264 #include <color_fragment> 3265 #include <alphamap_fragment> 3266 #include <alphatest_fragment> 3267 #include <alphahash_fragment> 3268 #include <normal_fragment_begin> 3269 #include <normal_fragment_maps> 3270 vec3 viewDir = normalize( vViewPosition ); 3271 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3272 vec3 y = cross( viewDir, x ); 3273 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3274 #ifdef USE_MATCAP 3275 vec4 matcapColor = texture2D( matcap, uv ); 3276 #else 3277 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3278 #endif 3279 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3280 #include <opaque_fragment> 3281 #include <tonemapping_fragment> 3282 #include <colorspace_fragment> 3283 #include <fog_fragment> 3284 #include <premultiplied_alpha_fragment> 3285 #include <dithering_fragment> 3286}`,lY=`#define NORMAL 3287#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3288 varying vec3 vViewPosition; 3289#endif 3290#include <common> 3291#include <batching_pars_vertex> 3292#include <uv_pars_vertex> 3293#include <displacementmap_pars_vertex> 3294#include <normal_pars_vertex> 3295#include <morphtarget_pars_vertex> 3296#include <skinning_pars_vertex> 3297#include <logdepthbuf_pars_vertex> 3298#include <clipping_planes_pars_vertex> 3299void main() { 3300 #include <uv_vertex> 3301 #include <batching_vertex> 3302 #include <beginnormal_vertex> 3303 #include <morphinstance_vertex> 3304 #include <morphnormal_vertex> 3305 #include <skinbase_vertex> 3306 #include <skinnormal_vertex> 3307 #include <defaultnormal_vertex> 3308 #include <normal_vertex> 3309 #include <begin_vertex> 3310 #include <morphtarget_vertex> 3311 #include <skinning_vertex> 3312 #include <displacementmap_vertex> 3313 #include <project_vertex> 3314 #include <logdepthbuf_vertex> 3315 #include <clipping_planes_vertex> 3316#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3317 vViewPosition = - mvPosition.xyz; 3318#endif 3319}`,cY=`#define NORMAL 3320uniform float opacity; 3321#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3322 varying vec3 vViewPosition; 3323#endif 3324#include <packing> 3325#include <uv_pars_fragment> 3326#include <normal_pars_fragment> 3327#include <bumpmap_pars_fragment> 3328#include <normalmap_pars_fragment> 3329#include <logdepthbuf_pars_fragment> 3330#include <clipping_planes_pars_fragment> 3331void main() { 3332 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3333 #include <clipping_planes_fragment> 3334 #include <logdepthbuf_fragment> 3335 #include <normal_fragment_begin> 3336 #include <normal_fragment_maps> 3337 gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); 3338 #ifdef OPAQUE 3339 gl_FragColor.a = 1.0; 3340 #endif 3341}`,uY=`#define PHONG 3342varying vec3 vViewPosition; 3343#include <common> 3344#include <batching_pars_vertex> 3345#include <uv_pars_vertex> 3346#include <displacementmap_pars_vertex> 3347#include <envmap_pars_vertex> 3348#include <color_pars_vertex> 3349#include <fog_pars_vertex> 3350#include <normal_pars_vertex> 3351#include <morphtarget_pars_vertex> 3352#include <skinning_pars_vertex> 3353#include <shadowmap_pars_vertex> 3354#include <logdepthbuf_pars_vertex> 3355#include <clipping_planes_pars_vertex> 3356void main() { 3357 #include <uv_vertex> 3358 #include <color_vertex> 3359 #include <morphcolor_vertex> 3360 #include <batching_vertex> 3361 #include <beginnormal_vertex> 3362 #include <morphinstance_vertex> 3363 #include <morphnormal_vertex> 3364 #include <skinbase_vertex> 3365 #include <skinnormal_vertex> 3366 #include <defaultnormal_vertex> 3367 #include <normal_vertex> 3368 #include <begin_vertex> 3369 #include <morphtarget_vertex> 3370 #include <skinning_vertex> 3371 #include <displacementmap_vertex> 3372 #include <project_vertex> 3373 #include <logdepthbuf_vertex> 3374 #include <clipping_planes_vertex> 3375 vViewPosition = - mvPosition.xyz; 3376 #include <worldpos_vertex> 3377 #include <envmap_vertex> 3378 #include <shadowmap_vertex> 3379 #include <fog_vertex> 3380}`,dY=`#define PHONG 3381uniform vec3 diffuse; 3382uniform vec3 emissive; 3383uniform vec3 specular; 3384uniform float shininess; 3385uniform float opacity; 3386#include <common> 3387#include <packing> 3388#include <dithering_pars_fragment> 3389#include <color_pars_fragment> 3390#include <uv_pars_fragment> 3391#include <map_pars_fragment> 3392#include <alphamap_pars_fragment> 3393#include <alphatest_pars_fragment> 3394#include <alphahash_pars_fragment> 3395#include <aomap_pars_fragment> 3396#include <lightmap_pars_fragment> 3397#include <emissivemap_pars_fragment> 3398#include <envmap_common_pars_fragment> 3399#include <envmap_pars_fragment> 3400#include <fog_pars_fragment> 3401#include <bsdfs> 3402#include <lights_pars_begin> 3403#include <normal_pars_fragment> 3404#include <lights_phong_pars_fragment> 3405#include <shadowmap_pars_fragment> 3406#include <bumpmap_pars_fragment> 3407#include <normalmap_pars_fragment> 3408#include <specularmap_pars_fragment> 3409#include <logdepthbuf_pars_fragment> 3410#include <clipping_planes_pars_fragment> 3411void main() { 3412 vec4 diffuseColor = vec4( diffuse, opacity ); 3413 #include <clipping_planes_fragment> 3414 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3415 vec3 totalEmissiveRadiance = emissive; 3416 #include <logdepthbuf_fragment> 3417 #include <map_fragment> 3418 #include <color_fragment> 3419 #include <alphamap_fragment> 3420 #include <alphatest_fragment> 3421 #include <alphahash_fragment> 3422 #include <specularmap_fragment> 3423 #include <normal_fragment_begin> 3424 #include <normal_fragment_maps> 3425 #include <emissivemap_fragment> 3426 #include <lights_phong_fragment> 3427 #include <lights_fragment_begin> 3428 #include <lights_fragment_maps> 3429 #include <lights_fragment_end> 3430 #include <aomap_fragment> 3431 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3432 #include <envmap_fragment> 3433 #include <opaque_fragment> 3434 #include <tonemapping_fragment> 3435 #include <colorspace_fragment> 3436 #include <fog_fragment> 3437 #include <premultiplied_alpha_fragment> 3438 #include <dithering_fragment> 3439}`,hY=`#define STANDARD 3440varying vec3 vViewPosition; 3441#ifdef USE_TRANSMISSION 3442 varying vec3 vWorldPosition; 3443#endif 3444#include <common> 3445#include <batching_pars_vertex> 3446#include <uv_pars_vertex> 3447#include <displacementmap_pars_vertex> 3448#include <color_pars_vertex> 3449#include <fog_pars_vertex> 3450#include <normal_pars_vertex> 3451#include <morphtarget_pars_vertex> 3452#include <skinning_pars_vertex> 3453#include <shadowmap_pars_vertex> 3454#include <logdepthbuf_pars_vertex> 3455#include <clipping_planes_pars_vertex> 3456void main() { 3457 #include <uv_vertex> 3458 #include <color_vertex> 3459 #include <morphinstance_vertex> 3460 #include <morphcolor_vertex> 3461 #include <batching_vertex> 3462 #include <beginnormal_vertex> 3463 #include <morphnormal_vertex> 3464 #include <skinbase_vertex> 3465 #include <skinnormal_vertex> 3466 #include <defaultnormal_vertex> 3467 #include <normal_vertex> 3468 #include <begin_vertex> 3469 #include <morphtarget_vertex> 3470 #include <skinning_vertex> 3471 #include <displacementmap_vertex> 3472 #include <project_vertex> 3473 #include <logdepthbuf_vertex> 3474 #include <clipping_planes_vertex> 3475 vViewPosition = - mvPosition.xyz; 3476 #include <worldpos_vertex> 3477 #include <shadowmap_vertex> 3478 #include <fog_vertex> 3479#ifdef USE_TRANSMISSION 3480 vWorldPosition = worldPosition.xyz; 3481#endif 3482}`,fY=`#define STANDARD 3483#ifdef PHYSICAL 3484 #define IOR 3485 #define USE_SPECULAR 3486#endif 3487uniform vec3 diffuse; 3488uniform vec3 emissive; 3489uniform float roughness; 3490uniform float metalness; 3491uniform float opacity; 3492#ifdef IOR 3493 uniform float ior; 3494#endif 3495#ifdef USE_SPECULAR 3496 uniform float specularIntensity; 3497 uniform vec3 specularColor; 3498 #ifdef USE_SPECULAR_COLORMAP 3499 uniform sampler2D specularColorMap; 3500 #endif 3501 #ifdef USE_SPECULAR_INTENSITYMAP 3502 uniform sampler2D specularIntensityMap; 3503 #endif 3504#endif 3505#ifdef USE_CLEARCOAT 3506 uniform float clearcoat; 3507 uniform float clearcoatRoughness; 3508#endif 3509#ifdef USE_DISPERSION 3510 uniform float dispersion; 3511#endif
3512#ifdef USE_IRIDESCENCE 3513 uniform float iridescence; 3514 uniform float iridescenceIOR; 3515 uniform float iridescenceThicknessMinimum; 3516 uniform float iridescenceThicknessMaximum; 3517#endif 3518#ifdef USE_SHEEN 3519 uniform vec3 sheenColor; 3520 uniform float sheenRoughness; 3521 #ifdef USE_SHEEN_COLORMAP 3522 uniform sampler2D sheenColorMap; 3523 #endif 3524 #ifdef USE_SHEEN_ROUGHNESSMAP 3525 uniform sampler2D sheenRoughnessMap; 3526 #endif 3527#endif 3528#ifdef USE_ANISOTROPY 3529 uniform vec2 anisotropyVector; 3530 #ifdef USE_ANISOTROPYMAP 3531 uniform sampler2D anisotropyMap; 3532 #endif 3533#endif 3534varying vec3 vViewPosition; 3535#include <common> 3536#include <packing> 3537#include <dithering_pars_fragment> 3538#include <color_pars_fragment> 3539#include <uv_pars_fragment> 3540#include <map_pars_fragment> 3541#include <alphamap_pars_fragment> 3542#include <alphatest_pars_fragment> 3543#include <alphahash_pars_fragment> 3544#include <aomap_pars_fragment> 3545#include <lightmap_pars_fragment> 3546#include <emissivemap_pars_fragment> 3547#include <iridescence_fragment> 3548#include <cube_uv_reflection_fragment> 3549#include <envmap_common_pars_fragment> 3550#include <envmap_physical_pars_fragment> 3551#include <fog_pars_fragment> 3552#include <lights_pars_begin> 3553#include <normal_pars_fragment> 3554#include <lights_physical_pars_fragment> 3555#include <transmission_pars_fragment> 3556#include <shadowmap_pars_fragment> 3557#include <bumpmap_pars_fragment> 3558#include <normalmap_pars_fragment> 3559#include <clearcoat_pars_fragment> 3560#include <iridescence_pars_fragment> 3561#include <roughnessmap_pars_fragment> 3562#include <metalnessmap_pars_fragment> 3563#include <logdepthbuf_pars_fragment> 3564#include <clipping_planes_pars_fragment> 3565void main() { 3566 vec4 diffuseColor = vec4( diffuse, opacity ); 3567 #include <clipping_planes_fragment> 3568 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3569 vec3 totalEmissiveRadiance = emissive; 3570 #include <logdepthbuf_fragment> 3571 #include <map_fragment> 3572 #include <color_fragment> 3573 #include <alphamap_fragment> 3574 #include <alphatest_fragment> 3575 #include <alphahash_fragment> 3576 #include <roughnessmap_fragment> 3577 #include <metalnessmap_fragment> 3578 #include <normal_fragment_begin> 3579 #include <normal_fragment_maps> 3580 #include <clearcoat_normal_fragment_begin> 3581 #include <clearcoat_normal_fragment_maps> 3582 #include <emissivemap_fragment> 3583 #include <lights_physical_fragment> 3584 #include <lights_fragment_begin> 3585 #include <lights_fragment_maps> 3586 #include <lights_fragment_end> 3587 #include <aomap_fragment> 3588 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3589 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3590 #include <transmission_fragment> 3591 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3592 #ifdef USE_SHEEN 3593 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 3594 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; 3595 #endif 3596 #ifdef USE_CLEARCOAT 3597 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3598 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3599 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3600 #endif 3601 #include <opaque_fragment> 3602 #include <tonemapping_fragment> 3603 #include <colorspace_fragment> 3604 #include <fog_fragment> 3605 #include <premultiplied_alpha_fragment> 3606 #include <dithering_fragment> 3607}`,pY=`#define TOON 3608varying vec3 vViewPosition; 3609#include <common> 3610#include <batching_pars_vertex> 3611#include <uv_pars_vertex> 3612#include <displacementmap_pars_vertex> 3613#include <color_pars_vertex> 3614#include <fog_pars_vertex> 3615#include <normal_pars_vertex> 3616#include <morphtarget_pars_vertex> 3617#include <skinning_pars_vertex> 3618#include <shadowmap_pars_vertex> 3619#include <logdepthbuf_pars_vertex> 3620#include <clipping_planes_pars_vertex> 3621void main() { 3622 #include <uv_vertex> 3623 #include <color_vertex> 3624 #include <morphinstance_vertex> 3625 #include <morphcolor_vertex> 3626 #include <batching_vertex> 3627 #include <beginnormal_vertex> 3628 #include <morphnormal_vertex> 3629 #include <skinbase_vertex> 3630 #include <skinnormal_vertex> 3631 #include <defaultnormal_vertex> 3632 #include <normal_vertex> 3633 #include <begin_vertex> 3634 #include <morphtarget_vertex> 3635 #include <skinning_vertex> 3636 #include <displacementmap_vertex> 3637 #include <project_vertex> 3638 #include <logdepthbuf_vertex> 3639 #include <clipping_planes_vertex> 3640 vViewPosition = - mvPosition.xyz; 3641 #include <worldpos_vertex> 3642 #include <shadowmap_vertex> 3643 #include <fog_vertex> 3644}`,mY=`#define TOON 3645uniform vec3 diffuse; 3646uniform vec3 emissive; 3647uniform float opacity; 3648#include <common> 3649#include <packing> 3650#include <dithering_pars_fragment> 3651#include <color_pars_fragment> 3652#include <uv_pars_fragment> 3653#include <map_pars_fragment> 3654#include <alphamap_pars_fragment> 3655#include <alphatest_pars_fragment> 3656#include <alphahash_pars_fragment> 3657#include <aomap_pars_fragment> 3658#include <lightmap_pars_fragment> 3659#include <emissivemap_pars_fragment> 3660#include <gradientmap_pars_fragment> 3661#include <fog_pars_fragment> 3662#include <bsdfs> 3663#include <lights_pars_begin> 3664#include <normal_pars_fragment> 3665#include <lights_toon_pars_fragment> 3666#include <shadowmap_pars_fragment> 3667#include <bumpmap_pars_fragment> 3668#include <normalmap_pars_fragment> 3669#include <logdepthbuf_pars_fragment> 3670#include <clipping_planes_pars_fragment> 3671void main() { 3672 vec4 diffuseColor = vec4( diffuse, opacity ); 3673 #include <clipping_planes_fragment> 3674 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3675 vec3 totalEmissiveRadiance = emissive; 3676 #include <logdepthbuf_fragment> 3677 #include <map_fragment> 3678 #include <color_fragment> 3679 #include <alphamap_fragment> 3680 #include <alphatest_fragment> 3681 #include <alphahash_fragment> 3682 #include <normal_fragment_begin> 3683 #include <normal_fragment_maps> 3684 #include <emissivemap_fragment> 3685 #include <lights_toon_fragment> 3686 #include <lights_fragment_begin> 3687 #include <lights_fragment_maps> 3688 #include <lights_fragment_end> 3689 #include <aomap_fragment> 3690 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3691 #include <opaque_fragment> 3692 #include <tonemapping_fragment> 3693 #include <colorspace_fragment> 3694 #include <fog_fragment> 3695 #include <premultiplied_alpha_fragment> 3696 #include <dithering_fragment> 3697}`,gY=`uniform float size; 3698uniform float scale; 3699#include <common> 3700#include <color_pars_vertex> 3701#include <fog_pars_vertex> 3702#include <morphtarget_pars_vertex> 3703#include <logdepthbuf_pars_vertex> 3704#include <clipping_planes_pars_vertex> 3705#ifdef USE_POINTS_UV 3706 varying vec2 vUv; 3707 uniform mat3 uvTransform; 3708#endif 3709void main() { 3710 #ifdef USE_POINTS_UV 3711 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3712 #endif 3713 #include <color_vertex> 3714 #include <morphinstance_vertex> 3715 #include <morphcolor_vertex> 3716 #include <begin_vertex> 3717 #include <morphtarget_vertex> 3718 #include <project_vertex> 3719 gl_PointSize = size; 3720 #ifdef USE_SIZEATTENUATION 3721 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3722 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3723 #endif 3724 #include <logdepthbuf_vertex> 3725 #include <clipping_planes_vertex> 3726 #include <worldpos_vertex> 3727 #include <fog_vertex> 3728}`,xY=`uniform vec3 diffuse; 3729uniform float opacity; 3730#include <common> 3731#include <color_pars_fragment> 3732#include <map_particle_pars_fragment> 3733#include <alphatest_pars_fragment> 3734#include <alphahash_pars_fragment> 3735#include <fog_pars_fragment> 3736#include <logdepthbuf_pars_fragment> 3737#include <clipping_planes_pars_fragment> 3738void main() { 3739 vec4 diffuseColor = vec4( diffuse, opacity ); 3740 #include <clipping_planes_fragment> 3741 vec3 outgoingLight = vec3( 0.0 ); 3742 #include <logdepthbuf_fragment> 3743 #include <map_particle_fragment> 3744 #include <color_fragment> 3745 #include <alphatest_fragment> 3746 #include <alphahash_fragment> 3747 outgoingLight = diffuseColor.rgb; 3748 #include <opaque_fragment> 3749 #include <tonemapping_fragment> 3750 #include <colorspace_fragment> 3751 #include <fog_fragment> 3752 #include <premultiplied_alpha_fragment> 3753}`,vY=`#include <common> 3754#include <batching_pars_vertex> 3755#include <fog_pars_vertex> 3756#include <morphtarget_pars_vertex> 3757#include <skinning_pars_vertex> 3758#include <logdepthbuf_pars_vertex> 3759#include <shadowmap_pars_vertex> 3760void main() { 3761 #include <batching_vertex> 3762 #include <beginnormal_vertex> 3763 #include <morphinstance_vertex> 3764 #include <morphnormal_vertex> 3765 #include <skinbase_vertex> 3766 #include <skinnormal_vertex> 3767 #include <defaultnormal_vertex> 3768 #include <begin_vertex> 3769 #include <morphtarget_vertex> 3770 #include <skinning_vertex> 3771 #include <project_vertex> 3772 #include <logdepthbuf_vertex> 3773 #include <worldpos_vertex> 3774 #include <shadowmap_vertex> 3775 #include <fog_vertex> 3776}
3776`,yY=`uniform vec3 color; 3777uniform float opacity; 3778#include <common> 3779#include <packing> 3780#include <fog_pars_fragment> 3781#include <bsdfs> 3782#include <lights_pars_begin> 3783#include <logdepthbuf_pars_fragment> 3784#include <shadowmap_pars_fragment> 3785#include <shadowmask_pars_fragment> 3786void main() { 3787 #include <logdepthbuf_fragment> 3788 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3789 #include <tonemapping_fragment> 3790 #include <colorspace_fragment> 3791 #include <fog_fragment> 3792}`,_Y=`uniform float rotation; 3793uniform vec2 center; 3794#include <common> 3795#include <uv_pars_vertex> 3796#include <fog_pars_vertex> 3797#include <logdepthbuf_pars_vertex> 3798#include <clipping_planes_pars_vertex> 3799void main() { 3800 #include <uv_vertex> 3801 vec4 mvPosition = modelViewMatrix[ 3 ]; 3802 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3803 #ifndef USE_SIZEATTENUATION 3804 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3805 if ( isPerspective ) scale *= - mvPosition.z; 3806 #endif 3807 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3808 vec2 rotatedPosition; 3809 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3810 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3811 mvPosition.xy += rotatedPosition; 3812 gl_Position = projectionMatrix * mvPosition; 3813 #include <logdepthbuf_vertex> 3814 #include <clipping_planes_vertex> 3815 #include <fog_vertex> 3816}`,wY=`uniform vec3 diffuse; 3817uniform float opacity; 3818#include <common> 3819#include <uv_pars_fragment> 3820#include <map_pars_fragment> 3821#include <alphamap_pars_fragment> 3822#include <alphatest_pars_fragment> 3823#include <alphahash_pars_fragment> 3824#include <fog_pars_fragment> 3825#include <logdepthbuf_pars_fragment> 3826#include <clipping_planes_pars_fragment> 3827void main() { 3828 vec4 diffuseColor = vec4( diffuse, opacity ); 3829 #include <clipping_planes_fragment> 3830 vec3 outgoingLight = vec3( 0.0 ); 3831 #include <logdepthbuf_fragment> 3832 #include <map_fragment> 3833 #include <alphamap_fragment> 3834 #include <alphatest_fragment> 3835 #include <alphahash_fragment> 3836 outgoingLight = diffuseColor.rgb; 3837 #include <opaque_fragment> 3838 #include <tonemapping_fragment> 3839 #include <colorspace_fragment> 3840 #include <fog_fragment> 3841}`,Ht={alphahash_fragment:H$,alphahash_pars_fragment:W$,alphamap_fragment:G$,alphamap_pars_fragment:$$,alphatest_fragment:X$,alphatest_pars_fragment:q$,aomap_fragment:Y$,aomap_pars_fragment:K$,batching_pars_vertex:Z$,batching_vertex:Q$,begin_vertex:J$,beginnormal_vertex:eX,bsdfs:tX,iridescence_fragment:nX,bumpmap_pars_fragment:rX,clipping_planes_fragment:iX,clipping_planes_pars_fragment:sX,clipping_planes_pars_vertex:oX,clipping_planes_vertex:aX,color_fragment:lX,color_pars_fragment:cX,color_pars_vertex:uX,color_vertex:dX,common:hX,cube_uv_reflection_fragment:fX,defaultnormal_vertex:pX,displacementmap_pars_vertex:mX,displacementmap_vertex:gX,emissivemap_fragment:xX,emissivemap_pars_fragment:vX,colorspace_fragment:yX,colorspace_pars_fragment:_X,envmap_fragment:wX,envmap_common_pars_fragment:bX,envmap_pars_fragment:SX,envmap_pars_vertex:EX,envmap_physical_pars_fragment:kX,envmap_vertex:MX,fog_vertex:AX,fog_pars_vertex:TX,fog_fragment:CX,fog_pars_fragment:NX,gradientmap_pars_fragment:RX,lightmap_pars_fragment:PX,lights_lambert_fragment:IX,lights_lambert_pars_fragment:FX,lights_pars_begin:DX,lights_toon_fragment:LX,lights_toon_pars_fragment:jX,lights_phong_fragment:OX,lights_phong_pars_fragment:UX,lights_physical_fragment:BX,lights_physical_pars_fragment:zX,lights_fragment_begin:VX,lights_fragment_maps:HX,lights_fragment_end:WX,logdepthbuf_fragment:GX,logdepthbuf_pars_fragment:$X,logdepthbuf_pars_vertex:XX,logdepthbuf_vertex:qX,map_fragment:YX,map_pars_fragment:KX,map_particle_fragment:ZX,map_particle_pars_fragment:QX,metalnessmap_fragment:JX,metalnessmap_pars_fragment:eq,morphinstance_vertex:tq,morphcolor_vertex:nq,morphnormal_vertex:rq,morphtarget_pars_vertex:iq,morphtarget_vertex:sq,normal_fragment_begin:oq,normal_fragment_maps:aq,normal_pars_fragment:lq,normal_pars_vertex:cq,normal_vertex:uq,normalmap_pars_fragment:dq,clearcoat_normal_fragment_begin:hq,clearcoat_normal_fragment_maps:fq,clearcoat_pars_fragment:pq,iridescence_pars_fragment:mq,opaque_fragment:gq,packing:xq,premultiplied_alpha_fragment:vq,project_vertex:yq,dithering_fragment:_q,dithering_pars_fragment:wq,roughnessmap_fragment:bq,roughnessmap_pars_fragment:Sq,shadowmap_pars_fragment:Eq,shadowmap_pars_vertex:Mq,shadowmap_vertex:Aq,shadowmask_pars_fragment:Tq,skinbase_vertex:Cq,skinning_pars_vertex:Nq,skinning_vertex:Rq,skinnormal_vertex:Pq,specularmap_fragment:Iq,specularmap_pars_fragment:Fq,tonemapping_fragment:Dq,tonemapping_pars_fragment:kq,transmission_fragment:Lq,transmission_pars_fragment:jq,uv_pars_fragment:Oq,uv_pars_vertex:Uq,uv_vertex:Bq,worldpos_vertex:zq,background_vert:Vq,background_frag:Hq,backgroundCube_vert:Wq,backgroundCube_frag:Gq,cube_vert:$q,cube_frag:Xq,depth_vert:qq,depth_frag:Yq,distanceRGBA_vert:Kq,distanceRGBA_frag:Zq,equirect_vert:Qq,equirect_frag:Jq,linedashed_vert:eY,linedashed_frag:tY,meshbasic_vert:nY,meshbasic_frag:rY,meshlambert_vert:iY,meshlambert_frag:sY,meshmatcap_vert:oY,meshmatcap_frag:aY,meshnormal_vert:lY,meshnormal_frag:cY,meshphong_vert:uY,meshphong_frag:dY,meshphysical_vert:hY,meshphysical_frag:fY,meshtoon_vert:pY,meshtoon_frag:mY,points_vert:gY,points_frag:xY,shadow_vert:vY,shadow_frag:yY,sprite_vert:_Y,sprite_frag:wY},qe={common:{diffuse:{value:new at(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new jt}},envmap:{envMap:{value:null},envMapRotation:{value:new jt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new jt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new jt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new jt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new jt},normalScale:{value:new Se(1,1)}}
vendor: 5,169 bytes, line 3841
3841,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new jt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new jt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new jt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new jt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new at(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 at(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0},uvTransform:{value:new jt}},sprite:{diffuse:{value:new at(16777215)},opacity:{value:1},center:{value:new Se(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}}},Ks={basic:{uniforms:ai([qe.common,qe.specularmap,qe.envmap,qe.aomap,qe.lightmap,qe.fog]),vertexShader:Ht.meshbasic_vert,fragmentShader:Ht.meshbasic_frag},lambert:{uniforms:ai([qe.common,qe.specularmap,qe.envmap,qe.aomap,qe.lightmap,qe.emissivemap,qe.bumpmap,qe.normalmap,qe.displacementmap,qe.fog,qe.lights,{emissive:{value:new at(0)}}]),vertexShader:Ht.meshlambert_vert,fragmentShader:Ht.meshlambert_frag},phong:{uniforms:ai([qe.common,qe.specularmap,qe.envmap,qe.aomap,qe.lightmap,qe.emissivemap,qe.bumpmap,qe.normalmap,qe.displacementmap,qe.fog,qe.lights,{emissive:{value:new at(0)},specular:{value:new at(1118481)},shininess:{value:30}}]),vertexShader:Ht.meshphong_vert,fragmentShader:Ht.meshphong_frag},standard:{uniforms:ai([qe.common,qe.envmap,qe.aomap,qe.lightmap,qe.emissivemap,qe.bumpmap,qe.normalmap,qe.displacementmap,qe.roughnessmap,qe.metalnessmap,qe.fog,qe.lights,{emissive:{value:new at(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ht.meshphysical_vert,fragmentShader:Ht.meshphysical_frag},toon:{uniforms:ai([qe.common,qe.aomap,qe.lightmap,qe.emissivemap,qe.bumpmap,qe.normalmap,qe.displacementmap,qe.gradientmap,qe.fog,qe.lights,{emissive:{value:new at(0)}}]),vertexShader:Ht.meshtoon_vert,fragmentShader:Ht.meshtoon_frag},matcap:{uniforms:ai([qe.common,qe.bumpmap,qe.normalmap,qe.displacementmap,qe.fog,{matcap:{value:null}}]),vertexShader:Ht.meshmatcap_vert,fragmentShader:Ht.meshmatcap_frag},points:{uniforms:ai([qe.points,qe.fog]),vertexShader:Ht.points_vert,fragmentShader:Ht.points_frag},dashed:{uniforms:ai([qe.common,qe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ht.linedashed_vert,fragmentShader:Ht.linedashed_frag},depth:{uniforms:ai([qe.common,qe.displacementmap]),vertexShader:Ht.depth_vert,fragmentShader:Ht.depth_frag},normal:{uniforms:ai([qe.common,qe.bumpmap,qe.normalmap,qe.displacementmap,{opacity:{value:1}}]),vertexShader:Ht.meshnormal_vert,fragmentShader:Ht.meshnormal_frag},sprite:{uniforms:ai([qe.sprite,qe.fog]),vertexShader:Ht.sprite_vert,fragmentShader:Ht.sprite_frag},background:{uniforms:{uvTransform:{value:new jt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ht.background_vert,fragmentShader:Ht.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new jt}},vertexShader:Ht.backgroundCube_vert,fragmentShader:Ht.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ht.cube_vert,fragmentShader:Ht.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ht.equirect_vert,fragmentShader:Ht.equirect_frag},distanceRGBA:{uniforms:ai([qe.common,qe.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ht.distanceRGBA_vert,fragmentShader:Ht.distanceRGBA_frag},shadow:{uniforms:ai([qe.lights,qe.fog,{color:{value:new at(0)},opacity:{value:1}}]),vertexShader:Ht.shadow_vert,fragmentShader:Ht.shadow_frag}};
vendor: 4,840 bytes, line 3841
3841Ks.physical={uniforms:ai([Ks.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new jt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new jt},clearcoatNormalScale:{value:new Se(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new jt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new jt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new jt},sheen:{value:0},sheenColor:{value:new at(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new jt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new jt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new jt},transmissionSamplerSize:{value:new Se},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new jt},attenuationDistance:{value:0},attenuationColor:{value:new at(0)},specularColor:{value:new at(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new jt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new jt},anisotropyVector:{value:new Se},anisotropyMap:{value:null},anisotropyMapTransform:{value:new jt}}]),vertexShader:Ht.meshphysical_vert,fragmentShader:Ht.meshphysical_frag};const kx={r:0,b:0,g:0},yc=new ls,bY=new Rt;function SY(n,e,t,r,i,s,o){const a=new at(0);let c=s===!0?0:1,u,f,p=null,m=0,x=null;function v(S){let M=S.isScene===!0?S.background:null;return M&&M.isTexture&&(M=(S.backgroundBlurriness>0?t:e).get(M)),M}function _(S){let M=!1;const A=v(S);A===null?g(a,c):A&&A.isColor&&(g(A,1),M=!0);const R=n.xr.getEnvironmentBlendMode();R==="additive"?r.buffers.color.setClear(0,0,0,1,o):R==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,o),(n.autoClear||M)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(S,M){const A=v(M);A&&(A.isCubeTexture||A.mapping===kh)?(f===void 0&&(f=new cr(new yu(1,1,1),new so({name:"BackgroundCubeMaterial",uniforms:vh(Ks.backgroundCube.uniforms),vertexShader:Ks.backgroundCube.vertexShader,fragmentShader:Ks.backgroundCube.fragmentShader,side:mi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(R,F,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),yc.copy(M.backgroundRotation),yc.x*=-1,yc.y*=-1,yc.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(yc.y*=-1,yc.z*=-1),f.material.uniforms.envMap.value=A,f.material.uniforms.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,f.material.uniforms.backgroundRotation.value.setFromMatrix4(bY.makeRotationFromEuler(yc)),f.material.toneMapped=an.getTransfer(A.colorSpace)!==wn,(p!==A||m!==A.version||x!==n.toneMapping)&&(f.material.needsUpdate=!0,p=A,m=A.version,x=n.toneMapping),f.layers.enableAll(),S.unshift(f,f.geometry,f.material,0,0,null)):A&&A.isTexture&&(u===void 0&&(u=new cr(new Oh(2,2),new so({name:"BackgroundMaterial",uniforms:vh(Ks.background.uniforms),vertexShader:Ks.background.vertexShader,fragmentShader:Ks.background.fragmentShader,side:Ta,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=A,u.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,u.material.toneMapped=an.getTransfer(A.colorSpace)!==wn,A.matrixAutoUpdate===!0&&A.updateMatrix(),u.material.uniforms.uvTransform.value.copy(A.matrix),(p!==A||m!==A.version||x!==n.toneMapping)&&(u.material.needsUpdate=!0,p=A,m=A.version,x=n.toneMapping),u.layers.enableAll(),S.unshift(u,u.geometry,u.material,0,0,null))}function g(S,M){S.getRGB(kx,zk(n)),r.buffers.color.setClear(kx.r,kx.g,kx.b,M,o)}function b(){f!==void 0&&(f.geometry.dispose(),f.material.dispose(),f=void 0),u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0)}return{getClearColor:function(){return a},setClearColor:function(S,M=1){a.set(S),c=M,g(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(S){c=S,g(a,c)},render:_,addToRenderList:y,dispose:b}}function EY(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),r={},i=m(null);let s=i,o=!1;
vendor: 4,858 bytes, line 3841
3841function a(I,D,O,U,V){let Z=!1;const Y=p(U,O,D);s!==Y&&(s=Y,u(s.object)),Z=x(I,U,O,V),Z&&v(I,U,O,V),V!==null&&e.update(V,n.ELEMENT_ARRAY_BUFFER),(Z||o)&&(o=!1,M(I,D,O,U),V!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(V).buffer))}function c(){return n.createVertexArray()}function u(I){return n.bindVertexArray(I)}function f(I){return n.deleteVertexArray(I)}function p(I,D,O){const U=O.wireframe===!0;let V=r[I.id];V===void 0&&(V={},r[I.id]=V);let Z=V[D.id];Z===void 0&&(Z={},V[D.id]=Z);let Y=Z[U];return Y===void 0&&(Y=m(c()),Z[U]=Y),Y}function m(I){const D=[],O=[],U=[];for(let V=0;V<t;V++)D[V]=0,O[V]=0,U[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:D,enabledAttributes:O,attributeDivisors:U,object:I,attributes:{},index:null}}function x(I,D,O,U){const V=s.attributes,Z=D.attributes;let Y=0;const ne=O.getAttributes();for(const j in ne)if(ne[j].location>=0){const K=V[j];let re=Z[j];if(re===void 0&&(j==="instanceMatrix"&&I.instanceMatrix&&(re=I.instanceMatrix),j==="instanceColor"&&I.instanceColor&&(re=I.instanceColor)),K===void 0||K.attribute!==re||re&&K.data!==re.data)return!0;Y++}return s.attributesNum!==Y||s.index!==U}function v(I,D,O,U){const V={},Z=D.attributes;let Y=0;const ne=O.getAttributes();for(const j in ne)if(ne[j].location>=0){let K=Z[j];K===void 0&&(j==="instanceMatrix"&&I.instanceMatrix&&(K=I.instanceMatrix),j==="instanceColor"&&I.instanceColor&&(K=I.instanceColor));const re={};re.attribute=K,K&&K.data&&(re.data=K.data),V[j]=re,Y++}s.attributes=V,s.attributesNum=Y,s.index=U}function _(){const I=s.newAttributes;for(let D=0,O=I.length;D<O;D++)I[D]=0}function y(I){g(I,0)}function g(I,D){const O=s.newAttributes,U=s.enabledAttributes,V=s.attributeDivisors;O[I]=1,U[I]===0&&(n.enableVertexAttribArray(I),U[I]=1),V[I]!==D&&(n.vertexAttribDivisor(I,D),V[I]=D)}function b(){const I=s.newAttributes,D=s.enabledAttributes;for(let O=0,U=D.length;O<U;O++)D[O]!==I[O]&&(n.disableVertexAttribArray(O),D[O]=0)}function S(I,D,O,U,V,Z,Y){Y===!0?n.vertexAttribIPointer(I,D,O,V,Z):n.vertexAttribPointer(I,D,O,U,V,Z)}function M(I,D,O,U){_();const V=U.attributes,Z=O.getAttributes(),Y=D.defaultAttributeValues;for(const ne in Z){const j=Z[ne];if(j.location>=0){let $=V[ne];if($===void 0&&(ne==="instanceMatrix"&&I.instanceMatrix&&($=I.instanceMatrix),ne==="instanceColor"&&I.instanceColor&&($=I.instanceColor)),$!==void 0){const K=$.normalized,re=$.itemSize,xe=e.get($);if(xe===void 0)continue;const Ce=xe.buffer,ce=xe.type,_e=xe.bytesPerElement,Re=ce===n.INT||ce===n.UNSIGNED_INT||$.gpuType===Iy;if($.isInterleavedBufferAttribute){const pe=$.data,je=pe.stride,nt=$.offset;if(pe.isInstancedInterleavedBuffer){for(let Pe=0;Pe<j.locationSize;Pe++)g(j.location+Pe,pe.meshPerAttribute);I.isInstancedMesh!==!0&&U._maxInstanceCount===void 0&&(U._maxInstanceCount=pe.meshPerAttribute*pe.count)}else for(let Pe=0;Pe<j.locationSize;Pe++)y(j.location+Pe);n.bindBuffer(n.ARRAY_BUFFER,Ce);for(let Pe=0;Pe<j.locationSize;Pe++)S(j.location+Pe,re/j.locationSize,ce,K,je*_e,(nt+re/j.locationSize*Pe)*_e,Re)}else{if($.isInstancedBufferAttribute){for(let pe=0;pe<j.locationSize;pe++)g(j.location+pe,$.meshPerAttribute);I.isInstancedMesh!==!0&&U._maxInstanceCount===void 0&&(U._maxInstanceCount=$.meshPerAttribute*$.count)}else for(let pe=0;pe<j.locationSize;pe++)y(j.location+pe);n.bindBuffer(n.ARRAY_BUFFER,Ce);for(let pe=0;pe<j.locationSize;pe++)S(j.location+pe,re/j.locationSize,ce,K,re*_e,re/j.locationSize*pe*_e,Re)}}else if(Y!==void 0){const K=Y[ne];if(K!==void 0)switch(K.length){case 2:n.vertexAttrib2fv(j.location,K);break;case 3:n.vertexAttrib3fv(j.location,K);break;case 4:n.vertexAttrib4fv(j.location,K);break;default:n.vertexAttrib1fv(j.location,K)}}}}b()}function A(){L();for(const I in r){const D=r[I];for(const O in D){const U=D[O];for(const V in U)f(U[V].object),delete U[V];delete D[O]}delete r[I]}}function R(I){if(r[I.id]===void 0)return;const D=r[I.id];for(const O in D){const U=D[O];for(const V in U)f(U[V].object),delete U[V];delete D[O]}delete r[I.id]}function F(I){for(const D in r){const O=r[D];if(O[I.id]===void 0)continue;const U=O[I.id];for(const V in U)f(U[V].object),delete U[V];delete O[I.id]}}function L(){N(),o=!0,s!==i&&(s=i,u(s.object))}function N(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:L,resetDefaultState:N,dispose:A,releaseStatesOfGeometry:R,releaseStatesOfProgram:F,initAttributes:_,enableAttribute:y,disableUnusedAttributes:b}}function MY(n,e,t){let r;function i(u){r=u}function s(u,f){n.drawArrays(r,u,f),t.update(f,r,1)}function o(u,f,p){p!==0&&(n.drawArraysInstanced(r,u,f,p),t.update(f,r,p))}function a(u,f,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,u,0,f,0,p);let x=0;for(let v=0;v<p;v++)x+=f[v];t.update(x,r,1)}function c(u,f,p,m){if(p===0)return;const x=e.get("WEBGL_multi_draw");if(x===null)for(let v=0;v<u.length;v++)o(u[v],f[v],m[v]);
vendor: 12,567 bytes, lines 3841-3916
3841else{x.multiDrawArraysInstancedWEBGL(r,u,0,f,0,m,0,p);let v=0;for(let _=0;_<p;_++)v+=f[_]*m[_];t.update(v,r,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=c}function AY(n,e,t,r){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const F=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(F){return!(F!==Zr&&r.convert(F)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(F){const L=F===Lh&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(F!==Ds&&r.convert(F)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&F!==Li&&!L)}function c(F){if(F==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";F="mediump"}return F==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=t.precision!==void 0?t.precision:"highp";const f=c(u);f!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",f,"instead."),u=f);const p=t.logarithmicDepthBuffer===!0,m=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),x=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),S=n.getParameter(n.MAX_VARYING_VECTORS),M=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),A=v>0,R=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:a,precision:u,logarithmicDepthBuffer:p,reverseDepthBuffer:m,maxTextures:x,maxVertexTextures:v,maxTextureSize:_,maxCubemapSize:y,maxAttributes:g,maxVertexUniforms:b,maxVaryings:S,maxFragmentUniforms:M,vertexTextures:A,maxSamples:R}}function TY(n){const e=this;let t=null,r=0,i=!1,s=!1;const o=new la,a=new jt,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){const x=p.length!==0||m||r!==0||i;return i=m,r=p.length,x},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,m){t=f(p,m,0)},this.setState=function(p,m,x){const v=p.clippingPlanes,_=p.clipIntersection,y=p.clipShadows,g=n.get(p);if(!i||v===null||v.length===0||s&&!y)s?f(null):u();else{const b=s?0:r,S=b*4;let M=g.clippingState||null;c.value=M,M=f(v,m,S,x);for(let A=0;A!==S;++A)M[A]=t[A];g.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=b}};function u(){c.value!==t&&(c.value=t,c.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function f(p,m,x,v){const _=p!==null?p.length:0;let y=null;if(_!==0){if(y=c.value,v!==!0||y===null){const g=x+_*4,b=m.matrixWorldInverse;a.getNormalMatrix(b),(y===null||y.length<g)&&(y=new Float32Array(g));for(let S=0,M=x;S!==_;++S,M+=4)o.copy(p[S]).applyMatrix4(b,a),o.normal.toArray(y,M),y[M+3]=o.constant}c.value=y,c.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,y}}function CY(n){let e=new WeakMap;function t(o,a){return a===kp?o.mapping=Ca:a===Lp&&(o.mapping=Ol),o}function r(o){if(o&&o.isTexture){const a=o.mapping;if(a===kp||a===Lp)if(e.has(o)){const c=e.get(o).texture;return t(c,o.mapping)}else{const c=o.image;if(c&&c.height>0){const u=new Wk(c.height);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}const Ad=4,IN=[.125,.215,.35,.446,.526,.582],Cc=20,Yw=new Do,FN=new at;let Kw=null,Zw=0,Qw=0,Jw=!1;const Tc=(1+Math.sqrt(5))/2,td=1/Tc,DN=[new G(-Tc,td,0),new G(Tc,td,0),new G(-td,0,Tc),new G(td,0,Tc),new G(0,Tc,-td),new G(0,Tc,td),new G(-1,1,-1),new G(1,1,-1),new G(-1,1,1),new G(1,1,1)],NY=new G;class n2{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,t=0,r=.1,i=100,s={}){const{size:o=256,position:a=NY}=s;Kw=this._renderer.getRenderTarget(),Zw=this._renderer.getActiveCubeFace(),Qw=this._renderer.getActiveMipmapLevel(),Jw=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,r,i,c,a),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=jN(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=LN(),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;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Kw,Zw,Qw),this._renderer.xr.enabled=Jw,e.scissorTest=!1,Lx(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Ca||e.mapping===Ol?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Kw=this._renderer.getRenderTarget(),Zw=this._renderer.getActiveCubeFace(),Qw=this._renderer.getActiveMipmapLevel(),Jw=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:xr,minFilter:xr,generateMipmaps:!1,type:Lh,format:Zr,colorSpace:au,depthBuffer:!1},i=kN(e,t,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=kN(e,t,r);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=RY(s)),this._blurMaterial=PY(s,e,t)}return i}_compileMaterial(e){const t=new cr(this._lodPlanes[0],e);this._renderer.compile(t,Yw)}_sceneToCubeUV(e,t,r,i,s){const c=new Un(90,1,t,r),u=[1,-1,1,1,1,1],f=[1,1,1,-1,-1,-1],p=this._renderer,m=p.autoClear,x=p.toneMapping;p.getClearColor(FN),p.toneMapping=Io,p.autoClear=!1;const v=new Xl({name:"PMREM.Background",side:mi,depthWrite:!1,depthTest:!1}),_=new cr(new yu,v);let y=!1;const g=e.background;g?g.isColor&&(v.color.copy(g),e.background=null,y=!0):(v.color.copy(FN),y=!0);for(let b=0;b<6;b++){const S=b%3;S===0?(c.up.set(0,u[b],0),c.position.set(s.x,s.y,s.z),c.lookAt(s.x+f[b],s.y,s.z)):S===1?(c.up.set(0,0,u[b]),c.position.set(s.x,s.y,s.z),c.lookAt(s.x,s.y+f[b],s.z)):(c.up.set(0,u[b],0),c.position.set(s.x,s.y,s.z),c.lookAt(s.x,s.y,s.z+f[b]));const M=this._cubeSize;Lx(i,S*M,b>2?M:0,M,M),p.setRenderTarget(i),y&&p.render(_,c),p.render(e,c)}_.geometry.dispose(),_.material.dispose(),p.toneMapping=x,p.autoClear=m,e.background=g}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===Ca||e.mapping===Ol;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=jN()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=LN());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new cr(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const c=this._cubeSize;Lx(t,0,0,3*c,2*c),r.setRenderTarget(t),r.render(o,Yw)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=DN[(i-s-1)%DN.length];this._blur(e,s-1,s,o,a)}t.autoClear=r}_blur(e,t,r,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,r,i,"latitudinal",s),this._halfBlur(o,e,r,r,i,"longitudinal",s)}_halfBlur(e,t,r,i,s,o,a){const c=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const f=3,p=new cr(this._lodPlanes[i],u),m=u.uniforms,x=this._sizeLods[r]-1,v=isFinite(s)?Math.PI/(2*x):2*Math.PI/(2*Cc-1),_=s/v,y=isFinite(s)?1+Math.floor(f*_):Cc;y>Cc&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Cc}`);const g=[];let b=0;for(let F=0;F<Cc;++F){const L=F/_,N=Math.exp(-L*L/2);g.push(N),F===0?b+=N:F<y&&(b+=2*N)}for(let F=0;F<g.length;F++)g[F]=g[F]/b;m.envMap.value=e.texture,m.samples.value=y,m.weights.value=g,m.latitudinal.value=o==="latitudinal",a&&(m.poleAxis.value=a);const{_lodMax:S}=this;m.dTheta.value=v,m.mipInt.value=S-r;const M=this._sizeLods[i],A=3*M*(i>S-Ad?i-S+Ad:0),R=4*(this._cubeSize-M);Lx(t,A,R,3*M,2*M),c.setRenderTarget(t),c.render(p,Yw)}}function RY(n){const e=[],t=[],r=[];let i=n;const s=n-Ad+1+IN.length;for(let o=0;o<s;o++){const a=Math.pow(2,i);t.push(a);let c=1/a;o>n-Ad?c=IN[o-n+Ad-1]:o===0&&(c=0),r.push(c);const u=1/(a-2),f=-u,p=1+u,m=[f,f,p,f,p,p,f,f,p,p,f,p],x=6,v=6,_=3,y=2,g=1,b=new Float32Array(_*v*x),S=new Float32Array(y*v*x),M=new Float32Array(g*v*x);for(let R=0;R<x;R++){const F=R%3*2/3-1,L=R>2?0:-1,N=[F,L,0,F+2/3,L,0,F+2/3,L+1,0,F,L,0,F+2/3,L+1,0,F,L+1,0];b.set(N,_*v*R),S.set(m,y*v*R);const I=[R,R,R,R,R,R];M.set(I,g*v*R)}const A=new zt;A.setAttribute("position",new En(b,_)),A.setAttribute("uv",new En(S,y)),A.setAttribute("faceIndex",new En(M,g)),e.push(A),i>Ad&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function kN(n,e,t){const r=new Oo(n,e,t);return r.texture.mapping=kh,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Lx(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function PY(n,e,t){const r=new Float32Array(Cc),i=new G(0,1,0);return new so({name:"SphericalGaussianBlur",defines:{n:Cc,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:RM(),fragmentShader:` 3842 3843 precision mediump float; 3844 precision mediump int; 3845 3846 varying vec3 vOutputDirection; 3847 3848 uniform sampler2D envMap; 3849 uniform int samples; 3850 uniform float weights[ n ]; 3851 uniform bool latitudinal; 3852 uniform float dTheta; 3853 uniform float mipInt; 3854 uniform vec3 poleAxis; 3855 3856 #define ENVMAP_TYPE_CUBE_UV 3857 #include <cube_uv_reflection_fragment> 3858 3859 vec3 getSample( float theta, vec3 axis ) { 3860 3861 float cosTheta = cos( theta ); 3862 // Rodrigues' axis-angle rotation 3863 vec3 sampleDirection = vOutputDirection * cosTheta 3864 + cross( axis, vOutputDirection ) * sin( theta ) 3865 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3866 3867 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3868 3869 } 3870 3871 void main() { 3872 3873 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3874 3875 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3876 3877 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3878 3879 } 3880 3881 axis = normalize( axis ); 3882 3883 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3884 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3885 3886 for ( int i = 1; i < n; i++ ) { 3887 3888 if ( i >= samples ) { 3889 3890 break; 3891 3892 } 3893 3894 float theta = dTheta * float( i ); 3895 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3896 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3897 3898 } 3899 3900 } 3901 `,blending:va,depthTest:!1,depthWrite:!1})}function LN(){return new so({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:RM(),fragmentShader:` 3902 3903 precision mediump float; 3904 precision mediump int; 3905 3906 varying vec3 vOutputDirection; 3907 3908 uniform sampler2D envMap; 3909 3910 #include <common> 3911 3912 void main() { 3913 3914 vec3 outputDirection = normalize( vOutputDirection ); 3915 vec2 uv = equirectUv( outputDirection ); 3916
3917 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3918 3919 } 3920 `,blending:va,depthTest:!1,depthWrite:!1})}function jN(){return new so({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:RM(),fragmentShader:` 3921 3922 precision mediump float; 3923 precision mediump int; 3924 3925 uniform float flipEnvMap; 3926 3927 varying vec3 vOutputDirection; 3928 3929 uniform samplerCube envMap; 3930 3931 void main() { 3932 3933 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3934 3935 } 3936 `,blending:va,depthTest:!1,depthWrite:!1})}function RM(){return` 3937 3938 precision mediump float; 3939 precision mediump int; 3940 3941 attribute float faceIndex; 3942 3943 varying vec3 vOutputDirection; 3944 3945 // RH coordinate system; PMREM face-indexing convention 3946 vec3 getDirection( vec2 uv, float face ) { 3947 3948 uv = 2.0 * uv - 1.0; 3949 3950 vec3 direction = vec3( uv, 1.0 ); 3951 3952 if ( face == 0.0 ) { 3953 3954 direction = direction.zyx; // ( 1, v, u ) pos x 3955 3956 } else if ( face == 1.0 ) { 3957 3958 direction = direction.xzy; 3959 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3960 3961 } else if ( face == 2.0 ) { 3962 3963 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3964 3965 } else if ( face == 3.0 ) { 3966 3967 direction = direction.zyx; 3968 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3969 3970 } else if ( face == 4.0 ) { 3971 3972 direction = direction.xzy; 3973 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3974 3975 } else if ( face == 5.0 ) { 3976 3977 direction.z *= -1.0; // ( u, v, -1 ) neg z 3978 3979 } 3980 3981 return direction; 3982 3983 } 3984 3985 void main() { 3986 3987 vOutputDirection = getDirection( uv, faceIndex ); 3988 gl_Position = vec4( position, 1.0 ); 3989 3990 } 3991 `}function IY(n){let e=new WeakMap,t=null;function r(a){if(a&&a.isTexture){const c=a.mapping,u=c===kp||c===Lp,f=c===Ca||c===Ol;if(u||f){let p=e.get(a);const m=p!==void 0?p.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==m)return t===null&&(t=new n2(n)),p=u?t.fromEquirectangular(a,p):t.fromCubemap(a,p),p.texture.pmremVersion=a.pmremVersion,e.set(a,p),p.texture;if(p!==void 0)return p.texture;{const x=a.image;return u&&x&&x.height>0||f&&x&&i(x)?(t===null&&(t=new n2(n)),p=u?t.fromEquirectangular(a):t.fromCubemap(a),p.texture.pmremVersion=a.pmremVersion,e.set(a,p),a.addEventListener("dispose",s),p.texture):null}}}return a}function i(a){let c=0;const u=6;for(let f=0;f<u;f++)a[f]!==void 0&&c++;return c===u}function s(a){const c=a.target;c.removeEventListener("dispose",s);const u=e.get(c);u!==void 0&&(e.delete(c),u.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:r,dispose:o}}function FY(n){const e={};function t(r){if(e[r]!==void 0)return e[r];let i;switch(r){case"WEBGL_depth_texture":i=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=n.getExtension(r)}return e[r]=i,i}return{has:function(r){return t(r)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(r){const i=t(r);return i===null&&c0("THREE.WebGLRenderer: "+r+" extension not supported."),i}}}function DY(n,e,t,r){const i={},s=new WeakMap;function o(p){const m=p.target;m.index!==null&&e.remove(m.index);for(const v in m.attributes)e.remove(m.attributes[v]);m.removeEventListener("dispose",o),delete i[m.id];const x=s.get(m);x&&(e.remove(x),s.delete(m)),r.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,t.memory.geometries--}function a(p,m){return i[m.id]===!0||(m.addEventListener("dispose",o),i[m.id]=!0,t.memory.geometries++),m}function c(p){const m=p.attributes;for(const x in m)e.update(m[x],n.ARRAY_BUFFER)}function u(p){const m=[],x=p.index,v=p.attributes.position;let _=0;if(x!==null){const b=x.array;_=x.version;for(let S=0,M=b.length;S<M;S+=3){const A=b[S+0],R=b[S+1],F=b[S+2];m.push(A,R,R,F,F,A)}}else if(v!==void 0){const b=v.array;_=v.version;for(let S=0,M=b.length/3-1;S<M;S+=3){const A=S+0,R=S+1,F=S+2;m.push(A,R,R,F,F,A)}}else return;const y=new(jk(m)?iM:rM)(m,1);y.version=_;const g=s.get(p);g&&e.remove(g),s.set(p,y)}function f(p){const m=s.get(p);if(m){const x=p.index;x!==null&&m.version<x.version&&u(p)}else u(p);return s.get(p)}return{get:a,update:c,getWireframeAttribute:f}}function kY(n,e,t){let r;function i(m){r=m}let s,o;function a(m){s=m.type,o=m.bytesPerElement}function c(m,x){n.drawElements(r,x,s,m*o),t.update(x,r,1)}function u(m,x,v){v!==0&&(n.drawElementsInstanced(r,x,s,m*o,v),t.update(x,r,v))}function f(m,x,v){if(v===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,x,0,s,m,0,v);let y=0;for(let g=0;g<v;g++)y+=x[g];t.update(y,r,1)}function p(m,x,v,_){if(v===0)return;const y=e.get("WEBGL_multi_draw");if(y===null)for(let g=0;g<m.length;g++)u(m[g]/o,x[g],_[g]);
vendor: 16,812 bytes, lines 3991-4021
3991else{y.multiDrawElementsInstancedWEBGL(r,x,0,s,m,0,_,0,v);let g=0;for(let b=0;b<v;b++)g+=x[b]*_[b];t.update(g,r,1)}}this.setMode=i,this.setIndex=a,this.render=c,this.renderInstances=u,this.renderMultiDraw=f,this.renderMultiDrawInstances=p}function LY(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function r(s,o,a){switch(t.calls++,o){case n.TRIANGLES:t.triangles+=a*(s/3);break;case n.LINES:t.lines+=a*(s/2);break;case n.LINE_STRIP:t.lines+=a*(s-1);break;case n.LINE_LOOP:t.lines+=a*s;break;case n.POINTS:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:r}}function jY(n,e,t){const r=new WeakMap,i=new cn;function s(o,a,c){const u=o.morphTargetInfluences,f=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,p=f!==void 0?f.length:0;let m=r.get(a);if(m===void 0||m.count!==p){let N=function(){F.dispose(),r.delete(a),a.removeEventListener("dispose",N)};m!==void 0&&m.texture.dispose();const x=a.morphAttributes.position!==void 0,v=a.morphAttributes.normal!==void 0,_=a.morphAttributes.color!==void 0,y=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],b=a.morphAttributes.color||[];let S=0;x===!0&&(S=1),v===!0&&(S=2),_===!0&&(S=3);let M=a.attributes.position.count*S,A=1;M>e.maxTextureSize&&(A=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const R=new Float32Array(M*A*4*p),F=new fm(R,M,A,p);F.type=Li,F.needsUpdate=!0;const L=S*4;for(let I=0;I<p;I++){const D=y[I],O=g[I],U=b[I],V=M*A*4*I;for(let Z=0;Z<D.count;Z++){const Y=Z*L;x===!0&&(i.fromBufferAttribute(D,Z),R[V+Y+0]=i.x,R[V+Y+1]=i.y,R[V+Y+2]=i.z,R[V+Y+3]=0),v===!0&&(i.fromBufferAttribute(O,Z),R[V+Y+4]=i.x,R[V+Y+5]=i.y,R[V+Y+6]=i.z,R[V+Y+7]=0),_===!0&&(i.fromBufferAttribute(U,Z),R[V+Y+8]=i.x,R[V+Y+9]=i.y,R[V+Y+10]=i.z,R[V+Y+11]=U.itemSize===4?i.w:1)}}m={count:p,texture:F,size:new Se(M,A)},r.set(a,m),a.addEventListener("dispose",N)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)c.getUniforms().setValue(n,"morphTexture",o.morphTexture,t);else{let x=0;for(let _=0;_<u.length;_++)x+=u[_];const v=a.morphTargetsRelative?1:1-x;c.getUniforms().setValue(n,"morphTargetBaseInfluence",v),c.getUniforms().setValue(n,"morphTargetInfluences",u)}c.getUniforms().setValue(n,"morphTargetsTexture",m.texture,t),c.getUniforms().setValue(n,"morphTargetsTextureSize",m.size)}return{update:s}}function OY(n,e,t,r){let i=new WeakMap;function s(c){const u=r.render.frame,f=c.geometry,p=e.get(c,f);if(i.get(p)!==u&&(e.update(p),i.set(p,u)),c.isInstancedMesh&&(c.hasEventListener("dispose",a)===!1&&c.addEventListener("dispose",a),i.get(c)!==u&&(t.update(c.instanceMatrix,n.ARRAY_BUFFER),c.instanceColor!==null&&t.update(c.instanceColor,n.ARRAY_BUFFER),i.set(c,u))),c.isSkinnedMesh){const m=c.skeleton;i.get(m)!==u&&(m.update(),i.set(m,u))}return p}function o(){i=new WeakMap}function a(c){const u=c.target;u.removeEventListener("dispose",a),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:s,dispose:o}}const HL=new Yn,ON=new Xy(1,1),WL=new fm,GL=new By,$L=new mm,UN=[],BN=[],zN=new Float32Array(16),VN=new Float32Array(9),HN=new Float32Array(4);function Uh(n,e,t){const r=n[0];if(r<=0||r>0)return n;const i=e*t;let s=UN[i];if(s===void 0&&(s=new Float32Array(i),UN[i]=s),e!==0){r.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function vr(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t<r;t++)if(n[t]!==e[t])return!1;return!0}function yr(n,e){for(let t=0,r=e.length;t<r;t++)n[t]=e[t]}function l1(n,e){let t=BN[e];t===void 0&&(t=new Int32Array(e),BN[e]=t);for(let r=0;r!==e;++r)t[r]=n.allocateTextureUnit();return t}function UY(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function BY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(vr(t,e))return;n.uniform2fv(this.addr,e),yr(t,e)}}function zY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(vr(t,e))return;n.uniform3fv(this.addr,e),yr(t,e)}}function VY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(vr(t,e))return;n.uniform4fv(this.addr,e),yr(t,e)}}function HY(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(vr(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),yr(t,e)}else{if(vr(t,r))return;HN.set(r),n.uniformMatrix2fv(this.addr,!1,HN),yr(t,r)}}function WY(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(vr(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),yr(t,e)}else{if(vr(t,r))return;VN.set(r),n.uniformMatrix3fv(this.addr,!1,VN),yr(t,r)}}function GY(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(vr(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),yr(t,e)}else{if(vr(t,r))return;zN.set(r),n.uniformMatrix4fv(this.addr,!1,zN),yr(t,r)}}function $Y(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function XY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(vr(t,e))return;n.uniform2iv(this.addr,e),yr(t,e)}}function qY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(vr(t,e))return;n.uniform3iv(this.addr,e),yr(t,e)}}function YY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(vr(t,e))return;n.uniform4iv(this.addr,e),yr(t,e)}}function KY(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function ZY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(vr(t,e))return;n.uniform2uiv(this.addr,e),yr(t,e)}}function QY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(vr(t,e))return;n.uniform3uiv(this.addr,e),yr(t,e)}}function JY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(vr(t,e))return;n.uniform4uiv(this.addr,e),yr(t,e)}}function eK(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i);let s;this.type===n.SAMPLER_2D_SHADOW?(ON.compareFunction=tM,s=ON):s=HL,t.setTexture2D(e||s,i)}function tK(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture3D(e||GL,i)}function nK(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTextureCube(e||$L,i)}function rK(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture2DArray(e||WL,i)}function iK(n){switch(n){case 5126:return UY;case 35664:return BY;case 35665:return zY;case 35666:return VY;case 35674:return HY;case 35675:return WY;case 35676:return GY;case 5124:case 35670:return $Y;case 35667:case 35671:return XY;case 35668:case 35672:return qY;case 35669:case 35673:return YY;case 5125:return KY;case 36294:return ZY;case 36295:return QY;case 36296:return JY;case 35678:case 36198:case 36298:case 36306:case 35682:return eK;case 35679:case 36299:case 36307:return tK;case 35680:case 36300:case 36308:case 36293:return nK;case 36289:case 36303:case 36311:case 36292:return rK}}function sK(n,e){n.uniform1fv(this.addr,e)}function oK(n,e){const t=Uh(e,this.size,2);n.uniform2fv(this.addr,t)}function aK(n,e){const t=Uh(e,this.size,3);n.uniform3fv(this.addr,t)}function lK(n,e){const t=Uh(e,this.size,4);n.uniform4fv(this.addr,t)}function cK(n,e){const t=Uh(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function uK(n,e){const t=Uh(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function dK(n,e){const t=Uh(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function hK(n,e){n.uniform1iv(this.addr,e)}function fK(n,e){n.uniform2iv(this.addr,e)}function pK(n,e){n.uniform3iv(this.addr,e)}function mK(n,e){n.uniform4iv(this.addr,e)}function gK(n,e){n.uniform1uiv(this.addr,e)}function xK(n,e){n.uniform2uiv(this.addr,e)}function vK(n,e){n.uniform3uiv(this.addr,e)}function yK(n,e){n.uniform4uiv(this.addr,e)}function _K(n,e,t){const r=this.cache,i=e.length,s=l1(t,i);vr(r,s)||(n.uniform1iv(this.addr,s),yr(r,s));for(let o=0;o!==i;++o)t.setTexture2D(e[o]||HL,s[o])}function wK(n,e,t){const r=this.cache,i=e.length,s=l1(t,i);vr(r,s)||(n.uniform1iv(this.addr,s),yr(r,s));for(let o=0;o!==i;++o)t.setTexture3D(e[o]||GL,s[o])}function bK(n,e,t){const r=this.cache,i=e.length,s=l1(t,i);vr(r,s)||(n.uniform1iv(this.addr,s),yr(r,s));for(let o=0;o!==i;++o)t.setTextureCube(e[o]||$L,s[o])}function SK(n,e,t){const r=this.cache,i=e.length,s=l1(t,i);vr(r,s)||(n.uniform1iv(this.addr,s),yr(r,s));for(let o=0;o!==i;++o)t.setTexture2DArray(e[o]||WL,s[o])}function EK(n){switch(n){case 5126:return sK;case 35664:return oK;case 35665:return aK;case 35666:return lK;case 35674:return cK;case 35675:return uK;case 35676:return dK;case 5124:case 35670:return hK;case 35667:case 35671:return fK;case 35668:case 35672:return pK;case 35669:case 35673:return mK;case 5125:return gK;case 36294:return xK;case 36295:return vK;case 36296:return yK;case 35678:case 36198:case 36298:case 36306:case 35682:return _K;case 35679:case 36299:case 36307:return wK;case 35680:case 36300:case 36308:case 36293:return bK;case 36289:case 36303:case 36311:case 36292:return SK}}class MK{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.setValue=iK(t.type)}}class AK{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=EK(t.type)}}class TK{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const a=i[s];a.setValue(e,t[a.id],r)}}}const eb=/(\w+)(\])?(\[|\.)?/g;function WN(n,e){n.seq.push(e),n.map[e.id]=e}function CK(n,e,t){const r=n.name,i=r.length;for(eb.lastIndex=0;;){const s=eb.exec(r),o=eb.lastIndex;let a=s[1];const c=s[2]==="]",u=s[3];if(c&&(a=a|0),u===void 0||u==="["&&o+2===i){WN(t,u===void 0?new MK(a,n,e):new AK(a,n,e));break}else{let p=t.map[a];p===void 0&&(p=new TK(a),WN(t,p)),t=p}}}class d0{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<r;++i){const s=e.getActiveUniform(t,i),o=e.getUniformLocation(t,s.name);CK(s,o,this)}}setValue(e,t,r,i){const s=this.map[t];s!==void 0&&s.setValue(e,r,i)}setOptional(e,t,r){const i=t[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,t,r,i){for(let s=0,o=t.length;s!==o;++s){const a=t[s],c=r[a.id];c.needsUpdate!==!1&&a.setValue(e,c.value,i)}}static seqWithValue(e,t){const r=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in t&&r.push(o)}return r}}function GN(n,e,t){const r=n.createShader(e);return n.shaderSource(r,t),n.compileShader(r),r}const NK=37297;let RK=0;function PK(n,e){const t=n.split(` 3992`),r=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=i;o<s;o++){const a=o+1;r.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return r.join(` 3993`)}const $N=new jt;function IK(n){an._getMatrix($N,an.workingColorSpace,n);const e=`mat3( ${$N.elements.map(t=>t.toFixed(4))} )`;switch(an.getTransfer(n)){case zp:return[e,"LinearTransferOETF"];case wn:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function XN(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` 3994 3995`+i+` 3996 3997`+PK(n.getShaderSource(e),o)}else return i}function FK(n,e){const t=IK(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` 3998`)}function DK(n,e){let t;switch(e){case xk:t="Linear";break;case vk:t="Reinhard";break;case yk:t="Cineon";break;case GE:t="ACESFilmic";break;case wk:t="AgX";break;case bk:t="Neutral";break;case _k:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const jx=new G;function kK(){an.getLuminanceCoefficients(jx);const n=jx.x.toFixed(4),e=jx.y.toFixed(4),t=jx.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` 3999`)}function LK(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Vf).join(` 4000`)}function jK(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(` 4001`)}function OK(n,e){const t={},r=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const s=n.getActiveAttrib(e,i),o=s.name;let a=1;s.type===n.FLOAT_MAT2&&(a=2),s.type===n.FLOAT_MAT3&&(a=3),s.type===n.FLOAT_MAT4&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function Vf(n){return n!==""}function qN(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function YN(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const UK=/^[ \t]*#include +<([\w\d./]+)>/gm;function r2(n){return n.replace(UK,zK)}const BK=new Map;function zK(n,e){let t=Ht[e];if(t===void 0){const r=BK.get(e);if(r!==void 0)t=Ht[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 r2(t)}const VK=/#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 KN(n){return n.replace(VK,HK)}function HK(n,e,t,r){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function ZN(n){let e=`precision ${n.precision} float; 4002 precision ${n.precision} int; 4003 precision ${n.precision} sampler2D; 4004 precision ${n.precision} samplerCube; 4005 precision ${n.precision} sampler3D; 4006 precision ${n.precision} sampler2DArray; 4007 precision ${n.precision} sampler2DShadow; 4008 precision ${n.precision} samplerCubeShadow; 4009 precision ${n.precision} sampler2DArrayShadow; 4010 precision ${n.precision} isampler2D; 4011 precision ${n.precision} isampler3D; 4012 precision ${n.precision} isamplerCube; 4013 precision ${n.precision} isampler2DArray; 4014 precision ${n.precision} usampler2D; 4015 precision ${n.precision} usampler3D; 4016 precision ${n.precision} usamplerCube; 4017 precision ${n.precision} usampler2DArray; 4018 `;return n.precision==="highp"?e+=` 4019#define HIGH_PRECISION`:n.precision==="mediump"?e+=` 4020#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=` 4021#define LOW_PRECISION`),e}function WK(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===Ry?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===rp?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Gs&&(e="SHADOWMAP_TYPE_VSM"),e}function GK(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Ca:case Ol:e="ENVMAP_TYPE_CUBE";break;case kh:e="ENVMAP_TYPE_CUBE_UV";break}return e}function $K(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Ol:e="ENVMAP_MODE_REFRACTION";break}return e}function XK(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case dm:e="ENVMAP_BLENDING_MULTIPLY";break;case mk:e="ENVMAP_BLENDING_MIX";break;case gk:e="ENVMAP_BLENDING_ADD";break}return e}function qK(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:r,max
vendor: 7,057 bytes, lines 4021-4028
4021Mip:t}}function YK(n,e,t,r){const i=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const c=WK(t),u=GK(t),f=$K(t),p=XK(t),m=qK(t),x=LK(t),v=jK(s),_=i.createProgram();let y,g,b=t.glslVersion?"#version "+t.glslVersion+` 4022`:"";t.isRawShaderMaterial?(y=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Vf).join(` 4023`),y.length>0&&(y+=` 4024`),g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Vf).join(` 4025`),g.length>0&&(g+=` 4026`)):(y=[ZN(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.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",` 4027`].filter(Vf).join(` 4028`),g=[ZN(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",t.envMap?"#define "+p:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
4028IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Io?"#define TONE_MAPPING":"",t.toneMapping!==Io?Ht.tonemapping_pars_fragment:"",t.toneMapping!==Io?DK("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Ht.colorspace_pars_fragment,FK("linearToOutputTexel",t.outputColorSpace),kK(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 4029`].filter(Vf).join(` 4030`)),o=r2(o),o=qN(o,t),o=YN(o,t),a=r2(a),a=qN(a,t),a=YN(a,t),o=KN(o),a=KN(a),t.isRawShaderMaterial!==!0&&(b=`#version 300 es 4031`,y=[x,"#define attribute in","#define varying out","#define texture2D texture"].join(` 4032`)+` 4033`+y,g=["#define varying in",t.glslVersion===XS?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===XS?"":"#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(` 4034`)+` 4035`+g);const S=b+y+o,M=b+g+a,A=GN(i,i.VERTEX_SHADER,S),R=GN(i,i.FRAGMENT_SHADER,M);i.attachShader(_,A),i.attachShader(_,R),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function F(D){if(n.debug.checkShaderErrors){const O=i.getProgramInfoLog(_).trim(),U=i.getShaderInfoLog(A).trim(),V=i.getShaderInfoLog(R).trim();let Z=!0,Y=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(Z=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,_,A,R);else{const ne=XN(i,A,"vertex"),j=XN(i,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+` 4036 4037Material Name: `+D.name+` 4038Material Type: `+D.type+` 4039 4040Program Info Log: `+O+` 4041`+ne+` 4042`+j)}else O!==""?console.warn("THREE.WebGLProgram: Program Info Log:",O):(U===""||V==="")&&(Y=!1);Y&&(D.diagnostics={runnable:Z,programLog:O,vertexShader:{log:U,prefix:y},fragmentShader:{log:V,prefix:g}})}i.deleteShader(A),i.deleteShader(R),L=new d0(i,_),N=OK(i,_)}let L;this.getUniforms=function(){return L===void 0&&F(this),L};let N;this.getAttributes=function(){return N===void 0&&F(this),N};let I=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return I===!1&&(I=i.getProgramParameter(_,NK)),I},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=RK++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=A,this.fragmentShader=R,this}let KK=0;class ZK{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)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 t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new QK(e),t.set(e,r)),r}}class QK{constructor(e){this.id=KK++,this.code=e,this.usedTimes=0}}function JK(n,e,t,r,i,s,o){const a=new qc,c=new ZK,u=new Set,f=[],p=i.logarithmicDepthBuffer,m=i.vertexTextures;let x=i.precision;const v={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 _(N){return u.add(N),N===0?"uv":`uv${N}`}function y(N,I,D,O,U){const V=O.fog,Z=U.geometry,Y=N.isMeshStandardMaterial?O.environment:null,ne=(N.isMeshStandardMaterial?t:e).get(N.envMap||Y),j=ne&&ne.mapping===kh?ne.image.height:null,$=v[N.type];N.precision!==null&&(x=i.getMaxPrecision(N.precision),x!==N.precision&&console.warn("THREE.WebGLProgram.getParameters:",N.precision,"not supported, using",x,"instead."));const K=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,re=K!==void 0?K.length:0;let xe=0;Z.morphAttributes.position!==void 0&&(xe=1),Z.morphAttributes.normal!==void 0&&(xe=2),Z.morphAttributes.color!==void 0&&(xe=3);let Ce,ce,_e,Re;if($){const Kt=Ks[$];Ce=Kt.vertexShader,ce=Kt.fragmentShader}else Ce=N.vertexShader,ce=N.fragmentShader,c.update(N),_e=c.getVertexShaderID(N),Re=c.getFragmentShaderID(N);const pe=n.getRenderTarget(),je=n.state.buffers.depth.getReversed(),nt=U.isInstancedMesh===!0,Pe=U.isBatchedMesh===!0,Ie=!!N.map,He
vendor: 17,439 bytes, lines 4042-4048
4042=!!N.matcap,ze=!!ne,H=!!N.aoMap,Fe=!!N.lightMap,Ae=!!N.bumpMap,Te=!!N.normalMap,be=!!N.displacementMap,Ke=!!N.emissiveMap,Ne=!!N.metalnessMap,W=!!N.roughnessMap,P=N.anisotropy>0,B=N.clearcoat>0,q=N.dispersion>0,se=N.iridescence>0,J=N.sheen>0,ue=N.transmission>0,me=P&&!!N.anisotropyMap,Oe=B&&!!N.clearcoatMap,Ze=B&&!!N.clearcoatNormalMap,Me=B&&!!N.clearcoatRoughnessMap,Je=se&&!!N.iridescenceMap,gt=se&&!!N.iridescenceThicknessMap,wt=J&&!!N.sheenColorMap,rt=J&&!!N.sheenRoughnessMap,ee=!!N.specularMap,we=!!N.specularColorMap,We=!!N.specularIntensityMap,Q=ue&&!!N.transmissionMap,Le=ue&&!!N.thicknessMap,ge=!!N.gradientMap,Ee=!!N.alphaMap,et=N.alphaTest>0,$e=!!N.alphaHash,bt=!!N.extensions;let sn=Io;N.toneMapped&&(pe===null||pe.isXRRenderTarget===!0)&&(sn=n.toneMapping);const Nn={shaderID:$,shaderType:N.type,shaderName:N.name,vertexShader:Ce,fragmentShader:ce,defines:N.defines,customVertexShaderID:_e,customFragmentShaderID:Re,isRawShaderMaterial:N.isRawShaderMaterial===!0,glslVersion:N.glslVersion,precision:x,batching:Pe,batchingColor:Pe&&U._colorsTexture!==null,instancing:nt,instancingColor:nt&&U.instanceColor!==null,instancingMorph:nt&&U.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:pe===null?n.outputColorSpace:pe.isXRRenderTarget===!0?pe.texture.colorSpace:au,alphaToCoverage:!!N.alphaToCoverage,map:Ie,matcap:He,envMap:ze,envMapMode:ze&&ne.mapping,envMapCubeUVHeight:j,aoMap:H,lightMap:Fe,bumpMap:Ae,normalMap:Te,displacementMap:m&&be,emissiveMap:Ke,normalMapObjectSpace:Te&&N.normalMapType===Nk,normalMapTangentSpace:Te&&N.normalMapType===$l,metalnessMap:Ne,roughnessMap:W,anisotropy:P,anisotropyMap:me,clearcoat:B,clearcoatMap:Oe,clearcoatNormalMap:Ze,clearcoatRoughnessMap:Me,dispersion:q,iridescence:se,iridescenceMap:Je,iridescenceThicknessMap:gt,sheen:J,sheenColorMap:wt,sheenRoughnessMap:rt,specularMap:ee,specularColorMap:we,specularIntensityMap:We,transmission:ue,transmissionMap:Q,thicknessMap:Le,gradientMap:ge,opaque:N.transparent===!1&&N.blending===$c&&N.alphaToCoverage===!1,alphaMap:Ee,alphaTest:et,alphaHash:$e,combine:N.combine,mapUv:Ie&&_(N.map.channel),aoMapUv:H&&_(N.aoMap.channel),lightMapUv:Fe&&_(N.lightMap.channel),bumpMapUv:Ae&&_(N.bumpMap.channel),normalMapUv:Te&&_(N.normalMap.channel),displacementMapUv:be&&_(N.displacementMap.channel),emissiveMapUv:Ke&&_(N.emissiveMap.channel),metalnessMapUv:Ne&&_(N.metalnessMap.channel),roughnessMapUv:W&&_(N.roughnessMap.channel),anisotropyMapUv:me&&_(N.anisotropyMap.channel),clearcoatMapUv:Oe&&_(N.clearcoatMap.channel),clearcoatNormalMapUv:Ze&&_(N.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Me&&_(N.clearcoatRoughnessMap.channel),iridescenceMapUv:Je&&_(N.iridescenceMap.channel),iridescenceThicknessMapUv:gt&&_(N.iridescenceThicknessMap.channel),sheenColorMapUv:wt&&_(N.sheenColorMap.channel),sheenRoughnessMapUv:rt&&_(N.sheenRoughnessMap.channel),specularMapUv:ee&&_(N.specularMap.channel),specularColorMapUv:we&&_(N.specularColorMap.channel),specularIntensityMapUv:We&&_(N.specularIntensityMap.channel),transmissionMapUv:Q&&_(N.transmissionMap.channel),thicknessMapUv:Le&&_(N.thicknessMap.channel),alphaMapUv:Ee&&_(N.alphaMap.channel),vertexTangents:!!Z.attributes.tangent&&(Te||P),vertexColors:N.vertexColors,vertexAlphas:N.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,pointsUvs:U.isPoints===!0&&!!Z.attributes.uv&&(Ie||Ee),fog:!!V,useFog:N.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:N.flatShading===!0,sizeAttenuation:N.sizeAttenuation===!0,logarithmicDepthBuffer:p,reverseDepthBuffer:je,skinning:U.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:xe,numDirLights:I.directional.length,numPointLights:I.point.length,numSpotLights:I.spot.length,numSpotLightMaps:I.spotLightMap.length,numRectAreaLights:I.rectArea.length,numHemiLights:I.hemi.length,numDirLightShadows:I.directionalShadowMap.length,numPointLightShadows:I.pointShadowMap.length,numSpotLightShadows:I.spotShadowMap.length,numSpotLightShadowsWithMaps:I.numSpotLightShadowsWithMaps,numLightProbes:I.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:N.dithering,shadowMapEnabled:n.shadowMap.enabled&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:sn,decodeVideoTexture:Ie&&N.map.isVideoTexture===!0&&an.getTransfer(N.map.colorSpace)===wn,decodeVideoTextureEmissive:Ke&&N.emissiveMap.isVideoTexture===!0&&an.getTransfer(N.emissiveMap.colorSpace)===wn,premultipliedAlpha:N.premultipliedAlpha,doubleSided:N.side===Ts,flipSided:N.side===mi,useDepthPacking:N.depthPacking>=0,depthPacking:N.depthPacking||0,index0AttributeName:N.index0AttributeName,extensionClipCullDistance:bt&&N.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(bt&&N.extensions.multiDraw===!0||Pe)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:N.customProgramCacheKey()};return Nn.vertexUv1s=u.has(1),Nn.vertexUv2s=u.has(2),Nn.vertexUv3s=u.has(3),u.clear(),Nn}function g(N){const I=[];if(N.shaderID?I.push(N.shaderID):(I.push(N.customVertexShaderID),I.push(N.customFragmentShaderID)),N.defines!==void 0)for(const D in N.defines)I.push(D),I.push(N.defines[D]);return N.isRawShaderMaterial===!1&&(b(I,N),S(I,N),I.push(n.outputColorSpace)),I.push(N.customProgramCacheKey),I.join()}function b(N,I){N.push(I.precision),N.push(I.outputColorSpace),N.push(I.envMapMode),N.push(I.envMapCubeUVHeight),N.push(I.mapUv),N.push(I.alphaMapUv),N.push(I.lightMapUv),N.push(I.aoMapUv),N.push(I.bumpMapUv),N.push(I.normalMapUv),N.push(I.displacementMapUv),N.push(I.emissiveMapUv),N.push(I.metalnessMapUv),N.push(I.roughnessMapUv),N.push(I.anisotropyMapUv),N.push(I.clearcoatMapUv),N.push(I.clearcoatNormalMapUv),N.push(I.clearcoatRoughnessMapUv),N.push(I.iridescenceMapUv),N.push(I.iridescenceThicknessMapUv),N.push(I.sheenColorMapUv),N.push(I.sheenRoughnessMapUv),N.push(I.specularMapUv),N.push(I.specularColorMapUv),N.push(I.specularIntensityMapUv),N.push(I.transmissionMapUv),N.push(I.thicknessMapUv),N.push(I.combine),N.push(I.fogExp2),N.push(I.sizeAttenuation),N.push(I.morphTargetsCount),N.push(I.morphAttributeCount),N.push(I.numDirLights),N.push(I.numPointLights),N.push(I.numSpotLights),N.push(I.numSpotLightMaps),N.push(I.numHemiLights),N.push(I.numRectAreaLights),N.push(I.numDirLightShadows),N.push(I.numPointLightShadows),N.push(I.numSpotLightShadows),N.push(I.numSpotLightShadowsWithMaps),N.push(I.numLightProbes),N.push(I.shadowMapType),N.push(I.toneMapping),N.push(I.numClippingPlanes),N.push(I.numClipIntersection),N.push(I.depthPacking)}function S(N,I){a.disableAll(),I.supportsVertexTextures&&a.enable(0),I.instancing&&a.enable(1),I.instancingColor&&a.enable(2),I.instancingMorph&&a.enable(3),I.matcap&&a.enable(4),I.envMap&&a.enable(5),I.normalMapObjectSpace&&a.enable(6),I.normalMapTangentSpace&&a.enable(7),I.clearcoat&&a.enable(8),I.iridescence&&a.enable(9),I.alphaTest&&a.enable(10),I.vertexColors&&a.enable(11),I.vertexAlphas&&a.enable(12),I.vertexUv1s&&a.enable(13),I.vertexUv2s&&a.enable(14),I.vertexUv3s&&a.enable(15),I.vertexTangents&&a.enable(16),I.anisotropy&&a.enable(17),I.alphaHash&&a.enable(18),I.batching&&a.enable(19),I.dispersion&&a.enable(20),I.batchingColor&&a.enable(21),N.push(a.mask),a.disableAll(),I.fog&&a.enable(0),I.useFog&&a.enable(1),I.flatShading&&a.enable(2),I.logarithmicDepthBuffer&&a.enable(3),I.reverseDepthBuffer&&a.enable(4),I.skinning&&a.enable(5),I.morphTargets&&a.enable(6),I.morphNormals&&a.enable(7),I.morphColors&&a.enable(8),I.premultipliedAlpha&&a.enable(9),I.shadowMapEnabled&&a.enable(10),I.doubleSided&&a.enable(11),I.flipSided&&a.enable(12),I.useDepthPacking&&a.enable(13),I.dithering&&a.enable(14),I.transmission&&a.enable(15),I.sheen&&a.enable(16),I.opaque&&a.enable(17),I.pointsUvs&&a.enable(18),I.decodeVideoTexture&&a.enable(19),I.decodeVideoTextureEmissive&&a.enable(20),I.alphaToCoverage&&a.enable(21),N.push(a.mask)}function M(N){const I=v[N.type];let D;if(I){const O=Ks[I];D=Vk.clone(O.uniforms)}else D=N.uniforms;return D}function A(N,I){let D;for(let O=0,U=f.length;O<U;O++){const V=f[O];if(V.cacheKey===I){D=V,++D.usedTimes;break}}return D===void 0&&(D=new YK(n,I,N,s),f.push(D)),D}function R(N){if(--N.usedTimes===0){const I=f.indexOf(N);f[I]=f[f.length-1],f.pop(),N.destroy()}}function F(N){c.remove(N)}function L(){c.dispose()}return{getParameters:y,getProgramCacheKey:g,getUniforms:M,acquireProgram:A,releaseProgram:R,releaseShaderCache:F,programs:f,dispose:L}}function eZ(){let n=new WeakMap;function e(o){return n.has(o)}function t(o){let a=n.get(o);return a===void 0&&(a={},n.set(o,a)),a}function r(o){n.delete(o)}function i(o,a,c){n.get(o)[a]=c}function s(){n=new WeakMap}return{has:e,get:t,remove:r,update:i,dispose:s}}function tZ(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function QN(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function JN(){const n=[];let e=0;const t=[],r=[],i=[];function s(){e=0,t.length=0,r.length=0,i.length=0}function o(p,m,x,v,_,y){let g=n[e];return g===void 0?(g={id:p.id,object:p,geometry:m,material:x,groupOrder:v,renderOrder:p.renderOrder,z:_,group:y},n[e]=g):(g.id=p.id,g.object=p,g.geometry=m,g.material=x,g.groupOrder=v,g.renderOrder=p.renderOrder,g.z=_,g.group=y),e++,g}function a(p,m,x,v,_,y){const g=o(p,m,x,v,_,y);x.transmission>0?r.push(g):x.transparent===!0?i.push(g):t.push(g)}function c(p,m,x,v,_,y){const g=o(p,m,x,v,_,y);x.transmission>0?r.unshift(g):x.transparent===!0?i.unshift(g):t.unshift(g)}function u(p,m){t.length>1&&t.sort(p||tZ),r.length>1&&r.sort(m||QN),i.length>1&&i.sort(m||QN)}function f(){for(let p=e,m=n.length;p<m;p++){const x=n[p];if(x.id===null)break;x.id=null,x.object=null,x.geometry=null,x.material=null,x.group=null}}return{opaque:t,transmissive:r,transparent:i,init:s,push:a,unshift:c,finish:f,sort:u}}function nZ(){let n=new WeakMap;function e(r,i){const s=n.get(r);let o;return s===void 0?(o=new JN,n.set(r,[o])):i>=s.length?(o=new JN,s.push(o)):o=s[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function rZ(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new G,color:new at};break;case"SpotLight":t={position:new G,direction:new G,color:new at,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new G,color:new at,distance:0,decay:0};break;case"HemisphereLight":t={direction:new G,skyColor:new at,groundColor:new at};break;case"RectAreaLight":t={color:new at,position:new G,halfWidth:new G,halfHeight:new G};break}return n[e.id]=t,t}}}function iZ(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Se};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Se};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Se,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let sZ=0;function oZ(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function aZ(n){const e=new rZ,t=iZ(),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 u=0;u<9;u++)r.probe.push(new G);const i=new G,s=new Rt,o=new Rt;function a(u){let f=0,p=0,m=0;for(let N=0;N<9;N++)r.probe[N].set(0,0,0);let x=0,v=0,_=0,y=0,g=0,b=0,S=0,M=0,A=0,R=0,F=0;u.sort(oZ);for(let N=0,I=u.length;N<I;N++){const D=u[N],O=D.color,U=D.intensity,V=D.distance,Z=D.shadow&&D.shadow.map?D.shadow.map.texture:null;if(D.isAmbientLight)f+=O.r*U,p+=O.g*U,m+=O.b*U;else if(D.isLightProbe){for(let Y=0;Y<9;Y++)r.probe[Y].addScaledVector(D.sh.coefficients[Y],U);F++}else if(D.isDirectionalLight){const Y=e.get(D);if(Y.color.copy(D.color).multiplyScalar(D.intensity),D.castShadow){const ne=D.shadow,j=t.get(D);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,r.directionalShadow[x]=j,r.directionalShadowMap[x]=Z,r.directionalShadowMatrix[x]=D.shadow.matrix,b++}r.directional[x]=Y,x++}else if(D.isSpotLight){const Y=e.get(D);Y.position.setFromMatrixPosition(D.matrixWorld),Y.color.copy(O).multiplyScalar(U),Y.distance=V,Y.coneCos=Math.cos(D.angle),Y.penumbraCos=Math.cos(D.angle*(1-D.penumbra)),Y.decay=D.decay,r.spot[_]=Y;const ne=D.shadow;if(D.map&&(r.spotLightMap[A]=D.map,A++,ne.updateMatrices(D),D.castShadow&&R++),r.spotLightMatrix[_]=ne.matrix,D.castShadow){const j=t.get(D);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,r.spotShadow[_]=j,r.spotShadowMap[_]=Z,M++}_++}else if(D.isRectAreaLight){const Y=e.get(D);Y.color.copy(O).multiplyScalar(U),Y.halfWidth.set(D.width*.5,0,0),Y.halfHeight.set(0,D.height*.5,0),r.rectArea[y]=Y,y++}else if(D.isPointLight){const Y=e.get(D);if(Y.color.copy(D.color).multiplyScalar(D.intensity),Y.distance=D.distance,Y.decay=D.decay,D.castShadow){const ne=D.shadow,j=t.get(D);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,j.shadowCameraNear=ne.camera.near,j.shadowCameraFar=ne.camera.far,r.pointShadow[v]=j,r.pointShadowMap[v]=Z,r.pointShadowMatrix[v]=D.shadow.matrix,S++}r.point[v]=Y,v++}else if(D.isHemisphereLight){const Y=e.get(D);Y.skyColor.copy(D.color).multiplyScalar(U),Y.groundColor.copy(D.groundColor).multiplyScalar(U),r.hemi[g]=Y,g++}}y>0&&(n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=qe.LTC_FLOAT_1,r.rectAreaLTC2=qe.LTC_FLOAT_2):(r.rectAreaLTC1=qe.LTC_HALF_1,r.rectAreaLTC2=qe.LTC_HALF_2)),r.ambient[0]=f,r.ambient[1]=p,r.ambient[2]=m;const L=r.hash;(L.directionalLength!==x||L.pointLength!==v||L.spotLength!==_||L.rectAreaLength!==y||L.hemiLength!==g||L.numDirectionalShadows!==b||L.numPointShadows!==S||L.numSpotShadows!==M||L.numSpotMaps!==A||L.numLightProbes!==F)&&(r.directional.length=x,r.spot.length=_,r.rectArea.length=y,r.point.length=v,r.hemi.length=g,r.directionalShadow.length=b,r.directionalShadowMap.length=b,r.pointShadow.length=S,r.pointShadowMap.length=S,r.spotShadow.length=M,r.spotShadowMap.length=M,r.directionalShadowMatrix.length=b,r.pointShadowMatrix.length=S,r.spotLightMatrix.length=M+A-R,r.spotLightMap.length=A,r.numSpotLightShadowsWithMaps=R,r.numLightProbes=F,L.directionalLength=x,L.pointLength=v,L.spotLength=_,L.rectAreaLength=y,L.hemiLength=g,L.numDirectionalShadows=b,L.numPointShadows=S,L.numSpotShadows=M,L.numSpotMaps=A,L.numLightProbes=F,r.version=sZ++)}function c(u,f){let p=0,m=0,x=0,v=0,_=0;const y=f.matrixWorldInverse;for(let g=0,b=u.length;g<b;g++){const S=u[g];if(S.isDirectionalLight){const M=r.directional[p];M.direction.setFromMatrixPosition(S.matrixWorld),i.setFromMatrixPosition(S.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(y),p++}else if(S.isSpotLight){const M=r.spot[x];M.position.setFromMatrixPosition(S.matrixWorld),M.position.applyMatrix4(y),M.direction.setFromMatrixPosition(S.matrixWorld),i.setFromMatrixPosition(S.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(y),x++}else if(S.isRectAreaLight){const M=r.rectArea[v];M.position.setFromMatrixPosition(S.matrixWorld),M.position.applyMatrix4(y),o.identity(),s.copy(S.matrixWorld),s.premultiply(y),o.extractRotation(s),M.halfWidth.set(S.width*.5,0,0),M.halfHeight.set(0,S.height*.5,0),M.halfWidth.applyMatrix4(o),M.halfHeight.applyMatrix4(o),v++}else if(S.isPointLight){const M=r.point[m];M.position.setFromMatrixPosition(S.matrixWorld),M.position.applyMatrix4(y),m++}else if(S.isHemisphereLight){const M=r.hemi[_];M.direction.setFromMatrixPosition(S.matrixWorld),M.direction.transformDirection(y),_++}}}return{setup:a,setupView:c,state:r}}function eR(n){const e=new aZ(n),t=[],r=[];function i(f){u.camera=f,t.length=0,r.length=0}function s(f){t.push(f)}function o(f){r.push(f)}function a(){e.setup(t)}function c(f){e.setupView(t,f)}const u={lightsArray:t,shadowsArray:r,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:u,setupLights:a,setupLightsView:c,pushLight:s,pushShadow:o}}function lZ(n){let e=new WeakMap;function t(i,s=0){const o=e.get(i);let a;return o===void 0?(a=new eR(n),e.set(i,[a])):s>=o.length?(a=new eR(n),o.push(a)):a=o[s],a}function r(){e=new WeakMap}return{get:t,dispose:r}}const cZ=`void main() { 4043 gl_Position = vec4( position, 1.0 ); 4044}`,uZ=`uniform sampler2D shadow_pass; 4045uniform vec2 resolution; 4046uniform float radius; 4047#include <packing> 4048void main() {
4049 const float samples = float( VSM_SAMPLES ); 4050 float mean = 0.0; 4051 float squared_mean = 0.0; 4052 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 4053 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 4054 for ( float i = 0.0; i < samples; i ++ ) { 4055 float uvOffset = uvStart + i * uvStride; 4056 #ifdef HORIZONTAL_PASS 4057 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 4058 mean += distribution.x; 4059 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 4060 #else 4061 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 4062 mean += depth; 4063 squared_mean += depth * depth; 4064 #endif 4065 } 4066 mean = mean / samples; 4067 squared_mean = squared_mean / samples; 4068 float std_dev = sqrt( squared_mean - mean * mean ); 4069 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 4070}`;function dZ(n,e,t){let r=new jh;const i=new Se,s=new Se,o=new cn,a=new xM({depthPacking:Ck}),c=new vM,u={},f=t.maxTextureSize,p={[Ta]:mi,[mi]:Ta,[Ts]:Ts},m=new so({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Se},radius:{value:4}},vertexShader:cZ,fragmentShader:uZ}),x=m.clone();x.defines.HORIZONTAL_PASS=1;const v=new zt;v.setAttribute("position",new En(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new cr(v,m),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ry;let g=this.type;this.render=function(R,F,L){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||R.length===0)return;const N=n.getRenderTarget(),I=n.getActiveCubeFace(),D=n.getActiveMipmapLevel(),O=n.state;O.setBlending(va),O.buffers.color.setClear(1,1,1,1),O.buffers.depth.setTest(!0),O.setScissorTest(!1);const U=g!==Gs&&this.type===Gs,V=g===Gs&&this.type!==Gs;for(let Z=0,Y=R.length;Z<Y;Z++){const ne=R[Z],j=ne.shadow;if(j===void 0){console.warn("THREE.WebGLShadowMap:",ne,"has no shadow.");continue}if(j.autoUpdate===!1&&j.needsUpdate===!1)continue;i.copy(j.mapSize);const $=j.getFrameExtents();if(i.multiply($),s.copy(j.mapSize),(i.x>f||i.y>f)&&(i.x>f&&(s.x=Math.floor(f/$.x),i.x=s.x*$.x,j.mapSize.x=s.x),i.y>f&&(s.y=Math.floor(f/$.y),i.y=s.y*$.y,j.mapSize.y=s.y)),j.map===null||U===!0||V===!0){const re=this.type!==Gs?{minFilter:Lr,magFilter:Lr}:{};j.map!==null&&j.map.dispose(),j.map=new Oo(i.x,i.y,re),j.map.texture.name=ne.name+".shadowMap",j.camera.updateProjectionMatrix()}n.setRenderTarget(j.map),n.clear();const K=j.getViewportCount();for(let re=0;re<K;re++){const xe=j.getViewport(re);o.set(s.x*xe.x,s.y*xe.y,s.x*xe.z,s.y*xe.w),O.viewport(o),j.updateMatrices(ne,re),r=j.getFrustum(),M(F,L,j.camera,ne,this.type)}j.isPointLightShadow!==!0&&this.type===Gs&&b(j,L),j.needsUpdate=!1}g=this.type,y.needsUpdate=!1,n.setRenderTarget(N,I,D)};function b(R,F){const L=e.update(_);m.defines.VSM_SAMPLES!==R.blurSamples&&(m.defines.VSM_SAMPLES=R.blurSamples,x.defines.VSM_SAMPLES=R.blurSamples,m.needsUpdate=!0,x.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new Oo(i.x,i.y)),m.uniforms.shadow_pass.value=R.map.texture,m.uniforms.resolution.value=R.mapSize,m.uniforms.radius.value=R.radius,n.setRenderTarget(R.mapPass),n.clear(),n.renderBufferDirect(F,null,L,m,_,null),x.uniforms.shadow_pass.value=R.mapPass.texture,x.uniforms.resolution.value=R.mapSize,x.uniforms.radius.value=R.radius,n.setRenderTarget(R.map),n.clear(),n.renderBufferDirect(F,null,L,x,_,null)}function S(R,F,L,N){let I=null;const D=L.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(D!==void 0)I=D;else if(I=L.isPointLight===!0?c:a,n.localClippingEnabled&&F.clipShadows===!0&&Array.isArray(F.clippingPlanes)&&F.clippingPlanes.length!==0||F.displacementMap&&F.displacementScale!==0||F.alphaMap&&F.alphaTest>0||F.map&&F.alphaTest>0||F.alphaToCoverage===!0){const O=I.uuid,U=F.uuid;let V=u[O];V===void 0&&(V={},u[O]=V);let Z=V[U];Z===void 0&&(Z=I.clone(),V[U]=Z,F.addEventListener("dispose",A)),I=Z}if(I.visible=F.visible,I.wireframe=F.wireframe,N===Gs?I.side=F.shadowSide!==null?F.shadowSide:F.side:I.side=F.shadowSide!==null?F.shadowSide:p[F.side],I.alphaMap=F.alphaMap,I.alphaTest=F.alphaToCoverage===!0?.5:F.alph
vendor: 5,594 bytes, line 4070
4070aTest,I.map=F.map,I.clipShadows=F.clipShadows,I.clippingPlanes=F.clippingPlanes,I.clipIntersection=F.clipIntersection,I.displacementMap=F.displacementMap,I.displacementScale=F.displacementScale,I.displacementBias=F.displacementBias,I.wireframeLinewidth=F.wireframeLinewidth,I.linewidth=F.linewidth,L.isPointLight===!0&&I.isMeshDistanceMaterial===!0){const O=n.properties.get(I);O.light=L}return I}function M(R,F,L,N,I){if(R.visible===!1)return;if(R.layers.test(F.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&I===Gs)&&(!R.frustumCulled||r.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,R.matrixWorld);const U=e.update(R),V=R.material;if(Array.isArray(V)){const Z=U.groups;for(let Y=0,ne=Z.length;Y<ne;Y++){const j=Z[Y],$=V[j.materialIndex];if($&&$.visible){const K=S(R,$,N,I);R.onBeforeShadow(n,R,F,L,U,K,j),n.renderBufferDirect(L,null,U,K,R,j),R.onAfterShadow(n,R,F,L,U,K,j)}}}else if(V.visible){const Z=S(R,V,N,I);R.onBeforeShadow(n,R,F,L,U,Z,null),n.renderBufferDirect(L,null,U,Z,R,null),R.onAfterShadow(n,R,F,L,U,Z,null)}}const O=R.children;for(let U=0,V=O.length;U<V;U++)M(O[U],F,L,N,I)}function A(R){R.target.removeEventListener("dispose",A);for(const L in u){const N=u[L],I=R.target.uuid;I in N&&(N[I].dispose(),delete N[I])}}}const hZ={[J0]:ev,[tv]:iv,[nv]:sv,[ou]:rv,[ev]:J0,[iv]:tv,[sv]:nv,[rv]:ou};function fZ(n,e){function t(){let Q=!1;const Le=new cn;let ge=null;const Ee=new cn(0,0,0,0);return{setMask:function(et){ge!==et&&!Q&&(n.colorMask(et,et,et,et),ge=et)},setLocked:function(et){Q=et},setClear:function(et,$e,bt,sn,Nn){Nn===!0&&(et*=sn,$e*=sn,bt*=sn),Le.set(et,$e,bt,sn),Ee.equals(Le)===!1&&(n.clearColor(et,$e,bt,sn),Ee.copy(Le))},reset:function(){Q=!1,ge=null,Ee.set(-1,0,0,0)}}}function r(){let Q=!1,Le=!1,ge=null,Ee=null,et=null;return{setReversed:function($e){if(Le!==$e){const bt=e.get("EXT_clip_control");$e?bt.clipControlEXT(bt.LOWER_LEFT_EXT,bt.ZERO_TO_ONE_EXT):bt.clipControlEXT(bt.LOWER_LEFT_EXT,bt.NEGATIVE_ONE_TO_ONE_EXT),Le=$e;const sn=et;et=null,this.setClear(sn)}},getReversed:function(){return Le},setTest:function($e){$e?pe(n.DEPTH_TEST):je(n.DEPTH_TEST)},setMask:function($e){ge!==$e&&!Q&&(n.depthMask($e),ge=$e)},setFunc:function($e){if(Le&&($e=hZ[$e]),Ee!==$e){switch($e){case J0:n.depthFunc(n.NEVER);break;case ev:n.depthFunc(n.ALWAYS);break;case tv:n.depthFunc(n.LESS);break;case ou:n.depthFunc(n.LEQUAL);break;case nv:n.depthFunc(n.EQUAL);break;case rv:n.depthFunc(n.GEQUAL);break;case iv:n.depthFunc(n.GREATER);break;case sv:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ee=$e}},setLocked:function($e){Q=$e},setClear:function($e){et!==$e&&(Le&&($e=1-$e),n.clearDepth($e),et=$e)},reset:function(){Q=!1,ge=null,Ee=null,et=null,Le=!1}}}function i(){let Q=!1,Le=null,ge=null,Ee=null,et=null,$e=null,bt=null,sn=null,Nn=null;return{setTest:function(Kt){Q||(Kt?pe(n.STENCIL_TEST):je(n.STENCIL_TEST))},setMask:function(Kt){Le!==Kt&&!Q&&(n.stencilMask(Kt),Le=Kt)},setFunc:function(Kt,rr,Ur){(ge!==Kt||Ee!==rr||et!==Ur)&&(n.stencilFunc(Kt,rr,Ur),ge=Kt,Ee=rr,et=Ur)},setOp:function(Kt,rr,Ur){($e!==Kt||bt!==rr||sn!==Ur)&&(n.stencilOp(Kt,rr,Ur),$e=Kt,bt=rr,sn=Ur)},setLocked:function(Kt){Q=Kt},setClear:function(Kt){Nn!==Kt&&(n.clearStencil(Kt),Nn=Kt)},reset:function(){Q=!1,Le=null,ge=null,Ee=null,et=null,$e=null,bt=null,sn=null,Nn=null}}}const s=new t,o=new r,a=new i,c=new WeakMap,u=new WeakMap;let f={},p={},m=new WeakMap,x=[],v=null,_=!1,y=null,g=null,b=null,S=null,M=null,A=null,R=null,F=new at(0,0,0),L=0,N=!1,I=null,D=null,O=null,U=null,V=null;const Z=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let Y=!1,ne=0;const j=n.getParameter(n.VERSION);j.indexOf("WebGL")!==-1?(ne=parseFloat(/^WebGL (\d)/.exec(j)[1]),Y=ne>=1):j.indexOf("OpenGL ES")!==-1&&(ne=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),Y=ne>=2);let $=null,K={};const re=n.getParameter(n.SCISSOR_BOX),xe=n.getParameter(n.VIEWPORT),Ce=new cn().fromArray(re),ce=new cn().fromArray(xe);function _e(Q,Le,ge,Ee){const et=new Uint8Array(4),$e=n.createTexture();n.bindTexture(Q,$e),n.texParameteri(Q,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(Q,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let bt=0;bt<ge;bt++)Q===n.TEXTURE_3D||Q===n.TEXTURE_2D_ARRAY?n.texImage3D(Le,0,n.RGBA,1,1,Ee,0,n.RGBA,n.UNSIGNED_BYTE,et):n.texImage2D(Le+bt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,et);return $e}const Re={};Re[n.TEXTURE_2D]=_e(n.TEXTURE_2D,n.TEXTURE_2D,1),Re[n.TEXTURE_CUBE_MAP]=_e(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),Re[n.TEXTURE_2D_ARRAY]=_e(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),Re[n.TEXTURE_3D]=_e(n.TEXTURE_3D,n.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),a.setClear(0),pe(n.DEPTH_TEST),o.setFunc(ou),Ae(!1),Te(zS),pe(n.CULL_FACE),H(va);function pe(Q){f[Q]!==!0&&(n.enable(Q),f[Q]=!0)}function je(Q){f[Q]!==!1&&(n.disable(Q),f[Q]=!1)}function nt(Q,Le){return p[Q]!==Le?(n.bindFramebuffer(Q,Le),p[Q]=Le,Q===n.DRAW_FRAMEBUFFER&&(p[n.FRAMEBUFFER]=Le),Q===n.FRAMEBUFFER&&(p[n.DRAW_FRAMEBUFFER]=Le),!0):!1}function Pe(Q,Le){let ge=x,Ee=!1;if(Q){ge=m.get(Le),ge===void 0&&(ge=[],m.set(Le,ge));const et=Q.textures;if(ge.length!==et.length||ge[0]!==n.COLOR_ATTACHMENT0){for(let $e=0,bt=et.length;$e<bt;$e++)ge[$e]=n.COLOR_ATTACHMENT0+$e;ge.length=et.length,Ee=!0}}else ge[0]!==n.BACK&&(ge[0]=n.BACK,Ee=!0);Ee&&n.drawBuffers(ge)}function Ie(Q){return v!==Q?(n.useProgram(Q),v=Q,!0):!1}const He={[al]:n.FUNC_ADD,[QD]:n.FUNC_SUBTRACT,[JD]:n.FUNC_REVERSE_SUBTRACT};He[ek]=n.MIN,He[tk]=n.MAX;const ze={[nk]:n.ZERO,[rk]:n.ONE,[ik]:n.SRC_COLOR,[Z0]:n.SRC_ALPHA,[uk]:n.SRC_ALPHA_SATURATE,[lk]:n.DST_COLOR,[ok]:n.DST_ALPHA,[
vendor: 4,827 bytes, line 4070
4070sk]:n.ONE_MINUS_SRC_COLOR,[Q0]:n.ONE_MINUS_SRC_ALPHA,[ck]:n.ONE_MINUS_DST_COLOR,[ak]:n.ONE_MINUS_DST_ALPHA,[dk]:n.CONSTANT_COLOR,[hk]:n.ONE_MINUS_CONSTANT_COLOR,[fk]:n.CONSTANT_ALPHA,[pk]:n.ONE_MINUS_CONSTANT_ALPHA};function H(Q,Le,ge,Ee,et,$e,bt,sn,Nn,Kt){if(Q===va){_===!0&&(je(n.BLEND),_=!1);return}if(_===!1&&(pe(n.BLEND),_=!0),Q!==ZD){if(Q!==y||Kt!==N){if((g!==al||M!==al)&&(n.blendEquation(n.FUNC_ADD),g=al,M=al),Kt)switch(Q){case $c:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case VS:n.blendFunc(n.ONE,n.ONE);break;case HS:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case WS:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",Q);break}else switch(Q){case $c:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case VS:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case HS:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case WS:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",Q);break}b=null,S=null,A=null,R=null,F.set(0,0,0),L=0,y=Q,N=Kt}return}et=et||Le,$e=$e||ge,bt=bt||Ee,(Le!==g||et!==M)&&(n.blendEquationSeparate(He[Le],He[et]),g=Le,M=et),(ge!==b||Ee!==S||$e!==A||bt!==R)&&(n.blendFuncSeparate(ze[ge],ze[Ee],ze[$e],ze[bt]),b=ge,S=Ee,A=$e,R=bt),(sn.equals(F)===!1||Nn!==L)&&(n.blendColor(sn.r,sn.g,sn.b,Nn),F.copy(sn),L=Nn),y=Q,N=!1}function Fe(Q,Le){Q.side===Ts?je(n.CULL_FACE):pe(n.CULL_FACE);let ge=Q.side===mi;Le&&(ge=!ge),Ae(ge),Q.blending===$c&&Q.transparent===!1?H(va):H(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst,Q.blendEquationAlpha,Q.blendSrcAlpha,Q.blendDstAlpha,Q.blendColor,Q.blendAlpha,Q.premultipliedAlpha),o.setFunc(Q.depthFunc),o.setTest(Q.depthTest),o.setMask(Q.depthWrite),s.setMask(Q.colorWrite);const Ee=Q.stencilWrite;a.setTest(Ee),Ee&&(a.setMask(Q.stencilWriteMask),a.setFunc(Q.stencilFunc,Q.stencilRef,Q.stencilFuncMask),a.setOp(Q.stencilFail,Q.stencilZFail,Q.stencilZPass)),Ke(Q.polygonOffset,Q.polygonOffsetFactor,Q.polygonOffsetUnits),Q.alphaToCoverage===!0?pe(n.SAMPLE_ALPHA_TO_COVERAGE):je(n.SAMPLE_ALPHA_TO_COVERAGE)}function Ae(Q){I!==Q&&(Q?n.frontFace(n.CW):n.frontFace(n.CCW),I=Q)}function Te(Q){Q!==qD?(pe(n.CULL_FACE),Q!==D&&(Q===zS?n.cullFace(n.BACK):Q===YD?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):je(n.CULL_FACE),D=Q}function be(Q){Q!==O&&(Y&&n.lineWidth(Q),O=Q)}function Ke(Q,Le,ge){Q?(pe(n.POLYGON_OFFSET_FILL),(U!==Le||V!==ge)&&(n.polygonOffset(Le,ge),U=Le,V=ge)):je(n.POLYGON_OFFSET_FILL)}function Ne(Q){Q?pe(n.SCISSOR_TEST):je(n.SCISSOR_TEST)}function W(Q){Q===void 0&&(Q=n.TEXTURE0+Z-1),$!==Q&&(n.activeTexture(Q),$=Q)}function P(Q,Le,ge){ge===void 0&&($===null?ge=n.TEXTURE0+Z-1:ge=$);let Ee=K[ge];Ee===void 0&&(Ee={type:void 0,texture:void 0},K[ge]=Ee),(Ee.type!==Q||Ee.texture!==Le)&&($!==ge&&(n.activeTexture(ge),$=ge),n.bindTexture(Q,Le||Re[Q]),Ee.type=Q,Ee.texture=Le)}function B(){const Q=K[$];Q!==void 0&&Q.type!==void 0&&(n.bindTexture(Q.type,null),Q.type=void 0,Q.texture=void 0)}function q(){try{n.compressedTexImage2D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function se(){try{n.compressedTexImage3D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function J(){try{n.texSubImage2D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function ue(){try{n.texSubImage3D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function me(){try{n.compressedTexSubImage2D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function Oe(){try{n.compressedTexSubImage3D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function Ze(){try{n.texStorage2D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function Me(){try{n.texStorage3D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function Je(){try{n.texImage2D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function gt(){try{n.texImage3D(...arguments)}catch(Q){console.error("THREE.WebGLState:",Q)}}function wt(Q){Ce.equals(Q)===!1&&(n.scissor(Q.x,Q.y,Q.z,Q.w),Ce.copy(Q))}function rt(Q){ce.equals(Q)===!1&&(n.viewport(Q.x,Q.y,Q.z,Q.w),ce.copy(Q))}function ee(Q,Le){let ge=u.get(Le);ge===void 0&&(ge=new WeakMap,u.set(Le,ge));let Ee=ge.get(Q);Ee===void 0&&(Ee=n.getUniformBlockIndex(Le,Q.name),ge.set(Q,Ee))}function we(Q,Le){const Ee=u.get(Le).get(Q);c.get(Le)!==Ee&&(n.uniformBlockBinding(Le,Ee,Q.__bindingPointIndex),c.set(Le,Ee))}function We(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor
vendor: 32,506 bytes, line 4070
4070(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),o.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),f={},$=null,K={},p={},m=new WeakMap,x=[],v=null,_=!1,y=null,g=null,b=null,S=null,M=null,A=null,R=null,F=new at(0,0,0),L=0,N=!1,I=null,D=null,O=null,U=null,V=null,Ce.set(0,0,n.canvas.width,n.canvas.height),ce.set(0,0,n.canvas.width,n.canvas.height),s.reset(),o.reset(),a.reset()}return{buffers:{color:s,depth:o,stencil:a},enable:pe,disable:je,bindFramebuffer:nt,drawBuffers:Pe,useProgram:Ie,setBlending:H,setMaterial:Fe,setFlipSided:Ae,setCullFace:Te,setLineWidth:be,setPolygonOffset:Ke,setScissorTest:Ne,activeTexture:W,bindTexture:P,unbindTexture:B,compressedTexImage2D:q,compressedTexImage3D:se,texImage2D:Je,texImage3D:gt,updateUBOMapping:ee,uniformBlockBinding:we,texStorage2D:Ze,texStorage3D:Me,texSubImage2D:J,texSubImage3D:ue,compressedTexSubImage2D:me,compressedTexSubImage3D:Oe,scissor:wt,viewport:rt,reset:We}}function pZ(n,e,t,r,i,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Se,f=new WeakMap;let p;const m=new WeakMap;let x=!1;try{x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(W,P){return x?new OffscreenCanvas(W,P):Wp("canvas")}function _(W,P,B){let q=1;const se=Ne(W);if((se.width>B||se.height>B)&&(q=B/Math.max(se.width,se.height)),q<1)if(typeof HTMLImageElement<"u"&&W instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&W instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&W instanceof ImageBitmap||typeof VideoFrame<"u"&&W instanceof VideoFrame){const J=Math.floor(q*se.width),ue=Math.floor(q*se.height);p===void 0&&(p=v(J,ue));const me=P?v(J,ue):p;return me.width=J,me.height=ue,me.getContext("2d").drawImage(W,0,0,J,ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+J+"x"+ue+")."),me}else return"data"in W&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),W;return W}function y(W){return W.generateMipmaps}function g(W){n.generateMipmap(W)}function b(W){return W.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:W.isWebGL3DRenderTarget?n.TEXTURE_3D:W.isWebGLArrayRenderTarget||W.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function S(W,P,B,q,se=!1){if(W!==null){if(n[W]!==void 0)return n[W];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+W+"'")}let J=P;if(P===n.RED&&(B===n.FLOAT&&(J=n.R32F),B===n.HALF_FLOAT&&(J=n.R16F),B===n.UNSIGNED_BYTE&&(J=n.R8)),P===n.RED_INTEGER&&(B===n.UNSIGNED_BYTE&&(J=n.R8UI),B===n.UNSIGNED_SHORT&&(J=n.R16UI),B===n.UNSIGNED_INT&&(J=n.R32UI),B===n.BYTE&&(J=n.R8I),B===n.SHORT&&(J=n.R16I),B===n.INT&&(J=n.R32I)),P===n.RG&&(B===n.FLOAT&&(J=n.RG32F),B===n.HALF_FLOAT&&(J=n.RG16F),B===n.UNSIGNED_BYTE&&(J=n.RG8)),P===n.RG_INTEGER&&(B===n.UNSIGNED_BYTE&&(J=n.RG8UI),B===n.UNSIGNED_SHORT&&(J=n.RG16UI),B===n.UNSIGNED_INT&&(J=n.RG32UI),B===n.BYTE&&(J=n.RG8I),B===n.SHORT&&(J=n.RG16I),B===n.INT&&(J=n.RG32I)),P===n.RGB_INTEGER&&(B===n.UNSIGNED_BYTE&&(J=n.RGB8UI),B===n.UNSIGNED_SHORT&&(J=n.RGB16UI),B===n.UNSIGNED_INT&&(J=n.RGB32UI),B===n.BYTE&&(J=n.RGB8I),B===n.SHORT&&(J=n.RGB16I),B===n.INT&&(J=n.RGB32I)),P===n.RGBA_INTEGER&&(B===n.UNSIGNED_BYTE&&(J=n.RGBA8UI),B===n.UNSIGNED_SHORT&&(J=n.RGBA16UI),B===n.UNSIGNED_INT&&(J=n.RGBA32UI),B===n.BYTE&&(J=n.RGBA8I),B===n.SHORT&&(J=n.RGBA16I),B===n.INT&&(J=n.RGBA32I)),P===n.RGB&&B===n.UNSIGNED_INT_5_9_9_9_REV&&(J=n.RGB9_E5),P===n.RGBA){const ue=se?zp:an.getTransfer(q);B===n.FLOAT&&(J=n.RGBA32F),B===n.HALF_FLOAT&&(J=n.RGBA16F),B===n.UNSIGNED_BYTE&&(J=ue===wn?n.SRGB8_ALPHA8:n.RGBA8),B===n.UNSIGNED_SHORT_4_4_4_4&&(J=n.RGBA4),B===n.UNSIGNED_SHORT_5_5_5_1&&(J=n.RGB5_A1)}return(J===n.R16F||J===n.R32F||J===n.RG16F||J===n.RG32F||J===n.RGBA16F||J===n.RGBA32F)&&e.get("EXT_color_buffer_float"),J}function M(W,P){let B;return W?P===null||P===Na||P===ph?B=n.DEPTH24_STENCIL8:P===Li?B=n.DEPTH32F_STENCIL8:P===fh&&(B=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):P===null||P===Na||P===ph?B=n.DEPTH_COMPONENT24:P===Li?B=n.DEPTH_COMPONENT32F:P===fh&&(B=n.DEPTH_COMPONENT16),B}function A(W,P){return y(W)===!0||W.isFramebufferTexture&&W.minFilter!==Lr&&W.minFilter!==xr?Math.log2(Math.max(P.width,P.height))+1:W.mipmaps!==void 0&&W.mipmaps.length>0?W.mipmaps.length:W.isCompressedTexture&&Array.isArray(W.image)?P.mipmaps.length:1}function R(W){const P=W.target;P.removeEventListener("dispose",R),L(P),P.isVideoTexture&&f.delete(P)}function F(W){const P=W.target;P.removeEventListener("dispose",F),I(P)}function L(W){const P=r.get(W);if(P.__webglInit===void 0)return;const B=W.source,q=m.get(B);if(q){const se=q[P.__cacheKey];se.usedTimes--,se.usedTimes===0&&N(W),Object.keys(q).length===0&&m.delete(B)}r.remove(W)}function N(W){const P=r.get(W);n.deleteTexture(P.__webglTexture);const B=W.source,q=m.get(B);delete q[P.__cacheKey],o.memory.textures--}function I(W){const P=r.get(W);if(W.depthTexture&&(W.depthTexture.dispose(),r.remove(W.depthTexture)),W.isWebGLCubeRenderTarget)for(let q=0;q<6;q++){if(Array.isArray(P.__webglFramebuffer[q]))for(let se=0;se<P.__webglFramebuffer[q].length;se++)n.deleteFramebuffer(P.__webglFramebuffer[q][se]);else n.deleteFramebuffer(P.__webglFramebuffer[q]);P.__webglDepthbuffer&&n.deleteRenderbuffer(P.__webglDepthbuffer[q])}else{if(Array.isArray(P.__webglFramebuffer))for(let q=0;q<P.__webglFramebuffer.length;q++)n.deleteFramebuffer(P.__webglFramebuffer[q]);else n.deleteFramebuffer(P.__webglFramebuffer);if(P.__webglDepthbuffer&&n.deleteRenderbuffer(P.__webglDepthbuffer),P.__webglMultisampledFramebuffer&&n.deleteFramebuffer(P.__webglMultisampledFramebuffer),P.__webglColorRenderbuffer)for(let q=0;q<P.__webglColorRenderbuffer.length;q++)P.__webglColorRenderbuffer[q]&&n.deleteRenderbuffer(P.__webglColorRenderbuffer[q]);P.__webglDepthRenderbuffer&&n.deleteRenderbuffer(P.__webglDepthRenderbuffer)}const B=W.textures;for(let q=0,se=B.length;q<se;q++){const J=r.get(B[q]);J.__webglTexture&&(n.deleteTexture(J.__webglTexture),o.memory.textures--),r.remove(B[q])}r.remove(W)}let D=0;function O(){D=0}function U(){const W=D;return W>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+W+" texture units while this GPU supports only "+i.maxTextures),D+=1,W}function V(W){const P=[];return P.push(W.wrapS),P.push(W.wrapT),P.push(W.wrapR||0),P.push(W.magFilter),P.push(W.minFilter),P.push(W.anisotropy),P.push(W.internalFormat),P.push(W.format),P.push(W.type),P.push(W.generateMipmaps),P.push(W.premultiplyAlpha),P.push(W.flipY),P.push(W.unpackAlignment),P.push(W.colorSpace),P.join()}function Z(W,P){const B=r.get(W);if(W.isVideoTexture&&be(W),W.isRenderTargetTexture===!1&&W.version>0&&B.__version!==W.version){const q=W.image;if(q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ce(B,W,P);return}}t.bindTexture(n.TEXTURE_2D,B.__webglTexture,n.TEXTURE0+P)}function Y(W,P){const B=r.get(W);if(W.version>0&&B.__version!==W.version){ce(B,W,P);return}t.bindTexture(n.TEXTURE_2D_ARRAY,B.__webglTexture,n.TEXTURE0+P)}function ne(W,P){const B=r.get(W);if(W.version>0&&B.__version!==W.version){ce(B,W,P);return}t.bindTexture(n.TEXTURE_3D,B.__webglTexture,n.TEXTURE0+P)}function j(W,P){const B=r.get(W);if(W.version>0&&B.__version!==W.version){_e(B,W,P);return}t.bindTexture(n.TEXTURE_CUBE_MAP,B.__webglTexture,n.TEXTURE0+P)}const $={[jp]:n.REPEAT,[Ns]:n.CLAMP_TO_EDGE,[Op]:n.MIRRORED_REPEAT},K={[Lr]:n.NEAREST,[$E]:n.NEAREST_MIPMAP_NEAREST,[Sd]:n.NEAREST_MIPMAP_LINEAR,[xr]:n.LINEAR,[ip]:n.LINEAR_MIPMAP_NEAREST,[To]:n.LINEAR_MIPMAP_LINEAR},re={[Rk]:n.NEVER,[Lk]:n.ALWAYS,[Pk]:n.LESS,[tM]:n.LEQUAL,[Ik]:n.EQUAL,[kk]:n.GEQUAL,[Fk]:n.GREATER,[Dk]:n.NOTEQUAL};function xe(W,P){if(P.type===Li&&e.has("OES_texture_float_linear")===!1&&(P.magFilter===xr||P.magFilter===ip||P.magFilter===Sd||P.magFilter===To||P.minFilter===xr||P.minFilter===ip||P.minFilter===Sd||P.minFilter===To)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(W,n.TEXTURE_WRAP_S,$[P.wrapS]),n.texParameteri(W,n.TEXTURE_WRAP_T,$[P.wrapT]),(W===n.TEXTURE_3D||W===n.TEXTURE_2D_ARRAY)&&n.texParameteri(W,n.TEXTURE_WRAP_R,$[P.wrapR]),n.texParameteri(W,n.TEXTURE_MAG_FILTER,K[P.magFilter]),n.texParameteri(W,n.TEXTURE_MIN_FILTER,K[P.minFilter]),P.compareFunction&&(n.texParameteri(W,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(W,n.TEXTURE_COMPARE_FUNC,re[P.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(P.magFilter===Lr||P.minFilter!==Sd&&P.minFilter!==To||P.type===Li&&e.has("OES_texture_float_linear")===!1)return;if(P.anisotropy>1||r.get(P).__currentAnisotropy){const B=e.get("EXT_texture_filter_anisotropic");n.texParameterf(W,B.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(P.anisotropy,i.getMaxAnisotropy())),r.get(P).__currentAnisotropy=P.anisotropy}}}function Ce(W,P){let B=!1;W.__webglInit===void 0&&(W.__webglInit=!0,P.addEventListener("dispose",R));const q=P.source;let se=m.get(q);se===void 0&&(se={},m.set(q,se));const J=V(P);if(J!==W.__cacheKey){se[J]===void 0&&(se[J]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,B=!0),se[J].usedTimes++;const ue=se[W.__cacheKey];ue!==void 0&&(se[W.__cacheKey].usedTimes--,ue.usedTimes===0&&N(P)),W.__cacheKey=J,W.__webglTexture=se[J].texture}return B}function ce(W,P,B){let q=n.TEXTURE_2D;(P.isDataArrayTexture||P.isCompressedArrayTexture)&&(q=n.TEXTURE_2D_ARRAY),P.isData3DTexture&&(q=n.TEXTURE_3D);const se=Ce(W,P),J=P.source;t.bindTexture(q,W.__webglTexture,n.TEXTURE0+B);const ue=r.get(J);if(J.version!==ue.__version||se===!0){t.activeTexture(n.TEXTURE0+B);const me=an.getPrimaries(an.workingColorSpace),Oe=P.colorSpace===ua?null:an.getPrimaries(P.colorSpace),Ze=P.colorSpace===ua||me===Oe?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,P.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,P.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ze);let Me=_(P.image,!1,i.maxTextureSize);Me=Ke(P,Me);const Je=s.convert(P.format,P.colorSpace),gt=s.convert(P.type);let wt=S(P.internalFormat,Je,gt,P.colorSpace,P.isVideoTexture);xe(q,P);let rt;const ee=P.mipmaps,we=P.isVideoTexture!==!0,We=ue.__version===void 0||se===!0,Q=J.dataReady,Le=A(P,Me);if(P.isDepthTexture)wt=M(P.format===gh,P.type),We&&(we?t.texStorage2D(n.TEXTURE_2D,1,wt,Me.width,Me.height):t.texImage2D(n.TEXTURE_2D,0,wt,Me.width,Me.height,0,Je,gt,null));else if(P.isDataTexture)if(ee.length>0){we&&We&&t.texStorage2D(n.TEXTURE_2D,Le,wt,ee[0].width,ee[0].height);for(let ge=0,Ee=ee.length;ge<Ee;ge++)rt=ee[ge],we?Q&&t.texSubImage2D(n.TEXTURE_2D,ge,0,0,rt.width,rt.height,Je,gt,rt.data):t.texImage2D(n.TEXTURE_2D,ge,wt,rt.width,rt.height,0,Je,gt,rt.data);P.generateMipmaps=!1}else we?(We&&t.texStorage2D(n.TEXTURE_2D,Le,wt,Me.width,Me.height),Q&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,Me.width,Me.height,Je,gt,Me.data)):t.texImage2D(n.TEXTURE_2D,0,wt,Me.width,Me.height,0,Je,gt,Me.data);else if(P.isCompressedTexture)if(P.isCompressedArrayTexture){we&&We&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Le,wt,ee[0].width,ee[0].height,Me.depth);for(let ge=0,Ee=ee.length;ge<Ee;ge++)if(rt=ee[ge],P.format!==Zr)if(Je!==null)if(we){if(Q)if(P.layerUpdates.size>0){const et=t2(rt.width,rt.height,P.format,P.type);for(const $e of P.layerUpdates){const bt=rt.data.subarray($e*et/rt.data.BYTES_PER_ELEMENT,($e+1)*et/rt.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ge,0,0,$e,rt.width,rt.height,1,Je,bt)}P.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ge,0,0,0,rt.width,rt.height,Me.depth,Je,rt.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,ge,wt,rt.width,rt.height,Me.depth,0,rt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else we?Q&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,ge,0,0,0,rt.width,rt.height,Me.depth,Je,gt,rt.data):t.texImage3D(n.TEXTURE_2D_ARRAY,ge,wt,rt.width,rt.height,Me.depth,0,Je,gt,rt.data)}else{we&&We&&t.texStorage2D(n.TEXTURE_2D,Le,wt,ee[0].width,ee[0].height);for(let ge=0,Ee=ee.length;ge<Ee;ge++)rt=ee[ge],P.format!==Zr?Je!==null?we?Q&&t.compressedTexSubImage2D(n.TEXTURE_2D,ge,0,0,rt.width,rt.height,Je,rt.data):t.compressedTexImage2D(n.TEXTURE_2D,ge,wt,rt.width,rt.height,0,rt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):we?Q&&t.texSubImage2D(n.TEXTURE_2D,ge,0,0,rt.width,rt.height,Je,gt,rt.data):t.texImage2D(n.TEXTURE_2D,ge,wt,rt.width,rt.height,0,Je,gt,rt.data)}else if(P.isDataArrayTexture)if(we){if(We&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Le,wt,Me.width,Me.height,Me.depth),Q)if(P.layerUpdates.size>0){const ge=t2(Me.width,Me.height,P.format,P.type);for(const Ee of P.layerUpdates){const et=Me.data.subarray(Ee*ge/Me.data.BYTES_PER_ELEMENT,(Ee+1)*ge/Me.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Ee,Me.width,Me.height,1,Je,gt,et)}P.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Me.width,Me.height,Me.depth,Je,gt,Me.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,wt,Me.width,Me.height,Me.depth,0,Je,gt,Me.data);else if(P.isData3DTexture)we?(We&&t.texStorage3D(n.TEXTURE_3D,Le,wt,Me.width,Me.height,Me.depth),Q&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Me.width,Me.height,Me.depth,Je,gt,Me.data)):t.texImage3D(n.TEXTURE_3D,0,wt,Me.width,Me.height,Me.depth,0,Je,gt,Me.data);else if(P.isFramebufferTexture){if(We)if(we)t.texStorage2D(n.TEXTURE_2D,Le,wt,Me.width,Me.height);else{let ge=Me.width,Ee=Me.height;for(let et=0;et<Le;et++)t.texImage2D(n.TEXTURE_2D,et,wt,ge,Ee,0,Je,gt,null),ge>>=1,Ee>>=1}}else if(ee.length>0){if(we&&We){const ge=Ne(ee[0]);t.texStorage2D(n.TEXTURE_2D,Le,wt,ge.width,ge.height)}for(let ge=0,Ee=ee.length;ge<Ee;ge++)rt=ee[ge],we?Q&&t.texSubImage2D(n.TEXTURE_2D,ge,0,0,Je,gt,rt):t.texImage2D(n.TEXTURE_2D,ge,wt,Je,gt,rt);P.generateMipmaps=!1}else if(we){if(We){const ge=Ne(Me);t.texStorage2D(n.TEXTURE_2D,Le,wt,ge.width,ge.height)}Q&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,Je,gt,Me)}else t.texImage2D(n.TEXTURE_2D,0,wt,Je,gt,Me);y(P)&&g(q),ue.__version=J.version,P.onUpdate&&P.onUpdate(P)}W.__version=P.version}function _e(W,P,B){if(P.image.length!==6)return;const q=Ce(W,P),se=P.source;t.bindTexture(n.TEXTURE_CUBE_MAP,W.__webglTexture,n.TEXTURE0+B);const J=r.get(se);if(se.version!==J.__version||q===!0){t.activeTexture(n.TEXTURE0+B);const ue=an.getPrimaries(an.workingColorSpace),me=P.colorSpace===ua?null:an.getPrimaries(P.colorSpace),Oe=P.colorSpace===ua||ue===me?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,P.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,P.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Oe);const Ze=P.isCompressedTexture||P.image[0].isCompressedTexture,Me=P.image[0]&&P.image[0].isDataTexture,Je=[];for(let Ee=0;Ee<6;Ee++)!Ze&&!Me?Je[Ee]=_(P.image[Ee],!0,i.maxCubemapSize):Je[Ee]=Me?P.image[Ee].image:P.image[Ee],Je[Ee]=Ke(P,Je[Ee]);const gt=Je[0],wt=s.convert(P.format,P.colorSpace),rt=s.convert(P.type),ee=S(P.internalFormat,wt,rt,P.colorSpace),we=P.isVideoTexture!==!0,We=J.__version===void 0||q===!0,Q=se.dataReady;let Le=A(P,gt);xe(n.TEXTURE_CUBE_MAP,P);let ge;if(Ze){we&&We&&t.texStorage2D(n.TEXTURE_CUBE_MAP,Le,ee,gt.width,gt.height);for(let Ee=0;Ee<6;Ee++){ge=Je[Ee].mipmaps;for(let et=0;et<ge.length;et++){const $e=ge[et];P.format!==Zr?wt!==null?we?Q&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,et,0,0,$e.width,$e.height,wt,$e.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,et,ee,$e.width,$e.height,0,$e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):we?Q&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,et,0,0,$e.width,$e.height,wt,rt,$e.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,et,ee,$e.width,$e.height,0,wt,rt,$e.data)}}}else{if(ge=P.mipmaps,we&&We){ge.length>0&&Le++;const Ee=Ne(Je[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Le,ee,Ee.width,Ee.height)}for(let Ee=0;Ee<6;Ee++)if(Me){we?Q&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0,0,0,Je[Ee].width,Je[Ee].height,wt,rt,Je[Ee].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0,ee,Je[Ee].width,Je[Ee].height,0,wt,rt,Je[Ee].data);for(let et=0;et<ge.length;et++){const bt=ge[et].image[Ee].image;we?Q&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,et+1,0,0,bt.width,bt.height,wt,rt,bt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,et+1,ee,bt.width,bt.height,0,wt,rt,bt.data)}}else{we?Q&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0,0,0,wt,rt,Je[Ee]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0,ee,wt,rt,Je[Ee]);for(let et=0;et<ge.length;et++){const $e=ge[et];we?Q&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,et+1,0,0,wt,rt,$e.image[Ee]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,et+1,ee,wt,rt,$e.image[Ee])}}}y(P)&&g(n.TEXTURE_CUBE_MAP),J.__version=se.version,P.onUpdate&&P.onUpdate(P)}W.__version=P.version}function Re(W,P,B,q,se,J){const ue=s.convert(B.format,B.colorSpace),me=s.convert(B.type),Oe=S(B.internalFormat,ue,me,B.colorSpace),Ze=r.get(P),Me=r.get(B);if(Me.__renderTarget=P,!Ze.__hasExternalTextures){const Je=Math.max(1,P.width>>J),gt=Math.max(1,P.height>>J);se===n.TEXTURE_3D||se===n.TEXTURE_2D_ARRAY?t.texImage3D(se,J,Oe,Je,gt,P.depth,0,ue,me,null):t.texImage2D(se,J,Oe,Je,gt,0,ue,me,null)}t.bindFramebuffer(n.FRAMEBUFFER,W),Te(P)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,q,se,Me.__webglTexture,0,Ae(P)):(se===n.TEXTURE_2D||se>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&se<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,q,se,Me.__webglTexture,J),t.bindFramebuffer(n.FRAMEBUFFER,null)}function pe(W,P,B){if(n.bindRenderbuffer(n.RENDERBUFFER,W),P.depthBuffer){const q=P.depthTexture,se=q&&q.isDepthTexture?q.type:null,J=M(P.stencilBuffer,se),ue=P.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,me=Ae(P);Te(P)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,me,J,P.width,P.height):B?n.renderbufferStorageMultisample(n.RENDERBUFFER,me,J,P.width,P.height):n.renderbufferStorage(n.RENDERBUFFER,J,P.width,P.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ue,n.RENDERBUFFER,W)}else{const q=P.textures;for(let se=0;se<q.length;se++){const J=q[se],ue=s.convert(J.format,J.colorSpace),me=s.convert(J.type),Oe=S(J.internalFormat,ue,me,J.colorSpace),Ze=Ae(P);B&&Te(P)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ze,Oe,P.width,P.height):Te(P)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ze,Oe,P.width,P.height):n.renderbufferStorage(n.RENDERBUFFER,Oe,P.width,P.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function je(W,P){if(P&&P.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,W),!(P.depthTexture&&P.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const q=r.get(P.depthTexture);q.__renderTarget=P,(!q.__webglTexture||P.depthTexture.image.width!==P.width||P.depthTexture.image.height!==P.height)&&(P.depthTexture.image.width=P.width,P.depthTexture.image.height=P.height,P.depthTexture.needsUpdate=!0),Z(P.depthTexture,0);const se=q.__webglTexture,J=Ae(P);if(P.depthTexture.format===mh)Te(P)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,se,0,J):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,se,0);else if(P.depthTexture.format===gh)Te(P)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,se,0,J):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,se,0);else throw new Error("Unknown depthTexture format")}function nt(W){const P=r.get(W),B=W.isWebGLCubeRenderTarget===!0;if(P.__boundDepthTexture!==W.depthTexture){const q=W.depthTexture;if(P.__depthDisposeCallback&&P.__depthDisposeCallback(),q){const se=()=>{delete P.__boundDepthTexture,delete P.__depthDisposeCallback,q.removeEventListener("dispose",se)};q.addEventListener("dispose",se),P.__depthDisposeCallback=se}P.__boundDepthTexture=q}if(W.depthTexture&&!P.__autoAllocateDepthBuffer){if(B)throw new Error("target.depthTexture not supported in Cube render targets");const q=W.texture.mipmaps;q&&q.length>0?je(P.__webglFramebuffer[0],W):je(P.__webglFramebuffer,W)}else if(B){P.__webglDepthbuffer=[];for(let q=0;q<6;q++)if(t.bindFramebuffer(n.FRAMEBUFFER,P.__webglFramebuffer[q]),P.__webglDepthbuffer[q]===void 0)P.__webglDepthbuffer[q]=n.createRenderbuffer(),pe(P.__webglDepthbuffer[q],W,!1);else{const se=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,J=P.__webglDepthbuffer[q];n.bindRenderbuffer(n.RENDERBUFFER,J),n.framebufferRenderbuffer(n.FRAMEBUFFER,se,n.RENDERBUFFER,J)}}else{const q=W.texture.mipmaps;if(q&&q.length>0?t.bindFramebuffer(n.FRAMEBUFFER,P.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,P.__webglFramebuffer),P.__webglDepthbuffer===void 0)P.__webglDepthbuffer=n.createRenderbuffer(),pe(P.__webglDepthbuffer,W,!1);else{const se=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,J=P.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,J),n.framebufferRenderbuffer(n.FRAMEBUFFER,se,n.RENDERBUFFER,J)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function Pe(W,P,B){const q=r.get(W);P!==void 0&&Re(q.__webglFramebuffer,W,W.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),B!==void 0&&nt(W)}function Ie(W){const P=W.texture,B=r.get(W),q=r.get(P);W.addEventListener("dispose",F);const se=W.textures,J=W.isWebGLCubeRenderTarget===!0,ue=se.length>1;if(ue||(q.__webglTexture===void 0&&(q.__webglTexture=n.createTexture()),q.__version=P.version,o.memory.textures++),J){B.__webglFramebuffer=[];for(let me=0;me<6;me++)if(P.mipmaps&&P.mipmaps.length>0){B.__webglFramebuffer[me]=[];for(let Oe=0;Oe<P.mipmaps.length;Oe++)B.__webglFramebuffer[me][Oe]=n.createFramebuffer()}else B.__webglFramebuffer[me]=n.createFramebuffer()}else{if(P.mipmaps&&P.mipmaps.length>0){B.__webglFramebuffer=[];for(let me=0;me<P.mipmaps.length;me++)B.__webglFramebuffer[me]=n.createFramebuffer()}else B.__webglFramebuffer=n.createFramebuffer();if(ue)for(let me=0,Oe=se.length;me<Oe;me++){const Ze=r.get(se[me]);Ze.__webglTexture===void 0&&(Ze.__webglTexture=n.createTexture(),o.memory.textures++)}if(W.samples>0&&Te(W)===!1){B.__webglMultisampledFramebuffer=n.createFramebuffer(),B.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,B.__webglMultisampledFramebuffer);for(let me=0;me<se.length;me++){const Oe=se[me];B.__webglColorRenderbuffer[me]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,B.__webglColorRenderbuffer[me]);const Ze=s.convert(Oe.format,Oe.colorSpace),Me=s.convert(Oe.type),Je=S(Oe.internalFormat,Ze,Me,Oe.colorSpace,W.isXRRenderTarget===!0),gt=Ae(W);n.renderbufferStorageMultisample(n.RENDERBUFFER,gt,Je,W.width,W.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+me,n.RENDERBUFFER,B.__webglColorRenderbuffer[me])}n.bindRenderbuffer(n.RENDERBUFFER,null),W.depthBuffer&&(B.__webglDepthRenderbuffer=n.createRenderbuffer(),pe(B.__webglDepthRenderbuffer,W,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(J){t.bindTexture(n.TEXTURE_CUBE_MAP,q.__webglTexture),xe(n.TEXTURE_CUBE_MAP,P);for(let me=0;me<6;me++)if(P.mipmaps&&P.mipmaps.length>0)for(let Oe=0;Oe<P.mipmaps.length;Oe++)Re(B.__webglFramebuffer[me][Oe],W,P,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+me,Oe);else Re(B.__webglFramebuffer[me],W,P,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+me,0);y(P)&&g(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ue){for(let me=0,Oe=se.length;me<Oe;me++){const Ze=se[me],Me=r.get(Ze);t.bindTexture(n.TEXTURE_2D,Me.__webglTexture),xe(n.TEXTURE_2D,Ze),Re(B.__webglFramebuffer,W,Ze,n.COLOR_ATTACHMENT0+me,n.TEXTURE_2D,0),y(Ze)&&g(n.TEXTURE_2D)}t.unbindTexture()}else{let me=n.TEXTURE_2D;if((W.isWebGL3DRenderTarget||W.isWebGLArrayRenderTarget)&&(me=W.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(me,q.__webglTexture),xe(me,P),P.mipmaps&&P.mipmaps.length>0)for(let Oe=0;Oe<P.mipmaps.length;Oe++)Re(B.__webglFramebuffer[Oe],W,P,n.COLOR_ATTACHMENT0,me,Oe);else Re(B.__webglFramebuffer,W,P,n.COLOR_ATTACHMENT0,me,0);y(P)&&g(me),t.unbindTexture()}W.depthBuffer&&nt(W)}function He(W){const P=W.textures;for(let B=0,q=P.length;B<q;B++){const se=P[B];if(y(se)){const J=b(W),ue=r.get(se).__webglTexture;t.bindTexture(J,ue),g(J),t.unbindTexture()}}}const ze=[],H=[];function Fe(W){if(W.samples>0){if(Te(W)===!1){const P=W.textures,B=W.width,q=W.height;let se=n.COLOR_BUFFER_BIT;const J=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ue=r.get(W),me=P.length>1;if(me)for(let Ze=0;Ze<P.length;Ze++)t.bindFramebuffer(n.FRAMEBUFFER,ue.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ze,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,ue.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ze,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,ue.__webglMultisampledFramebuffer);const Oe=W.texture.mipmaps;Oe&&Oe.length>0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ue.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ue.__webglFramebuffer);for(let Ze=0;Ze<P.length;Ze++){if(W.resolveDepthBuffer&&(W.depthBuffer&&(se|=n.DEPTH_BUFFER_BIT),W.stencilBuffer&&W.resolveStencilBuffer&&(se|=n.STENCIL_BUFFER_BIT)),me){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,ue.__webglColorRenderbuffer[Ze]);const Me=r.get(P[Ze]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,Me,0)}n.blitFramebuffer(0,0,B,q,0,0,B,q,se,n.NEAREST),c===!0&&(ze.length=0,H.length=0,ze.push(n.COLOR_ATTACHMENT0+Ze),W.depthBuffer&&W.resolveDepthBuffer===!1&&(ze.push(J),H.push(J),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,H)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,ze))}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),me)for(let Ze=0;Ze<P.length;Ze++){t.bindFramebuffer(n.FRAMEBUFFER,ue.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ze,n.RENDERBUFFER,ue.__webglColorRenderbuffer[Ze]);const Me=r.get(P[Ze]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,ue.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ze,n.TEXTURE_2D,Me,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ue.__webglMultisampledFramebuffer)}else if(W.depthBuffer&&W.resolveDepthBuffer===!1&&c){const P=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[P])}}}function Ae(W){return Math.min(i.maxSamples,W.samples)}function Te(W){const P=r.get(W);return W.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&P.__useRenderToTexture!==!1}function be(W){const P=o.render.frame;f.get(W)!==P&&(f.set(W,P),W.update())}function Ke(W,P){const B=W.colorSpace,q=W.format,se=W.type;return W.isCompressedTexture===!0||W.isVideoTexture===!0||B!==au&&B!==ua&&(an.getTransfer(B)===wn?(q!==Zr||se!==Ds)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",B)),P}function Ne(W){return typeof HTMLImageElement<"u"&&W instanceof HTMLImageElement?(u.width=W.naturalWidth||W.width,u.height=W.naturalHeight||W.height):typeof VideoFrame<"u"&&W instanceof VideoFrame?(u.width=W.displayWidth,u.height=W.displayHeight):(u.width=W.width,u.height=W.height),u}this.allocateTextureUnit=U,this.resetTextureUnits=O,this.setTexture2D=Z,this.setTexture2DArray=Y,this.setTexture3D=ne,this.setTextureCube=j,this.rebindTextures=Pe,this.setupRenderTarget=Ie,this.updateRenderTargetMipmap=He,this.updateMultisampleRenderTarget=Fe,this.setupDepthRenderbuffer=nt,this.setupFrameBufferTexture=Re,this.useMultisampledRTT=Te}function XL(n,e){function t(r,i=ua){let s;const o=an.getTransfer(i);if(r===Ds)return n.UNSIGNED_BYTE;if(r===Fy)return n.UNSIGNED_SHORT_4_4_4_4;if(r===Dy)return n.UNSIGNED_SHORT_5_5_5_1;if(r===YE)return n.UNSIGNED_INT_5_9_9_9_REV;if(r===XE)return n.BYTE;if(r===qE)return n.SHORT;if(r===fh)return n.UNSIGNED_SHORT;if(r===Iy)return n.INT;if(r===Na)return n.UNSIGNED_INT;if(r===Li)return n.FLOAT;if(r===Lh)return n.HALF_FLOAT;if(r===KE)return n.ALPHA;if(r===ZE)return n.RGB;if(r===Zr)return n.RGBA;if(r===mh)return n.DEPTH_COMPONENT;if(r===gh)return n.DEPTH_STENCIL;if(r===ky)return n.RED;if(r===hm)return n.RED_INTEGER;if(r===QE)return n.RG;if(r===Ly)return n.RG_INTEGER;if(r===jy)return n.RGBA_INTEGER;if(r===sp||r===op||r===ap||r===lp)if(o===wn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(r===sp)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===op)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===ap)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===lp)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(r===sp)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===op)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===ap)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===lp)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===ov||r===av||r===lv||r===cv)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(r===ov)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===av)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===lv)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===cv)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===uv||r===dv||r===hv)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(r===uv||r===dv)return o===wn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(r===hv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===fv||r===pv||r===mv||r===gv||r===xv||r===vv||r===yv||r===_v||r===wv||r===bv||r===Sv||r===Ev||r===Mv||r===Av)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(r===fv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===pv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===mv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===gv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===xv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===vv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===yv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===_v)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===wv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===bv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Sv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===Ev)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===Mv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===Av)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===cp||r===Tv||r===Cv)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(r===cp)return o===wn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===Tv)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===Cv)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===JE||r===Nv||r===Rv||r===Pv)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(r===cp)return s.COMPRESSED_RED_RGT
vendor: 19,046 bytes, lines 4070-4094
4070C1_EXT;if(r===Nv)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===Rv)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===Pv)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===ph?n.UNSIGNED_INT_24_8:n[r]!==void 0?n[r]:null}return{convert:t}}const mZ=` 4071void main() { 4072 4073 gl_Position = vec4( position, 1.0 ); 4074 4075}`,gZ=` 4076uniform sampler2DArray depthColor; 4077uniform float depthWidth; 4078uniform float depthHeight; 4079 4080void main() { 4081 4082 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 4083 4084 if ( coord.x >= 1.0 ) { 4085 4086 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 4087 4088 } else { 4089 4090 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 4091 4092 } 4093 4094}`;class xZ{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(this.texture===null){const i=new Yn,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!==r.depthNear||t.depthFar!==r.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,r=new so({vertexShader:mZ,fragmentShader:gZ,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new cr(new Oh(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class vZ extends zo{constructor(e,t){super();const r=this;let i=null,s=1,o=null,a="local-floor",c=1,u=null,f=null,p=null,m=null,x=null,v=null;const _=new xZ,y=t.getContextAttributes();let g=null,b=null;const S=[],M=[],A=new Se;let R=null;const F=new Un;F.viewport=new cn;const L=new Un;L.viewport=new cn;const N=[F,L],I=new LL;let D=null,O=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ce){let _e=S[ce];return _e===void 0&&(_e=new u0,S[ce]=_e),_e.getTargetRaySpace()},this.getControllerGrip=function(ce){let _e=S[ce];return _e===void 0&&(_e=new u0,S[ce]=_e),_e.getGripSpace()},this.getHand=function(ce){let _e=S[ce];return _e===void 0&&(_e=new u0,S[ce]=_e),_e.getHandSpace()};function U(ce){const _e=M.indexOf(ce.inputSource);if(_e===-1)return;const Re=S[_e];Re!==void 0&&(Re.update(ce.inputSource,ce.frame,u||o),Re.dispatchEvent({type:ce.type,data:ce.inputSource}))}function V(){i.removeEventListener("select",U),i.removeEventListener("selectstart",U),i.removeEventListener("selectend",U),i.removeEventListener("squeeze",U),i.removeEventListener("squeezestart",U),i.removeEventListener("squeezeend",U),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",Z);for(let ce=0;ce<S.length;ce++){const _e=M[ce];_e!==null&&(M[ce]=null,S[ce].disconnect(_e))}D=null,O=null,_.reset(),e.setRenderTarget(g),x=null,m=null,p=null,i=null,b=null,Ce.stop(),r.isPresenting=!1,e.setPixelRatio(R),e.setSize(A.width,A.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ce){s=ce,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ce){a=ce,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(ce){u=ce},this.getBaseLayer=function(){return m!==null?m:x},this.getBinding=function(){return p},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(ce){if(i=ce,i!==null){if(g=e.getRenderTarget(),i.addEventListener("select",U),i.addEventListener("selectstart",U),i.addEventListener("selectend",U),i.addEventListener("squeeze",U),i.addEventListener("squeezestart",U),i.addEventListener("squeezeend",U),i.addEventListener("end",V),i.addEventListener("inputsourceschange",Z),y.xrCompatible!==!0&&await t.makeXRCompatible(),R=e.getPixelRatio(),e.getSize(A),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Re=null,pe=null,je=null;y.depth&&(je=y.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Re=y.stencil?gh:mh,pe=y.stencil?ph:Na);const nt={colorFormat:t.RGBA8,depthFormat:je,scaleFactor:s};p=new XRWebGLBinding(i,t),m=p.createProjectionLayer(nt),i.updateRenderState({layers:[m]}),e.setPixelRatio(1),e.setSize(m.textureWidth,m.textureHeight,!1),b=new Oo(m.textureWidth,m.textureHeight,{format:Zr,type:Ds,depthTexture:new Xy(m.textureWidth,m.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,Re),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}else{const Re={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};x=new XRWebGLLayer(i,t,Re),i.updateRenderState({baseLayer:x}),e.setPixelRatio(1),e.setSize(x.framebufferWidth,x.framebufferHeight,!1),b=new Oo(x.framebufferWidth,x.framebufferHeight,{format:Zr,type:Ds,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:x.ignoreDepthValues===!1,resolveStencilBuffer:x.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(c),u=null,o=await i.requestReferenceSpace(a),Ce.setContext(i),Ce.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function Z(ce){for(let _e=0;_e<ce.removed.length;_e++){const Re=ce.removed[_e],pe=M.indexOf(Re);pe>=0&&(M[pe]=null,S[pe].disconnect(Re))}for(let _e=0;_e<ce.added.length;_e++){const Re=ce.added[_e];let pe=M.indexOf(Re);if(pe===-1){for(let nt=0;nt<S.length;nt++)if(nt>=M.length){M.push(Re),pe=nt;break}else if(M[nt]===null){M[nt]=Re,pe=nt;break}if(pe===-1)break}const je=S[pe];je&&je.connect(Re)}}const Y=new G,ne=new G;function j(ce,_e,Re){Y.setFromMatrixPosition(_e.matrixWorld),ne.setFromMatrixPosition(Re.matrixWorld);const pe=Y.distanceTo(ne),je=_e.projectionMatrix.elements,nt=Re.projectionMatrix.elements,Pe=je[14]/(je[10]-1),Ie=je[14]/(je[10]+1),He=(je[9]+1)/je[5],ze=(je[9]-1)/je[5],H=(je[8]-1)/je[0],Fe=(nt[8]+1)/nt[0],Ae=Pe*H,Te=Pe*Fe,be=pe/(-H+Fe),Ke=be*-H;if(_e.matrixWorld.decompose(ce.position,ce.quaternion,ce.scale),ce.translateX(Ke),ce.translateZ(be),ce.matrixWorld.compose(ce.position,ce.quaternion,ce.scale),ce.matrixWorldInverse.copy(ce.matrixWorld).invert(),je[10]===-1)ce.projectionMatrix.copy(_e.projectionMatrix),ce.projectionMatrixInverse.copy(_e.projectionMatrixInverse);else{const Ne=Pe+be,W=Ie+be,P=Ae-Ke,B=Te+(pe-Ke),q=He*Ie/W*Ne,se=ze*Ie/W*Ne;ce.projectionMatrix.makePerspective(P,B,q,se,Ne,W),ce.projectionMatrixInverse.copy(ce.projectionMatrix).invert()}}function $(ce,_e){_e===null?ce.matrixWorld.copy(ce.matrix):ce.matrixWorld.multiplyMatrices(_e.matrixWorld,ce.matrix),ce.matrixWorldInverse.copy(ce.matrixWorld).invert()}this.updateCamera=function(ce){if(i===null)return;let _e=ce.near,Re=ce.far;_.texture!==null&&(_.depthNear>0&&(_e=_.depthNear),_.depthFar>0&&(Re=_.depthFar)),I.near=L.near=F.near=_e,I.far=L.far=F.far=Re,(D!==I.near||O!==I.far)&&(i.updateRenderState({depthNear:I.near,depthFar:I.far}),D=I.near,O=I.far),F.layers.mask=ce.layers.mask|2,L.layers.mask=ce.layers.mask|4,I.layers.mask=F.layers.mask|L.layers.mask;const pe=ce.parent,je=I.cameras;$(I,pe);for(let nt=0;nt<je.length;nt++)$(je[nt],pe);je.length===2?j(I,F,L):I.projectionMatrix.copy(F.projectionMatrix),K(ce,I,pe)};function K(ce,_e,Re){Re===null?ce.matrix.copy(_e.matrixWorld):(ce.matrix.copy(Re.matrixWorld),ce.matrix.invert(),ce.matrix.multiply(_e.matrixWorld)),ce.matrix.decompose(ce.position,ce.quaternion,ce.scale),ce.updateMatrixWorld(!0),ce.projectionMatrix.copy(_e.projectionMatrix),ce.projectionMatrixInverse.copy(_e.projectionMatrixInverse),ce.isPerspectiveCamera&&(ce.fov=xh*2*Math.atan(1/ce.projectionMatrix.elements[5]),ce.zoom=1)}this.getCamera=function(){return I},this.getFoveation=function(){if(!(m===null&&x===null))return c},this.setFoveation=function(ce){c=ce,m!==null&&(m.fixedFoveation=ce),x!==null&&x.fixedFoveation!==void 0&&(x.fixedFoveation=ce)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(I)};let re=null;function xe(ce,_e){if(f=_e.getViewerPose(u||o),v=_e,f!==null){const Re=f.views;x!==null&&(e.setRenderTargetFramebuffer(b,x.framebuffer),e.setRenderTarget(b));let pe=!1;Re.length!==I.cameras.length&&(I.cameras.length=0,pe=!0);for(let Pe=0;Pe<Re.length;Pe++){const Ie=Re[Pe];let He=null;if(x!==null)He=x.getViewport(Ie);else{const H=p.getViewSubImage(m,Ie);He=H.viewport,Pe===0&&(e.setRenderTargetTextures(b,H.colorTexture,H.depthStencilTexture),e.setRenderTarget(b))}let ze=N[Pe];ze===void 0&&(ze=new Un,ze.layers.enable(Pe),ze.viewport=new cn,N[Pe]=ze),ze.matrix.fromArray(Ie.transform.matrix),ze.matrix.decompose(ze.position,ze.quaternion,ze.scale),ze.projectionMatrix.fromArray(Ie.projectionMatrix),ze.projectionMatrixInverse.copy(ze.projectionMatrix).invert(),ze.viewport.set(He.x,He.y,He.width,He.height),Pe===0&&(I.matrix.copy(ze.matrix),I.matrix.decompose(I.position,I.quaternion,I.scale)),pe===!0&&I.cameras.push(ze)}const je=i.enabledFeatures;if(je&&je.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&p){const Pe=p.getDepthInformation(Re[0]);Pe&&Pe.isValid&&Pe.texture&&_.init(e,Pe,i.renderState)}}for(let Re=0;Re<S.length;Re++){const pe=M[Re],je=S[Re];pe!==null&&je!==void 0&&je.update(pe,_e,u||o)}re&&re(ce,_e),_e.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:_e}),v=null}const Ce=new VL;Ce.setAnimationLoop(xe),this.setAnimationLoop=function(ce){re=ce},this.dispose=function(){}}}const _c=new ls,yZ=new Rt;function _Z(n,e){function t(y,g){y.matrixAutoUpdate===!0&&y.updateMatrix(),g.value.copy(y.matrix)}function r(y,g){g.color.getRGB(y.fogColor.value,zk(n)),g.isFog?(y.fogNear.value=g.near,y.fogFar.value=g.far):g.isFogExp2&&(y.fogDensity.value=g.density)}function i(y,g,b,S,M){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(y,g):g.isMeshToonMaterial?(s(y,g),p(y,g)):g.isMeshPhongMaterial?(s(y,g),f(y,g)):g.isMeshStandardMaterial?(s(y,g),m(y,g),g.isMeshPhysicalMaterial&&x(y,g,M)):g.isMeshMatcapMaterial?(s(y,g),v(y,g)):g.isMeshDepthMaterial?s(y,g):g.isMeshDistanceMaterial?(s(y,g),_(y,g)):g.isMeshNormalMaterial?s(y,g):g.isLineBasicMaterial?(o(y,g),g.isLineDashedMaterial&&a(y,g)):g.isPointsMaterial?c(y,g,b,S):g.isSpriteMaterial?u(y,g):g.isShadowMaterial?(y.color.value.copy(g.color),y.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(y,g){y.opacity.value=g.opacity,g.color&&y.diffuse.value.copy(g.color),g.emissive&&y.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(y.map.value=g.map,t(g.map,y.mapTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.bumpMap&&(y.bumpMap.value=g.bumpMap,t(g.bumpMap,y.bumpMapTransform),y.bumpScale.value=g.bumpScale,g.side===mi&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,t(g.normalMap,y.normalMapTransform),y.normalScale.value.copy(g.normalScale),g.side===mi&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,t(g.displacementMap,y.displacementMapTransform),y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias),g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap,t(g.emissiveMap,y.emissiveMapTransform)),g.specularMap&&(y.specularMap.value=g.specularMap,t(g.specularMap,y.specularMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest);const b=e.get(g),S=b.envMap,M=b.envMapRotation;S&&(y.envMap.value=S,_c.copy(M),_c.x*=-1,_c.y*=-1,_c.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(_c.y*=-1,_c.z*=-1),y.envMapRotation.value.setFromMatrix4(yZ.makeRotationFromEuler(_c)),y.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=g.reflectivity,y.ior.value=g.ior,y.refractionRatio.value=g.refractionRatio),g.lightMap&&(y.lightMap.value=g.lightMap,y.lightMapIntensity.value=g.lightMapIntensity,t(g.lightMap,y.lightMapTransform)),g.aoMap&&(y.aoMap.value=g.aoMap,y.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,y.aoMapTransform))}function o(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,g.map&&(y.map.value=g.map,t(g.map,y.mapTransform))}function a(y,g){y.dashSize.value=g.dashSize,y.totalSize.value=g.dashSize+g.gapSize,y.scale.value=g.scale}function c(y,g,b,S){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.size.value=g.size*b,y.scale.value=S*.5,g.map&&(y.map.value=g.map,t(g.map,y.uvTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function u(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.rotation.value=g.rotation,g.map&&(y.map.value=g.map,t(g.map,y.mapTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function f(y,g){y.specular.value.copy(g.specular),y.shininess.value=Math.max(g.shininess,1e-4)}function p(y,g){g.gradientMap&&(y.gradientMap.value=g.gradientMap)}function m(y,g){y.metalness.value=g.metalness,g.metalnessMap&&(y.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,y.metalnessMapTransform)),y.roughness.value=g.roughness,g.roughnessMap&&(y.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,y.roughnessMapTransform)),g.envMap&&(y.envMapIntensity.value=g.envMapIntensity)}function x(y,g,b){y.ior.value=g.ior,g.sheen>0&&(y.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),y.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(y.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,y.sheenColorMapTransform)),g.sheenRoughnessMap&&(y.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,y.sheenRoughnessMapTransform))),g.clearcoat>0&&(y.clearcoat.value=g.clearcoat,y.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(y.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,y.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(y.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===mi&&y.clearcoatNormalScale.value.negate())),g.dispersion>0&&(y.dispersion.value=g.dispersion),g.iridescence>0&&(y.iridescence.value=g.iridescence,y.iridescenceIOR.value=g.iridescenceIOR,y.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(y.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,y.iridescenceMapTransform)),g.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),g.transmission>0&&(y.transmission.value=g.transmission,y.transmissionSamplerMap.value=b.texture,y.transmissionSamplerSize.value.set(b.width,b.height),g.transmissionMap&&(y.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,y.transmissionMapTransform)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(y.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(y.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=g.specularIntensity,y.specularColor.value.copy(g.specularColor),g.specularColorMap&&(y.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,y.specularColorMapTransform)),g.specularIntensityMap&&(y.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,g){g.matcap&&(y.matcap.value=g.matcap)}function _(y,g){const b=e.get(g).light;y.referencePosition.value.setFromMatrixPosition(b.matrixWorld),y.nearDistance.value=b.shadow.camera.near,y.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function wZ(n,e,t,r){let i={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function c(b,S){const M=S.program;r.uniformBlockBinding(b,M)}function u(b,S){let M=i[b.id];M===void 0&&(v(b),M=f(b),i[b.id]=M,b.addEventListener("dispose",y));const A=S.program;r.updateUBOMapping(b,A);const R=e.render.frame;s[b.id]!==R&&(m(b),s[b.id]=R)}function f(b){const S=p();b.__bindingPointIndex=S;const M=n.createBuffer(),A=b.__size,R=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,A,R),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,M),M}function p(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(b){const S=i[b.id],M=b.uniforms,A=b.__cache;n.bindBuffer(n.UNIFORM_BUFFER,S);for(let R=0,F=M.length;R<F;R++){const L=Array.isArray(M[R])?M[R]:[M[R]];for(let N=0,I=L.length;N<I;N++){const D=L[N];if(x(D,R,N,A)===!0){const O=D.__offset,U=Array.isArray(D.value)?D.value:[D.value];let V=0;for(let Z=0;Z<U.length;Z++){const Y=U[Z],ne=_(Y);typeof Y=="number"||typeof Y=="boolean"?(D.__data[0]=Y,n.bufferSubData(n.UNIFORM_BUFFER,O+V,D.__data)):Y.isMatrix3?(D.__data[0]=Y.elements[0],D.__data[1]=Y.elements[1],D.__data[2]=Y.elements[2],D.__data[3]=0,D.__data[4]=Y.elements[3],D.__data[5]=Y.elements[4],D.__data[6]=Y.elements[5],D.__data[7]=0,D.__data[8]=Y.elements[6],D.__data[9]=Y.elements[7],D.__data[10]=Y.elements[8],D.__data[11]=0):(Y.toArray(D.__data,V),V+=ne.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,O,D.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function x(b,S,M,A){const R=b.value,F=S+"_"+M;if(A[F]===void 0)return typeof R=="number"||typeof R=="boolean"?A[F]=R:A[F]=R.clone(),!0;{const L=A[F];if(typeof R=="number"||typeof R=="boolean"){if(L!==R)return A[F]=R,!0}else if(L.equals(R)===!1)return L.copy(R),!0}return!1}function v(b){const S=b.uniforms;let M=0;const A=16;for(let F=0,L=S.length;F<L;F++){const N=Array.isArray(S[F])?S[F]:[S[F]];for(let I=0,D=N.length;I<D;I++){const O=N[I],U=Array.isArray(O.value)?O.value:[O.value];for(let V=0,Z=U.length;V<Z;V++){const Y=U[V],ne=_(Y),j=M%A,$=j%ne.boundary,K=j+$;M+=$,K!==0&&A-K<ne.storage&&(M+=A-K),O.__data=new Float32Array(ne.storage/Float32Array.BYTES_PER_ELEMENT),O.__offset=M,M+=ne.storage}}}const R=M%A;return R>0&&(M+=A-R),b.__size=M,b.__cache={},this}function _(b){const S={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(S.boundary=4,S.storage=4):b.isVector2?(S.boundary=8,S.storage=8):b.isVector3||b.isColor?(S.boundary=16,S.storage=12):b.isVector4?(S.boundary=16,S.storage=16):b.isMatrix3?(S.boundary=48,S.storage=48):b.isMatrix4?(S.boundary=64,S.storage=64):b.isTexture?c
vendor: 2,492 bytes, line 4094
4094onsole.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),S}function y(b){const S=b.target;S.removeEventListener("dispose",y);const M=o.indexOf(S.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(i[S.id]),delete i[S.id],delete s[S.id]}function g(){for(const b in i)n.deleteBuffer(i[b]);o=[],i={},s={}}return{bind:c,update:u,dispose:g}}class qL{constructor(e={}){const{canvas:t=Ok(),context:r=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:u=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:p=!1,reverseDepthBuffer:m=!1}=e;this.isWebGLRenderer=!0;let x;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");x=r.getContextAttributes().alpha}else x=o;const v=new Uint32Array(4),_=new Int32Array(4);let y=null,g=null;const b=[],S=[];this.domElement=t,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=Io,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const M=this;let A=!1;this._outputColorSpace=Ri;let R=0,F=0,L=null,N=-1,I=null;const D=new cn,O=new cn;let U=null;const V=new at(0);let Z=0,Y=t.width,ne=t.height,j=1,$=null,K=null;const re=new cn(0,0,Y,ne),xe=new cn(0,0,Y,ne);let Ce=!1;const ce=new jh;let _e=!1,Re=!1;const pe=new Rt,je=new Rt,nt=new G,Pe=new cn,Ie={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let He=!1;function ze(){return L===null?j:1}let H=r;function Fe(z,le){return t.getContext(z,le)}try{const z={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:c,preserveDrawingBuffer:u,powerPreference:f,failIfMajorPerformanceCaveat:p};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Ny}`),t.addEventListener("webglcontextlost",Ee,!1),t.addEventListener("webglcontextrestored",et,!1),t.addEventListener("webglcontextcreationerror",$e,!1),H===null){const le="webgl2";if(H=Fe(le,z),H===null)throw Fe(le)?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 Ae,Te,be,Ke,Ne,W,P,B,q,se,J,ue,me,Oe,Ze,Me,Je,gt,wt,rt,ee,we,We,Q;
vendor: 10,041 bytes, line 4094
4094function Le(){Ae=new FY(H),Ae.init(),we=new XL(H,Ae),Te=new AY(H,Ae,e,we),be=new fZ(H,Ae),Te.reverseDepthBuffer&&m&&be.buffers.depth.setReversed(!0),Ke=new LY(H),Ne=new eZ,W=new pZ(H,Ae,be,Ne,Te,we,Ke),P=new CY(M),B=new IY(M),q=new V$(H),We=new EY(H,q),se=new DY(H,q,Ke,We),J=new OY(H,se,q,Ke),wt=new jY(H,Te,W),Me=new TY(Ne),ue=new JK(M,P,B,Ae,Te,We,Me),me=new _Z(M,Ne),Oe=new nZ,Ze=new lZ(Ae),gt=new SY(M,P,B,be,J,x,c),Je=new dZ(M,J,Te),Q=new wZ(H,Ke,Te,be),rt=new MY(H,Ae,Ke),ee=new kY(H,Ae,Ke),Ke.programs=ue.programs,M.capabilities=Te,M.extensions=Ae,M.properties=Ne,M.renderLists=Oe,M.shadowMap=Je,M.state=be,M.info=Ke}Le();const ge=new vZ(M,H);this.xr=ge,this.getContext=function(){return H},this.getContextAttributes=function(){return H.getContextAttributes()},this.forceContextLoss=function(){const z=Ae.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Ae.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return j},this.setPixelRatio=function(z){z!==void 0&&(j=z,this.setSize(Y,ne,!1))},this.getSize=function(z){return z.set(Y,ne)},this.setSize=function(z,le,he=!0){if(ge.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=z,ne=le,t.width=Math.floor(z*j),t.height=Math.floor(le*j),he===!0&&(t.style.width=z+"px",t.style.height=le+"px"),this.setViewport(0,0,z,le)},this.getDrawingBufferSize=function(z){return z.set(Y*j,ne*j).floor()},this.setDrawingBufferSize=function(z,le,he){Y=z,ne=le,j=he,t.width=Math.floor(z*he),t.height=Math.floor(le*he),this.setViewport(0,0,z,le)},this.getCurrentViewport=function(z){return z.copy(D)},this.getViewport=function(z){return z.copy(re)},this.setViewport=function(z,le,he,fe){z.isVector4?re.set(z.x,z.y,z.z,z.w):re.set(z,le,he,fe),be.viewport(D.copy(re).multiplyScalar(j).round())},this.getScissor=function(z){return z.copy(xe)},this.setScissor=function(z,le,he,fe){z.isVector4?xe.set(z.x,z.y,z.z,z.w):xe.set(z,le,he,fe),be.scissor(O.copy(xe).multiplyScalar(j).round())},this.getScissorTest=function(){return Ce},this.setScissorTest=function(z){be.setScissorTest(Ce=z)},this.setOpaqueSort=function(z){$=z},this.setTransparentSort=function(z){K=z},this.getClearColor=function(z){return z.copy(gt.getClearColor())},this.setClearColor=function(){gt.setClearColor(...arguments)},this.getClearAlpha=function(){return gt.getClearAlpha()},this.setClearAlpha=function(){gt.setClearAlpha(...arguments)},this.clear=function(z=!0,le=!0,he=!0){let fe=0;if(z){let ae=!1;if(L!==null){const De=L.texture.format;ae=De===jy||De===Ly||De===hm}if(ae){const De=L.texture.type,Xe=De===Ds||De===Na||De===fh||De===ph||De===Fy||De===Dy,lt=gt.getClearColor(),ct=gt.getClearAlpha(),St=lt.r,_t=lt.g,Ge=lt.b;Xe?(v[0]=St,v[1]=_t,v[2]=Ge,v[3]=ct,H.clearBufferuiv(H.COLOR,0,v)):(_[0]=St,_[1]=_t,_[2]=Ge,_[3]=ct,H.clearBufferiv(H.COLOR,0,_))}else fe|=H.COLOR_BUFFER_BIT}le&&(fe|=H.DEPTH_BUFFER_BIT),he&&(fe|=H.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),H.clear(fe)},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(){t.removeEventListener("webglcontextlost",Ee,!1),t.removeEventListener("webglcontextrestored",et,!1),t.removeEventListener("webglcontextcreationerror",$e,!1),gt.dispose(),Oe.dispose(),Ze.dispose(),Ne.dispose(),P.dispose(),B.dispose(),J.dispose(),We.dispose(),Q.dispose(),ue.dispose(),ge.dispose(),ge.removeEventListener("sessionstart",Cm),ge.removeEventListener("sessionend",Nm),lo.stop()};function Ee(z){z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),A=!0}function et(){console.log("THREE.WebGLRenderer: Context Restored."),A=!1;const z=Ke.autoReset,le=Je.enabled,he=Je.autoUpdate,fe=Je.needsUpdate,ae=Je.type;Le(),Ke.autoReset=z,Je.enabled=le,Je.autoUpdate=he,Je.needsUpdate=fe,Je.type=ae}function $e(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function bt(z){const le=z.target;le.removeEventListener("dispose",bt),sn(le)}function sn(z){Nn(z),Ne.remove(z)}function Nn(z){const le=Ne.get(z).programs;le!==void 0&&(le.forEach(function(he){ue.releaseProgram(he)}),z.isShaderMaterial&&ue.releaseShaderCache(z))}this.renderBufferDirect=function(z,le,he,fe,ae,De){le===null&&(le=Ie);const Xe=ae.isMesh&&ae.matrixWorld.determinant()<0,lt=S1(z,le,he,fe,ae);be.setMaterial(fe,Xe);let ct=he.index,St=1;if(fe.wireframe===!0){if(ct=se.getWireframeAttribute(he),ct===void 0)return;St=2}const _t=he.drawRange,Ge=he.attributes.position;let pt=_t.start*St,qt=(_t.start+_t.count)*St;De!==null&&(pt=Math.max(pt,De.start*St),qt=Math.min(qt,(De.start+De.count)*St)),ct!==null?(pt=Math.max(pt,0),qt=Math.min(qt,ct.count)):Ge!=null&&(pt=Math.max(pt,0),qt=Math.min(qt,Ge.count));const Qt=qt-pt;if(Qt<0||Qt===1/0)return;We.setup(ae,fe,lt,he,ct);let Jt,Wt=rt;if(ct!==null&&(Jt=q.get(ct),Wt=ee,Wt.setIndex(Jt)),ae.isMesh)fe.wireframe===!0?(be.setLineWidth(fe.wireframeLinewidth*ze()),Wt.setMode(H.LINES)):Wt.setMode(H.TRIANGLES);else if(ae.isLine){let xt=fe.linewidth;xt===void 0&&(xt=1),be.setLineWidth(xt*ze()),ae.isLineSegments?Wt.setMode(H.LINES):ae.isLineLoop?Wt.setMode(H.LINE_LOOP):Wt.setMode(H.LINE_STRIP)}else ae.isPoints?Wt.setMode(H.POINTS):ae.isSprite&&Wt.setMode(H.TRIANGLES);if(ae.isBatchedMesh)if(ae._multiDrawInstances!==null)c0("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Wt.renderMultiDrawInstances(ae._multiDrawStarts,ae._multiDrawCounts,ae._multiDrawCount,ae._multiDrawInstances);else if(Ae.get("WEBGL_multi_draw"))Wt.renderMultiDraw(ae._multiDrawStarts,ae._multiDrawCounts,ae._multiDrawCount);else{const xt=ae._multiDrawStarts,fn=ae._multiDrawCounts,nn=ae._multiDrawCount,_i=ct?q.get(ct).bytesPerElement:1,Ho=Ne.get(fe).currentProgram.getUniforms();for(let _r=0;_r<nn;_r++)Ho.setValue(H,"_gl_DrawID",_r),Wt.render(xt[_r]/_i,fn[_r])}else if(ae.isInstancedMesh)Wt.renderInstances(pt,Qt,ae.count);else if(he.isInstancedBufferGeometry){const xt=he._maxInstanceCount!==void 0?he._maxInstanceCount:1/0,fn=Math.min(he.instanceCount,xt);Wt.renderInstances(pt,Qt,fn)}else Wt.render(pt,Qt)};function Kt(z,le,he){z.transparent===!0&&z.side===Ts&&z.forceSinglePass===!1?(z.side=mi,z.needsUpdate=!0,Eu(z,le,he),z.side=Ta,z.needsUpdate=!0,Eu(z,le,he),z.side=Ts):Eu(z,le,he)}this.compile=function(z,le,he=null){he===null&&(he=z),g=Ze.get(he),g.init(le),S.push(g),he.traverseVisible(function(ae){ae.isLight&&ae.layers.test(le.layers)&&(g.pushLight(ae),ae.castShadow&&g.pushShadow(ae))}),z!==he&&z.traverseVisible(function(ae){ae.isLight&&ae.layers.test(le.layers)&&(g.pushLight(ae),ae.castShadow&&g.pushShadow(ae))}),g.setupLights();const fe=new Set;return z.traverse(function(ae){if(!(ae.isMesh||ae.isPoints||ae.isLine||ae.isSprite))return;const De=ae.material;if(De)if(Array.isArray(De))for(let Xe=0;Xe<De.length;Xe++){const lt=De[Xe];Kt(lt,he,ae),fe.add(lt)}else Kt(De,he,ae),fe.add(De)}),g=S.pop(),fe},this.compileAsync=function(z,le,he=null){const fe=this.compile(z,le,he);return new Promise(ae=>{function De(){if(fe.forEach(function(Xe){Ne.get(Xe).currentProgram.isReady()&&fe.delete(Xe)}),fe.size===0){ae(z);return}setTimeout(De,10)}Ae.get("KHR_parallel_shader_compile")!==null?De():setTimeout(De,10)})};let rr=null;function Ur(z){rr&&rr(z)}function Cm(){lo.stop()}function Nm(){lo.start()}const lo=new VL;lo.setAnimationLoop(Ur),typeof self<"u"&&lo.setContext(self),this.setAnimationLoop=function(z){rr=z,ge.setAnimationLoop(z),z===null?lo.stop():lo.start()},ge.addEventListener("sessionstart",Cm),ge.addEventListener("sessionend",Nm),this.render=function(z,le){if(le!==void 0&&le.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(A===!0)return;if(z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),le.parent===null&&le.matrixWorldAutoUpdate===!0&&le.updateMatrixWorld(),ge.enabled===!0&&ge.isPresenting===!0&&(ge.cameraAutoUpdate===!0&&ge.updateCamera(le),le=ge.getCamera()),z.isScene===!0&&z.onBeforeRender(M,z,le,L),g=Ze.get(z,S.length),g.init(le),S.push(g),je.multiplyMatrices(le.projectionMatrix,le.matrixWorldInverse),ce.setFromProjectionMatrix(je),Re=this.localClippingEnabled,_e=Me.init(this.clippingPlanes,Re),y=Oe.get(z,b.length),y.init(),b.push(y),ge.enabled===!0&&ge.isPresenting===!0){const De=M.xr.getDepthSensingMesh();De!==null&&Ql(De,le,-1/0,M.sortObjects)}Ql(z,le,0,M.sortObjects),y.finish(),M.sortObjects===!0&&y.sort($,K),He=ge.enabled===!1||ge.isPresenting===!1||ge.hasDepthSensing()===!1,He&>.addToRenderList(y,z),this.info.render.frame++,_e===!0&&Me.beginShadows();const he=g.state.shadowsArray;Je.render(he,z,le),_e===!0&&Me.endShadows(),this.info.autoReset===!0&&this.info.reset();const fe=y.opaque,ae=y.transmissive;if(g.setupLights(),le.isArrayCamera){const De=le.cameras;if(ae.length>0)for(let Xe=0,lt=De.length;Xe<lt;Xe++){const ct=De[Xe];Fa(fe,ae,z,ct)}He&>.render(z);for(let Xe=0,lt=De.length;Xe<lt;Xe++){const ct=De[Xe];Rm(y,z,ct,ct.viewport)}}else ae.length>0&&Fa(fe,ae,z,le),He&>.render(z),Rm(y,z,le);L!==null&&F===0&&(W.updateMultisampleRenderTarget(L),W.updateRenderTargetMipmap(L)),z.isScene===!0&&z.onAfterRender(M,z,le),We.resetDefaultState(),N=-1,I=null,S.pop(),S.length>0?(g=S[S.length-1],_e===!0&&Me.setGlobalState(M.clippingPlanes,g.state.camera)):g=null,b.pop(),b.length>0?y=b[b.length-1]:y=null};function Ql(z,le,he,fe){if(z.visible===!1)return;if(z.layers.test(le.layers)){if(z.isGroup)he=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(le);else if(z.isLight)g.pushLight(z),z.castShadow&&g.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||ce.intersectsSprite(z)){fe&&Pe.setFromMatrixPosition(z.matrixWorld).applyMatrix4(je);const Xe=J.update(z),lt=z.material;lt.visible&&y.push(z,Xe,lt,he,Pe.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||ce.intersectsObject(z))){const Xe=J.update(z),lt=z.material;
vendor: 20,334 bytes, line 4094
4094if(fe&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),Pe.copy(z.boundingSphere.center)):(Xe.boundingSphere===null&&Xe.computeBoundingSphere(),Pe.copy(Xe.boundingSphere.center)),Pe.applyMatrix4(z.matrixWorld).applyMatrix4(je)),Array.isArray(lt)){const ct=Xe.groups;for(let St=0,_t=ct.length;St<_t;St++){const Ge=ct[St],pt=lt[Ge.materialIndex];pt&&pt.visible&&y.push(z,Xe,pt,he,Pe.z,Ge)}}else lt.visible&&y.push(z,Xe,lt,he,Pe.z,null)}}const De=z.children;for(let Xe=0,lt=De.length;Xe<lt;Xe++)Ql(De[Xe],le,he,fe)}function Rm(z,le,he,fe){const ae=z.opaque,De=z.transmissive,Xe=z.transparent;g.setupLightsView(he),_e===!0&&Me.setGlobalState(M.clippingPlanes,he),fe&&be.viewport(D.copy(fe)),ae.length>0&&Su(ae,le,he),De.length>0&&Su(De,le,he),Xe.length>0&&Su(Xe,le,he),be.buffers.depth.setTest(!0),be.buffers.depth.setMask(!0),be.buffers.color.setMask(!0),be.setPolygonOffset(!1)}function Fa(z,le,he,fe){if((he.isScene===!0?he.overrideMaterial:null)!==null)return;g.state.transmissionRenderTarget[fe.id]===void 0&&(g.state.transmissionRenderTarget[fe.id]=new Oo(1,1,{generateMipmaps:!0,type:Ae.has("EXT_color_buffer_half_float")||Ae.has("EXT_color_buffer_float")?Lh:Ds,minFilter:To,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:an.workingColorSpace}));const De=g.state.transmissionRenderTarget[fe.id],Xe=fe.viewport||D;De.setSize(Xe.z*M.transmissionResolutionScale,Xe.w*M.transmissionResolutionScale);const lt=M.getRenderTarget();M.setRenderTarget(De),M.getClearColor(V),Z=M.getClearAlpha(),Z<1&&M.setClearColor(16777215,.5),M.clear(),He&>.render(he);const ct=M.toneMapping;M.toneMapping=Io;const St=fe.viewport;if(fe.viewport!==void 0&&(fe.viewport=void 0),g.setupLightsView(fe),_e===!0&&Me.setGlobalState(M.clippingPlanes,fe),Su(z,he,fe),W.updateMultisampleRenderTarget(De),W.updateRenderTargetMipmap(De),Ae.has("WEBGL_multisampled_render_to_texture")===!1){let _t=!1;for(let Ge=0,pt=le.length;Ge<pt;Ge++){const qt=le[Ge],Qt=qt.object,Jt=qt.geometry,Wt=qt.material,xt=qt.group;if(Wt.side===Ts&&Qt.layers.test(fe.layers)){const fn=Wt.side;Wt.side=mi,Wt.needsUpdate=!0,Pm(Qt,he,fe,Jt,Wt,xt),Wt.side=fn,Wt.needsUpdate=!0,_t=!0}}_t===!0&&(W.updateMultisampleRenderTarget(De),W.updateRenderTargetMipmap(De))}M.setRenderTarget(lt),M.setClearColor(V,Z),St!==void 0&&(fe.viewport=St),M.toneMapping=ct}function Su(z,le,he){const fe=le.isScene===!0?le.overrideMaterial:null;for(let ae=0,De=z.length;ae<De;ae++){const Xe=z[ae],lt=Xe.object,ct=Xe.geometry,St=Xe.group;let _t=Xe.material;_t.allowOverride===!0&&fe!==null&&(_t=fe),lt.layers.test(he.layers)&&Pm(lt,le,he,ct,_t,St)}}function Pm(z,le,he,fe,ae,De){z.onBeforeRender(M,le,he,fe,ae,De),z.modelViewMatrix.multiplyMatrices(he.matrixWorldInverse,z.matrixWorld),z.normalMatrix.getNormalMatrix(z.modelViewMatrix),ae.onBeforeRender(M,le,he,fe,z,De),ae.transparent===!0&&ae.side===Ts&&ae.forceSinglePass===!1?(ae.side=mi,ae.needsUpdate=!0,M.renderBufferDirect(he,le,fe,ae,z,De),ae.side=Ta,ae.needsUpdate=!0,M.renderBufferDirect(he,le,fe,ae,z,De),ae.side=Ts):M.renderBufferDirect(he,le,fe,ae,z,De),z.onAfterRender(M,le,he,fe,ae,De)}function Eu(z,le,he){le.isScene!==!0&&(le=Ie);const fe=Ne.get(z),ae=g.state.lights,De=g.state.shadowsArray,Xe=ae.state.version,lt=ue.getParameters(z,ae.state,De,le,he),ct=ue.getProgramCacheKey(lt);let St=fe.programs;fe.environment=z.isMeshStandardMaterial?le.environment:null,fe.fog=le.fog,fe.envMap=(z.isMeshStandardMaterial?B:P).get(z.envMap||fe.environment),fe.envMapRotation=fe.environment!==null&&z.envMap===null?le.environmentRotation:z.envMapRotation,St===void 0&&(z.addEventListener("dispose",bt),St=new Map,fe.programs=St);let _t=St.get(ct);if(_t!==void 0){if(fe.currentProgram===_t&&fe.lightsStateVersion===Xe)return Fm(z,lt),_t}else lt.uniforms=ue.getUniforms(z),z.onBeforeCompile(lt,M),_t=ue.acquireProgram(lt,ct),St.set(ct,_t),fe.uniforms=lt.uniforms;const Ge=fe.uniforms;return(!z.isShaderMaterial&&!z.isRawShaderMaterial||z.clipping===!0)&&(Ge.clippingPlanes=Me.uniform),Fm(z,lt),fe.needsLights=Dm(z),fe.lightsStateVersion=Xe,fe.needsLights&&(Ge.ambientLightColor.value=ae.state.ambient,Ge.lightProbe.value=ae.state.probe,Ge.directionalLights.value=ae.state.directional,Ge.directionalLightShadows.value=ae.state.directionalShadow,Ge.spotLights.value=ae.state.spot,Ge.spotLightShadows.value=ae.state.spotShadow,Ge.rectAreaLights.value=ae.state.rectArea,Ge.ltc_1.value=ae.state.rectAreaLTC1,Ge.ltc_2.value=ae.state.rectAreaLTC2,Ge.pointLights.value=ae.state.point,Ge.pointLightShadows.value=ae.state.pointShadow,Ge.hemisphereLights.value=ae.state.hemi,Ge.directionalShadowMap.value=ae.state.directionalShadowMap,Ge.directionalShadowMatrix.value=ae.state.directionalShadowMatrix,Ge.spotShadowMap.value=ae.state.spotShadowMap,Ge.spotLightMatrix.value=ae.state.spotLightMatrix,Ge.spotLightMap.value=ae.state.spotLightMap,Ge.pointShadowMap.value=ae.state.pointShadowMap,Ge.pointShadowMatrix.value=ae.state.pointShadowMatrix),fe.currentProgram=_t,fe.uniformsList=null,_t}function Im(z){if(z.uniformsList===null){const le=z.currentProgram.getUniforms();z.uniformsList=d0.seqWithValue(le.seq,z.uniforms)}return z.uniformsList}function Fm(z,le){const he=Ne.get(z);he.outputColorSpace=le.outputColorSpace,he.batching=le.batching,he.batchingColor=le.batchingColor,he.instancing=le.instancing,he.instancingColor=le.instancingColor,he.instancingMorph=le.instancingMorph,he.skinning=le.skinning,he.morphTargets=le.morphTargets,he.morphNormals=le.morphNormals,he.morphColors=le.morphColors,he.morphTargetsCount=le.morphTargetsCount,he.numClippingPlanes=le.numClippingPlanes,he.numIntersection=le.numClipIntersection,he.vertexAlphas=le.vertexAlphas,he.vertexTangents=le.vertexTangents,he.toneMapping=le.toneMapping}function S1(z,le,he,fe,ae){le.isScene!==!0&&(le=Ie),W.resetTextureUnits();const De=le.fog,Xe=fe.isMeshStandardMaterial?le.environment:null,lt=L===null?M.outputColorSpace:L.isXRRenderTarget===!0?L.texture.colorSpace:au,ct=(fe.isMeshStandardMaterial?B:P).get(fe.envMap||Xe),St=fe.vertexColors===!0&&!!he.attributes.color&&he.attributes.color.itemSize===4,_t=!!he.attributes.tangent&&(!!fe.normalMap||fe.anisotropy>0),Ge=!!he.morphAttributes.position,pt=!!he.morphAttributes.normal,qt=!!he.morphAttributes.color;let Qt=Io;fe.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Qt=M.toneMapping);const Jt=he.morphAttributes.position||he.morphAttributes.normal||he.morphAttributes.color,Wt=Jt!==void 0?Jt.length:0,xt=Ne.get(fe),fn=g.state.lights;if(_e===!0&&(Re===!0||z!==I)){const Nr=z===I&&fe.id===N;Me.setState(fe,z,Nr)}let nn=!1;fe.version===xt.__version?(xt.needsLights&&xt.lightsStateVersion!==fn.state.version||xt.outputColorSpace!==lt||ae.isBatchedMesh&&xt.batching===!1||!ae.isBatchedMesh&&xt.batching===!0||ae.isBatchedMesh&&xt.batchingColor===!0&&ae.colorTexture===null||ae.isBatchedMesh&&xt.batchingColor===!1&&ae.colorTexture!==null||ae.isInstancedMesh&&xt.instancing===!1||!ae.isInstancedMesh&&xt.instancing===!0||ae.isSkinnedMesh&&xt.skinning===!1||!ae.isSkinnedMesh&&xt.skinning===!0||ae.isInstancedMesh&&xt.instancingColor===!0&&ae.instanceColor===null||ae.isInstancedMesh&&xt.instancingColor===!1&&ae.instanceColor!==null||ae.isInstancedMesh&&xt.instancingMorph===!0&&ae.morphTexture===null||ae.isInstancedMesh&&xt.instancingMorph===!1&&ae.morphTexture!==null||xt.envMap!==ct||fe.fog===!0&&xt.fog!==De||xt.numClippingPlanes!==void 0&&(xt.numClippingPlanes!==Me.numPlanes||xt.numIntersection!==Me.numIntersection)||xt.vertexAlphas!==St||xt.vertexTangents!==_t||xt.morphTargets!==Ge||xt.morphNormals!==pt||xt.morphColors!==qt||xt.toneMapping!==Qt||xt.morphTargetsCount!==Wt)&&(nn=!0):(nn=!0,xt.__version=fe.version);let _i=xt.currentProgram;nn===!0&&(_i=Eu(fe,le,ae));let Ho=!1,_r=!1,Da=!1;const tn=_i.getUniforms(),wi=xt.uniforms;if(be.useProgram(_i.program)&&(Ho=!0,_r=!0,Da=!0),fe.id!==N&&(N=fe.id,_r=!0),Ho||I!==z){be.buffers.depth.getReversed()?(pe.copy(z.projectionMatrix),cW(pe),uW(pe),tn.setValue(H,"projectionMatrix",pe)):tn.setValue(H,"projectionMatrix",z.projectionMatrix),tn.setValue(H,"viewMatrix",z.matrixWorldInverse);const ur=tn.map.cameraPosition;ur!==void 0&&ur.setValue(H,nt.setFromMatrixPosition(z.matrixWorld)),Te.logarithmicDepthBuffer&&tn.setValue(H,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial)&&tn.setValue(H,"isOrthographic",z.isOrthographicCamera===!0),I!==z&&(I=z,_r=!0,Da=!0)}if(ae.isSkinnedMesh){tn.setOptional(H,ae,"bindMatrix"),tn.setOptional(H,ae,"bindMatrixInverse");const Nr=ae.skeleton;Nr&&(Nr.boneTexture===null&&Nr.computeBoneTexture(),tn.setValue(H,"boneTexture",Nr.boneTexture,W))}ae.isBatchedMesh&&(tn.setOptional(H,ae,"batchingTexture"),tn.setValue(H,"batchingTexture",ae._matricesTexture,W),tn.setOptional(H,ae,"batchingIdTexture"),tn.setValue(H,"batchingIdTexture",ae._indirectTexture,W),tn.setOptional(H,ae,"batchingColorTexture"),ae._colorsTexture!==null&&tn.setValue(H,"batchingColorTexture",ae._colorsTexture,W));const bi=he.morphAttributes;if((bi.position!==void 0||bi.normal!==void 0||bi.color!==void 0)&&wt.update(ae,he,_i),(_r||xt.receiveShadow!==ae.receiveShadow)&&(xt.receiveShadow=ae.receiveShadow,tn.setValue(H,"receiveShadow",ae.receiveShadow)),fe.isMeshGouraudMaterial&&fe.envMap!==null&&(wi.envMap.value=ct,wi.flipEnvMap.value=ct.isCubeTexture&&ct.isRenderTargetTexture===!1?-1:1),fe.isMeshStandardMaterial&&fe.envMap===null&&le.environment!==null&&(wi.envMapIntensity.value=le.environmentIntensity),_r&&(tn.setValue(H,"toneMappingExposure",M.toneMappingExposure),xt.needsLights&&E1(wi,Da),De&&fe.fog===!0&&me.refreshFogUniforms(wi,De),me.refreshMaterialUniforms(wi,fe,j,ne,g.state.transmissionRenderTarget[z.id]),d0.upload(H,Im(xt),wi,W)),fe.isShaderMaterial&&fe.uniformsNeedUpdate===!0&&(d0.upload(H,Im(xt),wi,W),fe.uniformsNeedUpdate=!1),fe.isSpriteMaterial&&tn.setValue(H,"center",ae.center),tn.setValue(H,"modelViewMatrix",ae.modelViewMatrix),tn.setValue(H,"normalMatrix",ae.normalMatrix),tn.setValue(H,"modelMatrix",ae.matrixWorld),fe.isShaderMaterial||fe.isRawShaderMaterial){const Nr=fe.uniformsGroups;for(let ur=0,ka=Nr.length;ur<ka;ur++){const Hi=Nr[ur];Q.update(Hi,_i),Q.bind(Hi,_i)}}return _i}function E1(z,le){z.ambientLightColor.needsUpdate=le,z.lightProbe.needsUpdate=le,z.directionalLights.needsUpdate=le,z.directionalLightShadows.needsUpdate=le,z.pointLights.needsUpdate=le,z.pointLightShadows.needsUpdate=le,z.spotLights.needsUpdate=le,z.spotLightShadows.needsUpdate=le,z.rectAreaLights.needsUpdate=le,z.hemisphereLights.needsUpdate=le}function Dm(z){return z.isMeshLambertMaterial||z.isMeshToonMaterial||z.isMeshPhongMaterial||z.isMeshStandardMaterial||z.isShadowMaterial||z.isShaderMaterial&&z.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return F},this.getRenderTarget=function(){return L},this.setRenderTargetTextures=function(z,le,he){const fe=Ne.get(z);fe.__autoAllocateDepthBuffer=z.resolveDepthBuffer===!1,fe.__autoAllocateDepthBuffer===!1&&(fe.__useRenderToTexture=!1),Ne.get(z.texture).__webglTexture=le,Ne.get(z.depthTexture).__webglTexture=fe.__autoAllocateDepthBuffer?void 0:he,fe.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(z,le){const he=Ne.get(z);he.__webglFramebuffer=le,he.__useDefaultFramebuffer=le===void 0};const M1=H.createFramebuffer();this.setRenderTarget=function(z,le=0,he=0){L=z,R=le,F=he;let fe=!0,ae=null,De=!1,Xe=!1;if(z){const ct=Ne.get(z);if(ct.__useDefaultFramebuffer!==void 0)be.bindFramebuffer(H.FRAMEBUFFER,null),fe=!1;else if(ct.__webglFramebuffer===void 0)W.setupRenderTarget(z);else if(ct.__hasExternalTextures)W.rebindTextures(z,Ne.get(z.texture).__webglTexture,Ne.get(z.depthTexture).__webglTexture);else if(z.depthBuffer){const Ge=z.depthTexture;if(ct.__boundDepthTexture!==Ge){if(Ge!==null&&Ne.has(Ge)&&(z.width!==Ge.image.width||z.height!==Ge.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");W.setupDepthRenderbuffer(z)}}const St=z.texture;(St.isData3DTexture||St.isDataArrayTexture||St.isCompressedArrayTexture)&&(Xe=!0);const _t=Ne.get(z).__webglFramebuffer;z.isWebGLCubeRenderTarget?(Array.isArray(_t[le])?ae=_t[le][he]:ae=_t[le],De=!0):z.samples>0&&W.useMultisampledRTT(z)===!1?ae=Ne.get(z).__webglMultisampledFramebuffer:Array.isArray(_t)?ae=_t[he]:ae=_t,D.copy(z.viewport),O.copy(z.scissor),U=z.scissorTest}else D.copy(re).multiplyScalar(j).floor(),O.copy(xe).multiplyScalar(j).floor(),U=Ce;if(he!==0&&(ae=M1),be.bindFramebuffer(H.FRAMEBUFFER,ae)&&fe&&be.drawBuffers(z,ae),be.viewport(D),be.scissor(O),be.setScissorTest(U),De){const ct=Ne.get(z.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+le,ct.__webglTexture,he)}else if(Xe){const ct=Ne.get(z.texture),St=le;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,ct.__webglTexture,he,St)}else if(z!==null&&he!==0){const ct=Ne.get(z.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,ct.__webglTexture,he)}N=-1},this.readRenderTargetPixels=function(z,le,he,fe,ae,De,Xe){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let lt=Ne.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Xe!==void 0&&(lt=lt[Xe]),lt){be.bindFramebuffer(H.FRAMEBUFFER,lt);try{const ct=z.texture,St=ct.format,_t=ct.type;if(!Te.textureFormatReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Te.textureTypeReadable(_t)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}le>=0&&le<=z.width-fe&&he>=0&&he<=z.height-ae&&H.readPixels(le,he,fe,ae,we.convert(St),we.convert(_t),De)}finally{const ct=L!==null?Ne.get(L).__webglFramebuffer:null;be.bindFramebuffer(H.FRAMEBUFFER,ct)}}},this.readRenderTargetPixelsAsync=async function(z,le,he,fe,ae,De,Xe){if(!(z&&z.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let lt=Ne.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Xe!==void 0&&(lt=lt[Xe]),lt)if(le>=0&&le<=z.width-fe&&he>=0&&he<=z.height-ae){be.bindFramebuffer(H.FRAMEBUFFER,lt);const ct=z.texture,St=ct.format,_t=ct.type;if(!Te.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Te.textureTypeReadable(_t))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ge=H.createBuffer();H.bindBuffer(H.PIXEL_PACK_BUFFER,Ge),H.bufferData(H.PIXEL_PACK_BUFFER,De.byteLength,H.STREAM_READ),H.readPixels(le,he,fe,ae,we.convert(St),we.convert(_t),0);const pt=L!==null?Ne.get(L).__webglFramebuffer:null;be.bindFramebuffer(H.FRAMEBUFFER,pt);const qt=H.fenceSync(H.SYNC_GPU_COMMANDS_COMPLETE,0);return H.flush(),await lW(H,qt,4),H.bindBuffer(H.PIXEL_PACK_BUFFER,Ge),H.getBufferSubData(H.PIXEL_PACK_BUFFER,0,De),H.deleteBuffer(Ge),H.deleteSync(qt),De}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(z,le=null,he=0){const fe=Math.pow(2,-he),ae=Math.floor(z.image.width*fe),De=Math.floor(z.image.height*fe),Xe=le!==null?le.x:0,lt=le!==null?le.y:0;W.setTexture2D(z,0),H.copyTexSubImage2D(H.TEXTURE_2D,he,0,0,Xe,lt,ae,De),be.unbindTexture()};const A1=H.createFramebuffer(),T1=H.createFramebuffer();this.copyTextureToTexture=function(z,le,he=null,fe=null,ae=0,De=null){De===null&&(ae!==0?(c0("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),De=ae,ae=0):De=0);let Xe,lt,ct,St,_t,Ge,pt,qt,Qt;const Jt=z.isCompressedTexture?z.mipmaps[De]:z.image;if(he!==null)Xe=he.max.x-he.min.x,lt=he.max.y-he.min.y,ct=he.isBox3?he.max.z-he.min.z:1,St=he.min.x,_t=he.min.y,Ge=he.isBox3?he.min.z:0;else{const bi=Math.pow(2,-ae);Xe=Math.floor(Jt.width*bi),lt=Math.floor(Jt.height*bi),z.isDataArrayTexture?ct=Jt.depth:z.isData3DTexture?ct=Math.floor(Jt.depth*bi):ct=1,St=0,_t=0,Ge=0}fe!==null?(pt=fe.x,qt=fe.y,Qt=fe.z):(pt=0,qt=0,Qt=0);const Wt=we.convert(le.format),xt=we.convert(le.type);let fn;le.isData3DTexture?(W.setTexture3D(le,0),fn=H.TEXTURE_3D):le.isDataArrayTexture||le.isCompressedArrayTexture?(W.setTexture2DArray(le,0),fn=H.TEXTURE_2D_ARRAY):(W.setTexture2D(le,0),fn=H.TEXTURE_2D),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,le.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,le.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,le.unpackAlignment);const nn=H.getParameter(H.UNPACK_ROW_LENGTH),_i=H.getParameter(H.UNPACK_IMAGE_HEIGHT),Ho=H.getParameter(H.UNPACK_SKIP_PIXELS),_r=H.getParameter(H.UNPACK_SKIP_ROWS),Da=H.getParameter(H.UNPACK_SKIP_IMAGES);H.pixelStorei(H.UNPACK_ROW_LENGTH,Jt.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,Jt.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,St),H.pixelStorei(H.UNPACK_SKIP_ROWS,_t),H.pixelStorei(H.UNPACK_SKIP_IMAGES,Ge);const tn=z.isDataArrayTexture||z.isData3DTexture,wi=le.isDataArrayTexture||le.isData3DTexture;if(z.isDepthTexture){const bi=Ne.get(z),Nr=Ne.get(le),ur=Ne.get(bi.__renderTarget),ka=Ne.get(Nr.__renderTarget);be.bindFramebuffer(H.READ_FRAMEBUFFER,ur.__webglFramebuffer),be.bindFramebuffer(H.DRAW_FRAMEBUFFER,ka.__webglFramebuffer);for(let Hi=0;Hi<ct;Hi++)tn&&(H.framebufferTextureLayer(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,Ne.get(z).__webglTexture,ae,Ge+Hi),H.framebufferTextureLayer(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,Ne.get(le).__webglTexture,De,Qt+Hi)),H.blitFramebuffer(St,_t,Xe,lt,pt,qt,Xe,lt,H.DEPTH_BUFFER_BIT,H.NEAREST);be.bindFramebuffer(H.READ_FRAMEBUFFER,null),be.bindFramebuffer(H.DRAW_FRAMEBUFFER,null)}else if(ae!==0||z.isRenderTargetTexture||Ne.has(z)){const bi=Ne.get(z),Nr=Ne.get(le);be.bindFramebuffer(H.READ_FRAMEBUFFER,A1),be.bindFramebuffer(H.DRAW_FRAMEBUFFER,T1);for(let ur=0;ur<ct;ur++)tn?H.framebufferTextureLayer(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,bi.__webglTexture,ae,Ge+ur):H.framebufferTexture2D(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,bi.__webglTexture,ae),wi?H.framebufferTextureLayer(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,Nr.__webglTexture,De,Qt+ur):H.framebufferTexture2D(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,Nr.__webglTexture,De),ae!==0?H.blitFramebuffer(St,_t,Xe,lt,pt,qt,Xe,lt,H.COLOR_BUFFER_BIT,H.NEAREST):wi?H.copyTexSubImage3D(fn,De,pt,qt,Qt+ur,St,_t,Xe,lt):H.copyTexSubImage2D(fn,De,pt,qt,St,_t,Xe,lt);be.bindFramebuffer(H.READ_FRAMEBUFFER,null),be.bindFramebuffer(H.DRAW_FRAMEBUFFER,null)}else wi?z.isDataTexture||z.isData3DTexture?H.texSubImage3D(fn,De,pt,qt,Qt,Xe,lt,ct,Wt,xt,Jt.data):le.isCompressedArrayTexture?H.compressedTexSubImage3D(fn,De,pt,qt,Qt,Xe,lt,ct,Wt,Jt.data):H.texSubImage3D(fn,De,pt,qt,Qt,Xe,lt,ct,Wt,xt,Jt):z.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,De,pt,qt,Xe,lt,Wt,xt,Jt.data):z.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,De,pt,qt,Jt.width,Jt.height,Wt,Jt.data):H.texSubImage2D(H.TEXTURE_2D,De,pt,qt,Xe,lt,Wt,xt,Jt);H.pixelStorei(H.UNPACK_ROW_LENGTH,nn),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,_i),H.pixelStorei(H.UNPACK_SKIP_PIXELS,Ho),H.pixelStorei(H.UNPACK_SKIP_ROWS,_r),H.pixelStorei(H.UNPACK_SKIP_IMAGES,Da),De===0&&le.generateMipmaps&&H.generateMipmap(fn),be.unbindTexture()},this.copyTextureToTexture3D=function(z,le,he=null,fe=null,ae=0){return c0('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(z,le,he,fe,ae)},this.initRenderTarget=function(z){Ne.get(z).__webglFramebuffer===void 0&&W.setupRenderTarget(z)},this.initTexture=function(z){z.isCubeTexture?W.setTextureCube(z,0):z.isData3DTexture?W.setTexture3D(z,0):z.isDataArrayTexture||z.isCompressedArrayTexture?W.setTexture2DArray(z,0):W.setTexture2D(z,0),be.unbindTexture()},this.resetState=function(){R=0,F=0,L=null,be.reset(),We.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Rs}get outputColorSpace(){return this._outputColorSpace}
4094set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=an._getDrawingBufferColorSpace(e),t.unpackColorSpace=an._getUnpackColorSpace()}}const bZ=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:GE,AddEquation:al,AddOperation:gk,AdditiveAnimationBlendMode:eM,AdditiveBlending:VS,AgXToneMapping:wk,AlphaFormat:KE,AlwaysCompare:Lk,AlwaysDepth:ev,AlwaysStencilFunc:$S,AmbientLight:RL,AnimationAction:UL,AnimationClip:Kp,AnimationLoader:LG,AnimationMixer:d$,AnimationObjectGroup:c$,AnimationUtils:IG,ArcCurve:tL,ArrayCamera:LL,ArrowHelper:F$,AttachedBindMode:GS,Audio:jL,AudioAnalyser:JG,AudioContext:EM,AudioListener:KG,AudioLoader:XG,AxesHelper:D$,BackSide:mi,BasicDepthPacking:Tk,BasicShadowMap:KD,BatchedMesh:Kk,Bone:aM,BooleanKeyframeTrack:_u,Box2:y$,Box3:Jr,Box3Helper:P$,BoxGeometry:yu,BoxHelper:R$,BufferAttribute:En,BufferGeometry:zt,BufferGeometryLoader:kL,ByteType:XE,Cache:pa,Camera:pm,CameraHelper:N$,CanvasTexture:cM,CapsuleGeometry:qy,CatmullRomCurve3:nL,CineonToneMapping:yk,CircleGeometry:Yy,ClampToEdgeWrapping:Ns,Clock:MM,Color:at,ColorKeyframeTrack:wM,ColorManagement:an,CompressedArrayTexture:JW,CompressedCubeTexture:eG,CompressedTexture:$y,CompressedTextureLoader:jG,ConeGeometry:xm,ConstantAlphaFactor:fk,ConstantColorFactor:dk,Controls:L$,CubeCamera:Hk,CubeReflectionMapping:Ca,CubeRefractionMapping:Ol,CubeTexture:mm,CubeTextureLoader:OG,CubeUVReflectionMapping:kh,CubicBezierCurve:dM,CubicBezierCurve3:rL,CubicInterpolant:bL,CullFaceBack:zS,CullFaceFront:YD,CullFaceFrontBack:a7,CullFaceNone:qD,Curve:oo,CurvePath:sL,CustomBlending:ZD,CustomToneMapping:_k,CylinderGeometry:gm,Cylindrical:v$,Data3DTexture:By,DataArrayTexture:fm,DataTexture:Fo,DataTextureLoader:UG,DataUtils:MW,DecrementStencilOp:w7,DecrementWrapStencilOp:S7,DefaultLoadingManager:ML,DepthArrayTexture:tG,DepthFormat:mh,DepthStencilFormat:gh,DepthTexture:Xy,DetachedBindMode:Sk,DirectionalLight:NL,DirectionalLightHelper:C$,DiscreteInterpolant:SL,DodecahedronGeometry:Ky,DoubleSide:Ts,DstAlphaFactor:ok,DstColorFactor:lk,DynamicCopyUsage:O7,DynamicDrawUsage:I7,DynamicReadUsage:k7,EdgesGeometry:eL,EllipseCurve:Zy,EqualCompare:Ik,EqualDepth:nv,EqualStencilFunc:T7,EquirectangularReflectionMapping:kp,EquirectangularRefractionMapping:Lp,Euler:ls,EventDispatcher:zo,ExtrudeGeometry:Qy,FileLoader:Ra,Float16BufferAttribute:IW,Float32BufferAttribute:ht,FloatType:Li,Fog:Vy,FogExp2:zy,FramebufferTexture:QW,FrontSide:Ta,Frustum:jh,FrustumArray:Gy,GLBufferAttribute:x$,GLSL1:B7,GLSL3:XS,GreaterCompare:Fk,GreaterDepth:iv,GreaterEqualCompare:kk,GreaterEqualDepth:rv,GreaterEqualStencilFunc:P7,GreaterStencilFunc:N7,GridHelper:A$,Group:Md,HalfFloatType:Lh,HemisphereLight:AL,HemisphereLightHelper:M$,IcosahedronGeometry:Jy,ImageBitmapLoader:$G,ImageLoader:Zp,ImageUtils:Uk,IncrementStencilOp:_7,IncrementWrapStencilOp:b7,InstancedBufferAttribute:yh,InstancedBufferGeometry:DL,InstancedInterleavedBuffer:g$,InstancedMesh:Yk,Int16BufferAttribute:RW,Int32BufferAttribute:PW,Int8BufferAttribute:TW,IntType:Iy,InterleavedBuffer:Hy,InterleavedBufferAttribute:lu,Interpolant:_m,InterpolateDiscrete:Up,InterpolateLinear:Iv,InterpolateSmooth:l0,InterpolationSamplingMode:H7,InterpolationSamplingType:V7,InvertStencilOp:E7,KeepStencilOp:Ac,KeyframeTrack:ks,LOD:Xk,LatheGeometry:e1,Layers:qc,LessCompare:Pk,LessDepth:tv,LessEqualCompare:tM,LessEqualDepth:ou,LessEqualStencilFunc:C7,LessStencilFunc:A7,Light:Yl,LightProbe:FL,Line:Ul,Line3:_$,LineBasicMaterial:yi,LineCurve:hM,LineCurve3:iL,LineDashedMaterial:yL,LineLoop:Zk,LineSegments:Vo,LinearFilter:xr,LinearInterpolant:_M,LinearMipMapLinearFilter:d7,LinearMipMapNearestFilter:u7,LinearMipmapLinearFilter:To,LinearMipmapNearestFilter:ip,LinearSRGBColorSpace:au,LinearToneMapping:xk,LinearTransfer:zp,Loader:Vi,LoaderUtils:QS,LoadingManager:bM,LoopOnce:Ek,LoopPingPong:Ak,LoopRepeat:Mk,MOUSE:Ec,Material:ri,MaterialLoader:a1,MathUtils:oW,Matrix2:NM,Matrix3:jt,Matrix4:Rt,MaxEquation:tk,Mesh:cr,MeshBasicMaterial:Xl,MeshDepthMaterial:xM,MeshDistanceMaterial:vM,MeshLambertMaterial:xL,MeshMatcapMaterial:vL,MeshNormalMaterial:gL,MeshPhongMaterial:pL,MeshPhysicalMaterial:fL,MeshStandardMaterial:gM,MeshToonMaterial:mL,MinEquation:ek,MirroredRepeatWrapping:Op,MixOperation:mk,MultiplyBlending:WS,MultiplyOperation:dm,NearestFilter:Lr,NearestMipMapLinearFilter:c7,NearestMipMapNearestFilter:l7,NearestMipmapLinearFilter:Sd,NearestMipmapNearestFilter:$E,NeutralToneMapping:bk,NeverCompare:Rk,NeverDepth:J0,NeverStencilFunc:M7,NoBlending:va,NoColorSpace:ua,NoToneMapping:Io,NormalAnimationBlendMode:Oy,NormalBlending:$c,NotEqualCompare:Dk,NotEqualDepth:sv,NotEqualStencilFunc:R7,NumberKeyframeTrack:qp,Object3D:dn,ObjectLoader:WG,ObjectSpaceNormalMap:Nk,OctahedronGeometry:vm,OneFactor:rk,OneMinusConstantAlphaFactor:pk,OneMinusConstantColorFactor:hk,OneMinusDstAlphaFactor:ak,OneMinusDstColorFactor:ck,OneMinusSrcAlphaFactor:Q0,OneMinusSrcColorFactor:sk,Orthogra
vendor: 5,372 bytes, lines 4094-4102
4094phicCamera:Do,PCFShadowMap:Ry,PCFSoftShadowMap:rp,PMREMGenerator:n2,Path:Lv,PerspectiveCamera:Un,Plane:la,PlaneGeometry:Oh,PlaneHelper:I$,PointLight:CL,PointLightHelper:S$,Points:Qk,PointsMaterial:lM,PolarGridHelper:T$,PolyhedronGeometry:ql,PositionalAudio:QG,PropertyBinding:ln,PropertyMixer:OL,QuadraticBezierCurve:fM,QuadraticBezierCurve3:pM,Quaternion:Qr,QuaternionKeyframeTrack:wm,QuaternionLinearInterpolant:EL,RED_GREEN_RGTC2_Format:Rv,RED_RGTC1_Format:JE,REVISION:Ny,RGBADepthPacking:Ck,RGBAFormat:Zr,RGBAIntegerFormat:jy,RGBA_ASTC_10x10_Format:Ev,RGBA_ASTC_10x5_Format:wv,RGBA_ASTC_10x6_Format:bv,RGBA_ASTC_10x8_Format:Sv,RGBA_ASTC_12x10_Format:Mv,RGBA_ASTC_12x12_Format:Av,RGBA_ASTC_4x4_Format:fv,RGBA_ASTC_5x4_Format:pv,RGBA_ASTC_5x5_Format:mv,RGBA_ASTC_6x5_Format:gv,RGBA_ASTC_6x6_Format:xv,RGBA_ASTC_8x5_Format:vv,RGBA_ASTC_8x6_Format:yv,RGBA_ASTC_8x8_Format:_v,RGBA_BPTC_Format:cp,RGBA_ETC2_EAC_Format:hv,RGBA_PVRTC_2BPPV1_Format:cv,RGBA_PVRTC_4BPPV1_Format:lv,RGBA_S3TC_DXT1_Format:op,RGBA_S3TC_DXT3_Format:ap,RGBA_S3TC_DXT5_Format:lp,RGBDepthPacking:g7,RGBFormat:ZE,RGBIntegerFormat:h7,RGB_BPTC_SIGNED_Format:Tv,RGB_BPTC_UNSIGNED_Format:Cv,RGB_ETC1_Format:uv,RGB_ETC2_Format:dv,RGB_PVRTC_2BPPV1_Format:av,RGB_PVRTC_4BPPV1_Format:ov,RGB_S3TC_DXT1_Format:sp,RGDepthPacking:x7,RGFormat:QE,RGIntegerFormat:Ly,RawShaderMaterial:hL,Ray:vu,Raycaster:BL,RectAreaLight:PL,RedFormat:ky,RedIntegerFormat:hm,ReinhardToneMapping:vk,RenderTarget:Uy,RenderTarget3D:h$,RenderTargetArray:f$,RepeatWrapping:jp,ReplaceStencilOp:y7,ReverseSubtractEquation:JD,RingGeometry:t1,SIGNED_RED_GREEN_RGTC2_Format:Pv,SIGNED_RED_RGTC1_Format:Nv,SRGBColorSpace:Ri,SRGBTransfer:wn,Scene:sM,ShaderChunk:Ht,ShaderLib:Ks,ShaderMaterial:so,ShadowMaterial:dL,Shape:Yc,ShapeGeometry:n1,ShapePath:k$,ShapeUtils:Js,ShortType:qE,Skeleton:Wy,SkeletonHelper:b$,SkinnedMesh:qk,Source:_l,Sphere:jr,SphereGeometry:ym,Spherical:e2,SphericalHarmonics3:IL,SplineCurve:mM,SpotLight:TL,SpotLightHelper:w$,Sprite:$k,SpriteMaterial:oM,SrcAlphaFactor:Z0,SrcAlphaSaturateFactor:uk,SrcColorFactor:ik,StaticCopyUsage:j7,StaticDrawUsage:Vp,StaticReadUsage:D7,StereoCamera:qG,StreamCopyUsage:U7,StreamDrawUsage:F7,StreamReadUsage:L7,StringKeyframeTrack:wu,SubtractEquation:QD,SubtractiveBlending:HS,TOUCH:Mc,TangentSpaceNormalMap:$l,TetrahedronGeometry:r1,Texture:Yn,TextureLoader:BG,TextureUtils:z$,TimestampQuery:z7,TorusGeometry:i1,TorusKnotGeometry:s1,Triangle:Ii,TriangleFanDrawMode:m7,TriangleStripDrawMode:p7,TrianglesDrawMode:f7,TubeGeometry:o1,UVMapping:Py,Uint16BufferAttribute:rM,Uint32BufferAttribute:iM,Uint8BufferAttribute:CW,Uint8ClampedBufferAttribute:NW,Uniform:CM,UniformsGroup:m$,UniformsLib:qe,UniformsUtils:Vk,UnsignedByteType:Ds,UnsignedInt248Type:ph,UnsignedInt5999Type:YE,UnsignedIntType:Na,UnsignedShort4444Type:Fy,UnsignedShort5551Type:Dy,UnsignedShortType:fh,VSMShadowMap:Gs,Vector2:Se,Vector3:G,Vector4:cn,VectorKeyframeTrack:Yp,VideoFrameTexture:ZW,VideoTexture:Jk,WebGL3DRenderTarget:mW,WebGLArrayRenderTarget:pW,WebGLCoordinateSystem:Rs,WebGLCubeRenderTarget:Wk,WebGLRenderTarget:Oo,WebGLRenderer:qL,WebGLUtils:XL,WebGPUCoordinateSystem:Hp,WebXRController:u0,WireframeGeometry:uL,WrapAroundEnding:Bp,ZeroCurvatureEnding:Ic,ZeroFactor:nk,ZeroSlopeEnding:Fc,ZeroStencilOp:v7,createCanvasElement:Ok},Symbol.toStringTag,{value:"Module"}));var YL={exports:{}},bu={};/** 4095 * @license React 4096 * react-reconciler-constants.production.min.js 4097 * 4098 * Copyright (c) Facebook, Inc. and its affiliates. 4099 * 4100 * This source code is licensed under the MIT license found in the 4101 * LICENSE file in the root directory of this source tree. 4102 */bu.ConcurrentRoot=1;bu.ContinuousEventPriority=4;bu.DefaultEventPriority=16;bu.DiscreteEventPriority=1;bu.IdleEventPriority=536870912;bu.LegacyRoot=0;YL.exports=bu;var Td=YL.exports;function SZ(n){let e;const t=new Set,r=(u,f)=>{const p=typeof u=="function"?u(e):u;if(p!==e){const m=e;e=f?p:Object.assign({},e,p),t.forEach(x=>x(e,m))}},i=()=>e,s=(u,f=i,p=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let m=f(e);function x(){const v=f(e);if(!p(m,v)){const _=m;u(m=v,_)}}return t.add(x),()=>t.delete(x)},c={setState:r,getState:i,subscribe:(u,f,p)=>f||p?s(u,f,p):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(r,i,c),c}const EZ=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),tR=EZ?T.useEffect:T.useLayoutEffect;function MZ(n){const e=typeof n=="function"?SZ(n):n,t=(r=e.getState,i=Object.is)=>{const[,s]=T.useReducer(y=>y+1,0),o=e.getState(),a=T.useRef(o),c=T.useRef(r),u=T.useRef(i),f=T.useRef(!1),p=T.useRef();p.current===void 0&&(p.current=r(o));let m,x=!1;(a.current!==o||c.current!==r||u.current!==i||f.current)&&(m=r(o),x=!i(p.current,m)),tR(()=>{x&&(p.current=m),a.current=o,c.current=r,u.current=i,f.current=!1});const v=T.useRef(o);tR(()=>{const y=()=>{try{const b=e.getState(),S=c.current(b);u.current(p.current,S)||(a.current=b,p.current=S,s())}catch{f.current=!0,s()}},g=e.subscribe(y);return e.getState()!==v.current&&y(),g},[]);const _=x?m:p.current;return T.useDebugValue(_),_};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[t,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},t}var KL={exports:{}},tb={exports:{}},nb={};
vendor: 4,836 bytes, lines 4102-4118
4102/** 4103 * @license React 4104 * scheduler.production.min.js 4105 * 4106 * Copyright (c) Facebook, Inc. and its affiliates. 4107 * 4108 * This source code is licensed under the MIT license found in the 4109 * LICENSE file in the root directory of this source tree. 4110 */var nR;function AZ(){return nR||(nR=1,function(n){function e(j,$){var K=j.length;j.push($);e:for(;0<K;){var re=K-1>>>1,xe=j[re];if(0<i(xe,$))j[re]=$,j[K]=xe,K=re;else break e}}function t(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var $=j[0],K=j.pop();if(K!==$){j[0]=K;e:for(var re=0,xe=j.length,Ce=xe>>>1;re<Ce;){var ce=2*(re+1)-1,_e=j[ce],Re=ce+1,pe=j[Re];if(0>i(_e,K))Re<xe&&0>i(pe,_e)?(j[re]=pe,j[Re]=K,re=Re):(j[re]=_e,j[ce]=K,re=ce);else if(Re<xe&&0>i(pe,K))j[re]=pe,j[Re]=K,re=Re;else break e}}return $}function i(j,$){var K=j.sortIndex-$.sortIndex;return K!==0?K:j.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var c=[],u=[],f=1,p=null,m=3,x=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(j){for(var $=t(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=j)r(u),$.sortIndex=$.expirationTime,e(c,$);else break;$=t(u)}}function M(j){if(_=!1,S(j),!v)if(t(c)!==null)v=!0,Y(A);else{var $=t(u);$!==null&&ne(M,$.startTime-j)}}function A(j,$){v=!1,_&&(_=!1,g(L),L=-1),x=!0;var K=m;try{for(S($),p=t(c);p!==null&&(!(p.expirationTime>$)||j&&!D());){var re=p.callback;if(typeof re=="function"){p.callback=null,m=p.priorityLevel;var xe=re(p.expirationTime<=$);$=n.unstable_now(),typeof xe=="function"?p.callback=xe:p===t(c)&&r(c),S($)}else r(c);p=t(c)}if(p!==null)var Ce=!0;else{var ce=t(u);ce!==null&&ne(M,ce.startTime-$),Ce=!1}return Ce}finally{p=null,m=K,x=!1}}var R=!1,F=null,L=-1,N=5,I=-1;function D(){return!(n.unstable_now()-I<N)}function O(){if(F!==null){var j=n.unstable_now();I=j;var $=!0;try{$=F(!0,j)}finally{$?U():(R=!1,F=null)}}else R=!1}var U;if(typeof b=="function")U=function(){b(O)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,Z=V.port2;V.port1.onmessage=O,U=function(){Z.postMessage(null)}}else U=function(){y(O,0)};function Y(j){F=j,R||(R=!0,U())}function ne(j,$){L=y(function(){j(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_continueExecution=function(){v||x||(v=!0,Y(A))},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return m},n.unstable_getFirstCallbackNode=function(){return t(c)},n.unstable_next=function(j){switch(m){case 1:case 2:case 3:var $=3;break;default:$=m}var K=m;m=$;try{return j()}finally{m=K}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(j,$){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var K=m;m=j;try{return $()}finally{m=K}},n.unstable_scheduleCallback=function(j,$,K){var re=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?re+K:re):K=re,j){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=K+xe,j={id:f++,callback:$,priorityLevel:j,startTime:K,expirationTime:xe,sortIndex:-1},K>re?(j.sortIndex=K,e(u,j),t(c)===null&&j===t(u)&&(_?(g(L),L=-1):_=!0,ne(M,K-re))):(j.sortIndex=xe,e(c,j),v||x||(v=!0,Y(A))),j},n.unstable_shouldYield=D,n.unstable_wrapCallback=function(j){var $=m;return function(){var K=m;m=$;try{return j.apply(this,arguments)}finally{m=K}}}}(nb)),nb}var rR;function TZ(){return rR||(rR=1,tb.exports=AZ()),tb.exports}/** 4111 * @license React 4112 * react-reconciler.production.min.js 4113 * 4114 * Copyright (c) Facebook, Inc. and its affiliates. 4115 * 4116 * This source code is licensed under the MIT license found in the 4117 * LICENSE file in the root directory of this source tree. 4118 */var CZ=function(e){var t={},r=T,i=TZ(),s=Object.assign;function o(d){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+d,w=1;w<arguments.length;w++)h+="&args[]="+encodeURIComponent(arguments[w]);return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
vendor: 134,189 bytes, lines 4118-4136
4118var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=Symbol.for("react.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),v=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),A=Symbol.iterator;function R(d){return d===null||typeof d!="object"?null:(d=A&&d[A]||d["@@iterator"],typeof d=="function"?d:null)}function F(d){if(d==null)return null;if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case f:return"Fragment";case u:return"Portal";case m:return"Profiler";case p:return"StrictMode";case y:return"Suspense";case g:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case v:return(d.displayName||"Context")+".Consumer";case x:return(d._context.displayName||"Context")+".Provider";case _:var h=d.render;return d=d.displayName,d||(d=h.displayName||h.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case b:return h=d.displayName||null,h!==null?h:F(d.type)||"Memo";case S:h=d._payload,d=d._init;try{return F(d(h))}catch{}}return null}function L(d){var h=d.type;switch(d.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return d=h.render,d=d.displayName||d.name||"",h.displayName||(d!==""?"ForwardRef("+d+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return F(h);case 8:return h===p?"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 h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function N(d){var h=d,w=d;if(d.alternate)for(;h.return;)h=h.return;else{d=h;do h=d,h.flags&4098&&(w=h.return),d=h.return;while(d)}return h.tag===3?w:null}function I(d){if(N(d)!==d)throw Error(o(188))}function D(d){var h=d.alternate;if(!h){if(h=N(d),h===null)throw Error(o(188));return h!==d?null:d}for(var w=d,E=h;;){var C=w.return;if(C===null)break;var k=C.alternate;if(k===null){if(E=C.return,E!==null){w=E;continue}break}if(C.child===k.child){for(k=C.child;k;){if(k===w)return I(C),d;if(k===E)return I(C),h;k=k.sibling}throw Error(o(188))}if(w.return!==E.return)w=C,E=k;else{for(var X=!1,ie=C.child;ie;){if(ie===w){X=!0,w=C,E=k;break}if(ie===E){X=!0,E=C,w=k;break}ie=ie.sibling}if(!X){for(ie=k.child;ie;){if(ie===w){X=!0,w=k,E=C;break}if(ie===E){X=!0,E=k,w=C;break}ie=ie.sibling}if(!X)throw Error(o(189))}}if(w.alternate!==E)throw Error(o(190))}if(w.tag!==3)throw Error(o(188));return w.stateNode.current===w?d:h}function O(d){return d=D(d),d!==null?U(d):null}function U(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){var h=U(d);if(h!==null)return h;d=d.sibling}return null}function V(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){if(d.tag!==4){var h=V(d);if(h!==null)return h}d=d.sibling}return null}var Z=Array.isArray,Y=e.getPublicInstance,ne=e.getRootHostContext,j=e.getChildHostContext,$=e.prepareForCommit,K=e.resetAfterCommit,re=e.createInstance,xe=e.appendInitialChild,Ce=e.finalizeInitialChildren,ce=e.prepareUpdate,_e=e.shouldSetTextContent,Re=e.createTextInstance,pe=e.scheduleTimeout,je=e.cancelTimeout,nt=e.noTimeout,Pe=e.isPrimaryRenderer,Ie=e.supportsMutation,He=e.supportsPersistence,ze=e.supportsHydration,H=e.getInstanceFromNode,Fe=e.preparePortalMount,Ae=e.getCurrentEventPriority,Te=e.detachDeletedInstance,be=e.supportsMicrotasks,Ke=e.scheduleMicrotask,Ne=e.supportsTestSelectors,W=e.findFiberRoot,P=e.getBoundingRect,B=e.getTextContent,q=e.isHiddenSubtree,se=e.matchAccessibilityRole,J=e.setFocusIfFocusable,ue=e.setupIntersectionObserver,me=e.appendChild,Oe=e.appendChildToContainer,Ze=e.commitTextUpdate,Me=e.commitMount,Je=e.commitUpdate,gt=e.insertBefore,wt=e.insertInContainerBefore,rt=e.removeChild,ee=e.removeChildFromContainer,we=e.resetTextContent,We=e.hideInstance,Q=e.hideTextInstance,Le=e.unhideInstance,ge=e.unhideTextInstance,Ee=e.clearContainer,et=e.cloneInstance,$e=e.createContainerChildSet,bt=e.appendChildToContainerChildSet,sn=e.finalizeContainerChildren,Nn=e.replaceContainerChildren,Kt=e.cloneHiddenInstance,rr=e.cloneHiddenTextInstance,Ur=e.canHydrateInstance,Cm=e.canHydrateTextInstance,Nm=e.canHydrateSuspenseInstance,lo=e.isSuspenseInstancePending,Ql=e.isSuspenseInstanceFallback,Rm=e.registerSuspenseInstanceRetry,Fa=e.getNextHydratableSibling,Su=e.getFirstHydratableChild,Pm=e.getFirstHydratableChildWithinContainer,Eu=e.getFirstHydratableChildWithinSuspenseInstance,Im=e.hydrateInstance,Fm=e.hydrateTextInstance,S1=e.hydrateSuspenseInstance,E1=e.getNextHydratableInstanceAfterSuspenseInstance,Dm=e.commitHydratedContainer,M1=e.commitHydratedSuspenseInstance,A1=e.clearSuspenseBoundary,T1=e.clearSuspenseBoundaryFromContainer,z=e.shouldDeleteUnhydratedTailInstances,le=e.didNotMatchHydratedContainerTextInstance,he=e.didNotMatchHydratedTextInstance,fe;function ae(d){if(fe===void 0)try{throw Error()}catch(w){var h=w.stack.trim().match(/\n( *(at )?)/);fe=h&&h[1]||""}return` 4119`+fe+d}var De=!1;function Xe(d,h){if(!d||De)return"";De=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(Ue){var E=Ue}Reflect.construct(d,[],h)}else{try{h.call()}catch(Ue){E=Ue}d.call(h.prototype)}else{try{throw Error()}catch(Ue){E=Ue}d()}}catch(Ue){if(Ue&&E&&typeof Ue.stack=="string"){for(var C=Ue.stack.split(` 4120`),k=E.stack.split(` 4121`),X=C.length-1,ie=k.length-1;1<=X&&0<=ie&&C[X]!==k[ie];)ie--;for(;1<=X&&0<=ie;X--,ie--)if(C[X]!==k[ie]){if(X!==1||ie!==1)do if(X--,ie--,0>ie||C[X]!==k[ie]){var ye=` 4122`+C[X].replace(" at new "," at ");return d.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",d.displayName)),ye}while(1<=X&&0<=ie);break}}}finally{De=!1,Error.prepareStackTrace=w}return(d=d?d.displayName||d.name:"")?ae(d):""}var lt=Object.prototype.hasOwnProperty,ct=[],St=-1;function _t(d){return{current:d}}function Ge(d){0>St||(d.current=ct[St],ct[St]=null,St--)}function pt(d,h){St++,ct[St]=d.current,d.current=h}var qt={},Qt=_t(qt),Jt=_t(!1),Wt=qt;function xt(d,h){var w=d.type.contextTypes;if(!w)return qt;var E=d.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===h)return E.__reactInternalMemoizedMaskedChildContext;var C={},k;for(k in w)C[k]=h[k];return E&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=h,d.__reactInternalMemoizedMaskedChildContext=C),C}function fn(d){return d=d.childContextTypes,d!=null}function nn(){Ge(Jt),Ge(Qt)}function _i(d,h,w){if(Qt.current!==qt)throw Error(o(168));pt(Qt,h),pt(Jt,w)}function Ho(d,h,w){var E=d.stateNode;if(h=h.childContextTypes,typeof E.getChildContext!="function")return w;E=E.getChildContext();for(var C in E)if(!(C in h))throw Error(o(108,L(d)||"Unknown",C));return s({},w,E)}function _r(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||qt,Wt=Qt.current,pt(Qt,d),pt(Jt,Jt.current),!0}function Da(d,h,w){var E=d.stateNode;if(!E)throw Error(o(169));w?(d=Ho(d,h,Wt),E.__reactInternalMemoizedMergedChildContext=d,Ge(Jt),Ge(Qt),pt(Qt,d)):Ge(Jt),pt(Jt,w)}var tn=Math.clz32?Math.clz32:Nr,wi=Math.log,bi=Math.LN2;function Nr(d){return d>>>=0,d===0?32:31-(wi(d)/bi|0)|0}var ur=64,ka=4194304;function Hi(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function km(d,h){var w=d.pendingLanes;if(w===0)return 0;var E=0,C=d.suspendedLanes,k=d.pingedLanes,X=w&268435455;if(X!==0){var ie=X&~C;ie!==0?E=Hi(ie):(k&=X,k!==0&&(E=Hi(k)))}else X=w&~C,X!==0?E=Hi(X):k!==0&&(E=Hi(k));if(E===0)return 0;if(h!==0&&h!==E&&!(h&C)&&(C=E&-E,k=h&-h,C>=k||C===16&&(k&4194240)!==0))return h;if(E&4&&(E|=w&16),h=d.entangledLanes,h!==0)for(d=d.entanglements,h&=E;0<h;)w=31-tn(h),C=1<<w,E|=d[w],h&=~C;return E}function GO(d,h){switch(d){case 1:case 2:case 4:return h+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $O(d,h){for(var w=d.suspendedLanes,E=d.pingedLanes,C=d.expirationTimes,k=d.pendingLanes;0<k;){var X=31-tn(k),ie=1<<X,ye=C[X];ye===-1?(!(ie&w)||ie&E)&&(C[X]=GO(ie,h)):ye<=h&&(d.expiredLanes|=ie),k&=~ie}}function C1(d){return d=d.pendingLanes&-1073741825,d!==0?d:d&1073741824?1073741824:0}function N1(d){for(var h=[],w=0;31>w;w++)h.push(d);return h}function Vh(d,h,w){d.pendingLanes|=h,h!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,h=31-tn(h),d[h]=w}function XO(d,h){var w=d.pendingLanes&~h;d.pendingLanes=h,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=h,d.mutableReadLanes&=h,d.entangledLanes&=h,h=d.entanglements;var E=d.eventTimes;for(d=d.expirationTimes;0<w;){var C=31-tn(w),k=1<<C;h[C]=0,E[C]=-1,d[C]=-1,w&=~k}}function R1(d,h){var w=d.entangledLanes|=h;for(d=d.entanglements;w;){var E=31-tn(w),C=1<<E;C&h|d[E]&h&&(d[E]|=h),w&=~C}}var pn=0;function tA(d){return d&=-d,1<d?4<d?d&268435455?16:536870912:4:1}var P1=i.unstable_scheduleCallback,nA=i.unstable_cancelCallback,qO=i.unstable_shouldYield,YO=i.unstable_requestPaint,wr=i.unstable_now,I1=i.unstable_ImmediatePriority,KO=i.unstable_UserBlockingPriority,F1=i.unstable_NormalPriority,ZO=i.unstable_IdlePriority,Lm=null,co=null;function QO(d){if(co&&typeof co.onCommitFiberRoot=="function")try{co.onCommitFiberRoot(Lm,d,void 0,(d.current.flags&128)===128)}catch{}}function JO(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var uo=typeof Object.is=="function"?Object.is:JO,Wo=null,jm=!1,D1=!1;function rA(d){Wo===null?Wo=[d]:Wo.push(d)}function eU(d){jm=!0,rA(d)}function ho(){if(!D1&&Wo!==null){D1=!0;var d=0,h=pn;try{var w=Wo;for(pn=1;d<w.length;d++){var E=w[d];do E=E(!0);while(E!==null)}Wo=null,jm=!1}catch(C){throw Wo!==null&&(Wo=Wo.slice(d+1)),P1(I1,ho),C}finally{pn=h,D1=!1}}return null}var tU=a.ReactCurrentBatchConfig;function Om(d,h){if(uo(d,h))return!0;if(typeof d!="object"||d===null||typeof h!="object"||h===null)return!1;var w=Object.keys(d),E=Object.keys(h);if(w.length!==E.length)return!1;for(E=0;E<w.length;E++){var C=w[E];if(!lt.call(h,C)||!uo(d[C],h[C]))return!1}return!0}function nU(d){switch(d.tag){case 5:return ae(d.type);case 16:return ae("Lazy");case 13:return ae("Suspense");case 19:return ae("SuspenseList");case 0:case 2:case 15:return d=Xe(d.type,!1),d;case 11:return d=Xe(d.type.render,!1),d;case 1:return d=Xe(d.type,!0),d;default:return""}}function js(d,h){if(d&&d.defaultProps){h=s({},h),d=d.defaultProps;for(var w in d)h[w]===void 0&&(h[w]=d[w]);return h}return h}var Um=_t(null),Bm=null,Mu=null,k1=null;function L1(){k1=Mu=Bm=null}function iA(d,h,w){Pe?(pt(Um,h._currentValue),h._currentValue=w):(pt(Um,h._currentValue2),h._currentValue2=w)}function j1(d){var h=Um.current;Ge(Um),Pe?d._currentValue=h:d._currentValue2=h}function O1(d,h,w){for(;d!==null;){var E=d.alternate;if((d.childLanes&h)!==h?(d.childLanes|=h,E!==null&&(E.childLanes|=h)):E!==null&&(E.childLanes&h)!==h&&(E.childLanes|=h),d===w)break;d=d.return}}function Au(d,h){Bm=d,k1=Mu=null,d=d.dependencies,d!==null&&d.firstContext!==null&&(d.lanes&h&&($i=!0),d.firstContext=null)}function fs(d){var h=Pe?d._currentValue:d._currentValue2;if(k1!==d)if(d={context:d,memoizedValue:h,next:null},Mu===null){if(Bm===null)throw Error(o(308));Mu=d,Bm.dependencies={lanes:0,firstContext:d}}else Mu=Mu.next=d;return h}var fo=null,La=!1;function U1(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sA(d,h){d=d.updateQueue,h.updateQueue===d&&(h.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,effects:d.effects})}function Go(d,h){return{eventTime:d,lane:h,tag:0,payload:null,callback:null,next:null}}function ja(d,h){var w=d.updateQueue;w!==null&&(w=w.shared,ir!==null&&d.mode&1&&!(Yt&2)?(d=w.interleaved,d===null?(h.next=h,fo===null?fo=[w]:fo.push(w)):(h.next=d.next,d.next=h),w.interleaved=h):(d=w.pending,d===null?h.next=h:(h.next=d.next,d.next=h),w.pending=h))}function zm(d,h,w){if(h=h.updateQueue,h!==null&&(h=h.shared,(w&4194240)!==0)){var E=h.lanes;E&=d.pendingLanes,w|=E,h.lanes=w,R1(d,w)}}function oA(d,h){var w=d.updateQueue,E=d.alternate;if(E!==null&&(E=E.updateQueue,w===E)){var C=null,k=null;if(w=w.firstBaseUpdate,w!==null){do{var X={eventTime:w.eventTime,lane:w.lane,tag:w.tag,payload:w.payload,callback:w.callback,next:null};k===null?C=k=X:k=k.next=X,w=w.next}while(w!==null);k===null?C=k=h:k=k.next=h}else C=k=h;w={baseState:E.baseState,firstBaseUpdate:C,lastBaseUpdate:k,shared:E.shared,effects:E.effects},d.updateQueue=w;return}d=w.lastBaseUpdate,d===null?w.firstBaseUpdate=h:d.next=h,w.lastBaseUpdate=h}function Vm(d,h,w,E){var C=d.updateQueue;La=!1;var k=C.firstBaseUpdate,X=C.lastBaseUpdate,ie=C.shared.pending;if(ie!==null){C.shared.pending=null;var ye=ie,Ue=ye.next;ye.next=null,X===null?k=Ue:X.next=Ue,X=ye;var dt=d.alternate;dt!==null&&(dt=dt.updateQueue,ie=dt.lastBaseUpdate,ie!==X&&(ie===null?dt.firstBaseUpdate=Ue:ie.next=Ue,dt.lastBaseUpdate=ye))}if(k!==null){var kt=C.baseState;X=0,dt=Ue=ye=null,ie=k;do{var Et=ie.lane,An=ie.eventTime;if((E&Et)===Et){dt!==null&&(dt=dt.next={eventTime:An,lane:0,tag:ie.tag,payload:ie.payload,callback:ie.callback,next:null});e:{var yt=d,Hr=ie;switch(Et=h,An=w,Hr.tag){case 1:if(yt=Hr.payload,typeof yt=="function"){kt=yt.call(An,kt,Et);break e}kt=yt;break e;case 3:yt.flags=yt.flags&-65537|128;case 0:if(yt=Hr.payload,Et=typeof yt=="function"?yt.call(An,kt,Et):yt,Et==null)break e;kt=s({},kt,Et);break e;case 2:La=!0}}ie.callback!==null&&ie.lane!==0&&(d.flags|=64,Et=C.effects,Et===null?C.effects=[ie]:Et.push(ie))}else An={eventTime:An,lane:Et,tag:ie.tag,payload:ie.payload,callback:ie.callback,next:null},dt===null?(Ue=dt=An,ye=kt):dt=dt.next=An,X|=Et;if(ie=ie.next,ie===null){if(ie=C.shared.pending,ie===null)break;Et=ie,ie=Et.next,Et.next=null,C.lastBaseUpdate=Et,C.shared.pending=null}}while(!0);if(dt===null&&(ye=kt),C.baseState=ye,C.firstBaseUpdate=Ue,C.lastBaseUpdate=dt,h=C.shared.interleaved,h!==null){C=h;do X|=C.lane,C=C.next;while(C!==h)}else k===null&&(C.shared.lanes=0);ku|=X,d.lanes=X,d.memoizedState=kt}}function aA(d,h,w){if(d=h.effects,h.effects=null,d!==null)for(h=0;h<d.length;h++){var E=d[h],C=E.callback;if(C!==null){if(E.callback=null,E=w,typeof C!="function")throw Error(o(191,C));C.call(E)}}}var lA=new r.Component().refs;function B1(d,h,w,E){h=d.memoizedState,w=w(E,h),w=w==null?h:s({},h,w),d.memoizedState=w,d.lanes===0&&(d.updateQueue.baseState=w)}var Hm={isMounted:function(d){return(d=d._reactInternals)?N(d)===d:!1},enqueueSetState:function(d,h,w){d=d._reactInternals;var E=si(),C=Ba(d),k=Go(E,C);k.payload=h,w!=null&&(k.callback=w),ja(d,k),h=vs(d,C,E),h!==null&&zm(h,d,C)},enqueueReplaceState:function(d,h,w){d=d._reactInternals;var E=si(),C=Ba(d),k=Go(E,C);k.tag=1,k.payload=h,w!=null&&(k.callback=w),ja(d,k),h=vs(d,C,E),h!==null&&zm(h,d,C)},enqueueForceUpdate:function(d,h){d=d._reactInternals;var w=si(),E=Ba(d),C=Go(w,E);C.tag=2,h!=null&&(C.callback=h),ja(d,C),h=vs(d,E,w),h!==null&&zm(h,d,E)}};function cA(d,h,w,E,C,k,X){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(E,k,X):h.prototype&&h.prototype.isPureReactComponent?!Om(w,E)||!Om(C,k):!0}function uA(d,h,w){var E=!1,C=qt,k=h.contextType;return typeof k=="object"&&k!==null?k=fs(k):(C=fn(h)?Wt:Qt.current,E=h.contextTypes,k=(E=E!=null)?xt(d,C):qt),h=new h(w,k),d.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Hm,d.stateNode=h,h._reactInternals=d,E&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=C,d.__reactInternalMemoizedMaskedChildContext=k),h}function dA(d,h,w,E){d=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(w,E),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(w,E),h.state!==d&&Hm.enqueueReplaceState(h,h.state,null)}function z1(d,h,w,E){var C=d.stateNode;C.props=w,C.state=d.memoizedState,C.refs=lA,U1(d);var k=h.contextType;typeof k=="object"&&k!==null?C.context=fs(k):(k=fn(h)?Wt:Qt.current,C.context=xt(d,k)),C.state=d.memoizedState,k=h.getDerivedStateFromProps,typeof k=="function"&&(B1(d,h,k,w),C.state=d.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(h=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),h!==C.state&&Hm.enqueueReplaceState(C,C.state,null),Vm(d,w,C,E),C.state=d.memoizedState),typeof C.componentDidMount=="function"&&(d.flags|=4194308)}var Tu=[],Cu=0,Wm=null,Gm=0,ps=[],ms=0,Jl=null,$o=1,Xo="";function ec(d,h){Tu[Cu++]=Gm,Tu[Cu++]=Wm,Wm=d,Gm=h}function hA(d,h,w){ps[ms++]=$o,ps[ms++]=Xo,ps[ms++]=Jl,Jl=d;var E=$o;d=Xo;var C=32-tn(E)-1;E&=~(1<<C),w+=1;var k=32-tn(h)+C;if(30<k){var X=C-C%5;k=(E&(1<<X)-1).toString(32),E>>=X,C-=X,$o=1<<32-tn(h)+C|w<<C|E,Xo=k+d}else $o=1<<k|w<<C|E,Xo=d}function V1(d){d.return!==null&&(ec(d,1),hA(d,1,0))}function H1(d){for(;d===Wm;)Wm=Tu[--Cu],Tu[Cu]=null,Gm=Tu[--Cu],Tu[Cu]=null;for(;d===Jl;)Jl=ps[--ms],ps[ms]=null,Xo=ps[--ms],ps[ms]=null,$o=ps[--ms],ps[ms]=null}var Wi=null,Gi=null,Dn=!1,Hh=!1,Os=null;function fA(d,h){var w=ys(5,null,null,0);w.elementType="DELETED",w.stateNode=h,w.return=d,h=d.deletions,h===null?(d.deletions=[w],d.flags|=16):h.push(w)}function pA(d,h){switch(d.tag){case 5:return h=Ur(h,d.type,d.pendingProps),h!==null?(d.stateNode=h,Wi=d,Gi=Su(h),!0):!1;case 6:return h=Cm(h,d.pendingProps),h!==null?(d.stateNode=h,Wi=d,Gi=null,!0):!1;case 13:if(h=Nm(h),h!==null){var w=Jl!==null?{id:$o,overflow:Xo}:null;return d.memoizedState={dehydrated:h,treeContext:w,retryLane:1073741824},w=ys(18,null,null,0),w.stateNode=h,w.return=d,d.child=w,Wi=d,Gi=null,!0}return!1;default:return!1}}function W1(d){return(d.mode&1)!==0&&(d.flags&128)===0}function G1(d){if(Dn){var h=Gi;if(h){var w=h;if(!pA(d,h)){if(W1(d))throw Error(o(418));h=Fa(w);var E=Wi;h&&pA(d,h)?fA(E,w):(d.flags=d.flags&-4097|2,Dn=!1,Wi=d)}}else{if(W1(d))throw Error(o(418));d.flags=d.flags&-4097|2,Dn=!1,Wi=d}}}function mA(d){for(d=d.return;d!==null&&d.tag!==5&&d.tag!==3&&d.tag!==13;)d=d.return;Wi=d}function Wh(d){if(!ze||d!==Wi)return!1;if(!Dn)return mA(d),Dn=!0,!1;if(d.tag!==3&&(d.tag!==5||z(d.type)&&!_e(d.type,d.memoizedProps))){var h=Gi;if(h){if(W1(d)){for(d=Gi;d;)d=Fa(d);throw Error(o(418))}for(;h;)fA(d,h),h=Fa(h)}}if(mA(d),d.tag===13){if(!ze)throw Error(o(316));if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));Gi=E1(d)}else Gi=Wi?Fa(d.stateNode):null;return!0}function Nu(){ze&&(Gi=Wi=null,Hh=Dn=!1)}function $1(d){Os===null?Os=[d]:Os.push(d)}function Gh(d,h,w){if(d=w.ref,d!==null&&typeof d!="function"&&typeof d!="object"){if(w._owner){if(w=w._owner,w){if(w.tag!==1)throw Error(o(309));var E=w.stateNode}if(!E)throw Error(o(147,d));var C=E,k=""+d;return h!==null&&h.ref!==null&&typeof h.ref=="function"&&h.ref._stringRef===k?h.ref:(h=function(X){var ie=C.refs;ie===lA&&(ie=C.refs={}),X===null?delete ie[k]:ie[k]=X},h._stringRef=k,h)}if(typeof d!="string")throw Error(o(284));if(!w._owner)throw Error(o(290,d))}return d}function $m(d,h){throw d=Object.prototype.toString.call(h),Error(o(31,d==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":d))}function gA(d){var h=d._init;return h(d._payload)}function xA(d){function h(de,oe){if(d){var ve=de.deletions;ve===null?(de.deletions=[oe],de.flags|=16):ve.push(oe)}}function w(de,oe){if(!d)return null;for(;oe!==null;)h(de,oe),oe=oe.sibling;return null}function E(de,oe){for(de=new Map;oe!==null;)oe.key!==null?de.set(oe.key,oe):de.set(oe.index,oe),oe=oe.sibling;return de}function C(de,oe){return de=Va(de,oe),de.index=0,de.sibling=null,de}function k(de,oe,ve){return de.index=ve,d?(ve=de.alternate,ve!==null?(ve=ve.index,ve<oe?(de.flags|=2,oe):ve):(de.flags|=2,oe)):(de.flags|=1048576,oe)}function X(de){return d&&de.alternate===null&&(de.flags|=2),de}function ie(de,oe,ve,tt){return oe===null||oe.tag!==6?(oe=N_(ve,de.mode,tt),oe.return=de,oe):(oe=C(oe,ve),oe.return=de,oe)}function ye(de,oe,ve,tt){var vt=ve.type;return vt===f?dt(de,oe,ve.props.children,tt,ve.key):oe!==null&&(oe.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===S&&gA(vt)===oe.type)?(tt=C(oe,ve.props),tt.ref=Gh(de,oe,ve),tt.return=de,tt):(tt=Sg(ve.type,ve.key,ve.props,null,de.mode,tt),tt.ref=Gh(de,oe,ve),tt.return=de,tt)}function Ue(de,oe,ve,tt){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==ve.containerInfo||oe.stateNode.implementation!==ve.implementation?(oe=R_(ve,de.mode,tt),oe.return=de,oe):(oe=C(oe,ve.children||[]),oe.return=de,oe)}function dt(de,oe,ve,tt,vt){return oe===null||oe.tag!==7?(oe=ac(ve,de.mode,tt,vt),oe.return=de,oe):(oe=C(oe,ve),oe.return=de,oe)}function kt(de,oe,ve){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return oe=N_(""+oe,de.mode,ve),oe.return=de,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case c:return ve=Sg(oe.type,oe.key,oe.props,null,de.mode,ve),ve.ref=Gh(de,null,oe),ve.return=de,ve;case u:return oe=R_(oe,de.mode,ve),oe.return=de,oe;case S:var tt=oe._init;return kt(de,tt(oe._payload),ve)}if(Z(oe)||R(oe))return oe=ac(oe,de.mode,ve,null),oe.return=de,oe;$m(de,oe)}return null}function Et(de,oe,ve,tt){var vt=oe!==null?oe.key:null;if(typeof ve=="string"&&ve!==""||typeof ve=="number")return vt!==null?null:ie(de,oe,""+ve,tt);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case c:return ve.key===vt?ye(de,oe,ve,tt):null;case u:return ve.key===vt?Ue(de,oe,ve,tt):null;case S:return vt=ve._init,Et(de,oe,vt(ve._payload),tt)}if(Z(ve)||R(ve))return vt!==null?null:dt(de,oe,ve,tt,null);$m(de,ve)}return null}function An(de,oe,ve,tt,vt){if(typeof tt=="string"&&tt!==""||typeof tt=="number")return de=de.get(ve)||null,ie(oe,de,""+tt,vt);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case c:return de=de.get(tt.key===null?ve:tt.key)||null,ye(oe,de,tt,vt);case u:return de=de.get(tt.key===null?ve:tt.key)||null,Ue(oe,de,tt,vt);case S:var Gt=tt._init;return An(de,oe,ve,Gt(tt._payload),vt)}if(Z(tt)||R(tt))return de=de.get(ve)||null,dt(oe,de,tt,vt,null);$m(oe,tt)}return null}function yt(de,oe,ve,tt){for(var vt=null,Gt=null,Lt=oe,mn=oe=0,Sr=null;Lt!==null&&mn<ve.length;mn++){Lt.index>mn?(Sr=Lt,Lt=null):Sr=Lt.sibling;var gn=Et(de,Lt,ve[mn],tt);if(gn===null){Lt===null&&(Lt=Sr);break}d&&Lt&&gn.alternate===null&&h(de,Lt),oe=k(gn,oe,mn),Gt===null?vt=gn:Gt.sibling=gn,Gt=gn,Lt=Sr}if(mn===ve.length)return w(de,Lt),Dn&&ec(de,mn),vt;if(Lt===null){for(;mn<ve.length;mn++)Lt=kt(de,ve[mn],tt),Lt!==null&&(oe=k(Lt,oe,mn),Gt===null?vt=Lt:Gt.sibling=Lt,Gt=Lt);return Dn&&ec(de,mn),vt}for(Lt=E(de,Lt);mn<ve.length;mn++)Sr=An(Lt,de,mn,ve[mn],tt),Sr!==null&&(d&&Sr.alternate!==null&&Lt.delete(Sr.key===null?mn:Sr.key),oe=k(Sr,oe,mn),Gt===null?vt=Sr:Gt.sibling=Sr,Gt=Sr);return d&&Lt.forEach(function(Ha){return h(de,Ha)}),Dn&&ec(de,mn),vt}function Hr(de,oe,ve,tt){var vt=R(ve);if(typeof vt!="function")throw Error(o(150));if(ve=vt.call(ve),ve==null)throw Error(o(151));for(var Gt=vt=null,Lt=oe,mn=oe=0,Sr=null,gn=ve.next();Lt!==null&&!gn.done;mn++,gn=ve.next()){Lt.index>mn?(Sr=Lt,Lt=null):Sr=Lt.sibling;var Ha=Et(de,Lt,gn.value,tt);if(Ha===null){Lt===null&&(Lt=Sr);break}d&&Lt&&Ha.alternate===null&&h(de,Lt),oe=k(Ha,oe,mn),Gt===null?vt=Ha:Gt.sibling=Ha,Gt=Ha,Lt=Sr}if(gn.done)return w(de,Lt),Dn&&ec(de,mn),vt;if(Lt===null){for(;!gn.done;mn++,gn=ve.next())gn=kt(de,gn.value,tt),gn!==null&&(oe=k(gn,oe,mn),Gt===null?vt=gn:Gt.sibling=gn,Gt=gn);return Dn&&ec(de,mn),vt}for(Lt=E(de,Lt);!gn.done;mn++,gn=ve.next())gn=An(Lt,de,mn,gn.value,tt),gn!==null&&(d&&gn.alternate!==null&&Lt.delete(gn.key===null?mn:gn.key),oe=k(gn,oe,mn),Gt===null?vt=gn:Gt.sibling=gn,Gt=gn);return d&&Lt.forEach(function(IU){return h(de,IU)}),Dn&&ec(de,mn),vt}function _s(de,oe,ve,tt){if(typeof ve=="object"&&ve!==null&&ve.type===f&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case c:e:{for(var vt=ve.key,Gt=oe;Gt!==null;){if(Gt.key===vt){if(vt=ve.type,vt===f){if(Gt.tag===7){w(de,Gt.sibling),oe=C(Gt,ve.props.children),oe.return=de,de=oe;break e}}else if(Gt.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===S&&gA(vt)===Gt.type){w(de,Gt.sibling),oe=C(Gt,ve.props),oe.ref=Gh(de,Gt,ve),oe.return=de,de=oe;break e}w(de,Gt);break}else h(de,Gt);Gt=Gt.sibling}ve.type===f?(oe=ac(ve.props.children,de.mode,tt,ve.key),oe.return=de,de=oe):(tt=Sg(ve.type,ve.key,ve.props,null,de.mode,tt),tt.ref=Gh(de,oe,ve),tt.return=de,de=tt)}return X(de);case u:e:{for(Gt=ve.key;oe!==null;){if(oe.key===Gt)if(oe.tag===4&&oe.stateNode.containerInfo===ve.containerInfo&&oe.stateNode.implementation===ve.implementation){w(de,oe.sibling),oe=C(oe,ve.children||[]),oe.return=de,de=oe;break e}else{w(de,oe);break}else h(de,oe);oe=oe.sibling}oe=R_(ve,de.mode,tt),oe.return=de,de=oe}return X(de);case S:return Gt=ve._init,_s(de,oe,Gt(ve._payload),tt)}if(Z(ve))return yt(de,oe,ve,tt);if(R(ve))return Hr(de,oe,ve,tt);$m(de,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,oe!==null&&oe.tag===6?(w(de,oe.sibling),oe=C(oe,ve),oe.return=de,de=oe):(w(de,oe),oe=N_(ve,de.mode,tt),oe.return=de,de=oe),X(de)):w(de,oe)}return _s}var Ru=xA(!0),vA=xA(!1),$h={},gs=_t($h),Xh=_t($h),Pu=_t($h);function po(d){if(d===$h)throw Error(o(174));return d}function X1(d,h){pt(Pu,h),pt(Xh,d),pt(gs,$h),d=ne(h),Ge(gs),pt(gs,d)}function Iu(){Ge(gs),Ge(Xh),Ge(Pu)}function yA(d){var h=po(Pu.current),w=po(gs.current);h=j(w,d.type,h),w!==h&&(pt(Xh,d),pt(gs,h))}function q1(d){Xh.current===d&&(Ge(gs),Ge(Xh))}var jn=_t(0);function Xm(d){for(var h=d;h!==null;){if(h.tag===13){var w=h.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||lo(w)||Ql(w)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===d)break;for(;h.sibling===null;){if(h.return===null||h.return===d)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Y1=[];function K1(){for(var d=0;d<Y1.length;d++){var h=Y1[d];Pe?h._workInProgressVersionPrimary=null:h._workInProgressVersionSecondary=null}Y1.length=0}var qm=a.ReactCurrentDispatcher,xs=a.ReactCurrentBatchConfig,Fu=0,Hn=null,Br=null,br=null,Ym=!1,qh=!1,Yh=0,rU=0;function zr(){throw Error(o(321))}function Z1(d,h){if(h===null)return!1;for(var w=0;w<h.length&&w<d.length;w++)if(!uo(d[w],h[w]))return!1;return!0}function Q1(d,h,w,E,C,k){if(Fu=k,Hn=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,qm.current=d===null||d.memoizedState===null?aU:lU,d=w(E,C),qh){k=0;do{if(qh=!1,Yh=0,25<=k)throw Error(o(301));k+=1,br=Br=null,h.updateQueue=null,qm.current=cU,d=w(E,C)}while(qh)}if(qm.current=eg,h=Br!==null&&Br.next!==null,Fu=0,br=Br=Hn=null,Ym=!1,h)throw Error(o(300));return d}function J1(){var d=Yh!==0;return Yh=0,d}function qo(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return br===null?Hn.memoizedState=br=d:br=br.next=d,br}function mo(){if(Br===null){var d=Hn.alternate;d=d!==null?d.memoizedState:null}else d=Br.next;var h=br===null?Hn.memoizedState:br.next;if(h!==null)br=h,Br=d;else{if(d===null)throw Error(o(310));Br=d,d={memoizedState:Br.memoizedState,baseState:Br.baseState,baseQueue:Br.baseQueue,queue:Br.queue,next:null},br===null?Hn.memoizedState=br=d:br=br.next=d}return br}function tc(d,h){return typeof h=="function"?h(d):h}function Km(d){var h=mo(),w=h.queue;if(w===null)throw Error(o(311));w.lastRenderedReducer=d;var E=Br,C=E.baseQueue,k=w.pending;if(k!==null){if(C!==null){var X=C.next;C.next=k.next,k.next=X}E.baseQueue=C=k,w.pending=null}if(C!==null){k=C.next,E=E.baseState;var ie=X=null,ye=null,Ue=k;do{var dt=Ue.lane;if((Fu&dt)===dt)ye!==null&&(ye=ye.next={lane:0,action:Ue.action,hasEagerState:Ue.hasEagerState,eagerState:Ue.eagerState,next:null}),E=Ue.hasEagerState?Ue.eagerState:d(E,Ue.action);else{var kt={lane:dt,action:Ue.action,hasEagerState:Ue.hasEagerState,eagerState:Ue.eagerState,next:null};ye===null?(ie=ye=kt,X=E):ye=ye.next=kt,Hn.lanes|=dt,ku|=dt}Ue=Ue.next}while(Ue!==null&&Ue!==k);ye===null?X=E:ye.next=ie,uo(E,h.memoizedState)||($i=!0),h.memoizedState=E,h.baseState=X,h.baseQueue=ye,w.lastRenderedState=E}if(d=w.interleaved,d!==null){C=d;do k=C.lane,Hn.lanes|=k,ku|=k,C=C.next;while(C!==d)}else C===null&&(w.lanes=0);return[h.memoizedState,w.dispatch]}function Zm(d){var h=mo(),w=h.queue;if(w===null)throw Error(o(311));w.lastRenderedReducer=d;var E=w.dispatch,C=w.pending,k=h.memoizedState;if(C!==null){w.pending=null;var X=C=C.next;do k=d(k,X.action),X=X.next;while(X!==C);uo(k,h.memoizedState)||($i=!0),h.memoizedState=k,h.baseQueue===null&&(h.baseState=k),w.lastRenderedState=k}return[k,E]}function _A(){}function wA(d,h){var w=Hn,E=mo(),C=h(),k=!uo(E.memoizedState,C);if(k&&(E.memoizedState=C,$i=!0),E=E.queue,Zh(EA.bind(null,w,E,d),[d]),E.getSnapshot!==h||k||br!==null&&br.memoizedState.tag&1){if(w.flags|=2048,Kh(9,SA.bind(null,w,E,C,h),void 0,null),ir===null)throw Error(o(349));Fu&30||bA(w,h,C)}return C}function bA(d,h,w){d.flags|=16384,d={getSnapshot:h,value:w},h=Hn.updateQueue,h===null?(h={lastEffect:null,stores:null},Hn.updateQueue=h,h.stores=[d]):(w=h.stores,w===null?h.stores=[d]:w.push(d))}function SA(d,h,w,E){h.value=w,h.getSnapshot=E,MA(h)&&vs(d,1,-1)}function EA(d,h,w){return w(function(){MA(h)&&vs(d,1,-1)})}function MA(d){var h=d.getSnapshot;d=d.value;try{var w=h();return!uo(d,w)}catch{return!0}}function e_(d){var h=qo();return typeof d=="function"&&(d=d()),h.memoizedState=h.baseState=d,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tc,lastRenderedState:d},h.queue=d,d=d.dispatch=oU.bind(null,Hn,d),[h.memoizedState,d]}function Kh(d,h,w,E){return d={tag:d,create:h,destroy:w,deps:E,next:null},h=Hn.updateQueue,h===null?(h={lastEffect:null,stores:null},Hn.updateQueue=h,h.lastEffect=d.next=d):(w=h.lastEffect,w===null?h.lastEffect=d.next=d:(E=w.next,w.next=d,d.next=E,h.lastEffect=d)),d}function AA(){return mo().memoizedState}function Qm(d,h,w,E){var C=qo();Hn.flags|=d,C.memoizedState=Kh(1|h,w,void 0,E===void 0?null:E)}function Jm(d,h,w,E){var C=mo();E=E===void 0?null:E;var k=void 0;if(Br!==null){var X=Br.memoizedState;if(k=X.destroy,E!==null&&Z1(E,X.deps)){C.memoizedState=Kh(h,w,k,E);return}}Hn.flags|=d,C.memoizedState=Kh(1|h,w,k,E)}function t_(d,h){return Qm(8390656,8,d,h)}function Zh(d,h){return Jm(2048,8,d,h)}function TA(d,h){return Jm(4,2,d,h)}function CA(d,h){return Jm(4,4,d,h)}function NA(d,h){if(typeof h=="function")return d=d(),h(d),function(){h(null)};if(h!=null)return d=d(),h.current=d,function(){h.current=null}}function RA(d,h,w){return w=w!=null?w.concat([d]):null,Jm(4,4,NA.bind(null,h,d),w)}function n_(){}function PA(d,h){var w=mo();h=h===void 0?null:h;var E=w.memoizedState;return E!==null&&h!==null&&Z1(h,E[1])?E[0]:(w.memoizedState=[d,h],d)}function IA(d,h){var w=mo();h=h===void 0?null:h;var E=w.memoizedState;return E!==null&&h!==null&&Z1(h,E[1])?E[0]:(d=d(),w.memoizedState=[d,h],d)}function iU(d,h){var w=pn;pn=w!==0&&4>w?w:4,d(!0);var E=xs.transition;xs.transition={};try{d(!1),h()}finally{pn=w,xs.transition=E}}function FA(){return mo().memoizedState}function sU(d,h,w){var E=Ba(d);w={lane:E,action:w,hasEagerState:!1,eagerState:null,next:null},DA(d)?kA(h,w):(LA(d,h,w),w=si(),d=vs(d,E,w),d!==null&&jA(d,h,E))}function oU(d,h,w){var E=Ba(d),C={lane:E,action:w,hasEagerState:!1,eagerState:null,next:null};if(DA(d))kA(h,C);else{LA(d,h,C);var k=d.alternate;if(d.lanes===0&&(k===null||k.lanes===0)&&(k=h.lastRenderedReducer,k!==null))try{var X=h.lastRenderedState,ie=k(X,w);if(C.hasEagerState=!0,C.eagerState=ie,uo(ie,X))return}catch{}finally{}w=si(),d=vs(d,E,w),d!==null&&jA(d,h,E)}}function DA(d){var h=d.alternate;return d===Hn||h!==null&&h===Hn}function kA(d,h){qh=Ym=!0;var w=d.pending;w===null?h.next=h:(h.next=w.next,w.next=h),d.pending=h}function LA(d,h,w){ir!==null&&d.mode&1&&!(Yt&2)?(d=h.interleaved,d===null?(w.next=w,fo===null?fo=[h]:fo.push(h)):(w.next=d.next,d.next=w),h.interleaved=w):(d=h.pending,d===null?w.next=w:(w.next=d.next,d.next=w),h.pending=w)}function jA(d,h,w){if(w&4194240){var E=h.lanes;E&=d.pendingLanes,w|=E,h.lanes=w,R1(d,w)}}var eg={readContext:fs,useCallback:zr,useContext:zr,useEffect:zr,useImperativeHandle:zr,useInsertionEffect:zr,useLayoutEffect:zr,useMemo:zr,useReducer:zr,useRef:zr,useState:zr,useDebugValue:zr,useDeferredValue:zr,useTransition:zr,useMutableSource:zr,useSyncExternalStore:zr,useId:zr,unstable_isNewReconciler:!1},aU={readContext:fs,useCallback:function(d,h){return qo().memoizedState=[d,h===void 0?null:h],d},useContext:fs,useEffect:t_,useImperativeHandle:function(d,h,w){return w=w!=null?w.concat([d]):null,Qm(4194308,4,NA.bind(null,h,d),w)},useLayoutEffect:function(d,h){return Qm(4194308,4,d,h)},useInsertionEffect:function(d,h){return Qm(4,2,d,h)},useMemo:function(d,h){var w=qo();return h=h===void 0?null:h,d=d(),w.memoizedState=[d,h],d},useReducer:function(d,h,w){var E=qo();return h=w!==void 0?w(h):h,E.memoizedState=E.baseState=h,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:h},E.queue=d,d=d.dispatch=sU.bind(null,Hn,d),[E.memoizedState,d]},useRef:function(d){var h=qo();return d={current:d},h.memoizedState=d},useState:e_,useDebugValue:n_,useDeferredValue:function(d){var h=e_(d),w=h[0],E=h[1];return t_(function(){var C=xs.transition;xs.transition={};try{E(d)}finally{xs.transition=C}},[d]),w},useTransition:function(){var d=e_(!1),h=d[0];return d=iU.bind(null,d[1]),qo().memoizedState=d,[h,d]},useMutableSource:function(){},useSyncExternalStore:function(d,h,w){var E=Hn,C=qo();if(Dn){if(w===void 0)throw Error(o(407));w=w()}else{if(w=h(),ir===null)throw Error(o(349));Fu&30||bA(E,h,w)}C.memoizedState=w;var k={value:w,getSnapshot:h};return C.queue=k,t_(EA.bind(null,E,k,d),[d]),E.flags|=2048,Kh(9,SA.bind(null,E,k,w,h),void 0,null),w},useId:function(){var d=qo(),h=ir.identifierPrefix;if(Dn){var w=Xo,E=$o;w=(E&~(1<<32-tn(E)-1)).toString(32)+w,h=":"+h+"R"+w,w=Yh++,0<w&&(h+="H"+w.toString(32)),h+=":"}else w=rU++,h=":"+h+"r"+w.toString(32)+":";return d.memoizedState=h},unstable_isNewReconciler:!1},lU={readContext:fs,useCallback:PA,useContext:fs,useEffect:Zh,useImperativeHandle:RA,useInsertionEffect:TA,useLayoutEffect:CA,useMemo:IA,useReducer:Km,useRef:AA,useState:function(){return Km(tc)},useDebugValue:n_,useDeferredValue:function(d){var h=Km(tc),w=h[0],E=h[1];return Zh(function(){var C=xs.transition;xs.transition={};try{E(d)}finally{xs.transition=C}},[d]),w},useTransition:function(){var d=Km(tc)[0],h=mo().memoizedState;return[d,h]},useMutableSource:_A,useSyncExternalStore:wA,useId:FA,unstable_isNewReconciler:!1},cU={readContext:fs,useCallback:PA,useContext:fs,useEffect:Zh,useImperativeHandle:RA,useInsertionEffect:TA,useLayoutEffect:CA,useMemo:IA,useReducer:Zm,useRef:AA,useState:function(){return Zm(tc)},useDebugValue:n_,useDeferredValue:function(d){var h=Zm(tc),w=h[0],E=h[1];return Zh(function(){var C=xs.transition;xs.transition={};try{E(d)}finally{xs.transition=C}},[d]),w},useTransition:function(){var d=Zm(tc)[0],h=mo().memoizedState;return[d,h]},useMutableSource:_A,useSyncExternalStore:wA,useId:FA,unstable_isNewReconciler:!1};function r_(d,h){try{var w="",E=h;do w+=nU(E),E=E.return;while(E);var C=w}catch(k){C=` 4123Error generating stack: `+k.message+` 4124`+k.stack}return{value:d,source:h,stack:C}}function i_(d,h){try{console.error(h.value)}catch(w){setTimeout(function(){throw w})}}var uU=typeof WeakMap=="function"?WeakMap:Map;function OA(d,h,w){w=Go(-1,w),w.tag=3,w.payload={element:null};var E=h.value;return w.callback=function(){gg||(gg=!0,b_=E),i_(d,h)},w}function UA(d,h,w){w=Go(-1,w),w.tag=3;var E=d.type.getDerivedStateFromError;if(typeof E=="function"){var C=h.value;w.payload=function(){return E(C)},w.callback=function(){i_(d,h)}}var k=d.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(w.callback=function(){i_(d,h),typeof E!="function"&&(Oa===null?Oa=new Set([this]):Oa.add(this));var X=h.stack;this.componentDidCatch(h.value,{componentStack:X!==null?X:""})}),w}function BA(d,h,w){var E=d.pingCache;if(E===null){E=d.pingCache=new uU;var C=new Set;E.set(h,C)}else C=E.get(h),C===void 0&&(C=new Set,E.set(h,C));C.has(w)||(C.add(w),d=EU.bind(null,d,h,w),h.then(d,d))}function zA(d){do{var h;if((h=d.tag===13)&&(h=d.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return d;d=d.return}while(d!==null);return null}function VA(d,h,w,E,C){return d.mode&1?(d.flags|=65536,d.lanes=C,d):(d===h?d.flags|=65536:(d.flags|=128,w.flags|=131072,w.flags&=-52805,w.tag===1&&(w.alternate===null?w.tag=17:(h=Go(-1,1),h.tag=2,ja(w,h))),w.lanes|=1),d)}function go(d){d.flags|=4}function HA(d,h){if(d!==null&&d.child===h.child)return!0;if(h.flags&16)return!1;for(d=h.child;d!==null;){if(d.flags&12854||d.subtreeFlags&12854)return!1;d=d.sibling}return!0}var Qh,Jh,tg,ng;if(Ie)Qh=function(d,h){for(var w=h.child;w!==null;){if(w.tag===5||w.tag===6)xe(d,w.stateNode);else if(w.tag!==4&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===h)break;for(;w.sibling===null;){if(w.return===null||w.return===h)return;w=w.return}w.sibling.return=w.return,w=w.sibling}},Jh=function(){},tg=function(d,h,w,E,C){if(d=d.memoizedProps,d!==E){var k=h.stateNode,X=po(gs.current);w=ce(k,w,d,E,C,X),(h.updateQueue=w)&&go(h)}},ng=function(d,h,w,E){w!==E&&go(h)};else if(He){Qh=function(d,h,w,E){for(var C=h.child;C!==null;){if(C.tag===5){var k=C.stateNode;w&&E&&(k=Kt(k,C.type,C.memoizedProps,C)),xe(d,k)}else if(C.tag===6)k=C.stateNode,w&&E&&(k=rr(k,C.memoizedProps,C)),xe(d,k);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)k=C.child,k!==null&&(k.return=C),Qh(d,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===h)break;for(;C.sibling===null;){if(C.return===null||C.return===h)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};var WA=function(d,h,w,E){for(var C=h.child;C!==null;){if(C.tag===5){var k=C.stateNode;w&&E&&(k=Kt(k,C.type,C.memoizedProps,C)),bt(d,k)}else if(C.tag===6)k=C.stateNode,w&&E&&(k=rr(k,C.memoizedProps,C)),bt(d,k);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)k=C.child,k!==null&&(k.return=C),WA(d,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===h)break;for(;C.sibling===null;){if(C.return===null||C.return===h)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};Jh=function(d,h){var w=h.stateNode;if(!HA(d,h)){d=w.containerInfo;var E=$e(d);WA(E,h,!1,!1),w.pendingChildren=E,go(h),sn(d,E)}},tg=function(d,h,w,E,C){var k=d.stateNode,X=d.memoizedProps;if((d=HA(d,h))&&X===E)h.stateNode=k;else{var ie=h.stateNode,ye=po(gs.current),Ue=null;X!==E&&(Ue=ce(ie,w,X,E,C,ye)),d&&Ue===null?h.stateNode=k:(k=et(k,Ue,w,X,E,h,d,ie),Ce(k,w,E,C,ye)&&go(h),h.stateNode=k,d?go(h):Qh(k,h,!1,!1))}},ng=function(d,h,w,E){w!==E?(d=po(Pu.current),w=po(gs.current),h.stateNode=Re(E,d,w,h),go(h)):h.stateNode=d.stateNode}}else Jh=function(){},tg=function(){},ng=function(){};function ef(d,h){if(!Dn)switch(d.tailMode){case"hidden":h=d.tail;for(var w=null;h!==null;)h.alternate!==null&&(w=h),h=h.sibling;w===null?d.tail=null:w.sibling=null;break;case"collapsed":w=d.tail;for(var E=null;w!==null;)w.alternate!==null&&(E=w),w=w.sibling;E===null?h||d.tail===null?d.tail=null:d.tail.sibling=null:E.sibling=null}}function Vr(d){var h=d.alternate!==null&&d.alternate.child===d.child,w=0,E=0;if(h)for(var C=d.child;C!==null;)w|=C.lanes|C.childLanes,E|=C.subtreeFlags&14680064,E|=C.flags&14680064,C.return=d,C=C.sibling;else for(C=d.child;C!==null;)w|=C.lanes|C.childLanes,E|=C.subtreeFlags,E|=C.flags,C.return=d,C=C.sibling;return d.subtreeFlags|=E,d.childLanes=w,h}function dU(d,h,w){var E=h.pendingProps;switch(H1(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vr(h),null;case 1:return fn(h.type)&&nn(),Vr(h),null;case 3:return E=h.stateNode,Iu(),Ge(Jt),Ge(Qt),K1(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(d===null||d.child===null)&&(Wh(h)?go(h):d===null||d.memoizedState.isDehydrated&&!(h.flags&256)||(h.flags|=1024,Os!==null&&(M_(Os),Os=null))),Jh(d,h),Vr(h),null;case 5:q1(h),w=po(Pu.current);var C=h.type;if(d!==null&&h.stateNode!=null)tg(d,h,C,E,w),d.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!E){if(h.stateNode===null)throw Error(o(166));return Vr(h),null}if(d=po(gs.current),Wh(h)){if(!ze)throw Error(o(175));d=Im(h.stateNode,h.type,h.memoizedProps,w,d,h,!Hh),h.updateQueue=d,d!==null&&go(h)}else{var k=re(C,E,w,d,h);Qh(k,h,!1,!1),h.stateNode=k,Ce(k,C,E,w,d)&&go(h)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return Vr(h),null;case 6:if(d&&h.stateNode!=null)ng(d,h,d.memoizedProps,E);else{if(typeof E!="string"&&h.stateNode===null)throw Error(o(166));if(d=po(Pu.current),w=po(gs.current),Wh(h)){if(!ze)throw Error(o(176));if(d=h.stateNode,E=h.memoizedProps,(w=Fm(d,E,h,!Hh))&&(C=Wi,C!==null))switch(k=(C.mode&1)!==0,C.tag){case 3:le(C.stateNode.containerInfo,d,E,k);break;case 5:he(C.type,C.memoizedProps,C.stateNode,d,E,k)}w&&go(h)}else h.stateNode=Re(E,d,w,h)}return Vr(h),null;case 13:if(Ge(jn),E=h.memoizedState,Dn&&Gi!==null&&h.mode&1&&!(h.flags&128)){for(d=Gi;d;)d=Fa(d);return Nu(),h.flags|=98560,h}if(E!==null&&E.dehydrated!==null){if(E=Wh(h),d===null){if(!E)throw Error(o(318));if(!ze)throw Error(o(344));if(d=h.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));S1(d,h)}else Nu(),!(h.flags&128)&&(h.memoizedState=null),h.flags|=4;return Vr(h),null}return Os!==null&&(M_(Os),Os=null),h.flags&128?(h.lanes=w,h):(E=E!==null,w=!1,d===null?Wh(h):w=d.memoizedState!==null,E&&!w&&(h.child.flags|=8192,h.mode&1&&(d===null||jn.current&1?dr===0&&(dr=3):T_())),h.updateQueue!==null&&(h.flags|=4),Vr(h),null);case 4:return Iu(),Jh(d,h),d===null&&Fe(h.stateNode.containerInfo),Vr(h),null;case 10:return j1(h.type._context),Vr(h),null;case 17:return fn(h.type)&&nn(),Vr(h),null;case 19:if(Ge(jn),C=h.memoizedState,C===null)return Vr(h),null;if(E=(h.flags&128)!==0,k=C.rendering,k===null)if(E)ef(C,!1);else{if(dr!==0||d!==null&&d.flags&128)for(d=h.child;d!==null;){if(k=Xm(d),k!==null){for(h.flags|=128,ef(C,!1),d=k.updateQueue,d!==null&&(h.updateQueue=d,h.flags|=4),h.subtreeFlags=0,d=w,E=h.child;E!==null;)w=E,C=d,w.flags&=14680066,k=w.alternate,k===null?(w.childLanes=0,w.lanes=C,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=k.childLanes,w.lanes=k.lanes,w.child=k.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=k.memoizedProps,w.memoizedState=k.memoizedState,w.updateQueue=k.updateQueue,w.type=k.type,C=k.dependencies,w.dependencies=C===null?null:{lanes:C.lanes,firstContext:C.firstContext}),E=E.sibling;return pt(jn,jn.current&1|2),h.child}d=d.sibling}C.tail!==null&&wr()>w_&&(h.flags|=128,E=!0,ef(C,!1),h.lanes=4194304)}else{if(!E)if(d=Xm(k),d!==null){if(h.flags|=128,E=!0,d=d.updateQueue,d!==null&&(h.updateQueue=d,h.flags|=4),ef(C,!0),C.tail===null&&C.tailMode==="hidden"&&!k.alternate&&!Dn)return Vr(h),null}else 2*wr()-C.renderingStartTime>w_&&w!==1073741824&&(h.flags|=128,E=!0,ef(C,!1),h.lanes=4194304);C.isBackwards?(k.sibling=h.child,h.child=k):(d=C.last,d!==null?d.sibling=k:h.child=k,C.last=k)}return C.tail!==null?(h=C.tail,C.rendering=h,C.tail=h.sibling,C.renderingStartTime=wr(),h.sibling=null,d=jn.current,pt(jn,E?d&1|2:d&1),h):(Vr(h),null);case 22:case 23:return A_(),E=h.memoizedState!==null,d!==null&&d.memoizedState!==null!==E&&(h.flags|=8192),E&&h.mode&1?Xi&1073741824&&(Vr(h),Ie&&h.subtreeFlags&6&&(h.flags|=8192)):Vr(h),null;case 24:return null;case 25:return null}throw Error(o(156,h.tag))}var hU=a.ReactCurrentOwner,$i=!1;function ii(d,h,w,E){h.child=d===null?vA(h,null,w,E):Ru(h,d.child,w,E)}function GA(d,h,w,E,C){w=w.render;var k=h.ref;return Au(h,C),E=Q1(d,h,w,E,k,C),w=J1(),d!==null&&!$i?(h.updateQueue=d.updateQueue,h.flags&=-2053,d.lanes&=~C,Yo(d,h,C)):(Dn&&w&&V1(h),h.flags|=1,ii(d,h,E,C),h.child)}function $A(d,h,w,E,C){if(d===null){var k=w.type;return typeof k=="function"&&!C_(k)&&k.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(h.tag=15,h.type=k,XA(d,h,k,E,C)):(d=Sg(w.type,null,E,h,h.mode,C),d.ref=h.ref,d.return=h,h.child=d)}if(k=d.child,!(d.lanes&C)){var X=k.memoizedProps;if(w=w.compare,w=w!==null?w:Om,w(X,E)&&d.ref===h.ref)return Yo(d,h,C)}return h.flags|=1,d=Va(k,E),d.ref=h.ref,d.return=h,h.child=d}function XA(d,h,w,E,C){if(d!==null&&Om(d.memoizedProps,E)&&d.ref===h.ref)if($i=!1,(d.lanes&C)!==0)d.flags&131072&&($i=!0);else return h.lanes=d.lanes,Yo(d,h,C);return s_(d,h,w,E,C)}function qA(d,h,w){var E=h.pendingProps,C=E.children,k=d!==null?d.memoizedState:null;if(E.mode==="hidden")if(!(h.mode&1))h.memoizedState={baseLanes:0,cachePool:null},pt(Du,Xi),Xi|=w;else if(w&1073741824)h.memoizedState={baseLanes:0,cachePool:null},E=k!==null?k.baseLanes:w,pt(Du,Xi),Xi|=E;else return d=k!==null?k.baseLanes|w:w,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:d,cachePool:null},h.updateQueue=null,pt(Du,Xi),Xi|=d,null;else k!==null?(E=k.baseLanes|w,h.memoizedState=null):E=w,pt(Du,Xi),Xi|=E;return ii(d,h,C,w),h.child}function YA(d,h){var w=h.ref;(d===null&&w!==null||d!==null&&d.ref!==w)&&(h.flags|=512,h.flags|=2097152)}function s_(d,h,w,E,C){var k=fn(w)?Wt:Qt.current;return k=xt(h,k),Au(h,C),w=Q1(d,h,w,E,k,C),E=J1(),d!==null&&!$i?(h.updateQueue=d.updateQueue,h.flags&=-2053,d.lanes&=~C,Yo(d,h,C)):(Dn&&E&&V1(h),h.flags|=1,ii(d,h,w,C),h.child)}function KA(d,h,w,E,C){if(fn(w)){var k=!0;_r(h)}else k=!1;if(Au(h,C),h.stateNode===null)d!==null&&(d.alternate=null,h.alternate=null,h.flags|=2),uA(h,w,E),z1(h,w,E,C),E=!0;else if(d===null){var X=h.stateNode,ie=h.memoizedProps;X.props=ie;var ye=X.context,Ue=w.contextType;typeof Ue=="object"&&Ue!==null?Ue=fs(Ue):(Ue=fn(w)?Wt:Qt.current,Ue=xt(h,Ue));var dt=w.getDerivedStateFromProps,kt=typeof dt=="function"||typeof X.getSnapshotBeforeUpdate=="function";kt||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(ie!==E||ye!==Ue)&&dA(h,X,E,Ue),La=!1;var Et=h.memoizedState;X.state=Et,Vm(h,E,X,C),ye=h.memoizedState,ie!==E||Et!==ye||Jt.current||La?(typeof dt=="function"&&(B1(h,w,dt,E),ye=h.memoizedState),(ie=La||cA(h,w,ie,E,Et,ye,Ue))?(kt||typeof X.UNSAFE_componentWillMount!="function"&&typeof X.componentWillMount!="function"||(typeof X.componentWillMount=="function"&&X.componentWillMount(),typeof X.UNSAFE_componentWillMount=="function"&&X.UNSAFE_componentWillMount()),typeof X.componentDidMount=="function"&&(h.flags|=4194308)):(typeof X.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=E,h.memoizedState=ye),X.props=E,X.state=ye,X.context=Ue,E=ie):(typeof X.componentDidMount=="function"&&(h.flags|=4194308),E=!1)}else{X=h.stateNode,sA(d,h),ie=h.memoizedProps,Ue=h.type===h.elementType?ie:js(h.type,ie),X.props=Ue,kt=h.pendingProps,Et=X.context,ye=w.contextType,typeof ye=="object"&&ye!==null?ye=fs(ye):(ye=fn(w)?Wt:Qt.current,ye=xt(h,ye));var An=w.getDerivedStateFromProps;(dt=typeof An=="function"||typeof X.getSnapshotBeforeUpdate=="function")||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(ie!==kt||Et!==ye)&&dA(h,X,E,ye),La=!1,Et=h.memoizedState,X.state=Et,Vm(h,E,X,C);var yt=h.memoizedState;ie!==kt||Et!==yt||Jt.current||La?(typeof An=="function"&&(B1(h,w,An,E),yt=h.memoizedState),(Ue=La||cA(h,w,Ue,E,Et,yt,ye)||!1)?(dt||typeof X.UNSAFE_componentWillUpdate!="function"&&typeof X.componentWillUpdate!="function"||(typeof X.componentWillUpdate=="function"&&X.componentWillUpdate(E,yt,ye),typeof X.UNSAFE_componentWillUpdate=="function"&&X.UNSAFE_componentWillUpdate(E,yt,ye)),typeof X.componentDidUpdate=="function"&&(h.flags|=4),typeof X.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof X.componentDidUpdate!="function"||ie===d.memoizedProps&&Et===d.memoizedState||(h.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||ie===d.memoizedProps&&Et===d.memoizedState||(h.flags|=1024),h.memoizedProps=E,h.memoizedState=yt),X.props=E,X.state=yt,X.context=ye,E=Ue):(typeof X.componentDidUpdate!="function"||ie===d.memoizedProps&&Et===d.memoizedState||(h.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||ie===d.memoizedProps&&Et===d.memoizedState||(h.flags|=1024),E=!1)}return o_(d,h,w,E,k,C)}function o_(d,h,w,E,C,k){YA(d,h);var X=(h.flags&128)!==0;if(!E&&!X)return C&&Da(h,w,!1),Yo(d,h,k);E=h.stateNode,hU.current=h;var ie=X&&typeof w.getDerivedStateFromError!="function"?null:E.render();return h.flags|=1,d!==null&&X?(h.child=Ru(h,d.child,null,k),h.child=Ru(h,null,ie,k)):ii(d,h,ie,k),h.memoizedState=E.state,C&&Da(h,w,!0),h.child}function ZA(d){var h=d.stateNode;h.pendingContext?_i(d,h.pendingContext,h.pendingContext!==h.context):h.context&&_i(d,h.context,!1),X1(d,h.containerInfo)}function QA(d,h,w,E,C){return Nu(),$1(C),h.flags|=256,ii(d,h,w,E),h.child}var rg={dehydrated:null,treeContext:null,retryLane:0};function ig(d){return{baseLanes:d,cachePool:null}}function JA(d,h,w){var E=h.pendingProps,C=jn.current,k=!1,X=(h.flags&128)!==0,ie;if((ie=X)||(ie=d!==null&&d.memoizedState===null?!1:(C&2)!==0),ie?(k=!0,h.flags&=-129):(d===null||d.memoizedState!==null)&&(C|=1),pt(jn,C&1),d===null)return G1(h),d=h.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?(h.mode&1?Ql(d)?h.lanes=8:h.lanes=1073741824:h.lanes=1,null):(C=E.children,d=E.fallback,k?(E=h.mode,k=h.child,C={mode:"hidden",children:C},!(E&1)&&k!==null?(k.childLanes=0,k.pendingProps=C):k=Eg(C,E,0,null),d=ac(d,E,w,null),k.return=h,d.return=h,k.sibling=d,h.child=k,h.child.memoizedState=ig(w),h.memoizedState=rg,d):a_(h,C));if(C=d.memoizedState,C!==null){if(ie=C.dehydrated,ie!==null){if(X)return h.flags&256?(h.flags&=-257,sg(d,h,w,Error(o(422)))):h.memoizedState!==null?(h.child=d.child,h.flags|=128,null):(k=E.fallback,C=h.mode,E=Eg({mode:"visible",children:E.children},C,0,null),k=ac(k,C,w,null),k.flags|=2,E.return=h,k.return=h,E.sibling=k,h.child=E,h.mode&1&&Ru(h,d.child,null,w),h.child.memoizedState=ig(w),h.memoizedState=rg,k);if(!(h.mode&1))h=sg(d,h,w,null);else if(Ql(ie))h=sg(d,h,w,Error(o(419)));else if(E=(w&d.childLanes)!==0,$i||E){if(E=ir,E!==null){switch(w&-w){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}E=k&(E.suspendedLanes|w)?0:k,E!==0&&E!==C.retryLane&&(C.retryLane=E,vs(d,E,-1))}T_(),h=sg(d,h,w,Error(o(421)))}else lo(ie)?(h.flags|=128,h.child=d.child,h=MU.bind(null,d),Rm(ie,h),h=null):(w=C.treeContext,ze&&(Gi=Eu(ie),Wi=h,Dn=!0,Os=null,Hh=!1,w!==null&&(ps[ms++]=$o,ps[ms++]=Xo,ps[ms++]=Jl,$o=w.id,Xo=w.overflow,Jl=h)),h=a_(h,h.pendingProps.children),h.flags|=4096);return h}return k?(E=tT(d,h,E.children,E.fallback,w),k=h.child,C=d.child.memoizedState,k.memoizedState=C===null?ig(w):{baseLanes:C.baseLanes|w,cachePool:null},k.childLanes=d.childLanes&~w,h.memoizedState=rg,E):(w=eT(d,h,E.children,w),h.memoizedState=null,w)}return k?(E=tT(d,h,E.children,E.fallback,w),k=h.child,C=d.child.memoizedState,k.memoizedState=C===null?ig(w):{baseLanes:C.baseLanes|w,cachePool:null},k.childLanes=d.childLanes&~w,h.memoizedState=rg,E):(w=eT(d,h,E.children,w),h.memoizedState=null,w)}function a_(d,h){return h=Eg({mode:"visible",children:h},d.mode,0,null),h.return=d,d.child=h}function eT(d,h,w,E){var C=d.child;return d=C.sibling,w=Va(C,{mode:"visible",children:w}),!(h.mode&1)&&(w.lanes=E),w.return=h,w.sibling=null,d!==null&&(E=h.deletions,E===null?(h.deletions=[d],h.flags|=16):E.push(d)),h.child=w}function tT(d,h,w,E,C){var k=h.mode;d=d.child;var X=d.sibling,ie={mode:"hidden",children:w};return!(k&1)&&h.child!==d?(w=h.child,w.childLanes=0,w.pendingProps=ie,h.deletions=null):(w=Va(d,ie),w.subtreeFlags=d.subtreeFlags&14680064),X!==null?E=Va(X,E):(E=ac(E,k,C,null),E.flags|=2),E.return=h,w.return=h,w.sibling=E,h.child=w,E}function sg(d,h,w,E){return E!==null&&$1(E),Ru(h,d.child,null,w),d=a_(h,h.pendingProps.children),d.flags|=2,h.memoizedState=null,d}function nT(d,h,w){d.lanes|=h;var E=d.alternate;E!==null&&(E.lanes|=h),O1(d.return,h,w)}function l_(d,h,w,E,C){var k=d.memoizedState;k===null?d.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:E,tail:w,tailMode:C}:(k.isBackwards=h,k.rendering=null,k.renderingStartTime=0,k.last=E,k.tail=w,k.tailMode=C)}function rT(d,h,w){var E=h.pendingProps,C=E.revealOrder,k=E.tail;if(ii(d,h,E.children,w),E=jn.current,E&2)E=E&1|2,h.flags|=128;else{if(d!==null&&d.flags&128)e:for(d=h.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&nT(d,w,h);else if(d.tag===19)nT(d,w,h);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===h)break e;for(;d.sibling===null;){if(d.return===null||d.return===h)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}E&=1}if(pt(jn,E),!(h.mode&1))h.memoizedState=null;else switch(C){case"forwards":for(w=h.child,C=null;w!==null;)d=w.alternate,d!==null&&Xm(d)===null&&(C=w),w=w.sibling;w=C,w===null?(C=h.child,h.child=null):(C=w.sibling,w.sibling=null),l_(h,!1,C,w,k);break;case"backwards":for(w=null,C=h.child,h.child=null;C!==null;){if(d=C.alternate,d!==null&&Xm(d)===null){h.child=C;break}d=C.sibling,C.sibling=w,w=C,C=d}l_(h,!0,w,null,k);break;case"together":l_(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Yo(d,h,w){if(d!==null&&(h.dependencies=d.dependencies),ku|=h.lanes,!(w&h.childLanes))return null;if(d!==null&&h.child!==d.child)throw Error(o(153));if(h.child!==null){for(d=h.child,w=Va(d,d.pendingProps),h.child=w,w.return=h;d.sibling!==null;)d=d.sibling,w=w.sibling=Va(d,d.pendingProps),w.return=h;w.sibling=null}return h.child}function fU(d,h,w){switch(h.tag){case 3:ZA(h),Nu();break;case 5:yA(h);break;case 1:fn(h.type)&&_r(h);break;case 4:X1(h,h.stateNode.containerInfo);break;case 10:iA(h,h.type._context,h.memoizedProps.value);break;case 13:var E=h.memoizedState;if(E!==null)return E.dehydrated!==null?(pt(jn,jn.current&1),h.flags|=128,null):w&h.child.childLanes?JA(d,h,w):(pt(jn,jn.current&1),d=Yo(d,h,w),d!==null?d.sibling:null);pt(jn,jn.current&1);break;case 19:if(E=(w&h.childLanes)!==0,d.flags&128){if(E)return rT(d,h,w);h.flags|=128}var C=h.memoizedState;if(C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),pt(jn,jn.current),E)break;return null;case 22:case 23:return h.lanes=0,qA(d,h,w)}return Yo(d,h,w)}function pU(d,h){switch(H1(h),h.tag){case 1:return fn(h.type)&&nn(),d=h.flags,d&65536?(h.flags=d&-65537|128,h):null;case 3:return Iu(),Ge(Jt),Ge(Qt),K1(),d=h.flags,d&65536&&!(d&128)?(h.flags=d&-65537|128,h):null;case 5:return q1(h),null;case 13:if(Ge(jn),d=h.memoizedState,d!==null&&d.dehydrated!==null){if(h.alternate===null)throw Error(o(340));Nu()}return d=h.flags,d&65536?(h.flags=d&-65537|128,h):null;case 19:return Ge(jn),null;case 4:return Iu(),null;case 10:return j1(h.type._context),null;case 22:case 23:return A_(),null;case 24:return null;default:return null}}var og=!1,nc=!1,mU=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function ag(d,h){var w=d.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(E){Mi(d,h,E)}else w.current=null}function c_(d,h,w){try{w()}catch(E){Mi(d,h,E)}}var iT=!1;function gU(d,h){for($(d.containerInfo),Qe=h;Qe!==null;)if(d=Qe,h=d.child,(d.subtreeFlags&1028)!==0&&h!==null)h.return=d,Qe=h;else for(;Qe!==null;){d=Qe;try{var w=d.alternate;if(d.flags&1024)switch(d.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var E=w.memoizedProps,C=w.memoizedState,k=d.stateNode,X=k.getSnapshotBeforeUpdate(d.elementType===d.type?E:js(d.type,E),C);k.__reactInternalSnapshotBeforeUpdate=X}break;case 3:Ie&&Ee(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ie){Mi(d,d.return,ie)}if(h=d.sibling,h!==null){h.return=d.return,Qe=h;break}Qe=d.return}return w=iT,iT=!1,w}function rc(d,h,w){var E=h.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var C=E=E.next;do{if((C.tag&d)===d){var k=C.destroy;C.destroy=void 0,k!==void 0&&c_(h,w,k)}C=C.next}while(C!==E)}}function tf(d,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var w=h=h.next;do{if((w.tag&d)===d){var E=w.create;w.destroy=E()}w=w.next}while(w!==h)}}function u_(d){var h=d.ref;if(h!==null){var w=d.stateNode;switch(d.tag){case 5:d=Y(w);break;default:d=w}typeof h=="function"?h(d):h.current=d}}function sT(d,h,w){if(co&&typeof co.onCommitFiberUnmount=="function")try{co.onCommitFiberUnmount(Lm,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(d=h.updateQueue,d!==null&&(d=d.lastEffect,d!==null)){var E=d=d.next;do{var C=E,k=C.destroy;C=C.tag,k!==void 0&&(C&2||C&4)&&c_(h,w,k),E=E.next}while(E!==d)}break;case 1:if(ag(h,w),d=h.stateNode,typeof d.componentWillUnmount=="function")try{d.props=h.memoizedProps,d.state=h.memoizedState,d.componentWillUnmount()}catch(X){Mi(h,w,X)}break;case 5:ag(h,w);break;case 4:Ie?dT(d,h,w):He&&He&&(h=h.stateNode.containerInfo,w=$e(h),Nn(h,w))}}function oT(d,h,w){for(var E=h;;)if(sT(d,E,w),E.child===null||Ie&&E.tag===4){if(E===h)break;for(;E.sibling===null;){if(E.return===null||E.return===h)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function aT(d){var h=d.alternate;h!==null&&(d.alternate=null,aT(h)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(h=d.stateNode,h!==null&&Te(h)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function lT(d){return d.tag===5||d.tag===3||d.tag===4}function cT(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||lT(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function uT(d){if(Ie){e:{for(var h=d.return;h!==null;){if(lT(h))break e;h=h.return}throw Error(o(160))}var w=h;switch(w.tag){case 5:h=w.stateNode,w.flags&32&&(we(h),w.flags&=-33),w=cT(d),h_(d,w,h);break;case 3:case 4:h=w.stateNode.containerInfo,w=cT(d),d_(d,w,h);break;default:throw Error(o(161))}}}function d_(d,h,w){var E=d.tag;if(E===5||E===6)d=d.stateNode,h?wt(w,d,h):Oe(w,d);else if(E!==4&&(d=d.child,d!==null))for(d_(d,h,w),d=d.sibling;d!==null;)d_(d,h,w),d=d.sibling}function h_(d,h,w){var E=d.tag;if(E===5||E===6)d=d.stateNode,h?gt(w,d,h):me(w,d);else if(E!==4&&(d=d.child,d!==null))for(h_(d,h,w),d=d.sibling;d!==null;)h_(d,h,w),d=d.sibling}function dT(d,h,w){for(var E=h,C=!1,k,X;;){if(!C){C=E.return;e:for(;;){if(C===null)throw Error(o(160));switch(k=C.stateNode,C.tag){case 5:X=!1;break e;case 3:k=k.containerInfo,X=!0;break e;case 4:k=k.containerInfo,X=!0;break e}C=C.return}C=!0}if(E.tag===5||E.tag===6)oT(d,E,w),X?ee(k,E.stateNode):rt(k,E.stateNode);else if(E.tag===18)X?T1(k,E.stateNode):A1(k,E.stateNode);else if(E.tag===4){if(E.child!==null){k=E.stateNode.containerInfo,X=!0,E.child.return=E,E=E.child;continue}}else if(sT(d,E,w),E.child!==null){E.child.return=E,E=E.child;continue}if(E===h)break;for(;E.sibling===null;){if(E.return===null||E.return===h)return;E=E.return,E.tag===4&&(C=!1)}E.sibling.return=E.return,E=E.sibling}}function f_(d,h){if(Ie){switch(h.tag){case 0:case 11:case 14:case 15:rc(3,h,h.return),tf(3,h),rc(5,h,h.return);return;case 1:return;case 5:var w=h.stateNode;if(w!=null){var E=h.memoizedProps;d=d!==null?d.memoizedProps:E;var C=h.type,k=h.updateQueue;h.updateQueue=null,k!==null&&Je(w,k,C,d,E,h)}return;case 6:if(h.stateNode===null)throw Error(o(162));w=h.memoizedProps,Ze(h.stateNode,d!==null?d.memoizedProps:w,w);return;case 3:ze&&d!==null&&d.memoizedState.isDehydrated&&Dm(h.stateNode.containerInfo);return;case 12:return;case 13:lg(h);return;case 19:lg(h);return;case 17:return}throw Error(o(163))}switch(h.tag){case 0:case 11:case 14:case 15:rc(3,h,h.return),tf(3,h),rc(5,h,h.return);return;case 12:return;case 13:lg(h);return;case 19:lg(h);return;case 3:ze&&d!==null&&d.memoizedState.isDehydrated&&Dm(h.stateNode.containerInfo);break;case 22:case 23:return}e:if(He){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,Nn(h.containerInfo,h.pendingChildren);break e}throw Error(o(163))}}function lg(d){var h=d.updateQueue;if(h!==null){d.updateQueue=null;var w=d.stateNode;w===null&&(w=d.stateNode=new mU),h.forEach(function(E){var C=AU.bind(null,d,E);w.has(E)||(w.add(E),E.then(C,C))})}}function xU(d,h){for(Qe=h;Qe!==null;){h=Qe;var w=h.deletions;if(w!==null)for(var E=0;E<w.length;E++){var C=w[E];try{var k=d;Ie?dT(k,C,h):oT(k,C,h);var X=C.alternate;X!==null&&(X.return=null),C.return=null}catch(vt){Mi(C,h,vt)}}if(w=h.child,h.subtreeFlags&12854&&w!==null)w.return=h,Qe=w;else for(;Qe!==null;){h=Qe;try{var ie=h.flags;if(ie&32&&Ie&&we(h.stateNode),ie&512){var ye=h.alternate;if(ye!==null){var Ue=ye.ref;Ue!==null&&(typeof Ue=="function"?Ue(null):Ue.current=null)}}if(ie&8192)switch(h.tag){case 13:if(h.memoizedState!==null){var dt=h.alternate;(dt===null||dt.memoizedState===null)&&(__=wr())}break;case 22:var kt=h.memoizedState!==null,Et=h.alternate,An=Et!==null&&Et.memoizedState!==null;if(w=h,Ie){e:if(E=w,C=kt,k=null,Ie)for(var yt=E;;){if(yt.tag===5){if(k===null){k=yt;var Hr=yt.stateNode;C?We(Hr):Le(yt.stateNode,yt.memoizedProps)}}else if(yt.tag===6){if(k===null){var _s=yt.stateNode;C?Q(_s):ge(_s,yt.memoizedProps)}}else if((yt.tag!==22&&yt.tag!==23||yt.memoizedState===null||yt===E)&&yt.child!==null){yt.child.return=yt,yt=yt.child;continue}if(yt===E)break;for(;yt.sibling===null;){if(yt.return===null||yt.return===E)break e;k===yt&&(k=null),yt=yt.return}k===yt&&(k=null),yt.sibling.return=yt.return,yt=yt.sibling}}if(kt&&!An&&w.mode&1){Qe=w;for(var de=w.child;de!==null;){for(w=Qe=de;Qe!==null;){E=Qe;var oe=E.child;switch(E.tag){case 0:case 11:case 14:case 15:rc(4,E,E.return);break;case 1:ag(E,E.return);var ve=E.stateNode;if(typeof ve.componentWillUnmount=="function"){var tt=E.return;try{ve.props=E.memoizedProps,ve.state=E.memoizedState,ve.componentWillUnmount()}catch(vt){Mi(E,tt,vt)}}break;case 5:ag(E,E.return);break;case 22:if(E.memoizedState!==null){pT(w);continue}}oe!==null?(oe.return=E,Qe=oe):pT(w)}de=de.sibling}}}switch(ie&4102){case 2:uT(h),h.flags&=-3;break;case 6:uT(h),h.flags&=-3,f_(h.alternate,h);break;case 4096:h.flags&=-4097;break;case 4100:h.flags&=-4097,f_(h.alternate,h);break;case 4:f_(h.alternate,h)}}catch(vt){Mi(h,h.return,vt)}if(w=h.sibling,w!==null){w.return=h.return,Qe=w;break}Qe=h.return}}}function vU(d,h,w){Qe=d,hT(d)}function hT(d,h,w){for(var E=(d.mode&1)!==0;Qe!==null;){var C=Qe,k=C.child;if(C.tag===22&&E){var X=C.memoizedState!==null||og;if(!X){var ie=C.alternate,ye=ie!==null&&ie.memoizedState!==null||nc;ie=og;var Ue=nc;if(og=X,(nc=ye)&&!Ue)for(Qe=C;Qe!==null;)X=Qe,ye=X.child,X.tag===22&&X.memoizedState!==null?mT(C):ye!==null?(ye.return=X,Qe=ye):mT(C);for(;k!==null;)Qe=k,hT(k),k=k.sibling;Qe=C,og=ie,nc=Ue}fT(d)}else C.subtreeFlags&8772&&k!==null?(k.return=C,Qe=k):fT(d)}}function fT(d){for(;Qe!==null;){var h=Qe;if(h.flags&8772){var w=h.alternate;try{if(h.flags&8772)switch(h.tag){case 0:case 11:case 15:nc||tf(5,h);break;case 1:var E=h.stateNode;if(h.flags&4&&!nc)if(w===null)E.componentDidMount();else{var C=h.elementType===h.type?w.memoizedProps:js(h.type,w.memoizedProps);E.componentDidUpdate(C,w.memoizedState,E.__reactInternalSnapshotBeforeUpdate)}var k=h.updateQueue;k!==null&&aA(h,k,E);break;case 3:var X=h.updateQueue;if(X!==null){if(w=null,h.child!==null)switch(h.child.tag){case 5:w=Y(h.child.stateNode);break;case 1:w=h.child.stateNode}aA(h,X,w)}break;case 5:var ie=h.stateNode;w===null&&h.flags&4&&Me(ie,h.type,h.memoizedProps,h);break;case 6:break;case 4:break;case 12:break;case 13:if(ze&&h.memoizedState===null){var ye=h.alternate;if(ye!==null){var Ue=ye.memoizedState;if(Ue!==null){var dt=Ue.dehydrated;dt!==null&&M1(dt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}nc||h.flags&512&&u_(h)}catch(kt){Mi(h,h.return,kt)}}if(h===d){Qe=null;break}if(w=h.sibling,w!==null){w.return=h.return,Qe=w;break}Qe=h.return}}function pT(d){for(;Qe!==null;){var h=Qe;if(h===d){Qe=null;break}var w=h.sibling;if(w!==null){w.return=h.return,Qe=w;break}Qe=h.return}}function mT(d){for(;Qe!==null;){var h=Qe;try{switch(h.tag){case 0:case 11:case 15:var w=h.return;try{tf(4,h)}catch(ye){Mi(h,w,ye)}break;case 1:var E=h.stateNode;if(typeof E.componentDidMount=="function"){var C=h.return;try{E.componentDidMount()}catch(ye){Mi(h,C,ye)}}var k=h.return;try{u_(h)}catch(ye){Mi(h,k,ye)}break;case 5:var X=h.return;try{u_(h)}catch(ye){Mi(h,X,ye)}}}catch(ye){Mi(h,h.return,ye)}if(h===d){Qe=null;break}var ie=h.sibling;if(ie!==null){ie.return=h.return,Qe=ie;break}Qe=h.return}}var cg=0,ug=1,dg=2,hg=3,fg=4;if(typeof Symbol=="function"&&Symbol.for){var nf=Symbol.for;cg=nf("selector.component"),ug=nf("selector.has_pseudo_class"),dg=nf("selector.role"),hg=nf("selector.test_id"),fg=nf("selector.text")}function p_(d){var h=H(d);if(h!=null){if(typeof h.memoizedProps["data-testname"]!="string")throw Error(o(364));return h}if(d=W(d),d===null)throw Error(o(362));return d.stateNode.current}function m_(d,h){switch(h.$$typeof){case cg:if(d.type===h.value)return!0;break;case ug:e:{h=h.value,d=[d,0];for(var w=0;w<d.length;){var E=d[w++],C=d[w++],k=h[C];if(E.tag!==5||!q(E)){for(;k!=null&&m_(E,k);)C++,k=h[C];if(C===h.length){h=!0;break e}else for(E=E.child;E!==null;)d.push(E,C),E=E.sibling}}h=!1}return h;case dg:if(d.tag===5&&se(d.stateNode,h.value))return!0;break;case fg:if((d.tag===5||d.tag===6)&&(d=B(d),d!==null&&0<=d.indexOf(h.value)))return!0;break;case hg:if(d.tag===5&&(d=d.memoizedProps["data-testname"],typeof d=="string"&&d.toLowerCase()===h.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function g_(d){switch(d.$$typeof){case cg:return"<"+(F(d.value)||"Unknown")+">";case ug:return":has("+(g_(d)||"")+")";case dg:return'[role="'+d.value+'"]';case fg:return'"'+d.value+'"';case hg:return'[data-testname="'+d.value+'"]';default:throw Error(o(365))}}function gT(d,h){var w=[];d=[d,0];for(var E=0;E<d.length;){var C=d[E++],k=d[E++],X=h[k];if(C.tag!==5||!q(C)){for(;X!=null&&m_(C,X);)k++,X=h[k];if(k===h.length)w.push(C);else for(C=C.child;C!==null;)d.push(C,k),C=C.sibling}}return w}function x_(d,h){if(!Ne)throw Error(o(363));d=p_(d),d=gT(d,h),h=[],d=Array.from(d);for(var w=0;w<d.length;){var E=d[w++];if(E.tag===5)q(E)||h.push(E.stateNode);else for(E=E.child;E!==null;)d.push(E),E=E.sibling}return h}var yU=Math.ceil,pg=a.ReactCurrentDispatcher,v_=a.ReactCurrentOwner,Kn=a.ReactCurrentBatchConfig,Yt=0,ir=null,sr=null,Rr=0,Xi=0,Du=_t(0),dr=0,rf=null,ku=0,mg=0,y_=0,sf=null,Si=null,__=0,w_=1/0;function Lu(){w_=wr()+500}var gg=!1,b_=null,Oa=null,xg=!1,Ua=null,vg=0,of=0,S_=null,yg=-1,_g=0;function si(){return Yt&6?wr():yg!==-1?yg:yg=wr()}function Ba(d){return d.mode&1?Yt&2&&Rr!==0?Rr&-Rr:tU.transition!==null?(_g===0&&(d=ur,ur<<=1,!(ur&4194240)&&(ur=64),_g=d),_g):(d=pn,d!==0?d:Ae()):1}function vs(d,h,w){if(50<of)throw of=0,S_=null,Error(o(185));var E=wg(d,h);return E===null?null:(Vh(E,h,w),(!(Yt&2)||E!==ir)&&(E===ir&&(!(Yt&2)&&(mg|=h),dr===4&&za(E,Rr)),Ei(E,w),h===1&&Yt===0&&!(d.mode&1)&&(Lu(),jm&&ho())),E)}function wg(d,h){d.lanes|=h;var w=d.alternate;for(w!==null&&(w.lanes|=h),w=d,d=d.return;d!==null;)d.childLanes|=h,w=d.alternate,w!==null&&(w.childLanes|=h),w=d,d=d.return;return w.tag===3?w.stateNode:null}function Ei(d,h){var w=d.callbackNode;$O(d,h);var E=km(d,d===ir?Rr:0);if(E===0)w!==null&&nA(w),d.callbackNode=null,d.callbackPriority=0;else if(h=E&-E,d.callbackPriority!==h){if(w!=null&&nA(w),h===1)d.tag===0?eU(vT.bind(null,d)):rA(vT.bind(null,d)),be?Ke(function(){Yt===0&&ho()}):P1(I1,ho),w=null;else{switch(tA(E)){case 1:w=I1;break;case 4:w=KO;break;case 16:w=F1;break;case 536870912:w=ZO;break;default:w=F1}w=TT(w,xT.bind(null,d))}d.callbackPriority=h,d.callbackNode=w}}function xT(d,h){if(yg=-1,_g=0,Yt&6)throw Error(o(327));var w=d.callbackNode;if(oc()&&d.callbackNode!==w)return null;var E=km(d,d===ir?Rr:0);if(E===0)return null;if(E&30||E&d.expiredLanes||h)h=bg(d,E);else{h=E;var C=Yt;Yt|=2;var k=wT();(ir!==d||Rr!==h)&&(Lu(),ic(d,h));do try{bU();break}catch(ie){_T(d,ie)}while(!0);L1(),pg.current=k,Yt=C,sr!==null?h=0:(ir=null,Rr=0,h=dr)}if(h!==0){if(h===2&&(C=C1(d),C!==0&&(E=C,h=E_(d,C))),h===1)throw w=rf,ic(d,0),za(d,E),Ei(d,wr()),w;if(h===6)za(d,E);else{if(C=d.current.alternate,!(E&30)&&!_U(C)&&(h=bg(d,E),h===2&&(k=C1(d),k!==0&&(E=k,h=E_(d,k))),h===1))throw w=rf,ic(d,0),za(d,E),Ei(d,wr()),w;switch(d.finishedWork=C,d.finishedLanes=E,h){case 0:case 1:throw Error(o(345));case 2:sc(d,Si);break;case 3:if(za(d,E),(E&130023424)===E&&(h=__+500-wr(),10<h)){if(km(d,0)!==0)break;if(C=d.suspendedLanes,(C&E)!==E){si(),d.pingedLanes|=d.suspendedLanes&C;break}d.timeoutHandle=pe(sc.bind(null,d,Si),h);break}sc(d,Si);break;case 4:if(za(d,E),(E&4194240)===E)break;for(h=d.eventTimes,C=-1;0<E;){var X=31-tn(E);k=1<<X,X=h[X],X>C&&(C=X),E&=~k}if(E=C,E=wr()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*yU(E/1960))-E,10<E){d.timeoutHandle=pe(sc.bind(null,d,Si),E);break}sc(d,Si);break;case 5:sc(d,Si);break;default:throw Error(o(329))}}}return Ei(d,wr()),d.callbackNode===w?xT.bind(null,d):null}function E_(d,h){var w=sf;return d.current.memoizedState.isDehydrated&&(ic(d,h).flags|=256),d=bg(d,h),d!==2&&(h=Si,Si=w,h!==null&&M_(h)),d}function M_(d){Si===null?Si=d:Si.push.apply(Si,d)}function _U(d){for(var h=d;;){if(h.flags&16384){var w=h.updateQueue;if(w!==null&&(w=w.stores,w!==null))for(var E=0;E<w.length;E++){var C=w[E],k=C.getSnapshot;C=C.value;try{if(!uo(k(),C))return!1}catch{return!1}}}if(w=h.child,h.subtreeFlags&16384&&w!==null)w.return=h,h=w;else{if(h===d)break;for(;h.sibling===null;){if(h.return===null||h.return===d)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function za(d,h){for(h&=~y_,h&=~mg,d.suspendedLanes|=h,d.pingedLanes&=~h,d=d.expirationTimes;0<h;){var w=31-tn(h),E=1<<w;d[w]=-1,h&=~E}}function vT(d){if(Yt&6)throw Error(o(327));oc();var h=km(d,0);if(!(h&1))return Ei(d,wr()),null;var w=bg(d,h);if(d.tag!==0&&w===2){var E=C1(d);E!==0&&(h=E,w=E_(d,E))}if(w===1)throw w=rf,ic(d,0),za(d,h),Ei(d,wr()),w;if(w===6)throw Error(o(345));return d.finishedWork=d.current.alternate,d.finishedLanes=h,sc(d,Si),Ei(d,wr()),null}function yT(d){Ua!==null&&Ua.tag===0&&!(Yt&6)&&oc();var h=Yt;Yt|=1;var w=Kn.transition,E=pn;try{if(Kn.transition=null,pn=1,d)return d()}finally{pn=E,Kn.transition=w,Yt=h,!(Yt&6)&&ho()}}function A_(){Xi=Du.current,Ge(Du)}function ic(d,h){d.finishedWork=null,d.finishedLanes=0;var w=d.timeoutHandle;if(w!==nt&&(d.timeoutHandle=nt,je(w)),sr!==null)for(w=sr.return;w!==null;){var E=w;switch(H1(E),E.tag){case 1:E=E.type.childContextTypes,E!=null&&nn();break;case 3:Iu(),Ge(Jt),Ge(Qt),K1();break;case 5:q1(E);break;case 4:Iu();break;case 13:Ge(jn);break;case 19:Ge(jn);break;case 10:j1(E.type._context);break;case 22:case 23:A_()}w=w.return}if(ir=d,sr=d=Va(d.current,null),Rr=Xi=h,dr=0,rf=null,y_=mg=ku=0,Si=sf=null,fo!==null){for(h=0;h<fo.length;h++)if(w=fo[h],E=w.interleaved,E!==null){w.interleaved=null;var C=E.next,k=w.pending;if(k!==null){var X=k.next;k.next=C,E.next=X}w.pending=E}fo=null}return d}function _T(d,h){do{var w=sr;try{if(L1(),qm.current=eg,Ym){for(var E=Hn.memoizedState;E!==null;){var C=E.queue;C!==null&&(C.pending=null),E=E.next}Ym=!1}if(Fu=0,br=Br=Hn=null,qh=!1,Yh=0,v_.current=null,w===null||w.return===null){dr=1,rf=h,sr=null;break}e:{var k=d,X=w.return,ie=w,ye=h;if(h=Rr,ie.flags|=32768,ye!==null&&typeof ye=="object"&&typeof ye.then=="function"){var Ue=ye,dt=ie,kt=dt.tag;if(!(dt.mode&1)&&(kt===0||kt===11||kt===15)){var Et=dt.alternate;Et?(dt.updateQueue=Et.updateQueue,dt.memoizedState=Et.memoizedState,dt.lanes=Et.lanes):(dt.updateQueue=null,dt.memoizedState=null)}var An=zA(X);if(An!==null){An.flags&=-257,VA(An,X,ie,k,h),An.mode&1&&BA(k,Ue,h),h=An,ye=Ue;var yt=h.updateQueue;if(yt===null){var Hr=new Set;Hr.add(ye),h.updateQueue=Hr}else yt.add(ye);break e}else{if(!(h&1)){BA(k,Ue,h),T_();break e}ye=Error(o(426))}}else if(Dn&&ie.mode&1){var _s=zA(X);if(_s!==null){!(_s.flags&65536)&&(_s.flags|=256),VA(_s,X,ie,k,h),$1(ye);break e}}k=ye,dr!==4&&(dr=2),sf===null?sf=[k]:sf.push(k),ye=r_(ye,ie),ie=X;do{switch(ie.tag){case 3:ie.flags|=65536,h&=-h,ie.lanes|=h;var de=OA(ie,ye,h);oA(ie,de);break e;case 1:k=ye;var oe=ie.type,ve=ie.stateNode;if(!(ie.flags&128)&&(typeof oe.getDerivedStateFromError=="function"||ve!==null&&typeof ve.componentDidCatch=="function"&&(Oa===null||!Oa.has(ve)))){ie.flags|=65536,h&=-h,ie.lanes|=h;var tt=UA(ie,k,h);oA(ie,tt);break e}}ie=ie.return}while(ie!==null)}ST(w)}catch(vt){h=vt,sr===w&&w!==null&&(sr=w=w.return);continue}break}while(!0)}function wT(){var d=pg.current;return pg.current=eg,d===null?eg:d}function T_(){(dr===0||dr===3||dr===2)&&(dr=4),ir===null||!(ku&268435455)&&!(mg&268435455)||za(ir,Rr)}function bg(d,h){var w=Yt;Yt|=2;var E=wT();ir===d&&Rr===h||ic(d,h);do try{wU();break}catch(C){_T(d,C)}while(!0);if(L1(),Yt=w,pg.current=E,sr!==null)throw Error(o(261));return ir=null,Rr=0,dr}function wU(){for(;sr!==null;)bT(sr)}function bU(){for(;sr!==null&&!qO();)bT(sr)}function bT(d){var h=AT(d.alternate,d,Xi);d.memoizedProps=d.pendingProps,h===null?ST(d):sr=h,v_.current=null}function ST(d){var h=d;do{var w=h.alternate;if(d=h.return,h.flags&32768){if(w=pU(w,h),w!==null){w.flags&=32767,sr=w;return}if(d!==null)d.flags|=32768,d.subtreeFlags=0,d.deletions=null;else{dr=6,sr=null;return}}else if(w=dU(w,h,Xi),w!==null){sr=w;return}if(h=h.sibling,h!==null){sr=h;return}sr=h=d}while(h!==null);dr===0&&(dr=5)}function sc(d,h){var w=pn,E=Kn.transition;try{Kn.transition=null,pn=1,SU(d,h,w)}finally{Kn.transition=E,pn=w}return null}function SU(d,h,w){do oc();while(Ua!==null);if(Yt&6)throw Error(o(327));var E=d.finishedWork,C=d.finishedLanes;if(E===null)return null;if(d.finishedWork=null,d.finishedLanes=0,E===d.current)throw Error(o(177));d.callbackNode=null,d.callbackPriority=0;var k=E.lanes|E.childLanes;if(XO(d,k),d===ir&&(sr=ir=null,Rr=0),!(E.subtreeFlags&2064)&&!(E.flags&2064)||xg||(xg=!0,TT(F1,function(){return oc(),null})),k=(E.flags&15990)!==0,E.subtreeFlags&15990||k){k=Kn.transition,Kn.transition=null;var X=pn;pn=1;var ie=Yt;Yt|=4,v_.current=null,gU(d,E),xU(d,E),K(d.containerInfo),d.current=E,vU(E),YO(),Yt=ie,pn=X,Kn.transition=k}else d.current=E;if(xg&&(xg=!1,Ua=d,vg=C),k=d.pendingLanes,k===0&&(Oa=null),QO(E.stateNode),Ei(d,wr()),h!==null)for(w=d.onRecoverableError,E=0;E<h.length;E++)w(h[E]);if(gg)throw gg=!1,d=b_,b_=null,d;return vg&1&&d.tag!==0&&oc(),k=d.pendingLanes,k&1?d===S_?of++:(of=0,S_=d):of=0,ho(),null}function oc(){if(Ua!==null){var d=tA(vg),h=Kn.transition,w=pn;try{if(Kn.transition=null,pn=16>d?16:d,Ua===null)var E=!1;else{if(d=Ua,Ua=null,vg=0,Yt&6)throw Error(o(331));var C=Yt;for(Yt|=4,Qe=d.current;Qe!==null;){var k=Qe,X=k.child;if(Qe.flags&16){var ie=k.deletions;if(ie!==null){for(var ye=0;ye<ie.length;ye++){var Ue=ie[ye];for(Qe=Ue;Qe!==null;){var dt=Qe;switch(dt.tag){case 0:case 11:case 15:rc(8,dt,k)}var kt=dt.child;if(kt!==null)kt.return=dt,Qe=kt;else for(;Qe!==null;){dt=Qe;var Et=dt.sibling,An=dt.return;if(aT(dt),dt===Ue){Qe=null;break}if(Et!==null){Et.return=An,Qe=Et;break}Qe=An}}}var yt=k.alternate;if(yt!==null){var Hr=yt.child;if(Hr!==null){yt.child=null;do{var _s=Hr.sibling;Hr.sibling=null,Hr=_s}while(Hr!==null)}}Qe=k}}if(k.subtreeFlags&2064&&X!==null)X.return=k,Qe=X;else e:for(;Qe!==null;){if(k=Qe,k.flags&2048)switch(k.tag){case 0:case 11:case 15:rc(9,k,k.return)}var de=k.sibling;if(de!==null){de.return=k.return,Qe=de;break e}Qe=k.return}}var oe=d.current;for(Qe=oe;Qe!==null;){X=Qe;var ve=X.child;if(X.subtreeFlags&2064&&ve!==null)ve.return=X,Qe=ve;else e:for(X=oe;Qe!==null;){if(ie=Qe,ie.flags&2048)try{switch(ie.tag){case 0:case 11:case 15:tf(9,ie)}}catch(vt){Mi(ie,ie.return,vt)}if(ie===X){Qe=null;break e}var tt=ie.sibling;if(tt!==null){tt.return=ie.return,Qe=tt;break e}Qe=ie.return}}if(Yt=C,ho(),co&&typeof co.onPostCommitFiberRoot=="function")try{co.onPostCommitFiberRoot(Lm,d)}catch{}E=!0}return E}finally{pn=w,Kn.transition=h}}return!1}function ET(d,h,w){h=r_(w,h),h=OA(d,h,1),ja(d,h),h=si(),d=wg(d,1),d!==null&&(Vh(d,1,h),Ei(d,h))}function Mi(d,h,w){if(d.tag===3)ET(d,d,w);else for(;h!==null;){if(h.tag===3){ET(h,d,w);break}else if(h.tag===1){var E=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(Oa===null||!Oa.has(E))){d=r_(w,d),d=UA(h,d,1),ja(h,d),d=si(),h=wg(h,1),h!==null&&(Vh(h,1,d),Ei(h,d));break}}h=h.return}}function EU(d,h,w){var E=d.pingCache;E!==null&&E.delete(h),h=si(),d.pingedLanes|=d.suspendedLanes&w,ir===d&&(Rr&w)===w&&(dr===4||dr===3&&(Rr&130023424)===Rr&&500>wr()-__?ic(d,0):y_|=w),Ei(d,h)}function MT(d,h){h===0&&(d.mode&1?(h=ka,ka<<=1,!(ka&130023424)&&(ka=4194304)):h=1);var w=si();d=wg(d,h),d!==null&&(Vh(d,h,w),Ei(d,w))}function MU(d){var h=d.memoizedState,w=0;h!==null&&(w=h.retryLane),MT(d,w)}function AU(d,h){var w=0;switch(d.tag){case 13:var E=d.stateNode,C=d.memoizedState;C!==null&&(w=C.retryLane);break;case 19:E=d.stateNode;break;default:throw Error(o(314))}E!==null&&E.delete(h),MT(d,w)}var AT;AT=function(d,h,w){if(d!==null)if(d.memoizedProps!==h.pendingProps||Jt.current)$i=!0;else{if(!(d.lanes&w)&&!(h.flags&128))return $i=!1,fU(d,h,w);$i=!!(d.flags&131072)}else $i=!1,Dn&&h.flags&1048576&&hA(h,Gm,h.index);switch(h.lanes=0,h.tag){case 2:var E=h.type;d!==null&&(d.alternate=null,h.alternate=null,h.flags|=2),d=h.pendingProps;var C=xt(h,Qt.current);Au(h,w),C=Q1(null,h,E,d,C,w);var k=J1();return h.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,fn(E)?(k=!0,_r(h)):k=!1,h.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,U1(h),C.updater=Hm,h.stateNode=C,C._reactInternals=h,z1(h,E,d,w),h=o_(null,h,E,!0,k,w)):(h.tag=0,Dn&&k&&V1(h),ii(null,h,C,w),h=h.child),h;case 16:E=h.elementType;e:{switch(d!==null&&(d.alternate=null,h.alternate=null,h.flags|=2),d=h.pendingProps,C=E._init,E=C(E._payload),h.type=E,C=h.tag=CU(E),d=js(E,d),C){case 0:h=s_(null,h,E,d,w);break e;case 1:h=KA(null,h,E,d,w);break e;case 11:h=GA(null,h,E,d,w);break e;case 14:h=$A(null,h,E,js(E.type,d),w);break e}throw Error(o(306,E,""))}return h;case 0:return E=h.type,C=h.pendingProps,C=h.elementType===E?C:js(E,C),s_(d,h,E,C,w);case 1:return E=h.type,C=h.pendingProps,C=h.elementType===E?C:js(E,C),KA(d,h,E,C,w);case 3:e:{if(ZA(h),d===null)throw Error(o(387));E=h.pendingProps,k=h.memoizedState,C=k.element,sA(d,h),Vm(h,E,null,w);var X=h.memoizedState;if(E=X.element,ze&&k.isDehydrated)if(k={element:E,isDehydrated:!1,cache:X.cache,transitions:X.transitions},h.updateQueue.baseState=k,h.memoizedState=k,h.flags&256){C=Error(o(423)),h=QA(d,h,E,w,C);break e}else if(E!==C){C=Error(o(424)),h=QA(d,h,E,w,C);break e}else for(ze&&(Gi=Pm(h.stateNode.containerInfo),Wi=h,Dn=!0,Os=null,Hh=!1),w=vA(h,null,E,w),h.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(Nu(),E===C){h=Yo(d,h,w);break e}ii(d,h,E,w)}h=h.child}return h;case 5:return yA(h),d===null&&G1(h),E=h.type,C=h.pendingProps,k=d!==null?d.memoizedProps:null,X=C.children,_e(E,C)?X=null:k!==null&&_e(E,k)&&(h.flags|=32),YA(d,h),ii(d,h,X,w),h.child;case 6:return d===null&&G1(h),null;case 13:return JA(d,h,w);case 4:return X1(h,h.stateNode.containerInfo),E=h.pendingProps,d===null?h.child=Ru(h,null,E,w):ii(d,h,E,w),h.child;case 11:return E=h.type,C=h.pendingProps,C=h.elementType===E?C:js(E,C),GA(d,h,E,C,w);case 7:return ii(d,h,h.pendingProps,w),h.child;case 8:return ii(d,h,h.pendingProps.children,w),h.child;case 12:return ii(d,h,h.pendingProps.children,w),h.child;case 10:e:{if(E=h.type._context,C=h.pendingProps,k=h.memoizedProps,X=C.value,iA(h,E,X),k!==null)if(uo(k.value,X)){if(k.children===C.children&&!Jt.current){h=Yo(d,h,w);break e}}else for(k=h.child,k!==null&&(k.return=h);k!==null;){var ie=k.dependencies;if(ie!==null){X=k.child;for(var ye=ie.firstContext;ye!==null;){if(ye.context===E){if(k.tag===1){ye=Go(-1,w&-w),ye.tag=2;var Ue=k.updateQueue;if(Ue!==null){Ue=Ue.shared;var dt=Ue.pending;dt===null?ye.next=ye:(ye.next=dt.next,dt.next=ye),Ue.pending=ye}}k.lanes|=w,ye=k.alternate,ye!==null&&(ye.lanes|=w),O1(k.return,w,h),ie.lanes|=w;break}ye=ye.next}}else if(k.tag===10)X=k.type===h.type?null:k.child;else if(k.tag===18){if(X=k.return,X===null)throw Error(o(341));X.lanes|=w,ie=X.alternate,ie!==null&&(ie.lanes|=w),O1(X,w,h),X=k.sibling}else X=k.child;if(X!==null)X.return=k;else for(X=k;X!==null;){if(X===h){X=null;break}if(k=X.sibling,k!==null){k.return=X.return,X=k;break}X=X.return}k=X}ii(d,h,C.children,w),h=h.child}return h;case 9:return C=h.type,E=h.pendingProps.children,Au(h,w),C=fs(C),E=E(C),h.flags|=1,ii(d,h,E,w),h.child;case 14:return E=h.type,C=js(E,h.pendingProps),C=js(E.type,C),$A(d,h,E,C,w);case 15:return XA(d,h,h.type,h.pendingProps,w);case 17:return E=h.type,C=h.pendingProps,C=h.elementType===E?C:js(E,C),d!==null&&(d.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,fn(E)?(d=!0,_r(h)):d=!1,Au(h,w),uA(h,E,C),z1(h,E,C,w),o_(null,h,E,!0,d,w);case 19:return rT(d,h,w);case 22:return qA(d,h,w)}throw Error(o(156,h.tag))};function TT(d,h){return P1(d,h)}function TU(d,h,w,E){this.tag=d,this.key=w,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ys(d,h,w,E){return new TU(d,h,w,E)}function C_(d){return d=d.prototype,!(!d||!d.isReactComponent)}function CU(d){if(typeof d=="function")return C_(d)?1:0;if(d!=null){if(d=d.$$typeof,d===_)return 11;if(d===b)return 14}return 2}function Va(d,h){var w=d.alternate;return w===null?(w=ys(d.tag,h,d.key,d.mode),w.elementType=d.elementType,w.type=d.type,w.stateNode=d.stateNode,w.alternate=d,d.alternate=w):(w.pendingProps=h,w.type=d.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=d.flags&14680064,w.childLanes=d.childLanes,w.lanes=d.lanes,w.child=d.child,w.memoizedProps=d.memoizedProps,w.memoizedState=d.memoizedState,w.updateQueue=d.updateQueue,h=d.dependencies,w.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},w.sibling=d.sibling,w.index=d.index,w.ref=d.ref,w}function Sg(d,h,w,E,C,k){var X=2;if(E=d,typeof d=="function")C_(d)&&(X=1);else if(typeof d=="string")X=5;else e:switch(d){case f:return ac(w.children,C,k,h);case p:X=8,C|=8;break;case m:return d=ys(12,w,h,C|2),d.elementType=m,d.lanes=k,d;case y:return d=ys(13,w,h,C),d.elementType=y,d.lanes=k,d;case g:return d=ys(19,w,h,C),d.elementType=g,d.lanes=k,d;case M:return Eg(w,C,k,h);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case x:X=10;break e;case v:X=9;break e;case _:X=11;break e;case b:X=14;break e;case S:X=16,E=null;break e}throw Error(o(130,d==null?d:typeof d,""))}return h=ys(X,w,h,C),h.elementType=d,h.type=E,h.lanes=k,h}function ac(d,h,w,E){return d=ys(7,d,E,h),d.lanes=w,d}function Eg(d,h,w,E){return d=ys(22,d,E,h),d.elementType=M,d.lanes=w,d.stateNode={},d}function N_(d,h,w){return d=ys(6,d,null,h),d.lanes=w,d}function R_(d,h,w){return h=ys(4,d.children!==null?d.children:[],d.key,h),h.lanes=w,h.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},h}function NU(d,h,w,E,C){this.tag=h,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=nt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=N1(0),this.expirationTimes=N1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=N1(0),this.identifierPrefix=E,this.onRecoverableError=C,ze&&(this.mutableSourceEagerHydrationData=null)}function CT(d,h,w,E,C,k,X,ie,ye){return d=new NU(d,h,w,ie,ye),h===1?(h=1,k===!0&&(h|=8)):h=0,k=ys(3,null,null,h),d.current=k,k.stateNode=d,k.memoizedState={element:E,isDehydrated:w,cache:null,transitions:null},U1(k),d}function NT(d){if(!d)return qt;d=d._reactInternals;e:{if(N(d)!==d||d.tag!==1)throw Error(o(170));var h=d;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(fn(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(o(171))}if(d.tag===1){var w=d.type;if(fn(w))return Ho(d,w,h)}return h}function RT(d){var h=d._reactInternals;if(h===void 0)throw typeof d.render=="function"?Error(o(188)):(d=Object.keys(d).join(","),Error(o(268,d)));return d=O(h),d===null?null:d.stateNode}function PT(d,h){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var w=d.retryLane;d.retryLane=w!==0&&w<h?w:h}}function P_(d,h){PT(d,h),(d=d.alternate)&&PT(d,h)}function RU(d){return d=O(d),d===null?null:d.stateNode}function PU(){return null}return t.attemptContinuousHydration=function(d){if(d.tag===13){var h=si();vs(d,134217728,h),P_(d,134217728)}},t.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13){var h=si(),w=Ba(d);vs(d,w,h),P_(d,w)}},t.attemptSynchronousHydration=function(d){switch(d.tag){case 3:var h=d.stateNode;if(h.current.memoizedState.isDehydrated){var w=Hi(h.pendingLanes);w!==0&&(R1(h,w|1),Ei(h,wr()),!(Yt&6)&&(Lu(),ho()))}break;case 13:var E=si();yT(function(){return vs(d,1,E)}),P_(d,1)}},t.batchedUpdates=function(d,h){var w=Yt;Yt|=1;try{return d(h)}finally{Yt=w,Yt===0&&(Lu(),jm&&ho())}},t.createComponentSelector=function(d){return{$$typeof:cg,value:d}},t.createContainer=function(d,h,w,E,C,k,X){return CT(d,h,!1,null,w,E,C,k,X)},t.createHasPseudoClassSelector=function(d){return{$$typeof:ug,value:d}},t.createHydrationContainer=function(d,h,w,E,C,k,X,ie,ye){return d=CT(w,E,!0,d,C,k,X,ie,ye),d.context=NT(null),w=d.current,E=si(),C=Ba(w),k=Go(E,C),k.callback=h??null,ja(w,k),d.current.lanes=C,Vh(d,C,E),Ei(d,E),d},t.createPortal=function(d,h,w){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:E==null?null:""+E,children:d,containerInfo:h,implementation:w}},t.createRoleSelector=function(d){return{$$typeof:dg,value:d}},t.createTestNameSelector=function(d){return{$$typeof:hg,value:d}},t.createTextSelector=function(d){return{$$typeof:fg,value:d}},t.deferredUpdates=function(d){var h=pn,w=Kn.transition;try{return Kn.transition=null,pn=16,d()}finally{pn=h,Kn.transition=w}},t.discreteUpdates=function(d,h,w,E,C){var k=pn,X=Kn.transition;try{return Kn.transition=null,pn=1,d(h,w,E,C)}finally{pn=k,Kn.transition=X,Yt===0&&Lu()}},t.findAllNodes=x_,t.findBoundingRects=function(d,h){if(!Ne)throw Error(o(363));h=x_(d,h),d=[];for(var w=0;w<h.length;w++)d.push(P(h[w]));for(h=d.length-1;0<h;h--){w=d[h];for(var E=w.x,C=E+w.width,k=w.y,X=k+w.height,ie=h-1;0<=ie;ie--)if(h!==ie){var ye=d[ie],Ue=ye.x,dt=Ue+ye.width,kt=ye.y,Et=kt+ye.height;if(E>=Ue&&k>=kt&&C<=dt&&X<=Et){d.splice(h,1);break}else if(E!==Ue||w.width!==ye.width||Et<k||kt>X){if(!(k!==kt||w.height!==ye.height||dt<E||Ue>C)){Ue>E&&(ye.width+=Ue-E,ye.x=E),dt<C&&(ye.width=C-Ue),d.splice(h,1);break}}else{kt>k&&(ye.height+=kt-k,ye.y=k),Et<X&&(ye.height=X-kt),d.splice(h,1);break}}}return d},t.findHostInstance=RT,t.findHostInstanceWithNoPortals=function(d){return d=D(d),d=d!==null?V(d):null,d===null?null:d.stateNode},t.findHostInstanceWithWarning=function(d){return RT(d)},t.flushControlled=function(d){var h=Yt;Yt|=1;var w=Kn.transition,E=pn;try{Kn.transition=null,pn=1,d()}finally{pn=E,Kn.transition=w,Yt=h,Yt===0&&(Lu(),ho())}},t.flushPassiveEffects=oc,t.flushSync=yT,t.focusWithin=function(d,h){if(!Ne)throw Error(o(363));for(d=p_(d),h=gT(d,h),h=Array.from(h),d=0;d<h.length;){var w=h[d++];if(!q(w)){if(w.tag===5&&J(w.stateNode))return!0;for(w=w.child;w!==null;)h.push(w),w=w.sibling}}return!1},t.getCurrentUpdatePriority=function(){return pn},t.getFindAllNodesFailureDescription=function(d,h){if(!Ne)throw Error(o(363));var w=0,E=[];d=[p_(d),0];for(var C=0;C<d.length;){var k=d[C++],X=d[C++],ie=h[X];if((k.tag!==5||!q(k))&&(m_(k,ie)&&(E.push(g_(ie)),X++,X>w&&(w=X)),X<h.length))for(k=k.child;k!==null;)d.push(k,X),k=k.sibling}if(w<h.length){for(d=[];w<h.length;w++)d.push(g_(h[w]));return`findAllNodes was able to match part of the selector: 4125 `+(E.join(" > ")+` 4126 4127No matching component was found for: 4128 `)+d.join(" > ")}return null},t.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return Y(d.child.stateNode);default:return d.child.stateNode}},t.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:RU,findFiberByHostInstance:d.findFiberByHostInstance||PU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)d=!0;else{try{Lm=h.inject(d),co=h}catch{}d=!!h.checkDCE}}return d},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(d,h,w,E){if(!Ne)throw Error(o(363));d=x_(d,h);var C=ue(d,w,E).disconnect;return{disconnect:function(){C()}}},t.registerMutableSourceForHydration=function(d,h){var w=h._getVersion;w=w(h._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[h,w]:d.mutableSourceEagerHydrationData.push(h,w)},t.runWithPriority=function(d,h){var w=pn;try{return pn=d,h()}finally{pn=w}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(d,h,w,E){var C=h.current,k=si(),X=Ba(C);return w=NT(w),h.context===null?h.context=w:h.pendingContext=w,h=Go(k,X),h.payload={element:d},E=E===void 0?null:E,E!==null&&(h.callback=E),ja(C,h),d=vs(C,X,k),d!==null&&zm(d,C,X),X},t};KL.exports=CZ;var NZ=KL.exports;const RZ=S2(NZ);var ZL={exports:{}},QL={};/** 4129 * @license React 4130 * scheduler.production.min.js 4131 * 4132 * Copyright (c) Facebook, Inc. and its affiliates. 4133 * 4134 * This source code is licensed under the MIT license found in the 4135 * LICENSE file in the root directory of this source tree. 4136 */(function(n){function e(j,$){var K=j.length;j.push($);e:for(;0<K;){var re=K-1>>>1,xe=j[re];if(0<i(xe,$))j[re]=$,j[K]=xe,K=re;else break e}}function t(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var $=j[0],K=j.pop();if(K!==$){j[0]=K;e:for(var re=0,xe=j.length,Ce=xe>>>1;re<Ce;){var ce=2*(re+1)-1,_e=j[ce],Re=ce+1,pe=j[Re];if(0>i(_e,K))Re<xe&&0>i(pe,_e)?(j[re]=pe,j[Re]=K,re=Re):(j[re]=_e,j[ce]=K,re=ce);else if(Re<xe&&0>i(pe,K))j[re]=pe,j[Re]=K,re=Re;else break e}}return $}function i(j,$){var K=j.sortIndex-$.sortIndex;return K!==0?K:j.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var c=[],u=[],f=1,p=null,m=3,x=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(j){for(var $=t(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=j)r(u),$.sortIndex=$.expirationTime,e(c,$);else break;$=t(u)}}function M(j){if(_=!1,S(j),!v)if(t(c)!==null)v=!0,Y(A);else{var $=t(u);$!==null&&ne(M,$.startTime-j)}}function A(j,$){v=!1,_&&(_=!1,g(L),L=-1),x=!0;var K=m;try{for(S($),p=t(c);p!==null&&(!(p.expirationTime>$)||j&&!D());){var re=p.callback;if(typeof re=="function"){p.callback=null,m=p.priorityLevel;var xe=re(p.expirationTime<=$);$=n.unstable_now(),typeof xe=="function"?p.callback=xe:p===t(c)&&r(c),S($)}else r(c);p=t(c)}if(p!==null)var Ce=!0;else{var ce=t(u);ce!==null&&ne(M,ce.startTime-$),Ce=!1}return Ce}finally{p=null,m=K,x=!1}}var R=!1,F=null,L=-1,N=5,I=-1;function D(){return!(n.unstable_now()-I<N)}function O(){if(F!==null){var j=n.unstable_now();I=j;var $=!0;try{$=F(!0,j)}finally{$?U():(R=!1,F=null)}}else R=!1}var U;if(typeof b=="function")U=function(){b(O)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,Z=V.port2;V.port1.onmessage=O,U=function(){Z.postMessage(null)}}else U=function(){y(O,0)};function Y(j){F=j,R||(R=!0,U())}function ne(j,$){L=y(function(){j(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_continueExecution=function(){v||x||(v=!0,Y(A))},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return m},n.unstable_getFirstCallbackNode=function(){return t(c)},n.unstable_next=function(j){switch(m){case 1:case 2:case 3:var $=3;break;default:$=m}var K=m;m=$;try{return j()}finally{m=K}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(j,$){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var K=m;m=j;try{return $()}finally{m=K}},n.unstable_scheduleCallback=function(j,$,K){var re=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?re+K:re):K=re,j){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=K+xe,j={id:f++,callback:$,priorityLevel:j,startTime:K,expirationTime:xe,sortIndex:-1},K>re?(j.sortIndex=K,e(u,j),t(c)===null&&j===t(u)&&(_?(g(L),L=-1):_=!0,ne(M,K-re))):(j.sortIndex=xe,e(c,j),v||x||(v=!0,Y(A))),j},n.unstable_shouldYield=D,n.unstable_wrapCallback=function(j){var $=m;return function(){var K=m;m=$;try{return j.apply(this,arguments)}finally{m=K}}}})(QL);ZL.exports=QL;var iR=ZL.exports;const PM={},PZ=n=>void Object.assign(PM,n);function IZ(n,e){function t(f,{args:p=[],attach:m,...x},v){let _=`${f[0].toUpperCase()}${f.slice(1)}`,y;if(f==="primitive"){if(x.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=x.object;y=ld(g,{type:f,root:v,attach:m,primitive:!0})}else{const g=PM[_];if(!g)throw new Error(`R3F: ${_} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(p))throw new Error("R3F: The args prop must be an array!");y=ld(new g(...p),{type:f,root:v,attach:m,memoizedProps:{args:p}})}return y.__r3f.attach===void 0&&(y.isBufferGeometry?y.__r3f.attach="geometry":y.isMaterial&&(y.__r3f.attach="material")),_!=="inject"&&sb(y,x),y}function r(f,p){let m=!1;if(p){var x,v;(x=p.__r3f)!=null&&x.attach?ib(f,p,p.__r3f.attach):p.isObject3D&&f.isObject3D&&(f.add(p),m=!0),m||(v=f.__r3f)==null||v.objects.push(p),p.__r3f||ld(p,{}),p.__r3f.parent=f,s2(p),cd(p)}}function i(f,p,m){let x=!1;if(p){var v,_;if((v=p.__r3f)!=null&&v.attach)ib(f,p,p.__r3f.attach);else if(p.isObject3D&&f.isObject3D){p.parent=f,p.dispatchEvent({type:"added"}),f.dispatchEvent({type:"childadded",child:p});const y=f.children.filter(b=>b!==p),g=y.indexOf(m);f.children=[...y.slice(0,g),p,...y.slice(g)],x=!0}x||(_=f.__r3f)==null||_.objects.push(p),p.__r3f||ld(p,{}),p.__r3f.parent=f,s2(p),cd(p)}}function s(f,p,m=!1){f&&[...f].forEach(x=>o(p,x,m))}function o(f,p,m){if(p){var x,v,_;if(p.__r3f&&(p.__r3f.parent=null),(x=f.__r3f)!=null&&x.objects&&(f.__r3f.objects=f.__r3f.objects.filter(M=>M!==p)),(v=p.__r3f)!=null&&v.attach)cR(f,p,p.__r3f.attach);else if(p.isObject3D&&f.isObject3D){var y;f.remove(p),(y=p.__r3f)!=null&&y.root&&BZ(h0(p),p)}const b=(_=p.__r3f)==null?void 0:_.primitive,S=!b&&(m===void 0?p.dispose!==null:m);if(!b){var g;s((g=p.__r3f)==null?void 0:g.objects,p,S),s(p.children,p,S)}if(delete p.__r3f,S&&p.dispose&&p.type!=="Scene"){const M=()=>{try{p.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?iR.unstable_scheduleCallback(iR.unstable_IdlePriority,M):M()}cd(f)}}function a(f,p,m,x){var v;const _=(v=f.__r3f)==null?void 0:v.parent;if(!_)return;const y=t(p,m,f.__r3f.root);if(f.children){for(const g of f.children)g.__r3f&&r(y,g);f.children=f.children.filter(g=>!g.__r3f)}f.__r3f.objects.forEach(g=>r(y,g)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||o(_,f),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),r(_,y),y.raycast&&y.__r3f.eventCount&&h0(y).getState().internal.interaction.push(y),[x,x.alternate].forEach(g=>{g!==null&&(g.stateNode=y,g.ref&&(typeof g.ref=="function"?g.ref(y):g.ref.current=y))})}const c=()=>{};return{reconciler:RZ({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,p)=>{if(!p)return;const m=f.getState().scene;m.__r3f&&(m.__r3f.root=f,r(m,p))},removeChildFromContainer:(f,p)=>{p&&o(f.getState().scene,p)},insertInContainerBefore:(f,p,m)=>{if(!p||!m)return;const x=f.getState().scene;x.__r3f&&i(x,p,m)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var p;return!!((p=f==null?void 0:f.__r3f)!=null?p:{}).handlers},prepareUpdate(f,p,m,x){var v;if(((v=f==null?void 0:f.__r3f)!=null?v:{}).primitive&&x.object&&x.object!==f)return[!0];{const{args:y=[],children:g,...b}=x,{args:S=[],children:M,...A}=m;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((F,L)=>F!==S[L]))return[!0];const R=s5(f,b,A,!0);return R.changes.length?[!1,R]:null}},commitUpdate(f,[p,m],x,v,_,y){p?a(f,x,_,y):sb(f,m)},commitMount(f,p,m,x){var v;const _=(v=f.__r3f)!=null?v:{};f.raycast&&_.handlers&&_.eventCount&&h0(f).getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>ld(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var p;const{attach:m,parent:x}=(p=f.__r3f)!=null?p:{};m&&x&&cR(x,f,m),f.isObject3D&&(f.visible=!1),cd(f)},unhideInstance(f,p){var m;const{attach:x,parent:v}=(m=f.__r3f)!=null?m:{};x&&v&&ib(v,f,x),(f.isObject3D&&p.visible==null||p.visible)&&(f.visible=!0),cd(f)},createTextInstance:c,hideTextInstance:c,unhideTextInstance:c,getCurrentEventPriority:()=>e?e():Td.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&In.fun(performance.now)?performance.now:In.fun(Date.now)?Date.now:()=>0,scheduleTimeout:In.fun(setTimeout)?setTimeout:void 0,cancelTimeout:In.fun(clearTimeout)?clearTimeout:void 0}),applyProps:sb}}var sR,oR;const rb=n=>"colorSpace"in n||"outputColorSpace"in n,JL=()=>{var n;return(n=PM.ColorManagement)!=null?n:null},e5=n=>n&&n.isOrthographicCamera,FZ=n=>n&&n.hasOwnProperty("current"),bm=typeof window<"u"&&((sR=window.document)!=null&&sR.createElement||((oR=window.navigator)==null?void 0:oR.product)==="ReactNative")?T.useLayoutEffect:T.useEffect;function t5(n){const e=T.useRef(n);return bm(()=>void(e.current=n),[n]),e}function DZ({set:n}){return bm(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class n5 extends T.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}n5.getDerivedStateFromError=()=>({error:!0});const r5="__default",aR=new Map,kZ=n=>n&&!!n.memoized&&!!n.changes;function i5(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Nf=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function h0(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const In={obj:n=>n===Object(n)&&!In.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(In.str(n)||In.num(n)||In.boo(n))return n===e;const s=In.obj(n);if(s&&r==="reference")return n===e;const o=In.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&r==="shallow"){for(a in i?e:n)if(!In.equ(n[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:n)if(n[a]!==e[a])return!1;if(In.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function LZ(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function ld(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function i2(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}const lR=/-\d+$/;function ib(n,e,t){if(In.str(t)){if(lR.test(t)){const s=t.replace(lR,""),{target:o,key:a}=i2(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:r,key:i}=i2(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function cR(n,e,t){var r,i;if(In.str(t)){const{target:s,key:o}=i2(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function s5(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:a,...c}={},u=!1){const f=n.__r3f,p=Object.entries(i),m=[];if(u){const v=Object.keys(c);for(let _=0;_<v.length;_++)i.hasOwnProperty(v[_])||p.unshift([v[_],r5+"remove"])}p.forEach(([v,_])=>{var y;if((y=n.__r3f)!=null&&y.primitive&&v==="object"||In.equ(_,c[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return m.push([v,_,!0,[]]);let g=[];v.includes("-")&&(g=v.split("-")),m.push([v,_,!1,g]);for(const b in i){const S=i[b];b.startsWith(`${v}-`)&&m.push([b,S,!1,b.split("-")])}});const x={...i};return f!=null&&f.memoizedProps&&f!=null&&f.memoizedProps.args&&(x.args=f.memoizedProps.args),f!=null&&f.memoizedProps&&f!=null&&f.memoizedProps.attach&&(x.attach=f.memoizedProps.attach),{memoized:x,changes:m}}const jZ=typeof process<"u"&&!1;function sb(n,e){var t;const r=n.__r3f,i=r==null?void 0:r.root,s=i==null||i.getState==null?void 0:i.getState(),{memoized:o,changes:a}=kZ(e)?e:s5(n,e),c=r==null?void 0:r.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let m=0;m<a.length;m++){let[x,v,_,y]=a[m];if(rb(n)){const M="srgb",A="srgb-linear";x==="encoding"?(x="colorSpace",v=v===3001?M:A):x==="outputEncoding"&&(x="outputColorSpace",v=v===3001?M:A)}let g=n,b=g[x];if(y.length&&(b=y.reduce((S,M)=>S[M],n),!(b&&b.set))){const[S,...M]=y.reverse();g=M.reverse().reduce((A,R)=>A[R],n),x=S}if(v===r5+"remove")if(g.constructor){let S=aR.get(g.constructor);S||(S=new g.constructor,aR.set(g.constructor,S)),v=S[x]}else v=0;if(_&&r)v?r.handlers[x]=v:delete r.handlers[x],r.eventCount=Object.keys(r.handlers).length;else if(b&&b.set&&(b.copy||b instanceof qc)){if(Array.isArray(v))b.fromArray?b.fromArray(v):b.set(...v);else if(b.copy&&v&&v.constructor&&(jZ?b.constructor.name===v.constructor.name:b.constructor===v.constructor))b.copy(v);else if(v!==void 0){var u;const S=(u=b)==null?void 0:u.isColor;!S&&b.setScalar?b.setScalar(v):b instanceof qc&&v instanceof qc?b.mask=v.mask:b.set(v),!JL()&&s&&!s.linear&&S&&b.convertSRGBToLinear()}}else{var f;if(g[x]=v,(f=g[x])!=null&&f.isTexture&&g[x].format===Zr&&g[x].type===Ds&&s){const S=g[x];rb(S)&&rb(s.gl)?S.colorSpace=s.gl.outputColorSpace:S.encoding=s.gl.outputEncoding}}cd(n)}if(r&&r.parent&&n.raycast&&c!==r.eventCount){const m=h0(n).getState().internal,x=m.interaction.indexOf(n);x>-1&&m.interaction.splice(x,1),r.eventCount&&m.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&s2(n),n}function cd(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function s2(n){n.onUpdate==null||n.onUpdate(n)}function OZ(n,e){n.manual||(e5(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Ox(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function UZ(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Td.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Td.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Td.ContinuousEventPriority;default:return Td.DefaultEventPriority}}function o5(n,e,t,r){const i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function BZ(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((r,i)=>{o5(t.capturedMap,e,r,i)})}function zZ(n){function e(c){const{internal:u}=n.getState(),f=c.offsetX-u.initialClick[0],p=c.offsetY-u.initialClick[1];return Math.round(Math.sqrt(f*f+p*p))}function t(c){return c.filter(u=>["Move","Over","Enter","Out","Leave"].some(f=>{var p;return(p=u.__r3f)==null?void 0:p.handlers["onPointer"+f]}))}function r(c,u){const f=n.getState(),p=new Set,m=[],x=u?u(f.internal.interaction):f.internal.interaction;for(let g=0;g<x.length;g++){const b=Nf(x[g]);b&&(b.raycaster.camera=void 0)}f.previousRoot||f.events.compute==null||f.events.compute(c,f);function v(g){const b=Nf(g);if(!b||!b.events.enabled||b.raycaster.camera===null)return[];if(b.raycaster.camera===void 0){var S;b.events.compute==null||b.events.compute(c,b,(S=b.previousRoot)==null?void 0:S.getState()),b.raycaster.camera===void 0&&(b.raycaster.camera=null)}return b.raycaster.camera?b.raycaster.intersectObject(g,!0):[]}let _=x.flatMap(v).sort((g,b)=>{const S=Nf(g.object),M=Nf(b.object);return!S||!M?g.distance-b.distance:M.events.priority-S.events.priority||g.distance-b.distance}).filter(g=>{const b=Ox(g);return p.has(b)?!1:(p.add(b),!0)});f.events.filter&&(_=f.events.filter(_,f));for(const g of _){let b=g.object;for(;b;){var y;(y=b.__r3f)!=null&&y.eventCount&&m.push({...g,eventObject:b}),b=b.parent}}if("pointerId"in c&&f.internal.capturedMap.has(c.pointerId))for(let g of f.internal.capturedMap.get(c.pointerId).values())p.has(Ox(g.intersection))||m.push(g.intersection);return m}function i(c,u,f,p){const m=n.getState();if(c.length){const x={stopped:!1};for(const v of c){const _=Nf(v.object)||m,{raycaster:y,pointer:g,camera:b,internal:S}=_,M=new G(g.x,g.y,0).unproject(b),A=I=>{var D,O;return(D=(O=S.capturedMap.get(I))==null?void 0:O.has(v.eventObject))!=null?D:!1},R=I=>{const D={intersection:v,target:u.target};S.capturedMap.has(I)?S.capturedMap.get(I).set(v.eventObject,D):S.capturedMap.set(I,new Map([[v.eventObject,D]])),u.target.setPointerCapture(I)},F=I=>{const D=S.capturedMap.get(I);D&&o5(S.capturedMap,v.eventObject,D,I)};let L={};for(let I in u){let D=u[I];typeof D!="function"&&(L[I]=D)}let N={...v,...L,pointer:g,intersections:c,stopped:x.stopped,delta:f,unprojectedPoint:M,ray:y.ray,camera:b,stopPropagation(){const I="pointerId"in u&&S.capturedMap.get(u.pointerId);if((!I||I.has(v.eventObject))&&(N.stopped=x.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(D=>D.eventObject===v.eventObject))){const D=c.slice(0,c.indexOf(v));s([...D,v])}},target:{hasPointerCapture:A,setPointerCapture:R,releasePointerCapture:F},currentTarget:{hasPointerCapture:A,setPointerCapture:R,releasePointerCapture:F},nativeEvent:u};if(p(N),x.stopped===!0)break}}return c}function s(c){const{internal:u}=n.getState();for(const f of u.hovered.values())if(!c.length||!c.find(p=>p.object===f.object&&p.index===f.index&&p.instanceId===f.instanceId)){const m=f.eventObject.__r3f,x=m==null?void 0:m.handlers;if(u.hovered.delete(Ox(f)),m!=null&&m.eventCount){const v={...f,intersections:c};x.onPointerOut==null||x.onPointerOut(v),x.onPointerLeave==null||x.onPointerLeave(v)}}}function o(c,u){for(let f=0;f<u.length;f++){const p=u[f].__r3f;p==null||p.handlers.onPointerMissed==null||p.handlers.onPointerMissed(c)}}function a(c){switch(c){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return u=>{const{internal:f}=n.getState();"pointerId"in u&&f.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(u.pointerId)&&(f.capturedMap.delete(u.pointerId),s([]))})}}return function(f){const{onPointerMissed:p,internal:m}=n.getState();m.lastEvent.current=f;const x=c==="onPointerMove",v=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",y=r(f,x?t:void 0),g=v?e(f):0;c==="onPointerDown"&&(m.initialClick=[f.offsetX,f.offsetY],m.initialHits=y.map(S=>S.eventObject)),v&&!y.length&&g<=2&&(o(f,m.interaction),p&&p(f)),x&&s(y);function b(S){const M=S.eventObject,A=M.__r3f,R=A==null?void 0:A.handlers;if(A!=null&&A.eventCount)if(x){if(R.onPointerOver||R.onPointerEnter||R.onPointerOut||R.onPointerLeave){const F=Ox(S),L=m.hovered.get(F);L?L.stopped&&S.stopPropagation():(m.hovered.set(F,S),R.onPointerOver==null||R.onPointerOver(S),R.onPointerEnter==null||R.onPointerEnter(S))}R.onPointerMove==null||R.onPointerMove(S)}else{const F=R[c];F?(!v||m.initialHits.includes(M))&&(o(f,m.interaction.filter(L=>!m.initialHits.includes(L))),F(S)):v&&m.initialHits.includes(M)&&o(f,m.interaction.filter(L=>!m.initialHits.includes(L)))}}i(y,f,g,b)}}return{handlePointer:a}}const a5=n=>!!(n!=null&&n.render),l5=T.createContext(null),VZ=(n,e)=>{const t=MZ((a,c)=>{const u=new G,f=new G,p=new G;function m(g=c().camera,b=f,S=c().size){const{width:M,height:A,top:R,left:F}=S,L=M/A;b.isVector3?p.copy(b):p.set(...b);const N=g.getWorldPosition(u).distanceTo(p);if(e5(g))return{width:M/g.zoom,height:A/g.zoom,top:R,left:F,factor:1,distance:N,aspect:L};{const I=g.fov*Math.PI/180,D=2*Math.tan(I/2)*N,O=D*(M/A);return{width:O,height:D,top:R,left:F,factor:M/O,distance:N,aspect:L}}}let x;const v=g=>a(b=>({performance:{...b.performance,current:g}})),_=new Se;return{set:a,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(c(),g),advance:(g,b)=>e(g,b,c()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new MM,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=c();x&&clearTimeout(x),g.performance.current!==g.performance.min&&v(g.performance.min),x=setTimeout(()=>v(c().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:m},setEvents:g=>a(b=>({...b,events:{...b.events,...g}})),setSize:(g,b,S,M,A)=>{const R=c().camera,F={width:g,height:b,top:M||0,left:A||0,updateStyle:S};a(L=>({size:F,viewport:{...L.viewport,...m(R,f,F)}}))},setDpr:g=>a(b=>{const S=i5(g);return{viewport:{...b.viewport,dpr:S,initialDpr:b.viewport.initialDpr||S}}}),setFrameloop:(g="always")=>{const b=c().clock;b.stop(),b.elapsedTime=0,g!=="never"&&(b.start(),b.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:T.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,b,S)=>{const M=c().internal;return M.priority=M.priority+(b>0?1:0),M.subscribers.push({ref:g,priority:b,store:S}),M.subscribers=M.subscribers.sort((A,R)=>A.priority-R.priority),()=>{const A=c().internal;A!=null&&A.subscribers&&(A.priority=A.priority-(b>0?1:0),A.subscribers=A.subscribers.filter(R=>R.ref!==g))}}}}}),r=t.getState();let i=r.size,s=r.viewport.dpr,o=r.camera;return t.subscribe(()=>{const{camera:a,size:c,viewport:u,gl:f,set:p}=t.getState();if(c.width!==i.width||c.height!==i.height||u.dpr!==s){var m;i=c,s=u.dpr,OZ(a,c),f.setPixelRatio(u.dpr);const x=(m=c.updateStyle)!=null?m:typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(c.width,c.height,x)}a!==o&&(o=a,p(x=>({viewport:{...x.viewport,...x.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Ux,HZ=new Set,WZ=new Set,GZ=new Set;function ob(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Rf(n,e){switch(n){case"before":return ob(HZ,e);case"after":return ob(WZ,e);case"tail":return ob(GZ,e)}}let ab,lb;function cb(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),ab=e.internal.subscribers,Ux=0;Ux<ab.length;Ux++)lb=ab[Ux],lb.ref.current(lb.store.getState(),r,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}function $Z(n){let e=!1,t=!1,r,i,s;function o(u){i=requestAnimationFrame(o),e=!0,r=0,Rf("before",u),t=!0;for(const p of n.values()){var f;s=p.store.getState(),s.internal.active&&(s.frameloop==="always"||s.internal.frames>0)&&!((f=s.gl.xr)!=null&&f.isPresenting)&&(r+=cb(u,s))}if(t=!1,Rf("after",u),r===0)return Rf("tail",u),e=!1,cancelAnimationFrame(i)}function a(u,f=1){var p;if(!u)return n.forEach(m=>a(m.store.getState(),f));(p=u.gl.xr)!=null&&p.isPresenting||!u.internal.active||u.frameloop==="never"||(f>1?u.internal.frames=Math.min(60,u.internal.frames+f):t?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function c(u,f=!0,p,m){if(f&&Rf("before",u),p)cb(u,p,m);else for(const x of n.values())cb(u,x.store.getState());f&&Rf("after",u)}return{loop:o,invalidate:a,advance:c}}function c5(){const n=T.useContext(l5);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function sa(n=t=>t,e){return c5()(n,e)}function Bh(n,e=0){const t=c5(),r=t.getState().internal.subscribe,i=t5(n);return bm(()=>r(i,e,t),[e,r,t]),null}const wh=new Map,{invalidate:uR,advance:dR}=$Z(wh),{reconciler:jv,applyProps:nd}=IZ(wh,UZ),rd={objects:"shallow",strict:!1},XZ=(n,e)=>{const t=typeof n=="function"?n(e):n;return a5(t)?t:new qL({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function qZ(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:s,left:o,updateStyle:a=t}=e;return{width:r,height:i,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:r,height:i,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:r,height:i,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function YZ(n){const e=wh.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=r||VZ(uR,dR),o=t||jv.createContainer(s,Td.ConcurrentRoot,null,!1,null,"",i,null);e||wh.set(n,{fiber:o,store:s});let a,c=!1,u;return{configure(f={}){let{gl:p,size:m,scene:x,events:v,onCreated:_,shadows:y=!1,linear:g=!1,flat:b=!1,legacy:S=!1,orthographic:M=!1,frameloop:A="always",dpr:R=[1,2],performance:F,raycaster:L,camera:N,onPointerMissed:I}=f,D=s.getState(),O=D.gl;D.gl||D.set({gl:O=XZ(p,n)});let U=D.raycaster;U||D.set({raycaster:U=new BL});const{params:V,...Z}=L||{};if(In.equ(Z,U,rd)||nd(U,{...Z}),In.equ(V,U.params,rd)||nd(U,{params:{...U.params,...V}}),!D.camera||D.camera===u&&!In.equ(u,N,rd)){u=N;const K=N instanceof pm,re=K?N:M?new Do(0,0,0,0,.1,1e3):new Un(75,0,.1,1e3);K||(re.position.z=5,N&&(nd(re,N),("aspect"in N||"left"in N||"right"in N||"bottom"in N||"top"in N)&&(re.manual=!0,re.updateProjectionMatrix())),!D.camera&&!(N!=null&&N.rotation)&&re.lookAt(0,0,0)),D.set({camera:re}),U.camera=re}if(!D.scene){let K;x!=null&&x.isScene?K=x:(K=new sM,x&&nd(K,x)),D.set({scene:ld(K)})}if(!D.xr){var Y;const K=(Ce,ce)=>{const _e=s.getState();_e.frameloop!=="never"&&dR(Ce,!0,_e,ce)},re=()=>{const Ce=s.getState();Ce.gl.xr.enabled=Ce.gl.xr.isPresenting,Ce.gl.xr.setAnimationLoop(Ce.gl.xr.isPresenting?K:null),Ce.gl.xr.isPresenting||uR(Ce)},xe={connect(){const Ce=s.getState().gl;Ce.xr.addEventListener("sessionstart",re),Ce.xr.addEventListener("sessionend",re)},disconnect(){const Ce=s.getState().gl;Ce.xr.removeEventListener("sessionstart",re),Ce.xr.removeEventListener("sessionend",re)}};typeof((Y=O.xr)==null?void 0:Y.addEventListener)=="function"&&xe.connect(),D.set({xr:xe})}if(O.shadowMap){const K=O.shadowMap.enabled,re=O.shadowMap.type;if(O.shadowMap.enabled=!!y,In.boo(y))O.shadowMap.type=rp;else if(In.str(y)){var ne;const xe={basic:KD,percentage:Ry,soft:rp,variance:Gs};O.shadowMap.type=(ne=xe[y])!=null?ne:rp}else In.obj(y)&&Object.assign(O.shadowMap,y);(K!==O.shadowMap.enabled||re!==O.shadowMap.type)&&(O.shadowMap.needsUpdate=!0)}const j=JL();j&&("enabled"in j?j.enabled=!S:"legacyMode"in j&&(j.legacyMode=S)),c||nd(O,{outputEncoding:g?3e3:3001,toneMapping:b?Io:GE}),D.legacy!==S&&D.set(()=>({legacy:S})),D.linear!==g&&D.set(()=>({linear:g})),D.flat!==b&&D.set(()=>({flat:b})),p&&!In.fun(p)&&!a5(p)&&!In.equ(p,O,rd)&&nd(O,p),v&&!D.events.handlers&&D.set({events:v(s)});const $=qZ(n,m);return In.equ($,D.size,rd)||D.setSize($.width,$.height,$.updateStyle,$.top,$.left),R&&D.viewport.dpr!==i5(R)&&D.setDpr(R),D.frameloop!==A&&D.setFrameloop(A),D.onPointerMissed||D.set({onPointerMissed:I}),F&&!In.equ(F,D.performance,rd)&&D.set(K=>({performance:{...K.performance,...F}})),a=_,c=!0,this},render(f){return c||this.configure(),jv.updateContainer(l.jsx(KZ,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){u5(n)}}}function KZ({store:n,children:e,onCreated:t,rootElement:r}){return bm(()=>{const i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),l.jsx(l5.Provider,{value:n,children:e})}function u5(n,e){const t=wh.get(n),r=t==null?void 0:t.fiber;if(r){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),jv.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,a,c;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(c=i.gl)!=null&&c.xr&&i.xr.disconnect(),LZ(i),wh.delete(n)}catch{}},500)})}}jv.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:T.version});const ub={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function ZZ(n){const{handlePointer:e}=zZ(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(ub).reduce((t,r)=>({...t,[r]:e(r)}),{}),update:()=>{var t;const{events:r,internal:i}=n.getState();(t=i.lastEvent)!=null&&t.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var r;const{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s.handlers)!=null?r:[]).forEach(([o,a])=>{const[c,u]=ub[o];t.addEventListener(c,a,{passive:u})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){const[a]=ub[s];r.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function hR(n,e){let t;return(...r)=>{window.clearTimeout(t),t=window.setTimeout(()=>n(...r),e)}}function QZ({debounce:n,scroll:e,polyfill:t,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=T.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=T.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),c=n?typeof n=="number"?n:n.scroll:null,u=n?typeof n=="number"?n:n.resize:null,f=T.useRef(!1);T.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[p,m,x]=T.useMemo(()=>{const g=()=>{if(!a.current.element)return;const{left:b,top:S,width:M,height:A,bottom:R,right:F,x:L,y:N}=a.current.element.getBoundingClientRect(),I={left:b,top:S,width:M,height:A,bottom:R,right:F,x:L,y:N};a.current.element instanceof HTMLElement&&r&&(I.height=a.current.element.offsetHeight,I.width=a.current.element.offsetWidth),Object.freeze(I),f.current&&!nQ(a.current.lastBounds,I)&&o(a.current.lastBounds=I)};return[g,u?hR(g,u):g,c?hR(g,c):g]},[o,r,c,u]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",x,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function _(){a.current.element&&(a.current.resizeObserver=new i(x),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(g=>g.addEventListener("scroll",x,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{x()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const y=g=>{!g||g===a.current.element||(v(),a.current.element=g,a.current.scrollContainers=d5(g),_())};return eQ(x,!!e),JZ(m),T.useEffect(()=>{v(),_()},[e,x,m]),T.useEffect(()=>v,[]),[y,s,p]}function JZ(n){T.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function eQ(n,e){T.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function d5(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...d5(n.parentElement)]}const tQ=["x","y","top","bottom","left","right","width","height"],nQ=(n,e)=>tQ.every(t=>n[t]===e[t]);var rQ=Object.defineProperty,iQ=Object.defineProperties,sQ=Object.getOwnPropertyDescriptors,fR=Object.getOwnPropertySymbols,oQ=Object.prototype.hasOwnProperty,aQ=Object.prototype.propertyIsEnumerable,pR=(n,e,t)=>e in n?rQ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,mR=(n,e)=>{for(var t in e||(e={}))oQ.call(e,t)&&pR(n,t,e[t]);if(fR)for(var t of fR(e))aQ.call(e,t)&&pR(n,t,e[t]);return n},lQ=(n,e)=>iQ(n,sQ(e)),gR,xR;typeof window<"u"&&((gR=window.document)!=null&&gR.createElement||((xR=window.navigator)==null?void 0:xR.product)==="ReactNative")?T.useLayoutEffect:T.useEffect;function h5(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=n.child;for(;r;){const i=h5(r,e,t);if(i)return i;r=r.sibling}}function f5(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const vR=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=vR;return}return vR.apply(this,arguments)};const IM=f5(T.createContext(null));class p5 extends T.Component{render(){return T.createElement(IM.Provider,{value:this._reactInternals},this.props.children)}}function cQ(){const n=T.useContext(IM);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=T.useId();return T.useMemo(()=>{for(const r of[n,n==null?void 0:n.alternate]){if(!r)continue;const i=h5(r,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[n,e])}function uQ(){const n=cQ(),[e]=T.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const i=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;i&&i!==IM&&!e.has(i)&&e.set(i,T.useContext(f5(i)))}t=t.return}return e}function dQ(){const n=uQ();return T.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>r=>T.createElement(e,null,T.createElement(t.Provider,lQ(mR({},r),{value:n.get(t)}))),e=>T.createElement(p5,mR({},e))),[n])}const hQ=T.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=ZZ,eventSource:a,eventPrefix:c,shadows:u,linear:f,flat:p,legacy:m,orthographic:x,frameloop:v,dpr:_,performance:y,raycaster:g,camera:b,scene:S,onPointerMissed:M,onCreated:A,...R},F){T.useMemo(()=>PZ(bZ),[]);const L=dQ(),[N,I]=QZ({scroll:!0,debounce:{scroll:50,resize:0},...r}),D=T.useRef(null),O=T.useRef(null);T.useImperativeHandle(F,()=>D.current);const U=t5(M),[V,Z]=T.useState(!1),[Y,ne]=T.useState(!1);if(V)throw V;if(Y)throw Y;const j=T.useRef(null);bm(()=>{const K=D.current;I.width>0&&I.height>0&&K&&(j.current||(j.current=YZ(K)),j.current.configure({gl:s,events:o,shadows:u,linear:f,flat:p,legacy:m,orthographic:x,frameloop:v,dpr:_,performance:y,raycaster:g,camera:b,scene:S,size:I,onPointerMissed:(...re)=>U.current==null?void 0:U.current(...re),onCreated:re=>{re.events.connect==null||re.events.connect(a?FZ(a)?a.current:a:O.current),c&&re.setEvents({compute:(xe,Ce)=>{const ce=xe[c+"X"],_e=xe[c+"Y"];Ce.pointer.set(ce/Ce.size.width*2-1,-(_e/Ce.size.height)*2+1),Ce.raycaster.setFromCamera(Ce.pointer,Ce.camera)}}),A==null||A(re)}}),j.current.render(l.jsx(L,{children:l.jsx(n5,{set:ne,children:l.jsx(T.Suspense,{fallback:l.jsx(DZ,{set:Z}),children:e??null})})})))}),T.useEffect(()=>{const K=D.current;if(K)return()=>u5(K)},[]);const $=a?"none":"auto";return l.jsx("div",{ref:O,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:$,...i},...R,children:l.jsx("div",{ref:N,style:{width:"100%",height:"100%"},children:l.jsx("canvas",{ref:D,style:{display:"block"},children:t})})})}),m5=T.forwardRef(function(e,t){return l.jsx(p5,{children:l.jsx(hQ,{...e,ref:t})})});function Ov(){return Ov=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ov.apply(null,arguments)}const Sm=new G,FM=new G,fQ=new G,yR=new Se;function pQ(n,e,t){const r=Sm.setFromMatrixPosition(n.matrixWorld);r.project(e);const i=t.width/2,s=t.height/2;return[r.x*i+i,-(r.y*s)+s]}function mQ(n,e){const t=Sm.setFromMatrixPosition(n.matrixWorld),r=FM.setFromMatrixPosition(e.matrixWorld),i=t.sub(r),s=e.getWorldDirection(fQ);return i.angleTo(s)>Math.PI/2}function gQ(n,e,t,r){const i=Sm.setFromMatrixPosition(n.matrixWorld),s=i.clone();s.project(e),yR.set(s.x,s.y),t.setFromCamera(yR,e);const o=t.intersectObjects(r,!0);if(o.length){const a=o[0].distance;return i.distanceTo(t.ray.origin)<a}return!0}function xQ(n,e){if(e instanceof Do)return e.zoom;if(e instanceof Un){const t=Sm.setFromMatrixPosition(n.matrixWorld),r=FM.setFromMatrixPosition(e.matrixWorld),i=e.fov*Math.PI/180,s=t.distanceTo(r);return 1/(2*Math.tan(i/2)*s)}else return 1}function vQ(n,e,t){if(e instanceof Un||e instanceof Do){const r=Sm.setFromMatrixPosition(n.matrixWorld),i=FM.setFromMatrixPosition(e.matrixWorld),s=r.distanceTo(i),o=(t[1]-t[0])/(e.far-e.near),a=t[1]-o*e.far;return Math.round(o*s+a)}}const o2=n=>Math.abs(n)<1e-10?0:n;function g5(n,e,t=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=o2(e[i]*n.elements[i])+(i!==15?",":")");return t+r}const yQ=(n=>e=>g5(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),_Q=(n=>(e,t)=>g5(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function wQ(n){return n&&typeof n=="object"&&"current"in n}const x5=T.forwardRef(({children:n,eps:e=.001,style:t,className:r,prepend:i,center:s,fullscreen:o,portal:a,distanceFactor:c,sprite:u=!1,transform:f=!1,occlude:p,onOcclude:m,castShadow:x,receiveShadow:v,material:_,geometry:y,zIndexRange:g=[16777271,0],calculatePosition:b=pQ,as:S="div",wrapperClass:M,pointerEvents:A="auto",...R},F)=>{const{gl:L,camera:N,scene:I,size:D,raycaster:O,events:U,viewport:V}=sa(),[Z]=T.useState(()=>document.createElement(S)),Y=T.useRef(),ne=T.useRef(null),j=T.useRef(0),$=T.useRef([0,0]),K=T.useRef(null),re=T.useRef(null),xe=(a==null?void 0:a.current)||U.connected||L.domElement.parentNode,Ce=T.useRef(null),ce=T.useRef(!1),_e=T.useMemo(()=>p&&p!=="blending"||Array.isArray(p)&&p.length&&wQ(p[0]),[p]);T.useLayoutEffect(()=>{const Pe=L.domElement;p&&p==="blending"?(Pe.style.zIndex=`${Math.floor(g[0]/2)}`,Pe.style.position="absolute",Pe.style.pointerEvents="none"):(Pe.style.zIndex=null,Pe.style.position=null,Pe.style.pointerEvents=null)},[p]),T.useLayoutEffect(()=>{if(ne.current){const Pe=Y.current=vE(Z);if(I.updateMatrixWorld(),f)Z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Ie=b(ne.current,N,D);Z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Ie[0]}px,${Ie[1]}px,0);transform-origin:0 0;`}return xe&&(i?xe.prepend(Z):xe.appendChild(Z)),()=>{xe&&xe.removeChild(Z),Pe.unmount()}}},[xe,f]),T.useLayoutEffect(()=>{M&&(Z.className=M)},[M]);const Re=T.useMemo(()=>f?{position:"absolute",top:0,left:0,width:D.width,height:D.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-D.height/2,left:-D.width/2,width:D.width,height:D.height},...t},[t,s,o,D,f]),pe=T.useMemo(()=>({position:"absolute",pointerEvents:A}),[A]);T.useLayoutEffect(()=>{if(ce.current=!1,f){var Pe;(Pe=Y.current)==null||Pe.render(T.createElement("div",{ref:K,style:Re},T.createElement("div",{ref:re,style:pe},T.createElement("div",{ref:F,className:r,style:t,children:n}))))}else{var Ie;(Ie=Y.current)==null||Ie.render(T.createElement("div",{ref:F,style:Re,className:r,children:n}))}});const je=T.useRef(!0);Bh(Pe=>{if(ne.current){N.updateMatrixWorld(),ne.current.updateWorldMatrix(!0,!1);const Ie=f?$.current:b(ne.current,N,D);if(f||Math.abs(j.current-N.zoom)>e||Math.abs($.current[0]-Ie[0])>e||Math.abs($.current[1]-Ie[1])>e){const He=mQ(ne.current,N);let ze=!1;_e&&(Array.isArray(p)?ze=p.map(Te=>Te.current):p!=="blending"&&(ze=[I]));const H=je.current;if(ze){const Te=gQ(ne.current,N,O,ze);je.current=Te&&!He}else je.current=!He;H!==je.current&&(m?m(!je.current):Z.style.display=je.current?"block":"none");const Fe=Math.floor(g[0]/2),Ae=p?_e?[g[0],Fe]:[Fe-1,0]:g;if(Z.style.zIndex=`${vQ(ne.current,N,Ae)}`,f){const[Te,be]=[D.width/2,D.height/2],Ke=N.projectionMatrix.elements[5]*be,{isOrthographicCamera:Ne,top:W,left:P,bottom:B,right:q}=N,se=yQ(N.matrixWorldInverse),J=Ne?`scale(${Ke})translate(${o2(-(q+P)/2)}px,${o2((W+B)/2)}px)`:`translateZ(${Ke}px)`;let ue=ne.current.matrixWorld;u&&(ue=N.matrixWorldInverse.clone().transpose().copyPosition(ue).scale(ne.current.scale),ue.elements[3]=ue.elements[7]=ue.elements[11]=0,ue.elements[15]=1),Z.style.width=D.width+"px",Z.style.height=D.height+"px",Z.style.perspective=Ne?"":`${Ke}px`,K.current&&re.current&&(K.current.style.transform=`${J}${se}translate(${Te}px,${be}px)`,re.current.style.transform=_Q(ue,1/((c||10)/400)))}else{const Te=c===void 0?1:xQ(ne.current,N)*c;Z.style.transform=`translate3d(${Ie[0]}px,${Ie[1]}px,0) scale(${Te})`}$.current=Ie,j.current=N.zoom}}if(!_e&&Ce.current&&!ce.current)if(f){if(K.current){const Ie=K.current.children[0];if(Ie!=null&&Ie.clientWidth&&Ie!=null&&Ie.clientHeight){const{isOrthographicCamera:He}=N;if(He||y)R.scale&&(Array.isArray(R.scale)?R.scale instanceof G?Ce.current.scale.copy(R.scale.clone().divideScalar(1)):Ce.current.scale.set(1/R.scale[0],1/
4136R.scale[1],1/R.scale[2]):Ce.current.scale.setScalar(1/R.scale));else{const ze=(c||10)/400,H=Ie.clientWidth*ze,Fe=Ie.clientHeight*ze;Ce.current.scale.set(H,Fe,1)}ce.current=!0}}}else{const Ie=Z.children[0];if(Ie!=null&&Ie.clientWidth&&Ie!=null&&Ie.clientHeight){const He=1/V.factor,ze=Ie.clientWidth*He,H=Ie.clientHeight*He;Ce.current.scale.set(ze,H,1),ce.current=!0}Ce.current.lookAt(Pe.camera.position)}});const nt=T.useMemo(()=>({vertexShader:f?void 0:` 4137 /* 4138 This shader is from the THREE's SpriteMaterial. 4139 We need to turn the backing plane into a Sprite 4140 (make it always face the camera) if "transfrom" 4141 is false. 4142 */ 4143 #include <common> 4144 4145 void main() { 4146 vec2 center = vec2(0., 1.); 4147 float rotation = 0.0; 4148 4149 // This is somewhat arbitrary, but it seems to work well 4150 // Need to figure out how to derive this dynamically if it even matters 4151 float size = 0.03; 4152 4153 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 4154 vec2 scale; 4155 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 4156 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 4157 4158 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 4159 if ( isPerspective ) scale *= - mvPosition.z; 4160 4161 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; 4162 vec2 rotatedPosition; 4163 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 4164 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 4165 mvPosition.xy += rotatedPosition; 4166 4167 gl_Position = projectionMatrix * mvPosition; 4168 } 4169 `,fragmentShader:` 4170 void main() { 4171 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 4172 } 4173 `}),[f]);return T.createElement("group",Ov({},R,{ref:ne}),p&&!_e&&T.createElement("mesh",{castShadow:x,receiveShadow:v,ref:Ce},y||T.createElement("planeGeometry",null),_||T.createElement("shaderMaterial",{side:Ts,vertexShader:nt.vertexShader,fragmentShader:nt.fragmentShader})))});var bQ=Object.defineProperty,SQ=(n,e,t)=>e in n?bQ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,EQ=(n,e,t)=>(SQ(n,e+"",t),t);class MQ{constructor(){EQ(this,"_listeners")}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}}var AQ=Object.defineProperty,TQ=(n,e,t)=>e in n?AQ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Mt=(n,e,t)=>(TQ(n,typeof e!="symbol"?e+"":e,t),t);const Bx=new vu,_R=new la,CQ=Math.cos(70*(Math.PI/180)),wR=(n,e)=>(n%e+e)%e;let NQ=class extends MQ{constructor(e,t){super(),Mt(this,"object"),Mt(this,"domElement"),Mt(this,"enabled",!0),Mt(this,"target",new G),Mt(this,"minDistance",0),Mt(this,"maxDistance",1/0),Mt(this,"minZoom",0),Mt(this,"maxZoom",1/0),Mt(this,"minPolarAngle",0),Mt(this,"maxPolarAngle",Math.PI),Mt(this,"minAzimuthAngle",-1/0),Mt(this,"maxAzimuthAngle",1/0),Mt(this,"enableDamping",!1),Mt(this,"dampingFactor",.05),Mt(this,"enableZoom",!0),Mt(this,"zoomSpeed",1),Mt(this,"enableRotate",!0),Mt(this,"rotateSpeed",1),Mt(this,"enablePan",!0),Mt(this,"panSpeed",1),Mt(this,"screenSpacePanning",!0),Mt(this,"keyPanSpeed",7),Mt(this,"zoomToCursor",!1),Mt(this,"autoRotate",!1),Mt(this,"autoRotateSpeed",2),Mt(this,"reverseOrbit",!1),Mt(this,"reverseHorizontalOrbit",!1),Mt(this,"reverseVerticalOrbit",!1),Mt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Mt(this,"mouseButtons",{LEFT:Ec.ROTATE,MIDDLE:Ec.DOLLY,RIGHT:Ec.PAN}),Mt(this,"touches",{ONE:Mc.ROTATE,TWO:Mc.DOLLY_PAN}),Mt(this,"target0"),Mt(this,"position0"),Mt(this,"zoom0"),Mt(this,"_domElementKeyEvents",null),Mt(this,"getPolarAngle"),Mt(this,"getAzimuthalAngle"),Mt(this,"setPolarAngle"),Mt(this,"setAzimuthalAngle"),Mt(this,"getDistance"),Mt(this,"getZoomScale"),Mt(this,"listenToKeyEvents"),Mt(this,"stopListenToKeyEvents"),Mt(this,"saveState"),Mt(this,"reset"),Mt(this,"update"),Mt(this,"connect"),Mt(this,"dispose"),Mt(this,"dollyIn"),Mt(this,"dollyOut"),Mt(this,"getScale"),Mt(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>f.phi,this.getAzimuthalAngle=()=>f.theta,this.setPolarAngle=ee=>{let we=wR(ee,2*Math.PI),We=f.phi;We<0&&(We+=2*Math.PI),we<0&&(we+=2*Math.PI);let Q=Math.abs(we-We);2*Math.PI-Q<Q&&(we<We?we+=2*Math.PI:We+=2*Math.PI),p.phi=we-We,r.update(
4173)},this.setAzimuthalAngle=ee=>{let we=wR(ee,2*Math.PI),We=f.theta;We<0&&(We+=2*Math.PI),we<0&&(we+=2*Math.PI);let Q=Math.abs(we-We);2*Math.PI-Q<Q&&(we<We?we+=2*Math.PI:We+=2*Math.PI),p.theta=we-We,r.update()},this.getDistance=()=>r.object.position.distanceTo(r.target),this.listenToKeyEvents=ee=>{ee.addEventListener("keydown",me),this._domElementKeyEvents=ee},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",me),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),c=a.NONE},this.update=(()=>{const ee=new G,we=new G(0,1,0),We=new Qr().setFromUnitVectors(e.up,we),Q=We.clone().invert(),Le=new G,ge=new Qr,Ee=2*Math.PI;return function(){const $e=r.object.position;We.setFromUnitVectors(e.up,we),Q.copy(We).invert(),ee.copy($e).sub(r.target),ee.applyQuaternion(We),f.setFromVector3(ee),r.autoRotate&&c===a.NONE&&V(O()),r.enableDamping?(f.theta+=p.theta*r.dampingFactor,f.phi+=p.phi*r.dampingFactor):(f.theta+=p.theta,f.phi+=p.phi);let bt=r.minAzimuthAngle,sn=r.maxAzimuthAngle;isFinite(bt)&&isFinite(sn)&&(bt<-Math.PI?bt+=Ee:bt>Math.PI&&(bt-=Ee),sn<-Math.PI?sn+=Ee:sn>Math.PI&&(sn-=Ee),bt<=sn?f.theta=Math.max(bt,Math.min(sn,f.theta)):f.theta=f.theta>(bt+sn)/2?Math.max(bt,f.theta):Math.min(sn,f.theta)),f.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,f.phi)),f.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(x,r.dampingFactor):r.target.add(x),r.zoomToCursor&&N||r.object.isOrthographicCamera?f.radius=Ce(f.radius):f.radius=Ce(f.radius*m),ee.setFromSpherical(f),ee.applyQuaternion(Q),$e.copy(r.target).add(ee),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(p.theta*=1-r.dampingFactor,p.phi*=1-r.dampingFactor,x.multiplyScalar(1-r.dampingFactor)):(p.set(0,0,0),x.set(0,0,0));let Nn=!1;if(r.zoomToCursor&&N){let Kt=null;if(r.object instanceof Un&&r.object.isPerspectiveCamera){const rr=ee.length();Kt=Ce(rr*m);const Ur=rr-Kt;r.object.position.addScaledVector(F,Ur),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rr=new G(L.x,L.y,0);rr.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/m)),r.object.updateProjectionMatrix(),Nn=!0;const Ur=new G(L.x,L.y,0);Ur.unproject(r.object),r.object.position.sub(Ur).add(rr),r.object.updateMatrixWorld(),Kt=ee.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;Kt!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(Kt).add(r.object.position):(Bx.origin.copy(r.object.position),Bx.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Bx.direction))<CQ?e.lookAt(r.target):(_R.setFromNormalAndCoplanarPoint(r.object.up,r.target),Bx.intersectPlane(_R,r.target))))}else r.object instanceof Do&&r.object.isOrthographicCamera&&(Nn=m!==1,Nn&&(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/m)),r.object.updateProjectionMatrix()));return m=1,N=!1,Nn||Le.distanceToSquared(r.object.position)>u||8*(1-ge.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Le.copy(r.object.position),ge.copy(r.object.quaternion),Nn=!1,!0):!1}})(),this.connect=ee=>{r.domElement=ee,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Me),r.domElement.addEventListener("pointerdown",P),r.domElement.addEventListener("pointercancel",q),r.domElement.addEventListener("wheel",ue)},this.dispose=()=>{var ee,we,We,Q,Le,ge;r.domElement&&(r.domElement.style.touchAction="auto"),(ee=r.domElement)==null||ee.removeEventListener("contextmenu",Me),(we=r.domElement)==null||we.removeEventListener("pointerdown",P),(We=r.domElement)==null||We.removeEventListener("pointercancel",q),(Q=r.domElement)==null||Q.removeEventListener("wheel",ue),(Le=r.domElement)==null||Le.ownerDocument.removeEventListener("pointermove",B),(ge=r.domElement)==null||ge.ownerDocument.removeEventListener("pointerup",q),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",me)};const r=this,i={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=a.NONE;const u=1e-6,f=new e2,p=new e2;let m=1;const x=new G,v=new Se,_=new Se,y=new Se,g=new Se,b=new Se,S=new Se,M=new Se,A=new Se,R=new Se,F=new G,L=new Se;let N=!1;const I=[],D={};function O(){return 2*Math.PI/60/60*r.autoRotateSpeed}function U(){return Math.pow(.95,r.zoomSpeed)}function V(ee){r.reverseOrbit||r.reverseHorizontalOrbit?p.theta+=ee:p.theta-=ee}function Z(ee){r.reverseOrbit||r.reverseVerticalOrbit?p.phi+=ee:p.phi-=ee}const Y=(()=>{const ee=new G;return function(We,Q){ee.setFromMatrixColumn(Q,0),ee.multiplyScalar(-We),x.add(ee)}})(),ne=(()=>{const ee=new G;return function(We,Q){r.screenSpacePanning===!0?ee.setFromMatrixColumn(Q,1):(ee.setFromMatrixColumn(Q,0),ee.crossVectors(r.object.up,ee)),ee.multiplyScalar(We),x.add(ee)}})(),j=(()=>{const ee=new G;return function(We,Q){const Le=r.domElement;if(Le&&r.object instanceof Un&&r.object.isPerspectiveCamera){const ge=r.object.position;ee.copy(ge).sub(r.target);let Ee=ee.length();
4173Ee*=Math.tan(r.object.fov/2*Math.PI/180),Y(2*We*Ee/Le.clientHeight,r.object.matrix),ne(2*Q*Ee/Le.clientHeight,r.object.matrix)}else Le&&r.object instanceof Do&&r.object.isOrthographicCamera?(Y(We*(r.object.right-r.object.left)/r.object.zoom/Le.clientWidth,r.object.matrix),ne(Q*(r.object.top-r.object.bottom)/r.object.zoom/Le.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function $(ee){r.object instanceof Un&&r.object.isPerspectiveCamera||r.object instanceof Do&&r.object.isOrthographicCamera?m=ee:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function K(ee){$(m/ee)}function re(ee){$(m*ee)}function xe(ee){if(!r.zoomToCursor||!r.domElement)return;N=!0;const we=r.domElement.getBoundingClientRect(),We=ee.clientX-we.left,Q=ee.clientY-we.top,Le=we.width,ge=we.height;L.x=We/Le*2-1,L.y=-(Q/ge)*2+1,F.set(L.x,L.y,1).unproject(r.object).sub(r.object.position).normalize()}function Ce(ee){return Math.max(r.minDistance,Math.min(r.maxDistance,ee))}function ce(ee){v.set(ee.clientX,ee.clientY)}function _e(ee){xe(ee),M.set(ee.clientX,ee.clientY)}function Re(ee){g.set(ee.clientX,ee.clientY)}function pe(ee){_.set(ee.clientX,ee.clientY),y.subVectors(_,v).multiplyScalar(r.rotateSpeed);const we=r.domElement;we&&(V(2*Math.PI*y.x/we.clientHeight),Z(2*Math.PI*y.y/we.clientHeight)),v.copy(_),r.update()}function je(ee){A.set(ee.clientX,ee.clientY),R.subVectors(A,M),R.y>0?K(U()):R.y<0&&re(U()),M.copy(A),r.update()}function nt(ee){b.set(ee.clientX,ee.clientY),S.subVectors(b,g).multiplyScalar(r.panSpeed),j(S.x,S.y),g.copy(b),r.update(
4173)}function Pe(ee){xe(ee),ee.deltaY<0?re(U()):ee.deltaY>0&&K(U()),r.update()}function Ie(ee){let we=!1;switch(ee.code){case r.keys.UP:j(0,r.keyPanSpeed),we=!0;break;case r.keys.BOTTOM:j(0,-r.keyPanSpeed),we=!0;break;case r.keys.LEFT:j(r.keyPanSpeed,0),we=!0;break;case r.keys.RIGHT:j(-r.keyPanSpeed,0),we=!0;break}we&&(ee.preventDefault(),r.update())}function He(){if(I.length==1)v.set(I[0].pageX,I[0].pageY);else{const ee=.5*(I[0].pageX+I[1].pageX),we=.5*(I[0].pageY+I[1].pageY);v.set(ee,we)}}function ze(){if(I.length==1)g.set(I[0].pageX,I[0].pageY);else{const ee=.5*(I[0].pageX+I[1].pageX),we=.5*(I[0].pageY+I[1].pageY);g.set(ee,we)}}function H(){const ee=I[0].pageX-I[1].pageX,we=I[0].pageY-I[1].pageY,We=Math.sqrt(ee*ee+we*we);M.set(0,We)}function Fe(){r.enableZoom&&H(),r.enablePan&&ze()}function Ae(){r.enableZoom&&H(),r.enableRotate&&He()}function Te(ee){if(I.length==1)_.set(ee.pageX,ee.pageY);else{const We=rt(ee),Q=.5*(ee.pageX+We.x),Le=.5*(ee.pageY+We.y);_.set(Q,Le)}y.subVectors(_,v).multiplyScalar(r.rotateSpeed);const we=r.domElement;we&&(V(2*Math.PI*y.x/we.clientHeight),Z(2*Math.PI*y.y/we.clientHeight)),v.copy(_)}function be(ee){if(I.length==1)b.set(ee.pageX,ee.pageY);else{const we=rt(ee),We=.5*(ee.pageX+we.x),Q=.5*(ee.pageY+we.y);b.set(We,Q)}S.subVectors(b,g).multiplyScalar(r.panSpeed),j(S.x,S.y),g.copy(b)}function Ke(ee){const we=rt(ee),We=ee.pageX-we.x,Q=ee.pageY-we.y,Le=Math.sqrt(We*We+Q*Q);A.set(0,Le),R.set(0,Math.pow(A.y/M.y,r.zoomSpeed)),K(R.y),M.copy(A)}function Ne(ee){r.enableZoom&&Ke(ee),r.enablePan&&be(ee)}function W(ee){r.enableZoom&&Ke(ee),r.enableRotate&&Te(ee)}function P(ee){var we,We;r.enabled!==!1&&(I.length===0&&((we=r.domElement)==null||we.ownerDocument.addEventListener("pointermove",B),(We=r.domElement)==null||We.ownerDocument.addEventListener("pointerup",q)),Je(ee),ee.pointerType==="touch"?Oe(ee):se(ee))}function B(ee){r.enabled!==!1&&(ee.pointerType==="touch"?Ze(ee):J(ee))}function q(ee){var we,We,Q;gt(ee),I.length===0&&((we=r.domElement)==null||we.releasePointerCapture(ee.pointerId),(We=r.domElement)==null||We.ownerDocument.removeEventListener("pointermove",B),(Q=r.domElement)==null||Q.ownerDocument.removeEventListener("pointerup",q)),r.dispatchEvent(o),c=a.NONE}function se(ee){let we;switch(ee.button){case 0:we=r.mouseButtons.LEFT;break;case 1:we=r.mouseButtons.MIDDLE;break;case 2:we=r.mouseButtons.RIGHT;break;default:we=-1}switch(we){case Ec.DOLLY:if(r.enableZoom===!1)return;_e(ee),c=a.DOLLY;break;case Ec.ROTATE:if(ee.ctrlKey||ee.metaKey||ee.shiftKey){if(r.enablePan===!1)return;Re(ee),c=a.PAN}else{if(r.enableRotate===!1)return;ce(ee),c=a.ROTATE}break;case Ec.PAN:if(ee.ctrlKey||ee.metaKey||ee.shiftKey){if(r.enableRotate===!1)return;ce(ee),c=a.ROTATE}else{if(r.enablePan===!1)return;Re(ee),c=a.PAN}break;default:c=a.NONE}c!==a.NONE&&r.dispatchEvent(s)}function J(ee){if(r.enabled!==!1)switch(c){case a.ROTATE:if(r.enableRotate===!1)return;pe(ee);break;case a.DOLLY:if(r.enableZoom===!1)return;je(ee);break;case a.PAN:if(r.enablePan===!1)return;nt(ee);break}}function ue(ee){r.enabled===!1||r.enableZoom===!1||c!==a.NONE&&c!==a.ROTATE||(ee.preventDefault(),r.dispatchEvent(s),Pe(ee),r.dispatchEvent(o))}function me(ee){r.enabled===!1||r.enablePan===!1||Ie(ee)}function Oe(ee){switch(wt(ee),I.length){case 1:switch(r.touches.ONE){case Mc.ROTATE:if(r.enableRotate===!1)return;He(),c=a.TOUCH_ROTATE;break;case Mc.PAN:if(r.enablePan===!1)return;ze(),c=a.TOUCH_PAN;break;default:c=a.NONE}break;case 2:switch(r.touches.TWO){case Mc.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Fe(),c=a.TOUCH_DOLLY_PAN;break;case Mc.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Ae(),c=a.TOUCH_DOLLY_ROTATE;break;default:c=a.NONE}break;default:c=a.NONE}c!==a.NONE&&r.dispatchEvent(s)}function Ze(ee){switch(wt(ee),c){case a.TOUCH_ROTATE:if(r.enableRotate===!1)return;
4173Te(ee),r.update();break;case a.TOUCH_PAN:if(r.enablePan===!1)return;be(ee),r.update();break;case a.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ne(ee),r.update();break;case a.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;W(ee),r.update();break;default:c=a.NONE}}function Me(ee){r.enabled!==!1&&ee.preventDefault()}function Je(ee){I.push(ee)}function gt(ee){delete D[ee.pointerId];for(let we=0;we<I.length;we++)if(I[we].pointerId==ee.pointerId){I.splice(we,1);return}}function wt(ee){let we=D[ee.pointerId];we===void 0&&(we=new Se,D[ee.pointerId]=we),we.set(ee.pageX,ee.pageY)}function rt(ee){const we=ee.pointerId===I[0].pointerId?I[1]:I[0];return D[we.pointerId]}this.dollyIn=(ee=U())=>{re(ee),r.update()},this.dollyOut=(ee=U())=>{K(ee),r.update()},this.getScale=()=>m,this.setScale=ee=>{$(ee),r.update()},this.getZoomScale=()=>U(),t!==void 0&&this.connect(t),this.update()}};const v5=T.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:r,enableDamping:i=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:c,...u},f)=>{const p=sa(R=>R.invalidate),m=sa(R=>R.camera),x=sa(R=>R.gl),v=sa(R=>R.events),_=sa(R=>R.setEvents),y=sa(R=>R.set),g=sa(R=>R.get),b=sa(R=>R.performance),S=e||m,M=r||v.connected||x.domElement,A=T.useMemo(()=>new NQ(S),[S]);return Bh(()=>{A.enabled&&A.update()},-1),T.useEffect(()=>(s&&A.connect(s===!0?M:s),A.connect(M),()=>void A.dispose()),[s,M,t,A,p]),T.useEffect(()=>{const R=N=>{p(),t&&b.regress(),o&&o(N)},F=N=>{a&&a(N)},L=N=>{c&&c(N)};return A.addEventListener("change",R),A.addEventListener("start",F),A.addEventListener("end",L),()=>{A.removeEventListener("start",F),A.removeEventListener("end",L),A.removeEventListener("change",R)}},[o,a,c,A,p,_]),T.useEffect(()=>{if(n){const R=g().controls;return y({controls:A}),()=>y({controls:R})}},[n,A]),T.createElement("primitive",Ov({ref:f,object:A,enableDamping:i},u))});function RQ({event:n,isOpen:e,onClose:t}){const[r,i]=T.useState(null),[s,o]=T.useState(!1),{playTrack:a,isConnected:c,isPremium:u}=HE(),{toast:f}=Mn(),p=y=>y.eventType==="album"||y.eventType==="career"&&(y.title.includes("LP")||y.title.includes("Album")||y.title.includes("Slim Shady")||y.title.includes("Marshall Mathers")||y.title.includes("Encore")||y.title.includes("Relapse")||y.title.includes("Recovery")||y.title.includes("Revival")||y.title.includes("Kamikaze"));T.useEffect(()=>{if(!e||!n||!p(n)){i(null);return}(async()=>{o(!0);try{const g=await fetch(`/api/spotify/timeline-event/${n.id}`);if(g.ok){const b=await g.json();i(b)}}catch(g){console.error("Error fetching Spotify content:",g)}finally{o(!1)}})()},[e,n]);const m=y=>{if(!u){f({title:"Spotify Premium Required",description:"Full track playback requires Spotify Premium. You can listen to 30-second previews here.",variant:"destructive"});return}if(!c){f({title:"Connect to Spotify",description:"Please connect your Spotify account to play full tracks.",variant:"destructive"});return}const g={id:y.id,name:y.name,artist:(r==null?void 0:r.artist)||"Eminem",album:(r==null?void 0:r.name)||"Unknown Album",albumArt:(r==null?void 0:r.imageUrl)||"",duration:30,progress:0,spotifyUrl:y.spotifyUrl};a(g),f({title:"Now Playing",description:`"${y.name}" is now playing in the main player`})};if(!e||!n)return null;const v=(y=>{switch(y){case"personal":return{color:"from-pink-600 to-pink-800",icon:"ð¤",label:"Personal Life"};case"career":return{color:"from-yellow-600 to-yellow-800",icon:"ð¯",label:"Career Milestone"};case"album":return{color:"from-purple-600 to-purple-800",icon:"ðµ",label:"Album Release"};case"award":return{color:"from-green-600 to-green-800",icon:"ð",label:"Award & Recognition"};default:return{color:"from-blue-600 to-blue-800",icon:"ð
",label:"Event"}}})(n.eventType),_=n.date?new Date(n.date).getFullYear():"Unknown";return l.jsx(l.Fragment,{children:l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",onClick:t,children:l.jsxs("div",{className:"bg-[#121212] border border-[#3D3D3D] rounded-xl max-w-md w-full max-h-[90vh] overflow-hidden",onClick:y=>y.stopPropagation(),children:[l.jsxs("div",{className:`bg-gradient-to-r ${v.color} p-4 relative`,children:[l.jsx("button",{onClick:t,className:"absolute top-3 right-3 text-white/80 hover:text-white transition-colors",children:l.jsx(yy,{size:20})}),l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("div",{className:"text-3xl",children:v.icon}),l.jsxs("div",{children:[l.jsx("div",{className:"text-white font-bold text-lg",children:n.title}),l.jsx("div",{className:"text-white/80 text-sm",children:v.label})]})]}),l.jsxs("div",{className:"mt-2 flex items-center space-x-4",children:[l.jsxs("div",{className:"bg-black/20 px-2 py-1 rounded text-white text-sm",children:["ð
",n.date||"Date Unknown"]}),l.jsx("div",{className:"bg-black/20 px-2 py-1 rounded text-white text-sm",children:_})]})]}),l.jsxs("div",{className:"p-6",children:[l.jsx("div",{className:"text-[#F5F5F5] leading-relaxed mb-4",children:n.description}),n.significance&&l.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-4 mb-4",children:l.jsxs("div",{className:"flex items-start space-x-2",children:[l.jsx("div",{className:"text-yellow-400 mt-0.5",children:"ð¡"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-yellow-300 font-semibold text-sm mb-1",children:"Why This Matters"}),l.jsx("div",{className:"text-yellow-100 text-sm italic leading-relaxed",children:n.significance})]})]})}),p(n)&&l.jsx("div",{className:"mb-4",children:s?l.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:l.jsxs("div",{className:"flex items-center justify-center space-x-2 text-gray-300",children:[l.jsx("div",{className:"w-4 h-4 border-2 border-gray-300 border-t-transparent roun
4173ded-full animate-spin"}),l.jsx("span",{children:"Loading album..."})]})}):r&&r.tracks&&r.tracks.length>0?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"text-[#1DB954] font-semibold text-sm mb-3 flex items-center space-x-2",children:[l.jsx(As,{size:16}),l.jsxs("span",{children:["Tracks from ",r.name]})]}),r.tracks.slice(0,3).map(y=>l.jsx("div",{className:"bg-gray-800 rounded-lg p-3",children:l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded overflow-hidden flex-shrink-0",children:r.imageUrl?l.jsx("img",{src:r.imageUrl,alt:r.name,className:"w-full h-full object-cover"}):l.jsx("div",{className:"w-full h-full flex items-center justify-center",children:l.jsx(As,{size:16,className:"text-gray-400"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-white font-medium text-sm truncate",children:y.name}),l.jsx("div",{className:"text-gray-400 text-xs truncate",children:r.artist})]}),l.jsx("button",{onClick:()=>m(y),className:"bg-[#1DB954] hover:bg-[#1ed760] text-white p-2 rounded-full transition-colors flex-shrink-0",title:"Play in main player",children:l.jsx($0,{size:14})})]})},y.id)),l.jsx("div",{className:"text-center mt-3",children:l.jsxs("a",{href:r.spotifyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center space-x-2 text-[#1DB954] hover:text-[#1ed760] transition-colors text-sm",children:[l.jsx(FS,{size:14}),l.jsx("span",{children:"View full album on Spotify"})]})})]}):r?l.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("div",{className:"w-12 h-12 bg-gray-700 rounded overflow-hidden",children:r.imageUrl?l.jsx("img",{src:r.imageUrl,alt:r.name,className:"w-full h-full object-cover"}):l.jsx("div",{className:"w-full h-full flex items-center justify-center",children:l.jsx(As,{size:20,className:"text-gray-400"})})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"text-white font-medium text-sm",children:r.name}),l.jsx("div",{className:"text-gray-400 text-xs",children:r.artist}),l.jsx("div",{className:"text-gray-500 text-xs mt-1",children:"Tracks not available for preview"})]}),l.jsx("a",{href:r.spotifyUrl,target:"_blank",rel:"noopener noreferrer",className:"bg-[#1DB954] hover:bg-[#1ed760] text-white px-3 py-1 rounded text-xs transition-colors",children:"Open in Spotify"})]})}):l.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:l.jsxs("div",{className:"text-center text-gray-400",children:[l.jsx(As,{size:24,className:"mx-auto mb-2"}),l.jsx("div",{className:"text-sm",children:"Album not found on Spotify"})]})})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{className:"bg-[#FB3939] hover:bg-[#d82d2d] text-white px-4 py-2 rounded-lg font-medium transition-colors flex items-center justify-center space-x-2",children:[l.jsx(G0,{size:14}),l.jsx("span",{children:"Save Event"})]}),l.jsxs("button",{className:"bg-[#2D2D2D] hover:bg-[#3D3D3D] text-white px-4 py-2 rounded-lg font-medium transition-colors flex items-center justify-center space-x-2",children:[l.jsx(w8,{size:14}),l.jsx("span",{children:"Share"})]})]}),l.jsxs("button",{className:"w-full bg-transparent border border-[#FB3939] hover:bg-[#FB3939] text-[#FB3939] hover:text-white px-4 py-2 rounded-lg font-medium transition-colors flex items-center justify-center space-x-2",children:[l.jsx(FS,{size:14}),l.jsx("span",{children:"Discover Related Artists"})]})]}),l.jsx("div",{className:"mt-6 pt-4 border-t border-[#3D3D3D]",children:l.jsx("div",{className:"text-[#A0A0A0] text-sm",children:l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{children:"Part of Eminem's Timeline"}),l.jsx("span",{className:"text-[#FB3939]",children:_})]})})})]})]})})})}function PQ(){const n=T.useRef(null),e=new cM(IQ());return Bh(t=>{n.current&&(n.current.rotation.y=t.clock.elapsedTime*.05)}),l.jsxs("mesh",{ref:n,children:[l.jsx("sphereGeometry",{args:[1.3,64,32]}),l.jsx("meshStandardMaterial",{map:e,transparent:!0,opacity:.8})]})}function IQ(){const n=document.createElement("canvas");n.width=1024,n.height=512;const e=n.getContext("2d");e.fillStyle="#1e6091",e.fillRect(0,0,1024,512);const t=(r,i)=>{e.fillStyle=r,e.beginPath(),e.moveTo(i[0][0],i[0][1]);for(let s=1;s<i.length;s++)e.lineTo(i[s][0],i[s][1]);e.closePath(),e.fill()};t("#2d5a2d",[[120,80],[180,60],[240,70],[280,90],[260,140],[220,160],[180,150],[140,130],[110,110],[120,80]]),t("#3a6b3a",[[200,200],[240,190],[260,220],[250,280],[230,340],[210,360],[190,350],[180,320],[190,280],[200,240],[200,200]]),t("#2d5a2d",[[450,60],[490,50],[520,70],[510,100],[480,110],[460,90],[450,60]]),t("#4a7a4a",[[480,120],[520,110],[540,140],[550,180],[545,220],[535,260
4173],[520,290],[500,300],[480,290],[470,250],[475,200],[480,160],[480,120]]),t("#2d5a2d",[[550,80],[620,70],[680,85],[720,100],[740,130],[720,160],[680,170],[640,160],[600,140],[570,120],[550,80]]),t("#3a6b3a",[[720,220],[780,215],[800,240],[790,260],[760,265],[730,250],[720,220]]),e.fillStyle="#f0f8ff",e.fillRect(0,0,1024,25),e.fillRect(0,487,1024,25),e.fillStyle="rgba(255, 255, 255, 0.3)";for(let r=0;r<20;r++){const i=Math.random()*1024,s=Math.random()*512,o=Math.random()*30+10;e.beginPath(),e.arc(i,s,o,0,Math.PI*2),e.fill()}e.strokeStyle="rgba(255, 255, 255, 0.1)",e.lineWidth=1;for(let r=0;r<1024;r+=102.4)e.beginPath(),e.moveTo(r,0),e.lineTo(r,512),e.stroke();for(let r=0;r<512;r+=64)e.beginPath(),e.moveTo(0,r),e.lineTo(1024,r),e.stroke();return n}function FQ({position:n,index:e,event:t,onEventClick:r}){const i=T.useRef(null),[s,o]=T.useState(!1);Bh(u=>{if(i.current&&!s){const f=1+Math.sin(u.clock.elapsedTime*2+e)*.1;i.current.scale.setScalar(f)}});const a=u=>{switch(u){case"personal":return"#FF69B4";case"career":return"#FFD700";case"album":return"#9370DB";case"award":return"#32CD32";default:return"#00BFFF"}},c=DQ(t);return l.jsxs("group",{position:n,children:[l.jsxs("mesh",{ref:i,onPointerEnter:()=>o(!0),onPointerLeave:()=>o(!1),onClick:()=>r(t),scale:s?[1.3,1.3,1.3]:[1,1,1],children:[l.jsx("sphereGeometry",{args:[.12,16,16]}),l.jsx("meshStandardMaterial",{color:a(t.eventType),emissive:a(t.eventType),emissiveIntensity:s?.8:.4,transparent:!0,opacity:s?1:.8})]}),l.jsxs("mesh",{position:[0,0,0],children:[l.jsx("ringGeometry",{args:[.18,.25,8]}),l.jsx("meshBasicMaterial",{map:c,transparent:!0,opacity:s?1:.7,side:Ts})]}),s&&l.jsx(x5,{center:!0,distanceFactor:15,position:[0,.3,0],style:{pointerEvents:"none"},children:l.jsxs("div",{className:"bg-black/90 text-white px-2 py-1 rounded text-xs border border-gray-600 whitespace-nowrap",children:[l.jsx("div",{className:"font-semibold text-[#FFD700] text-[10px]",children:t.title}),l.jsx("div",{className:"text-gray-300 text-[9px]",children:"Click for details"})]})})]})}function DQ(n){const e=document.createElement("canvas");e.width=128,e.height=128;const t=e.getContext("2d"),r={personal:"#FF69B4",career:"#FFD700",album:"#9370DB",award:"#32CD32",default:"#00BFFF"},i=r[n.eventType]||r.default,s=t.createRadialGradient(64,64,0,64,64,64);s.addColorStop(0,i),s.addColorStop(1,"#000000"),t.fillStyle=s,t.fillRect(0,0,128,128),t.fillStyle="#FFFFFF",t.font="bold 48px Arial",t.textAlign="center",t.textBaseline="middle";const o={personal:"ð¤",career:"ð¯",album:"ðµ",award:"ð",default:"ð
"},a=o[n.eventType]||o.default;if(t.fillText(a,64,64),n.date){const c=n.date.split("-")[0];t.font="bold 12px Arial",t.fillStyle="#FFFFFF",t.fillText(c,64,100)}return new cM(e)}function kQ({events:n=[]}){const[e,t]=T.useState(null),[r,i]=T.useState(!1);console.log("ð SimpleSphereTimeline rendering with",n.length,"events"),console.log("ð First few events:",n.slice(0,3).map(a=>({title:a.title,date:a.date})));const s=a=>{t(a),i(!0)},o=()=>{i(!1),t(null)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative w-full h-[600px] bg-gradient-to-b from-[#121212] to-[#0D0D0D] rounded-xl overflow-hidden isolate",children:[l.jsxs(m5,{camera:{position:[0,0,5],fov:75},style:{position:"relative",zIndex:1},gl:{preserveDrawingBuffer:!0,antialias:!0},children:[l.jsx("ambientLight",{intensity:.6}),l.jsx("pointLight",{position:[10,10,10],intensity:1.5}),l.jsx("pointLight",{position:[-10,-10,-10],intensity:.8,color:"#FB3939"}),l.jsxs(T.Suspense,{fallback:null,children:[l.jsx(PQ,{}),n.slice(0,20).map((a,c)=>{const u=Math.acos(-1+2*c/20),f=Math.sqrt(20*Math.PI)*u,p=2.4,m=p*Math.cos(f)*Math.sin(u),x=p*Math.sin(f)*Math.sin(u),v=p*Math.cos(u);return l.jsx(FQ,{position:[m,x,v],index:c,event:a,onEventClick:s},a.id)})]}),l.jsx(v5,{enableZoom:!0,enablePan:!0,enableRotate:!0,minDistance:2,maxDistance:8})]}),l.jsxs("div",{className:"absolute bottom-4 left-4 bg-black/80 text-white px-4 py-3 rounded-lg text-sm",children:[l.jsx("div",{className:"font-semibold",children:"ð 3D Timeline"}),l.jsxs("div",{children:[n.length," events total"]}),l.jsxs("div",{children:["Showing: ",Math.min(20,n.length)," event points"]}),l.jsx("div",{className:"text-xs text-gray-300 mt-1",children:"Drag to rotate ⢠Scroll to zoom"})]})]}),l.jsx(RQ,{event:e,isOpen:r,onClose:o})]})}class LQ extends Ot.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("ð¨ Timeline Error Boundary caught error:",e,t),console.error("ð¨ Error stack:",e.stack),console.error("ð¨ Component stack:",t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function jQ(){const[n,e]=T.useState("linear"),[t,r]=T.useState(!0),{data:i=[],isLoading:s,error:o}=Nt({queryKey:["/api/timeline-events"],retry:3,retryDelay:1e3});if(console.log("MainTimeline render - isLoading:",s,"error:",o,"events:",i==null?void 0:i.length),T.useEffect(()=>{console.log("Checking WebGL support...");try{const c=document.createElement("canvas"),u=c.getContext("webgl")||c.getContext("experimental-webgl");u&&u instanceof WebGLRenderingContext?(console.log("â
WebGL is supported - switching to 3D view"),r(!0),e("3d")):(console.warn("â WebGL not supported - staying with linear view"),r(!1))}catch(c){console.error("â Error detecting WebGL support:",c),r(!1)}},[]),o)return l.jsx("section",{id:"timeline",className:"bg-[#1A1A1A] py-16",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-7xl mx-auto text-center",children:[l.jsxs("h2",{className:"text-4xl md:text-5xl font-heading text-[#F5F5F5] mb-4",children:["INTERACTIVE ",l.jsx("span",{className:"text-[#FB3939]",children:"TIMELINE"})]}),l.jsx("div",{className:"bg-red-500/20 border border-red-500/50 rounded-lg p-6 text-red-200",children:l.jsx("p",{children:"Unable to load timeline data. Please try refreshing the page."})})]})})});if(s)return l.jsx("section",{className:"bg-[#1A1A1A] py-16",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsx("div",{className:"text-center",children:l.jsxs("div",{className:"animate-pulse",children:[l.jsx("div",{className:"h-8 bg-[#2D2D2D] rounded w-96 mx-auto mb-4"}),l.jsx("div",{className:"h-4 bg-[#2D2D2D] rounded w-64 mx-auto"})]})})})});const a=i.reduce((c,u)=>(c[u.eventType]=(c[u.eventType]||0)+1,c),{});return l.jsx("section",{id:"timeline",className:"bg-[#1A1A1A] py-16",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-7xl mx-auto",children:[l.jsxs("div",{className:"text-center mb-8",children:[l.jsxs("h2",{className:"text-4xl md:text-5xl font-heading text-[#F5F5F5] mb-4",children:["INTERACTIVE ",l.jsx("span",{className:"text-[#FB3939]",children:"TIMELINE"})]}),l.jsx("p",{className:"text-[#A0A0A0] max-w-3xl mx-auto text-lg mb-8",children:"Explore Marshall Mathers' complete life journey through an immersive 3D timeline. Click on events to discover defining moments, albums, awards, and personal milestones."}),l.jsx("div",{className:"flex justify-center mb-8",children:l.jsxs("div",{className:"bg-[#2D2D2D] rounded-lg p-1 border border-[#444]",children:[t&&l.jsxs("button",{onClick:()=>e("3d"),className:`flex items-center px-4 py-2 rounded-md transition-all duration-200 ${n==="3d"?"bg-[#FB3939] text-white shadow-lg":"text-[#A0A0A0] hover:text-[#F5F5F5]"}`,children:[l.jsx(DS,{className:"w-4 h-4 mr-2"}),"3D Sphere"]}),l.jsxs("button",{onClick:()=>e("linear"),className:`flex items-center px-4 py-2 rounded-md transition-all duration-200 ${n==="linear"?"bg-[#FB3939] text-white shadow-lg":"text-[#A0A0A0] hover:text-[#F5F5F5]"}`,children:[l.jsx(x8,{className:"w-4 h-4 mr-2"}),"Linear View"]})]})})]}),n==="3d"?l.jsx("div",{className:"bg-[#121212] rounded-2xl border border-[#3D3D3D] p-4",children:l.jsxs("div",{className:"h-[600px] relative",children:[l.jsx(LQ,{fallback:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-red-400 mb-4",children:"â ï¸"}),l.jsx("p",{className:"text-[#A0A0A0] mb-4",children:"3D Timeline failed to load"}),l.jsx("button",{onClick:()=>e("linear"),className:"bg-[#FB3939] hover:bg-[#d82d2d] text-white px-4 py-2 rounded-lg",children:"Switch to Linear View"})]})}),children:l.jsx(T.Suspense,{fallback:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-[#FB3939] mx-auto mb-4"}),l.jsx("p",{className:"text-[#A0A0A0]",children:"Loading 3D Timeline..."})]})}),children:i&&i.length>0?l.jsx(kQ,{events:i}):l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("p",{className:"text-[#A0A0A0]",children:"No timeline events to display"})})})}),l.jsxs("div",{className:"absolute top-4 left-4 bg-black/70 backdrop-blur-sm rounded-lg p-3 text-sm text-[#F5F5F5] max-w-xs",children:[l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsx(DS,{className:"w-4 h-4 mr-2 text-[#FB3939]"}),l.jsx("span",{className:"font-semibold",children:"3D Timeline Guide"})]}),l.jsxs("ul",{className:"space-y-1 text-xs text-[#A0A0A0]",children:[l.jsx("li",{children:"⢠Drag to rotate the sphere"}),l.jsx("li",{children:"⢠Scroll to zoom in/out"}),l.jsx("li",{children:"⢠Click events for videos"}
4173),l.jsx("li",{children:"⢠Different colors = event types"})]})]})]})}):l.jsx("div",{className:"bg-[#121212] rounded-2xl border border-[#3D3D3D] p-8",children:l.jsx("div",{className:"space-y-6",children:i.filter(c=>c.date).sort((c,u)=>new Date(c.date).getTime()-new Date(u.date).getTime()).map((c,u)=>l.jsxs("div",{className:"flex items-start space-x-4 p-4 bg-[#1E1E1E] rounded-lg border border-[#3D3D3D] hover:border-[#FB3939]/50 transition-colors",children:[l.jsx("div",{className:`w-3 h-3 rounded-full mt-2 ${c.eventType==="personal"?"bg-pink-500":c.eventType==="career"?"bg-yellow-500":c.eventType==="album"?"bg-purple-500":c.eventType==="award"?"bg-green-500":"bg-blue-500"}`}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[l.jsx("h3",{className:"text-[#F5F5F5] font-semibold",children:c.title}),l.jsx("span",{className:`px-2 py-1 rounded text-xs uppercase ${c.eventType==="personal"?"bg-pink-500/20 text-pink-300":c.eventType==="career"?"bg-yellow-500/20 text-yellow-300":c.eventType==="album"?"bg-purple-500/20 text-purple-300":c.eventType==="award"?"bg-green-500/20 text-green-300":"bg-blue-500/20 text-blue-300"}`,children:c.eventType})]}),l.jsx("p",{className:"text-[#A0A0A0] mb-2",children:c.description}),l.jsxs("div",{className:"flex items-center text-sm text-[#666]",children:[l.jsx(kd,{className:"w-4 h-4 mr-1"}),c.date]})]})]},c.id))})}),l.jsxs("div",{className:"mt-16 grid grid-cols-2 md:grid-cols-4 gap-6",children:[l.jsxs("div",{className:"bg-[#2D2D2D] rounded-xl p-6 border border-[#444] text-center",children:[l.jsx("div",{className:"text-3xl font-bold text-[#FB3939] mb-2",children:i.length}),l.jsx("div",{className:"text-[#A0A0A0] text-sm",children:"Total Events"})]}),l.jsxs("div",{className:"bg-[#2D2D2D] rounded-xl p-6 border border-[#444] text-center",children:[l.jsx("div",{className:"text-3xl font-bold text-pink-400 mb-2",children:a.personal||0}),l.jsx("div",{className:"text-[#A0A0A0] text-sm",children:"Personal"})]}),l.jsxs("div",{className:"bg-[#2D2D2D] rounded-xl p-6 border border-[#444] text-center",children:[l.jsx("div",{className:"text-3xl font-bold text-purple-400 mb-2",children:a.album||0}),l.jsx("div",{className:"text-[#A0A0A0] text-sm",children:"Albums"})]}),l.jsxs("div",{className:"bg-[#2D2D2D] rounded-xl p-6 border border-[#444] text-center",children:[l.jsx("div",{className:"text-3xl font-bold text-green-400 mb-2",children:a.award||0}),l.jsx("div",{className:"text-[#A0A0A0] text-sm",children:"Awards"})]})]}),l.jsx("div",{className:"text-center mt-12",children:l.jsx(Pt,{href:"/eras",children:l.jsxs("button",{className:"bg-[#FB3939] hover:bg-[#d82d2d] text-white px-8 py-3 rounded-lg font-bold transition-colors duration-300 flex items-center mx-auto",children:[l.jsx(qF,{className:"w-5 h-5 mr-2"}),"Explore Detailed Era Breakdown"]})})})]})})})}function OQ({trackName:n,artistName:e,spotifyId:t,spotifyTrackId:r}){const{toast:i}=Mn(),[s,o]=T.useState(!1);HE();const a=()=>({"In Da Club":"https://open.spotify.com/track/7iL6o9tox1zgHpKUfh9vuC","P.I.M.P.":"https://open.spotify.com/track/6JgLAozen9vNOl3jccgRzR","21 Questions":"https://open.spotify.com/track/1PzHJhvwVbrQKbpQAgJv94","Candy Shop":"https://open.spotify.com/track/5qEHsGxvkGQpV7NI51iuOO","Just A Lil Bit":"https://open.spotify.com/track/1sIKAzkw4r8XcCbUxO4NoM","Many Men":"https://open.spotify.com/track/22s83S1XuPI5kGUWgBXHqW"})[n]||`https://open.spotify.com/search/${encodeURIComponent(`${n} ${e}`)}`,c=()=>{o(!s),i({title:`Now Playing: ${n}`,description:`by ${e}`}),setTimeout(()=>{o(!1)},3e3)},u=()=>{o(!1),window.open(a(),"_blank"),i({title:"Opening in Spotify",description:`${n} by ${e}`})};return l.jsxs("div",{className:"flex items-center p-3 bg-[#252525] rounded-md hover:bg-[#303030] transition-colors group",children:[l.jsx("button",{onClick:c,className:"w-8 h-8 flex items-center justify-center rounded-full mr-4 bg-[#FB3939] hover:bg-[#d82d2d] transition-colors flex-shrink-0","aria-label":s?"Pause":"Play",children:s?l.jsx(KF,{className:"text-white h-4 w-4"}):l.jsx($0,{className:"text-white h-4 w-4"})}),l.jsxs("div",{className:"text-left flex-grow",children:[l.jsx("p",{className:"text-white font-medium",children:n}),l.jsx("p",{className:"text-[#A0A0A0] text-sm",children:e})]}),l.jsxs(BH,{children:[l.jsx(zH,{asChild:!0,children:l.jsx(it,{variant:"ghost",size:"sm",className:"text-[#1DB954] hover:text-white hover:bg-[#1DB954]/20 ml-2",onClick:u,children:l.jsx(FS,{className:"h-4 w-4"})})}),l.jsx(BD,{children:l.jsx("p",{children:"Open in Spotify"})})]})]})}function UQ(){const{data:n}=Nt({queryKey:["/api/artists/slug/eminem"]});return l.jsx("section",{className:"bg-[#151515] py-16",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("div",{className:"text-center mb-10",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-bold text-white mb-2",children:[l.jsx("span",{className:"text-[#FB3939]",children:"SPOTLIGHT:"})," EMINEM"]}),l.jsx("p",{className:"text-[#A0A0A0] text-lg max-w-2xl mx-auto",children:"The legendary rapper who changed the game forever and influenced countless artists"})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8 items-start",children:[l.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[l.jsx("div",{className:"w-full aspect-[3/4] bg-gray-800 flex items-center justify-center",children:n!=null&&n.imageUrl?l.jsx("img",{src:n.imageUrl,alt:"Eminem",className:"w-full h-full object-cover"}):l.jsxs("div",{className:"text-center text-white p-4",children:[l.jsx("div",{className:"text-6xl font-bold text-[#FB3939] mb-2",children:"E"}),l.jsx("div",{className:"text-xl",children:"Eminem"})]})}),l.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black to-transparent p-6",children:[l.jsx("h3",{className:"text-2xl font-bold text-white",children:"Eminem"}),l.jsx("p",{className:"text-[#FB3939] font-medium",children:"Marshall Mathers"}),l.jsxs("div",{className:"flex justify-between mt-3 text-sm text-white",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[#A0A0A0]",children:"GRAMMY AWARDS"}),l.jsx("p",{className:"text-xl font-bold",children:"15"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[#A0A0A0]",children:"ALBUMS"}),l.jsx("p",{className:"text-xl font-bold",children:"11"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[#A0A0A0]",children:"HIT SINGLES"}),l.jsx("p",{className:"text-xl font-bold",children:"30+"})]})]})]})]}),l.jsxs("div",{className:"bg-[#1A1A1A] p-6 rounded-lg",children:[l.jsx("h3",{className:"text-xl font-bold text-white mb-4",children:"The Real Slim Shady"}),l.jsxs("div",{className:"text-[#E0E0E0] space-y-4",children:[l.jsx("p",{children:"Eminem, born Marshall Bruce Mathers III, emerged from Detroit's battle rap scene to become one of the best-selling music artists of all time. His complex rhyme schemes, emotional honesty, and controversial lyrics changed hip-hop forever."}),l.jsx("p",{children:`After being discovered by Dr. Dre, Eminem's major-label debut "The Slim Shady LP" (1999) catapulted him to global fame. Throughout his career, he's balanced alter egos, personal struggles, and commercial success while mentoring numerous artists through his Shady Records label.`}),l.jsx("p",{children:"With his technical prowess, storytelling abilities, and fearless approach to controversial topics, Eminem has earned his place as one of hip-hop's most influential figures and paved the way for countless artists who followed."})]}),l.jsx(Pt,{href:"/artists/eminem",children:l.jsx(it,{className:"mt-6 bg-[#FB3939] hover:bg-[#d82d2d]",children:"View Full Profile"})})]}),l.jsxs("div",{className:"bg-[#1A1A1A] p-6 rounded-lg",children:[l.jsx("h3",{className:"text-xl font-bold text-white mb-4",children:"Essential Tracks"}),l.jsx("div",{className:"space-y-3",children:["Lose Yourself","Stan","The Real Slim Shady","Without Me","Till I Collapse","Rap God"].map((e,t)=>l.jsx(OQ,{trackName:e,artistName:"Eminem",spotifyId:"eminem"},t))}),l.jsxs("div",{className:"mt-6 pt-4 border-t border-[#333333]",children:[l.jsx("h4",{className:"text-lg font-bold text-white mb-3",children:"Eminem's Influence"}),l.jsx("p",{className:"text-[#E0E0E0] mb-4",children:"Explore the artists directly influenced by Eminem's unique style, lyricism, and technical ability."}),l.jsx(Pt,{href:"/artists",children:l.jsx(it,{variant:"outline",className:"border-[#FB3939] text-[#FB3939] hover:bg-[#FB3939]/10",children:"View Influenced Artists"})})]})]})]})]})})}function BQ(){const[n,e]=T.useState(""),[t,r]=T.useState(!1),{toast:i}=Mn(),s=async o=>{if(o.preventDefault(),!n||!n.includes("@")){i({title:"Invalid email",description:"Please enter a valid email address.",variant:"destructive"});return}r(!0),setTimeout(()=>
4173{i({title:"Subscription successful!",description:"Thank you for joining the ShadyMusic community."}),e(""),r(!1)},1e3)};return l.jsxs("section",{className:"bg-[#1E1E1E] py-16 relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 opacity-10",children:l.jsx("div",{className:"absolute inset-0",style:{backgroundImage:'url("https://images.unsplash.com/photo-1611348586804-61bf6c080437?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&h=1080")',backgroundSize:"cover",backgroundPosition:"center"}})}),l.jsx("div",{className:"container mx-auto px-4 relative z-10",children:l.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5] mb-6",children:["JOIN THE ",l.jsx("span",{className:"text-[#FB3939]",children:"COMMUNITY"})]}),l.jsx("p",{className:"text-[#E0E0E0] mb-8",children:"Get exclusive updates on new artists, special features, and early access to premium content."}),l.jsxs("form",{onSubmit:s,className:"bg-[#2D2D2D] p-6 md:p-8 rounded-2xl",children:[l.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[l.jsx(Sn,{type:"email",placeholder:"Your email address",className:"flex-1 bg-[#121212] border-[#3D3D3D] text-[#F5F5F5] rounded-full px-6 py-3 focus:border-[#FB3939]",value:n,onChange:o=>e(o.target.value),disabled:t}),l.jsx(it,{type:"submit",className:"bg-[#FB3939] hover:bg-opacity-90 text-white rounded-full px-8 py-3 font-medium transition",disabled:t,children:t?"Subscribing...":"Subscribe"})]}),l.jsx("p",{className:"text-xs text-[#A0A0A0] mt-4",children:"By subscribing, you agree to our privacy policy and consent to receive updates from our team."})]})]})})]})}const zQ="ShadyMusic - The Ultimate Eminem Influenced Artists Directory",VQ="Explore Eminem's impact on hip-hop and discover artists influenced by the legendary rapper.";function HQ(){document.title=zQ;const n=document.querySelector('meta[name="description"]');return n&&n.setAttribute("content",VQ),l.jsxs(l.Fragment,{children:[l.jsx(r7,{}),l.jsx(jQ,{}),l.jsx(UQ,{}),l.jsx(o7,{}),l.jsx(i7,{}),l.jsx(s7,{}),l.jsx(BQ,{})]})}const bR="https://shadymusic.com/";function WQ(){return l.jsxs("div",{className:"min-h-screen flex flex-col items-center px-5 pt-10 pb-15 text-white bg-cover bg-top bg-no-repeat bg-fixed",style:{fontFamily:"'Poppins', Arial, Helvetica, sans-serif",backgroundImage:"url('/desert-bg.jpg')",backgroundColor:"#1c4f8e"},children:[l.jsx("a",{href:"/",className:"mb-6",children:l.jsx("img",{src:"/logo.png",alt:"Shady Music",className:"w-28 sm:w-[140px] h-auto"})}),l.jsx("h1",{className:"font-extrabold leading-tight text-center max-w-[900px] mb-7 text-[clamp(2.2rem,6vw,4.5rem)]",style:{fontFamily:"'Sen', 'Poppins', sans-serif",textShadow:"0 2px 8px rgba(0,0,0,0.25)"},children:"We're Launching Our New Site Soon"}),l.jsx("p",{className:"text-[1.05rem] font-medium text-center mb-5",style:{textShadow:"0 0 6px rgba(0,0,0,0.65), 0 1px 2px rgba(0,0,0,0.85)"},children:"Sign up to be the first to know when we go live:"}),l.jsx("iframe",{title:"Subscribe to Shady Music",src:"https://sendiio.com/form/11488/render",className:"w-full max-w-[480px] mb-3 border-0 rounded-md bg-transparent",style:{height:"450px"}}),l.jsxs("p",{className:"max-w-[640px] px-[22px] py-[18px] bg-white/[0.18] rounded-md text-[0.95rem] leading-[1.55] text-center text-slate-900 mb-7",style:{backdropFilter:"blur(2px)"},children:["This site is not affiliated with Eminem or Shady Records, but we have mad respect for Slim Shady and his record label. This site will be a music sanctuary for Shady fans and all music lovers. The plan is to bring all genres of music together in one location that have been influenced by Eminem throughout his career. One artist that was influenced by him is Ed Sheeran, the English pop singer. See their collaboration"," ",l.jsx("a",{href:"https://youtu.be/wfWIs2gFTAM",target:"_blank",rel:"noopener noreferrer",className:"text-slate-900 underline font-semibold",children:"here"}),"."]}),l.jsxs("div",{className:"flex gap-2.5 flex-wrap justify-center",children:[l.jsxs("a",{href:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(bR)}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-[22px] py-2.5 rounded text-[0.85rem] font-bold tracking-[0.05em] uppercase text-white no-underline bg-[#3B5998] hover:opacity-90 transition-opacity",children:[l.jsx("svg",{viewBox:"0 0 264 512",className:"w-3.5 h-3.5 fill-current",children:l.jsx("path",{d:"M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"})}),"Share"]}),l.jsxs("a",{href:`https://twitter.com/intent/tweet?url=${encodeURIComponent(bR)}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-[22px] py-2.5 rounded text-[0.85rem] font-bold tracking-[0.05em] uppercase text-white no-underline bg-[#1DA1F2] hover:opacity-90 transition-opacity",children:[l.jsx("svg",{viewBox:"0 0 512 512",className:"w-3.5 h-3.5 fill-current",children:l.jsx("path",{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})}),"Tweet"]})]})]})}function SR(){return l.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center px-5 py-10 text-white bg-cover bg-top bg-no-repeat bg-fixed",style:{fontFamily:"'Poppins', Arial, Helvetica, sans-serif",backgroundImage:"url('/desert-bg.jpg')",backgroundColor:"#1c4f8e"},children:[l.jsx("a",{href:"/",className:"mb-6",children:l.jsx("img",{src:"/logo.png",alt:"Shady Music",className:"w-28 sm:w-[140px] h-auto"})}),l.jsx("h1",{className:"font-extrabold leading-tight text-center max-w-[900px] mb-5 text-[clamp(2rem,5.5vw,4rem)]",style:{fontFamily:"'Sen', 'Poppins', sans-serif",textShadow:"0 2px 8px rgba(0,0,0,0.25)"},children:"You're On the List"}),l.jsx("p",{className:"text-[1.1rem] font-medium text-center max-w-[560px] mb-8",style:{textShadow:"0 0 6px rgba(0,0,0,0.65), 0 1px 2px rgba(0,0,0,0.85)"},children:"Thanks for signing up. We'll let you know the moment we go live."}),l.jsx("a",{href:"/",className:"inline-flex items-center px-[26px] py-3 rounded text-[0.85rem] font-bold tracking-[0.05em] uppercase text-white no-underline bg-[#1E72D8] hover:bg-[#1860B8] transition-colors",children:"Back to Home"})]})}function ER(){return l.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center px-5 py-10 text-white bg-cover bg-top bg-no-repeat bg-fixed",style:{fontFamily:"'Poppins', Arial, Helvetica, sans-serif",backgroundImage:"url('/desert-bg.jpg')",backgroundColor:"#1c4f8e"},children:[l.jsx("a",{href:"/",className:"mb-6",children:l.jsx("img",{src:"/logo.png",alt:"Shady Music",className:"w-28 sm:w-[140px] h-auto"})}),l.jsx("h1",{className:"font-extrabold leading-tight text-center max-w-[900px] mb-5 text-[clamp(2rem,5.5vw,4rem)]",style:{fontFamily:"'Sen', 'Poppins', sans-serif",textShadow:"0 2px 8px rgba(0,0,0,0.25)"},children:"You're Already In"}),l.jsx("p",{className:"text-[1.1rem] font-medium text-center max-w-[560px] mb-8",style:{textShadow:"0 0 6px rgba(0,0,0,0.65), 0 1px 2px rgba(0,0,0,0.85)"},children:"Looks like you've already signed up. Sit tight â we'll be in touch the moment we lau
4173nch."}),l.jsx("a",{href:"/",className:"inline-flex items-center px-[26px] py-3 rounded text-[0.85rem] font-bold tracking-[0.05em] uppercase text-white no-underline bg-[#1E72D8] hover:bg-[#1860B8] transition-colors",children:"Back to Home"})]})}function MR(n,[e,t]){return Math.min(t,Math.max(e,n))}var GQ=T.createContext(void 0);function DM(n){const e=T.useContext(GQ);return n||e||"ltr"}var db=0;function y5(){T.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??AR()),document.body.insertAdjacentElement("beforeend",n[1]??AR()),db++,()=>{db===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),db--}},[])}function AR(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var hb="focusScope.autoFocusOnMount",fb="focusScope.autoFocusOnUnmount",TR={bubbles:!1,cancelable:!0},$Q="FocusScope",kM=T.forwardRef((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=n,[a,c]=T.useState(null),u=zi(i),f=zi(s),p=T.useRef(null),m=Tn(e,_=>c(_)),x=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(r){let _=function(S){if(x.paused||!a)return;const M=S.target;a.contains(M)?p.current=M:tl(p.current,{select:!0})},y=function(S){if(x.paused||!a)return;const M=S.relatedTarget;M!==null&&(a.contains(M)||tl(p.current,{select:!0}))},g=function(S){if(document.activeElement===document.body)for(const A of S)A.removedNodes.length>0&&tl(a)};document.addEventListener("focusin",_),document.addEventListener("focusout",y);const b=new MutationObserver(g);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,x.paused]),T.useEffect(()=>{if(a){NR.add(x);const _=document.activeElement;if(!a.contains(_)){const g=new CustomEvent(hb,TR);a.addEventListener(hb,u),a.dispatchEvent(g),g.defaultPrevented||(XQ(QQ(_5(a)),{select:!0}),document.activeElement===_&&tl(a))}return()=>{a.removeEventListener(hb,u),setTimeout(()=>{const g=new CustomEvent(fb,TR);a.addEventListener(fb,f),a.dispatchEvent(g),g.defaultPrevented||tl(_??document.body,{select:!0}),a.removeEventListener(fb,f),NR.remove(x)},0)}}},[a,u,f,x]);const v=T.useCallback(_=>{if(!t&&!r||x.paused)return;const y=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,g=document.activeElement;if(y&&g){const b=_.currentTarget,[S,M]=qQ(b);S&&M?!_.shiftKey&&g===M?(_.preventDefault(),t&&tl(S,{select:!0})):_.shiftKey&&g===S&&(_.preventDefault(),t&&tl(M,{select:!0})):g===b&&_.preventDefault()}},[t,r,x.paused]);return l.jsx(Dt.div,{tabIndex:-1,...o,ref:m,onKeyDown:v})});kM.displayName=$Q;function XQ(n,{select:e=!1}={}){const t=document.activeElement;for(const r of n)if(tl(r,{select:e}),document.activeElement!==t)return}function qQ(n){const e=_5(n),t=CR(e,n),r=CR(e.reverse(),n);return[t,r]}function _5(n){const e=[],t=document.createTreeWalker(n,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(;t.nextNode();)e.push(t.currentNode);return e}function CR(n,e){for(const t of n)if(!YQ(t,{upTo:e}))return t}function YQ(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function KQ(n){return n instanceof HTMLInputElement&&"select"in n}function tl(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&KQ(n)&&e&&n.select()}}var NR=ZQ();function ZQ(){let n=[];return{add(e){const t=n[0];e!==t&&(t==null||t.pause()),n=RR(n,e),n.unshift(e)},remove(e){var t;n=RR(n,e),(t=n[0])==null||t.resume()}}}function RR(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}function QQ(n){return n.filter(e=>e.tagName!=="A")}function w5(n){const e=T.useRef({value:n,previous:n});return T.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var JQ=function(n){if(typeof document>"u")return null;var e=Array.isArray(n)?n[0]:n;return e.ownerDocument.body},id=new WeakMap,zx=new WeakMap,Vx={},pb=0,b5=function(n){return n&&(n.host||b5(n.parentNode))},eJ=function(n,e){return e.map(function(t){if(n.contains(t))return t;var r=b5(t);return r&&n.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",n,". Doing nothing"),null)}).filter(function(t){return!!t})},tJ=function(n,e,t,r){var i=eJ(e,Array.isArray(n)?n:[n]);Vx[t]||(Vx[t]=new WeakMap);var s=Vx[t],o=[],a=new Set,c=new Set(i),u=function(p){!p||a.has(p)||(a.add(p),u(p.parentNode))};
vendor: 6,421 bytes, lines 4173-4188
4173i.forEach(u);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(a.has(m))f(m);else try{var x=m.getAttribute(r),v=x!==null&&x!=="false",_=(id.get(m)||0)+1,y=(s.get(m)||0)+1;id.set(m,_),s.set(m,y),o.push(m),_===1&&v&&zx.set(m,!0),y===1&&m.setAttribute(t,"true"),v||m.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return f(e),a.clear(),pb++,function(){o.forEach(function(p){var m=id.get(p)-1,x=s.get(p)-1;id.set(p,m),s.set(p,x),m||(zx.has(p)||p.removeAttribute(r),zx.delete(p)),x||p.removeAttribute(t)}),pb--,pb||(id=new WeakMap,id=new WeakMap,zx=new WeakMap,Vx={})}},S5=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),i=JQ(n);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),tJ(r,i,t,"aria-hidden")):function(){return null}},Ao=function(){return Ao=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Ao.apply(this,arguments)};function E5(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function nJ(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}var f0="right-scroll-bar-position",p0="width-before-scroll-bar",rJ="with-scroll-bars-hidden",iJ="--removed-body-scroll-bar-size";function mb(n,e){return typeof n=="function"?n(e):n&&(n.current=e),n}function sJ(n,e){var t=T.useState(function(){return{value:n,callback:e,facade:{get current(){return t.value},set current(r){var i=t.value;i!==r&&(t.value=r,t.callback(r,i))}}}})[0];return t.callback=e,t.facade}var oJ=typeof window<"u"?T.useLayoutEffect:T.useEffect,PR=new WeakMap;function aJ(n,e){var t=sJ(null,function(r){return n.forEach(function(i){return mb(i,r)})});return oJ(function(){var r=PR.get(t);if(r){var i=new Set(r),s=new Set(n),o=t.current;i.forEach(function(a){s.has(a)||mb(a,null)}),s.forEach(function(a){i.has(a)||mb(a,o)})}PR.set(t,n)},[n]),t}function lJ(n){return n}function cJ(n,e){e===void 0&&(e=lJ);var t=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:n},useMedium:function(s){var o=e(s,r);return t.push(o),function(){t=t.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;t.length;){var o=t;t=[],o.forEach(s)}t={push:function(a){return s(a)},filter:function(){return t}}},assignMedium:function(s){r=!0;var o=[];if(t.length){var a=t;t=[],a.forEach(s),o=t}var c=function(){var f=o;o=[],f.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),t={push:function(f){o.push(f),u()},filter:function(f){return o=o.filter(f),t}}}};return i}function uJ(n){n===void 0&&(n={});var e=cJ(null);return e.options=Ao({async:!0,ssr:!1},n),e}var M5=function(n){var e=n.sideCar,t=E5(n,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return T.createElement(r,Ao({},t))};M5.isSideCarExport=!0;function dJ(n,e){return n.useMedium(e),M5}var A5=uJ(),gb=function(){},c1=T.forwardRef(function(n,e){var t=T.useRef(null),r=T.useState({onScrollCapture:gb,onWheelCapture:gb,onTouchMoveCapture:gb}),i=r[0],s=r[1],o=n.forwardProps,a=n.children,c=n.className,u=n.removeScrollBar,f=n.enabled,p=n.shards,m=n.sideCar,x=n.noIsolation,v=n.inert,_=n.allowPinchZoom,y=n.as,g=y===void 0?"div":y,b=n.gapMode,S=E5(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=m,A=aJ([t,e]),R=Ao(Ao({},S),i);return T.createElement(T.Fragment,null,f&&T.createElement(M,{sideCar:A5,removeScrollBar:u,shards:p,noIsolation:x,inert:v,setCallbacks:s,allowPinchZoom:!!_,lockRef:t,gapMode:b}),o?T.cloneElement(T.Children.only(a),Ao(Ao({},R),{ref:A})):T.createElement(g,Ao({},R,{className:c,ref:A}),a))});c1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};c1.classNames={fullWidth:p0,zeroRight:f0};var hJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fJ(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var e=hJ();return e&&n.setAttribute("nonce",e),n}function pJ(n,e){n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}function mJ(n){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(n)}var gJ=function(){var n=0,e=null;return{add:function(t){n==0&&(e=fJ())&&(pJ(e,t),mJ(e)),n++},remove:function(){n--,!n&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},xJ=function(){var n=gJ();return function(e,t){T.useEffect(function(){return n.add(e),function(){n.remove()}},[e&&t])}},T5=function(){var n=xJ(),e=function(t){var r=t.styles,i=t.dynamic;return n(r,i),null};return e},vJ={left:0,top:0,right:0,gap:0},xb=function(n){return parseInt(n||"",10)||0},yJ=function(n){var e=window.getComputedStyle(document.body),t=e[n==="padding"?"paddingLeft":"marginLeft"],r=e[n==="padding"?"paddingTop":"marginTop"],i=e[n==="padding"?"paddingRight":"marginRight"];return[xb(t),xb(r),xb(i)]},_J=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return vJ;var e=yJ(n),t=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-t+e[2]-e[0])}},wJ=T5(),Ud="data-scroll-locked",bJ=function(n,e,t,r){var i=n.left,s=n.top,o=n.right,a=n.gap;return t===void 0&&(t="margin"),` 4174 .`.concat(rJ,` { 4175 overflow: hidden `).concat(r,`; 4176 padding-right: `).concat(a,"px ").concat(r,`; 4177 } 4178 body[`).concat(Ud,`] { 4179 overflow: hidden `).concat(r,`; 4180 overscroll-behavior: contain; 4181 `).concat([e&&"position: relative ".concat(r,";"),t==="margin"&&` 4182 padding-left: `.concat(i,`px; 4183 padding-top: `).concat(s,`px; 4184 padding-right: `).concat(o,`px; 4185 margin-left:0; 4186 margin-top:0; 4187 margin-right: `).concat(a,"px ").concat(r,`; 4188 `),t==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";
4188")].filter(Boolean).join(""),` 4189 } 4190 4191 .`).concat(f0,` { 4192 right: `).concat(a,"px ").concat(r,`; 4193 } 4194 4195 .`).concat(p0,` { 4196 margin-right: `).concat(a,"px ").concat(r,`; 4197 } 4198 4199 .`).concat(f0," .").concat(f0,` { 4200 right: 0 `).concat(r,`; 4201 } 4202 4203 .`).concat(p0," .").concat(p0,` { 4204 margin-right: 0 `).concat(r,`; 4205 } 4206 4207 body[`).concat(Ud,`] { 4208 `).concat(iJ,": ").concat(a,`px; 4209 } 4210`)},IR=function(){var n=parseInt(document.body.getAttribute(Ud)||"0",10);return isFinite(n)?n:0},SJ=function(){T.useEffect(function(){return document.body.setAttribute(Ud,(IR()+1).toString()),function(){var n=IR()-1;n<=0?document.body.removeAttribute(Ud):document.body.setAttribute(Ud,n.toString())}},[])},EJ=function(n){var e=n.noRelative,t=n.noImportant,r=n.gapMode,i=r===void 0?"margin":r;SJ();var s=T.useMemo(function(){return _J(i)},[i]);return T.createElement(wJ,{styles:bJ(s,!e,i,t?"":"!important")})},a2=!1;if(typeof window<"u")try{var Hx=Object.defineProperty({},"passive",{get:function(){return a2=!0,!0}});window.addEventListener("test",Hx,Hx),window.removeEventListener("test",Hx,Hx)}catch{a2=!1}var sd=a2?{passive:!1}:!1,MJ=function(n){return n.tagName==="TEXTAREA"},C5=function(n,e){if(!(n instanceof Element))return!1;var t=window.getComputedStyle(n);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!MJ(n)&&t[e]==="visible")},AJ=function(n){return C5(n,"overflowY")},TJ=function(n){return C5(n,"overflowX")},FR=function(n,e){var t=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=N5(n,r);if(i){var s=R5(n,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==t.body);return!1},CJ=function(n){var e=n.scrollTop,t=n.scrollHeight,r=n.clientHeight;return[e,t,r]},NJ=function(n){var e=n.scrollLeft,t=n.scrollWidth,r=n.clientWidth;return[e,t,r]},N5=function(n,e){return n==="v"?AJ(e):TJ(e)},R5=function(n,e){return n==="v"?CJ(e):NJ(e)},RJ=function(n,e){return n==="h"&&e==="rtl"?-1:1},PJ=function(n,e,t,r,i){var s=RJ(n,window.getComputedStyle(e).direction),o=s*r,a=t.target,c=e.contains(a),u=!1,f=o>0,p=0,m=0;do{var x=R5(n,a),v=x[0],_=x[1],y=x[2],g=_-y-s*v;(v||g)&&N5(n,a)&&(p+=g,m+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(Math.abs(p)<1||!i)||!f&&(Math.abs(m)<1||!i))&&(u=!0),u},Wx=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},DR=function(n){return[n.deltaX,n.deltaY]},kR=function(n){return n&&"current"in n?n.current:n},IJ=function(n,e){return n[0]===e[0]&&n[1]===e[1]},FJ=function(n){return` 4211 .block-interactivity-`.concat(n,` {pointer-events: none;} 4212 .allow-interactivity-`).concat(n,` {pointer-events: all;} 4213`)},DJ=0,od=[];function kJ(n){var e=T.useRef([]),t=T.useRef([0,0]),r=T.useRef(),i=T.useState(DJ++)[0],s=T.useState(T5)[0],o=T.useRef(n);T.useEffect(function(){o.current=n},[n]),T.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var _=nJ([n.lockRef.current],(n.shards||[]).map(kR),!0).filter(Boolean);return _.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),_.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var a=T.useCallback(function(_,y){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var g=Wx(_),b=t.current,S="deltaX"in _?_.deltaX:b[0]-g[0],M="deltaY"in _?_.deltaY:b[1]-g[1],A,R=_.target,F=Math.abs(S)>Math.abs(M)?"h":"v";if("touches"in _&&F==="h"&&R.type==="range")return!1;var L=FR(F,R);if(!L)return!0;if(L?A=F:(A=F==="v"?"h":"v",L=FR(F,R)),!L)return!1;if(!r.current&&"changedTouches"in _&&(S||M)&&(r.current=A),!A)return!0;var N=r.current||A;return PJ(N,y,_,N==="h"?S:M,!0)},[]),c=T.useCallback(function(_){var y=_;if(!(!od.length||od[od.length-1]!==s)){var g="deltaY"in y?DR(y):Wx(y),b=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&IJ(A.delta,g)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}
vendor: 24,637 bytes, line 4213
4213if(!b){var S=(o.current.shards||[]).map(kR).filter(Boolean).filter(function(A){return A.contains(y.target)}),M=S.length>0?a(y,S[0]):!o.current.noIsolation;M&&y.cancelable&&y.preventDefault()}}},[]),u=T.useCallback(function(_,y,g,b){var S={name:_,delta:y,target:g,should:b,shadowParent:LJ(g)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(M){return M!==S})},1)},[]),f=T.useCallback(function(_){t.current=Wx(_),r.current=void 0},[]),p=T.useCallback(function(_){u(_.type,DR(_),_.target,a(_,n.lockRef.current))},[]),m=T.useCallback(function(_){u(_.type,Wx(_),_.target,a(_,n.lockRef.current))},[]);T.useEffect(function(){return od.push(s),n.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,sd),document.addEventListener("touchmove",c,sd),document.addEventListener("touchstart",f,sd),function(){od=od.filter(function(_){return _!==s}),document.removeEventListener("wheel",c,sd),document.removeEventListener("touchmove",c,sd),document.removeEventListener("touchstart",f,sd)}},[]);var x=n.removeScrollBar,v=n.inert;return T.createElement(T.Fragment,null,v?T.createElement(s,{styles:FJ(i)}):null,x?T.createElement(EJ,{gapMode:n.gapMode}):null)}function LJ(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const jJ=dJ(A5,kJ);var LM=T.forwardRef(function(n,e){return T.createElement(c1,Ao({},n,{ref:e,sideCar:jJ}))});LM.classNames=c1.classNames;var OJ=[" ","Enter","ArrowUp","ArrowDown"],UJ=[" ","Enter"],Em="Select",[u1,d1,BJ]=CE(Em),[zh,uie]=Uo(Em,[BJ,Sy]),h1=Sy(),[zJ,Kl]=zh(Em),[VJ,HJ]=zh(Em),P5=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:u,name:f,autoComplete:p,disabled:m,required:x,form:v}=n,_=h1(e),[y,g]=T.useState(null),[b,S]=T.useState(null),[M,A]=T.useState(!1),R=DM(u),[F=!1,L]=Dl({prop:r,defaultProp:i,onChange:s}),[N,I]=Dl({prop:o,defaultProp:a,onChange:c}),D=T.useRef(null),O=y?v||!!y.closest("form"):!0,[U,V]=T.useState(new Set),Z=Array.from(U).map(Y=>Y.props.value).join(";");return l.jsx(CD,{..._,children:l.jsxs(zJ,{required:x,scope:e,trigger:y,onTriggerChange:g,valueNode:b,onValueNodeChange:S,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:xa(),value:N,onValueChange:I,open:F,onOpenChange:L,dir:R,triggerPointerDownPosRef:D,disabled:m,children:[l.jsx(u1.Provider,{scope:e,children:l.jsx(VJ,{scope:n.__scopeSelect,onNativeOptionAdd:T.useCallback(Y=>{V(ne=>new Set(ne).add(Y))},[]),onNativeOptionRemove:T.useCallback(Y=>{V(ne=>{const j=new Set(ne);return j.delete(Y),j})},[]),children:t})}),O?l.jsxs(rj,{"aria-hidden":!0,required:x,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:Y=>I(Y.target.value),disabled:m,form:v,children:[N===void 0?l.jsx("option",{value:""}):null,Array.from(U)]},Z):null]})})};P5.displayName=Em;var I5="SelectTrigger",F5=T.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...i}=n,s=h1(t),o=Kl(I5,t),a=o.disabled||r,c=Tn(e,o.onTriggerChange),u=d1(t),f=T.useRef("touch"),[p,m,x]=ij(_=>{const y=u().filter(S=>!S.disabled),g=y.find(S=>S.value===o.value),b=sj(y,_,g);b!==void 0&&o.onValueChange(b.value)}),v=_=>{a||(o.onOpenChange(!0),x()),_&&(o.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return l.jsx(ND,{asChild:!0,...s,children:l.jsx(Dt.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":nj(o.value)?"":void 0,...i,ref:c,onClick:At(i.onClick,_=>{_.currentTarget.focus(),f.current!=="mouse"&&v(_)}),onPointerDown:At(i.onPointerDown,_=>{f.current=_.pointerType;const y=_.target;y.hasPointerCapture(_.pointerId)&&y.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(v(_),_.preventDefault())}),onKeyDown:At(i.onKeyDown,_=>{const y=p.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&m(_.key),!(y&&_.key===" ")&&OJ.includes(_.key)&&(v(),_.preventDefault())})})})});F5.displayName=I5;var D5="SelectValue",k5=T.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,children:s,placeholder:o="",...a}=n,c=Kl(D5,t),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,p=Tn(e,c.onValueNodeChange);return ni(()=>{u(f)},[u,f]),l.jsx(Dt.span,{...a,ref:p,style:{pointerEvents:"none"},children:nj(c.value)?l.jsx(l.Fragment,{children:o}):s})});k5.displayName=D5;var WJ="SelectIcon",L5=T.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...i}=n;return l.jsx(Dt.span,{"aria-hidden":!0,...i,ref:e,children:r||"â¼"})});L5.displayName=WJ;var GJ="SelectPortal",j5=n=>l.jsx(my,{asChild:!0,...n});j5.displayName=GJ;var uu="SelectContent",O5=T.forwardRef((n,e)=>{const t=Kl(uu,n.__scopeSelect),[r,i]=T.useState();if(ni(()=>{i(new DocumentFragment)},[]),!t.open){const s=r;return s?xu.createPortal(l.jsx(U5,{scope:n.__scopeSelect,children:l.jsx(u1.Slot,{scope:n.__scopeSelect,children:l.jsx("div",{children:n.children})})}),s):null}return l.jsx(B5,{...n,ref:e})});O5.displayName=uu;var Hs=10,[U5,Zl]=zh(uu),$J="SelectContentImpl",XJ=uh("SelectContent.RemoveScroll"),B5=T.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:x,sticky:v,hideWhenDetached:_,avoidCollisions:y,...g}=n,b=Kl(uu,t),[S,M]=T.useState(null),[A,R]=T.useState(null),F=Tn(e,pe=>M(pe)),[L,N]=T.useState(null),[I,D]=T.useState(null),O=d1(t),[U,V]=T.useState(!1),Z=T.useRef(!1);T.useEffect(()=>{if(S)return S5(S)},[S]),y5();const Y=T.useCallback(pe=>{const[je,...nt]=O().map(He=>He.ref.current),[Pe]=nt.slice(-1),Ie=document.activeElement;for(const He of pe)if(He===Ie||(He==null||He.scrollIntoView({block:"nearest"}),He===je&&A&&(A.scrollTop=0),He===Pe&&A&&(A.scrollTop=A.scrollHeight),He==null||He.focus(),document.activeElement!==Ie))return},[O,A]),ne=T.useCallback(()=>Y([L,S]),[Y,L,S]);T.useEffect(()=>{U&&ne()},[U,ne]);const{onOpenChange:j,triggerPointerDownPosRef:$}=b;T.useEffect(()=>{if(S){let pe={x:0,y:0};const je=Pe=>{var Ie,He;pe={x:Math.abs(Math.round(Pe.pageX)-(((Ie=$.current)==null?void 0:Ie.x)??0)),y:Math.abs(Math.round(Pe.pageY)-(((He=$.current)==null?void 0:He.y)??0))}},nt=Pe=>{pe.x<=10&&pe.y<=10?Pe.preventDefault():S.contains(Pe.target)||j(!1),document.removeEventListener("pointermove",je),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",je),document.addEventListener("pointerup",nt,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",je),document.removeEventListener("pointerup",nt,{capture:!0})}}},[S,j,$]),T.useEffect(()=>{const pe=()=>j(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[j]);const[K,re]=ij(pe=>{const je=O().filter(Ie=>!Ie.disabled),nt=je.find(Ie=>Ie.ref.current===document.activeElement),Pe=sj(je,pe,nt);Pe&&setTimeout(()=>Pe.ref.current.focus())}),xe=T.useCallback((pe,je,nt)=>{const Pe=!Z.current&&!nt;(b.value!==void 0&&b.value===je||Pe)&&(N(pe),Pe&&(Z.current=!0))},[b.value]),Ce=T.useCallback(()=>S==null?void 0:S.focus(),[S]),ce=T.useCallback((pe,je,nt)=>{const Pe=!Z.current&&!nt;(b.value!==void 0&&b.value===je||Pe)&&D(pe)},[b.value]),_e=r==="popper"?l2:z5,Re=_e===l2?{side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:x,sticky:v,hideWhenDetached:_,avoidCollisions:y}:{};return l.jsx(U5,{scope:t,content:S,viewport:A,onViewportChange:R,itemRefCallback:xe,selectedItem:L,onItemLeave:Ce,itemTextRefCallback:ce,focusSelectedItem:ne,selectedItemText:I,position:r,isPositioned:U,searchRef:K,children:l.jsx(LM,{as:XJ,allowPinchZoom:!0,children:l.jsx(kM,{asChild:!0,trapped:b.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:At(i,pe=>{var je;(je=b.trigger)==null||je.focus({preventScroll:!0}),pe.preventDefault()}),children:l.jsx(lm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(_e,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:pe=>pe.preventDefault(),...g,...Re,onPlaced:()=>V(!0),ref:F,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:At(g.onKeyDown,pe=>{const je=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!je&&pe.key.length===1&&re(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let Pe=O().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(Pe=Pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const Ie=pe.target,He=Pe.indexOf(Ie);Pe=Pe.slice(He+1)}setTimeout(()=>Y(Pe)),pe.preventDefault()}})})})})})})});B5.displayName=$J;var qJ="SelectItemAlignedPosition",z5=T.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...i}=n,s=Kl(uu,t),o=Zl(uu,t),[a,c]=T.useState(null),[u,f]=T.useState(null),p=Tn(e,F=>f(F)),m=d1(t),x=T.useRef(!1),v=T.useRef(!0),{viewport:_,selectedItem:y,selectedItemText:g,focusSelectedItem:b}=o,S=T.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&_&&y&&g){const F=s.trigger.getBoundingClientRect(),L=u.getBoundingClientRect(),N=s.valueNode.getBoundingClientRect(),I=g.getBoundingClientRect();if(s.dir!=="rtl"){const Ie=I.left-L.left,He=N.left-Ie,ze=F.left-He,H=F.width+ze,Fe=Math.max(H,L.width),Ae=window.innerWidth-Hs,Te=MR(He,[Hs,Math.max(Hs,Ae-Fe)]);a.style.minWidth=H+"px",a.style.left=Te+"px"}else{const Ie=L.right-I.right,He=window.innerWidth-N.right-Ie,ze=window.innerWidth-F.right-He,H=F.width+ze,Fe=Math.max(H,L.width),Ae=window.innerWidth-Hs,Te=MR(He,[Hs,Math.max(Hs,Ae-Fe)]);a.style.minWidth=H+"px",a.style.right=Te+"px"}const D=m(),O=window.innerHeight-Hs*2,U=_.scrollHeight,V=window.getComputedStyle(u),Z=parseInt(V.borderTopWidth,10),Y=parseInt(V.paddingTop,10),ne=parseInt(V.borderBottomWidth,10),j=parseInt(V.paddingBottom,10),$=Z+Y+U+j+ne,K=Math.min(y.offsetHeight*5,$),re=window.getComputedStyle(_),xe=parseInt(re.paddingTop,10),Ce=parseInt(re.paddingBottom,10),ce=F.top+F.height/2-Hs,_e=O-ce,Re=y.offsetHeight/2,pe=y.offsetTop+Re,je=Z+Y+pe,nt=$-je;if(je<=ce){const Ie=D.length>0&&y===D[D.length-1].ref.current;a.style.bottom="0px";const He=u.clientHeight-_.offsetTop-_.offsetHeight,ze=Math.max(_e,Re+(Ie?Ce:0)+He+ne),H=je+ze;a.style.height=H+"px"}else{const Ie=D.length>0&&y===D[0].ref.current;a.style.top="0px";const ze=Math.max(ce,Z+_.offsetTop+(Ie?xe:0)+Re)+nt;a.style.height=ze+"px",_.scrollTop=je-ce+_.offsetTop}a.style.margin=`${Hs}px 0`,a.style.minHeight=K+"px",a.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[m,s.trigger,s.valueNode,a,u,_,y,g,s.dir,r]);ni(()=>S(),[S]);const[M,A]=T.useState();ni(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const R=T.useCallback(F=>{F&&v.current===!0&&(S(),b==null||b(),v.current=!1)},[S,b]);return l.jsx(KJ,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:x,onScrollButtonChange:R,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:l.jsx(Dt.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});z5.displayName=qJ;var YJ="SelectPopperPosition",l2=T.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:i=Hs,...s}=n,o=h1(t);return l.jsx(RD,{...o,...s,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})});l2.displayName=YJ;var[KJ,jM]=zh(uu,{}),c2="SelectViewport",V5=T.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:r,...i}=n,s=Zl(c2,t),o=jM(c2,t),a=Tn(e,s.onViewportChange),c=T.useRef(0);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(u1.Slot,{scope:t,children:l.jsx(Dt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:At(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&p){const x=Math.abs(c.current-f.scrollTop);if(x>0){const v=window.innerHeight-Hs*2,_=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),g=Math.max(_,y);if(g<v){const b=g+x,S=Math.min(v,b),M=b-S;p.style.height=S+"px",p.style.bottom==="0px"&&(f.scrollTop=M>0?M:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});V5.displayName=c2;var H5="SelectGroup",[ZJ,QJ]=zh(H5),W5=T.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=xa();return l.jsx(ZJ,{scope:t,id:i,children:l.jsx(Dt.div,{role:"group","aria-labelledby":i,...r,ref:e})})});W5.displayName=H5;var G5="SelectLabel",$5=T.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=QJ(G5,t);return l.jsx(Dt.div,{id:i.id,...r,ref:e})});$5.displayName=G5;var Uv="SelectItem",[JJ,X5]=zh(Uv),q5=T.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:i=!1,textValue:s,...o}=n,a=Kl(Uv,t),c=Zl(Uv,t),u=a.value===r,[f,p]=T.useState(s??""),[m,x]=T.useState(!1),v=Tn(e,b=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,b,r,i)}),_=xa(),y=T.useRef("touch"),g=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> 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 l.jsx(JJ,{scope:t,value:r,disabled:i,textId:_,isSelected:u,onItemTextChange:T.useCallback(b=>{p(S=>S||((b==null?void 0:b.textContent)??"").trim())},[]),children:l.jsx(u1.ItemSlot,{scope:t,value:r,disabled:i,textValue:f,children:l.jsx(Dt.div,{role:"option","aria-labelledby":_,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:v,onFocus:At(o.onFocus,()=>x(!0)),onBlur:At(o.onBlur,()=>x(!1)),onClick:At(o.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:At(o.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:At(o.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:At(o.onPointerMove,b=>{var S;y.current=b.pointerType,i?(S=c.onItemLeave)==null||S.call(c):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:At(o.onPointerLeave,b=>{var S;b.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:At(o.onKeyDown,b=>{var M;((M=c.searchRef)==null?void 0:M.current)!==""&&b.key===" "||(UJ.includes(b.key)&&g(),b.key===" "&&b.preventDefault())})})})})});q5.displayName=Uv;var Hf="SelectItemText",Y5=T.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,...s}=n,o=Kl(Hf,t),a=Zl(Hf,t),c=X5(Hf,t),u=HJ(Hf,t),[f,p]=T.useState(null),m=Tn(e,g=>p(g),c.onItemTextChange,g=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,g,c.value,c.disabled)}),x=f==null?void 0:f.textContent,v=T.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:_,onNativeOptionRemove:y}=u;return ni(()=>(_(v),()=>y(v)),[_,y,v]),l.jsxs(l.Fragment,{children:[l.jsx(Dt.span,{id:c.textId,...s,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?xu.createPortal(s.children,o.valueNode):null]})});Y5.displayName=Hf;var K5="SelectItemIndicator",Z5=T.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return X5(K5,t).isSelected?l.jsx(Dt.span,{"aria-hidden":!0,...r,ref:e}):null});Z5.displayName=K5;var u2="SelectScrollUpButton",Q5=T.forwardRef((n,e)=>{const t=Zl(u2,n.__scopeSelect),r=jM(u2,n.__scopeSelect),[i,s]=T.useState(!1),o=Tn(e,r.onScrollButtonChange);return ni(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=c.scrollTop>0;s(u)};const c=t.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),i?l.jsx(ej,{...n,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=t;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Q5.displayName=u2;var d2="SelectScrollDownButton",J5=T.forwardRef((n,e)=>{const t=Zl(d2,n.__scopeSelect),r=jM(d2,n.__scopeSelect),[i,s]=T.useState(!1),o=Tn(e,r.onScrollButtonChange);return ni(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;s(f)};const c=t.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),i?l.jsx(ej,{...n,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=t;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});J5.displayName=d2;var ej=T.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:r,...i}=n,s=Zl("SelectScrollButton",t),o=T.useRef(null),a=d1(t),c=T.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return T.useEffect(()=>()=>c(),[c]),ni(()=>{var f;const u=a().find(p=>p.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),l.jsx(Dt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:At(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:At(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:At(i.onPointerLeave,()=>{c()})})}),eee="SelectSeparator",tj=T.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return l.jsx(Dt.div,{"aria-hidden":!0,...r,ref:e})});tj.displayName=eee;var h2="SelectArrow",tee=T.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=h1(t),s=Kl(h2,t),o=Zl(h2,t);return s.open&&o.position==="popper"?l.jsx(PD,{...i,...r,ref:e}):null});tee.displayName=h2;function nj(n){return n===""||n===void 0}var rj=T.forwardRef((n,e)=>{const{value:t,...r}=n,i=T.useRef(null),s=Tn(e,i),o=w5(t);return T.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&f){const p=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(p)}},[o,t]),l.jsx(cm,{asChild:!0,children:l.jsx("select",{...r,ref:s,defaultValue:t})})});rj.displayName="BubbleSelect";function ij(n){const e=zi(n),t=T.useRef(""),r=T.useRef(0),i=T.useCallback(o=>{const a=t.current+o;e(a),function c(u){t.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=T.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return T.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,i,s]}function sj(n,e,t){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let o=nee(n,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==t));const c=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==t?c:void 0}function nee(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var ree=P5,oj=F5,iee=k5,see=L5,oee=j5,aj=O5,aee=V5,lee=W5,lj=$5,cj=q5,cee=Y5,uee=Z5,uj=Q5,dj=J5,hj=tj;const OM=ree,dee=lee,UM=iee,f1=T.forwardRef(({className:n,children:e,...t},r)=>l.jsxs(oj,{ref:r,className:Ct("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 data-[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",n),...t,children:[e,l.jsx(see,{asChild:!0,children:l.jsx($F,{className:"h-4 w-4 opacity-50"})})]}));f1.displayName=oj.displayName;const fj=T.forwardRef(({className:n,...e},t)=>l.jsx(uj,{ref:t,className:Ct("flex cursor-default items-center justify-center py-1",n),...e,children:l.jsx(d8,{className:"h-4 w-4"})}));fj.displayName=uj.displayName;const pj=T.forwardRef(({className:n,...e},t)=>l.jsx(dj,{ref:t,className:Ct("flex cursor-default items-center justify-center py-1",n),...e,children:l.jsx($F,{className:"h-4 w-4"})}));pj.displayName=dj.displayName;const p1=T.forwardRef(({className:n,children:e,position:t="popper",...r},i)=>l.jsx(oee,{children:l.jsxs(aj,{ref:i,className:Ct("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-select-content-transform-origin]",t==="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",n),position:t,...r,children:[l.jsx(fj,{}),l.jsx(aee,{className:Ct("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(pj,{})]})}));p1.displayName=aj.displayName;const mj=T.forwardRef(({className:n,...e},t)=>l.jsx(lj,{ref:t,className:Ct("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...e}));mj.displayName=lj.displayName;const wl=T.forwardRef(({className:n,children:e,...t},r)=>l.jsxs(cj,{ref:r,className:Ct("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",n),...t,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(uee,{children:l.jsx(GF,{className:"h-4 w-4"})})}),l.jsx(cee,{children:e})]}));wl.displayName=cj.displayName;const hee=T.forwardRef(({className:n,...e},t)=>l.jsx(hj,{ref:t,className:Ct("-mx-1 my-1 h-px bg-muted",n),...e}));hee.displayName=hj.displayName;var fee="Label",gj=T.forwardRef((n,e)=>l.jsx(Dt.label,{...n,ref:e,onMouseDown:t=>{var i;t.target.closest("button, input, select, textarea")||((i=n.onMouseDown)==null||i.call(n,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));gj.displayName=fee;var xj=gj;const pee=vy("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),kn=T.forwardRef(({className:n,...e},t)=>l.jsx(xj,{ref:t,className:Ct(pee(),n),...e}));kn.displayName=xj.displayName;var BM="Checkbox",[mee,die]=Uo(BM),[gee,xee]=mee(BM),vj=T.forwardRef((n,e)=>{const{__scopeCheckbox:t,name:r,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:u,form:f,...p}=n,[m,x]=T.useState(null),v=Tn(e,M=>x(M)),_=T.useRef(!1),y=m?f||!!m.closest("form"):!0,[g=!1,b]=Dl({prop:i,defaultProp:s,onChange:u}),S=T.useRef(g);return T.useEffect(()=>{const M=m==null?void 0:m.form;if(M){const A=()=>b(S.current);return M.addEventListener("reset",A),()=>M.removeEventListener("reset",A)}},[m,b]),l.jsxs(gee,{scope:t,state:g,disabled:a,children:[l.jsx(Dt.button,{type:"button",role:"checkbox","aria-checked":Rl(g)?"mixed":g,"aria-required":o,"data-state":wj(g),"data-disabled":a?"":void 0,disabled:a,value:c,...p,ref:v,onKeyDown:At(n.onKeyDown,M=>{M.key==="Enter"&&M.preventDefault()}),onClick:At(n.onClick,M=>{b(A=>Rl(A)?!0:!A),y&&(_.current=M.isPropagationStopped(),_.current||M.stopPropagation())})}),y&&l.jsx(vee,{control:m,bubbles:!_.current,name:r,value:c,checked:g,required:o,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Rl(s)?!1:s})]})});vj.displayName=BM;var yj="CheckboxIndicator",_j=T.forwardRef((n,e)=>{const{__scopeCheckbox:t,forceMount:r,...i}=n,s=xee(yj,t);return l.jsx(Gl,{present:r||Rl(s.state)||s.state===!0,children:l.jsx(Dt.span,{"data-state":wj(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...n.style}})})});_j.displayName=yj;var vee=n=>{const{control:e,checked:t,bubbles:r=!0,defaultChecked:i,...s}=n,o=T.useRef(null),a=w5(t),c=vD(e);T.useEffect(()=>{const f=o.current,p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(a!==t&&x){const v=new Event("click",{bubbles:r});
4213f.indeterminate=Rl(t),x.call(f,Rl(t)?!1:t),f.dispatchEvent(v)}},[a,t,r]);const u=T.useRef(Rl(t)?!1:t);return l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??u.current,...s,tabIndex:-1,ref:o,style:{...n.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Rl(n){return n==="indeterminate"}function wj(n){return Rl(n)?"indeterminate":n?"checked":"unchecked"}var bj=vj,yee=_j;const Bd=T.forwardRef(({className:n,...e},t)=>l.jsx(bj,{ref:t,className:Ct("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",n),...e,children:l.jsx(yee,{className:Ct("flex items-center justify-center text-current"),children:l.jsx(GF,{className:"h-4 w-4"})})}));Bd.displayName=bj.displayName;function _ee({onFilterChange:n,initialFilters:e={}}){const[t,r]=T.useState(e.search||""),[i,s]=T.useState(e.genres||[]),[o,a]=T.useState(e.eras||[]),[c,u]=T.useState(e.influenceLevelId),{data:f=[]}=Nt({queryKey:["/api/genres"]}),{data:p=[]}=Nt({queryKey:["/api/eras"]}),{data:m=WH}=Nt({queryKey:["/api/influence-levels"]}),x=()=>{const g={};t&&(g.search=t),i.length>0&&(g.genres=i),o.length>0&&(g.eras=o),c&&(g.influenceLevelId=c),n(g)},v=g=>{s(b=>b.includes(g)?b.filter(S=>S!==g):[...b,g])},_=g=>{a(b=>b.includes(g)?b.filter(S=>S!==g):[...b,g])},y=()=>{r(""),s([]),a([]),u(void 0),n({})};return l.jsx(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D] mb-8",children:l.jsxs(tr,{className:"pt-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[l.jsxs("div",{children:[l.jsx(kn,{className:"block text-[#A0A0A0] text-sm mb-2",children:"Search"}),l.jsx(Sn,{type:"text",placeholder:"Artist name...",className:"w-full bg-[#121212] border-[#3D3D3D] text-[#F5F5F5] rounded-lg px-4 py-2 focus:border-[#FB3939]",value:t,onChange:g=>r(g.target.value)})]}),l.jsxs("div",{children:[l.jsx(kn,{className:"block text-[#A0A0A0] text-sm mb-2",children:"Genre"}),l.jsx("div",{className:"bg-[#121212] border border-[#3D3D3D] rounded-lg p-3 max-h-40 overflow-y-auto",children:f.map(g=>l.jsxs("div",{className:"flex items-center mb-2 last:mb-0",children:[l.jsx(Bd,{id:`genre-${g.id}`,checked:i.includes(g.id),onCheckedChange:()=>v(g.id),className:"text-[#FB3939] border-[#3D3D3D]"}),l.jsx("label",{htmlFor:`genre-${g.id}`,className:"ml-2 text-sm text-[#E0E0E0] cursor-pointer",children:g.name})]},g.id))})]}),l.jsxs("div",{children:[l.jsx(kn,{className:"block text-[#A0A0A0] text-sm mb-2",children:"Era"}),l.jsx("div",{className:"bg-[#121212] border border-[#3D3D3D] rounded-lg p-3 max-h-40 overflow-y-auto",children:p.map(g=>l.jsxs("div",{className:"flex items-center mb-2 last:mb-0",children:[l.jsx(Bd,{id:`era-${g.id}`,checked:o.includes(g.id),onCheckedChange:()=>_(g.id),className:"text-[#FB3939] border-[#3D3D3D]"}),l.jsx("label",{htmlFor:`era-${g.id}`,className:"ml-2 text-sm text-[#E0E0E0] cursor-pointer",children:g.name})]},g.id))})]}),l.jsxs("div",{children:[l.jsx(kn,{className:"block text-[#A0A0A0] text-sm mb-2",children:"Influence Level"}),l.jsxs(OM,{value:c==null?void 0:c.toString(),onValueChange:g=>u(g?parseInt(g):void 0),children:[l.jsx(f1,{className:"w-full bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",children:l.jsx(UM,{placeholder:"All Levels"})}),l.jsxs(p1,{className:"bg-[#1E1E1E] border-[#3D3D3D] text-[#F5F5F5]",children:[l.jsx(wl,{value:"0",children:"All Levels"}),m.map(g=>l.jsx(wl,{value:g.id.toString(),children:g.name},g.id))]})]})]})]}),l.jsxs("div",{className:"flex justify-end mt-4 gap-2",children:[l.jsx(it,{variant:"outline",className:"border-[#3D3D3D] text-[#E0E0E0] hover:bg-[#2D2D2D]",onClick:y,children:"Reset"}),l.jsx(it,{className:"bg-[#3A86FF] hover:bg-opacity-90",onClick:x,children:"Apply Filters"})]})]})})}function wee({initialFilters:n={}}){const[e,t]=T.useState(1),[r,i]=T.useState("list"),[s,o]=T.useState(n);T.useEffect(()=>{t(1)},[s]);const{data:a,isLoading:c,error:u}=Nt({queryKey:["/api/artists/filter",{page:e,limit:10,...s}],queryFn:async()=>{const v=new URLSearchParams({page:e.toString(),limit:"10",...Object.fromEntries(Object.entries(s).map(([y,g])=>[y,Array.isArray(g)?g.join(","):String(g)]))}),_=await fetch(`/api/artists/filter?${v}`);if(!_.ok)throw new Error("Failed to fetch artists");return _.json()},staleTime:0}),f=(a==null?void 0:a.artists)||[],p=(a==null?void 0:a.count)||0,m=Math.ceil(p/10),x=v=>{o(v)};return c?l.jsx("section",{className:"bg-[#121212] py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5] mb-8",children:["FULL ",l.jsx("span",{className:"text-[#FB3939]",children:"DIRECTORY"})]}),l.jsx(yn,{className:"h-96 w-full bg-[#1E1E1E] rounded-xl mb-8"}),l.jsxs("div",{className:"mb-6 flex justify-between items-center",children:[l.jsx(yn,{className:"h-6 w-48 bg-[#1E1E1E]"}),l.jsx(yn,{className:"h-10 w-24 bg-[#1E1E1E]"})]}),l.jsx(yn,{className:"h-96 w-full bg-[#1E1E1E] rounded-xl mb-8"})]})}):u?l.jsx("section",{className:"bg-[#121212] py-12",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"text-center",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5] mb-4",children:["FULL ",l.jsx("span",{className:"text-[#FB3939]",children:"DIRECTORY"})]}),l.jsx("p",{className:"text-[#E0E0E0]",children:"Unable to load artists. Please try again later."})]})})}):l.jsx("section",{className:"bg-[#121212] py-12 animate-in fade-in duration-700",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading tracking-wide text-[#F5F5F5] mb-8 animate-in slide-in-from-top-4 duration-700",children:["FULL ",l.jsx("span",{className:"text-[#FB3939]",children:"DIRECTORY"})]}),l.jsx(_ee,{onFilterChange:x,initialFilters:s}),l.jsxs("div",{className:"mb-6 flex justify-between items-center",children:[l.jsxs("p",{className:"text-[#A0A0A0]",children:[l.jsx("span",{className:"text-[#F5F5F5]",children:p})," artists found"]}
4213),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[#A0A0A0] text-sm",children:"View:"}),l.jsx("button",{className:`bg-[#1E1E1E] p-2 rounded ${r==="list"?"text-[#FB3939]":"text-[#A0A0A0] hover:text-[#FB3939]"} transition`,onClick:()=>i("list"),"aria-label":"List view",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h16M4 18h16"})})}),l.jsx("button",{className:`bg-[#1E1E1E] p-2 rounded ${r==="grid"?"text-[#FB3939]":"text-[#A0A0A0] hover:text-[#FB3939]"} transition`,onClick:()=>i("grid"),"aria-label":"Grid view",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})})]})]}),r==="list"?l.jsx("div",{className:"bg-[#1E1E1E] rounded-xl overflow-hidden",children:f.length>0?f.map(v=>l.jsx("div",{className:"border-b border-[#2D2D2D] last:border-0",children:l.jsxs("div",{onClick:()=>window.location.href=Ve.ARTIST_DETAILS(v.slug),className:"p-4 flex items-center hover:bg-[#2D2D2D] transition cursor-pointer block",children:[l.jsx("div",{className:"w-14 h-14 rounded-full overflow-hidden mr-4",children:l.jsx("img",{src:v.imageUrl||"https://cdn-icons-png.flaticon.com/512/26/26805.png",alt:v.name,className:"w-full h-full object-cover",onError:_=>{_.currentTarget.onerror=null,_.currentTarget.src="https://cdn-icons-png.flaticon.com/512/26/26805.png"}})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"text-lg font-heading text-[#F5F5F5]",children:v.name.toUpperCase()}),l.jsxs("div",{className:"flex items-center text-[#A0A0A0] text-sm flex-wrap",children:[l.jsx("span",{children:(v.genres||[]).map(_=>_.name).join(", ")}),l.jsx("span",{className:"mx-2",children:"â¢"}),l.jsx("span",{children:(v.eras||[]).map(_=>_.name).join(", ")}),v.influenceLevel&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"mx-2",children:"â¢"}),l.jsx("span",{children:v.influenceLevel})]})]})]}),l.jsx("div",{className:"hidden md:flex items-center space-x-4",children:l.jsx(su,{rating:v.rating||0,size:"sm"})}),l.jsx("div",{children:l.jsx("span",{className:"text-[#3A86FF] hover:text-[#FB3939] transition",children:"View"})})]})},v.id)):l.jsx("div",{className:"p-8 text-center",children:l.jsx("p",{className:"text-[#A0A0A0]",children:"No artists found matching your criteria."})})}):l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6",children:f.length>0?f.map((v,_)=>l.jsxs("div",{onClick:()=>window.location.href=Ve.ARTIST_DETAILS(v.slug),className:"block bg-[#1E1E1E] rounded-xl overflow-hidden border border-[#2D2D2D] hover:border-[#FB3939] hover:shadow-2xl hover:shadow-[#FB3939]/20 transform hover:-translate-y-2 transition-all duration-500 shadow-lg cursor-pointer group animate-in fade-in slide-in-from-bottom-4",style:{animationDelay:`${_*100}ms`,animationDuration:"600ms"},children:[l.jsxs("div",{className:"h-48 overflow-hidden bg-[#121212] relative",children:[l.jsx("img",{src:v.imageUrl||"https://cdn-icons-png.flaticon.com/512/26/26805.png",alt:v.name,className:"w-full h-full object-cover transform group-hover:scale-110 transition-transform duration-700 ease-out",onError:y=>{y.currentTarget.onerror=null,y.currentTarget.src="https://cdn-icons-png.flaticon.com/512/26/26805.png"}}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"})]}),l.jsxs("div",{className:"p-4",children:[l.jsx("h3",{className:"text-lg font-heading text-[#F5F5F5] group-hover:text-white transition-colors duration-300 mb-2",children:v.name.toUpperCase()}),l.jsx("div",{className:"flex items-center mb-2",children:l.jsx(su,{rating:v.rating||0,size:"sm"})}),l.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(v.genres||[]).slice(0,2).map(y=>l.jsx("span",{className:"text-xs bg-[#2D2D2D] text-[#E0E0E0] rounded-full px-2 py-1",children:y.name},y.id))})]})]},v.id)):l.jsx("div",{className:"col-span-full p-8 text-center",children:l.jsx("p",{className:"text-[#A0A0A0]",children:"No artists found matching your criteria."})})}),m>1&&l.jsx("div",{className:"mt-8 flex justify-center",children:l.jsxs("nav",{className:"flex items-center space-x-2",children:[l.jsxs(it,{variant:"outline",size:"icon",onClick:()=>t(v=>Math.max(v-1,1)),disabled:e===1,className:"text-[#A0A0A0] hover:text-[#F5F5F5] bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 19l-7-7 7-7"})}),l.jsx("span",{className:"sr-only",children:"Previous page"})]}),Array.from({length:Math.min(5,m)}).map((v,_)=>{const y=[],g=Math.min(Math.floor(2.5),e-1),b=Math.max(1,e-g),S=Math.min(m,b+4);for(let R=b;R<=S;R++)y.push(R);if(y.length<=_)return null;const M=y[_],A=e===M;return l.jsx(it,{variant:A?"default":"outline",size:"icon",onClick:()=>t(M),className:A?"bg-[#FB3939] text-white":"bg-[#1E1E1E] text-[#F5F5F5] border-[#2D2D2D] hover:bg-[#2D2D2D]",children:M},M)}),m>5&&e<m-2&&l.jsx("span",{className:"px-3 py-1 text-[#A0A0A0]",children:"..."}),m>5&&e<m-1&&l.jsx(it,{variant:"outline",size:"icon",onClick:()=>t(m),className:"bg-[#1E1E1E] text-[#F5F5F5] border-[#2D2D2D] hover:bg-[#2D2D2D]",children:m}),l.jsxs(it,{variant:"outline",size:"icon",onClick:()=>t(v=>Math.min(v+1,m)),disabled:e===m,className:"text-[#A0A0A0] hover:text-[#F5F5F5] bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),l.jsx("span",{className:"sr-only",children:"Next page"})]})]})})]})})}function bee(){const[n]=Bi(),[e,t]=T.useState(""),[r,i]=T.useState({});return T.useEffect(()=>{const s=new URLSearchParams(window.location.search),o={};if(s.has("q")){const a=s.get("q");t(a||""),o.search=a}s.has("genre")&&(o.genres=s.getAll("genre").map(a=>parseInt(a))),s.has("era")&&(o.eras=s.getAll("era").map(a=>parseInt(a))),s.has("influence")&&(o.influenceLevelId=parseInt(s.get("influence")||"")),i(o)},[n]),l.jsxs("div",{className:"bg-[#121212] min-h-screen",children:[l.jsx("section",{className:"bg-[#1E1E1E] py-12",children:l.jsxs("div",{className:"container mx-auto px-4 text-center",children:[l.jsxs("h1",{className:"text-3xl md:text-5xl font-heading tracking-wider mb-4 text-white",children:[l.jsx("span",{className:"text-[#FB3939]",children:"SHADY"})," ARTIST DIRECTORY"]}
4213),l.jsx("p",{className:"text-lg text-[#E0E0E0] max-w-2xl mx-auto mb-8",children:"Explore our comprehensive directory of artists influenced by Eminem"}),l.jsx(Cy,{placeholder:"Search by artist name...",className:"mb-6",searchPath:"/artists"})]})}),l.jsx(wee,{initialFilters:r})]})}const es=T.forwardRef(({className:n,...e},t)=>l.jsx("textarea",{className:Ct("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background 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",n),ref:t,...e}));es.displayName="Textarea";function Dr(n){const e=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&e==="[object Date]"?new n.constructor(+n):typeof n=="number"||e==="[object Number]"||typeof n=="string"||e==="[object String]"?new Date(n):new Date(NaN)}const Gx=43200,LR=1440;let See={};function Eee(){return See}function jR(n){const e=Dr(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function m0(n,e){const t=Dr(n),r=Dr(e),i=t.getTime()-r.getTime();return i<0?-1:i>0?1:i}function Mee(n,e){const t=Dr(n),r=Dr(e),i=t.getFullYear()-r.getFullYear(),s=t.getMonth()-r.getMonth();return i*12+s}function Aee(n){return e=>{const r=(n?Math[n]:Math.trunc)(e);return r===0?0:r}}function Tee(n,e){return+Dr(n)-+Dr(e)}function Cee(n){const e=Dr(n);return e.setHours(23,59,59,999),e}function Nee(n){const e=Dr(n),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function Ree(n){const e=Dr(n);return+Cee(e)==+Nee(e)}function Pee(n,e){const t=Dr(n),r=Dr(e),i=m0(t,r),s=Math.abs(Mee(t,r));let o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*s);let a=m0(t,r)===-i;Ree(Dr(n))&&s===1&&m0(n,r)===1&&(a=!1),o=i*(s-Number(a))}return o===0?0:o}function Iee(n,e,t){const r=Tee(n,e)/1e3;return Aee(t==null?void 0:t.roundingMethod)(r)}const Fee={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Dee=(n,e,t)=>{let r;const i=Fee[n];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};function vb(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const kee={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lee={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jee={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Oee={date:vb({formats:kee,defaultWidth:"full"}),time:vb({formats:Lee,defaultWidth:"full"}),dateTime:vb({formats:jee,defaultWidth:"full"})},Uee={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Bee=(n,e,t,r)=>Uee[n];function Pf(n){return(e,t)=>{const r=t!=null&&t.context?String(t.context):"standalone";let i;if(r==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=t!=null&&t.width?String(t.width):o;i=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=t!=null&&t.width?String(t.width):n.defaultWidth;i=n.values[a]||n.values[o]}const s=n.argumentCallback?n.argumentCallback(e):e;return i[s]}}const zee={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vee={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Hee={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Wee={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
4213ay","Saturday"]},Gee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$ee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Xee=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},qee={ordinalNumber:Xee,era:Pf({values:zee,defaultWidth:"wide"}),quarter:Pf({values:Vee,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Pf({values:Hee,defaultWidth:"wide"}),day:Pf({values:Wee,defaultWidth:"wide"}),dayPeriod:Pf({values:Gee,defaultWidth:"wide",formattingValues:$ee,defaultFormattingWidth:"wide"})};function If(n){return(e,t={})=>{const r=t.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=e.match(i);if(!s)return null;const o=s[0],a=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(a)?Kee(a,p=>p.test(o)):Yee(a,p=>p.test(o));let u;u=n.valueCallback?n.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const f=e.slice(o.length);return{value:u,rest:f}}}function Yee(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function Kee(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function Zee(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const i=r[0],s=e.match(n.parsePattern);if(!s)return null;let o=n.valueCallback?n.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const a=e.slice(i.length);return{value:o,rest:a}}}const Qee=/^(\d+)(th|st|nd|rd)?/i,Jee=/\d+/i,ete={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tte={any:[/^b/i,/^(a|c)/i]},nte={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rte={any:[/1/i,/2/i,/3/i,/4/i]},ite={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ste={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ote={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ate={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lte={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cte={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ute={ordinalNumber:Zee({matchPattern:Qee,parsePattern:Jee,valueCallback:n=>parseInt(n,10)}),era:If({matchPatterns:ete,defaultMatchWidth:"wide",parsePatterns:tte,defaultParseWidth:"any"}),quarter:If({matchPatterns:nte,defaultMatchWidth:"wide",parsePatterns:rte,defaultParseWidth:"any",valueCallback:n=>n+1}),month:If({matchPatterns:ite,defaultMatchWidth:"wide",parsePatterns:ste,defaultParseWidth:"any"}),day:If({matchPatterns:ote,defaultMatchWidth:"wide",parsePatterns:ate,defaultParseWidth:"any"}),dayPeriod:If({matchPatterns:lte,defaultMatchWidth:"any",parsePatterns:cte,defaultParseWidth:"any"})},dte={code:"en-US",formatDistance:Dee,formatLong:Oee,formatRelative:Bee,localize:qee,match:ute,o
4213ptions:{weekStartsOn:0,firstWeekContainsDate:1}};function zM(n,e,t){const r=Eee(),i=(t==null?void 0:t.locale)??r.locale??dte,s=2520,o=m0(n,e);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let c,u;o>0?(c=Dr(e),u=Dr(n)):(c=Dr(n),u=Dr(e));const f=Iee(u,c),p=(jR(u)-jR(c))/1e3,m=Math.round((f-p)/60);let x;if(m<2)return t!=null&&t.includeSeconds?f<5?i.formatDistance("lessThanXSeconds",5,a):f<10?i.formatDistance("lessThanXSeconds",10,a):f<20?i.formatDistance("lessThanXSeconds",20,a):f<40?i.formatDistance("halfAMinute",0,a):f<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):m===0?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",m,a);if(m<45)return i.formatDistance("xMinutes",m,a);if(m<90)return i.formatDistance("aboutXHours",1,a);if(m<LR){const v=Math.round(m/60);return i.formatDistance("aboutXHours",v,a)}else{if(m<s)return i.formatDistance("xDays",1,a);if(m<Gx){const v=Math.round(m/LR);return i.formatDistance("xDays",v,a)}else if(m<Gx*2)return x=Math.round(m/Gx),i.formatDistance("aboutXMonths",x,a)}if(x=Pee(u,c),x<12){const v=Math.round(m/Gx);return i.formatDistance("xMonths",v,a)}else{const v=x%12,_=Math.trunc(x/12);return v<3?i.formatDistance("aboutXYears",_,a):v<9?i.formatDistance("overXYears",_,a):i.formatDistance("almostXYears",_+1,a)}}function hte({artistId:n,reviews:e=[],initialUserReview:t,isAuthenticated:r}){const{user:i}=vi(),{toast:s}=Mn(),o=hs(),[a,c]=T.useState((t==null?void 0:t.rating)||0),[u,f]=T.useState((t==null?void 0:t.content)||""),[p,m]=T.useState(!1),{data:x=[],isLoading:v,error:_}=Nt({queryKey:[`/api/artists/${n}/reviews`],enabled:!!n}),{data:y,isLoading:g}=Nt({queryKey:[`/api/artists/${n}/user-review`],enabled:!!n&&r});T.useEffect(()=>{y&&(c(y.rating),f(y.content||""))},[y]);const b=ti({mutationFn:async()=>{if(!a)throw new Error("Please provide a rating");return m(!0),(await Lo("POST",`/api/artists/${n}/review`,{rating:a,content:u.trim()})).json()},onSuccess:()=>{o.invalidateQueries({queryKey:[`/api/artists/${n}/reviews`]}),o.invalidateQueries({queryKey:[`/api/artists/${n}/rating`]}),o.invalidateQueries({queryKey:[`/api/artists/${n}/user-review`]}),s({title:"Review submitted",description:"Your review has been successfully submitted."}),y||(c(0),f(""))},onError:N=>{s({title:"Error",description:N.message||"Failed to submit review. Please try again.",variant:"destructive"})},onSettled:()=>{m(!1)}}),S=ti({mutationFn:async N=>await Lo("DELETE",`/api/reviews/${N}`),onSuccess:()=>{o.invalidateQueries({queryKey:[`/api/artists/${n}/reviews`]}),o.invalidateQueries({queryKey:[`/api/artists/${n}/rating`]}),o.invalidateQueries({queryKey:[`/api/artists/${n}/user-review`]}),s({title:"Review deleted",description:"Your review has been deleted."}),c(0),f("")},onError:()=>{s({title:"Error",description:"Failed to delete review. Please try again.",variant:"destructive"})}}),M=N=>{N.preventDefault(),b.mutate()},A=N=>{confirm("Are you sure you want to delete this review?")&&S.mutate(N)},R=a>0,F=(i==null?void 0:i.isAdmin)||!1,L=N=>{const I=new Date(N);return zM(I,new Date,{addSuffix:!0})};return l.jsxs(qn,{className:"bg-[#1E1E1E] mb-8",children:[l.jsx(ts,{children:l.jsx(ns,{className:"text-2xl font-heading text-[#F5F5F5]",children:"REVIEWS"})}),l.jsxs(tr,{children:[r?l.jsxs("form",{onSubmit:M,className:"mb-8 bg-[#2D2D2D] rounded-xl p-4",children:[l.jsx("h3",{className:"text-xl font-heading text-[#F5F5F5] mb-4",children:y?"Edit Your Review":"Write a Review"}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-[#E0E0E0] mb-2",children:"Your Rating:"}),l.jsx(su,{rating:a,interactive:!0,onChange:c,size:"lg"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{htmlFor:"review-content",className:"block text-[#E0E0E0] mb-2",children:"Your Review (optional):"}),l.jsx(es,{id:"review-content",value:u,onChange:N=>f(N.target.value),placeholder:"Share your thoughts about this artist...",className:"bg-[#1E1E1E] border-[#3D3D3D] text-[#F5F5F5] min-h-[100px]"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(it,{type:"submit",className:"bg-[#FB3939] hover:bg-opacity-90 text-white",disabled:!R||p,children:p?"Submitting...":y?"Update Review":"Submit Review"}),y&&l.jsx(it,{type:"button",variant:"outline",className:"border-[#3D3D3D] text-[#E0E0E0] hover:bg-[#2D2D2D]",onClick:()=>A(y.id),disabled:S.isPending,children:S.isPending?"Deleting...":"Delete Review"})]})]}):l.jsxs("div",{className:"mb-8 bg-[#2D2D2D] rounded-xl p-6 text-center",children:[l.jsx("p",{className:"text-[#E0E0E0] mb-4",children:"Sign in to leave a review for this artist."}),l.jsx(it,{onClick:()=>{window.location.href=Ve.LOGIN},className:"bg-[#FB3939] hover:bg-opacity-90 text-white",children:"Sign In to Review"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"text-xl font-heading text-[#F5F5F5] mb-2",children:[e.length," ",e.length===1?"Review":"Reviews"]}),v?l.jsx("p",{className:"text-[#A0A0A0]",children:"Loading reviews..."}):_?l.jsx("p",{className:"text-[#A0A0A0]",children:"Failed to load reviews."}):e.length>0?e.map(N=>{var I,D,O,U;return l.jsxs("div",{className:"border-b border-[#2D2D2D] pb-4 mb-4 last:border-0",children:[l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("img",{src:((I=N.user)==null?void 0:I.profileImageUrl)||"https://replit.com/public/images/mark.png",alt:((D=N.user)==null?void 0:D.firstName)||"User",className:"w-10 h-10 rounded-full mr-3 object-cover"}),l.jsxs("div",{children:[l.jsxs("div",{className:"font-medium text-[#F5F5F5]",children:[((O=N.user)==null?void 0:O.firstName)||"Anonymous"," ",((U=N.user)==null?void 0:U.lastName)||""]}),l.jsx("div",{className:"text-[#A0A0A0] text-sm",children:L(N.createdAt)})]})]}),l.jsx(su,{rating:N.rating,size:"sm"})]}),N.content&&l.jsx("div",{className:"mt-3 text-[#E0E0E0]",children:N.content}),(F||r&&(i==null?void 0:i.id)===N.userId)&&l.jsx("div",{className:"mt-2 flex justify-end",children:l.jsx(it,{variant:"ghost",size:"sm",onClick:()=>A(N.id),className:"text-[#A0A0A0] hover:text-[#FB3939] hover:bg-transparent",children:"Delete"})})]},N.id)}):l.jsx("p",{className:"text-[#A0A0A0] py-4",children:"No reviews yet. Be the first to review!"})]})]})]})}function fte({artistId:n,comments:e=[],isAuthenticated:t}){const{user:r}=vi(),{toast:i}=Mn(),s=hs(),[o,a]=T.useState(""),[c,u]=T.useState(!1),{data:f=[],isLoading:p,error:m}=Nt({queryKey:[`/api/artists/${n}/comments`],enabled:!!n}),x=ti({mutationFn:async()=>
4213{if(!o.trim())throw new Error("Comment cannot be empty");return u(!0),(await Lo("POST",`/api/artists/${n}/comment`,{content:o.trim()})).json()},onSuccess:()=>{s.invalidateQueries({queryKey:[`/api/artists/${n}/comments`]}),i({title:"Comment submitted",description:"Your comment has been posted successfully."}),a("")},onError:M=>{i({title:"Error",description:M.message||"Failed to submit comment. Please try again.",variant:"destructive"})},onSettled:()=>{u(!1)}}),v=ti({mutationFn:async M=>await Lo("DELETE",`/api/comments/${M}`),onSuccess:()=>{s.invalidateQueries({queryKey:[`/api/artists/${n}/comments`]}),i({title:"Comment deleted",description:"Your comment has been deleted."})},onError:()=>{i({title:"Error",description:"Failed to delete comment. Please try again.",variant:"destructive"})}}),_=M=>{M.preventDefault(),x.mutate()},y=M=>{confirm("Are you sure you want to delete this comment?")&&v.mutate(M)},g=o.trim().length>0,b=(r==null?void 0:r.isAdmin)||!1,S=M=>{const A=new Date(M);return zM(A,new Date,{addSuffix:!0})};return l.jsxs(qn,{className:"bg-[#1E1E1E]",children:[l.jsx(ts,{children:l.jsx(ns,{className:"text-2xl font-heading text-[#F5F5F5]",children:"COMMENTS"})}),l.jsxs(tr,{children:[t?l.jsxs("form",{onSubmit:_,className:"mb-8 bg-[#2D2D2D] rounded-xl p-4",children:[l.jsx("h3",{className:"text-xl font-heading text-[#F5F5F5] mb-4",children:"Leave a Comment"}),l.jsx("div",{className:"mb-4",children:l.jsx(es,{value:o,onChange:M=>a(M.target.value),placeholder:"Share your thoughts about this artist...",className:"bg-[#1E1E1E] border-[#3D3D3D] text-[#F5F5F5] min-h-[100px]",required:!0})}),l.jsx(it,{type:"submit",className:"bg-[#FB3939] hover:bg-opacity-90 text-white",disabled:!g||c,children:c?"Posting...":"Post Comment"})]}):l.jsxs("div",{className:"mb-8 bg-[#2D2D2D] rounded-xl p-6 text-center",children:[l.jsx("p",{className:"text-[#E0E0E0] mb-4",children:"Sign in to leave a comment for this artist."}),l.jsx(it,{onClick:()=>{window.location.href=Ve.LOGIN},className:"bg-[#FB3939] hover:bg-opacity-90 text-white",children:"Sign In to Comment"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"text-xl font-heading text-[#F5F5F5] mb-2",children:[e.length," ",e.length===1?"Comment":"Comments"]}),p?l.jsx("p",{className:"text-[#A0A0A0]",children:"Loading comments..."}):m?l.jsx("p",{className:"text-[#A0A0A0]",children:"Failed to load comments."}):e.length>0?e.map(M=>{var A,R,F,L;return l.jsx("div",{className:"border-b border-[#2D2D2D] pb-4 mb-4 last:border-0",children:l.jsxs("div",{className:"flex items-start",children:[l.jsx("img",{src:((A=M.user)==null?void 0:A.profileImageUrl)||"https://via.placeholder.com/150",alt:((R=M.user)==null?void 0:R.firstName)||"User",className:"w-10 h-10 rounded-full mr-3 object-cover"}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex justify-between",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"font-medium text-[#F5F5F5]",children:[((F=M.user)==null?void 0:F.firstName)||"Anonymous"," ",((L=M.user)==null?void 0:L.lastName)||""]}),l.jsx("div",{className:"text-[#A0A0A0] text-sm",children:S(M.createdAt)})]}),(b||t&&(r==null?void 0:r.id)===M.userId)&&l.jsx(it,{variant:"ghost",size:"sm",onClick:()=>y(M.id),className:"text-[#A0A0A0] hover:text-[#FB3939] hover:bg-transparent",children:"Delete"})]}),l.jsx("div",{className:"mt-2 text-[#E0E0E0]",children:M.content})]})]})},M.id)}):l.jsx("p",{className:"text-[#A0A0A0] py-4",children:"No comments yet. Be the first to comment!"})]})]})]})}function pte({artistName:n,onTrackSelect:e}){const{data:t,isLoading:r,error:i}=Nt({queryKey:["spotify-tracks",n],queryFn:async()=>{const s=await fetch(`/api/spotify/artist-tracks?artist=${encodeURIComponent(n)}`);if(!s.ok)throw new Error("Failed to fetch tracks");return s.json()},enabled:!!n});return r?l.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(s=>l.jsxs("div",{className:"flex items-center p-3 bg-[#1E1E1E] rounded-lg animate-pulse",children:[l.jsx("div",{className:"w-10 h-10 rounded-full bg-[#2D2D2D] mr-3"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"h-4 bg-[#2D2D2D] rounded mb-1"}),l.jsx("div",{className:"h-3 bg-[#2D2D2D] rounded w-2/3"})]})]},s))}):i||!t||t.length===0?l.jsx("div",{className:"space-y-3",children:["Popular Track","Hit Single","Fan Favorite","Chart Topper","Latest Release"].map((s,o)=>l.jsxs("div",{className:"flex items-center p-3 bg-[#1E1E1E] rounded-lg hover:bg-[#2A2A2A] transition",children:[l.jsx("button",{className:"flex-shrink-0 mr-3 h-10 w-10 rounded-full bg-[#1DB954] hover:bg-[#1ED760] flex items-center justify-center transition",onClick:()=>{e({id:`${n}-${o}`,name:s,duration_ms:18e4,album:{name:"Popular Tracks"}}
4213)},title:"Play track",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"white",children:l.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"text-sm font-medium text-white truncate",children:[n," - ",s]}),l.jsx("div",{className:"text-xs text-gray-400 truncate",children:"Popular Track"})]}),l.jsx("div",{className:"ml-2 text-xs text-[#1DB954]",children:"3:00"})]},o))}):l.jsx("div",{className:"space-y-3",children:t.slice(0,5).map((s,o)=>{var a;return l.jsxs("div",{className:"flex items-center p-3 bg-[#1E1E1E] rounded-lg hover:bg-[#2A2A2A] transition",children:[l.jsx("button",{className:"flex-shrink-0 mr-3 h-10 w-10 rounded-full bg-[#1DB954] hover:bg-[#1ED760] flex items-center justify-center transition",onClick:()=>e(s),title:"Play track",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"white",children:l.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-white truncate",children:s.name}),l.jsx("div",{className:"text-xs text-gray-400 truncate",children:((a=s.album)==null?void 0:a.name)||"Single"})]}),l.jsxs("div",{className:"ml-2 text-xs text-[#1DB954]",children:[Math.floor(s.duration_ms/6e4),":",String(Math.floor(s.duration_ms%6e4/1e3)).padStart(2,"0")]})]},s.id)})})}function mte({slug:n}){HE();const{setCurrentTrack:e}=GD(),{toast:t}=Mn(),{isAuthenticated:r,user:i}=vi(),s=hs(),{data:o,isLoading:a,error:c}=Nt({queryKey:[`/api/artists/slug/${n}`],enabled:!!n}),{data:u}=Nt({queryKey:[`/api/artists/${o==null?void 0:o.id}/rating`],enabled:!!(o!=null&&o.id)}),{data:f}=Nt({queryKey:[`/api/artists/${o==null?void 0:o.id}/discography`],enabled:!!(o!=null&&o.id)}),{data:p}=Nt({queryKey:[`/api/artists/${o==null?void 0:o.id}/favorite`],enabled:!!(o!=null&&o.id)&&r}),{data:m}=Nt({queryKey:[`/api/artists/${o==null?void 0:o.id}/reviews`],enabled:!!(o!=null&&o.id)});Nt({queryKey:[`/api/artists/${o==null?void 0:o.id}/user-review`],enabled:!!(o!=null&&o.id)&&r});const{data:x}=Nt({queryKey:[`/api/artists/${o==null?void 0:o.id}/comments`],enabled:!!(o!=null&&o.id)}),v=ti({mutationFn:y=>Lo(`/api/artists/${y}/favorite`,"POST"),onSuccess:()=>{s.invalidateQueries({queryKey:[`/api/artists/${o==null?void 0:o.id}/favorite`]})}}),_=()=>{if(!r){t({title:"Authentication Required",description:"Please log in to add artists to your favorites",variant:"destructive"});return}o!=null&&o.id&&v.mutate(o.id)};return a?l.jsx("div",{className:"container mx-auto py-8",children:l.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[l.jsxs("div",{className:"w-full md:w-1/3",children:[l.jsx(yn,{className:"w-full aspect-square rounded-lg mb-4"}),l.jsx(yn,{className:"w-3/4 h-8 mb-2"}),l.jsx(yn,{className:"w-1/2 h-6"})]}),l.jsxs("div",{className:"w-full md:w-2/3",children:[l.jsx(yn,{className:"w-full h-[200px] mb-6"}),l.jsx(yn,{className:"w-full h-[100px] mb-4"}),l.jsx(yn,{className:"w-full h-[100px]"})]})]})}):c||!o?l.jsxs("div",{className:"container mx-auto py-8 text-center",children:[l.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Artist Not Found"}),l.jsx("p",{className:"mb-6",children:"Sorry, we couldn't find the artist you're looking for."}),l.jsx(Pt,{href:Ve.HOME,children:l.jsx(it,{children:"Return to Home"})})]}):l.jsx("div",{className:"container mx-auto py-8",children:l.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[l.jsx("div",{className:"w-full md:w-1/3",children:l.jsx("div",{className:"sticky top-24",children:l.jsxs("div",{className:"bg-[#1A1A1A] rounded-lg overflow-hidden shadow-lg",children:[l.jsx("div",{className:"aspect-square overflow-hidden",children:l.jsx("img",{src:o.imageUrl||"/default-artist.jpg",alt:o.name,className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"p-4",children:[l.jsx("h1",{className:"text-2xl font-bold text-[#F5F5F5] mb-2",children:o.name}),l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx("span",{className:"text-lg text-[#E0E0E0]",children:u&&!isNaN(Number(u))?Number(u).toFixed(1):"0.0"}),l.jsx(su,{rating:u&&!isNaN(Number(u))?Number(u):0,size:"md"})]}),l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx(it,{variant:p!=null&&p.isFavorited?"default":"outline",size:"sm",onClick:_,className:p!=null&&p.isFavorited?"bg-red-600 hover:bg-red-700":"",children:p!=null&&p.isFavorited?"â
Favorited":"â Add to Favorites"}),r&&(i==null?void 0:i.isAdmin)&&l.jsx(Pt,{href:`/artists/${o.id}/edit`,children:l.jsx(it,{variant:"outline",size:"sm",className:"w-full",children:"Edit"})})]})]})]})})}),l.jsxs("div",{className:"w-full md:w-2/3",children:[o.genres&&o.genres.length>0&&l.jsx("div",{className:"mb-6",children:l.jsx("div",{className:"flex flex-wrap gap-2",children:o.genres.map(y=>l.jsx(Pt,{href:`/genres/${y.id}`,children:l.jsx("span",{className:"bg-[#3D3D3D] text-[#E0E0E0] px-3 py-1 rounded-full text-sm hover:bg-opacity-80 transition cursor-pointer",children:y.name})},y.id))})}),o.eras&&o.eras.length>0&&l.jsx("div",{className:"mb-6",children:l.jsx("div",{className:"flex flex-wrap gap-2",children:o.eras.map(y=>l.jsx(Pt,{href:`/eras/${y.id}`,children:l.jsx("span",{className:"bg-[#2D2D2D] text-[#E0E0E0] px-3 py-1 rounded-full text-sm hover:bg-opacity-80 transition cursor-pointer",children:y.name})},y.id))})}),o.eminemConnection&&l.jsxs("div",{className:"mb-6 p-4 bg-[#2D2D2D] rounded-lg",children:[l.jsx("h3",{className:"text-lg font-medium text-[#F5F5F5] mb-2",children:"Connection to Eminem:"}),l.jsx("p",{className:"text-[#E0E0E0]",children:o.eminemConnection})]}),l.jsx("div",{className:"mb-6",children:l.jsx("p",{className:"text-[#E0E0E0] whitespace-pre-line",children:o.bio||"No biography available."})}),l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4 mb-6",children:[o.spotifyUrl&&l.jsx(l.Fragment,{children:l.jsxs("a",{href:`${o.spotifyUrl}?${Gc}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 bg-[#1DB954] text-white py-2 px-4 roun
4213ded-lg hover:bg-opacity-90 transition",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:l.jsx("path",{d:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.48.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"})}),"Spotify"]})}),o.appleUrl&&l.jsxs("a",{href:`${o.appleUrl}?${Gc}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 bg-[#FB233B] text-white py-2 px-4 rounded-lg hover:bg-opacity-90 transition",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:l.jsx("path",{d:"M23.906 12.946c0 2.408-1.096 4.417-2.701 5.826-1.693 1.526-3.204 1.141-4.725.377-1.492-.758-2.022-.639-3.01.118-1.216.954-2.41 1.05-3.641.096C8.335 18.178 6.99 15.94 6.99 12.5c0-3.084 1.704-5.262 4.335-5.26 1.097-.022 1.935.53 2.647.927.714.403 1.26.642 2.016.014 1.407-1.252 3.44-1.2 4.965.126 1.705 1.462 2.938 3.756 2.953 4.639zM12.452.266c.15 1.296-.392 2.587-1.166 3.499-.899 1.028-2.397 1.827-3.886 1.738C7.113 3.809 8.054 2.419 9.05 1.59 10.096.7 11.67.039 12.452.266z"})}),"Apple Music"]}),o.youtubeUrl&&l.jsxs("a",{href:`${o.youtubeUrl}?${Gc}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 bg-[#FF0000] text-white py-2 px-4 rounded-lg hover:bg-opacity-90 transition",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:l.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),"YouTube"]}),o.websiteUrl&&l.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 bg-[#4A4A4A] text-white py-2 px-4 rounded-lg hover:bg-opacity-90 transition",children:[l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-5 h-5",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),l.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),"Website"]}),o.instagramUrl&&l.jsxs("a",{href:o.instagramUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 bg-[#C13584] text-white py-2 px-4 rounded-lg hover:bg-opacity-90 transition",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:l.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"})}),"Instagram"]}),o.twitterUrl&&l.jsxs("a",{href:o.twitterUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 bg-[#1DA1F2] text-white py-2 px-4 roun
4213ded-lg hover:bg-opacity-90 transition",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-5 h-5",children:l.jsx("path",{d:"M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"})}),"Twitter"]})]}),o.spotifyUrl&&l.jsxs("div",{className:"mb-8",children:[l.jsxs("h2",{className:"text-xl font-semibold text-[#F5F5F5] mb-4",children:["Listen to ",o.name]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsx("div",{className:"col-span-1 lg:col-span-2",children:l.jsxs("div",{className:"p-6 bg-[#2D2D2D] rounded-lg",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-[#E0E0E0] text-lg font-bold",children:["Listen to ",o.name]}),l.jsx("p",{className:"text-[#A0A0A0] text-sm",children:"Essential tracks"})]}),l.jsx("svg",{viewBox:"0 0 24 24",width:"30",height:"30",fill:"#1DB954",className:"flex-shrink-0",children:l.jsx("path",{d:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.66.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"})})]}),l.jsx("div",{className:"space-y-3",children:l.jsx(pte,{artistName:o.name,onTrackSelect:y=>{var g,b,S,M;e({id:y.id,title:y.name,artist:o.name,album:((g=y.album)==null?void 0:g.name)||"Single",imageUrl:((M=(S=(b=y.album)==null?void 0:b.images)==null?void 0:S[0])==null?void 0:M.url)||o.imageUrl,duration:Math.floor(y.duration_ms/1e3)}),console.log(`ðµ Playing: ${y.name} by ${o.name}`)}})})]})}),l.jsx("div",{className:"col-span-1",children:l.jsxs("div",{className:"bg-[#2D2D2D] rounded-lg p-5",children:[l.jsx("h3",{className:"text-[#E0E0E0] text-lg font-semibold mb-3",children:"Top Tracks"}),l.jsx("ul",{className:"space-y-3",children:[1,2,3].map(y=>l.jsxs("li",{className:"flex items-center",children:[l.jsx("div",{className:"w-10 h-10 bg-[#333] rounded flex-shrink-0 flex items-center justify-center mr-3",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#FB3939",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M9 18V5l12-2v13"}),l.jsx("circle",{cx:"6",cy:"18",r:"3"}),l.jsx("circle",{cx:"18",cy:"16",r:"3"})]})}),l.jsxs("div",{children:[l.jsxs("div",{className:"text-[#E0E0E0] font-medium",children:[o.name," Track ",y]}),l.jsxs("div",{className:"text-[#A0A0A0] text-sm",children:["Album ",y]})]})]},y))}),l.jsx("div",{className:"mt-4 pt-4 border-t border-[#444]",children:l.jsxs("a",{href:o.spotifyUrl||"#",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 bg-[#1DB954] text-black font-medium py-2 rounded-md w-full hover:bg-opacity-90 transition",children:[l.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor",children:l.jsx("path",{d:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.66.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"})}),"Listen on Spotify"]})})]})})]})]}),f&&f.length>0&&l.jsxs("div",{className:"mb-8",children:[l.jsx("h2",{className:"text-xl font-semibold text-[#F5F5F5] mb-4",children:"Discography"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:f.map(y=>l.jsxs("div",{className:"bg-[#2D2D2D] rounded-lg overflow-hidden shadow-md",children:[l.jsx("div",{className:"aspect-square overflow-hidden",children:l.jsx("img",{src:y.imageUrl||"/default-album.jpg",alt:y.title,className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"p-3",children:[l.jsx("h3",{className:"text-[#F5F5F5] font-medium text-sm truncate",children:y.title}),l.jsx("p",{className:"text-[#A0A0A0] text-xs",children:y.releaseYear})]})]},y.id))})]}),l.jsx(hte,{artistId:o.id,reviews:m||[],isAuthenticated:r}),l.jsx(fte,{artistId:o.id,comments:x||[],isAuthenticated:r})]})]})})}function gte(){const[n,e]=Z4("/artists/:slug");return!n||!(e!=null&&e.slug)?l.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[l.jsx("h1",{className:"text-3xl font-heading text-[#F5F5F5] mb-4",children:"Artist Not Found"}),l.jsx("p",{className:"text-[#A0A0A0]",children:"The artist you're looking for could not be found."})]}):l.jsx("div",{className:"bg-[#121212] min-h-screen py-8",children:l.jsx(mte,{slug:e.slug})})}function xte(){const[n,e]=T.useState(""),[t,r]=T.useState([]),{data:i=[],isLoading:s,error:o}=Nt({queryKey:["/api/genres"]}),a={"Alternative Hip Hop":"https://images.unsplash.com/photo-1501281668745-f7f57925c3b4?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","Conscious Rap":"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","Hardcore Hip Hop":"https://images.unsplash.com/photo-1514525253161-7a46d19cd819?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","Hip Hop":"https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400",Horrorcore:"https://images.unsplash.com/photo-1470225620780-dba8ba36b745?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","Pop Rap":"https://images.unsplash.com/photo-1511671
4213782779-c97d3d27a1d4?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400","R&B":"https://images.unsplash.com/photo-1518609878373-06d740f60d8b?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400",Rap:"https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400",Trap:"https://images.unsplash.com/photo-1541697183324-e09ae74005c8?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400"};return T.useEffect(()=>{if(!i)return;if(!n.trim()){r(i);return}const c=n.toLowerCase().trim(),u=i.filter(f=>f.name.toLowerCase().includes(c)||f.description&&f.description.toLowerCase().includes(c));r(u)},[i,n]),l.jsxs("div",{className:"bg-[#121212] min-h-screen",children:[l.jsx("section",{className:"bg-[#1E1E1E] py-12",children:l.jsxs("div",{className:"container mx-auto px-4 text-center",children:[l.jsxs("h1",{className:"text-3xl md:text-5xl font-heading tracking-wider mb-4 text-white",children:["MUSIC ",l.jsx("span",{className:"text-[#FB3939]",children:"GENRES"})]}),l.jsx("p",{className:"text-lg text-[#E0E0E0] max-w-2xl mx-auto mb-8",children:"Explore genres that have been influenced by Eminem throughout his career"}),l.jsx(Cy,{placeholder:"Search genres...",className:"mb-6",searchPath:"/genres"})]})}),l.jsx("section",{className:"py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] mb-8",children:["ALL ",l.jsx("span",{className:"text-[#FB3939]",children:"GENRES"})]}),s?l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-[#A0A0A0]",children:"Loading genres..."})}):o?l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-[#A0A0A0]",children:"Error loading genres. Please try again later."})}):t.length>0?l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6",children:t.map(c=>l.jsx($D,{id:c.id,name:c.name,imageUrl:c.imageUrl||a[c.name]||"https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400",artistCount:c.artistCount||0},c.id))}):l.jsx("div",{className:"text-center py-12",children:l.jsxs("p",{className:"text-[#A0A0A0]",children:['No genres found matching "',n,'".']})})]})})]})}function vte(){const[n,e]=Z4("/genres/:id"),t=e!=null&&e.id?parseInt(e.id):null,{data:r,isLoading:i,error:s}=Nt({queryKey:[`/api/genres/${t}`],enabled:!!t}),{data:o,isLoading:a,error:c}=Nt({queryKey:["/api/artists/filter",{genres:[t]}],enabled:!!t}),u=(o==null?void 0:o.artists)||[],f=i||a,p=s||c;return!n||!t?l.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[l.jsx("h1",{className:"text-3xl font-heading text-[#F5F5F5] mb-4",children:"Genre Not Found"}),l.jsx("p",{className:"text-[#A0A0A0] mb-8",children:"The genre you're looking for could not be found."}),l.jsx(Pt,{href:Ve.GENRES,children:l.jsx("a",{className:"bg-[#FB3939] hover:bg-opacity-90 text-white px-4 py-2 rounded-lg",children:"Back to Genres"})})]}):f?l.jsx("div",{className:"container mx-auto px-4 py-12",children:l.jsx("div",{className:"text-center",children:l.jsx("p",{className:"text-[#A0A0A0]",children:"Loading genre details..."})})}):p||!r?l.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[l.jsx("h1",{className:"text-3xl font-heading text-[#F5F5F5] mb-4",children:"Error Loading Genre"}),l.jsx("p",{className:"text-[#A0A0A0] mb-8",children:"There was an error loading this genre. Please try again later."}),l.jsx(Pt,{href:Ve.GENRES,children:l.jsx("a",{className:"bg-[#FB3939] hover:bg-opacity-90 text-white px-4 py-2 rounded-lg",children:"Back to Genres"})})]}):l.jsxs("div",{className:"bg-[#121212] min-h-screen",children:[l.jsxs("section",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 z-0 bg-gradient-to-b from-transparent to-[#121212]",children:l.jsx("div",{style:{backgroundImage:`url(${r.imageUrl||"https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&h=600"})`,backgroundSize:"cover",backgroundPosition:"center"},className:"w-full h-full opacity-50"})}),l.jsx("div",{className:"relative z-10 container mx-auto px-4 py-16 md:py-24",children:l.jsxs("div",{className:"max-w-3xl",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-heading tracking-wider mb-4 text-white",children:r.name.toUpperCase()}),r.description&&l.jsx("p",{className:"text-lg md:text-xl text-[#E0E0E0] mb-6",children:r.description}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"bg-[#FB3939] text-white px-4 py-1 rounded-full",children:[r.artistCount||u.length," ",(r.artistCount||u.length)===1?"Artist":"Artists"]}),l.jsx(Pt,{href:Ve.GENRES,children:l.jsxs("a",{className:"text-[#3A86FF] hover:text-[#FB3939] transition flex items-center",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),"Back to Genres"]})})]})]})})]}),l.jsx("section",{className:"py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] mb-8",children:["ARTISTS IN ",l.jsx("span",{className:"text-[#FB3939]",children:r.name.toUpperCase()})]}),u.length>0?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:u.map(m=>l.jsx(WE,{id:m.id,name:m.name,slug:m.slug,imageUrl:m.imageUrl||"https://images.unsplash.com/photo-1511671
4213782779-c97d3d27a1d4?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400",bio:m.bio||"No biography available.",genres:m.genres||[],eras:m.eras||[],rating:m.rating||0,reviewCount:m.reviewCount||0},m.id))}):l.jsxs("div",{className:"text-center py-8 bg-[#1E1E1E] rounded-xl",children:[l.jsx("p",{className:"text-[#A0A0A0] mb-4",children:"No artists found in this genre."}),l.jsx(Pt,{href:Ve.ARTISTS,children:l.jsx("a",{className:"text-[#3A86FF] hover:text-[#FB3939] transition",children:"Browse all artists"})})]})]})})]})}function yte(){const[n,e]=T.useState(""),[t,r]=T.useState([]),{data:i=[],isLoading:s,error:o}=Nt({queryKey:["/api/eras"]});return T.useEffect(()=>{if(!i)return;if(!n.trim()){r(i);return}const a=n.toLowerCase().trim(),c=i.filter(u=>u.name.toLowerCase().includes(a)||u.description&&u.description.toLowerCase().includes(a));r(c)},[i,n]),l.jsxs("div",{className:"bg-[#121212] min-h-screen",children:[l.jsx("section",{className:"bg-[#1E1E1E] py-12",children:l.jsxs("div",{className:"container mx-auto px-4 text-center",children:[l.jsxs("h1",{className:"text-3xl md:text-5xl font-heading tracking-wider mb-4 text-white",children:["EMINEM'S ",l.jsx("span",{className:"text-[#FB3939]",children:"BIOGRAPHICAL TIMELINE"})]}),l.jsx("p",{className:"text-lg text-[#E0E0E0] max-w-2xl mx-auto mb-8",children:"Journey through Marshall Mathers' life story - from childhood struggles in Detroit to becoming one of hip-hop's greatest legends"}),l.jsx(Cy,{placeholder:"Search biographical eras...",className:"mb-6",searchPath:"/eras"})]})}),l.jsx("section",{className:"py-12",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] mb-8",children:["BIOGRAPHICAL ",l.jsx("span",{className:"text-[#FB3939]",children:"ERAS"})]}),s?l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-[#A0A0A0]",children:"Loading eras..."})}):o?l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-[#A0A0A0]",children:"Error loading eras. Please try again later."})}):t.length>0?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.map(a=>l.jsx(XD,{id:a.id,name:a.name,description:a.description||"",startYear:a.startYear??void 0,endYear:a.endYear??void 0,imageUrl:a.imageUrl||"https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&h=400",artistCount:a.artistCount||0},a.id))}):l.jsx("div",{className:"text-center py-12",children:l.jsxs("p",{className:"text-[#A0A0A0]",children:['No eras found matching "',n,'".']})})]})})]})}function _te({events:n}){const e=[...n].sort((i,s)=>{if(i.sortOrder!==void 0&&s.sortOrder!==void 0)return i.sortOrder-s.sortOrder;if(i.date&&s.date){const o=new Date(i.date).getTime()||parseInt(i.date)||0,a=new Date(s.date).getTime()||parseInt(s.date)||0;return o-a}return 0}),t=i=>{switch(i.toLowerCase()){case"personal":return l.jsx(G0,{className:"w-4 h-4"});case"career":return l.jsx(As,{className:"w-4 h-4"});case"album":return l.jsx(As,{className:"w-4 h-4"});case"award":return l.jsx(u3,{className:"w-4 h-4"});case"collaboration":return l.jsx(h3,{className:"w-4 h-4"});default:return l.jsx(kd,{className:"w-4 h-4"})}},r=i=>{switch(i.toLowerCase()){case"personal":return"bg-pink-500 border-pink-400";case"career":return"bg-yellow-500 border-yellow-400";case"album":return"bg-purple-500 border-purple-400";case"award":return"bg-green-500 border-green-400";case"collaboration":return"bg-blue-500 border-blue-400";default:return"bg-gray-500 border-gray-400"}};return n.length===0?l.jsxs("div",{className:"text-center py-12",children:[l.jsx(kd,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),l.jsx("p",{className:"text-gray-400 text-lg",children:"No timeline events available for this era."})]}):l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute left-8 top-0 bottom-0 w-0.5 bg-gradient-to-b from-[#FB3939] to-[#d82d2d]"}),l.jsx("div",{className:"space-y-8",children:e.map((i,s)=>l.jsxs("div",{className:"relative flex items-start group",children:[l.jsx("div",{className:`relative z-10 flex items-center justify-center w-16 h-16 rounded-full border-4 ${r(i.eventType)} shadow-lg transition-transform group-hover:scale-110`,children:l.jsx("div",{className:"text-white",children:t(i.eventType)})}),l.jsx("div",{className:"ml-6 flex-1 min-w-0",children:l.jsxs("div",{className:"bg-[#1E1E1E] rounded-xl p-6 border border-[#333] shadow-xl transition-all duration-300 group-hover:shadow-2xl group-hover:border-[#FB3939]/50",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-4",children:[l.jsx("h3",{className:"text-xl font-bold text-[#F5F5F5] group-hover:text-[#FB3939] transition-colors",children:i.title}),l.jsxs("div",{className:"flex items-center space-x-4 mt-2 sm:mt-0",children:[i.date&&l.jsxs("div",{className:"flex items-center text-[#A0A0A0] text-sm",children:[l.jsx(kd,{className:"w-4 h-4 mr-1"}),i.date]}),l.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium uppercase tracking-wide ${i.eventType==="personal"?"bg-pink-500/20 text-pink-300":i.eventType==="career"?"bg-yellow-500/20 text-yellow-300":i.eventType==="album"?"bg-purple-500/20 text-purple-300":i.eventType==="award"?"bg-green-500/20 text-green-300":i.eventType==="collaboration"?"bg-blue-500/20 text-blue-300":"bg-gray-500/20 text-gray-300"}`,children:i.eventType})]})]}),i.description&&l.jsx("p",{className:"text-[#E0E0E0] leading-relaxed mb-4",children:i.description}),i.significance&&l.jsxs("div",{className:"bg-[#2D2D2D] rounded-lg p-4 mb-4 border-l-4 border-[#FB3939]",children:[l.jsxs("h4",{className:"text-[#FB3939] font-semibold mb-2 flex items-center",children:[l.jsx(YF,{className:"w-4 h-4 mr-2"}),"Significance"]}),l.jsx("p",{className:"text-[#E0E0E0] text-sm leading-relaxed",children:i.significance})]}),i.relatedSongs&&i.relatedSongs.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsxs("span",{className:"text-[#A0A0A0] text-sm flex items-center",children:[l.jsx(As,{className:"w-4 h-4 mr-1"}),"Related Songs:"]}),i.relatedSongs.map((o,a)=>l.jsxs("span",{className:"bg-[#333] text-[#FB3939] px-2 py-1 rounded text-xs font-medium",children:['"',o,'"']},a))]})]})})]},i.id))}),l.jsxs("div",{className:"mt-12 bg-[#1E1E1E] rounded-xl p-6 border border-[#333]",children:[l.jsx("h4",{className:"text-lg font-bold text-[#F5F5F5] mb-4",children:"Timeline Legend"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 ga
4213p-4",children:[{type:"personal",label:"Personal Life",icon:G0},{type:"career",label:"Career Milestones",icon:As},{type:"album",label:"Album Releases",icon:As},{type:"award",label:"Awards & Recognition",icon:u3},{type:"collaboration",label:"Collaborations",icon:h3}].map(({type:i,label:s,icon:o})=>l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full border-2 ${r(i)}`,children:l.jsx(o,{className:"w-3 h-3 text-white"})}),l.jsx("span",{className:"text-[#A0A0A0] text-xs",children:s})]},i))})]})]})}function wte(){const{id:n}=K4(),e=parseInt(n||"0"),{data:t,isLoading:r,error:i}=Nt({queryKey:[`/api/eras/${e}`],enabled:!!e}),{data:s=[],isLoading:o}=Nt({queryKey:[`/api/eras/${e}/timeline-events`],enabled:!!e}),{data:a,isLoading:c}=Nt({queryKey:[`/api/artists/filter?eras=${e}`],enabled:!!e}),{data:u=[]}=Nt({queryKey:["/api/eras"]}),f=(a==null?void 0:a.artists)||[];if(console.log("Era ID:",e),console.log("Timeline Events:",s),console.log("Timeline Events Length:",s==null?void 0:s.length),console.log("Events Loading:",o),r)return l.jsx(bte,{});if(i||!t)return l.jsx("div",{className:"bg-[#121212] min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-4 py-12 text-center",children:[l.jsx("h1",{className:"text-3xl font-heading text-[#F5F5F5] mb-4",children:"Era Not Found"}),l.jsx("p",{className:"text-[#A0A0A0]",children:"The era you're looking for doesn't exist or has been removed."})]})});const p=t.startYear&&t.endYear?`${t.startYear} - ${t.endYear}`:t.startYear?`${t.startYear} - Present`:t.endYear?`Until ${t.endYear}`:"";return l.jsxs("div",{className:"bg-[#121212] min-h-screen",children:[l.jsxs("section",{className:"relative",children:[t.imageUrl&&l.jsxs("div",{className:"absolute inset-0 z-0",children:[l.jsx("img",{src:t.imageUrl,alt:t.name,className:"w-full h-full object-cover opacity-30"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-[#121212]/60 via-[#121212]/80 to-[#121212]"})]}),l.jsx("div",{className:"relative z-10 container mx-auto px-4 py-16",children:l.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-heading tracking-wider text-[#F5F5F5] mb-4",children:t.name}),p&&l.jsx("p",{className:"text-xl text-[#FB3939] font-semibold mb-6",children:p}),t.description&&l.jsx("p",{className:"text-lg text-[#E0E0E0] leading-relaxed max-w-3xl mx-auto",children:t.description})]})})]}),t.biographicalContext&&l.jsx("section",{className:"py-16 bg-[#1A1A1A]",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] text-center mb-8",children:["BIOGRAPHICAL ",l.jsx("span",{className:"text-[#FB3939]",children:"CONTEXT"})]}),l.jsx("div",{className:"bg-[#2D2D2D] rounded-xl p-8 border border-[#444] shadow-2xl",children:l.jsx("p",{className:"text-[#E0E0E0] leading-relaxed text-lg",children:t.biographicalContext})})]})})}),t.keyMilestones&&t.keyMilestones.length>0&&l.jsx("section",{className:"py-16",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] text-center mb-8",children:["KEY ",l.jsx("span",{className:"text-[#FB3939]",children:"MILESTONES"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.keyMilestones.map((m,x)=>l.jsx("div",{className:"bg-[#1E1E1E] rounded-xl p-6 border border-[#333] shadow-xl hover:border-[#FB3939]/50 transition-all duration-300 group",children:l.jsxs("div",{className:"flex items-start space-x-4",children:[l.jsx("div",{className:"flex-shrink-0 w-8 h-8 bg-[#FB3939] rounded-full flex items-center justify-center text-white font-bold text-sm",children:x+1}),l.jsx("p",{className:"text-[#E0E0E0] leading-relaxed group-hover:text-white transition-colors",children:m})]})},x))})]})})}),l.jsx("section",{className:"py-16",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5] text-center mb-4",children:["TIMELINE OF ",l.jsx("span",{className:"text-[#FB3939]",children:"EVENTS"})]}),l.jsxs("p",{className:"text-[#A0A0A0] text-center mb-8 max-w-2xl mx-auto",children:["Key moments and milestones from the ",t.name," period"]}),o?l.jsx(Ste,{}):s.length>0?l.jsx(_te,{events:s}):l.jsxs("div",{className:"text-center text-red-400 p-8",children:[l.jsx("p",{children:"No timeline events found for this era."}),l.jsxs("p",{children:["Timeline events count: ",(s==null?void 0:s.length)||0]})]})]})})}),f.length>0&&l.jsx("section",{className:"py-16 bg-[#1E1E1E]",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5] text-center mb-4",children:["FEATURED ",l.jsx("span",{className:"text-[#FB3939]",children:"ARTISTS"})]}),l.jsxs("p",{className:"text-[#A0A0A0] text-center mb-12 max-w-2xl mx-auto",children:["Artists who were active and influential during the ",t.name," period"]}),c?l.jsx(Ete,{}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(m=>l.jsx(WE,{id:m.id,name:m.name,slug:m.slug,imageUrl:m.imageUrl||"https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&h=400",bio:m.bio||"",genres:m.genres||[],eras:m.eras||[]},m.id))})]})})}),t.biographicalContext&&l.jsx("section",{className:"py-16",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5] text-center mb-8",children:["HISTORICAL ",l.jsx("span",{className:"text-[#FB3939]",children:"CONTEXT"})]}),l.jsx("div",{className:"prose prose-invert max-w-none",children:l.jsx("p",{className:"text-[#E0E0E0] leading-relaxed text-lg",children:t.biographicalContext})})]})})}),t.keyMilestones&&Array.isArray(t.keyMilestones)&&t.keyMilestones.length>0&&l.jsx("section",{className:"py-16 bg-[#1E1E1E]",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("h2",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5] text-center mb-8",children:["KEY ",l.jsx("span",{className:"text-[#FB3939]",children:"MILESTONES"})]}),l.jsx("div",{className:"grid gap-4",children:t.keyMilestones.map((m,x)=>l.jsxs("div",{className:"flex items-start gap-4 bg-[#2D2D2D] rounded-lg p-4",children:[l.jsx("div",{className:"w-2 h-2 bg-[#FB3939] rounded-full mt-2 flex-shrink-0"}),l.jsx("p",{className:"text-[#E0E0E0]",children:m})]},x))})]})})}),u.length>0&&l.jsx("section",{className:"py-16 bg-[#0D0D0D] border-t border-[#333]",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] text-center mb-8",children:["EXPLORE OTHER ",l.jsx("span",{className:"text-[#FB3939]",children:"ERAS"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:u.filter(m=>m.id!==e).sort((m,x)=>(m.startYear||0)-(x.startYear||0)).map(m=>l.jsxs("a",{href:`/eras/${m.id}`,className:"group block bg-[#1E1E1E] rounded-lg p-4 border border-[#333] hover:border-[#FB3939]/50 transition-all duration-300 hover:bg-[#2D2D2D]",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("h3",{className:"font-bold text-[#F5F5F5] group-hover:text-[#FB3939] transition-colors",children:m.name}),m.startYear&&m.endYear&&l.jsxs("span",{className:"text-xs text-[#A0A0A0] bg-[#333] px-2 py-1 rounded",children:[m.startYear,"-",m.endYear]})]}),l.jsx("p",{className:"text-sm text-[#A0A0A0] line-clamp-2",children:m.description})]},m.id))})]})})})]})}function bte(){return l.jsx("div",{className:"bg-[#121212] min-h-screen",children:l.jsx("div",{className:"container mx-auto px-4 py-16",children:l.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[l.jsx(yn,{className:"h-16 w-96 mx-auto mb-4 bg-[#2D2D2D]"}),l.jsx(yn,{className:"h-6 w-48 mx-auto mb-6 bg-[#2D2D2D]"}),l.jsx(yn,{className:"h-20 w-full max-w-3xl mx-auto bg-[#2D2D2D]"})]})})})}function Ste(){return l.jsx("div",{className:"space-y-8",children:[...Array(4)].map((n,e)=>l.jsx("div",{className:"relative flex items-start",children:l.jsx("div",{className:"w-full md:w-5/12 ml-12 md:ml-0",children:l.jsx(yn,{className:"h-48 w-full bg-[#2D2D2D] rounded-lg"})})},e))})}function Ete(){return l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[...Array(6)].map((n,e)=>l.jsx(yn,{className:"h-64 w-full bg-[#2D2D2D] rounded-lg"},e))})}function Mte({event:n,position:e,onClose:t}){const r=i=>`https://www.youtube.com/embed/${{personal:"XbGs_qK2PQA",career:"YVkUvmDQ3HY",album:"_Yhyp-_hX2s",award:"P9_VINMmsus",collaboration:"QM9-KeSxNY8"}[i.eventType]||"XbGs_qK2PQA"}?autoplay=0&rel=0`;return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:t,children:l.jsxs("div",{className:"bg-[#1E1E1E] rounded-xl p-6 max-w-2xl w-full mx-4 border border-[#FB3939]/50 shadow-2xl",onClick:i=>i.stopPropagation(),children:[l.jsxs("div",{className:"flex justify-between items-start mb-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-xl font-bold text-[#F5F5F5] mb-2",children:n.title}),l.jsxs("div",{className:"flex items-center space-x-4 text-sm text-[#A0A0A0]",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx(kd,{className:"w-4 h-4 mr-1"}),n.date]}),l.jsx("span",{className:`px-2 py-1 rounded text-xs uppercase ${n.eventType==="personal"?"bg-pink-500/20 text-pink-300":n.eventType==="career"?"bg-yellow-500/20 text-yellow-300":n.eventType==="album"?"bg-purple-500/20 text-purple-300":n.eventType==="award"?"bg-green-500/20 text-green-300":"bg-blue-500/20 text-blue-300"}`,children:n.eventType})]})]}),l.jsx("button",{onClick:t,className:"text-[#A0A0A0] hover:text-[#FB3939] transition-colors",children:l.jsx(yy,{className:"w-6 h-6"})})]}),l.jsx("div",{className:"aspect-video bg-black rounded-lg mb-4 overflow-hidden",children:l.jsx("iframe",{width:"100%",height:"100%",src:r(n),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"border-0"})}),n.description&&l.jsx("p",{className:"text-[#E0E0E0] mb-4",children:n.description}),n.significance&&l.jsxs("div",{className:"bg-[#2D2D2D] rounded-lg p-4 border-l-4 border-[#FB3939]",children:[l.jsx("h4",{className:"text-[#FB3939] font-semibold mb-2",children:"Significance"}),l.jsx("p",{className:"text-[#E0E0E0] text-sm",children:n.significance})]}),n.relatedSongs&&n.relatedSongs.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsx(As,{className:"w-4 h-4 mr-2 text-[#FB3939]"}),l.jsx("span",{className:"text-[#A0A0A0] text-sm",children:"Related Songs:"})]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:n.relatedSongs.map((i,s)=>l.jsxs("span",{className:"bg-[#333] text-[#FB3939] px-2 py-1 rounded text-xs",children:['"',i,'"']},s))})]})]})})}function Ate({event:n,position:e,onClick:t,index:r}){const i=T.useRef(null),[s,o]=T.useState(!1);Bh(c=>{i.current&&(i.current.rotation.x=c.clock.elapsedTime*.5,i.current.rotation.y=c.clock.elapsedTime*.3,s?i.current.scale.setScalar(1.5):i.current.scale.setScalar(1))});const a=c=>{switch(c.toLowerCase()){case"personal":return"#ec4899";case"career":return"#eab308";case"album":return"#a855f7";case"award":return"#22c55e";case"collaboration":return"#3b82f6";default:return"#6b7280"}};return l.jsxs("group",{position:e,children:[l.jsxs("mesh",{ref:i,onClick:()=>t(n),onPointerOver:()=>o(!0),onPointerOut:()=>o(!1),children:[l.jsx("sphereGeometry",{args:[.05,16,16]}),l.jsx("meshStandardMaterial",{color:a(n.eventType),emissive:a(n.eventType),emissiveIntensity:s?.3:.1})]}),s&&l.jsx(x5,{children:l.jsxs("div",{className:"bg-black/80 text-white px-2 py-1 rounded text-xs whitespace-nowrap pointer-events-none",children:[n.title," (",n.date,")"]})})]})}function Tte(){const n=T.useRef(null);return Bh(e=>{if(n.current){n.current.rotation.y=e.clock.elapsedTime*.1,n.current.rotation.x=Math.sin(e.clock.elapsedTime*.2)*.1;const t=1+Math.sin(e.clock.elapsedTime*.5)*.02;n.current.scale.setScalar(t)}}),l.jsxs("mesh",{ref:n,children:[l.jsx("sphereGeometry",{args:[1.5,64,64]}),l.jsx("meshStandardMaterial",{color:"#FB3939",metalness:.9,roughness:.1,transparent:!0,opacity:.25,emissive:"#FB3939",emissiveIntensity:.1})]})}function Cte({eraId:n,events:e}){const[t,r]=T.useState(null),i=n?`/api/eras/${n}/timeline-events`:"/api/timeline-events",{data:s=[],isLoading:o}=Nt({queryKey:[i],enabled:!e}),a=e||s||[];console.log("SphereTimeline render - eraId:",n,"provided events:",e==null?void 0:e.length,"fetched events:",s==null?void 0:s.length,"final events:",a==null?void 0:a.length);const c=u=>{r(u)};return!e&&o||!a||a.length===0?l.jsx("div",{className:"w-full h-[600px] bg-[#121212] flex items-center justify-center",children:l.jsx("div",{className:"text-[#F5F5F5] text-lg",children:"Loading timeline sphere..."})}):l.jsxs("div",{className:"relative w-full h-[600px] bg-gradient-to-b from-[#121212] to-[#0D0D0D] rounded-xl overflow-hidden",children:[t&&l.jsx(Mte,{event:t,position:[0,0],onClose:()=>r(null)}),l.jsxs(m5,{camera:{position:[0,0,4],fov:60},children:[l.jsx("ambientLight",{intensity:.4}),l.jsx("pointLight",{position:[10,10,10],intensity:1}),l.jsx("spotLight",{position:[-10,-10,-10],angle:.15,penumbra:1,intensity:.5}),l.jsxs(T.Suspense,{fallback:null,children:[l.jsx(Tte,{}),a.map((u,f)=>{const p=a.length,m=Math.acos(-1+2*f/p),x=Math.sqrt(p*Math.PI)*m,v=f/p*Math.PI*2,_=2.2,y=_*(Math.cos(x)*Math.sin(m)*.7+Math.cos(v)*.3),g=_*(Math.sin(x)*Math.sin(m)*.7+Math.sin(v)*.3),b=_*(Math.cos(m)*.7);return l.jsx(Ate,{event:u,position:[y,g,b],onClick:c,index:f},u.id)})]}),l.jsx(v5,{enableZoom:!0,enablePan:!0,enableRotate:!0,minDistance:2,maxDistance:8})]}),l.jsx("div",{className:"absolute bottom-4 left-4 bg-black/60 text-white px-3 py-2 rounded-lg text-sm",children:l.jsx("p",{children:"ð±ï¸ Drag to rotate ⢠ð Scroll to zoom ⢠⨠Click events for videos"})}),l.jsxs("div",{className:"absolute top-4 right-4 bg-black/60 text-white px-4 py-3 rounded-lg text-sm",children:[l.jsx("h4",{className:"font-bold mb-2",children:"Event Types"}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"w-3 h-3 bg-pink-500 rounded-full mr-2"}),l.jsx("span",{children:"Personal"})]}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full mr-2"}),l.jsx("span",{children:"Career"})]}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded-full mr-2"}),l.jsx("span",{children:"Album"})]}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full mr-2"}),l.jsx("span",{children:"Award"})]})]})]})]})}function Nte(){return l.jsx("div",{className:"bg-[#121212] min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-4 py-8",children:[l.jsxs("div",{className:"text-center mb-8",children:[l.jsxs("h1",{className:"text-4xl font-heading text-[#F5F5F5] mb-4",children:["3D SPHERE ",l.jsx("span",{className:"text-[#FB3939]",children:"TIMELINE"})]}),l.jsx("p",{className:"text-[#A0A0A0] max-w-2xl mx-auto",children:"Explore Eminem's entire timeline in an interactive 3D sphere. Rotate, zoom, and click on events to wat
4213ch related videos."})]}),l.jsx(Cte,{})]})})}function Rte(){return l.jsxs("div",{className:"bg-[#121212] min-h-screen",children:[l.jsxs("section",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 z-0 bg-gradient-to-b from-transparent to-[#121212]",children:l.jsx("div",{style:{backgroundImage:'url("https://images.unsplash.com/photo-1470229722913-7c0e2dbbafd3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&h=600")',backgroundSize:"cover",backgroundPosition:"center"},className:"w-full h-full opacity-40"})}),l.jsxs("div",{className:"relative z-10 container mx-auto px-4 py-16 md:py-24",children:[l.jsxs("h1",{className:"text-4xl md:text-6xl font-heading tracking-wider mb-4 text-white text-center",children:["ABOUT ",l.jsx("span",{className:"text-[#FB3939]",children:"SHADYMUSIC"})]}),l.jsx("p",{className:"text-lg md:text-xl text-[#E0E0E0] max-w-3xl mx-auto text-center",children:"A music sanctuary for shady fans and all music lovers"})]})]}),l.jsx("section",{className:"py-12",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-4xl mx-auto bg-[#1E1E1E] rounded-2xl p-6 md:p-10 shadow-lg",children:[l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] mb-6",children:["OUR ",l.jsx("span",{className:"text-[#FB3939]",children:"MISSION"})]}),l.jsx("p",{className:"text-[#E0E0E0] mb-8",children:"ShadyMusic.com was created to celebrate the significant impact Eminem has had on the music industry and to showcase the many artists who have been influenced by his groundbreaking style, lyricism, and artistic vision. Our mission is to connect fans with a diverse array of musicians across all genres who share Eminem's innovative spirit."}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] mb-6",children:["WHAT WE ",l.jsx("span",{className:"text-[#FB3939]",children:"OFFER"})]}),l.jsxs("div",{className:"space-y-4 mb-8",children:[l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"text-[#FB3939] mr-3 mt-1",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-[#F5F5F5]",children:"Comprehensive Artist Directory"}),l.jsx("p",{className:"text-[#E0E0E0]",children:"Our extensive database features artists from various genres and eras who have been influenced by Eminem in their musical journey."})]})]}),l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"text-[#FB3939] mr-3 mt-1",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-[#F5F5F5]",children:"Community Engagement"}),l.jsx("p",{className:"text-[#E0E0E0]",children:"Join our vibrant community where you can review artists, comment on profiles, and connect with other music enthusiasts who share your passion."})]})]}),l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"text-[#FB3939] mr-3 mt-1",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-[#F5F5F5]",children:"Genre and Era Exploration"}),l.jsx("p",{className:"text-[#E0E0E0]",children:"Discover how Eminem's influence transcends traditional boundaries, spanning across genres from rap to rock to pop, and crossing multiple decades."})]})]}),l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"text-[#FB3939] mr-3 mt-1",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-[#F5F5F5]",children:"Music Discovery"}),l.jsx("p",{className:"text-[#E0E0E0]",children:"Find your next favorite artist through our curated selections, user reviews, and easy-to-use search and filter tools."})]})]})]}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] mb-6",children:["THE ",l.jsx("span",{className:"text-[#FB3939]",children:"TEAM"})]}),l.jsx("p",{className:"text-[#E0E0E0] mb-8",children:"ShadyMusic.com is created by a dedicated team of music enthusiasts and Eminem fans who are passionate about building a comprehensive resource for discovering artists influenced by the legendary rapper. Our team works tirelessly to research, catalog, and present information on artists from around the world."}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-heading text-[#F5F5F5] mb-6",children:["JOIN ",l.jsx("span",{className:"text-[#FB3939]",children:"US"})]}),l.jsx("p",{className:"text-[#E0E0E0] mb-6",children:"We invite you to become part of our growing community. Create an account to:"}),l.jsxs("ul",{className:"list-disc pl-8 text-[#E0E0E0] space-y-2 mb-8",children:[l.jsx("li",{children:"Rate and review your favorite artists"}),l.jsx("li",{children:"Comment on artist profiles and engage with the community"}),l.jsx("li",{children:"Save artists to your favorites for easy access"}),l.jsx("li",{children:"Receive updates on new artists added to our directory"})]}
vendor: 12,871 bytes, line 4213
4213),l.jsx("p",{className:"text-[#E0E0E0]",children:"Thank you for visiting ShadyMusic.com. We hope our platform helps you discover amazing artists and connect with a community that shares your passion for music influenced by one of the greatest rappers of all time."})]})})})]})}var Mm=n=>n.type==="checkbox",kc=n=>n instanceof Date,hi=n=>n==null;const Sj=n=>typeof n=="object";var nr=n=>!hi(n)&&!Array.isArray(n)&&Sj(n)&&!kc(n),Ej=n=>nr(n)&&n.target?Mm(n.target)?n.target.checked:n.target.value:n,Pte=n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n,Mj=(n,e)=>n.has(Pte(e)),Ite=n=>{const e=n.constructor&&n.constructor.prototype;return nr(e)&&e.hasOwnProperty("isPrototypeOf")},VM=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Pr(n){let e;const t=Array.isArray(n),r=typeof FileList<"u"?n instanceof FileList:!1;if(n instanceof Date)e=new Date(n);else if(n instanceof Set)e=new Set(n);else if(!(VM&&(n instanceof Blob||r))&&(t||nr(n)))if(e=t?[]:{},!t&&!Ite(n))e=n;else for(const i in n)n.hasOwnProperty(i)&&(e[i]=Pr(n[i]));else return n;return e}var m1=n=>Array.isArray(n)?n.filter(Boolean):[],Jn=n=>n===void 0,Ye=(n,e,t)=>{if(!e||!nr(n))return t;const r=m1(e.split(/[,[\].]+?/)).reduce((i,s)=>hi(i)?i:i[s],n);return Jn(r)||r===n?Jn(n[e])?t:n[e]:r},Qi=n=>typeof n=="boolean",HM=n=>/^\w*$/.test(n),Aj=n=>m1(n.replace(/["|']|\]/g,"").split(/\.|\[/)),vn=(n,e,t)=>{let r=-1;const i=HM(e)?[e]:Aj(e),s=i.length,o=s-1;for(;++r<s;){const a=i[r];let c=t;if(r!==o){const u=n[a];c=nr(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;n[a]=c,n=n[a]}};const Bv={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Zs={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ra={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Tj=Ot.createContext(null),g1=()=>Ot.useContext(Tj),Fte=n=>{const{children:e,...t}=n;return Ot.createElement(Tj.Provider,{value:t},e)};var Cj=(n,e,t,r=!0)=>{const i={defaultValues:e._defaultValues};for(const s in n)Object.defineProperty(i,s,{get:()=>{const o=s;return e._proxyFormState[o]!==Zs.all&&(e._proxyFormState[o]=!r||Zs.all),t&&(t[o]=!0),n[o]}});return i};function Dte(n){const e=g1(),{control:t=e.control,disabled:r,name:i,exact:s}=n||{},[o,a]=Ot.useState(t._formState),c=Ot.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=Ot.useRef(i);return u.current=i,Ot.useEffect(()=>t._subscribe({name:u.current,formState:c.current,exact:s,callback:f=>{!r&&a({...t._formState,...f})}}),[t,r,s]),Ot.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),Ot.useMemo(()=>Cj(o,t,c.current,!1),[o,t])}var Co=n=>typeof n=="string",Nj=(n,e,t,r,i)=>Co(n)?(r&&e.watch.add(n),Ye(t,n,i)):Array.isArray(n)?n.map(s=>(r&&e.watch.add(s),Ye(t,s))):(r&&(e.watchAll=!0),t);function kte(n){const e=g1(),{control:t=e.control,name:r,defaultValue:i,disabled:s,exact:o}=n||{},a=Ot.useRef(r),c=Ot.useRef(i);a.current=r,Ot.useEffect(()=>t._subscribe({name:a.current,formState:{values:!0},exact:o,callback:p=>!s&&f(Nj(a.current,t._names,p.values||t._formValues,!1,c.current))}),[t,s,o]);const[u,f]=Ot.useState(t._getWatch(r,i));return Ot.useEffect(()=>t._removeUnmounted()),u}function Lte(n){const e=g1(),{name:t,disabled:r,control:i=e.control,shouldUnregister:s}=n,o=Mj(i._names.array,t),a=kte({control:i,name:t,defaultValue:Ye(i._formValues,t,Ye(i._defaultValues,t,n.defaultValue)),exact:!0}),c=Dte({control:i,name:t,exact:!0}),u=Ot.useRef(n),f=Ot.useRef(i.register(t,{...n.rules,value:a,...Qi(n.disabled)?{disabled:n.disabled}:{}})),p=Ot.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ye(c.errors,t)},isDirty:{enumerable:!0,get:()=>!!Ye(c.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!Ye(c.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!Ye(c.validatingFields,t)},error:{enumerable:!0,get:()=>Ye(c.errors,t)}}),[c,t]),m=Ot.useCallback(y=>f.current.onChange({target:{value:Ej(y),name:t},type:Bv.CHANGE}),[t]),x=Ot.useCallback(()=>f.current.onBlur({target:{value:Ye(i._formValues,t),name:t},type:Bv.BLUR}),[t,i._formValues]),v=Ot.useCallback(y=>{const g=Ye(i._fields,t);g&&y&&(g._f.ref={focus:()=>y.focus(),select:()=>y.select(),setCustomValidity:b=>y.setCustomValidity(b),reportValidity:()=>y.reportValidity()})},[i._fields,t]),_=Ot.useMemo(()=>({name:t,value:a,...Qi(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:m,onBlur:x,ref:v}),[t,r,c.disabled,m,x,v,a]);return Ot.useEffect(()=>{const y=i._options.shouldUnregister||s;i.register(t,{...u.current.rules,...Qi(u.current.disabled)?{disabled:u.current.disabled}:{}});const g=(b,S)=>{const M=Ye(i._fields,b);M&&M._f&&(M._f.mount=S)};if(g(t,!0),y){const b=Pr(Ye(i._options.defaultValues,t));vn(i._defaultValues,t,b),Jn(Ye(i._formValues,t))&&vn(i._formValues,t,b)}return!o&&i.register(t),()=>{(o?y&&!i._state.action:y)?i.unregister(t):g(t,!1)}},[t,i,o,s]),Ot.useEffect(()=>{i._setDisabledField({disabled:r,name:t})},[r,t,i]),Ot.useMemo(()=>({field:_,formState:c,fieldState:p}),[_,c,p])}const f2=n=>n.render(Lte(n));var Rj=(n,e,t,r,i)=>e?{...t[n],types:{...t[n]&&t[n].types?t[n].types:{},[r]:i||!0}}:{},fp=n=>Array.isArray(n)?n:[n],OR=()=>{let n=[];return{get observers(){return n},next:i=>{for(const s of n)s.next&&s.next(i)},subscribe:i=>(n.push(i),{unsubscribe:()=>{n=n.filter(s=>s!==i)}}),unsubscribe:()=>{n=[]}}},p2=n=>hi(n)||!Sj(n);function ll(n,e){if(p2(n)||p2(e))return n===e;if(kc(n)&&kc(e))return n.getTime()===e.getTime();const t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(const i of t){const s=n[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=e[i];if(kc(s)&&kc(o)||nr(s)&&nr(o)||Array.isArray(s)&&Array.isArray(o)?!ll(s,o):s!==o)return!1}}return!0}var ui=n=>nr(n)&&!Object.keys(n).length,WM=n=>n.type==="file",Qs=n=>typeof n=="function",zv=n=>{if(!VM)return!1;const e=n?n.ownerDocument:0;return n instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},Pj=n=>n.type==="select-multiple",GM=n=>n.type==="radio",jte=n=>GM(n)||Mm(n),yb=n=>zv(n)&&n.isConnected;function Ote(n,e){const t=e.slice(0,-1).length;let r=0;for(;r<t;)n=Jn(n)?r++:n[e[r++]];return n}function Ute(n){for(const e in n)if(n.hasOwnProperty(e)&&!Jn(n[e]))return!1;return!0}function hr(n,e){const t=Array.isArray(e)?e:HM(e)?[e]:Aj(e),r=t.length===1?n:Ote(n,t),i=t.length-1,s=t[i];return r&&delete r[s],i!==0&&(nr(r)&&ui(r)||Array.isArray(r)&&Ute(r))&&hr(n,t.slice(0,-1)),n}var Ij=n=>{for(const e in n)if(Qs(n[e]))return!0;return!1};function Vv(n,e={}){const t=Array.isArray(n);if(nr(n)||t)for(const r in n)Array.isArray(n[r])||nr(n[r])&&!Ij(n[r])?(e[r]=Array.isArray(n[r])?[]:{},Vv(n[r],e[r])):hi(n[r])||(e[r]=!0);return e}function Fj(n,e,t){const r=Array.isArray(n);if(nr(n)||r)for(const i in n)Array.isArray(n[i])||nr(n[i])&&!Ij(n[i])?Jn(e)||p2(t[i])?t[i]=Array.isArray(n[i])?Vv(n[i],[]):{...Vv(n[i])}:Fj(n[i],hi(e)?{}:e[i],t[i]):t[i]=!ll(n[i],e[i]);return t}var Ff=(n,e)=>Fj(n,e,Vv(e));const UR={value:!1,isValid:!1},BR={value:!0,isValid:!0};var Dj=n=>{if(Array.isArray(n)){if(n.length>1){const e=n.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:e,isValid:!!e.length}}return n[0].checked&&!n[0].disabled?n[0].attributes&&!Jn(n[0].attributes.value)?Jn(n[0].value)||n[0].value===""?BR:{value:n[0].value,isValid:!0}:BR:UR}return UR},kj=(n,{valueAsNumber:e,valueAsDate:t,setValueAs:r})=>Jn(n)?n:e?n===""?NaN:n&&+n:t&&Co(n)?new Date(n):r?r(n):n;const zR={isValid:!1,value:null};var Lj=n=>Array.isArray(n)?n.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,zR):zR;function VR(n){const e=n.ref;return WM(e)?e.files:GM(e)?Lj(n.refs).value:Pj(e)?[...e.selectedOptions].map(({value:t})=>t):Mm(e)?Dj(n.refs).value:kj(Jn(e.value)?n.ref.value:e.value,n)}var Bte=(n,e,t,r)=>{const i={};for(const s of n){const o=Ye(e,s);o&&vn(i,s,o._f)}return{criteriaMode:t,names:[...n],fields:i,shouldUseNativeValidation:r}},Hv=n=>n instanceof RegExp,Df=n=>Jn(n)?n:Hv(n)?n.source:nr(n)?Hv(n.value)?n.value.source:n.value:n,HR=n=>({isOnSubmit:!n||n===Zs.onSubmit,isOnBlur:n===Zs.onBlur,isOnChange:n===Zs.onChange,isOnAll:n===Zs.all,isOnTouch:n===Zs.onTouched});const WR="AsyncFunction";var zte=n=>!!n&&!!n.validate&&!!(Qs(n.validate)&&n.validate.constructor.name===WR||nr(n.validate)&&Object.values(n.validate).find(e=>e.constructor.name===WR)),Vte=n=>n.mount&&(n.required||n.min||n.max||n.maxLength||n.minLength||n.pattern||n.validate),GR=(n,e,t)=>!t&&(e.watchAll||e.watch.has(n)||[...e.watch].some(r=>n.startsWith(r)&&/^\.\w+/.test(n.slice(r.length))));const pp=(n,e,t,r)=>{for(const i of t||Object.keys(n)){const s=Ye(n,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],i)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if(pp(a,e))break}else if(nr(a)&&pp(a,e))break}}};function $R(n,e,t){const r=Ye(n,t);if(r||HM(t))return{error:r,name:t};const i=t.split(".");for(;i.length;){const s=i.join("."),o=Ye(e,s),a=Ye(n,s);if(o&&!Array.isArray(o)&&t!==s)return{name:t};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:t}}var Hte=(n,e,t,r)=>{t(n);const{name:i,...s}=n;return ui(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(o=>e[o]===(!r||Zs.all))},Wte=(n,e,t)=>!n||!e||n===e||fp(n).some(r=>r&&(t?r===e:r.startsWith(e)||e.startsWith(r))),Gte=(n,e,t,r,i)=>i.isOnAll?!1:!t&&i.isOnTouch?!(e||n):(t?r.isOnBlur:i.isOnBlur)?!n:(t?r.isOnChange:i.isOnChange)?n:!0,$te=(n,e)=>!m1(Ye(n,e)).length&&hr(n,e),Xte=(n,e,t)=>{const r=fp(Ye(n,t));return vn(r,"root",e[t]),vn(n,t,r),n},g0=n=>Co(n);function XR(n,e,t="validate"){if(g0(n)||Array.isArray(n)&&n.every(g0)||Qi(n)&&!n)return{type:t,message:g0(n)?n:"",ref:e}}var ad=n=>nr(n)&&!Hv(n)?n:{value:n,message:""},qR=async(n,e,t,r,i,s)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:f,min:p,max:m,pattern:x,validate:v,name:_,valueAsNumber:y,mount:g}=n._f,b=Ye(t,_);if(!g||e.has(_))return{};const S=a?a[0]:o,M=O=>{i&&S.reportValidity&&(S.setCustomValidity(Qi(O)?"":O||""),S.reportValidity())},A={},R=GM(o),F=Mm(o),L=R||F,N=(y||WM(o))&&Jn(o.value)&&Jn(b)||zv(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length,I=Rj.bind(null,_,r,A),D=(O,U,V,Z=ra.maxLength,Y=ra.minLength)=>{const ne=O?U:V;A[_]={type:O?Z:Y,message:ne,ref:o,...I(O?Z:Y,ne)}};if(s?!Array.isArray(b)||!b.length:c&&(!L&&(N||hi(b))||Qi(b)&&!b||F&&!Dj(a).isValid||R&&!Lj(a).isValid)){const{value:O,message:U}=g0(c)?{value:!!c,message:c}:ad(c);if(O&&(A[_]={type:ra.required,message:U,ref:S,...I(ra.required,U)},!r))return M(U),A}if(!N&&(!hi(p)||!hi(m))){let O,U;const V=ad(m),Z=ad(p);if(!hi(b)&&!isNaN(b)){const Y=o.valueAsNumber||b&&+b;hi(V.value)||(O=Y>V.value),hi(Z.value)||(U=Y<Z.value)}else{const Y=o.valueAsDate||new Date(b),ne=K=>new Date(new Date().toDateString()+" "+K),j=o.type=="time",$=o.type=="week";Co(V.value)&&b&&(O=j?ne(b)>ne(V.value):$?b>V.value:Y>new Date(V.value)),Co(Z.value)&&b&&(U=j?ne(b)<ne(Z.value):$?b<Z.value:Y<new Date(Z.value))}if((O||U)&&(D(!!O,V.message,Z.message,ra.max,ra.min),!r))return M(A[_].message),A}if((u||f)&&!N&&(Co(b)||s&&Array.isArray(b))){const O=ad(u),U=ad(f),V=!hi(O.value)&&b.length>+O.value,Z=!hi(U.value)&&b.length<+U.value;if((V||Z)&&(D(V,O.message,U.message),!r))return M(A[_].message),A}if(x&&!N&&Co(b)){const{value:O,message:U}=ad(x);if(Hv(O)&&!b.match(O)&&(A[_]={type:ra.pattern,message:U,ref:o,...I(ra.pattern,U)},!r))return M(U),A}if(v){if(Qs(v)){const O=await v(b,t),U=XR(O,S);if(U&&(A[_]={...U,...I(ra.validate,U.message)},!r))return M(U.message),A}else if(nr(v)){let O={};for(const U in v){if(!ui(O)&&!r)break;const V=XR(await v[U](b,t),S,U);V&&(O={...V,...I(U,V.message)},M(V.message),r&&(A[_]=O))}if(!ui(O)&&(A[_]={ref:S,...O},!r))return A}}return M(!0),A};const qte={mode:Zs.onSubmit,reValidateMode:Zs.onChange,shouldFocusError:!0};function Yte(n={}){let e={...qte,...n},t={submitCount:0,isDirty:!1,isLoading:Qs(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const r={};let i=nr(e.defaultValues)||nr(e.values)?Pr(e.values||e.defaultValues)||{}:{},s=e.shouldUnregister?{}:Pr(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...f};const m={array:OR(),state:OR()},x=HR(e.mode),v=HR(e.reValidateMode),_=e.criteriaMode===Zs.all,y=P=>B=>{clearTimeout(u),u=setTimeout(P,B)},g=async P=>{if(!e.disabled&&(f.isValid||p.isValid||P)){const B=e.resolver?ui((await N()).errors):await D(r,!0);B!==t.isValid&&m.state.next({isValid:B})}},b=(P,B)=>{!e.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((P||Array.from(a.mount)).forEac
vendor: 5,072 bytes, line 4213
4213h(q=>{q&&(B?vn(t.validatingFields,q,B):hr(t.validatingFields,q))}),m.state.next({validatingFields:t.validatingFields,isValidating:!ui(t.validatingFields)}))},S=(P,B=[],q,se,J=!0,ue=!0)=>{if(se&&q&&!e.disabled){if(o.action=!0,ue&&Array.isArray(Ye(r,P))){const me=q(Ye(r,P),se.argA,se.argB);J&&vn(r,P,me)}if(ue&&Array.isArray(Ye(t.errors,P))){const me=q(Ye(t.errors,P),se.argA,se.argB);J&&vn(t.errors,P,me),$te(t.errors,P)}if((f.touchedFields||p.touchedFields)&&ue&&Array.isArray(Ye(t.touchedFields,P))){const me=q(Ye(t.touchedFields,P),se.argA,se.argB);J&&vn(t.touchedFields,P,me)}(f.dirtyFields||p.dirtyFields)&&(t.dirtyFields=Ff(i,s)),m.state.next({name:P,isDirty:U(P,B),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else vn(s,P,B)},M=(P,B)=>{vn(t.errors,P,B),m.state.next({errors:t.errors})},A=P=>{t.errors=P,m.state.next({errors:t.errors,isValid:!1})},R=(P,B,q,se)=>{const J=Ye(r,P);if(J){const ue=Ye(s,P,Jn(q)?Ye(i,P):q);Jn(ue)||se&&se.defaultChecked||B?vn(s,P,B?ue:VR(J._f)):Y(P,ue),o.mount&&g()}},F=(P,B,q,se,J)=>{let ue=!1,me=!1;const Oe={name:P};if(!e.disabled){if(!q||se){(f.isDirty||p.isDirty)&&(me=t.isDirty,t.isDirty=Oe.isDirty=U(),ue=me!==Oe.isDirty);const Ze=ll(Ye(i,P),B);me=!!Ye(t.dirtyFields,P),Ze?hr(t.dirtyFields,P):vn(t.dirtyFields,P,!0),Oe.dirtyFields=t.dirtyFields,ue=ue||(f.dirtyFields||p.dirtyFields)&&me!==!Ze}if(q){const Ze=Ye(t.touchedFields,P);Ze||(vn(t.touchedFields,P,q),Oe.touchedFields=t.touchedFields,ue=ue||(f.touchedFields||p.touchedFields)&&Ze!==q)}ue&&J&&m.state.next(Oe)}return ue?Oe:{}},L=(P,B,q,se)=>{const J=Ye(t.errors,P),ue=(f.isValid||p.isValid)&&Qi(B)&&t.isValid!==B;if(e.delayError&&q?(c=y(()=>M(P,q)),c(e.delayError)):(clearTimeout(u),c=null,q?vn(t.errors,P,q):hr(t.errors,P)),(q?!ll(J,q):J)||!ui(se)||ue){const me={...se,...ue&&Qi(B)?{isValid:B}:{},errors:t.errors,name:P};t={...t,...me},m.state.next(me)}},N=async P=>{b(P,!0);const B=await e.resolver(s,e.context,Bte(P||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return b(P),B},I=async P=>{const{errors:B}=await N(P);if(P)for(const q of P){const se=Ye(B,q);se?vn(t.errors,q,se):hr(t.errors,q)}else t.errors=B;return B},D=async(P,B,q={valid:!0})=>{for(const se in P){const J=P[se];if(J){const{_f:ue,...me}=J;if(ue){const Oe=a.array.has(ue.name),Ze=J._f&&zte(J._f);Ze&&f.validatingFields&&b([se],!0);const Me=await qR(J,a.disabled,s,_,e.shouldUseNativeValidation&&!B,Oe);if(Ze&&f.validatingFields&&b([se]),Me[ue.name]&&(q.valid=!1,B))break;!B&&(Ye(Me,ue.name)?Oe?Xte(t.errors,Me,ue.name):vn(t.errors,ue.name,Me[ue.name]):hr(t.errors,ue.name))}!ui(me)&&await D(me,B,q)}}return q.valid},O=()=>{for(const P of a.unMount){const B=Ye(r,P);B&&(B._f.refs?B._f.refs.every(q=>!yb(q)):!yb(B._f.ref))&&nt(P)}a.unMount=new Set},U=(P,B)=>!e.disabled&&(P&&B&&vn(s,P,B),!ll(xe(),i)),V=(P,B,q)=>Nj(P,a,{...o.mount?s:Jn(B)?i:Co(P)?{[P]:B}:B},q,B),Z=P=>m1(Ye(o.mount?s:i,P,e.shouldUnregister?Ye(i,P,[]):[])),Y=(P,B,q={})=>{const se=Ye(r,P);let J=B;if(se){const ue=se._f;ue&&(!ue.disabled&&vn(s,P,kj(B,ue)),J=zv(ue.ref)&&hi(B)?"":B,Pj(ue.ref)?[...ue.ref.options].forEach(me=>me.selected=J.includes(me.value)):ue.refs?Mm(ue.ref)?ue.refs.length>1?ue.refs.forEach(me=>(!me.defaultChecked||!me.disabled)&&(me.checked=Array.isArray(J)?!!J.find(Oe=>Oe===me.value):J===me.value)):ue.refs[0]&&(ue.refs[0].checked=!!J):ue.refs.forEach(me=>me.checked=me.value===J):WM(ue.ref)?ue.ref.value="":(ue.ref.value=J,ue.ref.type||m.state.next({name:P,values:Pr(s)})))}(q.shouldDirty||q.shouldTouch)&&F(P,J,q.shouldTouch,q.shouldDirty,!0),q.shouldValidate&&re(P)},ne=(P,B,q)=>{for(const se in B){const J=B[se],ue=`${P}.${se}`,me=Ye(r,ue);(a.array.has(P)||nr(J)||me&&!me._f)&&!kc(J)?ne(ue,J,q):Y(ue,J,q)}},j=(P,B,q={})=>{const se=Ye(r,P),J=a.array.has(P),ue=Pr(B);vn(s,P,ue),J?(m.array.next({name:P,values:Pr(s)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&q.shouldDirty&&m.state.next({name:P,dirtyFields:Ff(i,s),isDirty:U(P,ue)})):se&&!se._f&&!hi(ue)?ne(P,ue,q):Y(P,ue,q),GR(P,a)&&m.state.next({...t}),m.state.next({name:o.mount?P:void 0,values:Pr(s)})},$=async P=>{o.mount=!0;const B=P.target;let q=B.name,se=!0;const J=Ye(r,q),ue=me=>{se=Number.isNaN(me)||kc(me)&&isNaN(me.getTime())||ll(me,Ye(s,q,me))};if(J){let me,Oe;const Ze=B.type?VR(J._f):Ej(P),Me=P.type===Bv.BLUR||P.type===Bv.FOCUS_OUT,Je=!Vte(J._f)&&!e.resolver&&!Ye(t.errors,q)&&!J._f.deps||Gte(Me,Ye(t.touchedFields,q),t.isSubmitted,v,x),gt=GR(q,a,Me);vn(s,q,Ze),Me?(J._f.onBlur&&J._f.onBlur(P),c&&c(0)):J._f.onChange&&J._f.onChange(P);const wt=F(q,Ze,Me),rt=!ui(wt)||gt;if(!Me&&m.state.next({name:q,type:P.type,values:Pr(s)}),Je)return(f.isValid||p.isValid)&&(e.mode==="onBlur"?Me&&g():Me||g()),rt&&m.state.next({name:q,...gt?{}:wt});if(!Me&>&&m.state.next({...t}),e.resolver){const{errors:ee}=await N([q]);if(ue(Ze),se){const we=$R(t.errors,r,q),We=$R(ee,r,we.name||q);me=We.error,q=We.name,Oe=ui(ee)}}else b([q],!0),me=(await qR(J,a.disabled,s,_,e.shouldUseNativeValidation))[q],b([q]),ue(Ze),se&&(me?Oe=!1:(f.isValid||p.isValid)&&(Oe=await D(r,!0)));se&&(J._f.deps&&re(J._f.deps),L(q,Oe,me,wt))}},K=(P,B)=>
vendor: 10,108 bytes, line 4213
4213{if(Ye(t.errors,B)&&P.focus)return P.focus(),1},re=async(P,B={})=>{let q,se;const J=fp(P);if(e.resolver){const ue=await I(Jn(P)?P:J);q=ui(ue),se=P?!J.some(me=>Ye(ue,me)):q}else P?(se=(await Promise.all(J.map(async ue=>{const me=Ye(r,ue);return await D(me&&me._f?{[ue]:me}:me)}))).every(Boolean),!(!se&&!t.isValid)&&g()):se=q=await D(r);return m.state.next({...!Co(P)||(f.isValid||p.isValid)&&q!==t.isValid?{}:{name:P},...e.resolver||!P?{isValid:q}:{},errors:t.errors}),B.shouldFocus&&!se&&pp(r,K,P?J:a.mount),se},xe=P=>{const B={...o.mount?s:i};return Jn(P)?B:Co(P)?Ye(B,P):P.map(q=>Ye(B,q))},Ce=(P,B)=>({invalid:!!Ye((B||t).errors,P),isDirty:!!Ye((B||t).dirtyFields,P),error:Ye((B||t).errors,P),isValidating:!!Ye(t.validatingFields,P),isTouched:!!Ye((B||t).touchedFields,P)}),ce=P=>{P&&fp(P).forEach(B=>hr(t.errors,B)),m.state.next({errors:P?t.errors:{}})},_e=(P,B,q)=>{const se=(Ye(r,P,{_f:{}})._f||{}).ref,J=Ye(t.errors,P)||{},{ref:ue,message:me,type:Oe,...Ze}=J;vn(t.errors,P,{...Ze,...B,ref:se}),m.state.next({name:P,errors:t.errors,isValid:!1}),q&&q.shouldFocus&&se&&se.focus&&se.focus()},Re=(P,B)=>Qs(P)?m.state.subscribe({next:q=>P(V(void 0,B),q)}):V(P,B,!0),pe=P=>m.state.subscribe({next:B=>{Wte(P.name,B.name,P.exact)&&Hte(B,P.formState||f,Ke,P.reRenderRoot)&&P.callback({values:{...s},...t,...B})}}).unsubscribe,je=P=>(o.mount=!0,p={...p,...P.formState},pe({...P,formState:p})),nt=(P,B={})=>{for(const q of P?fp(P):a.mount)a.mount.delete(q),a.array.delete(q),B.keepValue||(hr(r,q),hr(s,q)),!B.keepError&&hr(t.errors,q),!B.keepDirty&&hr(t.dirtyFields,q),!B.keepTouched&&hr(t.touchedFields,q),!B.keepIsValidating&&hr(t.validatingFields,q),!e.shouldUnregister&&!B.keepDefaultValue&&hr(i,q);m.state.next({values:Pr(s)}),m.state.next({...t,...B.keepDirty?{isDirty:U()}:{}}),!B.keepIsValid&&g()},Pe=({disabled:P,name:B})=>{(Qi(P)&&o.mount||P||a.disabled.has(B))&&(P?a.disabled.add(B):a.disabled.delete(B))},Ie=(P,B={})=>{let q=Ye(r,P);const se=Qi(B.disabled)||Qi(e.disabled);return vn(r,P,{...q||{},_f:{...q&&q._f?q._f:{ref:{name:P}},name:P,mount:!0,...B}}),a.mount.add(P),q?Pe({disabled:Qi(B.disabled)?B.disabled:e.disabled,name:P}):R(P,!0,B.value),{...se?{disabled:B.disabled||e.disabled}:{},...e.progressive?{required:!!B.required,min:Df(B.min),max:Df(B.max),minLength:Df(B.minLength),maxLength:Df(B.maxLength),pattern:Df(B.pattern)}:{},name:P,onChange:$,onBlur:$,ref:J=>{if(J){Ie(P,B),q=Ye(r,P);const ue=Jn(J.value)&&J.querySelectorAll&&J.querySelectorAll("input,select,textarea")[0]||J,me=jte(ue),Oe=q._f.refs||[];if(me?Oe.find(Ze=>Ze===ue):ue===q._f.ref)return;vn(r,P,{_f:{...q._f,...me?{refs:[...Oe.filter(yb),ue,...Array.isArray(Ye(i,P))?[{}]:[]],ref:{type:ue.type,name:P}}:{ref:ue}}}),R(P,!1,void 0,ue)}else q=Ye(r,P,{}),q._f&&(q._f.mount=!1),(e.shouldUnregister||B.shouldUnregister)&&!(Mj(a.array,P)&&o.action)&&a.unMount.add(P)}}},He=()=>e.shouldFocusError&&pp(r,K,a.mount),ze=P=>{Qi(P)&&(m.state.next({disabled:P}),pp(r,(B,q)=>{const se=Ye(r,q);se&&(B.disabled=se._f.disabled||P,Array.isArray(se._f.refs)&&se._f.refs.forEach(J=>{J.disabled=se._f.disabled||P}))},0,!1))},H=(P,B)=>async q=>{let se;q&&(q.preventDefault&&q.preventDefault(),q.persist&&q.persist());let J=Pr(s);if(m.state.next({isSubmitting:!0}),e.resolver){const{errors:ue,values:me}=await N();t.errors=ue,J=me}else await D(r);if(a.disabled.size)for(const ue of a.disabled)vn(J,ue,void 0);if(hr(t.errors,"root"),ui(t.errors)){m.state.next({errors:{}});try{await P(J,q)}catch(ue){se=ue}}else B&&await B({...t.errors},q),He(),setTimeout(He);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ui(t.errors)&&!se,submitCount:t.submitCount+1,errors:t.errors}),se)throw se},Fe=(P,B={})=>{Ye(r,P)&&(Jn(B.defaultValue)?j(P,Pr(Ye(i,P))):(j(P,B.defaultValue),vn(i,P,Pr(B.defaultValue))),B.keepTouched||hr(t.touchedFields,P),B.keepDirty||(hr(t.dirtyFields,P),t.isDirty=B.defaultValue?U(P,Pr(Ye(i,P))):U()),B.keepError||(hr(t.errors,P),f.isValid&&g()),m.state.next({...t}))},Ae=(P,B={})=>{const q=P?Pr(P):i,se=Pr(q),J=ui(P),ue=J?i:se;if(B.keepDefaultValues||(i=q),!B.keepValues){if(B.keepDirtyValues){const me=new Set([...a.mount,...Object.keys(Ff(i,s))]);for(const Oe of Array.from(me))Ye(t.dirtyFields,Oe)?vn(ue,Oe,Ye(s,Oe)):j(Oe,Ye(ue,Oe))}else{if(VM&&Jn(P))for(const me of a.mount){const Oe=Ye(r,me);if(Oe&&Oe._f){const Ze=Array.isArray(Oe._f.refs)?Oe._f.refs[0]:Oe._f.ref;if(zv(Ze)){const Me=Ze.closest("form");if(Me){Me.reset();break}}}}for(const me of a.mount)j(me,Ye(ue,me))}s=Pr(ue),m.array.next({values:{...ue}}),m.state.next({values:{...ue}})}a={mount:B.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!B.keepIsValid||!!B.keepDirtyValues,o.watch=!!e.shouldUnregister,m.state.next({submitCount:B.keepSubmitCount?t.submitCount:0,isDirty:J?!1:B.keepDirty?t.isDirty:!!(B.keepDefaultValues&&!ll(P,i)),isSubmitted:B.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:J?{}:B.keepDirtyValues?B.keepDefaultValues&&s?Ff(i,s):t.dirtyFields:B.keepDefaultValues&&P?Ff(i,P):B.keepDirty?t.dirtyFields:{},touchedFields:B.keepTouched?t.touchedFields:{},errors:B.keepErrors?t.errors:{},isSubmitSuccessful:B.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Te=(P,B)=>Ae(Qs(P)?P(s):P,B),be=(P,B={})=>{const q=Ye(r,P),se=q&&q._f;if(se){const J=se.refs?se.refs[0]:se.ref;J.focus&&(J.focus(),B.shouldSelect&&Qs(J.select)&&J.select())}},Ke=P=>{t={...t,...P}},W={control:{register:Ie,unregister:nt,getFieldState:Ce,handleSubmit:H,setError:_e,_subscribe:pe,_runSchema:N,_getWatch:V,_getDirty:U,_setValid:g,_setFieldArray:S,_setDisabledField:Pe,_setErrors:A,_getFieldArray:Z,_reset:Ae,_resetDefaultValues:()=>Qs(e.defaultValues)&&e.defaultValues().then(P=>{Te(P,e.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:O,_disableForm:ze,_subjects:m,_proxyFormState:f,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(P){o=P},get _defaultValues(){return i},get _names(){return a},set _names(P){a=P},get _formState(){return t},get _options(){return e},set _options(P){e={...e,...P}}},subscribe:je,trigger:re,register:Ie,handleSubmit:H,watch:Re,setValue:j,getValues:xe,reset:Te,resetField:Fe,clearErrors:ce,unregister:nt,setError:_e,setFocus:be,getFieldState:Ce};return{...W,formControl:W}}function x1(n={}){const e=Ot.useRef(void 0),t=Ot.useRef(void 0),[r,i]=Ot.useState({isDirty:!1,isValidating:!1,isLoading:Qs(n.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1,defaultValues:Qs(n.defaultValues)?void 0:n.defaultValues});e.current||(e.current={...n.formControl?n.formControl:Yte(n),formState:r},n.formControl&&n.defaultValues&&!Qs(n.defaultValues)&&n.formControl.reset(n.defaultValues,n.resetOptions));const s=e.current.control;return s._options=n,Ot.useLayoutEffect(()=>s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0}),[s]),Ot.useEffect(()=>s._disableForm(n.disabled),[s,n.disabled]),Ot.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),Ot.useEffect(()=>{n.values&&!ll(n.values,t.current)?(s._reset(n.values,s._options.resetOptions),t.current=n.values,i(o=>({...o}))):s._resetDefaultValues()},[n.values,s]),Ot.useEffect(()=>{n.errors&&!ui(n.errors)&&s._setErrors(n.errors)},[n.errors,s]),Ot.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),Ot.useEffect(()=>{n.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[n.shouldUnregister,s]),e.current.formState=Cj(r,s),e.current}const YR=(n,e,t)=>{if(n&&"reportValidity"in n){const r=Ye(t,e);n.setCustomValidity(r&&r.message||""),n.reportValidity()}},jj=(n,e)=>{for(const t in e.fields){const r=e.fields[t];r&&r.ref&&"reportValidity"in r.ref?YR(r.ref,t,n):r.refs&&r.refs.forEach(i=>YR(i,t,n))}},Kte=(n,e)=>{e.shouldUseNativeValidation&&jj(n,e);const t={};for(const r in n){const i=Ye(e.fields,r),s=Object.assign(n[r]||{},{ref:i&&i.ref});if(Zte(e.names||Object.keys(n),r)){const o=Object.assign({},Ye(t,r));vn(o,"root",s),vn(t,r,o)}else vn(t,r,s)}return t},Zte=(n,e)=>n.some(t=>t.startsWith(e+"."));var Qte=function(n,e){for(var t={};n.length;){var r=n[0],i=r.code,s=r.message,o=r.path.join(".");if(!t[o])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];t[o]={message:a.message,type:a.code}}else t[o]={message:s,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return n.push(p)})}),e){var c=t[o].types,u=c&&c[r.code];t[o]=Rj(o,e,t,i,u?[].concat(u,r.message):r.message)}n.shift()}return t},v1=function(n,e,t){return t===void 0&&(t={}),function(r,i,s){try{return Promise.resolve(function(o,a){try{var c=Promise.resolve(n[t.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(u){return s.shouldUseNativeValidation&&jj({},s),{errors:{},values:t.raw?r:u}})}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:Kte(Qte(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}},xn;(function(n){n.assertEqual=i=>{};function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return n.objectValues(o)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},n.find=(i,s)=>{for(const o of i)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>
vendor: 1,174 bytes, line 4213
4213typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(xn||(xn={}));var KR;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(KR||(KR={}));const ft=xn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),il=n=>{switch(typeof n){case"undefined":return ft.undefined;case"string":return ft.string;case"number":return Number.isNaN(n)?ft.nan:ft.number;case"boolean":return ft.boolean;case"function":return ft.function;case"bigint":return ft.bigint;case"symbol":return ft.symbol;case"object":return Array.isArray(n)?ft.array:n===null?ft.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?ft.promise:typeof Map<"u"&&n instanceof Map?ft.map:typeof Set<"u"&&n instanceof Set?ft.set:typeof Date<"u"&&n instanceof Date?ft.date:ft.object;default:return ft.unknown}},Be=xn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invali
4213d_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Pa extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let a=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),r}static assert(e){if(!(e instanceof Pa))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,xn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}Pa.create=n=>new Pa(n);const m2=(n,e)=>{let t;switch(n.code){case Be.invalid_type:n.received===ft.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case Be.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,xn.jsonStringifyReplacer)}`;break;case Be.unrecognized_keys:t=`Unrecognized key(s) in object: ${xn.joinValues(n.keys,", ")}`;break;case Be.invalid_union:t="Invalid input";break;case Be.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${xn.joinValues(n.options)}`;break;case Be.invalid_enum_value:t=`Invalid enum value. Expected ${xn.joinValues(n.options)}, received '${n.received}'`;break;case Be.invalid_arguments:t="Invalid function arguments";break;case Be.invalid_return_type:t="Invalid function return type";break;case Be.invalid_date:t="Invalid date";break;case Be.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:xn.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case Be.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case Be.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case Be.custom:t="Invalid input";break;case Be.invalid_intersection_types:t="Intersection results could not be merged";break;case Be.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case Be.not_finite:t="Number must be finite";break;default:t=e.defaultError,xn.assertNever(n)}return{message:t}};let Jte=m2;function ene(){return Jte}const tne=n=>
4213{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}};function st(n,e){const t=ene(),r=tne({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===m2?void 0:m2].filter(i=>!!i)});n.common.issues.push(r)}class cs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return Bt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return cs.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Bt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const Bt=Object.freeze({status:"aborted"}),Wf=n=>({status:"dirty",value:n}),Ls=n=>({status:"valid",value:n}),ZR=n=>n.status==="aborted",QR=n=>n.status==="dirty",bh=n=>n.status==="valid",Wv=n=>typeof Promise<"u"&&n instanceof Promise;var mt;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(mt||(mt={}));var Gv=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},Oj=function(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t},Gf,$f;
vendor: 27,649 bytes, line 4213
4213class Bl{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const JR=(n,e)=>{if(bh(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Pa(n.common.issues);return this._error=t,this._error}}};function Zt(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{const{message:c}=n;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??t??a.defaultError}},description:i}}class hn{get description(){return this._def.description}_getType(e){return il(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:il(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new cs,ctx:{common:e.parent.common,data:e.data,parsedType:il(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Wv(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:il(e)},i=this._parseSync({data:e,path:r.path,parent:r});return JR(r,i)}"~validate"(e){var r,i;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:il(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return bh(s)?{value:s.value}:{issues:t.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>bh(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:il(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(Wv(i)?i:Promise.resolve(i));return JR(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Be.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new Mh({schema:this,typeName:Ft.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Pl.create(this,this._def)}nullable(){return Ah.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ko.create(this)}promise(){return Yv.create(this,this._def)}or(e){return Xv.create([this,e],this._def)}and(e){return qv.create(this,e,this._def)}transform(e){return new Mh({...Zt(this._def),schema:this,typeName:Ft.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new v2({...Zt(this._def),innerType:this,defaultValue:t,typeName:Ft.ZodDefault})}brand(){return new Ene({typeName:Ft.ZodBranded,type:this,...Zt(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new y2({...Zt(this._def),innerType:this,catchValue:t,typeName:Ft.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return $M.create(this,e)}readonly(){return _2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nne=/^c[^\s-]{8,}$/i,rne=/^[0-9a-z]+$/,ine=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sne=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,one=/^[a-z0-9_-]{21}$/i,ane=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lne=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cne=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,une="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _b;const dne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,fne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,pne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gne=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Uj="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xne=new RegExp(`^${Uj}$`);function Bj(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function vne(n){return new RegExp(`^${Bj(n)}$`)}function yne(n){let e=`${Uj}T${Bj(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function _ne(n,e){return!!((e==="v4"||!e)&&dne.test(n)||(e==="v6"||!e)&&fne.test(n))}function wne(n,e){if(!ane.test(n))return!1;try{const[t]=n.split("."),r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function bne(n,e){return!!((e==="v4"||!e)&&hne.test(n)||(e==="v6"||!e)&&pne.test(n))}class ma extends hn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ft.string){const s=this._getOrReturnCtx(e);return st(s,{code:Be.invalid_type,expected:ft.string,received:s.parsedType}),Bt}const r=new cs;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),st(i,{code:Be.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),st(i,{code:Be.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?st(i,{code:Be.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&st(i,{code:Be.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")cne.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"email",code:Be.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")_b||(_b=new RegExp(une,"u")),_b.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"emoji",code:Be.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")sne.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"uuid",code:Be.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")one.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"nanoid",code:Be.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")nne.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"cuid",code:Be.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")rne.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"cuid2",code:Be.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")ine.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"ulid",code:Be.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),st(i,{validation:"url",code:Be.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"regex",code:Be.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),st(i,{code:Be.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),st(i,{code:Be.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),st(i,{code:Be.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?yne(s).test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{code:Be.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?xne.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{code:Be.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?vne(s).test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{code:Be.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?lne.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"duration",code:Be.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?_ne(e.data,s.version)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"ip",code:Be.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?wne(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"jwt",code:Be.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?bne(e.data,s.version)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"cidr",code:Be.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?mne.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"base64",code:Be.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?gne.test(e.data)||(i=this._getOrReturnCtx(e,i),st(i,{validation:"base64url",code:Be.invalid_string,message:s.message}),r.dirty()):xn.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(i=>e.test(i),{validation:t,code:Be.invalid_string,...mt.errToObj(r)})}_addCheck(e){return new ma({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...mt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...mt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...mt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...mt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...mt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...mt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...mt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...mt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...mt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...mt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...mt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...mt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...mt.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...mt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...mt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...mt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...mt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...mt.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...mt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...mt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...mt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...mt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...mt.errToObj(t)})}nonempty(e){return this.min(1,mt.errToObj(e))}trim(){return new ma({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ma({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ma({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ma.create=n=>new ma({checks:[],typeName:Ft.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...Zt(n)});function Sne(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=Number.parseInt(n.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return s%o/10**i}class du extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ft.number){const s=this._getOrReturnCtx(e);return st(s,{code:Be.invalid_type,expected:ft.number,received:s.parsedType}),Bt}let r;const i=new cs;for(const s of this._def.checks)s.kind==="int"?xn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),st(r,{code:Be.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),st(r,{code:Be.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),st(r,{code:Be.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Sne(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),st(r,{code:Be.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),st(r,{code:Be.not_finite,message:s.message}),i.dirty()):xn.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,mt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,mt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,mt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,mt.toString(t))}setLimit(e,t,r,i){return new du({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:mt.toString(i)}]})}_addCheck(e){return new du({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:mt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:mt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:mt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:mt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:mt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:mt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:mt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:mt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:mt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&xn.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}du.create=n=>new du({checks:[],typeName:Ft.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Zt(n)});class hu extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ft.bigint)return this._getInvalidInput(e);let r;const i=new cs;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),st(r,{code:Be.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),st(r,{code:Be.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),st(r,{code:Be.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):xn.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return st(t,{code:Be.invalid_type,expected:ft.bigint,received:t.parsedType}),Bt}gte(e,t){return this.setLimit("min",e,!0,mt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,mt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,mt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,mt.toString(t))}setLimit(e,t,r,i){return new hu({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:mt.toString(i)}]})}_addCheck(e){return new hu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:mt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:mt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:mt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:mt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:mt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}hu.create=n=>new hu({checks:[],typeName:Ft.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...Zt(n)});class $v extends hn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ft.boolean){const r=this._getOrReturnCtx(e);return st(r,{code:Be.invalid_type,expected:ft.boolean,received:r.parsedType}),Bt}return Ls(e.data)}}$v.create=n=>new $v({typeName:Ft.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Zt(n)});class Sh extends hn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ft.date){const s=this._getOrReturnCtx(e);return st(s,{code:Be.invalid_type,expected:ft.date,received:s.parsedType}),Bt}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return st(s,{code:Be.invalid_date}),Bt}const r=new cs;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),st(i,{code:Be.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),st(i,{code:Be.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):xn.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Sh({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:mt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:mt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Sh.create=n=>new Sh({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:Ft.ZodDate,...Zt(n)});class eP extends hn{_parse(e){if(this._getType(e)!==ft.symbol){const r=this._getOrReturnCtx(e);return st(r,{code:Be.invalid_type,expected:ft.symbol,received:r.parsedType}),Bt}return Ls(e.data)}}eP.create=n=>new eP({typeName:Ft.ZodSymbol,...Zt(n)});class tP extends hn{_parse(e){if(this._getType(e)!==ft.undefined){const r=this._getOrReturnCtx(e);return st(r,{code:Be.invalid_type,expected:ft.undefined,received:r.parsedType}),Bt}return Ls(e.data)}}tP.create=n=>new tP({typeName:Ft.ZodUndefined,...Zt(n)});class nP extends hn{_parse(e){if(this._getType(e)!==ft.null){const r=this._getOrReturnCtx(e);return st(r,{code:Be.invalid_type,expected:ft.null,received:r.parsedType}),Bt}return Ls(e.data)}}nP.create=n=>new nP({typeName:Ft.ZodNull,...Zt(n)});class rP extends hn{constructor(){super(...arguments),this._any=!0}_parse(e){return Ls(e.data)}}rP.create=n=>new rP({typeName:Ft.ZodAny,...Zt(n)});class iP extends hn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ls(e.data)}}iP.create=n=>new iP({typeName:Ft.ZodUnknown,...Zt(n)});class zl extends hn{_parse(e){const t=this._getOrReturnCtx(e);return st(t,{code:Be.invalid_type,expected:ft.never,received:t.parsedType}),Bt}}zl.create=n=>new zl({typeName:Ft.ZodNever,...Zt(n)});class sP extends hn{_parse(e){if(this._getType(e)!==ft.undefined){const r=this._getOrReturnCtx(e);return st(r,{code:Be.invalid_type,expected:ft.void,received:r.parsedType}),Bt}return Ls(e.data)}}sP.create=n=>new sP({typeName:Ft.ZodVoid,...Zt(n)});class ko extends hn{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==ft.array)return st(t,{code:Be.invalid_type,expected:ft.array,received:t.parsedType}),Bt;if(i.exactLength!==null){const o=t.data.length>i.exactLength.value,a=t.data.length<i.exactLength.value;(o||a)&&(st(t,{code:o?Be.too_big:Be.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(st(t,{code:Be.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(st(t,{code:Be.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>i.type._parseAsync(new Bl(t,o,t.path,a)))).then(o=>cs.mergeArray(r,o));const s=[...t.data].map((o,a)=>i.type._parseSync(new Bl(t,o,t.path,a)));return cs.mergeArray(r,s)}
vendor: 5,951 bytes, line 4213
4213get element(){return this._def.type}min(e,t){return new ko({...this._def,minLength:{value:e,message:mt.toString(t)}})}max(e,t){return new ko({...this._def,maxLength:{value:e,message:mt.toString(t)}})}length(e,t){return new ko({...this._def,exactLength:{value:e,message:mt.toString(t)}})}nonempty(e){return this.min(1,e)}}ko.create=(n,e)=>new ko({type:n,minLength:null,maxLength:null,exactLength:null,typeName:Ft.ZodArray,...Zt(e)});function ud(n){if(n instanceof $n){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Pl.create(ud(r))}return new $n({...n._def,shape:()=>e})}else return n instanceof ko?new ko({...n._def,type:ud(n.element)}):n instanceof Pl?Pl.create(ud(n.unwrap())):n instanceof Ah?Ah.create(ud(n.unwrap())):n instanceof fu?fu.create(n.items.map(e=>ud(e))):n}class $n extends hn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=xn.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==ft.object){const u=this._getOrReturnCtx(e);return st(u,{code:Be.invalid_type,expected:ft.object,received:u.parsedType}),Bt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof zl&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const c=[];for(const u of o){const f=s[u],p=i.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new Bl(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof zl){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")a.length>0&&(st(i,{code:Be.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of a){const p=i.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new Bl(i,p,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of c){const p=await f.key,m=await f.value;u.push({key:p,value:m,alwaysSet:f.alwaysSet})}return u}).then(u=>cs.mergeObjectSync(r,u)):cs.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return mt.errToObj,new $n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var s,o;const i=((o=(s=this._def).errorMap)==null?void 0:o.call(s,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:mt.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new $n({...this._def,unknownKeys:"strip"})}passthrough(){return new $n({...this._def,unknownKeys:"passthrough"})}extend(e){return new $n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ft.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new $n({...this._def,catchall:e})}pick(e){const t={};for(const r of xn.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new $n({...this._def,shape:()=>t})}omit(e){const t={};for(const r of xn.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new $n({...this._def,shape:()=>t})}deepPartial(){return ud(this)}partial(e){const t={};for(const r of xn.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}return new $n({...this._def,shape:()=>t})}required(e){const t={};for(const r of xn.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Pl;)s=s._def.innerType;t[r]=s}return new $n({...this._def,shape:()=>t})}keyof(){return zj(xn.objectKeys(this.shape))}}$n.create=(n,e)=>new $n({shape:()=>n,unknownKeys:"strip",catchall:zl.create(),typeName:Ft.ZodObject,...Zt(e)});$n.strictCreate=(n,e)=>new $n({shape:()=>n,unknownKeys:"strict",catchall:zl.create(),typeName:Ft.ZodObject,...Zt(e)});$n.lazycreate=(n,e)=>new $n({shape:n,unknownKeys:"strip",catchall:zl.create(),typeName:Ft.ZodObject,...Zt(e)});class Xv extends hn{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Pa(a.ctx.common.issues));return st(t,{code:Be.invalid_union,unionErrors:o}),Bt}if(t.common.async)return Promise.all(r.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of r){const u={...t,common:{...t.common,issues:[]},parent:null},f=c._parseSync({data:t.data,path:t.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Pa(c));return st(t,{code:Be.invalid_union,unionErrors:a}),Bt}}get options(){return this._def.options}}Xv.create=(n,e)=>new Xv({options:n,typeName:Ft.ZodUnion,...Zt(e)});function g2(n,e){const t=il(n),r=il(e);if(n===e)return{valid:!0,data:n};if(t===ft.object&&r===ft.object){const i=xn.objectKeys(e),s=xn.objectKeys(n).filter(a=>i.indexOf(a)!==-1),o={...n,...e};for(const a of s){const c=g2(n[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(t===ft.array&&r===ft.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<n.length;s++){const o=n[s],a=e[s],c=g2(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return t===ft.date&&r===ft.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class qv extends hn{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=(s,o)=>
vendor: 11,872 bytes, line 4213
4213{if(ZR(s)||ZR(o))return Bt;const a=g2(s.value,o.value);return a.valid?((QR(s)||QR(o))&&t.dirty(),{status:t.value,value:a.data}):(st(r,{code:Be.invalid_intersection_types}),Bt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}qv.create=(n,e,t)=>new qv({left:n,right:e,typeName:Ft.ZodIntersection,...Zt(t)});class fu extends hn{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ft.array)return st(r,{code:Be.invalid_type,expected:ft.array,received:r.parsedType}),Bt;if(r.data.length<this._def.items.length)return st(r,{code:Be.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Bt;!this._def.rest&&r.data.length>this._def.items.length&&(st(r,{code:Be.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Bl(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>cs.mergeArray(t,o)):cs.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new fu({...this._def,rest:e})}}fu.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fu({items:n,typeName:Ft.ZodTuple,rest:null,...Zt(e)})};class oP extends hn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ft.map)return st(r,{code:Be.invalid_type,expected:ft.map,received:r.parsedType}),Bt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],u)=>({key:i._parse(new Bl(r,a,r.path,[u,"key"])),value:s._parse(new Bl(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return Bt;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),a.set(u.value,f.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const c of o){const u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return Bt;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),a.set(u.value,f.value)}return{status:t.value,value:a}}}}oP.create=(n,e,t)=>new oP({valueType:e,keyType:n,typeName:Ft.ZodMap,...Zt(t)});class Qp extends hn{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ft.set)return st(r,{code:Be.invalid_type,expected:ft.set,received:r.parsedType}),Bt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(st(r,{code:Be.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(st(r,{code:Be.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function o(c){const u=new Set;for(const f of c){if(f.status==="aborted")return Bt;f.status==="dirty"&&t.dirty(),u.add(f.value)}return{status:t.value,value:u}}const a=[...r.data.values()].map((c,u)=>s._parse(new Bl(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,t){return new Qp({...this._def,minSize:{value:e,message:mt.toString(t)}})}max(e,t){return new Qp({...this._def,maxSize:{value:e,message:mt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Qp.create=(n,e)=>new Qp({valueType:n,minSize:null,maxSize:null,typeName:Ft.ZodSet,...Zt(e)});class aP extends hn{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}aP.create=(n,e)=>new aP({getter:n,typeName:Ft.ZodLazy,...Zt(e)});class x2 extends hn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return st(t,{received:t.data,code:Be.invalid_literal,expected:this._def.value}),Bt}return{status:"valid",value:e.data}}get value(){return this._def.value}}x2.create=(n,e)=>new x2({value:n,typeName:Ft.ZodLiteral,...Zt(e)});function zj(n,e){return new Eh({values:n,typeName:Ft.ZodEnum,...Zt(e)})}class Eh extends hn{constructor(){super(...arguments),Gf.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return st(t,{expected:xn.joinValues(r),received:t.parsedType,code:Be.invalid_type}),Bt}if(Gv(this,Gf,"f")||Oj(this,Gf,new Set(this._def.values),"f"),!Gv(this,Gf,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return st(t,{received:t.data,code:Be.invalid_enum_value,options:r}),Bt}return Ls(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Eh.create(e,{...this._def,...t})}exclude(e,t=this._def){return Eh.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}Gf=new WeakMap;Eh.create=zj;class lP extends hn{constructor(){super(...arguments),$f.set(this,void 0)}_parse(e){const t=xn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ft.string&&r.parsedType!==ft.number){const i=xn.objectValues(t);return st(r,{expected:xn.joinValues(i),received:r.parsedType,code:Be.invalid_type}),Bt}if(Gv(this,$f,"f")||Oj(this,$f,new Set(xn.getValidEnumValues(this._def.values)),"f"),!Gv(this,$f,"f").has(e.data)){const i=xn.objectValues(t);return st(r,{received:r.data,code:Be.invalid_enum_value,options:i}),Bt}return Ls(e.data)}get enum(){return this._def.values}}$f=new WeakMap;lP.create=(n,e)=>new lP({values:n,typeName:Ft.ZodNativeEnum,...Zt(e)});class Yv extends hn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ft.promise&&t.common.async===!1)return st(t,{code:Be.invalid_type,expected:ft.promise,received:t.parsedType}),Bt;const r=t.parsedType===ft.promise?t.data:Promise.resolve(t.data);return Ls(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Yv.create=(n,e)=>new Yv({type:n,typeName:Ft.ZodPromise,...Zt(e)});class Mh extends hn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ft.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{st(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return Bt;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Bt:c.status==="dirty"||t.value==="dirty"?Wf(c.value):c});{if(t.value==="aborted")return Bt;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Bt:a.status==="dirty"||t.value==="dirty"?Wf(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Bt:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Bt:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!bh(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>bh(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:t.value,value:a})):o);xn.assertNever(i)}}Mh.create=(n,e,t)=>new Mh({schema:n,typeName:Ft.ZodEffects,effect:e,...Zt(t)});Mh.createWithPreprocess=(n,e,t)=>new Mh({schema:e,effect:{type:"preprocess",transform:n},typeName:Ft.ZodEffects,...Zt(t)});class Pl extends hn{_parse(e){return this._getType(e)===ft.undefined?Ls(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pl.create=(n,e)=>new Pl({innerType:n,typeName:Ft.ZodOptional,...Zt(e)});class Ah extends hn{_parse(e){return this._getType(e)===ft.null?Ls(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ah.create=(n,e)=>new Ah({innerType:n,typeName:Ft.ZodNullable,...Zt(e)});class v2 extends hn{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===ft.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}v2.create=(n,e)=>new v2({innerType:n,typeName:Ft.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Zt(e)});class y2 extends hn{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Wv(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Pa(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Pa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}y2.create=(n,e)=>new y2({innerType:n,typeName:Ft.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Zt(e)});class cP extends hn{_parse(e){if(this._getType(e)!==ft.nan){const r=this._getOrReturnCtx(e);return st(r,{code:Be.invalid_type,expected:ft.nan,received:r.parsedType}),Bt}return{status:"valid",value:e.data}}}cP.create=n=>new cP({typeName:Ft.ZodNaN,...Zt(n)});class Ene extends hn{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class $M extends hn{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Bt:s.status==="dirty"?(t.dirty(),Wf(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Bt:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new $M({in:e,out:t,typeName:Ft.ZodPipeline})}}class _2 extends hn{_parse(e){const t=this._def.innerType._parse(e),r=i=>(bh(i)&&(i.value=Object.freeze(i.value)),i);return Wv(t)?t.then(i=>r(i)):r(t)}unwrap(){return this._def.innerType}}_2.create=(n,e)=>new _2({innerType:n,typeName:Ft.ZodReadonly,...Zt(e)});$n.lazycreate;var Ft;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",
4213n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(Ft||(Ft={}));const Qn=ma.create,uP=du.create;hu.create;const Mne=$v.create;Sh.create;zl.create;const dP=ko.create,y1=$n.create;$n.strictCreate;Xv.create;qv.create;fu.create;const wc=x2.create;Eh.create;Yv.create;Pl.create;Ah.create;const Ane={string:n=>ma.create({...n,coerce:!0}),number:n=>du.create({...n,coerce:!0}),boolean:n=>$v.create({...n,coerce:!0}),bigint:n=>hu.create({...n,coerce:!0}),date:n=>Sh.create({...n,coerce:!0})},Vj=Fte,Hj=T.createContext({}),Ir=({...n})=>l.jsx(Hj.Provider,{value:{name:n.name},children:l.jsx(f2,{...n})}),_1=()=>{const n=T.useContext(Hj),e=T.useContext(Wj),{getFieldState:t,formState:r}=g1(),i=t(n.name,r);if(!n)throw new Error("useFormField should be used within <FormField>");const{id:s}=e;return{id:s,name:n.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},Wj=T.createContext({}),Mr=T.forwardRef(({className:n,...e},t)=>{const r=T.useId();return l.jsx(Wj.Provider,{value:{id:r},children:l.jsx("div",{ref:t,className:Ct("space-y-2",n),...e})})});Mr.displayName="FormItem";const ar=T.forwardRef(({className:n,...e},t)=>{const{error:r,formItemId:i}=_1();return l.jsx(kn,{ref:t,className:Ct(r&&"text-destructive",n),htmlFor:i,...e})});ar.displayName="FormLabel";const Ar=T.forwardRef(({...n},e)=>{const{error:t,formItemId:r,formDescriptionId:i,formMessageId:s}=_1();return l.jsx(xF,{ref:e,id:r,"aria-describedby":t?`${i} ${s}`:`${i}`,"aria-invalid":!!t,...n})});Ar.displayName="FormControl";const x0=T.forwardRef(({className:n,...e},t)=>{const{formDescriptionId:r}=_1();return l.jsx("p",{ref:t,id:r,className:Ct("text-sm text-muted-foreground",n),...e})});x0.displayName="FormDescription";const fr=T.forwardRef(({className:n,children:e,...t},r)=>{const{error:i,formMessageId:s}=_1(),o=i?String((i==null?void 0:i.message)??""):e;return o?l.jsx("p",{ref:r,id:s,className:Ct("text-sm font-medium text-destructive",n),...t,children:o}):null});fr.displayName="FormMessage";const Tne=y1({name:Qn().min(1,"Name is required"),email:Qn().email("Invalid email address"),subject:Qn().min(1,"Subject is required"),message:Qn().min(10,"Message should be at least 10 characters")});function Cne(){const{toast:n}=Mn(),[e,t]=T.useState(!1),r=x1({resolver:v1(Tne),defaultValues:{name:"",email:"",subject:"",message:""}}),i=s=>{t(!0),setTimeout(()=>{n({title:"Message sent!",description:"Thank you for contacting us. We'll get back to you soon."}),r.reset(),t(!1)},1500)};return l.jsxs("div",{className:"bg-[#121212] min-h-screen",children:[l.jsxs("section",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 z-0 bg-gradient-to-b from-transparent to-[#121212]",children:l.jsx("div",{style:{backgroundImage:'url("https://images.unsplash.com/photo-1516223725307-6f76b9ec8742?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&h=600")',backgroundSize:"cover",backgroundPosition:"center"},className:"w-full h-full opacity-40"})}),l.jsxs("div",{className:"relative z-10 container mx-auto px-4 py-16 md:py-24",children:[l.jsxs("h1",{className:"text-4xl md:text-6xl font-heading tracking-wider mb-4 text-white text-center",children:["CONTACT ",l.jsx("span",{className:"text-[#FB3939]",children:"US"})]}),l.jsx("p",{className:"text-lg md:text-xl text-[#E0E0E0] max-w-3xl mx-auto text-center",children:"Questions, suggestions, or feedback? We'd love to hear from you."})]})]}),l.jsx("section",{className:"py-12",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsx("div",{className:"max-w-4xl mx-auto",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"bg-[#1E1E1E] rounded-2xl p-6 shadow-lg mb-6",children:[l.jsxs("h2",{className:"text-xl font-heading text-[#F5F5F5] mb-4",children:["CONTACT ",l.jsx("span",{className:"text-[#FB3939]",children:"INFO"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"text-[#FB3939] mr-3 mt-1",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-[#A0A0A0]",children:"Email"}),l.jsx("a",{href:"mailto:[email protected]",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:"[email protected]"})]})]}),l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"text-[#FB3939] mr-3 mt-1",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-[#A0A0A0]",children:"Social"}),l.jsxs("div",{className:"flex space-x-3 mt-1",children:[l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-
42135.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"})})}),l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"})})}),l.jsx("a",{href:"#",className:"text-[#E0E0E0] hover:text-[#FB3939] transition",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M19.615 3.184c-3.604-.246-11.631-.245-15.23 0-3.897.266-4.356 2.62-4.385 8.816.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0 3.897-.266 4.356-2.62 4.385-8.816-.029-6.185-.484-8.549-4.385-8.816zm-10.615 12.816v-8l8 3.993-8 4.007z"})})})]})]})]})]})]}),l.jsxs("div",{className:"bg-[#1E1E1E] rounded-2xl p-6 shadow-lg",children:[l.jsxs("h2",{className:"text-xl font-heading text-[#F5F5F5] mb-4",children:["RESPONSE ",l.jsx("span",{className:"text-[#FB3939]",children:"TIME"})]}),l.jsx("p",{className:"text-[#E0E0E0] text-sm",children:"We strive to respond to all inquiries within 24-48 hours during business days. For urgent matters, please email us directly."})]})]}),l.jsx("div",{className:"md:col-span-2",children:l.jsxs("div",{className:"bg-[#1E1E1E] rounded-2xl p-6 shadow-lg",children:[l.jsxs("h2",{className:"text-xl font-heading text-[#F5F5F5] mb-6",children:["SEND US A ",l.jsx("span",{className:"text-[#FB3939]",children:"MESSAGE"})]}),l.jsx(Vj,{...r,children:l.jsxs("form",{onSubmit:r.handleSubmit(i),className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsx(Ir,{control:r.control,name:"name",render:({field:s})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Name"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"Your name",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...s})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:r.control,name:"email",render:({field:s})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Email"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"Your email",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...s})}),l.jsx(fr,{})]})})]}),l.jsx(Ir,{control:r.control,name:"subject",render:({field:s})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Subject"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"Message subject",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...s})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:r.control,name:"message",render:({field:s})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Message"}),l.jsx(Ar,{children:l.jsx(es,{placeholder:"Your message",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5] min-h-[150px]",...s})}),l.jsx(fr,{})]})}),l.jsx(it,{type:"submit",className:"bg-[#FB3939] hover:bg-opacity-90 text-white w-full",disabled:e,children:e?"Sending...":"Send Message"})]})})]})})]})})})})]})}var Nne="Separator",hP="horizontal",Rne=["horizontal","vertical"],Gj=T.forwardRef((n,e)=>{const{decorative:t,orientation:r=hP,...i}=n,s=Pne(r)?r:hP,a=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(Dt.div,{"data-orientation":s,...a,...i,ref:e})});Gj.displayName=Nne;function Pne(n){return Rne.includes(n)}var $j=Gj;const w2=T.forwardRef(({className:n,orientation:e="horizontal",decorative:t=!0,...r},i)=>l.jsx($j,{ref:i,decorative:t,orientation:e,className:Ct("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...r}));w2.displayName=$j.displayName;var wb="rovingFocusGroup.onEntryFocus",Ine={bubbles:!1,cancelable:!0},w1="RovingFocusGroup",[b2,Xj,Fne]=CE(w1),[Dne,qj]=Uo(w1,[Fne]),[kne,Lne]=Dne(w1),Yj=T.forwardRef((n,e)=>l.jsx(b2.Provider,{scope:n.__scopeRovingFocusGroup,children:l.jsx(b2.Slot,{scope:n.__scopeRovingFocusGroup,children:l.jsx(jne,{...n,ref:e})})}));Yj.displayName=w1;var jne=T.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=n,m=T.useRef(null),x=Tn(e,m),v=DM(s),[_=null,y]=Dl({prop:o,defaultProp:a,onChange:c}),[g,b]=T.useState(!1),S=zi(u),M=Xj(t),A=T.useRef(!1),[R,F]=T.useState(0);return T.useEffect(()=>{const L=m.current;if(L)return L.addEventListener(wb,S),()=>L.removeEventListener(wb,S)},[S]),l.jsx(kne,{scope:t,orientation:r,dir:v,loop:i,currentTabStopId:_,onItemFocus:T.useCallback(L=>y(L),[y]),onItemShiftTab:T.useCallback(()=>b(!0),[]),onFocusableItemAdd:T.useCallback(()=>F(L=>L+1),[]),onFocusableItemRemove:T.useCallback(()=>F(L=>L-1),[]),children:l.jsx(Dt.div,{tabIndex:g||R===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...n.style},onMouseDown:At(n.onMouseDown,()=>{A.current=!0}),onFocus:At(n.onFocus,L=>{const N=!A.current;if(L.target===L.currentTarget&&N&&!g){const I=new CustomEvent(wb,Ine);if(L.currentTarget.dispatchEvent(I),!I.defaultPrevented){const D=M().filter(Y=>Y.focusable),O=D.find(Y=>Y.active),U=D.find(Y=>
vendor: 4,599 bytes, line 4213
4213Y.id===_),Z=[O,U,...D].filter(Boolean).map(Y=>Y.ref.current);Qj(Z,f)}}A.current=!1}),onBlur:At(n.onBlur,()=>b(!1))})})}),Kj="RovingFocusGroupItem",Zj=T.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:s,...o}=n,a=xa(),c=s||a,u=Lne(Kj,t),f=u.currentTabStopId===c,p=Xj(t),{onFocusableItemAdd:m,onFocusableItemRemove:x}=u;return T.useEffect(()=>{if(r)return m(),()=>x()},[r,m,x]),l.jsx(b2.ItemSlot,{scope:t,id:c,focusable:r,active:i,children:l.jsx(Dt.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...o,ref:e,onMouseDown:At(n.onMouseDown,v=>{r?u.onItemFocus(c):v.preventDefault()}),onFocus:At(n.onFocus,()=>u.onItemFocus(c)),onKeyDown:At(n.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const _=Bne(v,u.orientation,u.dir);if(_!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let g=p().filter(b=>b.focusable).map(b=>b.ref.current);if(_==="last")g.reverse();else if(_==="prev"||_==="next"){_==="prev"&&g.reverse();const b=g.indexOf(v.currentTarget);g=u.loop?zne(g,b+1):g.slice(b+1)}setTimeout(()=>Qj(g))}})})})});Zj.displayName=Kj;var One={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Une(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function Bne(n,e,t){const r=Une(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return One[r]}function Qj(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function zne(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var Vne=Yj,Hne=Zj,XM="Tabs",[Wne,hie]=Uo(XM,[qj]),Jj=qj(),[Gne,qM]=Wne(XM),eO=T.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...u}=n,f=DM(a),[p,m]=Dl({prop:r,onChange:i,defaultProp:s});return l.jsx(Gne,{scope:t,baseId:xa(),value:p,onValueChange:m,orientation:o,dir:f,activationMode:c,children:l.jsx(Dt.div,{dir:f,"data-orientation":o,...u,ref:e})})});eO.displayName=XM;var tO="TabsList",nO=T.forwardRef((n,e)=>{const{__scopeTabs:t,loop:r=!0,...i}=n,s=qM(tO,t),o=Jj(t);return l.jsx(Vne,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Dt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});nO.displayName=tO;var rO="TabsTrigger",iO=T.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,disabled:i=!1,...s}=n,o=qM(rO,t),a=Jj(t),c=aO(o.baseId,r),u=lO(o.baseId,r),f=r===o.value;return l.jsx(Hne,{asChild:!0,...a,focusable:!i,active:f,children:l.jsx(Dt.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:e,onMouseDown:At(n.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:At(n.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:At(n.onFocus,()=>{const p=o.activationMode!=="manual";!f&&!i&&p&&o.onValueChange(r)})})})});iO.displayName=rO;var sO="TabsContent",oO=T.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,forceMount:i,children:s,...o}=n,a=qM(sO,t),c=aO(a.baseId,r),u=lO(a.baseId,r),f=r===a.value,p=T.useRef(f);return T.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Gl,{present:i||f,children:({present:m})=>l.jsx(Dt.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...o,ref:e,style:{...n.style,animationDuration:p.current?"0s":void 0},children:m&&s})})});oO.displayName=sO;function aO(n,e){return`${n}-trigger-${e}`}function lO(n,e){return`${n}-content-${e}`}var $ne=eO,cO=nO,uO=iO,dO=oO;const b1=$ne,Am=T.forwardRef(({className:n,...e},t)=>l.jsx(cO,{ref:t,className:Ct("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...e}));Am.displayName=cO.displayName;const Fi=T.forwardRef(({className:n,...e},t)=>l.jsx(uO,{ref:t,className:Ct("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n
4213),...e}));Fi.displayName=uO.displayName;const Di=T.forwardRef(({className:n,...e},t)=>l.jsx(dO,{ref:t,className:Ct("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...e}));Di.displayName=dO.displayName;function Xne(){const{user:n,isAuthenticated:e,isLoading:t}=vi(),[r,i]=T.useState("reviews"),{data:s=[]}=Nt({queryKey:["/api/user/reviews"],enabled:e}),{data:o=[]}=Nt({queryKey:["/api/user/comments"],enabled:e}),a=c=>{const u=new Date(c);return zM(u,new Date,{addSuffix:!0})};return t?l.jsx("div",{className:"container mx-auto px-4 py-8",children:l.jsx("div",{className:"text-center py-12",children:l.jsx("div",{className:"text-[#A0A0A0]",children:"Loading profile..."})})}):e?l.jsx("div",{className:"container mx-auto px-4 py-8",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[l.jsx("div",{children:l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx(ts,{className:"pb-2",children:l.jsx(ns,{className:"text-2xl font-heading text-[#F5F5F5]",children:"Profile"})}),l.jsx(tr,{children:l.jsxs("div",{className:"flex flex-col items-center py-4",children:[l.jsx("div",{className:"w-32 h-32 relative mb-4",children:l.jsx("img",{src:(n==null?void 0:n.profileImageUrl)||"https://via.placeholder.com/150",alt:"Profile",className:"w-full h-full rounded-full object-cover border-4 border-[#FB3939]"})}),l.jsxs("h2",{className:"text-xl font-heading text-[#F5F5F5] mb-1",children:[n==null?void 0:n.firstName," ",n==null?void 0:n.lastName]}),l.jsx("p",{className:"text-[#A0A0A0] mb-4",children:(n==null?void 0:n.email)||"No email available"}),l.jsx(w2,{className:"my-4 bg-[#2D2D2D]"}),l.jsxs("div",{className:"w-full",children:[l.jsxs("div",{className:"flex justify-between items-center mb-3",children:[l.jsx("span",{className:"text-[#E0E0E0]",children:"Reviews"}),l.jsx("span",{className:"text-[#FB3939] font-bold",children:s.length})]}),l.jsxs("div",{className:"flex justify-between items-center mb-3",children:[l.jsx("span",{className:"text-[#E0E0E0]",children:"Comments"}),l.jsx("span",{className:"text-[#FB3939] font-bold",children:o.length})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-[#E0E0E0]",children:"Favorites"}),l.jsx(Pt,{href:Ve.USER_FAVORITES,children:l.jsx("a",{className:"text-[#3A86FF] hover:text-[#FB3939] transition",children:"View all"})})]})]}),l.jsx(w2,{className:"my-4 bg-[#2D2D2D]"}),l.jsx(it,{variant:"destructive",className:"w-full",onClick:()=>window.location.href=Ve.LOGOUT,children:"Sign Out"})]})})]})}),l.jsx("div",{className:"md:col-span-2",children:l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx(ts,{className:"pb-2",children:l.jsx(ns,{className:"text-2xl font-heading text-[#F5F5F5]",children:"Activity"})}),l.jsx(tr,{children:l.jsxs(b1,{defaultValue:"reviews",value:r,onValueChange:i,children:[l.jsxs(Am,{className:"bg-[#2D2D2D] mb-6",children:[l.jsx(Fi,{value:"reviews",className:"data-[state=active]:bg-[#FB3939] data-[state=active]:text-white",children:"Reviews"}),l.jsx(Fi,{value:"comments",className:"data-[state=active]:bg-[#FB3939] data-[state=active]:text-white",children:"Comments"})]}),l.jsx(Di,{value:"reviews",children:s.length>0?l.jsx("div",{className:"space-y-4",children:s.map(c=>l.jsxs("div",{className:"bg-[#2D2D2D] rounded-lg p-4",children:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsx(Pt,{href:Ve.ARTIST_DETAILS(c.artist.slug),children:l.jsx("a",{className:"text-lg font-heading text-[#F5F5F5] hover:text-[#FB3939] transition",children:c.artist.name})}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-[#F59E0B]",children:Array.from({length:5}).map((u,f)=>l.jsx("span",{className:f<c.rating?"text-[#F59E0B]":"text-[#A0A0A0]",children:"â
"},f))}),l.jsx("span",{className:"text-[#A0A0A0] text-sm ml-2",children:a(c.createdAt)})]})]}),c.content&&l.jsx("p",{className:"text-[#E0E0E0]",children:c.content})]},c.id))}):l.jsxs("div",{className:"text-center py-8",children:[l.jsx("p",{className:"text-[#A0A0A0]",children:"You haven't written any reviews yet."}),l.jsx(Pt,{href:Ve.ARTISTS,children:l.jsx("a",{className:"text-[#3A86FF] hover:text-[#FB3939] transition mt-2 inline-block",children:"Browse artists to review"})})]})}),l.jsx(Di,{value:"comments",children:o.length>0?l.jsx("div",{className:"space-y-4",children:o.map(c=>l.jsxs("div",{className:"bg-[#2D2D2D] rounded-lg p-4",children:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsx(Pt,{href:Ve.ARTIST_DETAILS(c.artist.slug),children:l.jsx("a",{className:"text-lg font-heading text-[#F5F5F5] hover:text-[#FB3939] transition",children:c.artist.name})}),l.jsx("span",{className:"text-[#A0A0A0] text-sm",children:a(c.createdAt)})]}),l.jsx("p",{className:"text-[#E0E0E0]",children:c.content})]},c.id))}):l.jsxs("div",{className:"text-center py-8",children:[l.jsx("p",{className:"text-[#A0A0A0]",children:"You haven't posted any comments yet."}),l.jsx(Pt,{href:Ve.ARTISTS,children:l.jsx("a",{className:"text-[#3A86FF] hover:text-[#FB3939] transition mt-2 inline-block",children:"Browse artists to comment"})})]})})]})})]})})]})}):l.jsx("div",{className:"container mx-auto px-4 py-8",children:l.jsx(qn,{
4213className:"bg-[#1E1E1E] border-[#2D2D2D]",children:l.jsx(tr,{className:"pt-6 pb-8",children:l.jsxs("div",{className:"text-center py-8",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5] mb-4",children:"Authentication Required"}),l.jsx("p",{className:"text-[#A0A0A0] mb-6",children:"Please sign in to view your profile."}),l.jsx(it,{onClick:()=>window.location.href=Ve.LOGIN,className:"bg-[#FB3939] hover:bg-opacity-90 text-white",children:"Sign In"})]})})})})}function qne(){return l.jsx("div",{className:"bg-[#121212] min-h-screen",children:l.jsx(Xne,{})})}function Yne(){const{isAuthenticated:n,isLoading:e}=vi(),{toast:t}=Mn(),r=hs(),{data:i=[],isLoading:s}=Nt({queryKey:["/api/user/favorites"],enabled:n}),o=ti({mutationFn:async c=>(await Lo("POST",`/api/artists/${c}/favorite`)).json(),onSuccess:(c,u)=>{r.invalidateQueries({queryKey:["/api/user/favorites"]}),r.invalidateQueries({queryKey:[`/api/artists/${u}/favorite`]}),t({title:"Favorite removed",description:"The artist has been removed from your favorites."})},onError:()=>{t({title:"Error",description:"Failed to update favorites. Please try again.",variant:"destructive"})}}),a=c=>{o.mutate(c)};return e?l.jsx("div",{className:"container mx-auto px-4 py-8",children:l.jsx("div",{className:"text-center py-12",children:l.jsx("div",{className:"text-[#A0A0A0]",children:"Loading favorites..."})})}):n?l.jsxs("div",{className:"container mx-auto px-4 py-8",children:[l.jsx("h1",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5] mb-8",children:"My Favorite Artists"}),s?l.jsx("div",{className:"text-center py-8",children:l.jsx("div",{className:"text-[#A0A0A0]",children:"Loading your favorites..."})}):i.length>0?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:i.map(c=>{const u=c.artist;return l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D] overflow-hidden hover:border-[#FB3939] transition duration-300",children:[l.jsx("div",{className:"h-48 overflow-hidden",children:l.jsx("img",{src:u.imageUrl||"https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&h=400",alt:u.name,className:"w-full h-full object-cover transition-transform duration-500 hover:scale-110"})}),l.jsxs(tr,{className:"p-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx(Pt,{href:Ve.ARTIST_DETAILS(u.slug),children:l.jsx("a",{className:"text-xl font-heading text-[#F5F5F5] hover:text-[#FB3939] transition",children:u.name.toUpperCase()})}),l.jsx("button",{className:"text-[#FB3939]",onClick:()=>a(u.id),disabled:o.isPending,"aria-label":"Remove from favorites",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})})})]}),l.jsx("div",{className:"mb-3",children:l.jsx(su,{rating:u.rating||0,size:"sm"})}),u.genres&&u.genres.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:u.genres.slice(0,3).map(f=>l.jsx("span",{className:"text-xs bg-[#2D2D2D] text-[#E0E0E0] rounded-full px-3 py-1",children:f.name},f.id))}),l.jsx("p",{className:"text-sm text-[#E0E0E0] mb-4 line-clamp-2",children:u.bio||"No biography available."}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx(Pt,{href:Ve.ARTIST_DETAILS(u.slug),children:l.jsx("a",{className:"text-[#3A86FF] hover:text-[#FB3939] transition text-sm font-medium",children:"View Profile"})}),l.jsxs("div",{className:"flex space-x-2",children:[u.spotifyUrl&&l.jsx("a",{href:`${u.spotifyUrl}?${Gc}`,target:"_blank",rel:"noopener noreferrer",className:"text-[#A0A0A0] hover:text-[#FB3939] transition","aria-label":`Listen to ${u.name} on Spotify`,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm4.326 18.266c-1.513.778-3.039 1.339-4.614 1.733-1.58.393-3.013.579-4.314.579-1.301 0-2.366-.21-3.195-.632-.828-.422-1.242-1.
4213027-1.242-1.818 0-.589.104-1.182.31-1.769.208-.588.524-1.207.948-1.858-.18.147-.32.315-.419.5-.128.186-.193.366-.193.54 0 .262.079.485.235.665.157.18.366.315.627.403s.563.137.903.137c.47 0 .97-.084 1.504-.252.532-.169 1.082-.396 1.652-.684.57-.288 1.152-.62 1.743-.994.592-.376 1.185-.794 1.778-1.254 1.188-.902 2.155-1.754 2.898-2.554.745-.8 1.116-1.436 1.116-1.906 0-.263-.058-.483-.175-.664-.118-.182-.273-.316-.463-.407-.19-.09-.403-.136-.641-.136-.428 0-.914.116-1.459.349s-1.156.625-1.825 1.177c-.669.551-1.388 1.28-2.157 2.172-.768.894-1.589 1.994-2.459 3.301-.546.812-1.027 1.576-1.447 2.288-.419.714-.788 1.355-1.111 1.924-.322.57-.605 1.068-.849 1.493 1.093.035 2.082-.107 2.966-.429.885-.321 1.67-.672 2.358-1.05.689-.379 1.292-.706 1.809-.978s.953-.407 1.319-.407c.366 0 .634.106.807.317s.258.446.258.703c0 .13-.31.266-.95.407-.63.143-.182.385-.355.736z"})})}),u.appleUrl&&l.jsx("a",{href:`${u.appleUrl}?${Gc}`,target:"_blank",rel:"noopener noreferrer",className:"text-[#A0A0A0] hover:text-[#FB3939] transition","aria-label":`Listen to ${u.name} on Apple Music`,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm3.445 17.827c-3.684 1.684-9.401-9.43-5.8-11.308.83-.428 1.576-.352 2.165.14l.011.011c.466.436.829 1.228.57 1.686-.365.684-1.404.407-1.82.222-.153-.068-.255-.172-.293-.311-.076-.244.146-.664.19-.777.189-.487-.729-.714-.863-.578-.124.127-.188.345-.189.626 0 .438.122.934.364 1.424.24.488.587.925.89 1.174.3.248.715.412.864.456.723.214 1.203-.154 1.45-.394.247-.238.513-.596.513-.596.453-.989.677-2.004.676-3.022 0-.546-.041-.996-.125-1.388-.085-.394-.219-.686-.401-.865-.182-.177-.416-.275-.683-.283-.284-.009-.512.068-.692.238-.18.17-.33.307-.433.452-.103.143-.186.223-.236.222-.051 0-.158-.115-.312-.34-.152-.225-.307-.498-.462-.82-.156-.32-.295-.607-.395-.86.306-.38.573-.789.798-1.222.223-.433.39-.895.478-1.377.88-.48.105-1.003.105-1.566 0-1.898-.489-3.178-1.375-3.88-.89-.7-1.891-.674-2.996.021-1.073.695-1.992 1.935-2.633 3.673-.596 1.6-.967 3.443-1.099 5.363-.134 1.922.016 3.839.486 5.618.467 1.777 1.26 3.334 2.353 4.538.069.076.3.301.483.468.181.169.379.327.594.417.453.186 1.035.25 1.555-.223l.011-.01c.247-.194.428-.46.544-.803.115-.343.155-.766.124-1.271-.037-.595-.231-1.174-.584-1.737-.351-.563-.911-1.125-1.621-1.667z"})})})]})]})]})]},u.id)})}):l.jsx(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:l.jsx(tr,{className:"pt-6 pb-8",children:l.jsxs("div",{className:"text-center py-8",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5] mb-4",children:"No Favorites Yet"}),l.jsx("p",{className:"text-[#A0A0A0] mb-6",children:"You haven't added any artists to your favorites."}),l.jsx(Pt,{href:Ve.ARTISTS,children:l.jsx("a",{className:"bg-[#FB3939] hover:bg-opacity-90 text-white px-4 py-2 rounded-lg inline-block",children:"Browse Artists"})})]})})})]}):l.jsx("div",{className:"container mx-auto px-4 py-8",children:l.jsx(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:l.jsx(tr,{className:"pt-6 pb-8",children:l.jsxs("div",{className:"text-center py-8",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5] mb-4",children:"Authentication Required"}),l.jsx("p",{className:"text-[#A0A0A0] mb-6",children:"Please sign in to view your favorites."}),l.jsx(it,{onClick:()=>window.location.href=Ve.LOGIN,className:"bg-[#FB3939] hover:bg-opacity-90 text-white",children:"Sign In"})]})})})})}function Kne(){return l.jsx("div",{className:"bg-[#121212] min-h-screen",children:l.jsx(Yne,{})})}function Zne(){const{user:n,isAuthenticated:e,isLoading:t}=vi();Mn();const[r,i]=Bi(),[s,o]=T.useState("overview"),[a,c]=T.useState(!1);return T.useEffect(()=>{c(!0)},[]),t?l.jsx("div",{className:"container mx-auto px-4 py-12",children:l.jsx("div",{className:"flex justify-center items-center h-48",children:l.jsx("div",{className:"text-[#A0A0A0]",children:"Loading admin panel..."})})}):l.jsxs("div",{className:"container mx-auto px-4 py-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsx("h1",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5]",children:"Admin Panel"}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[#A0A0A0] mr-2",children:"Logged in as:"}),l.jsx("span",{className:"text-[#FB3939] font-medium",children:(n==null?void 0:n.firstName)||(n==null?void 0:n.email)||"Admin"})]})]}),l.jsxs(b1,{defaultValue:"overview",value:s,onValueChange:o,className:"w-full",children:[l.jsxs(Am,{className:"bg-[#2D2D2D] mb-6",children:[l.jsx(Fi,{value:"overview",className:"data-[state=active]:bg-[#FB3939] data-[state=active]:text-white",children:"Overview"}),l.jsx(Fi,{value:"artists",className:"data-[state=active]:bg-[#FB3939] data-[state=active]:text-white",children:"Artists"}),l.jsx(Fi,{value:"reviews",className:"data-[state=active]:bg-[#FB3939] data-[state=active]:text-white",children:"Reviews"}),l.jsx(Fi,{value:"comments",className:"data-[state=active]:bg-[#FB3939] data-[state=active]:text-white",children:"Comments"})]}),l.jsxs(Di,{value:"overview",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx(ts,{children:l.jsx(ns,{className:"text-[#F5F5F5]",children:"Artists"})}),l.jsxs(tr,{children:[l.jsx("div",{className:"text-4xl font-bold text-[#FB3939] mb-4",children:l.jsx(Qne,{})}),l.jsx(it,{onClick:()=>i(Ve.ADMIN_ARTISTS),className:"bg-[#FB3939] hover:bg-opacity-90 text-white",children:"Manage Artists"})]})]}),l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx(ts,{children:l.jsx(ns,{className:"text-[#F5F5F5]",children:"Reviews"})}),l.jsxs(tr,{children:[l.jsx("div",{className:"text-4xl font-bold text-[#3A86FF] mb-4",children:l.jsx(Jne,{})}),l.jsx(it,{onClick:()=>i(Ve.ADMIN_REVIEWS),className:"bg-[#3A86FF] hover:bg-opacity-90 text-white",children:"Manage Reviews"})]})]}),l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx(ts,{children:l.jsx(ns,{className:"text-[#F5F5F5]",children:"Comments"})}),l.jsxs(tr,{children:[l.jsx("div",{className:"text-4xl font-bold text-[#F59E0B] mb-4",children:l.jsx(ere,{})}),l.jsx(it,{onClick:()=>i(Ve.ADMIN_COMMENTS),className:"bg-[#F59E0B] hover:bg-opacity-90 text-white",children:"Manage Comments"})]})]}),l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx(ts,{children:l.jsx(ns,{className:"text-[#F5F5F5]",children:"Site Customization"})}),l.jsxs(tr,{children:[l.jsx("div",{className:"text-4xl font-bold text-[#FB3939] mb-4",children:l.jsx("span",{children:"ð¨"})}),l.jsx(it,{onClick:()=>i(Ve.ADMIN_CUSTOMIZATION),className:"bg-[#FB3939] hover:bg-opacity-90 text-white",children:"Customize Site"})]})]})]}),l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D] mt-6",children:[l.jsx(ts,{children:l.jsx(ns,{className:"text-[#F5F5F5]",children:"Qu
4213ick Actions"})}),l.jsx(tr,{children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(Pt,{href:`${Ve.ADMIN_ARTISTS}?new=true`,children:l.jsxs("a",{className:"bg-[#2D2D2D] hover:bg-[#3D3D3D] text-[#F5F5F5] p-4 rounded-lg flex items-center transition",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 mr-2 text-[#FB3939]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4v16m8-8H4"})}),"Add New Artist"]})}),l.jsx(Pt,{href:Ve.HOME,children:l.jsxs("a",{className:"bg-[#2D2D2D] hover:bg-[#3D3D3D] text-[#F5F5F5] p-4 rounded-lg flex items-center transition",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 mr-2 text-[#3A86FF]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),"View Site"]})})]})})]})]}),l.jsx(Di,{value:"artists",children:l.jsxs("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-6",children:[l.jsxs("div",{className:"flex justify-between items-center mb-6",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5]",children:"Manage Artists"}),l.jsx(Pt,{href:`${Ve.ADMIN_ARTISTS}?new=true`,children:l.jsxs("a",{className:"bg-[#FB3939] hover:bg-opacity-90 text-white px-4 py-2 rounded-lg flex items-center",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4v16m8-8H4"})}),"Add Artist"]})})]}),l.jsx("p",{className:"text-[#A0A0A0] mb-4",children:"Click the button above to add a new artist or go to the full artists management page for more options."}),l.jsx(it,{onClick:()=>i(Ve.ADMIN_ARTISTS),className:"bg-[#3A86FF] hover:bg-opacity-90 text-white",children:"Go to Artists Management"})]})}),l.jsx(Di,{value:"reviews",children:l.jsxs("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-6",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5] mb-6",children:"Manage Reviews"}),l.jsx("p",{className:"text-[#A0A0A0] mb-4",children:"Moderate user reviews and manage review content from the reviews management page."}),l.jsx(it,{onClick:()=>i(Ve.ADMIN_REVIEWS),className:"bg-[#3A86FF] hover:bg-opacity-90 text-white",children:"Go to Reviews Management"})]})}),l.jsx(Di,{value:"comments",children:l.jsxs("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-6",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5] mb-6",children:"Manage Comments"}),l.jsx("p",{className:"text-[#A0A0A0] mb-4",children:"Moderate user comments and manage comment content from the comments management page."}),l.jsx(it,{onClick:()=>i(Ve.ADMIN_COMMENTS),className:"bg-[#3A86FF] hover:bg-opacity-90 text-white",children:"Go to Comments Management"})]})})]})]})}function Qne(){const{data:n}=Nt({queryKey:["/api/admin/artists"]});return l.jsx(l.Fragment,{children:(n==null?void 0:n.length)||0})}function Jne(){const{data:n=[]}=Nt({queryKey:["/api/admin/reviews"]});return l.jsx(l.Fragment,{children:n.length||0})}function ere(){const{data:n=[]}=Nt({queryKey:["/api/admin/comments"]});return l.jsx(l.Fragment,{children:n.length||0})}function tre({className:n}){return l.jsx("div",{className:Ct("animate-spin",n),children:l.jsx("svg",{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",children:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})}function Tm({children:n}){const{user:e,isAuthenticated:t,isAdmin:r,isLoading:i}=vi();return i?l.jsxs("div",{className:"min-h-screen bg-[#121212] flex flex-col items-center justify-center",children:[l.jsx(tre,{className:"w-12 h-12 text-[#FB3939]"}),l.jsx("p",{className:"text-[#F5F5F5] mt-4",children:"Verifying admin status..."})]}):t?l.jsx(l.Fragment,{children:n}):(window.location.href=Ve.LOGIN,null)}function nre(){return l.jsx(Tm,{children:l.jsx("div",{className:"bg-[#121212] min-h-screen",children:l.jsx(Zne,{})})})}var YM="Dialog",[hO,fie]=Uo(YM),[rre,ao]=hO(YM),fO=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=n,a=T.useRef(null),c=T.useRef(null),[u=!1,f]=Dl({prop:r,defaultProp:i,onChange:s});return l.jsx(rre,{scope:e,triggerRef:a,contentRef:c,contentId:xa(),titleId:xa(),descriptionId:xa(),open:u,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(p=>!p),[f]),modal:o,children:t})};
vendor: 5,616 bytes, lines 4213-4217
4213fO.displayName=YM;var pO="DialogTrigger",mO=T.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ao(pO,t),s=Tn(e,i.triggerRef);return l.jsx(Dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":QM(i.open),...r,ref:s,onClick:At(n.onClick,i.onOpenToggle)})});mO.displayName=pO;var KM="DialogPortal",[ire,gO]=hO(KM,{forceMount:void 0}),xO=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:i}=n,s=ao(KM,e);return l.jsx(ire,{scope:e,forceMount:t,children:T.Children.map(r,o=>l.jsx(Gl,{present:t||s.open,children:l.jsx(my,{asChild:!0,container:i,children:o})}))})};xO.displayName=KM;var Kv="DialogOverlay",vO=T.forwardRef((n,e)=>{const t=gO(Kv,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=ao(Kv,n.__scopeDialog);return s.modal?l.jsx(Gl,{present:r||s.open,children:l.jsx(ore,{...i,ref:e})}):null});vO.displayName=Kv;var sre=uh("DialogOverlay.RemoveScroll"),ore=T.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ao(Kv,t);return l.jsx(LM,{as:sre,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Dt.div,{"data-state":QM(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),pu="DialogContent",yO=T.forwardRef((n,e)=>{const t=gO(pu,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=ao(pu,n.__scopeDialog);return l.jsx(Gl,{present:r||s.open,children:s.modal?l.jsx(are,{...i,ref:e}):l.jsx(lre,{...i,ref:e})})});yO.displayName=pu;var are=T.forwardRef((n,e)=>{const t=ao(pu,n.__scopeDialog),r=T.useRef(null),i=Tn(e,t.contentRef,r);return T.useEffect(()=>{const s=r.current;if(s)return S5(s)},[]),l.jsx(_O,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:At(n.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:At(n.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:At(n.onFocusOutside,s=>s.preventDefault())})}),lre=T.forwardRef((n,e)=>{const t=ao(pu,n.__scopeDialog),r=T.useRef(!1),i=T.useRef(!1);return l.jsx(_O,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=n.onCloseAutoFocus)==null||o.call(n,s),s.defaultPrevented||(r.current||(a=t.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=n.onInteractOutside)==null||c.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=t.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),_O=T.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=n,a=ao(pu,t),c=T.useRef(null),u=Tn(e,c);return y5(),l.jsxs(l.Fragment,{children:[l.jsx(kM,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(lm,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":QM(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(cre,{titleId:a.titleId}),l.jsx(dre,{contentRef:c,descriptionId:a.descriptionId})]})]})}),ZM="DialogTitle",wO=T.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ao(ZM,t);return l.jsx(Dt.h2,{id:i.titleId,...r,ref:e})});wO.displayName=ZM;var bO="DialogDescription",SO=T.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ao(bO,t);return l.jsx(Dt.p,{id:i.descriptionId,...r,ref:e})});SO.displayName=bO;var EO="DialogClose",MO=T.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ao(EO,t);return l.jsx(Dt.button,{type:"button",...r,ref:e,onClick:At(n.onClick,()=>i.onOpenChange(!1))})});MO.displayName=EO;function QM(n){return n?"open":"closed"}var AO="DialogTitleWarning",[pie,TO]=vz(AO,{contentName:pu,titleName:ZM,docsSlug:"dialog"}),cre=({titleId:n})=>{const e=TO(AO),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 4214 4215If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 4216 4217For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return T.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},ure="DialogDescriptionWarning",dre=({contentRef:n,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${TO(ure).contentName}}.`;return T.useEffect(()=>{var s;const i=(s=n.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,n,e]),null},hre=fO,fre=mO,pre=xO,CO=vO,NO=yO,RO=wO,PO=SO,mre=MO;const gre=hre,xre=fre,vre=pre,IO=T.forwardRef(({className:n,...e},t)=>l.jsx(CO,{ref:t,className:Ct("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",n),...e}));IO.displayName=CO.displayName;const FO=T.forwardRef(({className:n,children:e,...t},r)=>l.jsxs(vre,{children:[l.jsx(IO,{}),l.jsxs(NO,{ref:r,className:Ct("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:rou
4217nded-lg",n),...t,children:[e,l.jsxs(mre,{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:[l.jsx(yy,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));FO.displayName=NO.displayName;const DO=({className:n,...e})=>l.jsx("div",{className:Ct("flex flex-col space-y-1.5 text-center sm:text-left",n),...e});DO.displayName="DialogHeader";const kO=T.forwardRef(({className:n,...e},t)=>l.jsx(RO,{ref:t,className:Ct("text-lg font-semibold leading-none tracking-tight",n),...e}));kO.displayName=RO.displayName;const LO=T.forwardRef(({className:n,...e},t)=>l.jsx(PO,{ref:t,className:Ct("text-sm text-muted-foreground",n),...e}));LO.displayName=PO.displayName;function fP({onSelectContent:n,contentType:e="custom",subjectName:t="",buttonText:r="Generate with AI",buttonClassName:i="",buttonVariant:s="outline",onInfluenceLevelChange:o}){const[a,c]=T.useState(!1),[u,f]=T.useState(!1),[p,m]=T.useState(""),[x,v]=T.useState(""),[_,y]=T.useState(200),[g,b]=T.useState(""),[S,M]=T.useState(e),{toast:A}=Mn(),R={bio:{prompt:t||"",additionalInfo:"Focus on their hip-hop career, major albums, and unique style. Include their rise to fame, influences, and career highlights. Mention any controversies without being too detailed. End with their musical legacy and current relevance."},genre:{prompt:t||"",additionalInfo:"Include the origins of this genre, key artists who defined it, musical characteristics, cultural impact, and its evolution over time. Highlight how this genre relates to the broader hip-hop landscape and its influence on modern music."},era:{prompt:t||"",additionalInfo:"Cover the defining characteristics of this era, key artists, technological and cultural influences, major albums/songs, and how it transformed hip-hop. Explain what made this period unique and its lasting impact on music today."},"eminem-connection":{prompt:t||"",additionalInfo:"Detail any collaborations with Eminem, mutual influences, public interactions, stylistic similarities, lyrical references to each other, shared producers/labels, and their relationship in the hip-hop community. Include specific songs, albums or quotes if relevant."},custom:{prompt:"",additionalInfo:""}},F=D=>{c(D),D&&(b(""),m(t||R[S].prompt),v(R[S].additionalInfo),t&&S!=="custom"&&setTimeout(()=>{L()},100))},L=async()=>{if(!p&&S!=="custom"){A({title:"Input needed",description:"Please enter a name to generate content",variant:"destructive"});return}if(S==="custom"&&!p){A({title:"Input needed",description:"Please enter a prompt to generate content",variant:"destructive"});return}f(!0);try{let D="",O={};switch(S){case"bio":D="/api/openai/generate-bio",O={artistName:p,additionalInfo:x};break;case"genre":D="/api/openai/generate-genre",O={genreName:p,additionalInfo:x};break;case"era":D="/api/openai/generate-era",O={eraName:p,additionalInfo:x};break;case"eminem-connection":D="/api/openai/generate-eminem-connection",O={artistName:p,additionalInfo:x};break;case"custom":D="/api/openai/generate-custom",O={prompt:p,wordLimit:_};break;default:D="/api/openai/generate-custom",O={prompt:p,wordLimit:_}}const U=await fetch(D,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O),credentials:"include"});if(!U.ok)throw new Error("Failed to generate content");const V=await U.json();b(V.content),S==="eminem-connection"&&V.influenceLevelId&&o&&(o(V.influenceLevelId),A({title:"Influence level detected",description:"Automatically set influence level based on artist connection"})),A({title:"Content generated",description:"AI content has been generated successfully"})}catch(D){console.error("Error generating content:",D),A({title:"Generation failed",description:"Failed to generate content. Please try again.",variant:"destructive"})}finally{f(!1)}},N=()=>{n(g),c(!1),A({title:"Content applied",description:"The generated content has been applied"})},I=()=>{navigator.clipboard.writeText(g),A({title:"Copied!",description:"Content copied to clipboard"})};return l.jsxs(gre,{open:a,onOpenChange:F,children:[l.jsx(xre,{asChild:!0,children:l.jsxs(it,{variant:s,className:`flex items-center gap-1 ${i}`,size:"sm",children:[l.jsx(uw,{className:"h-3.5 w-3.5"}),r]})}),l.jsxs(FO,{className:"sm:max-w-[600px] max-h-[80vh] overflow-y-auto",children:[l.jsxs(DO,{children:[l.jsxs(kO,{className:"flex items-center gap-2",children:[l.jsx(uw,{className:"h-5 w-5"}),"AI Content Generator"]}),l.jsx(LO,{children:"Generate professional content with AI. Content is being generated automatically with optimized prompts. You can edit the suggestions or regenerate as needed."})]}),l.jsxs(b1,{value:S,onValueChange:D=>M(D),className:"w-full",children:[l.jsxs(Am,{className:"grid grid-cols-5 mb-4",children:[l.jsx(Fi,{value:"bio",children:"Artist Bio"}),l.jsx(Fi,{value:"genre",children:"Genre"}),l.jsx(Fi,{value:"era",children:"Era"}),l.jsx(Fi,{value:"eminem-connection",children:"Eminem Connection"}),l.jsx(Fi,{value:"custom",children:"Custom"})]}),l.jsxs(Di,{value:"bio",className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"artistName",children:"Artist Name"}),l.jsx(Sn,{id:"artistName",value:p,onChange:D=>m(D.target.value),placeholder:"Enter artist name"})]}),l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"bioAdditionalInfo",children:"Additional Information (Optional)"}),l.jsx(es,{id:"bioAdditionalInfo",value:x,onChange:D=>v(D.target.value),placeholder:"Add any additional details about the artist (style, notable albums, collaborations)",rows:3})]})]}),l.jsxs(Di,{value:"genre",className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"genreName",children:"Genre Name"}),l.jsx(Sn,{id:"genreName",value:p,onChange:D=>m(D.target.value),placeholder:"Enter genre name"})]}),l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"genreAdditionalInfo",children:"Additional Information (Optional)"}),l.jsx(es,{id:"genreAdditionalInfo",value:x,onChange:D=>v(D.target.value),placeholder:"Add any additional details about the genre (origins, evolution, key artists)",rows:3})]})]}),l.jsxs(Di,{value:"era",className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"eraName",children:"Era Name"}),l.jsx(Sn,{id:"eraName",value:p,onChange:D=>m(D.target.value),placeholder:"Enter era name (e.g., 90s Hip Hop, Golden Age)"})]}),l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"eraAdditionalInfo",children:"Additional Information (Optional)"}),l.jsx(es,{id:"eraAdditionalInfo",value:x,onChange:D=>v(D.target.value),placeholder:"Add any additional details about this musical era",rows:3})]})]}),l.jsxs(Di,{value:"eminem-connection",className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"connectionArtistName",children:"Artist Name"}),l.jsx(Sn,{id:"connectionArtistName",value:p,onChange:D=>m(D.target.value),placeholder:"Enter artist name"})]}),l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"connectionAdditionalInfo",children:"Additional Information (Optional)"}),l.jsx(es,{id:"connectionAdditionalInfo",value:x,onChange:D=>v(D.target.value),placeholder:"Add any known details about this artist's connection to Eminem",rows:3})]})]}),l.jsxs(Di,{value:"custom",className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"customPrompt",children:"Custom Prompt"}),l.jsx(es,{id:"customPrompt",value:p,onChange:D=>m(D.target.value),placeholder:"Enter your custom prompt (e.g., Write a description of Dr. Dre's influence on West Coast hip hop)",rows:3})]}),l.jsxs("div",{children:[l.jsx(kn,{htmlFor:"wordLimit",children:"Word Limit"}),l.jsxs(OM,{value:_.toString(),onValueChange:D=>y(parseInt(D)),children:[l.jsx(f1,{id:"wordLimit",children:l.jsx(UM,{placeholder:"Select a word limit"})}),l.jsx(p1,{children:l.jsxs(dee,{children:[l.jsx(mj,{children:"Word Count"}),l.jsx(wl,{value:"100",children:"100 words"}),l.jsx(wl,{value:"200",children:"200 words"}),l.jsx(wl,{value:"300",children:"300 words"}),l.jsx(wl,{value:"500",children:"500 words"})]})})]})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[!g&&l.jsx(it,{onClick:L,disabled:u,className:"w-full",children:u?l.jsxs(l.Fragment,{children:[l.jsx(ru,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating..."]}):l.jsxs(l.Fragment,{children:[l.jsx(uw,{className:"mr-2 h-4 w-4"}),"Generate Content"]})}),g&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"relative",children:[l.jsx(es,{value:g,readOnly:!0,className:"min-h-[200px] pr-10",rows:8}),l.jsx(it,{variant:"ghost",size:"icon",className:"absolute top-2 right-2",onClick:I,children:l.jsx(f8,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(it,{variant:"outline",onClick:()=>{b("")},children:"Regenerate"}),l.jsx(it,{className:"flex-1",onClick:N,children:"Apply Content"})]})]})]})]})]})}const yre=({artistName:n,onLinksFound:e})=>{const[t,r]=T.useState(!1),{toast:i}=Mn(),s=async()=>{var o;if(!n||n.trim()===""){i({title:"Artist name required",description:"Please enter an artist name first",variant:"destructive"});return}r(!0);try{console.log("Fetching social media for artist:",n);const a=await fetch(`/api/spotify/search?q=${encodeURIComponent(n.trim())}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!a.ok)throw new Error("Failed to search Spotify");const c=await a.json();if(!c.artists||c.artists.items.length===0){i({title:"Artist not found",description:"No artist found on Spotify with that name",variant:"destructive"}),r(!1);return}const u=c.artists.items[0],f={spotifyUrl:((o=u.external_urls)==null?void 0:o.spotify)||""},p=u.name.toLowerCase().replace(/\s+/g,"").replace(/[^\w\s]/gi,"");u.external_urls&&(u.external_urls.instagram&&(f.instagramUrl=u.external_urls.instagram),u.external_urls.twitter&&(f.twitterUrl=u.external_urls.twitter),u.external_urls.youtube&&(f.youtubeUrl=u.external_urls.youtube)),f.instagramUrl||(f.instagramUrl=`https://www.instagram.com/${p}`),f.twitterUrl||(f.twitterUrl=`https://twitter.com/${p}`),f.youtubeUrl||(f.youtubeUrl=`https://www.youtube.com/results?search_query=${encodeURIComponent(u.name)}
4217`),f.websiteUrl="",console.log("Generated social media links for",u.name,":",f),e(f),i({title:"Social media links found",description:"Artist links have been added to the form"})}catch(a){console.error("Error fetching social media links:",a),i({title:"Error finding links",description:"Failed to fetch social media links from Spotify",variant:"destructive"})}finally{r(!1)}};return l.jsxs(it,{type:"button",variant:"outline",size:"sm",onClick:s,disabled:t||!n,className:"flex items-center gap-1",children:[t?l.jsx(ru,{className:"h-4 w-4 animate-spin"}):l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(DS,{className:"h-3 w-3"}),l.jsx(As,{className:"h-3 w-3"}),l.jsx(R8,{className:"h-3 w-3"}),l.jsx(m8,{className:"h-3 w-3"}),l.jsx(A8,{className:"h-3 w-3"})]}),l.jsx("span",{children:"Find Links"})]})},_re=({artistName:n,onMetadataFound:e,existingGenres:t,existingEras:r})=>{const[i,s]=T.useState(!1),{toast:o}=Mn(),a=async()=>{var c,u,f,p,m,x,v;if(!n||n.trim()===""){o({title:"Artist name required",description:"Please enter an artist name first",variant:"destructive"});return}s(!0);try{console.log("Fetching metadata for artist:",n);const _=await fetch(`/api/spotify/search?q=${encodeURIComponent(n.trim())}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!_.ok)throw new Error("Failed to search Spotify");const y=await _.json();if(!y.artists||y.artists.items.length===0){o({title:"Artist not found",description:"No artist found on Spotify with that name",variant:"destructive"}),s(!1);return}const g=(u=(c=y.artists)==null?void 0:c.items)==null?void 0:u[0];if(!g||!g.id)throw new Error("Artist data is incomplete");console.log("Found artist on Spotify:",g.name,"ID:",g.id);const b=await fetch(`/api/spotify/${g.id}/albums?limit=50`,{method:"GET",headers:{"Content-Type":"application/json"}});let S=null;if(b.ok){const D=await b.json();D.items&&D.items.length>0&&D.items.forEach(O=>{if(O.release_date){const U=parseInt(O.release_date.substring(0,4));(!S||U<S)&&(S=U)}})}const M={},A=[],R=(f=t.find(D=>D.name.toLowerCase().includes("hip hop")||D.name.toLowerCase().includes("hip-hop")))==null?void 0:f.id,F=(p=t.find(D=>D.name.toLowerCase().includes("trap")))==null?void 0:p.id,L=(m=t.find(D=>D.name.toLowerCase()==="rap"||D.name.toLowerCase()==="rap music"))==null?void 0:m.id;if(R&&A.push(R),g.genres&&Array.isArray(g.genres)&&g.genres.length>0&&(console.log("Spotify genres for artist:",g.genres.join(", ")),g.genres.forEach(D=>{const O=D.toLowerCase();t.forEach(U=>{const V=U.name.toLowerCase();(O.includes(V)||V.includes(O))&&(A.includes(U.id)||A.push(U.id)),O.includes("trap")&&F&&!A.includes(F)&&A.push(F),O.includes("rap")&&L&&!A.includes(L)&&A.push(L)})})),A.length===0&&R&&A.push(R),A.length>0){M.genres=A;const D=A.map(O=>{const U=t.find(V=>V.id===O);return U?U.name:`Unknown (ID: ${O})`});console.log("Selected genres for artist:",D.join(", "))}const N=[];if(S&&(console.log("First album year detected:",S),r.forEach(D=>{const O=D.startYear?parseInt(D.startYear):null,U=D.endYear?parseInt(D.endYear):null;if(S&&(O&&U&&S>=O&&S<=U||O&&!U&&S>=O||!O&&U&&S<=U)&&N.push(D.id),S){const V=String(Math.floor(S/10)*10)+"s";D.name.toLowerCase().includes(V.toLowerCase())&&(N.includes(D.id)||N.push(D.id))}})),N.length===0){const D=(x=r.find(U=>U.name.toLowerCase().includes("modern")))==null?void 0:x.id,O=(v=r.find(U=>U.name.toLowerCase().includes("2010s")))==null?void 0:v.id;D&&N.push(D),O&&!N.includes(O)&&N.push(O)}if(N.length>0&&(M.eras=N),M.eras){const D=M.eras.map(O=>{const U=r.find(V=>V.id===O);return U?U.name:`Unknown (ID: ${O})`});console.log("Selected eras for artist:",D.join(", "))}e(M);let I=[];M.genres&&I.push(`${M.genres.length} genres`),M.eras&&I.push(`${M.eras.length} eras`),I.length>0?o({title:"Metadata found",description:`Found ${I.join(" and ")} for this artist`}):o({title:"No metadata found",description:"Couldn't match any genres or eras for this artist",variant:"destructive"})}catch(_){console.error("Error fetching artist metadata:",_),o({title:"Error finding metadata",description:"Failed to fetch metadata from Spotify",variant:"destructive"})}finally{s(!1)}};return l.jsxs(it,{type:"button",variant:"outline",size:"sm",onClick:a,disabled:i||!n,className:"flex items-center gap-1",children:[i?l.jsx(ru,{className:"h-4 w-4 animate-spin"}):l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(M8,{className:"h-3.5 w-3.5"}),l.jsx(qF,{className:"h-3.5 w-3.5"})]}),l.jsx("span",{children:"Find Genres & Eras"})]})},wre=({influenceLevelId:n,showLabel:e=!0,size:t="md",className:r=""})=>{const{data:i}=Nt({queryKey:["/api/influence-levels"],enabled:!0});if(!i||!n)return null;const s=i.find(p=>p.id===n);if(!s)return null;const o=i.findIndex(p=>p.id===n),a=i.length,c=(a-o)/a*100,u=()=>{switch(t){case"sm":return"h-2";case"lg":return"h-6";default:return"h-4"}}
4217,f=()=>c<25?"bg-red-600":c<50?"bg-orange-500":c<75?"bg-yellow-500":"bg-green-600";return l.jsxs("div",{className:`flex flex-col gap-1 ${r}`,children:[e&&l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{children:"Eminem Influence"}),l.jsx("span",{className:"font-semibold",children:s.name})]}),l.jsx("div",{className:`relative w-full overflow-hidden rounded-full ${u()} bg-gray-800`,children:l.jsx("div",{className:`h-full ${f()}`,style:{width:`${c}%`}})})]})},bre=y1({name:Qn().min(1,"Name is required"),slug:Qn().min(1,"Slug is required").regex(/^[a-z0-9-]+$/,"Slug can only contain lowercase letters, numbers, and hyphens"),imageUrl:Qn().url("Must be a valid URL").optional().or(wc("")),bio:Qn().optional(),influenceLevelId:Ane.number().optional(),websiteUrl:Qn().url("Must be a valid URL").optional().or(wc("")),spotifyUrl:Qn().url("Must be a valid URL").optional().or(wc("")),appleUrl:Qn().url("Must be a valid URL").optional().or(wc("")),youtubeUrl:Qn().url("Must be a valid URL").optional().or(wc("")),instagramUrl:Qn().url("Must be a valid URL").optional().or(wc("")),twitterUrl:Qn().url("Must be a valid URL").optional().or(wc("")),eminemConnection:Qn().optional(),featured:Mne().default(!1),genres:dP(uP()).default([]),eras:dP(uP()).default([])});function jO({artistId:n,onSuccess:e,prefillData:t}){var S,M;const[r,i]=Bi(),{toast:s}=Mn(),o=hs(),a=!!n,{data:c,isLoading:u}=Nt({queryKey:[`/api/artists/${n}`],enabled:a}),{data:f=[]}=Nt({queryKey:["/api/influence-levels"]}),{data:p=[]}=Nt({queryKey:["/api/genres"]}),{data:m=[]}=Nt({queryKey:["/api/eras"]}),x=x1({resolver:v1(bre),defaultValues:{name:"",slug:"",imageUrl:"",bio:"",influenceLevelId:void 0,websiteUrl:"",spotifyUrl:"",appleUrl:"",youtubeUrl:"",instagramUrl:"",twitterUrl:"",eminemConnection:"",featured:!1,genres:[],eras:[]}});T.useEffect(()=>{c&&a?x.reset({name:c.name||"",slug:c.slug||"",imageUrl:c.imageUrl||"",bio:c.bio||"",influenceLevelId:c.influenceLevelId,websiteUrl:c.websiteUrl||"",spotifyUrl:c.spotifyUrl||"",appleUrl:c.appleUrl||"",youtubeUrl:c.youtubeUrl||"",instagramUrl:c.instagramUrl||"",twitterUrl:c.twitterUrl||"",eminemConnection:c.eminemConnection||"",featured:c.featured||!1,genres:(c.genres||[]).map(A=>A.id),eras:(c.eras||[]).map(A=>A.id)}):t&&!a&&x.reset({name:t.name||"",slug:t.slug||"",imageUrl:t.imageUrl||"",bio:"",influenceLevelId:void 0,websiteUrl:"",spotifyUrl:t.spotifyUrl||"",appleUrl:"",youtubeUrl:"",instagramUrl:"",twitterUrl:"",eminemConnection:"Added from Spotify search. Connection to Eminem needs to be described here.",featured:!1,genres:[],eras:[]})},[c,x,a,t]);const v=A=>A.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/--+/g,"-").trim(),_=A=>{const R=A.target.value;x.setValue("name",R);const F=x.getValues("slug"),L=x.getValues("name"),N=v(L);(!F||F===N)&&x.setValue("slug",v(R))},y=ti({mutationFn:async A=>(await Lo("POST","/api/artists",A)).json(),onSuccess:()=>{s({title:"Artist created",description:"The artist has been created successfully."}),o.invalidateQueries({queryKey:["/api/artists"]}),x.reset(),e?e():i(Ve.ADMIN_ARTISTS)},onError:A=>{s({title:"Error",description:A.message||"Failed to create artist. Please try again.",variant:"destructive"})}}),g=ti({mutationFn:async A=>(await Lo("PUT",`/api/artists/${n}`,A)).json(),onSuccess:()=>{s({title:"Artist updated",description:"The artist has been updated successfully."}),o.invalidateQueries({queryKey:["/api/artists"]}),o.invalidateQueries({queryKey:[`/api/artists/${n}`]}),e?e():i(Ve.ADMIN_ARTISTS)},onError:A=>{s({title:"Error",description:A.message||"Failed to update artist. Please try again.",variant:"destructive"})}}),b=A=>{a?g.mutate(A):y.mutate(A)};
4217return a&&u?l.jsx(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:l.jsx(ts,{children:l.jsx(ns,{className:"text-[#F5F5F5]",children:"Loading Artist..."})})}):l.jsxs(qn,{className:"bg-[#1E1E1E] border-[#2D2D2D]",children:[l.jsx(ts,{children:l.jsx(ns,{className:"text-[#F5F5F5]",children:a?"Edit Artist":"Add New Artist"})}),l.jsx(tr,{children:l.jsx(Vj,{...x,children:l.jsxs("form",{onSubmit:x.handleSubmit(b),className:"space-y-6",children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[l.jsx(Ir,{control:x.control,name:"name",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Artist Name"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"Artist name",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A,onChange:_})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:x.control,name:"slug",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"URL Slug"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"artist-slug",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A})}),l.jsx(x0,{className:"text-[#A0A0A0]",children:"Used in the URL, e.g., /artists/artist-slug"}),l.jsx(fr,{})]})})]}),l.jsx(Ir,{control:x.control,name:"imageUrl",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Image URL"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"https://example.com/image.jpg",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A,value:A.value||""})}),l.jsx(x0,{className:"text-[#A0A0A0]",children:"URL to the artist's image"}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:x.control,name:"bio",render:({field:A})=>l.jsxs(Mr,{children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Biography"}),l.jsx(fP,{contentType:"bio",subjectName:x.getValues("name"),onSelectContent:R=>A.onChange(R),buttonText:"Generate Bio",buttonClassName:"bg-gradient-to-r from-[#3a0000] to-[#FB3939] hover:from-[#FB3939] hover:to-[#3a0000] text-white border-none"})]}),l.jsx(Ar,{children:l.jsx(es,{placeholder:"Artist biography",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5] min-h-[150px]",...A,value:A.value||""})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:x.control,name:"eminemConnection",render:({field:A})=>l.jsxs(Mr,{children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Connection to Eminem"}),l.jsx(fP,{contentType:"eminem-connection",subjectName:x.getValues("name"),onSelectContent:R=>A.onChange(R),buttonText:"Generate Connection",buttonClassName:"bg-gradient-to-r from-[#3a0000] to-[#FB3939] hover:from-[#FB3939] hover:to-[#3a0000] text-white border-none",onInfluenceLevelChange:R=>{x.setValue("influenceLevelId",R)}})]}),l.jsx(Ar,{children:l.jsx(es,{placeholder:"Describe the artist's connection to Eminem",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5] min-h-[120px]",...A,value:A.value||""})}),l.jsx(fr,{})]})}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[l.jsx(Ir,{control:x.control,name:"influenceLevelId",render:({field:A})=>{var R;return l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Influence Level"}),l.jsx(Ar,{children:l.jsxs(OM,{onValueChange:F=>A.onChange(parseInt(F)||void 0),value:((R=A.value)==null?void 0:R.toString())||"",children:[l.jsx(f1,{className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",children:l.jsx(UM,{placeholder:"Select influence level"})}),l.jsx(p1,{className:"bg-[#1E1E1E] border-[#3D3D3D] text-[#F5F5F5]",children:f.map(F=>l.jsx(wl,{value:F.id.toString(),children:F.name},F.id))})]})}),A.value&&l.jsx("div",{className:"mt-2",children:l.jsx(wre,{influenceLevelId:A.value,size:"md",showLabel:!0})}),l.jsx(fr,{})]})}}),l.jsx(Ir,{control:x.control,name:"featured",render:({field:A})=>l.jsxs(Mr,{className:"flex flex-row items-center space-x-3 space-y-0 pt-6",children:[l.jsx(Ar,{children:l.jsx(Bd,{checked:A.value,onCheckedChange:A.onChange,className:"data-[state=checked]:bg-[#FB3939] data-[state=checked]:border-[#FB3939]"})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Featured Artist"}),l.jsx(x0,{className:"text-[#A0A0A0]",children:"Display this artist on the homepage"})]})]})})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("h3",{className:"text-xl font-heading text-[#F5F5F5]",children:"Genres & Eras"}),l.jsx(_re,{artistName:((S=document.querySelector('input[name="name"]'))==null?void 0:S.value)||x.getValues("name"),existingGenres:p,existingEras:m,onMetadataFound:A=>{A.genres&&x.setValue("genres",A.genres),A.eras&&x.setValue("eras",A.eras)}})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[l.jsxs("div",{children:[l.jsx(ar,{className:"text-[#F5F5F5] block mb-2",children:"Genres"}),l.jsx("div",{className:"bg-[#121212] border border-[#3D3D3D] rounded-md p-3 h-48 overflow-y-auto",children:l.jsx(f2,{control:x.control,name:"genres",render:({field:A})=>l.jsx(l.Fragment,{children:p.map(R=>l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsx(Bd,{id:`genre-${R.id}`,checked:A.value.includes(R.id),onCheckedChange:F=>{F?A.onChange([...A.value,R.id]):A.onChange(A.value.filter(L=>L!==R.id))},className:"data-[state=checked]:bg-[#FB3939] data-[state=checked]:border-[#FB3939]"}),l.jsx("label",{htmlFor:`genre-${R.id}`,className:"ml-2 text-[#E0E0E0] text-sm cursor-pointer",children:R.name})]},R.id))})})}),l.jsx(fr,{className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ar,{className:"text-[#F5F5F5] block mb-2",children:"Eras"}),l.jsx("div",{className:"bg-[#121212] border border-[#3D3D3D] rounded-md p-3 h-48 overflow-y-auto",children:l.jsx(f2,{control:x.control,name:"eras",render:({field:A})=>l.jsx(l.Fragment,{children:m.map(R=>l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsx(Bd,{id:`era-${R.id}`,checked:A.value.includes(R.id),onCheckedChange:F=>{F?A.onChange([...A.value,R.id]):A.onChange(A.value.filter(L=>L!==R.id))},className:"data-[state=checked]:bg-[#FB3939] data-[state=checked]:border-[#FB3939]"}),l.jsx("label",{htmlFor:`era-${R.id}`,className:"ml-2 text-[#E0E0E0] text-sm cursor-pointer",children:R.name})]},R.id))})})}),l.jsx(fr,{className:"mt-1"})]})]}),l.jsxs("div",{className:"flex justify-between items-center pt-4",children:[l.jsx("h3",{className:"text-xl font-heading text-[#F5F5F5]",children:"Social Media & Links"}),l.jsx(yre,{artistName:((M=document.querySelector('input[name="name"]'))==null?void 0:M.value)||x.getValues("name"),onLinksFound:A=>{A.websiteUrl&&x.setValue("websiteUrl",A.websiteUrl),A.spotifyUrl&&x.setValue("spotifyUrl",A.spotifyUrl),A.youtubeUrl&&x.setValue("youtubeUrl",A.youtubeUrl),A.instagramUrl&&x.setValue("instagramUrl",A.instagramUrl),A.twitterUrl&&x.setValue("twitterUrl",A.twitterUrl)}})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[l.jsx(Ir,{control:x.control,name:"websiteUrl",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Website"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"https://artistwebsite.com",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A,value:A.value||""})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:x.control,name:"spotifyUrl",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Spotify"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"https://open.spotify.com/artist/...",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A,value:A.value||""})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:x.control,name:"appleUrl",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Apple Music"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"https://music.apple.com/artist/...",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A,value:A.value||""})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:x.control,name:"youtubeUrl",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"YouTube"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"https://youtube.com/channel/...",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A,value:A.value||""})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:x.control,name:"instagramUrl",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Instagram"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"https://instagram.com/...",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A,value:A.value||""})}),l.jsx(fr,{})]})}),l.jsx(Ir,{control:x.control,name:"twitterUrl",render:({field:A})=>l.jsxs(Mr,{children:[l.jsx(ar,{className:"text-[#F5F5F5]",children:"Twitter"}),l.jsx(Ar,{children:l.jsx(Sn,{placeholder:"https://twitter.com/...",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]",...A,value:A.value||""})}),l.jsx(fr,{})]})})]}),l.jsxs("div",{className:"flex justify-end space-x-4 pt-4",children:[l.jsx(it,{type:"button",variant:"outline",onClick:()=>i(Ve.ADMIN_ARTISTS),className:"border-[#3D3D3D] text-[#E0E0E0] hover:bg-[#2D2D2D]",children:"Cancel"}),l.jsx(it,{type:"submit",className:"bg-[#FB3939] hover:bg-opacity-90 text-white",disabled:y.isPending||g.isPending,children:y.isPending||g.isPending?"Saving...":a?"Update Artist":"Add Artist"})]})]})})})]})}function Sre({onSelectArtist:n}){var p,m,x;const[e,t]=T.useState(""),[r,i]=T.useState(!1),{toast:s}=Mn(),{data:o,refetch:a,isFetching:c}=Nt({queryKey:[`/api/spotify/search-artists?q=${encodeURIComponent(e)}`],enabled:!1}),u=async()=>
4217{if(!e.trim()){s({title:"Search query empty",description:"Please enter an artist name to search",variant:"destructive"});return}i(!0),await a(),i(!1)},f=v=>{var y,g,b;const _={name:v.name,slug:v.name.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/--+/g,"-").trim(),imageUrl:((g=(y=v.images)==null?void 0:y[0])==null?void 0:g.url)||"",spotifyId:v.id,spotifyUrl:((b=v.external_urls)==null?void 0:b.spotify)||"",genres:v.genres||[]};n(_)};return l.jsxs("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-6 mb-8",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5] mb-6",children:"Search Spotify Artists"}),l.jsxs("div",{className:"flex gap-4 mb-6",children:[l.jsx(Sn,{type:"text",placeholder:"Search for an artist...",value:e,onChange:v=>t(v.target.value),onKeyDown:v=>v.key==="Enter"&&u(),className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5] flex-1"}),l.jsx(it,{onClick:u,disabled:c||!e.trim(),className:"bg-[#1DB954] hover:bg-[#1AA84F] text-black font-medium",children:c?"Searching...":"Search"})]}),(p=o==null?void 0:o.artists)!=null&&p.items&&o.artists.items.length>0?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:o.artists.items.map(v=>{var _,y,g;return l.jsxs(qn,{className:"bg-[#2A2A2A] border-[#3D3D3D] overflow-hidden flex",children:[l.jsx("div",{className:"w-20 h-20 flex-shrink-0",children:v.images&&((_=v.images[0])!=null&&_.url)?l.jsx("img",{src:v.images[0].url,alt:v.name,className:"w-full h-full object-cover"}):l.jsx("div",{className:"w-full h-full bg-[#121212] flex items-center justify-center text-[#666]",children:"No image"})}),l.jsx(tr,{className:"p-4 flex-1",children:l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-bold text-[#F5F5F5]",children:v.name}),((y=v.genres)==null?void 0:y.length)>0&&l.jsxs("p",{className:"text-sm text-[#A0A0A0] mt-1",children:[v.genres.slice(0,2).join(", "),v.genres.length>2&&"..."]}),l.jsxs("p",{className:"text-xs text-[#7D7D7D] mt-1",children:[(g=v.followers)==null?void 0:g.total.toLocaleString()," followers"]})]}),l.jsx(it,{onClick:()=>f(v),size:"sm",className:"bg-[#1DB954] hover:bg-[#1AA84F] text-black text-xs font-medium",children:"Select"})]})})]},v.id)})}):((x=(m=o==null?void 0:o.artists)==null?void 0:m.items)==null?void 0:x.length)===0&&!c?l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"No artists found matching your search."}):r?l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"Searching..."}):null]})}var JM="Progress",eA=100,[Ere,mie]=Uo(JM),[Mre,Are]=Ere(JM),OO=T.forwardRef((n,e)=>{const{__scopeProgress:t,value:r=null,max:i,getValueLabel:s=Tre,...o}=n;(i||i===0)&&!pP(i)&&console.error(Cre(`${i}`,"Progress"));const a=pP(i)?i:eA;r!==null&&!mP(r,a)&&console.error(Nre(`${r}`,"Progress"));const c=mP(r,a)?r:null,u=Zv(c)?s(c,a):void 0;return l.jsx(Mre,{scope:t,value:c,max:a,children:l.jsx(Dt.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Zv(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":zO(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});OO.displayName=JM;var UO="ProgressIndicator",BO=T.forwardRef((n,e)=>{const{__scopeProgress:t,...r}=n,i=Are(UO,t);return l.jsx(Dt.div,{"data-state":zO(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:e})});BO.displayName=UO;function Tre(n,e){return`${Math.round(n/e*100)}%`}function zO(n,e){return n==null?"indeterminate":n===e?"complete":"loading"}function Zv(n){return typeof n=="number"}function pP(n){return Zv(n)&&!isNaN(n)&&n>0}function mP(n,e){return Zv(n)&&!isNaN(n)&&n<=e&&n>=0}function Cre(n,e){return`Invalid prop \`max\` of value \`${n}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${eA}\`.`}function Nre(n,e){return`Invalid prop \`value\` of value \`${n}\` supplied to \`${e}\`. The \`value\` prop must be: 4218 - a positive number 4219 - less than the value passed to \`max\` (or ${eA} if no \`max\` prop is set) 4220 - \`null\` or \`undefined\` if the progress is indeterminate. 4221 4222Defaulting to \`null\`.`}var VO=OO,Rre=BO;const HO=T.forwardRef(({className:n,value:e,...t},r)=>l.jsx(VO,{ref:r,className:Ct("relative h-4 w-full overflow-hidden rounded-full bg-secondary",n),...t,children:l.jsx(Rre,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));HO.displayName=VO.displayName;const Pre=vy("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"}}),zd=T.forwardRef(({className:n,variant:e,...t},r)=>l.jsx("div",{ref:r,role:"alert",className:Ct(Pre({variant:e}),n),...t}));zd.displayName="Alert";const v0=T.forwardRef(({className:n,...e},t)=>l.jsx("h5",{ref:t,className:Ct("mb-1 font-medium leading-none tracking-tight",n),...e}));v0.displayName="AlertTitle";const Vd=T.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:Ct("text-sm [&_p]:leading-relaxed",n),...e}));Vd.displayName="AlertDescription";function Ire(){const[n,e]=T.useState(null),[t,r]=T.useState(""),[i,s]=T.useState({status:"idle",message:"",progress:0,totalArtists:0,processedArtists:0,details:{success:[],error:[]}}),{toast:o}=Mn(),a=f=>{var m;const p=(m=f.target.files)==null?void 0:m[0];if(p&&p.type==="text/csv"){e(p);const x=new FileReader;x.onload=v=>{var y;const _=(y=v.target)==null?void 0:y.result;r(_)},x.readAsText(p)}else p&&(o({title:"Invalid file type",description:"Please upload a CSV file",variant:"destructive"}),e(null))},c=f=>{const p=f.split(/\r?\n/).filter(y=>
4222y.trim()),m=p[0].toLowerCase(),v=m.includes("artist")||m.includes("name")?1:0,_=[];for(let y=v;y<p.length;y++){const g=p[y].trim();if(!g)continue;const b=g.split(",").map(S=>S.trim());if(b.length>=1){const S=b[0],M=b.length>1?b[1]:"";_.push({name:S,spotifyId:M})}}return _},u=async()=>{var p,m,x;if(!t){o({title:"No data to import",description:"Please upload a CSV file or enter artist data",variant:"destructive"});return}const f=c(t);if(f.length===0){o({title:"No artists found",description:"The CSV file doesn't contain valid artist data",variant:"destructive"});return}s({status:"processing",message:"Starting import process...",progress:0,totalArtists:f.length,processedArtists:0,details:{success:[],error:[]}});for(let v=0;v<f.length;v++){const _=f[v];s(y=>({...y,message:`Processing ${_.name} (${v+1}/${f.length})...`,processedArtists:v,progress:Math.round(v/f.length*100)}));try{let y=null;if(_.spotifyId){const R=await fetch(`/api/spotify/artist/${_.spotifyId}`);R.ok&&(y=await R.json())}else{const R=await fetch(`/api/spotify/search?q=${encodeURIComponent(_.name)}&type=artist&limit=1`);R.ok&&(y=await R.json())}let g=[],b=[],S=3;if(y){if(y.genres&&y.genres.length>0){const L=await fetch("/api/genres");if(L.ok){const N=await L.json();for(const I of y.genres){const D=N.find(O=>O.name.toLowerCase().includes(I.toLowerCase())||I.toLowerCase().includes(O.name.toLowerCase()));D&&!g.includes(D.id)&&g.push(D.id)}}}const R={"80s":1980,"90s":1990,"2000s":2e3,"2010s":2010,"2020s":2020},F=await fetch("/api/eras");if(F.ok){const L=await F.json();if(y.albums){const N=y.albums.map(I=>{const D=I.release_date;return D&&D.length>=4?parseInt(D.substring(0,4)):null}).filter(I=>I!==null);if(N.length>0)for(const I of L){const D=R[I.name.split(" ")[0]],O=D?D+9:null;D&&O&&N.some(V=>V>=D&&V<=O)&&!b.includes(I.id)&&b.push(I.id)}}}try{const L=await fetch("/api/openai/generate-eminem-connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({artistName:_.name})});if(L.ok){const N=await L.json();N.influenceLevelId&&(S=N.influenceLevelId),_.eminemConnection=N.content}}catch(L){console.error("Error generating Eminem connection:",L)}}const M={name:_.name,slug:_.name.toLowerCase().replace(/[^\w\s]/gi,"").replace(/\s+/g,"-"),imageUrl:((m=(p=y==null?void 0:y.images)==null?void 0:p[0])==null?void 0:m.url)||"",bio:"",influenceLevelId:S,eminemConnection:_.eminemConnection||"",websiteUrl:"",spotifyUrl:((x=y==null?void 0:y.external_urls)==null?void 0:x.spotify)||"",appleUrl:"",youtubeUrl:"",instagramUrl:"",twitterUrl:"",featured:!1,genres:g,eras:b},A=await fetch("/api/artists",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)});if(A.ok){const R=await A.json();s(F=>({...F,details:{...F.details,success:[...F.details.success,`${_.name} (ID: ${R.id})`]}}))}else throw new Error(`Failed to create artist: ${await A.text()}`)}catch(y){console.error(`Error importing ${_.name}:`,y),s(g=>({...g,details:{...g.details,error:[...g.details.error,`${_.name}: ${y instanceof Error?y.message:String(y)}`]}}))}s(y=>({...y,processedArtists:v+1,progress:Math.round((v+1)/f.length*100)}))}s(v=>({...v,status:v.details.error.length===0?"success":"error",message:`Import complete: ${v.details.success.length} succeeded, ${v.details.error.length} failed`,progress:100})),o({title:"Import complete",description:`Successfully imported ${i.details.success.length} artists with ${i.details.error.length} errors`})};return l.jsxs(qn,{className:"w-full bg-[#1E1E1E] border-[#3D3D3D] text-[#F5F5F5]",children:[l.jsxs(ts,{children:[l.jsxs(ns,{className:"flex items-center",children:[l.jsx(T8,{className:"mr-2 h-5 w-5"}),"Bulk Artist Import"]}),l.jsx(zD,{className:"text-[#A0A0A0]",children:"Import multiple artists at once from a CSV file. The system will automatically retrieve information from Spotify and generate Eminem connections."})]}),l.jsxs(tr,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(kn,{htmlFor:"csvFile",className:"text-[#F5F5F5]",children:"Upload CSV File"}),l.jsx(Sn,{id:"csvFile",type:"file",accept:".csv",onChange:a,className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5]"}),l.jsx("p",{className:"text-xs text-[#A0A0A0]",children:"CSV format: artist_name,spotify_id (optional). Include one artist per line."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(kn,{htmlFor:"csvText",className:"text-[#F5F5F5]",children:"Or Enter CSV Data Manually"}),l.jsx(es,{id:"csvText",value:t,onChange:f=>r(f.target.value),placeholder:"Artist Name,SpotifyID (optional)",className:"bg-[#121212] border-[#3D3D3D] text-[#F5F5F5] min-h-[150px]"})]}
4222),i.status!=="idle"&&l.jsxs("div",{className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{children:i.message}),l.jsxs("span",{children:[i.processedArtists," / ",i.totalArtists]})]}),l.jsx(HO,{value:i.progress,className:"h-2"})]}),i.status==="processing"&&l.jsxs(zd,{className:"bg-[#2C2C2C] border-[#4D4D4D]",children:[l.jsx(ru,{className:"h-4 w-4 animate-spin text-yellow-500"}),l.jsx(v0,{children:"Processing"}),l.jsx(Vd,{children:"Please wait while we import your artists. This may take some time."})]}),i.status==="success"&&l.jsxs(zd,{className:"bg-[#22331F] border-[#3A5735]",children:[l.jsx(h8,{className:"h-4 w-4 text-green-500"}),l.jsx(v0,{children:"Import Complete"}),l.jsxs(Vd,{children:["Successfully imported ",i.details.success.length," artists."]})]}),i.status==="error"&&i.details.error.length>0&&l.jsxs(zd,{className:"bg-[#331F1F] border-[#573535]",children:[l.jsx(XF,{className:"h-4 w-4 text-red-500"}),l.jsx(v0,{children:"Some imports failed"}),l.jsxs(Vd,{children:[i.details.error.length," artists failed to import."]})]}),(i.details.success.length>0||i.details.error.length>0)&&l.jsxs("div",{className:"mt-4 space-y-4",children:[i.details.success.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"text-sm font-medium text-green-500 mb-2",children:["Successful Imports (",i.details.success.length,")"]}),l.jsx("div",{className:"text-xs text-[#A0A0A0] max-h-[100px] overflow-y-auto space-y-1",children:i.details.success.map((f,p)=>l.jsx("div",{className:"text-green-500",children:f},`success-${p}`))})]}),i.details.error.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"text-sm font-medium text-red-500 mb-2",children:["Failed Imports (",i.details.error.length,")"]}),l.jsx("div",{className:"text-xs text-[#A0A0A0] max-h-[100px] overflow-y-auto space-y-1",children:i.details.error.map((f,p)=>l.jsx("div",{className:"text-red-500",children:f},`error-${p}`))})]})]})]})]}),l.jsx(VD,{children:l.jsx(it,{onClick:u,disabled:!t||i.status==="processing",className:"w-full bg-gradient-to-r from-[#3a0000] to-[#FB3939] hover:from-[#FB3939] hover:to-[#3a0000] text-white border-none",children:i.status==="processing"?l.jsxs(l.Fragment,{children:[l.jsx(ru,{className:"mr-2 h-4 w-4 animate-spin"}),"Importing..."]}):"Start Import"})})]})}function Fre(){return l.jsx(Tm,{children:l.jsx(Dre,{})})}function Dre(){const{user:n,isAuthenticated:e,isLoading:t}=vi(),{toast:r}=Mn(),[,i]=Bi(),[s,o]=T.useState("all"),[a,c]=T.useState(!1),[u,f]=T.useState(!1),[p,m]=T.useState(!1),[x,v]=T.useState(null),_=hs(),y=!0,g=ti({mutationFn:async({id:N,featured:I})=>{const D=await fetch(`/api/artists/${N}/toggle-featured`,{method:"POST",body:JSON.stringify({featured:I}),headers:{"Content-Type":"application/json"}});if(!D.ok){const O=await D.json();throw new Error(O.message||"Failed to update featured status")}return D.json()},onSuccess:N=>{_.invalidateQueries({queryKey:["/api/artists"]}),_.invalidateQueries({queryKey:["/api/admin/artists"]}),N.featured||o("all"),r({title:"Success",description:"Artist featured status updated successfully"})},onError:N=>{r({title:"Error",description:`Failed to update featured status: ${N instanceof Error?N.message:"Unknown error"}`,variant:"destructive"})}}),b=(N,I)=>{g.mutate({id:N,featured:I})},S=ti({mutationFn:async N=>{const I=await fetch(`/api/artists/${N}`,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!I.ok){const D=await I.json();throw new Error(D.message||"Failed to delete artist")}return I.json()},onSuccess:()=>{_.invalidateQueries({queryKey:["/api/artists"]}),_.invalidateQueries({queryKey:["/api/admin/artists"]}),r({title:"Success",description:"Artist deleted successfully"})},onError:N=>{console.error("Error deleting artist:",N),r({title:"Error",description:`Failed to delete artist: ${N instanceof Error?N.message:"Unknown error"}`,variant:"destructive"})}}),M=(N,I)=>{window.confirm(`Are you sure you want to delete ${I}? This action cannot be undone.`)&&S.mutate(N)},{data:A,isLoading:R}=Nt({queryKey:["/api/admin/artists"],enabled:e&&y});if(!t&&(!e||!y))return l.jsx("div",{className:"container mx-auto px-4 py-12",children:l.jsxs("div",{className:"flex flex-col items-center justify-center h-48",children:[l.jsx("h1",{className:"text-2xl font-bold text-[#F5F5F5]",children:"Access Denied"}),l.jsx("p",{className:"text-[#A0A0A0] mt-2",children:"You do not have permission to access this page."}),l.jsx(it,{onClick:()=>window.location.href=Ve.HOME,className:"mt-4 bg-[#3A86FF]",children:"Return to Home"})]})});const F=N=>{v(N),f(!1),c(!0),r({title:"Artist selected",description:`Selected ${N.name} from Spotify. You can now edit and save the artist.`})},L=()=>{c(!1),v(null),r({title:"Success",description:"Artist has been saved successfully."})};return l.jsxs("div",{className:"container mx-auto px-4 py-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsx("h1",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5]",children:"Manage Artists"}),l.jsxs("div",{className:"flex space-x-3",children:[l.jsx(it,{onClick:()=>{f(!u),c(!1),m(!1)},className:"bg-[#1DB954] hover:bg-opacity-90 text-black font-medium",children:u?"Cancel":"Search Spotify"}),l.jsx(it,{onClick:()=>{m(!p),c(!1),f(!1)},className:"bg-[#333333] hover:bg-opacity-90 text-white",children:p?"Cancel":"Bulk Import"}),l.jsx(it,{onClick:()=>{c(!a),f(!1),m(!1)},className:"bg-[#FB3939] hover:bg-opacity-90 text-white",children:a?"Cancel":"Add Manually"})]})]}),u?l.jsx(Sre,{onSelectArtist:F}):null,p?l.jsxs("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-6 mb-8",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5] mb-6",children:"Bulk Import Artists"}),l.jsx(Ire,{})]}):null,a?l.jsxs("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-6 mb-8",children:[l.jsx("h2",{className:"text-2xl font-heading text-[#F5F5F5] mb-6",children:x?`Add Artist from Spotify: ${x.name}`:"Add New Artist Manually"}),l.jsx(jO,{onSuccess:L,prefillData:x})]}
4222):null,l.jsxs(b1,{defaultValue:"all",className:"w-full",value:s,onValueChange:o,children:[l.jsxs(Am,{className:"mb-6 bg-[#1E1E1E] border-b border-[#2D2D2D]",children:[l.jsx(Fi,{value:"all",className:"data-[state=active]:border-b-2 data-[state=active]:border-[#FB3939]",children:"All Artists"}),l.jsx(Fi,{value:"featured",className:"data-[state=active]:border-b-2 data-[state=active]:border-[#FB3939]",children:"Featured Artists"})]}),l.jsx(Di,{value:"all",children:R?l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"Loading artists..."}):A&&A.length>0?l.jsx("div",{className:"grid gap-4",children:A.map(N=>{var I;return l.jsxs("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-4 flex justify-between items-center",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("img",{src:N.imageUrl||"/placeholder-artist.jpg",alt:N.name,className:"w-12 h-12 rounded-full object-cover mr-4"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-[#F5F5F5]",children:N.name}),l.jsx("p",{className:"text-sm text-[#A0A0A0]",children:(I=N.genres)==null?void 0:I.map(D=>D.name).join(", ")})]})]}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(it,{variant:"outline",className:"border-[#3A86FF] text-[#3A86FF]",onClick:()=>i(`/admin/artists/edit/${N.id}`),children:"Edit"}),N.featured?l.jsx(it,{variant:"outline",className:"border-[#FB3939] text-[#FB3939]",onClick:()=>b(N.id,!1),disabled:g.isPending,children:"Remove Featured"}):l.jsx(it,{variant:"outline",className:"border-[#3A86FF] text-[#3A86FF]",onClick:()=>b(N.id,!0),disabled:g.isPending,children:"Make Featured"}),l.jsx(it,{variant:"outline",className:"border-[#FB3939] text-[#FB3939]",onClick:()=>M(N.id,N.name),disabled:S.isPending,children:"Delete"})]})]},N.id)})}):l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"No artists found. Add your first artist using the button above."})}),l.jsx(Di,{value:"featured",children:R?l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"Loading featured artists..."}):A?l.jsx("div",{className:"grid gap-4",children:A.filter(N=>N.featured).map(N=>{var I;return l.jsxs("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-4 flex justify-between items-center",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("img",{src:N.imageUrl||"/placeholder-artist.jpg",alt:N.name,className:"w-12 h-12 rounded-full object-cover mr-4"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-[#F5F5F5]",children:N.name}),l.jsx("p",{className:"text-sm text-[#A0A0A0]",children:(I=N.genres)==null?void 0:I.map(D=>D.name).join(", ")})]})]}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(it,{variant:"outline",className:"border-[#3A86FF] text-[#3A86FF]",onClick:()=>i(`/admin/artists/edit/${N.id}`),children:"Edit"}),l.jsx(it,{variant:"outline",className:"border-[#FB3939] text-[#FB3939]",onClick:()=>b(N.id,!1),disabled:g.isPending,children:"Remove Featured"}),l.jsx(it,{variant:"outline",className:"border-[#FB3939] text-[#FB3939]",onClick:()=>M(N.id,N.name),disabled:S.isPending,children:"Delete"})]})]},N.id)})}):l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"No featured artists found."})})]})]})}function kre(){return l.jsx(Tm,{children:l.jsx(Lre,{})})}function Lre(){const{user:n,isAuthenticated:e,isLoading:t}=vi();Mn();const r=!0,{data:i,isLoading:s}=Nt({queryKey:["/api/reviews/all"],enabled:e&&r});return!t&&(!e||!r)?l.jsx("div",{className:"container mx-auto px-4 py-12",children:l.jsxs("div",{className:"flex flex-col items-center justify-center h-48",children:[l.jsx("h1",{className:"text-2xl font-bold text-[#F5F5F5]",children:"Access Denied"}),l.jsx("p",{className:"text-[#A0A0A0] mt-2",children:"You do not have permission to access this page."}),l.jsx(it,{onClick:()=>window.location.href=Ve.HOME,className:"mt-4 bg-[#3A86FF]",children:"Return to Home"})]})}):l.jsxs("div",{className:"container mx-auto px-4 py-8",children:[l.jsx("div",{className:"flex justify-between items-center mb-8",children:l.jsx("h1",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5]",children:"Manage Reviews"})}),s?l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"Loading reviews..."}):i&&i.length>0?l.jsx("div",{className:"space-y-6",children:i.map(o=>l.jsx("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-6",children:l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsxs("h3",{className:"text-lg font-medium text-[#F5F5F5] mr-2",children:["Review for ",o.artist.name]}),l.jsx("div",{className:"flex items-center",children:[1,2,3,4,5].map(a=>l.jsx("span",{className:`text-xl ${a<=o.rating?"text-yellow-400":"text-[#2D2D2D]"}`,children:"â
"},a))})]}),l.jsxs("p",{className:"text-sm text-[#A0A0A0] mb-1",children:["By ",o.user.firstName||o.user.email," on ",new Date(o.createdAt).toLocaleDateString()]}),l.jsx("p",{className:"text-[#F5F5F5] mt-4",children:o.content})]}),l.jsx("div",{children:l.jsx(it,{variant:"destructive",className:"bg-[#FB3939]",children:"Delete"})})]})},o.id))}):l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"No reviews found."})]})}function jre(){return l.jsx(Tm,{children:l.jsx(Ore,{})})}function Ore(){const{user:n,isAuthenticated:e,isLoading:t}=vi();Mn();const r=!0,{data:i,isLoading:s}=Nt({queryKey:["/api/comments/all"],enabled:e&&r});return!t&&(!e||!r)?l.jsx("div",{className:"container mx-auto px-4 py-12",children:l.jsxs("div",{className:"flex flex-col items-center justify-center h-48",children:[l.jsx("h1",{className:"text-2xl font-bold text-[#F5F5F5]",children:"Access Denied"}),l.jsx("p",{className:"text-[#A0A0A0] mt-2",children:"You do not have permission to access this page."}),l.jsx(it,{onClick:()=>window.location.href=Ve.HOME,className:"mt-4 bg-[#3A86FF]",children:"Return to Home"})]})}):l.jsxs("div",{className:"container mx-auto px-4 py-8",children:[l.jsx("div",{className:"flex justify-between items-center mb-8",children:l.jsx("h1",{className:"text-3xl md:text-4xl font-heading text-[#F5F5F5]",children:"Manage Comments"})}),s?l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"Loading comments..."}):i&&i.length>0?l.jsx("div",{className:"space-y-6",children:i.map(o=>l.jsx("div",{className:"bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg p-6",children:l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-lg font-medium text-[#F5F5F5] mb-2",children:["Comment on ",o.artist.name]}),l.jsxs("p",{className:"text-sm text-[#A0A0A0] mb-1",children:["By ",o.user.firstName||o.user.email," on ",new Date(o.createdAt).toLocaleDateString()]}),l.jsx("p",{className:"text-[#F5F5F5] mt-4",children:o.content})]}),l.jsx("div",{children:l.jsx(it,{variant:"destructive",className:"bg-[#FB3939]",children:"Delete"})})]})},o.id))}):l.jsx("div",{className:"text-center py-8 text-[#A0A0A0]",children:"No comments found."})]})}const bb=({children:n})=>l.jsx("div",{className:"container mx-auto px-4 py-8",children:n});function Ure(){const{user:n,isAuthenticated:e}=vi(),{toast:t}=Mn(),[r,i]=Bi(),s=ti({mutationFn:async()=>Lo("POST","/api/admin/make-admin"),onSuccess:()=>{t({title:"Success!",description:"Admin access granted. You now have full admin privileges."}),setTimeout(()=>{i("/admin")},1500)},onError:a=>{t({title:"Error",description:"Failed to grant admin access. Please try again.",variant:"destructive"})}}),o=()=>{s.mutate()};return e?n!=null&&n.isAdmin?l.jsx(bb,{children:l.jsx("div",{className:"max-w-3xl mx-auto py-12",children:l.jsxs("div",{className:"bg-[#1A1A1A] rounded-lg p-8 border border-[#333333] shadow-xl",children:[l.jsx("div",{className:"flex items-center justify-center text-green-500 mb-6",children:l.jsx(d3,{size:48})}),l.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-center text-white mb-4",children:"You Already Have Admin Access"}),l.jsx("p",{className:"text-[#A0A0A0] text-center mb-8",children:"You already have admin privileges on ShadyMusic."}),l.jsx("div",{className:"flex justify-center",children:l.jsx(it,{onClick:()=>i("/admin"),className:"bg-[#FB3939]",children:"Go to Admin Dashboard"})})]})})}):l.jsx(bb,{children:l.jsxs("div",{className:"max-w-4xl mx-auto py-12",children:[l.jsxs("a",{href:"/",className:"inline-flex items-center text-[#A0A0A0] hover:text-white mb-6",children:[l.jsx(c8,{className:"mr-2 h-4 w-4"}),"Back to Home"]}),l.jsxs("div",{className:"bg-[#1A1A1A] rounded-lg p-8 border border-[#333333] shadow-xl",children:[l.jsxs("div",{className:"mb-8",children:[l.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-white mb-4",children:"Set Up Admin Access"}),l.jsxs("p",{className:"text-[#A0A0A0]",children:["Welcome, ",(n==null?void 0:n.firstName)||(n==null?void 0:n.email),"! Set up your admin access to manage ShadyMusic content and features."]})]}),l.jsxs("div",{className:"space-y-6 mb-8",children:[l.jsx("h2",{className:"text-xl font-semibold text-white",children:"As an admin, you'll be able to:"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"bg-[#252525] p-4 rounded-lg flex items-start",children:[l.jsx("div",{className:"bg-[#FB3939] p-2 rounded-md mr-3",children:l.jsx(C8,{className:"h-5 w-5 text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-white",children:"Manage Artists"}),l.jsx("p",{className:"text-sm text-[#A0A0A0]",children:"Add, edit, and remove artists from the directory"})]})]}),l.jsxs("div",{className:"bg-[#252525] p-4 rounded-lg flex items-start",children:[l.jsx("div",{className:"bg-[#FB3939] p-2 rounded-md mr-3",children:l.jsx(g8,{className:"h-5 w-5 text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-white",children:"Manage Genres & Eras"}),l.jsx("p",{className:"text-sm text-[#A0A0A0]",children:"Customize music categories and time periods"})]})]}),l.jsxs("div",{className:"bg-[#252525] p-4 rounded-lg flex items-start",children:[l.jsx("div",{className:"bg-[#FB3939] p-2 rounded-md mr-3",children:l.jsx(p8,{className:"h-5 w-5 text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-white",children:"Customize Site Appearance"}),l.jsx("p",{className:"text-sm text-[#A0A0A0]",children:"Update images, descriptions, and site visuals"})]})]}),l.jsxs("div",{className:"bg-[#252525] p-4 rounded-lg flex items-start",children:[l.jsx("div",{className:"bg-[#FB3939] p-2 rounded-md mr-3",children:l.jsx(_8,{className:"h-5 w-5 text-white"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-white",children:"Manage Site Content"}),l.jsx("p",{className:"text-sm text-[#A0A0A0]",children:"Control user comments, reviews, and site text"})]})]})]})]}),l.jsx("div",{className:"flex justify-center",children:l.jsx(it,{onClick:o,className:"bg-[#FB3939] text-white px-6 py-6 text-lg rounded-md hover:bg-opacity-90 transition-colors duration-200",disabled:s.isPending,children:s.isPending?l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"animate-spin h-4 w-4 border-2 border-white border-t-transparent roun
4222ded-full mr-2"}),"Setting Up..."]}):l.jsxs("span",{className:"flex items-center",children:["Set Up Admin Access",l.jsx(u8,{className:"ml-2 h-5 w-5"})]})})})]})]})}):l.jsx(bb,{children:l.jsx("div",{className:"max-w-3xl mx-auto py-12",children:l.jsxs("div",{className:"bg-[#1A1A1A] rounded-lg p-8 border border-[#333333] shadow-xl",children:[l.jsx("div",{className:"flex items-center justify-center text-[#FB3939] mb-6",children:l.jsx(d3,{size:48})}),l.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-center text-white mb-4",children:"Admin Access Required"}),l.jsx("p",{className:"text-[#A0A0A0] text-center mb-8",children:"You need to log in to set up admin access for ShadyMusic."}),l.jsx("div",{className:"flex justify-center",children:l.jsx("a",{href:"/auth/login",className:"bg-[#FB3939] hover:bg-opacity-90 text-white px-6 py-3 rounded-md transition-colors duration-200 font-medium",children:"Log In to Continue"})})]})})})}function Bre(){const[,n]=Bi(),[e]=Bi(),[t,r]=T.useState(null),[i,s]=T.useState(!1),{toast:o}=Mn(),a=hs();T.useEffect(()=>{const x=e.match(/\/admin\/artists\/edit\/(\d+)$/);x&&x[1]&&r(parseInt(x[1]))},[e]);const{data:c,isLoading:u}=Nt({queryKey:[`/api/artists/${t}`],enabled:!!t}),f=ti({mutationFn:async()=>{if(!t)throw new Error("Artist ID is required");const x=await fetch(`/api/admin/refresh-artist-spotify/${t}`,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"});if(!x.ok){const v=await x.json();throw new Error(v.error||"Failed to refresh artist data")}return x.json()},onSuccess:()=>{a.invalidateQueries({queryKey:[`/api/artists/${t}`]}),a.invalidateQueries({queryKey:["/api/admin/artists"]}),a.invalidateQueries({queryKey:["/api/artists"]}),o({title:"Success",description:"Artist data refreshed from Spotify successfully"}),s(!1)},onError:x=>{o({title:"Error",description:`Failed to refresh from Spotify: ${x instanceof Error?x.message:"Unknown error"}`,variant:"destructive"}),s(!1)}}),p=()=>{s(!0),f.mutate()},m=()=>{n(Ve.ADMIN_ARTISTS)};return u?l.jsx("div",{className:"container mx-auto py-8",children:l.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Loading artist data..."})}):l.jsx(Tm,{children:l.jsxs("div",{className:"container mx-auto py-8",children:[l.jsx("div",{className:"mb-6",children:l.jsx(it,{variant:"outline",onClick:()=>n(Ve.ADMIN_ARTISTS),className:"text-[#3A86FF]",children:"< Back to Artists"})}),l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsx("h1",{className:"text-3xl font-bold text-white",children:"Edit Artist"}),c&&l.jsxs(it,{onClick:p,disabled:i,className:"bg-[#1DB954] hover:bg-opacity-90 text-black",children:[l.jsx(v8,{className:"mr-2 h-4 w-4"}),i?"Refreshing...":"Refresh from Spotify"]})]}),c?l.jsxs(l.Fragment,{children:[c.spotifyUrl&&l.jsxs("div",{className:"mb-6 p-4 bg-[#121212] border border-[#1DB954] rounded-lg flex items-center",children:[l.jsx(As,{className:"h-5 w-5 text-[#1DB954] mr-2"}),l.jsxs("span",{children:["This artist has a Spotify profile: ",l.jsx("a",{href:c.spotifyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[#1DB954] underline",children:"View on Spotify"})]})]}),l.jsx(jO,{onSuccess:m,artistId:t||void 0,prefillData:c})]}):l.jsx("div",{className:"p-4 bg-[#1E1E1E] border border-[#2D2D2D] rounded-lg",children:l.jsx("p",{children:"Artist not found. Please check the ID and try again."})})]})})}function zre(){const[n,e]=T.useState("loading"),[t,r]=T.useState(""),{toast:i}=Mn(),[s,o]=Bi();return T.useEffect(()=>{(async()=>{try{const c=new URLSearchParams(window.location.search),u=c.get("code"),f=c.get("state"),p=c.get("error");if(p){console.error("Spotify authentication error:",p),e("error"),r("Authentication was denied or failed."),i({title:"Connection Failed",description:"Failed to connect your Spotify account.",variant:"destructive"}),setTimeout(()=>{o("/spotify")},3e3);return}const m=localStorage.getItem("spotify_auth_state");if(!f||f!==m){console.error("State mismatch in Spotify callback"),e("error"),r("State verification failed. Please try again."),setTimeout(()=>{o("/spotify")},3e3);return}if(!u){console.error("No authorization code provided"),e("error"),r("No authorization code received from Spotify."),setTimeout(()=>{o("/spotify")},3e3);return}const x=await fetch("/api/spotify/auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:u})});if(!x.ok){const g=await x.json();console.error("Token exchange error:",g),e("error"),r("Failed to exchange authorization code for access token."),setTimeout(()=>{o("/spotify")},3e3);return}const v=await x.json();localStorage.setItem("spotifyAccessToken",v.access_token),localStorage.setItem("spotifyRefreshToken",v.refresh_token),localStorage.setItem("spotifyTokenExpiry",(Date.now()+v.expires_in*1e3).toString()),localStorage.removeItem("spotify_auth_state");const _=await fetch("/api/spotify/auth/profile",{headers:{Authorization:`Bearer ${v.access_token}`}});if(!_.ok){console.error("Failed to fetch user profile"),e("error"),r("Connected to Spotify but failed to fetch your profile."),setTimeout(()=>{o("/")},3e3);return}const y=await _.json();e("success"),i({title:"Connected to Spotify",description:`Successfully connected to Spotify as ${y.display_name||"User"}`}),setTimeout(()=>{o("/")},2e3)}catch(c){console.error("Error processing Spotify callback:",c),e("error"),r("An unexpected error occurred while connecting to Spotify."),setTimeout(()=>{o("/spotify")},3e3)}})()},[o,i]),l.jsxs("div",{className:"container mx-auto py-20 text-center",children:[n==="loading"&&l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold text-[#F5F5F5] mb-4",children:"Connecting to Spotify"}),l.jsx("p",{className:"text-[#A0A0A0] mb-8",children:"Please wait while we connect your account..."}),l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-[#1DB954] mx-auto"})]}),n==="success"&&l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold text-[#F5F5F5] mb-4",children:"Connection Successful"}),l.jsx("p",{className:"text-[#A0A0A0] mb-8",children:"Your Spotify account has been connected successfully!"}),l.jsx("div",{className:"text-[#1DB954] text-6xl mb-8",children:l.jsxs("svg",{className:"w-16 h-16 mx-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
4222currentColor",children:[l.jsx("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.jsx("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})]})}),l.jsx("p",{className:"text-[#A0A0A0]",children:"Redirecting you to the home page..."})]}),n==="error"&&l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold text-[#F5F5F5] mb-4",children:"Connection Failed"}),l.jsx("p",{className:"text-[#FB3939] mb-8",children:t||"An error occurred while connecting to Spotify."}),l.jsx("div",{className:"text-[#FB3939] text-6xl mb-8",children:l.jsxs("svg",{className:"w-16 h-16 mx-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:[l.jsx("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})]})}),l.jsx("p",{className:"text-[#A0A0A0]",children:"Redirecting you back..."})]})]})}const Vre=y1({email:Qn().email("Invalid email address"),password:Qn().min(6,"Password must be at least 6 characters")});async function Hre(n){const e=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)});if(!e.ok){const t=await e.json();throw new Error(t.message||"Login failed")}return e.json()}function Wre({onSuccess:n,redirectTo:e}){const[t,r]=T.useState(null),{toast:i}=Mn(),s=hs(),{register:o,handleSubmit:a,formState:{errors:c}}=x1({resolver:v1(Vre)}),u=ti({mutationFn:Hre,onSuccess:p=>{s.invalidateQueries({queryKey:["/api/auth/user"]}),s.invalidateQueries({queryKey:["/api/admin/check"]}),i({title:"Welcome back!",description:`Successfully logged in as ${p.user.email}`}),e?window.location.href=e:n&&n()},onError:p=>{r(p.message)}}),f=p=>{r(null),u.mutate(p)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Sign In"}),l.jsx("p",{className:"text-gray-400 mt-2",children:"Welcome back to ShadyMusic"})]}),l.jsxs("form",{onSubmit:a(f),className:"space-y-4",children:[t&&l.jsx(zd,{variant:"destructive",children:l.jsx(Vd,{children:t})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(kn,{htmlFor:"email",children:"Email"}),l.jsx(Sn,{id:"email",type:"email",placeholder:"[email protected]",...o("email"),className:"bg-gray-800 border-gray-600 text-white"}),c.email&&l.jsx("p",{className:"text-sm text-red-400",children:c.email.message})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(kn,{htmlFor:"password",children:"Password"}),l.jsx(Sn,{id:"password",type:"password",placeholder:"Enter your password",...o("password"),className:"bg-gray-800 border-gray-600 text-white"}),c.password&&l.jsx("p",{className:"text-sm text-red-400",children:c.password.message})]}),l.jsx(it,{type:"submit",className:"w-full bg-[#FB3939] hover:bg-[#e53333] text-white",disabled:u.isPending,children:u.isPending?l.jsxs(l.Fragment,{children:[l.jsx(ru,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing In..."]}):"Sign In"})]})]})}function Gre(){const[,n]=Bi(),{isAuthenticated:e,isLoading:t}=vi(),i=new URLSearchParams(window.location.search).get("returnTo")||localStorage.getItem("shadymusic_return_path")||"/";return T.useEffect(()=>{e&&!t&&(localStorage.removeItem("shadymusic_return_path"),n(i))},[e,t,i,n]),t?l.jsx("div",{className:"min-h-screen bg-[#121212] flex items-center justify-center",children:l.jsx("div",{className:"text-white",children:"Loading..."})}):e?null:l.jsx("div",{className:"min-h-screen bg-[#121212] flex items-center justify-center p-4",children:l.jsx("div",{className:"w-full max-w-md",children:l.jsx(qn,{className:"bg-gray-900 border-gray-700",children:l.jsxs(tr,{className:"p-6",children:[l.jsx(Wre,{redirectTo:i,onSuccess:()=>{localStorage.removeItem("shadymusic_return_path"),n(i)}}),l.jsx("div",{className:"mt-6 text-center",children:l.jsxs("p",{className:"text-gray-400",children:["Don't have an account?"," ",l.jsx(Pt,{href:`/auth/register${i!=="/"?`?returnTo=${encodeURIComponent(i)}`:""}`,children:l.jsx("span",{className:"text-[#FB3939] hover:underline cursor-pointer",children:"Sign up here"})})]})})]})})})})}const $re=y1({email:Qn().email("Invalid email address"),password:Qn().min(6,"Password must be at least 6 characters"),firstName:Qn().min(1,"First name is required"),lastName:Qn().min(1,"Last name is required")});async function Xre(n){const e=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)});if(!e.ok){const t=await e.json();throw new Error(t.message||"Registration failed")}return e.json()}function qre({onSuccess:n,redirectTo:e}){const[t,r]=T.useState(null),{toast:i}=Mn(),s=hs(),{register:o,handleSubmit:a,formState:{errors:c}}=x1({resolver:v1($re)}),u=ti({mutationFn:Xre,onSuccess:p=>{s.invalidateQueries({queryKey:["/api/auth/user"]}),s.invalidateQueries({queryKey:["/api/admin/check"]}),i({title:"Welcome to ShadyMusic!",description:`Account created successfully for ${p.user.email}`}),e?window.location.href=e:n&&n()},onError:p=>{r(p.message)}}),f=p=>{r(null),u.mutate(p)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Sign Up"}),l.jsx("p",{className:"text-gray-400 mt-2",children:"Join the ShadyMusic community"})]}),l.jsxs("form",{onSubmit:a(f),className:"space-y-4",children:[t&&l.jsx(zd,{variant:"destructive",children:l.jsx(Vd,{children:t})}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(kn,{htmlFor:"firstName",children:"First Name"}),l.jsx(Sn,{id:"firstName",type:"text",placeholder:"John",...o("firstName"),className:"bg-gray-800 border-gray-600 text-white"}),c.firstName&&l.jsx("p",{className:"text-sm text-red-400",children:c.firstName.message})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(kn,{htmlFor:"lastName",children:"Last Name"}),l.jsx(Sn,{id:"lastName",type:"text",placeholder:"Doe",...o("lastName"),className:"bg-gray-800 border-gray-600 text-white"}),c.lastName&&l.jsx("p",{className:"text-sm text-red-400",children:c.lastName.message})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(kn,{htmlFor:"email",children:"Email"}),l.jsx(Sn,{id:"email",type:"email",placeholder:"[email protected]",...o("email"),className:"bg-gray-800 border-gray-600 text-white"}),c.email&&l.jsx("p",{className:"text-sm text-red-400",children:c.email.message})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(kn,{htmlFor:"password",children:"Password"}),l.jsx(Sn,{id:"password",type:"password",placeholder:"Create a secure password",...o("password"),className:"bg-gray-800 border-gray-600 text-white"}),c.password&&l.jsx("p",{className:"text-sm text-red-400",children:c.password.message})]}),l.jsx(it,{type:"submit",className:"w-full bg-[#FB3939] hover:bg-[#e53333] text-white",disabled:u.isPending,children:u.isPending?l.jsxs(l.Fragment,{children:[l.jsx(ru,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating Account..."]}):"Sign Up"})]})]})}function Yre(){const[,n]=Bi(),{isAuthenticated:e,isLoading:t}=vi(),i=new URLSearchParams(window.location.search).get("returnTo")||localStorage.getItem("shadymusic_return_path")||"/";return T.useEffect(()=>{e&&!t&&(localStorage.removeItem("shadymusic_return_path"),n(i))},[e,t,i,n]),t?l.jsx("div",{className:"min-h-screen bg-[#121212] flex items-center justify-center",children:l.jsx("div",{className:"text-white",children:"Loading..."})}):e?null:l.jsx("div",{className:"min-h-screen bg-[#121212] flex items-center justify-center p-4",children:l.jsx("div",{className:"w-full max-w-md",children:l.jsx(qn,{
4222className:"bg-gray-900 border-gray-700",children:l.jsxs(tr,{className:"p-6",children:[l.jsx(qre,{redirectTo:i,onSuccess:()=>{localStorage.removeItem("shadymusic_return_path"),n(i)}}),l.jsx("div",{className:"mt-6 text-center",children:l.jsxs("p",{className:"text-gray-400",children:["Already have an account?"," ",l.jsx(Pt,{href:`/auth/login${i!=="/"?`?returnTo=${encodeURIComponent(i)}`:""}`,children:l.jsx("span",{className:"text-[#FB3939] hover:underline cursor-pointer",children:"Sign in here"})})]})})]})})})})}const Kre=T.lazy(()=>yE(()=>import("./customization-BNKoTmVY.js"),[])),gP=T.lazy(()=>yE(()=>import("./monetization-DfDXFM-z.js"),[])),xP=T.lazy(()=>yE(()=>import("./spotify-DmpESnNS.js"),[]));function Zre(){return l.jsxs(J4,{children:[l.jsx(on,{path:"/directory",component:HQ}),l.jsx(on,{path:Ve.ARTISTS,component:bee}),l.jsx(on,{path:`${Ve.ARTISTS}/:slug`,component:gte}),l.jsx(on,{path:Ve.GENRES,component:xte}),l.jsx(on,{path:`${Ve.GENRES}/:id`,component:vte}),l.jsx(on,{path:Ve.ERAS,component:yte}),l.jsx(on,{path:`${Ve.ERAS}/:id`,component:wte}),l.jsx(on,{path:Ve.SPHERE_DEMO,component:Nte}),l.jsx(on,{path:Ve.ABOUT,component:Rte}),l.jsx(on,{path:Ve.CONTACT,component:Cne}),l.jsx(on,{path:Ve.USER_PROFILE,component:qne}),l.jsx(on,{path:Ve.USER_FAVORITES,component:Kne}),l.jsx(on,{path:Ve.ADMIN,component:nre}),l.jsx(on,{path:Ve.ADMIN_ARTISTS,component:Fre}),l.jsx(on,{path:Ve.ADMIN_REVIEWS,component:kre}),l.jsx(on,{path:Ve.ADMIN_COMMENTS,component:jre}),l.jsx(on,{path:Ve.ADMIN_CUSTOMIZATION,children:l.jsx(T.Suspense,{fallback:l.jsx("div",{className:"p-8 text-center",children:"Loading site customization..."}),children:l.jsx(Kre,{})})}),l.jsx(on,{path:Ve.ADMIN_SETUP,component:Ure}),l.jsx(on,{path:"/admin/artists/edit/:id",component:Bre}),l.jsx(on,{path:"/spotify-callback",component:zre}),l.jsx(on,{path:"/connect-spotify",component:xP}),l.jsx(on,{path:"/auth/login",component:Gre}),l.jsx(on,{path:"/auth/register",component:Yre}),l.jsx(on,{path:"/api/login",children:l.jsx(k9,{to:"/auth/login"})}),l.jsx(on,{path:Ve.MONETIZATION,children:l.jsx(T.Suspense,{fallback:l.jsx("div",{className:"p-8 text-center",children:"Loading shop..."}),children:l.jsx(gP,{})})}),l.jsx(on,{path:"/shop",children:l.jsx(T.Suspense,{fallback:l.jsx("div",{className:"p-8 text-center",children:"Loading shop..."}),children:l.jsx(gP,{})})}),l.jsx(on,{path:Ve.SPOTIFY,children:l.jsx(T.Suspense,{fallback:l.jsx("div",{className:"p-8 text-center",children:"Loading Spotify integration..."}),children:l.jsx(xP,{})})}),l.jsx(on,{component:VH})]})}function Qre(){return l.jsx(dF,{client:mF,children:l.jsx(UH,{children:l.jsx(KH,{children:l.jsx(QH,{children:l.jsxs(JH,{children:[l.jsxs(J4,{children:[l.jsx(on,{path:"/",component:WQ}),l.jsx(on,{path:"/thanks",component:SR}),l.jsx(on,{path:"/thanks/",component:SR}),l.jsx(on,{path:"/already-subscribed",component:ER}),l.jsx(on,{path:"/already-subscribed/",component:ER}),l.jsx(on,{children:l.jsxs("div",{className:"flex flex-col min-h-screen",children:[l.jsx($H,{}),l.jsx("main",{className:"flex-grow pb-24",children:l.jsx(Zre,{})}),l.jsx(XH,{}),l.jsx(t7,{})]})})]}),l.jsx(hV,{})]})})})})})}const Jre=T.createContext(void 0);function eie({children:n}){const[e,t]=T.useState("dark"),[r,i]=T.useState(null),{data:s}=Nt({queryKey:["/api/admin/site-settings/colorPalette"]});T.useEffect(()=>{const a=window.document.documentElement;a.classList.remove("light"),a.classList.add("dark")},[e]),T.useEffect(()=>{if(s!=null&&s.value){const a=s.value;i(a),document.documentElement.style.setProperty("--primary",a.primary),document.documentElement.style.setProperty("--secondary",a.secondary),document.documentElement.style.setProperty("--accent",a.accent),document.documentElement.style.setProperty("--background-color",a.background),document.documentElement.style.setProperty("--text",a.text),document.querySelectorAll(".bg-\\[\\#FB3939\\]").forEach(c=>{c.style.backgroundColor=a.primary}),document.querySelectorAll(".text-\\[\\#FB3939\\]").forEach(c=>{c.style.color=a.primary}),document.querySelectorAll(".border-\\[\\#FB3939\\]").forEach(c=>{c.style.borderColor=a.primary}),document.querySelectorAll('[data-state="active"]').forEach(c=>{(c.classList.contains("bg-[#FB3939]")||c.classList.contains("data-[state=active]:bg-[#FB3939]"))&&(c.style.backgroundColor=a.primary)})}},[s]);const o={theme:e,setTheme:t,colorPalette:r};return l.jsx(Jre.Provider,{value:o,children:n})}const WO=document.createElement("style");WO.textContent=` 4223 :root { 4224 --background: 240 10% 3.9%; 4225 --foreground: 0 0% 98%; 4226 --primary: #FB3939; 4227 --secondary: #8B0000; 4228 --accent: #CCCCCC; 4229 --background-color: #121212; 4230 --text: #F5F5F5; 4231 } 4232 4233 body { 4234 font-family: 'Poppins', sans-serif; 4235 background-color: var(--background-color, #121212); 4236 color: var(--text, #F5F5F5); 4237 } 4238 4239 .font-heading { 4240 font-family: 'Bebas Neue', sans-serif; 4241 } 4242 4243 .font-special { 4244 font-family: 'Permanent Marker', cursive; 4245 } 4246 4247 .artist-card:hover { 4248 transform: translateY(-4px); 4249 box-shadow: 0 10px 25px -5px rgba(251, 57, 57, 0.1), 0 10px 10px -5px rgba(251, 57, 57, 0.04); 4250 } 4251 4252 .genre-tag { 4253 transition: all 0.3s ease; 4254 } 4255 4256 .genre-tag:hover { 4257 transform: scale(1.05); 4258 } 4259 4260 .nav-item { 4261 position: relative; 4262 } 4263 4264 .nav-item::after { 4265 content: ''; 4266 position: absolute; 4267 bottom: -4px; 4268 left: 0; 4269 width: 0; 4270 height: 2px; 4271 background-color: #FB3939; 4272 transition: width 0.3s ease; 4273 } 4274 4275 .nav-item:hover::after, 4276 .nav-item.active::after { 4277 width: 100%; 4278 } 4279 4280 /* Custom scrollbar */ 4281 ::-webkit-scrollbar {
4282 width: 8px; 4283 height: 8px; 4284 } 4285 4286 ::-webkit-scrollbar-track { 4287 background: #1E1E1E; 4288 } 4289 4290 ::-webkit-scrollbar-thumb { 4291 background: #3D3D3D; 4292 border-radius: 4px; 4293 } 4294 4295 ::-webkit-scrollbar-thumb:hover { 4296 background: #FB3939; 4297 } 4298 4299 .rating-stars .star { 4300 cursor: pointer; 4301 transition: all 0.2s ease; 4302 } 4303 4304 .rating-stars .star:hover { 4305 transform: scale(1.2); 4306 } 4307`;document.head.appendChild(WO);vE(document.getElementById("root")).render(l.jsx(dF,{client:mF,children:l.jsx(eie,{children:l.jsx(Qre,{})})}));export{Tm as A,it as B,qn as C,UM as D,p1 as E,wl as F,Nt as G,p8 as H,Sn as I,zd as J,Vd as K,kn as L,VD as M,FS as N,v0 as O,Dt as P,vi as Q,XF as R,OM as S,b1 as T,T8 as U,CE as a,Uo as b,Xt as c,At as d,Tn as e,DM as f,vD as g,w5 as h,MR as i,l as j,Ct as k,Mn as l,ti as m,ts as n,ns as o,zD as p,tr as q,T as r,ru as s,f8 as t,Dl as u,mF as v,Am as w,Fi as x,Di as y,f1 as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.