vendor: 4,895 bytes, lines 1-9
1(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function j_(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d0={exports:{}},Fc={},f0={exports:{}},nt={};/** 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 Do=Symbol.for("react.element"),B_=Symbol.for("react.portal"),G_=Symbol.for("react.fragment"),H_=Symbol.for("react.strict_mode"),V_=Symbol.for("react.profiler"),W_=Symbol.for("react.provider"),X_=Symbol.for("react.context"),$_=Symbol.for("react.forward_ref"),Y_=Symbol.for("react.suspense"),K_=Symbol.for("react.memo"),q_=Symbol.for("react.lazy"),Op=Symbol.iterator;function Z_(t){return t===null||typeof t!="object"?null:(t=Op&&t[Op]||t["@@iterator"],typeof t=="function"?t:null)}var h0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p0=Object.assign,m0={};function xa(t,e,n){this.props=t,this.context=e,this.refs=m0,this.updater=n||h0}xa.prototype.isReactComponent={};xa.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};xa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function g0(){}g0.prototype=xa.prototype;function uh(t,e,n){this.props=t,this.context=e,this.refs=m0,this.updater=n||h0}var dh=uh.prototype=new g0;dh.constructor=uh;p0(dh,xa.prototype);dh.isPureReactComponent=!0;var zp=Array.isArray,v0=Object.prototype.hasOwnProperty,fh={current:null},x0={key:!0,ref:!0,__self:!0,__source:!0};function _0(t,e,n){var i,r={},s=null,a=null;if(e!=null)for(i in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(s=""+e.key),e)v0.call(e,i)&&!x0.hasOwnProperty(i)&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];r.children=l}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return{$$typeof:Do,type:t,key:s,ref:a,props:r,_owner:fh.current}}function J_(t,e){return{$$typeof:Do,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function hh(t){return typeof t=="object"&&t!==null&&t.$$typeof===Do}function Q_(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var jp=/\/+/g;function au(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Q_(""+t.key):e.toString(36)}function Il(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Do:case B_:a=!0}}if(a)return a=t,r=r(a),t=i===""?"."+au(a,0):i,zp(r)?(n="",t!=null&&(n=t.replace(jp,"$&/")+"/"),Il(r,e,n,"",function(u){return u})):r!=null&&(hh(r)&&(r=J_(r,n+(!r.key||a&&a.key===r.key?"":(""+r.key).replace(jp,"$&/")+"/")+t)),e.push(r)),1;if(a=0,i=i===""?".":i+":",zp(t))for(var o=0;o<t.length;o++){s=t[o];var l=i+au(s,o);a+=Il(s,e,n,l,r)}else if(l=Z_(t),typeof l=="function")for(t=l.call(t),o=0;!(s=t.next()).done;)s=s.value,l=i+au(s,o++),a+=Il(s,e,n,l,r);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function Vo(t,e,n){if(t==null)return t;var i=[],r=0;return Il(t,i,"","",function(s){return e.call(n,s,r++)}),i}function ey(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Sn={current:null},Ul={transition:null},ty={ReactCurrentDispatcher:Sn,ReactCurrentBatchConfig:Ul,ReactCurrentOwner:fh};function y0(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 5,315 bytes, lines 9-25
9nt.Children={map:Vo,forEach:function(t,e,n){Vo(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Vo(t,function(){e++}),e},toArray:function(t){return Vo(t,function(e){return e})||[]},only:function(t){if(!hh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};nt.Component=xa;nt.Fragment=G_;nt.Profiler=V_;nt.PureComponent=uh;nt.StrictMode=H_;nt.Suspense=Y_;nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ty;nt.act=y0;nt.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var i=p0({},t.props),r=t.key,s=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,a=fh.current),e.key!==void 0&&(r=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in e)v0.call(e,l)&&!x0.hasOwnProperty(l)&&(i[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];i.children=o}return{$$typeof:Do,type:t.type,key:r,ref:s,props:i,_owner:a}};nt.createContext=function(t){return t={$$typeof:X_,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:W_,_context:t},t.Consumer=t};nt.createElement=_0;nt.createFactory=function(t){var e=_0.bind(null,t);return e.type=t,e};nt.createRef=function(){return{current:null}};nt.forwardRef=function(t){return{$$typeof:$_,render:t}};nt.isValidElement=hh;nt.lazy=function(t){return{$$typeof:q_,_payload:{_status:-1,_result:t},_init:ey}};nt.memo=function(t,e){return{$$typeof:K_,type:t,compare:e===void 0?null:e}};nt.startTransition=function(t){var e=Ul.transition;Ul.transition={};try{t()}finally{Ul.transition=e}};nt.unstable_act=y0;nt.useCallback=function(t,e){return Sn.current.useCallback(t,e)};nt.useContext=function(t){return Sn.current.useContext(t)};nt.useDebugValue=function(){};nt.useDeferredValue=function(t){return Sn.current.useDeferredValue(t)};nt.useEffect=function(t,e){return Sn.current.useEffect(t,e)};nt.useId=function(){return Sn.current.useId()};nt.useImperativeHandle=function(t,e,n){return Sn.current.useImperativeHandle(t,e,n)};nt.useInsertionEffect=function(t,e){return Sn.current.useInsertionEffect(t,e)};nt.useLayoutEffect=function(t,e){return Sn.current.useLayoutEffect(t,e)};nt.useMemo=function(t,e){return Sn.current.useMemo(t,e)};nt.useReducer=function(t,e,n){return Sn.current.useReducer(t,e,n)};nt.useRef=function(t){return Sn.current.useRef(t)};nt.useState=function(t){return Sn.current.useState(t)};nt.useSyncExternalStore=function(t,e,n){return Sn.current.useSyncExternalStore(t,e,n)};nt.useTransition=function(){return Sn.current.useTransition()};nt.version="18.3.1";f0.exports=nt;var q=f0.exports;const ny=j_(q);/** 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 iy=q,ry=Symbol.for("react.element"),sy=Symbol.for("react.fragment"),ay=Object.prototype.hasOwnProperty,oy=iy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ly={key:!0,ref:!0,__self:!0,__source:!0};function S0(t,e,n){var i,r={},s=null,a=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(i in e)ay.call(e,i)&&!ly.hasOwnProperty(i)&&(r[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:ry,type:t,key:s,ref:a,props:r,_owner:oy.current}}Fc.Fragment=sy;Fc.jsx=S0;Fc.jsxs=S0;d0.exports=Fc;var c=d0.exports,xd={},M0={exports:{}},Vn={},E0={exports:{}},b0={};/** 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(t){function e(I,V){var Q=I.length;I.push(V);e:for(;0<Q;){var re=Q-1>>>1,ae=I[re];if(0<r(ae,V))I[re]=V,I[Q]=ae,Q=re;else break e}}function n(I){return I.length===0?null:I[0]}function i(I){if(I.length===0)return null;var V=I[0],Q=I.pop();if(Q!==V){I[0]=Q;e:for(var re=0,ae=I.length,Fe=ae>>>1;re<Fe;){var je=2*(re+1)-1,Oe=I[je],ee=je+1,ue=I[ee];if(0>r(Oe,Q))ee<ae&&0>r(ue,Oe)?(I[re]=ue,I[ee]=Q,re=ee):(I[re]=Oe,I[je]=Q,re=je);else if(ee<ae&&0>r(ue,Q))I[re]=ue,I[ee]=Q,re=ee;else break e}}return V}function r(I,V){var Q=I.sortIndex-V.sortIndex;return Q!==0?Q:I.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],u=[],f=1,p=null,h=3,m=!1,x=!1,y=!1,g=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(I){for(var V=n(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=I)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=n(u)}}function M(I){if(y=!1,b(I),!x)if(n(l)!==null)x=!0,B(E);else{var V=n(u);
vendor: 9,346 bytes, lines 25-34
25V!==null&&z(M,V.startTime-I)}}function E(I,V){x=!1,y&&(y=!1,d(_),_=-1),m=!0;var Q=h;try{for(b(V),p=n(l);p!==null&&(!(p.expirationTime>V)||I&&!L());){var re=p.callback;if(typeof re=="function"){p.callback=null,h=p.priorityLevel;var ae=re(p.expirationTime<=V);V=t.unstable_now(),typeof ae=="function"?p.callback=ae:p===n(l)&&i(l),b(V)}else i(l);p=n(l)}if(p!==null)var Fe=!0;else{var je=n(u);je!==null&&z(M,je.startTime-V),Fe=!1}return Fe}finally{p=null,h=Q,m=!1}}var w=!1,A=null,_=-1,T=5,N=-1;function L(){return!(t.unstable_now()-N<T)}function R(){if(A!==null){var I=t.unstable_now();N=I;var V=!0;try{V=A(!0,I)}finally{V?D():(w=!1,A=null)}}else w=!1}var D;if(typeof v=="function")D=function(){v(R)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,k=F.port2;F.port1.onmessage=R,D=function(){k.postMessage(null)}}else D=function(){g(R,0)};function B(I){A=I,w||(w=!0,D())}function z(I,V){_=g(function(){I(t.unstable_now())},V)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_continueExecution=function(){x||m||(x=!0,B(E))},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(I){switch(h){case 1:case 2:case 3:var V=3;break;default:V=h}var Q=h;h=V;try{return I()}finally{h=Q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(I,V){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var Q=h;h=I;try{return V()}finally{h=Q}},t.unstable_scheduleCallback=function(I,V,Q){var re=t.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?re+Q:re):Q=re,I){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=Q+ae,I={id:f++,callback:V,priorityLevel:I,startTime:Q,expirationTime:ae,sortIndex:-1},Q>re?(I.sortIndex=Q,e(u,I),n(l)===null&&I===n(u)&&(y?(d(_),_=-1):y=!0,z(M,Q-re))):(I.sortIndex=ae,e(l,I),x||m||(x=!0,B(E))),I},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(I){var V=h;return function(){var Q=h;h=V;try{return I.apply(this,arguments)}finally{h=Q}}}})(b0);E0.exports=b0;var cy=E0.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 uy=q,Hn=cy;function le(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var w0=new Set,lo={};function hs(t,e){oa(t,e),oa(t+"Capture",e)}function oa(t,e){for(lo[t]=e,t=0;t<e.length;t++)w0.add(e[t])}var Ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_d=Object.prototype.hasOwnProperty,dy=/^[: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]*$/,Bp={},Gp={};function fy(t){return _d.call(Gp,t)?!0:_d.call(Bp,t)?!1:dy.test(t)?Gp[t]=!0:(Bp[t]=!0,!1)}function hy(t,e,n,i){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function py(t,e,n,i){if(e===null||typeof e>"u"||hy(t,e,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Mn(t,e,n,i,r,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var an={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){an[t]=new Mn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];an[e]=new Mn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){an[t]=new Mn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){an[t]=new Mn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){an[t]=new Mn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){an[t]=new Mn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){an[t]=new Mn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){an[t]=new Mn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){an[t]=new Mn(t,5,!1,t.toLowerCase(),null,!1,!1)});var ph=/[\-:]([a-z])/g;function mh(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(ph,mh);an[e]=new Mn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(ph,mh);an[e]=new Mn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(ph,mh);an[e]=new Mn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){an[t]=new Mn(t,1,!1,t.toLowerCase(),null,!1,!1)});an.xlinkHref=new Mn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){an[t]=new Mn(t,1,!1,t.toLowerCase(),null,!0,!0)});function gh(t,e,n,i){var r=an.hasOwnProperty(e)?an[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(py(e,n,r,i)&&(n=null),i||r===null?fy(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):r.mustUseProperty?t[r.propertyName]=n===null?r.type===3?!1:"":n:(e=r.attributeName,i=r.attributeNamespace,n===null?t.removeAttribute(e):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,i?t.setAttributeNS(i,e,n):t.setAttribute(e,n))))}var tr=uy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wo=Symbol.for("react.element"),Us=Symbol.for("react.portal"),Fs=Symbol.for("react.fragment"),vh=Symbol.for("react.strict_mode"),yd=Symbol.for("react.profiler"),T0=Symbol.for("react.provider"),C0=Symbol.for("react.context"),xh=Symbol.for("react.forward_ref"),Sd=Symbol.for("react.suspense"),Md=Symbol.for("react.suspense_list"),_h=Symbol.for("react.memo"),hr=Symbol.for("react.lazy"),A0=Symbol.for("react.offscreen"),Hp=Symbol.iterator;function wa(t){return t===null||typeof t!="object"?null:(t=Hp&&t[Hp]||t["@@iterator"],typeof t=="function"?t:null)}var Lt=Object.assign,ou;function ja(t){if(ou===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);ou=e&&e[1]||""}return` 34`+ou+t}var lu=!1;function cu(t,e){if(!t||lu)return"";lu=!0;var n=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 i=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){i=u}t.call(e.prototype)}else{try{throw Error()}catch(u){i=u}t()}}
vendor: 16,768 bytes, lines 34-37
34catch(u){if(u&&i&&typeof u.stack=="string"){for(var r=u.stack.split(` 35`),s=i.stack.split(` 36`),a=r.length-1,o=s.length-1;1<=a&&0<=o&&r[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(r[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||r[a]!==s[o]){var l=` 37`+r[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ja(t):""}function my(t){switch(t.tag){case 5:return ja(t.type);case 16:return ja("Lazy");case 13:return ja("Suspense");case 19:return ja("SuspenseList");case 0:case 2:case 15:return t=cu(t.type,!1),t;case 11:return t=cu(t.type.render,!1),t;case 1:return t=cu(t.type,!0),t;default:return""}}function Ed(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Fs:return"Fragment";case Us:return"Portal";case yd:return"Profiler";case vh:return"StrictMode";case Sd:return"Suspense";case Md:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case C0:return(t.displayName||"Context")+".Consumer";case T0:return(t._context.displayName||"Context")+".Provider";case xh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case _h:return e=t.displayName||null,e!==null?e:Ed(t.type)||"Memo";case hr:e=t._payload,t=t._init;try{return Ed(t(e))}catch{}}return null}function gy(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ed(e);case 8:return e===vh?"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 kr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function R0(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function vy(t){var e=R0(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){i=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(a){i=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Xo(t){t._valueTracker||(t._valueTracker=vy(t))}function P0(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=R0(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function nc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function bd(t,e){var n=e.checked;return Lt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Vp(t,e){var n=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;n=kr(e.value!=null?e.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function k0(t,e){e=e.checked,e!=null&&gh(t,"checked",e,!1)}function wd(t,e){k0(t,e);var n=kr(e.value),i=e.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Td(t,e.type,n):e.hasOwnProperty("defaultValue")&&Td(t,e.type,kr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Wp(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Td(t,e,n){(e!=="number"||nc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Ba=Array.isArray;function Zs(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+kr(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function Cd(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(le(91));return Lt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Xp(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(le(92));if(Ba(n)){if(1<n.length)throw Error(le(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:kr(n)}}function N0(t,e){var n=kr(e.value),i=kr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),i!=null&&(t.defaultValue=""+i)}function $p(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function D0(t){switch(t){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 Ad(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?D0(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var $o,L0=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,i,r){MSApp.execUnsafeLocalFunction(function(){return t(e,n,i,r)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for($o=$o||document.createElement("div"),$o.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=$o.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function co(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var qa={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},xy=["Webkit","ms","Moz","O"];Object.keys(qa).forEach(function(t){xy.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),qa[e]=qa[t]})});function I0(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||qa.hasOwnProperty(t)&&qa[t]?(""+e).trim():e+"px"}function U0(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=I0(n,e[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,r):t[n]=r}}var _y=Lt({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 Rd(t,e){if(e){if(_y[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(le(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(le(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(le(61))}if(e.style!=null&&typeof e.style!="object")throw Error(le(62))}}function Pd(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kd=null;function yh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Nd=null,Js=null,Qs=null;function Yp(t){if(t=Uo(t)){if(typeof Nd!="function")throw Error(le(280));var e=t.stateNode;e&&(e=Gc(e),Nd(t.stateNode,t.type,e))}}function F0(t){Js?Qs?Qs.push(t):Qs=[t]:Js=t}function O0(){if(Js){var t=Js,e=Qs;if(Qs=Js=null,Yp(t),e)for(t=0;t<e.length;t++)Yp(e[t])}}function z0(t,e){return t(e)}function j0(){}var uu=!1;function B0(t,e,n){if(uu)return t(e,n);uu=!0;try{return z0(t,e,n)}finally{uu=!1,(Js!==null||Qs!==null)&&(j0(),O0())}}function uo(t,e){var n=t.stateNode;if(n===null)return null;var i=Gc(n);if(i===null)return null;n=i[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":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(le(231,e,typeof n));return n}var Dd=!1;if(Ki)try{var Ta={};Object.defineProperty(Ta,"passive",{get:function(){Dd=!0}}),window.addEventListener("test",Ta,Ta),window.removeEventListener("test",Ta,Ta)}catch{Dd=!1}function yy(t,e,n,i,r,s,a,o,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(f){this.onError(f)}}var Za=!1,ic=null,rc=!1,Ld=null,Sy={onError:function(t){Za=!0,ic=t}};function My(t,e,n,i,r,s,a,o,l){Za=!1,ic=null,yy.apply(Sy,arguments)}function Ey(t,e,n,i,r,s,a,o,l){if(My.apply(this,arguments),Za){if(Za){var u=ic;Za=!1,ic=null}else throw Error(le(198));rc||(rc=!0,Ld=u)}}function ps(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function G0(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Kp(t){if(ps(t)!==t)throw Error(le(188))}function by(t){var e=t.alternate;if(!e){if(e=ps(t),e===null)throw Error(le(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Kp(r),t;if(s===i)return Kp(r),e;s=s.sibling}throw Error(le(188))}if(n.return!==i.return)n=r,i=s;else{for(var a=!1,o=r.child;o;){if(o===n){a=!0,n=r,i=s;break}if(o===i){a=!0,i=r,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,i=r;break}if(o===i){a=!0,i=s,n=r;break}o=o.sibling}if(!a)throw Error(le(189))}}if(n.alternate!==i)throw Error(le(190))}if(n.tag!==3)throw Error(le(188));return n.stateNode.current===n?t:e}function H0(t){return t=by(t),t!==null?V0(t):null}function V0(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=V0(t);if(e!==null)return e;t=t.sibling}return null}var W0=Hn.unstable_scheduleCallback,qp=Hn.unstable_cancelCallback,wy=Hn.unstable_shouldYield,Ty=Hn.unstable_requestPaint,Bt=Hn.unstable_now,Cy=Hn.unstable_getCurrentPriorityLevel,Sh=Hn.unstable_ImmediatePriority,X0=Hn.unstable_UserBlockingPriority,sc=Hn.unstable_NormalPriority,Ay=Hn.unstable_LowPriority,$0=Hn.unstable_IdlePriority,Oc=null,Ai=null;function Ry(t){if(Ai&&typeof Ai.onCommitFiberRoot=="function")try{Ai.onCommitFiberRoot(Oc,t,void 0,(t.current.flags&128)===128)}catch{}}var pi=Math.clz32?Math.clz32:Ny,Py=Math.log,ky=Math.LN2;function Ny(t){return t>>>=0,t===0?32:31-(Py(t)/ky|0)|0}var Yo=64,Ko=4194304;function Ga(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ac(t,e){var n=t.pendingLanes;if(n===0)return 0;var i=0,r=t.suspendedLanes,s=t.pingedLanes,a=n&268435455;if(a!==0){var o=a&~r;o!==0?i=Ga(o):(s&=a,s!==0&&(i=Ga(s)))}else a=n&~r,a!==0?i=Ga(a):s!==0&&(i=Ga(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=i;0<e;)n=31-pi(e),r=1<<n,i|=t[n],e&=~r;return i}function Dy(t,e){switch(t){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 Ly(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-pi(s),o=1<<a,l=r[a];l===-1?(!(o&n)||o&i)&&(r[a]=Dy(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}}function Id(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Y0(){var t=Yo;return Yo<<=1,!(Yo&4194240)&&(Yo=64),t}function du(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Lo(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-pi(e),t[e]=n}function Iy(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-pi(n),s=1<<r;e[r]=0,i[r]=-1,t[r]=-1,n&=~s}}function Mh(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-pi(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}var ht=0;function K0(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var q0,Eh,Z0,J0,Q0,Ud=!1,qo=[],Mr=null,Er=null,br=null,fo=new Map,ho=new Map,gr=[],Uy="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 Zp(t,e){switch(t){case"focusin":case"focusout":Mr=null;break;case"dragenter":case"dragleave":Er=null;break;case"mouseover":case"mouseout":br=null;break;case"pointerover":case"pointerout":fo.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ho.delete(e.pointerId)}}function Ca(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=Uo(e),e!==null&&Eh(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function Fy(t,e,n,i,r){switch(e){case"focusin":return Mr=Ca(Mr,t,e,n,i,r),!0;case"dragenter":return Er=Ca(Er,t,e,n,i,r),!0;case"mouseover":return br=Ca(br,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return fo.set(s,Ca(fo.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,ho.set(s,Ca(ho.get(s)||null,t,e,n,i,r)),!0}return!1}function ev(t){var e=qr(t.target);if(e!==null){var n=ps(e);if(n!==null){if(e=n.tag,e===13){if(e=G0(n),e!==null){t.blockedOn=e,Q0(t.priority,function(){Z0(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Fl(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Fd(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);kd=i,n.target.dispatchEvent(i),kd=null}else return e=Uo(n),e!==null&&Eh(e),t.blockedOn=n,!1;e.shift()}return!0}function Jp(t,e,n){Fl(t)&&n.delete(e)}function Oy(){Ud=!1,Mr!==null&&Fl(Mr)&&(Mr=null),Er!==null&&Fl(Er)&&(Er=null),br!==null&&Fl(br)&&(br=null),fo.forEach(Jp),ho.forEac
vendor: 13,603 bytes, line 37
37h(Jp)}function Aa(t,e){t.blockedOn===e&&(t.blockedOn=null,Ud||(Ud=!0,Hn.unstable_scheduleCallback(Hn.unstable_NormalPriority,Oy)))}function po(t){function e(r){return Aa(r,t)}if(0<qo.length){Aa(qo[0],t);for(var n=1;n<qo.length;n++){var i=qo[n];i.blockedOn===t&&(i.blockedOn=null)}}for(Mr!==null&&Aa(Mr,t),Er!==null&&Aa(Er,t),br!==null&&Aa(br,t),fo.forEach(e),ho.forEach(e),n=0;n<gr.length;n++)i=gr[n],i.blockedOn===t&&(i.blockedOn=null);for(;0<gr.length&&(n=gr[0],n.blockedOn===null);)ev(n),n.blockedOn===null&&gr.shift()}var ea=tr.ReactCurrentBatchConfig,oc=!0;function zy(t,e,n,i){var r=ht,s=ea.transition;ea.transition=null;try{ht=1,bh(t,e,n,i)}finally{ht=r,ea.transition=s}}function jy(t,e,n,i){var r=ht,s=ea.transition;ea.transition=null;try{ht=4,bh(t,e,n,i)}finally{ht=r,ea.transition=s}}function bh(t,e,n,i){if(oc){var r=Fd(t,e,n,i);if(r===null)Su(t,e,i,lc,n),Zp(t,i);else if(Fy(r,t,e,n,i))i.stopPropagation();else if(Zp(t,i),e&4&&-1<Uy.indexOf(t)){for(;r!==null;){var s=Uo(r);if(s!==null&&q0(s),s=Fd(t,e,n,i),s===null&&Su(t,e,i,lc,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else Su(t,e,i,null,n)}}var lc=null;function Fd(t,e,n,i){if(lc=null,t=yh(i),t=qr(t),t!==null)if(e=ps(t),e===null)t=null;else if(n=e.tag,n===13){if(t=G0(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return lc=t,null}function tv(t){switch(t){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(Cy()){case Sh:return 1;case X0:return 4;case sc:case Ay:return 16;case $0:return 536870912;default:return 16}default:return 16}}var _r=null,wh=null,Ol=null;function nv(){if(Ol)return Ol;var t,e=wh,n=e.length,i,r="value"in _r?_r.value:_r.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var a=n-t;for(i=1;i<=a&&e[n-i]===r[s-i];i++);return Ol=r.slice(t,1<i?1-i:void 0)}function zl(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Zo(){return!0}function Qp(){return!1}function Wn(t){function e(n,i,r,s,a){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Zo:Qp,this.isPropagationStopped=Qp,this}return Lt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Zo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Zo)},persist:function(){},isPersistent:Zo}),e}var _a={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Th=Wn(_a),Io=Lt({},_a,{view:0,detail:0}),By=Wn(Io),fu,hu,Ra,zc=Lt({},Io,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ch,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ra&&(Ra&&t.type==="mousemove"?(fu=t.screenX-Ra.screenX,hu=t.screenY-Ra.screenY):hu=fu=0,Ra=t),fu)},movementY:function(t){return"movementY"in t?t.movementY:hu}}),em=Wn(zc),Gy=Lt({},zc,{dataTransfer:0}),Hy=Wn(Gy),Vy=Lt({},Io,{relatedTarget:0}),pu=Wn(Vy),Wy=Lt({},_a,{animationName:0,elapsedTime:0,pseudoElement:0}),Xy=Wn(Wy),$y=Lt({},_a,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Yy=Wn($y),Ky=Lt({},_a,{data:0}),tm=Wn(Ky),qy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zy={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"},Jy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qy(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Jy[t])?!!e[t]:!1}function Ch(){return Qy}var eS=Lt({},Io,{key:function(t){if(t.key){var e=qy[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=zl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Zy[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ch,charCode:function(t){return t.type==="keypress"?zl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),tS=Wn(eS),nS=Lt({},zc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nm=Wn(nS),iS=Lt({},Io,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ch}),rS=Wn(iS),sS=Lt({},_a,{propertyName:0,elapsedTime:0,pseudoElement:0}),aS=Wn(sS),oS=Lt({},zc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),lS=Wn(oS),cS=[9,13,27,32],Ah=Ki&&"CompositionEvent"in window,Ja=null;Ki&&"documentMode"in document&&(Ja=document.documentMode);var uS=Ki&&"TextEvent"in window&&!Ja,iv=Ki&&(!Ah||Ja&&8<Ja&&11>=Ja),im=" ",rm=!1;function rv(t,e){switch(t){case"keyup":return cS.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Os=!1;function dS(t,e){switch(t){case"compositionend":return sv(e);case"keypress":return e.which!==32?null:(rm=!0,im);case"textInput":return t=e.data,t===im&&rm?null:t;default:return null}}function fS(t,e){if(Os)return t==="compositionend"||!Ah&&rv(t,e)?(t=nv(),Ol=wh=_r=null,Os=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return iv&&e.locale!=="ko"?null:e.data;default:return null}}var hS={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 sm(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!hS[t.type]:e==="textarea"}function av(t,e,n,i){F0(i),e=cc(e,"onChange"),0<e.length&&(n=new Th("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var Qa=null,mo=null;function pS(t){vv(t,0)}function jc(t){var e=Bs(t);if(P0(e))return t}function mS(t,e){if(t==="change")return e}var ov=!1;if(Ki){var mu;if(Ki){var gu="oninput"in document;if(!gu){var am=document.createElement("div");am.setAttribute("oninput","return;"),gu=typeof am.oninput=="function"}mu=gu}else mu=!1;ov=mu&&(!document.documentMode||9<document.documentMode)}function om(){Qa&&(Qa.detachEvent("onpropertychange",lv),mo=Qa=null)}function lv(t){if(t.propertyName==="value"&&jc(mo)){var e=[];av(e,mo,t,yh(t)),B0(pS,e)}}function gS(t,e,n){t==="focusin"?(om(),Qa=e,mo=n,Qa.attachEvent("onpropertychange",lv)):t==="focusout"&&om()}function vS(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return jc(mo)}function xS(t,e){if(t==="click")return jc(e)}function _S(t,e){if(t==="input"||t==="change")return jc(e)}function yS(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var gi=typeof Object.is=="function"?Object.is:yS;function go(t,e){if(gi(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!_d.call(e,r)||!gi(t[r],e[r]))return!1}return!0}function lm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function cm(t,e){var n=lm(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=lm(n)}}function cv(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?cv(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function uv(){for(var t=window,e=nc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=nc(t.document)}return e}function Rh(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function SS(t){var e=uv(),n=t.focusedElem,i=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&cv(n.ownerDocument.documentElement,n)){if(i!==null&&Rh(n)){if(e=i.start,t=i.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var r=n.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!t.extend&&s>i&&(r=i,i=s,s=r),r=cm(n,s);var a=cm(n,i);r&&a&&(t.rangeCount!==1||t.anchorNode!==r.node||t.anchorOffset!==r.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),t.removeAllRanges(),s>i?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var MS=Ki&&"documentMode"in document&&11>=document.documentMode,zs=null,Od=null,eo=null,zd=!1;function um(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zd||zs==null||zs!==nc(i)||(i=zs,"selectionStart"in i&&Rh(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),eo&&go(eo,i)||(eo=i,i=cc(Od,"onSelect"),0<i.length&&(e=new Th("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=zs)))}function Jo(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var js={animationend:Jo("Animation","AnimationEnd"),animationiteration:Jo("Animation","AnimationIteration"),animationstart:Jo("Animation","AnimationStart"),transitionend:Jo("Transition","TransitionEnd")},vu={},dv={};Ki&&(dv=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function Bc(t){if(vu[t])return vu[t];if(!js[t])return t;var e=js[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in dv)return vu[t]=e[n];return t}var fv=Bc("animationend"),hv=Bc("animationiteration"),pv=Bc("animationstart"),mv=Bc("transitionend"),gv=new Map,dm="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 Ur(t,e){gv.set(t,e),hs(e,[t])}for(var xu=0;xu<dm.length;xu++){var _u=dm[xu],ES=_u.toLowerCase(),bS=_u[0].toUpperCase()+_u.slice(1);
vendor: 4,215 bytes, line 37
37Ur(ES,"on"+bS)}Ur(fv,"onAnimationEnd");Ur(hv,"onAnimationIteration");Ur(pv,"onAnimationStart");Ur("dblclick","onDoubleClick");Ur("focusin","onFocus");Ur("focusout","onBlur");Ur(mv,"onTransitionEnd");oa("onMouseEnter",["mouseout","mouseover"]);oa("onMouseLeave",["mouseout","mouseover"]);oa("onPointerEnter",["pointerout","pointerover"]);oa("onPointerLeave",["pointerout","pointerover"]);hs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hs("onBeforeInput",["compositionend","keypress","textInput","paste"]);hs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ha="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(" "),wS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ha));function fm(t,e,n){var i=t.type||"unknown-event";t.currentTarget=n,Ey(i,e,void 0,t),t.currentTarget=null}function vv(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var a=i.length-1;0<=a;a--){var o=i[a],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==s&&r.isPropagationStopped())break e;fm(r,o,u),s=l}else for(a=0;a<i.length;a++){if(o=i[a],l=o.instance,u=o.currentTarget,o=o.listener,l!==s&&r.isPropagationStopped())break e;fm(r,o,u),s=l}}}if(rc)throw t=Ld,rc=!1,Ld=null,t}function Tt(t,e){var n=e[Vd];n===void 0&&(n=e[Vd]=new Set);var i=t+"__bubble";n.has(i)||(xv(e,t,2,!1),n.add(i))}function yu(t,e,n){var i=0;e&&(i|=4),xv(n,t,i,e)}var Qo="_reactListening"+Math.random().toString(36).slice(2);function vo(t){if(!t[Qo]){t[Qo]=!0,w0.forEach(function(n){n!=="selectionchange"&&(wS.has(n)||yu(n,!1,t),yu(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Qo]||(e[Qo]=!0,yu("selectionchange",!1,e))}}function xv(t,e,n,i){switch(tv(e)){case 1:var r=zy;break;case 4:r=jy;break;default:r=bh}n=r.bind(null,e,n,t),r=void 0,!Dd||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function Su(t,e,n,i,r){var s=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var a=i.tag;if(a===3||a===4){var o=i.stateNode.containerInfo;if(o===r||o.nodeType===8&&o.parentNode===r)break;if(a===4)for(a=i.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;a=a.return}for(;o!==null;){if(a=qr(o),a===null)return;if(l=a.tag,l===5||l===6){i=s=a;continue e}o=o.parentNode}}i=i.return}B0(function(){var u=s,f=yh(n),p=[];e:{var h=gv.get(t);if(h!==void 0){var m=Th,x=t;switch(t){case"keypress":if(zl(n)===0)break e;case"keydown":case"keyup":m=tS;break;case"focusin":x="focus",m=pu;break;case"focusout":x="blur",m=pu;break;case"beforeblur":case"afterblur":m=pu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=em;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Hy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=rS;break;case fv:case hv:case pv:m=Xy;break;case mv:m=aS;break;case"scroll":m=By;break;case"wheel":m=lS;break;case"copy":case"cut":case"paste":m=Yy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=nm}var y=(e&4)!==0,g=!y&&t==="scroll",d=y?h!==null?h+"Capture":null:h;y=[];for(var v=u,b;v!==null;){b=v;var M=b.stateNode;if(b.tag===5&&M!==null&&(b=M,d!==null&&(M=uo(v,d),M!=null&&y.push(xo(v,M,b)))),g)break;v=v.return}
vendor: 4,320 bytes, lines 37-38
370<y.length&&(h=new m(h,x,null,n,f),p.push({event:h,listeners:y}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",h&&n!==kd&&(x=n.relatedTarget||n.fromElement)&&(qr(x)||x[qi]))break e;if((m||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,m?(x=n.relatedTarget||n.toElement,m=u,x=x?qr(x):null,x!==null&&(g=ps(x),x!==g||x.tag!==5&&x.tag!==6)&&(x=null)):(m=null,x=u),m!==x)){if(y=em,M="onMouseLeave",d="onMouseEnter",v="mouse",(t==="pointerout"||t==="pointerover")&&(y=nm,M="onPointerLeave",d="onPointerEnter",v="pointer"),g=m==null?h:Bs(m),b=x==null?h:Bs(x),h=new y(M,v+"leave",m,n,f),h.target=g,h.relatedTarget=b,M=null,qr(f)===u&&(y=new y(d,v+"enter",x,n,f),y.target=b,y.relatedTarget=g,M=y),g=M,m&&x)t:{for(y=m,d=x,v=0,b=y;b;b=_s(b))v++;for(b=0,M=d;M;M=_s(M))b++;for(;0<v-b;)y=_s(y),v--;for(;0<b-v;)d=_s(d),b--;for(;v--;){if(y===d||d!==null&&y===d.alternate)break t;y=_s(y),d=_s(d)}y=null}else y=null;m!==null&&hm(p,h,m,y,!1),x!==null&&g!==null&&hm(p,g,x,y,!0)}}e:{if(h=u?Bs(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var E=mS;else if(sm(h))if(ov)E=_S;else{E=vS;var w=gS}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(E=xS);if(E&&(E=E(t,u))){av(p,E,n,f);break e}w&&w(t,h,u),t==="focusout"&&(w=h._wrapperState)&&w.controlled&&h.type==="number"&&Td(h,"number",h.value)}switch(w=u?Bs(u):window,t){case"focusin":(sm(w)||w.contentEditable==="true")&&(zs=w,Od=u,eo=null);break;case"focusout":eo=Od=zs=null;break;case"mousedown":zd=!0;break;case"contextmenu":case"mouseup":case"dragend":zd=!1,um(p,n,f);break;case"selectionchange":if(MS)break;case"keydown":case"keyup":um(p,n,f)}var A;if(Ah)e:{switch(t){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Os?rv(t,n)&&(_="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(iv&&n.locale!=="ko"&&(Os||_!=="onCompositionStart"?_==="onCompositionEnd"&&Os&&(A=nv()):(_r=f,wh="value"in _r?_r.value:_r.textContent,Os=!0)),w=cc(u,_),0<w.length&&(_=new tm(_,t,null,n,f),p.push({event:_,listeners:w}),A?_.data=A:(A=sv(n),A!==null&&(_.data=A)))),(A=uS?dS(t,n):fS(t,n))&&(u=cc(u,"onBeforeInput"),0<u.length&&(f=new tm("onBeforeInput","beforeinput",null,n,f),p.push({event:f,listeners:u}),f.data=A))}vv(p,e)})}function xo(t,e,n){return{instance:t,listener:e,currentTarget:n}}function cc(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;r.tag===5&&s!==null&&(r=s,s=uo(t,n),s!=null&&i.unshift(xo(t,s,r)),s=uo(t,e),s!=null&&i.push(xo(t,s,r))),t=t.return}return i}function _s(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function hm(t,e,n,i,r){for(var s=e._reactName,a=[];n!==null&&n!==i;){var o=n,l=o.alternate,u=o.stateNode;if(l!==null&&l===i)break;o.tag===5&&u!==null&&(o=u,r?(l=uo(n,s),l!=null&&a.unshift(xo(n,l,o))):r||(l=uo(n,s),l!=null&&a.push(xo(n,l,o)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var TS=/\r\n?/g,CS=/\u0000|\uFFFD/g;function pm(t){return(typeof t=="string"?t:""+t).replace(TS,` 38`).replace(CS,"")}function el(t,e,n){if(e=pm(e),pm(t)!==e&&n)throw Error(le(425))}function uc(){}var jd=null,Bd=null;function Gd(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Hd=typeof setTimeout=="function"?setTimeout:void 0,AS=typeof clearTimeout=="function"?clearTimeout:void 0,mm=typeof Promise=="function"?Promise:void 0,RS=typeof queueMicrotask=="function"?queueMicrotask:typeof mm<"u"?function(t){return mm.resolve(null).then(t).catch(PS)}:Hd;function PS(t){setTimeout(function(){throw t})}function Mu(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(i===0){t.removeChild(r),po(e);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=r}while(n);po(e)}function wr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function gm(t){t=t.previousSibling;for(var e=0;t;
vendor: 4,145 bytes, line 38
38){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var ya=Math.random().toString(36).slice(2),bi="__reactFiber$"+ya,_o="__reactProps$"+ya,qi="__reactContainer$"+ya,Vd="__reactEvents$"+ya,kS="__reactListeners$"+ya,NS="__reactHandles$"+ya;function qr(t){var e=t[bi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[qi]||n[bi]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=gm(t);t!==null;){if(n=t[bi])return n;t=gm(t)}return e}t=n,n=t.parentNode}return null}function Uo(t){return t=t[bi]||t[qi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Bs(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(le(33))}function Gc(t){return t[_o]||null}var Wd=[],Gs=-1;function Fr(t){return{current:t}}function Ct(t){0>Gs||(t.current=Wd[Gs],Wd[Gs]=null,Gs--)}function bt(t,e){Gs++,Wd[Gs]=t.current,t.current=e}var Nr={},gn=Fr(Nr),Pn=Fr(!1),ss=Nr;function la(t,e){var n=t.type.contextTypes;if(!n)return Nr;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in n)r[s]=e[s];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function kn(t){return t=t.childContextTypes,t!=null}function dc(){Ct(Pn),Ct(gn)}function vm(t,e,n){if(gn.current!==Nr)throw Error(le(168));bt(gn,e),bt(Pn,n)}function _v(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(le(108,gy(t)||"Unknown",r));return Lt({},n,i)}function fc(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Nr,ss=gn.current,bt(gn,t),bt(Pn,Pn.current),!0}function xm(t,e,n){var i=t.stateNode;if(!i)throw Error(le(169));n?(t=_v(t,e,ss),i.__reactInternalMemoizedMergedChildContext=t,Ct(Pn),Ct(gn),bt(gn,t)):Ct(Pn),bt(Pn,n)}var Bi=null,Hc=!1,Eu=!1;function yv(t){Bi===null?Bi=[t]:Bi.push(t)}function DS(t){Hc=!0,yv(t)}function Or(){if(!Eu&&Bi!==null){Eu=!0;var t=0,e=ht;try{var n=Bi;for(ht=1;t<n.length;t++){var i=n[t];do i=i(!0);while(i!==null)}Bi=null,Hc=!1}catch(r){throw Bi!==null&&(Bi=Bi.slice(t+1)),W0(Sh,Or),r}finally{ht=e,Eu=!1}}return null}var Hs=[],Vs=0,hc=null,pc=0,Kn=[],qn=0,as=null,Gi=1,Hi="";function Xr(t,e){Hs[Vs++]=pc,Hs[Vs++]=hc,hc=t,pc=e}function Sv(t,e,n){Kn[qn++]=Gi,Kn[qn++]=Hi,Kn[qn++]=as,as=t;var i=Gi;t=Hi;var r=32-pi(i)-1;i&=~(1<<r),n+=1;var s=32-pi(e)+r;if(30<s){var a=r-r%5;s=(i&(1<<a)-1).toString(32),i>>=a,r-=a,Gi=1<<32-pi(e)+r|n<<r|i,Hi=s+t}else Gi=1<<s|n<<r|i,Hi=t}function Ph(t){t.return!==null&&(Xr(t,1),Sv(t,1,0))}function kh(t){for(;t===hc;)hc=Hs[--Vs],Hs[Vs]=null,pc=Hs[--Vs],Hs[Vs]=null;for(;t===as;)as=Kn[--qn],Kn[qn]=null,Hi=Kn[--qn],Kn[qn]=null,Gi=Kn[--qn],Kn[qn]=null}var Gn=null,Bn=null,Rt=!1,ui=null;function Mv(t,e){var n=Jn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function _m(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Gn=t,Bn=wr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Gn=t,Bn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=as!==null?{id:Gi,overflow:Hi}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Jn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Gn=t,Bn=null,!0):!1;default:return!1}}function Xd(t){return(t.mode&1)!==0&&(t.flags&128)===0}function $d(t){if(Rt){var e=Bn;if(e){var n=e;if(!_m(t,e)){if(Xd(t))throw Error(le(418));e=wr(n.nextSibling);var i=Gn;e&&_m(t,e)?Mv(i,n):(t.flags=t.flags&-4097|2,Rt=!1,Gn=t)}}else{if(Xd(t))throw Error(le(418));t.flags=t.flags&-4097|2,Rt=!1,Gn=t}}}function ym(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Gn=t}function tl(t){if(t!==Gn)return!1;if(!Rt)return ym(t),Rt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Gd(t.type,t.memoizedProps)),e&&(e=Bn)){if
vendor: 12,720 bytes, line 38
38(Xd(t))throw Ev(),Error(le(418));for(;e;)Mv(t,e),e=wr(e.nextSibling)}if(ym(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(le(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Bn=wr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Bn=null}}else Bn=Gn?wr(t.stateNode.nextSibling):null;return!0}function Ev(){for(var t=Bn;t;)t=wr(t.nextSibling)}function ca(){Bn=Gn=null,Rt=!1}function Nh(t){ui===null?ui=[t]:ui.push(t)}var LS=tr.ReactCurrentBatchConfig;function Pa(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(le(309));var i=n.stateNode}if(!i)throw Error(le(147,t));var r=i,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(a){var o=r.refs;a===null?delete o[s]:o[s]=a},e._stringRef=s,e)}if(typeof t!="string")throw Error(le(284));if(!n._owner)throw Error(le(290,t))}return t}function nl(t,e){throw t=Object.prototype.toString.call(e),Error(le(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Sm(t){var e=t._init;return e(t._payload)}function bv(t){function e(d,v){if(t){var b=d.deletions;b===null?(d.deletions=[v],d.flags|=16):b.push(v)}}function n(d,v){if(!t)return null;for(;v!==null;)e(d,v),v=v.sibling;return null}function i(d,v){for(d=new Map;v!==null;)v.key!==null?d.set(v.key,v):d.set(v.index,v),v=v.sibling;return d}function r(d,v){return d=Rr(d,v),d.index=0,d.sibling=null,d}function s(d,v,b){return d.index=b,t?(b=d.alternate,b!==null?(b=b.index,b<v?(d.flags|=2,v):b):(d.flags|=2,v)):(d.flags|=1048576,v)}function a(d){return t&&d.alternate===null&&(d.flags|=2),d}function o(d,v,b,M){return v===null||v.tag!==6?(v=Pu(b,d.mode,M),v.return=d,v):(v=r(v,b),v.return=d,v)}function l(d,v,b,M){var E=b.type;return E===Fs?f(d,v,b.props.children,M,b.key):v!==null&&(v.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===hr&&Sm(E)===v.type)?(M=r(v,b.props),M.ref=Pa(d,v,b),M.return=d,M):(M=Xl(b.type,b.key,b.props,null,d.mode,M),M.ref=Pa(d,v,b),M.return=d,M)}function u(d,v,b,M){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=ku(b,d.mode,M),v.return=d,v):(v=r(v,b.children||[]),v.return=d,v)}function f(d,v,b,M,E){return v===null||v.tag!==7?(v=ns(b,d.mode,M,E),v.return=d,v):(v=r(v,b),v.return=d,v)}function p(d,v,b){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Pu(""+v,d.mode,b),v.return=d,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Wo:return b=Xl(v.type,v.key,v.props,null,d.mode,b),b.ref=Pa(d,null,v),b.return=d,b;case Us:return v=ku(v,d.mode,b),v.return=d,v;case hr:var M=v._init;return p(d,M(v._payload),b)}if(Ba(v)||wa(v))return v=ns(v,d.mode,b,null),v.return=d,v;nl(d,v)}return null}function h(d,v,b,M){var E=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return E!==null?null:o(d,v,""+b,M);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Wo:return b.key===E?l(d,v,b,M):null;case Us:return b.key===E?u(d,v,b,M):null;case hr:return E=b._init,h(d,v,E(b._payload),M)}if(Ba(b)||wa(b))return E!==null?null:f(d,v,b,M,null);nl(d,b)}return null}function m(d,v,b,M,E){if(typeof M=="string"&&M!==""||typeof M=="number")return d=d.get(b)||null,o(v,d,""+M,E);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case Wo:return d=d.get(M.key===null?b:M.key)||null,l(v,d,M,E);case Us:return d=d.get(M.key===null?b:M.key)||null,u(v,d,M,E);case hr:var w=M._init;return m(d,v,b,w(M._payload),E)}if(Ba(M)||wa(M))return d=d.get(b)||null,f(v,d,M,E,null);nl(v,M)}return null}function x(d,v,b,M){for(var E=null,w=null,A=v,_=v=0,T=null;A!==null&&_<b.length;_++){A.index>_?(T=A,A=null):T=A.sibling;var N=h(d,A,b[_],M);if(N===null){A===null&&(A=T);break}t&&A&&N.alternate===null&&e(d,A),v=s(N,v,_),w===null?E=N:w.sibling=N,w=N,A=T}if(_===b.length)return n(d,A),Rt&&Xr(d,_),E;if(A===null){for(;_<b.length;_++)A=p(d,b[_],M),A!==null&&(v=s(A,v,_),w===null?E=A:w.sibling=A,w=A);return Rt&&Xr(d,_),E}for(A=i(d,A);_<b.length;_++)T=m(A,d,_,b[_],M),T!==null&&(t&&T.alternate!==null&&A.delete(T.key===null?_:T.key),v=s(T,v,_),w===null?E=T:w.sibling=T,w=T);return t&&A.forEach(function(L){return e(d,L)}),Rt&&Xr(d,_),E}function y(d,v,b,M){var E=wa(b);if(typeof E!="function")throw Error(le(150));if(b=E.call(b),b==null)throw Error(le(151));for(var w=E=null,A=v,_=v=0,T=null,N=b.next();A!==null&&!N.done;_++,N=b.next()){A.index>_?(T=A,A=null):T=A.sibling;var L=h(d,A,N.value,M);if(L===null){A===null&&(A=T);break}t&&A&&L.alternate===null&&e(d,A),v=s(L,v,_),w===null?E=L:w.sibling=L,w=L,A=T}if(N.done)return n(d,A),Rt&&Xr(d,_),E;if(A===null){for(;!N.done;_++,N=b.next())N=p(d,N.value,M),N!==null&&(v=s(N,v,_),w===null?E=N:w.sibling=N,w=N);return Rt&&Xr(d,_),E}for(A=i(d,A);!N.done;_++,N=b.next())N=m(A,d,_,N.value,M),N!==null&&(t&&N.alternate!==null&&A.delete(N.key===null?_:N.key),v=s(N,v,_),w===null?E=N:w.sibling=N,w=N);return t&&A.forEach(function(R){return e(d,R)}),Rt&&Xr(d,_),E}function g(d,v,b,M){if(typeof b=="object"&&b!==null&&b.type===Fs&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Wo:e:{for(var E=b.key,w=v;w!==null;){if(w.key===E){if(E=b.type,E===Fs){if(w.tag===7){n(d,w.sibling),v=r(w,b.props.children),v.return=d,d=v;break e}}else if(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===hr&&Sm(E)===w.type){n(d,w.sibling),v=r(w,b.props),v.ref=Pa(d,w,b),v.return=d,d=v;break e}n(d,w);break}else e(d,w);w=w.sibling}b.type===Fs?(v=ns(b.props.children,d.mode,M,b.key),v.return=d,d=v):(M=Xl(b.type,b.key,b.props,null,d.mode,M),M.ref=Pa(d,v,b),M.return=d,d=M)}return a(d);case Us:e:{for(w=b.key;v!==null;){if(v.key===w)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(d,v.sibling),v=r(v,b.children||[]),v.return=d,d=v;break e}else{n(d,v);break}else e(d,v);v=v.sibling}v=ku(b,d.mode,M),v.return=d,d=v}return a(d);case hr:return w=b._init,g(d,v,w(b._payload),M)}if(Ba(b))return x(d,v,b,M);if(wa(b))return y(d,v,b,M);nl(d,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(n(d,v.sibling),v=r(v,b),v.return=d,d=v):(n(d,v),v=Pu(b,d.mode,M),v.return=d,d=v),a(d)):n(d,v)}return g}var ua=bv(!0),wv=bv(!1),mc=Fr(null),gc=null,Ws=null,Dh=null;function Lh(){Dh=Ws=gc=null}function Ih(t){var e=mc.current;Ct(mc),t._currentValue=e}function Yd(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function ta(t,e){gc=t,Dh=Ws=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Rn=!0),t.firstContext=null)}function ei(t){var e=t._currentValue;if(Dh!==t)if(t={context:t,memoizedValue:e,next:null},Ws===null){if(gc===null)throw Error(le(308));Ws=t,gc.dependencies={lanes:0,firstContext:t}}else Ws=Ws.next=t;return e}var Zr=null;function Uh(t){Zr===null?Zr=[t]:Zr.push(t)}function Tv(t,e,n,i){var r=e.interleaved;return r===null?(n.next=n,Uh(e)):(n.next=r.next,r.next=n),e.interleaved=n,Zi(t,i)}function Zi(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var pr=!1;function Fh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cv(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Xi(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Tr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,lt&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Zi(t,n)}return r=i.interleaved,r===null?(e.next=e,Uh(i)):(e.next=r.next,r.next=e),i.interleaved=e,Zi(t,n)}function jl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Mh(t,n)}}function Mm(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?r=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function vc(t,e,n,i){var r=t.updateQueue;pr=!1;var s=r.firstBaseUpdate,a=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?s=u:a.next=u,a=l;var f=t.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==a&&(o===null?f.firstBaseUpdate=u:o.next=u,f.lastBaseUpdate=l))}if(s!==null){var p=r.baseState;a=0,f=u=l=null,o=s;do{var h=o.lane,m=o.eventTime;if((i&h)===h){f!==null&&(f=f.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=t,y=o;switch(h=e,m=n,y.tag){case 1:if(x=y.payload,typeof x=="function"){p=x.call(m,p,h);break e}p=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,h=typeof x=="function"?x.call(m,p,h):x,h==null)break e;p=Lt({},p,h);break e;case 2:pr=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,h=r.effects,h===null?r.effects=[o]:h.push(o))}else m={eventTime:m,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(u=f=m,l=p):f=f.next=m,a|=h;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;h=o,o=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);if(f===null&&(l=p),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=f,e=r.shared.interleaved,e!==null){r=e;do a|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);ls|=a,t.lanes=a,t.memoizedState=p}}function Em(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var i=t[e],r=i.callback;if(r!==null){if(i.callback=null,i=n,typeof r!="function")throw Error(le(191,r));r.call(i)}}}var Fo={},Ri=Fr(Fo),yo=Fr(Fo),So=Fr(Fo);function Jr(t){if(t===Fo)throw Error(le(174));return t}function Oh(t,e){switch(bt(So,e),bt(yo,t),bt(Ri,Fo),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Ad(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Ad(e,t)}Ct(Ri),bt(Ri,e)}function da(){Ct(Ri),Ct(yo),Ct(So)}function Av(t){Jr(So.current);var e=Jr(Ri.current),n=Ad(e,t.type);e!==n&&(bt(yo,t),bt(Ri,n))}function zh(t){yo.current===t&&(Ct(Ri),Ct(yo))}var kt=Fr(0);function xc(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var bu=[];function jh(){for(var t=0;t<bu.length;t++)bu[t]._workInProgressVersionPrimary=null;bu.length=0}var Bl=tr.ReactCurrentDispatcher,wu=tr.ReactCurrentBatchConfig,os=0,Dt=null,Xt=null,Zt=null,_c=!1,to=!1,Mo=0,IS=0;function cn(){throw Error(le(321))}function Bh(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!gi(t[n],e[n]))return!1;return!0}function Gh(t,e,n,i,r,s){if(os=s,Dt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Bl.current=t===null||t.memoizedState===null?zS:jS,t=n(i,r),to){s=0;do{if(to=!1,Mo=0,25<=s)throw Error(le(301));s+=1,Zt=Xt=null,e.updateQueue=null,Bl.current=BS,t=n(i,r)}while(to)}if(Bl.current=yc,e=Xt!==null&&Xt.next!==null,os=0,Zt=Xt=Dt=null,_c=!1,e)throw Error(le(300));return t}function Hh(){var t=Mo!==0;return Mo=0,t}function Mi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Dt.memoizedState=Zt=t:Zt=Zt.next=t,Zt}function ti(){if(Xt===null){var t=Dt.alternate;t=t!==null?t.memoizedState:null}else t=Xt.next;var e=Zt===null?Dt.memoizedState:Zt.next;if(e!==null)Zt=e,Xt=t;else{if(t===null)throw Error(le(310));Xt=t,t={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},Zt===null?Dt.memoizedState=Zt=t:Zt=Zt.next=t}return Zt}function Eo(t,e){return typeof e=="function"?e(t):e}function Tu(t){var e=ti(),n=e.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=t;var i=Xt,r=i.baseQueue,s=n.pending;
vendor: 4,616 bytes, line 38
38if(s!==null){if(r!==null){var a=r.next;r.next=s.next,s.next=a}i.baseQueue=r=s,n.pending=null}if(r!==null){s=r.next,i=i.baseState;var o=a=null,l=null,u=s;do{var f=u.lane;if((os&f)===f)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:t(i,u.action);else{var p={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=p,a=i):l=l.next=p,Dt.lanes|=f,ls|=f}u=u.next}while(u!==null&&u!==s);l===null?a=i:l.next=o,gi(i,e.memoizedState)||(Rn=!0),e.memoizedState=i,e.baseState=a,e.baseQueue=l,n.lastRenderedState=i}if(t=n.interleaved,t!==null){r=t;do s=r.lane,Dt.lanes|=s,ls|=s,r=r.next;while(r!==t)}else r===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Cu(t){var e=ti(),n=e.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do s=t(s,a.action),a=a.next;while(a!==r);gi(s,e.memoizedState)||(Rn=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function Rv(){}function Pv(t,e){var n=Dt,i=ti(),r=e(),s=!gi(i.memoizedState,r);if(s&&(i.memoizedState=r,Rn=!0),i=i.queue,Vh(Dv.bind(null,n,i,t),[t]),i.getSnapshot!==e||s||Zt!==null&&Zt.memoizedState.tag&1){if(n.flags|=2048,bo(9,Nv.bind(null,n,i,r,e),void 0,null),Jt===null)throw Error(le(349));os&30||kv(n,e,r)}return r}function kv(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Dt.updateQueue,e===null?(e={lastEffect:null,stores:null},Dt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Nv(t,e,n,i){e.value=n,e.getSnapshot=i,Lv(e)&&Iv(t)}function Dv(t,e,n){return n(function(){Lv(e)&&Iv(t)})}function Lv(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!gi(t,n)}catch{return!0}}function Iv(t){var e=Zi(t,1);e!==null&&mi(e,t,1,-1)}function bm(t){var e=Mi();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:t},e.queue=t,t=t.dispatch=OS.bind(null,Dt,t),[e.memoizedState,t]}function bo(t,e,n,i){return t={tag:t,create:e,destroy:n,deps:i,next:null},e=Dt.updateQueue,e===null?(e={lastEffect:null,stores:null},Dt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t)),t}function Uv(){return ti().memoizedState}function Gl(t,e,n,i){var r=Mi();Dt.flags|=t,r.memoizedState=bo(1|e,n,void 0,i===void 0?null:i)}function Vc(t,e,n,i){var r=ti();i=i===void 0?null:i;var s=void 0;if(Xt!==null){var a=Xt.memoizedState;if(s=a.destroy,i!==null&&Bh(i,a.deps)){r.memoizedState=bo(e,n,s,i);return}}Dt.flags|=t,r.memoizedState=bo(1|e,n,s,i)}function wm(t,e){return Gl(8390656,8,t,e)}function Vh(t,e){return Vc(2048,8,t,e)}function Fv(t,e){return Vc(4,2,t,e)}function Ov(t,e){return Vc(4,4,t,e)}function zv(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function jv(t,e,n){return n=n!=null?n.concat([t]):null,Vc(4,4,zv.bind(null,e,t),n)}function Wh(){}function Bv(t,e){var n=ti();e=e===void 0?null:e;var i=n.memoizedState;return i!==null&&e!==null&&Bh(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function Gv(t,e){var n=ti();e=e===void 0?null:e;var i=n.memoizedState;return i!==null&&e!==null&&Bh(e,i[1])?i[0]:(t=t(),n.memoizedState=[t,e],t)}function Hv(t,e,n){return os&21?(gi(n,e)||(n=Y0(),Dt.lanes|=n,ls|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Rn=!0),t.memoizedState=n)}function US(t,e){var n=ht;ht=n!==0&&4>n?n:4,t(!0);var i=wu.transition;wu.transition={};try{t(!1),e()}finally{ht=n,wu.transition=i}}function Vv(){return ti().memoizedState}function FS(t,e,n){var i=Ar(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Wv(t))Xv(e,n);else if(n=Tv(t,e,n,i),n!==null){var r=yn();mi(n,t,i,r),$v(n,e,i)}}function OS(t,e,n){var i=Ar(t),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wv(t))Xv(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,n);if(r.hasEagerState=!0,r.eagerState=o,gi(o,a)){var l=e.interleaved;l===null?(r.next=r,Uh(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}n=Tv(t,e,r,i),n!==null&&(r=yn(),mi(n,t,i,r),$v(n,e,i))}}function Wv(t){var e=t.alternate;return t===Dt||e!==null&&e===Dt}function Xv(t,e){to=_c=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function $v(t,e,n){if(n&4194240){var i=e.lanes;
vendor: 8,472 bytes, lines 38-40
38i&=t.pendingLanes,n|=i,e.lanes=n,Mh(t,n)}}var yc={readContext:ei,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useInsertionEffect:cn,useLayoutEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useMutableSource:cn,useSyncExternalStore:cn,useId:cn,unstable_isNewReconciler:!1},zS={readContext:ei,useCallback:function(t,e){return Mi().memoizedState=[t,e===void 0?null:e],t},useContext:ei,useEffect:wm,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Gl(4194308,4,zv.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Gl(4194308,4,t,e)},useInsertionEffect:function(t,e){return Gl(4,2,t,e)},useMemo:function(t,e){var n=Mi();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var i=Mi();return e=n!==void 0?n(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=FS.bind(null,Dt,t),[i.memoizedState,t]},useRef:function(t){var e=Mi();return t={current:t},e.memoizedState=t},useState:bm,useDebugValue:Wh,useDeferredValue:function(t){return Mi().memoizedState=t},useTransition:function(){var t=bm(!1),e=t[0];return t=US.bind(null,t[1]),Mi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var i=Dt,r=Mi();if(Rt){if(n===void 0)throw Error(le(407));n=n()}else{if(n=e(),Jt===null)throw Error(le(349));os&30||kv(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,wm(Dv.bind(null,i,s,t),[t]),i.flags|=2048,bo(9,Nv.bind(null,i,s,n,e),void 0,null),n},useId:function(){var t=Mi(),e=Jt.identifierPrefix;if(Rt){var n=Hi,i=Gi;n=(i&~(1<<32-pi(i)-1)).toString(32)+n,e=":"+e+"R"+n,n=Mo++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=IS++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},jS={readContext:ei,useCallback:Bv,useContext:ei,useEffect:Vh,useImperativeHandle:jv,useInsertionEffect:Fv,useLayoutEffect:Ov,useMemo:Gv,useReducer:Tu,useRef:Uv,useState:function(){return Tu(Eo)},useDebugValue:Wh,useDeferredValue:function(t){var e=ti();return Hv(e,Xt.memoizedState,t)},useTransition:function(){var t=Tu(Eo)[0],e=ti().memoizedState;return[t,e]},useMutableSource:Rv,useSyncExternalStore:Pv,useId:Vv,unstable_isNewReconciler:!1},BS={readContext:ei,useCallback:Bv,useContext:ei,useEffect:Vh,useImperativeHandle:jv,useInsertionEffect:Fv,useLayoutEffect:Ov,useMemo:Gv,useReducer:Cu,useRef:Uv,useState:function(){return Cu(Eo)},useDebugValue:Wh,useDeferredValue:function(t){var e=ti();return Xt===null?e.memoizedState=t:Hv(e,Xt.memoizedState,t)},useTransition:function(){var t=Cu(Eo)[0],e=ti().memoizedState;return[t,e]},useMutableSource:Rv,useSyncExternalStore:Pv,useId:Vv,unstable_isNewReconciler:!1};function li(t,e){if(t&&t.defaultProps){e=Lt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Kd(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Lt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Wc={isMounted:function(t){return(t=t._reactInternals)?ps(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var i=yn(),r=Ar(t),s=Xi(i,r);s.payload=e,n!=null&&(s.callback=n),e=Tr(t,s,r),e!==null&&(mi(e,t,r,i),jl(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=yn(),r=Ar(t),s=Xi(i,r);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Tr(t,s,r),e!==null&&(mi(e,t,r,i),jl(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=yn(),i=Ar(t),r=Xi(n,i);r.tag=2,e!=null&&(r.callback=e),e=Tr(t,r,i),e!==null&&(mi(e,t,i,n),jl(e,t,i))}};function Tm(t,e,n,i,r,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,a):e.prototype&&e.prototype.isPureReactComponent?!go(n,i)||!go(r,s):!0}function Yv(t,e,n){var i=!1,r=Nr,s=e.contextType;return typeof s=="object"&&s!==null?s=ei(s):(r=kn(e)?ss:gn.current,i=e.contextTypes,s=(i=i!=null)?la(t,r):Nr),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Wc,t.stateNode=e,e._reactInternals=t,i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=s),e}function Cm(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Wc.enqueueReplaceState(e,e.state,null)}function qd(t,e,n,i){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},Fh(t);var s=e.contextType;typeof s=="object"&&s!==null?r.context=ei(s):(s=kn(e)?ss:gn.current,r.context=la(t,s)),r.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Kd(t,e,s,n),r.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&Wc.enqueueReplaceState(r,r.state,null),vc(t,n,r,i),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308)}function fa(t,e){try{var n="",i=e;do n+=my(i),i=i.return;while(i);var r=n}catch(s){r=` 39Error generating stack: `+s.message+` 40`+s.stack}return{value:t,source:e,stack:r,digest:null}}function Au(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Zd(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var GS=typeof WeakMap=="function"?WeakMap:Map;function Kv(t,e,n){n=Xi(-1,n),n.tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){Mc||(Mc=!0,lf=i),Zd(t,e)},n}function qv(t,e,n){n=Xi(-1,n),n.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){Zd(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Zd(t,e),typeof i!="function"&&(Cr===null?Cr=new Set([this]):Cr.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function Am(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new GS;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=nM.bind(null,t,e,n),e.then(t,t))}function Rm(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Pm(t,e,n,i,r){return t.mode&1?(t.flags|=65536,t.lanes=r,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Xi(-1,1),e.tag=2,Tr(n,e,1))),n.lanes|=1),t)}var HS=tr.ReactCurrentOwner,Rn=!1;function xn(t,e,n,i){e.child=t===null?wv(e,null,n,i):ua(e,t.child,n,i)}function km(t,e,n,i,r){n=n.render;var s=e.ref;return ta(e,r),i=Gh(t,e,n,i,s,r),n=Hh(),t!==null&&!Rn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,Ji(t,e,r)):(Rt&&n&&Ph(e),e.flags|=1,xn(t,e,i,r),e.child)}function Nm(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!Qh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,Zv(t,e,s,i,r)):(t=Xl(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&r)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:go,n(a,i)&&t.ref===e.ref)return Ji(t,e,r)}return e.flags|=1,t=Rr(s,i),t.ref=e.ref,t.return=e,e.child=t}function Zv(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(go(s,i)&&t.ref===e.ref)if(Rn=!1,e.pendingProps=i=s,(t.lanes&r)!==0)t.flags&131072&&(Rn=!0);else return e.lanes=t.lanes,Ji(t,e,r)}return Jd(t,e,n,i,r)}function Jv(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},bt($s,On),On|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,bt($s,On),On|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:n,bt($s,On),On|=i}else s!==null?(i=s.baseLanes|n,e.memoizedState=null):i=n,bt($s,On),On|=i;return xn(t,e,r,n),e.child}function Qv(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}
vendor: 7,030 bytes, line 40
40function Jd(t,e,n,i,r){var s=kn(n)?ss:gn.current;return s=la(e,s),ta(e,r),n=Gh(t,e,n,i,s,r),i=Hh(),t!==null&&!Rn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,Ji(t,e,r)):(Rt&&i&&Ph(e),e.flags|=1,xn(t,e,n,r),e.child)}function Dm(t,e,n,i,r){if(kn(n)){var s=!0;fc(e)}else s=!1;if(ta(e,r),e.stateNode===null)Hl(t,e),Yv(e,n,i),qd(e,n,i,r),i=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=ei(u):(u=kn(n)?ss:gn.current,u=la(e,u));var f=n.getDerivedStateFromProps,p=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";p||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==i||l!==u)&&Cm(e,a,i,u),pr=!1;var h=e.memoizedState;a.state=h,vc(e,i,a,r),l=e.memoizedState,o!==i||h!==l||Pn.current||pr?(typeof f=="function"&&(Kd(e,n,f,i),l=e.memoizedState),(o=pr||Tm(e,n,o,i,h,l,u))?(p||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),a.props=i,a.state=l,a.context=u,i=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,Cv(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:li(e.type,o),a.props=u,p=e.pendingProps,h=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=ei(l):(l=kn(n)?ss:gn.current,l=la(e,l));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==p||h!==l)&&Cm(e,a,i,l),pr=!1,h=e.memoizedState,a.state=h,vc(e,i,a,r);var x=e.memoizedState;o!==p||h!==x||Pn.current||pr?(typeof m=="function"&&(Kd(e,n,m,i),x=e.memoizedState),(u=pr||Tm(e,n,u,i,h,x,l)||!1)?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,x,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,x,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=x),a.props=i,a.state=x,a.context=l,i=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return Qd(t,e,n,i,s,r)}function Qd(t,e,n,i,r,s){Qv(t,e);var a=(e.flags&128)!==0;if(!i&&!a)return r&&xm(e,n,!1),Ji(t,e,s);i=e.stateNode,HS.current=e;var o=a&&typeof n.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,t!==null&&a?(e.child=ua(e,t.child,null,s),e.child=ua(e,null,o,s)):xn(t,e,o,s),e.memoizedState=i.state,r&&xm(e,n,!0),e.child}function ex(t){var e=t.stateNode;e.pendingContext?vm(t,e.pendingContext,e.pendingContext!==e.context):e.context&&vm(t,e.context,!1),Oh(t,e.containerInfo)}function Lm(t,e,n,i,r){return ca(),Nh(r),e.flags|=256,xn(t,e,n,i),e.child}var ef={dehydrated:null,treeContext:null,retryLane:0};function tf(t){return{baseLanes:t,cachePool:null,transitions:null}}function tx(t,e,n){var i=e.pendingProps,r=kt.current,s=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(r&2)!==0),o?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(r|=1),bt(kt,r&1),t===null)return $d(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=i.children,t=i.fallback,s?(i=e.mode,s=e.child,a={mode:"hidden",children:a},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=Yc(a,i,0,null),t=ns(t,i,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=tf(n),e.memoizedState=ef,t):Xh(e,a));if(r=t.memoizedState,r!==null&&(o=r.dehydrated,o!==null))return VS(t,e,a,i,o,r,n);if(s){s=i.fallback,a=e.mode,r=t.child,o=r.sibling;var l={mode:"hidden",children:i.children};return!(a&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=Rr(r,l),i.subtreeFlags=r.subtreeFlags&14680064),o!==null?s=Rr(o,s):(s=ns(s,a,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,a=t.child.memoizedState,a=a===null?tf(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=t.childLanes&~n,e.memoizedState=ef,i}return s=t.child,t=s.sibling,i=Rr(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=n),i.return=e,i.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=i,e.memoizedState=null,i}function Xh(t,e){return e=Yc({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function il(t,e,n,i){return i!==null&&Nh(i),ua(e,t.child,null,n),t=Xh(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function VS(t,e,n,i,r,s,a){if(n)return e.flags&256?(e.flags&=-257,i=Au(Error(le(422))),il(t,e,a,i)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=Yc({mode:"visible",children:i.children},r,0,null),s=ns(s,r,a,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&ua(e,t.child,null,a),e.child.memoizedState=tf(a),e.memoizedState=ef,s);if(!(e.mode&1))return il(t,e,a,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var o=i.dgst;return i=o,s=Error(le(419)),i=Au(s,i,void 0),il(t,e,a,i)}if(o=(a&t.childLanes)!==0,Rn||o){if(i=Jt,i!==null){switch(a&-a){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|a)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,Zi(t,r),mi(i,t,r,-1))}return Jh(),i=Au(Error(le(421))),il(t,e,a,i)}return r.data==="$?"?(e.flags|=128,e.child=t.child,e=iM.bind(null,t),r._reactRetry=e,null):(t=s.treeContext,Bn=wr(r.nextSibling),Gn=e,Rt=!0,ui=null,t!==null&&(Kn[qn++]=Gi,Kn[qn++]=Hi,Kn[qn++]=as,Gi=t.id,Hi=t.overflow,as=e),e=Xh(e,i.children),e.flags|=4096,e)}function Im(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),Yd(t.return,e,n)}function Ru(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function nx(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;
vendor: 4,760 bytes, line 40
40if(xn(t,e,i.children,n),i=kt.current,i&2)i=i&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Im(t,n,e);else if(t.tag===19)Im(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(bt(kt,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&xc(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Ru(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&xc(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Ru(e,!0,n,null,s);break;case"together":Ru(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Hl(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Ji(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ls|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(le(153));if(e.child!==null){for(t=e.child,n=Rr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Rr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function WS(t,e,n){switch(e.tag){case 3:ex(e),ca();break;case 5:Av(e);break;case 1:kn(e.type)&&fc(e);break;case 4:Oh(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;bt(mc,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(bt(kt,kt.current&1),e.flags|=128,null):n&e.child.childLanes?tx(t,e,n):(bt(kt,kt.current&1),t=Ji(t,e,n),t!==null?t.sibling:null);bt(kt,kt.current&1);break;case 19:if(i=(n&e.childLanes)!==0,t.flags&128){if(i)return nx(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),bt(kt,kt.current),i)break;return null;case 22:case 23:return e.lanes=0,Jv(t,e,n)}return Ji(t,e,n)}var ix,nf,rx,sx;ix=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};nf=function(){};rx=function(t,e,n,i){var r=t.memoizedProps;if(r!==i){t=e.stateNode,Jr(Ri.current);var s=null;switch(n){case"input":r=bd(t,r),i=bd(t,i),s=[];break;case"select":r=Lt({},r,{value:void 0}),i=Lt({},i,{value:void 0}),s=[];break;case"textarea":r=Cd(t,r),i=Cd(t,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(t.onclick=uc)}Rd(n,i);var a;n=null;for(u in r)if(!i.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var o=r[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(lo.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in i){var l=i[u];if(o=r!=null?r[u]:void 0,i.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(lo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Tt("scroll",t),s||o===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};sx=function(t,e,n,i){n!==i&&(e.flags|=4)};function ka(t,e){if(!Rt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function un(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function XS(t,e,n){var i=e.pendingProps;switch(kh(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(e),null;case 1:return kn(e.type)&&dc(),un(e),null;
vendor: 33,671 bytes, line 40
40case 3:return i=e.stateNode,da(),Ct(Pn),Ct(gn),jh(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(tl(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ui!==null&&(df(ui),ui=null))),nf(t,e),un(e),null;case 5:zh(e);var r=Jr(So.current);if(n=e.type,t!==null&&e.stateNode!=null)rx(t,e,n,i,r),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(le(166));return un(e),null}if(t=Jr(Ri.current),tl(e)){i=e.stateNode,n=e.type;var s=e.memoizedProps;switch(i[bi]=e,i[_o]=s,t=(e.mode&1)!==0,n){case"dialog":Tt("cancel",i),Tt("close",i);break;case"iframe":case"object":case"embed":Tt("load",i);break;case"video":case"audio":for(r=0;r<Ha.length;r++)Tt(Ha[r],i);break;case"source":Tt("error",i);break;case"img":case"image":case"link":Tt("error",i),Tt("load",i);break;case"details":Tt("toggle",i);break;case"input":Vp(i,s),Tt("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Tt("invalid",i);break;case"textarea":Xp(i,s),Tt("invalid",i)}Rd(n,s),r=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?i.textContent!==o&&(s.suppressHydrationWarning!==!0&&el(i.textContent,o,t),r=["children",o]):typeof o=="number"&&i.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&el(i.textContent,o,t),r=["children",""+o]):lo.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Tt("scroll",i)}switch(n){case"input":Xo(i),Wp(i,s,!0);break;case"textarea":Xo(i),$p(i);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(i.onclick=uc)}i=r,e.updateQueue=i,i!==null&&(e.flags|=4)}else{a=r.nodeType===9?r:r.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=D0(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=a.createElement(n,{is:i.is}):(t=a.createElement(n),n==="select"&&(a=t,i.multiple?a.multiple=!0:i.size&&(a.size=i.size))):t=a.createElementNS(t,n),t[bi]=e,t[_o]=i,ix(t,e,!1,!1),e.stateNode=t;e:{switch(a=Pd(n,i),n){case"dialog":Tt("cancel",t),Tt("close",t),r=i;break;case"iframe":case"object":case"embed":Tt("load",t),r=i;break;case"video":case"audio":for(r=0;r<Ha.length;r++)Tt(Ha[r],t);r=i;break;case"source":Tt("error",t),r=i;break;case"img":case"image":case"link":Tt("error",t),Tt("load",t),r=i;break;case"details":Tt("toggle",t),r=i;break;case"input":Vp(t,i),r=bd(t,i),Tt("invalid",t);break;case"option":r=i;break;case"select":t._wrapperState={wasMultiple:!!i.multiple},r=Lt({},i,{value:void 0}),Tt("invalid",t);break;case"textarea":Xp(t,i),r=Cd(t,i),Tt("invalid",t);break;default:r=i}Rd(n,r),o=r;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?U0(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&L0(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&co(t,l):typeof l=="number"&&co(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(lo.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Tt("scroll",t):l!=null&&gh(t,s,l,a))}switch(n){case"input":Xo(t),Wp(t,i,!1);break;case"textarea":Xo(t),$p(t);break;case"option":i.value!=null&&t.setAttribute("value",""+kr(i.value));break;case"select":t.multiple=!!i.multiple,s=i.value,s!=null?Zs(t,!!i.multiple,s,!1):i.defaultValue!=null&&Zs(t,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(t.onclick=uc)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return un(e),null;case 6:if(t&&e.stateNode!=null)sx(t,e,t.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(le(166));if(n=Jr(So.current),Jr(Ri.current),tl(e)){if(i=e.stateNode,n=e.memoizedProps,i[bi]=e,(s=i.nodeValue!==n)&&(t=Gn,t!==null))switch(t.tag){case 3:el(i.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&el(i.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[bi]=e,e.stateNode=i}return un(e),null;case 13:if(Ct(kt),i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Rt&&Bn!==null&&e.mode&1&&!(e.flags&128))Ev(),ca(),e.flags|=98560,s=!1;else if(s=tl(e),i!==null&&i.dehydrated!==null){if(t===null){if(!s)throw Error(le(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(le(317));s[bi]=e}else ca(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;un(e),s=!1}else ui!==null&&(df(ui),ui=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(i=i!==null,i!==(t!==null&&t.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(t===null||kt.current&1?$t===0&&($t=3):Jh())),e.updateQueue!==null&&(e.flags|=4),un(e),null);case 4:return da(),nf(t,e),t===null&&vo(e.stateNode.containerInfo),un(e),null;case 10:return Ih(e.type._context),un(e),null;case 17:return kn(e.type)&&dc(),un(e),null;case 19:if(Ct(kt),s=e.memoizedState,s===null)return un(e),null;if(i=(e.flags&128)!==0,a=s.rendering,a===null)if(i)ka(s,!1);else{if($t!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=xc(t),a!==null){for(e.flags|=128,ka(s,!1),i=a.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=n,n=e.child;n!==null;)s=n,t=i,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,t=a.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return bt(kt,kt.current&1|2),e.child}t=t.sibling}s.tail!==null&&Bt()>ha&&(e.flags|=128,i=!0,ka(s,!1),e.lanes=4194304)}else{if(!i)if(t=xc(a),t!==null){if(e.flags|=128,i=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),ka(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Rt)return un(e),null}else 2*Bt()-s.renderingStartTime>ha&&n!==1073741824&&(e.flags|=128,i=!0,ka(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(n=s.last,n!==null?n.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Bt(),e.sibling=null,n=kt.current,bt(kt,i?n&1|2:n&1),e):(un(e),null);case 22:case 23:return Zh(),i=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?On&1073741824&&(un(e),e.subtreeFlags&6&&(e.flags|=8192)):un(e),null;case 24:return null;case 25:return null}throw Error(le(156,e.tag))}function $S(t,e){switch(kh(e),e.tag){case 1:return kn(e.type)&&dc(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return da(),Ct(Pn),Ct(gn),jh(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return zh(e),null;case 13:if(Ct(kt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(le(340));ca()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ct(kt),null;case 4:return da(),null;case 10:return Ih(e.type._context),null;case 22:case 23:return Zh(),null;case 24:return null;default:return null}}var rl=!1,hn=!1,YS=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function Xs(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Ut(t,e,i)}else n.current=null}function rf(t,e,n){try{n()}catch(i){Ut(t,e,i)}}var Um=!1;function KS(t,e){if(jd=oc,t=uv(),Rh(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,f=0,p=t,h=null;t:for(;;){for(var m;p!==n||r!==0&&p.nodeType!==3||(o=a+r),p!==s||i!==0&&p.nodeType!==3||(l=a+i),p.nodeType===3&&(a+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===t)break t;if(h===n&&++u===r&&(o=a),h===s&&++f===i&&(l=a),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bd={focusedElem:t,selectionRange:n},oc=!1,Ce=e;Ce!==null;)if(e=Ce,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ce=t;else for(;Ce!==null;){e=Ce;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,g=x.memoizedState,d=e.stateNode,v=d.getSnapshotBeforeUpdate(e.elementType===e.type?y:li(e.type,y),g);d.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(M){Ut(e,e.return,M)}if(t=e.sibling,t!==null){t.return=e.return,Ce=t;break}Ce=e.return}return x=Um,Um=!1,x}function no(t,e,n){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&t)===t){var s=r.destroy;r.destroy=void 0,s!==void 0&&rf(e,n,s)}r=r.next}while(r!==i)}}function Xc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==e)}}function sf(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function ax(t){var e=t.alternate;e!==null&&(t.alternate=null,ax(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[bi],delete e[_o],delete e[Vd],delete e[kS],delete e[NS])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ox(t){return t.tag===5||t.tag===3||t.tag===4}function Fm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ox(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function af(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=uc));else if(i!==4&&(t=t.child,t!==null))for(af(t,e,n),t=t.sibling;t!==null;)af(t,e,n),t=t.sibling}function of(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(of(t,e,n),t=t.sibling;t!==null;)of(t,e,n),t=t.sibling}var en=null,ci=!1;function sr(t,e,n){for(n=n.child;n!==null;)lx(t,e,n),n=n.sibling}function lx(t,e,n){if(Ai&&typeof Ai.onCommitFiberUnmount=="function")try{Ai.onCommitFiberUnmount(Oc,n)}catch{}switch(n.tag){case 5:hn||Xs(n,e);case 6:var i=en,r=ci;en=null,sr(t,e,n),en=i,ci=r,en!==null&&(ci?(t=en,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):en.removeChild(n.stateNode));break;case 18:en!==null&&(ci?(t=en,n=n.stateNode,t.nodeType===8?Mu(t.parentNode,n):t.nodeType===1&&Mu(t,n),po(t)):Mu(en,n.stateNode));break;case 4:i=en,r=ci,en=n.stateNode.containerInfo,ci=!0,sr(t,e,n),en=i,ci=r;break;case 0:case 11:case 14:case 15:if(!hn&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&rf(n,e,a),r=r.next}while(r!==i)}sr(t,e,n);break;case 1:if(!hn&&(Xs(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(o){Ut(n,e,o)}sr(t,e,n);break;case 21:sr(t,e,n);break;case 22:n.mode&1?(hn=(i=hn)||n.memoizedState!==null,sr(t,e,n),hn=i):sr(t,e,n);break;default:sr(t,e,n)}}function Om(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new YS),e.forEach(function(i){var r=rM.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}}function ri(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i];try{var s=t,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:en=o.stateNode,ci=!1;break e;case 3:en=o.stateNode.containerInfo,ci=!0;break e;case 4:en=o.stateNode.containerInfo,ci=!0;break e}o=o.return}if(en===null)throw Error(le(160));lx(s,a,r),en=null,ci=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(u){Ut(r,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)cx(e,t),e=e.sibling}function cx(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(ri(e,t),_i(t),i&4){try{no(3,t,t.return),Xc(3,t)}catch(y){Ut(t,t.return,y)}try{no(5,t,t.return)}catch(y){Ut(t,t.return,y)}}break;case 1:ri(e,t),_i(t),i&512&&n!==null&&Xs(n,n.return);break;case 5:if(ri(e,t),_i(t),i&512&&n!==null&&Xs(n,n.return),t.flags&32){var r=t.stateNode;try{co(r,"")}catch(y){Ut(t,t.return,y)}}if(i&4&&(r=t.stateNode,r!=null)){var s=t.memoizedProps,a=n!==null?n.memoizedProps:s,o=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&k0(r,s),Pd(o,a);var u=Pd(o,s);for(a=0;a<l.length;a+=2){var f=l[a],p=l[a+1];f==="style"?U0(r,p):f==="dangerouslySetInnerHTML"?L0(r,p):f==="children"?co(r,p):gh(r,f,p,u)}switch(o){case"input":wd(r,s);break;case"textarea":N0(r,s);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?Zs(r,!!s.multiple,m,!1):h!==!!s.multiple&&(s.defaultValue!=null?Zs(r,!!s.multiple,s.defaultValue,!0):Zs(r,!!s.multiple,s.multiple?[]:"",!1))}r[_o]=s}catch(y){Ut(t,t.return,y)}}break;case 6:if(ri(e,t),_i(t),i&4){if(t.stateNode===null)throw Error(le(162));r=t.stateNode,s=t.memoizedProps;try{r.nodeValue=s}catch(y){Ut(t,t.return,y)}}break;case 3:if(ri(e,t),_i(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{po(e.containerInfo)}catch(y){Ut(t,t.return,y)}break;case 4:ri(e,t),_i(t);break;case 13:ri(e,t),_i(t),r=t.child,r.flags&8192&&(s=r.memoizedState!==null,r.stateNode.isHidden=s,!s||r.alternate!==null&&r.alternate.memoizedState!==null||(Kh=Bt())),i&4&&Om(t);break;case 22:if(f=n!==null&&n.memoizedState!==null,t.mode&1?(hn=(u=hn)||f,ri(e,t),hn=u):ri(e,t),_i(t),i&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!f&&t.mode&1)for(Ce=t,f=t.child;f!==null;){for(p=Ce=f;Ce!==null;){switch(h=Ce,m=h.child,h.tag){case 0:case 11:case 14:case 15:no(4,h,h.return);break;case 1:Xs(h,h.return);var x=h.stateNode;if(typeof x.componentWillUnmount=="function"){i=h,n=h.return;try{e=i,x.props=e.memoizedProps,x.state=e.memoizedState,x.componentWillUnmount()}catch(y){Ut(i,n,y)}}break;case 5:Xs(h,h.return);break;case 22:if(h.memoizedState!==null){jm(p);continue}}m!==null?(m.return=h,Ce=m):jm(p)}f=f.sibling}e:for(f=null,p=t;;){if(p.tag===5){if(f===null){f=p;try{r=p.stateNode,u?(s=r.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=p.stateNode,l=p.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=I0("display",a))}catch(y){Ut(t,t.return,y)}}}else if(p.tag===6){if(f===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(y){Ut(t,t.return,y)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===t)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;f===p&&(f=null),p=p.return}f===p&&(f=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:ri(e,t),_i(t),i&4&&Om(t);break;case 21:break;default:ri(e,t),_i(t)}}function _i(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(ox(n)){var i=n;break e}n=n.return}throw Error(le(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(co(r,""),i.flags&=-33);var s=Fm(t);of(t,s,r);break;case 3:case 4:var a=i.stateNode.containerInfo,o=Fm(t);af(t,o,a);break;default:throw Error(le(161))}}catch(l){Ut(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function qS(t,e,n){Ce=t,ux(t)}function ux(t,e,n){for(var i=(t.mode&1)!==0;Ce!==null;){var r=Ce,s=r.child;if(r.tag===22&&i){var a=r.memoizedState!==null||rl;if(!a){var o=r.alternate,l=o!==null&&o.memoizedState!==null||hn;o=rl;var u=hn;if(rl=a,(hn=l)&&!u)for(Ce=r;Ce!==null;)a=Ce,l=a.child,a.tag===22&&a.memoizedState!==null?Bm(r):l!==null?(l.return=a,Ce=l):Bm(r);for(;s!==null;)Ce=s,ux(s),s=s.sibling;Ce=r,rl=o,hn=u}zm(t)}else r.subtreeFlags&8772&&s!==null?(s.return=r,Ce=s):zm(t)}}function zm(t){for(;Ce!==null;){var e=Ce;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:hn||Xc(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!hn)if(n===null)i.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:li(e.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Em(e,s,i);break;case 3:var a=e.updateQueue;if(a!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Em(e,a,n)}break;case 5:var o=e.stateNode;if(n===null&&e.flags&4){n=o;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.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&&po(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(le(163))}hn||e.flags&512&&sf(e)}catch(h){Ut(e,e.return,h)}}if(e===t){Ce=null;break}if(n=e.sibling,n!==null){n.return=e.return,Ce=n;break}Ce=e.return}}function jm(t){for(;Ce!==null;){var e=Ce;if(e===t){Ce=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Ce=n;break}Ce=e.return}}function Bm(t){for(;Ce!==null;){var e=Ce;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Xc(4,e)}catch(l){Ut(e,n,l)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(l){Ut(e,r,l)}}var s=e.return;try{sf(e)}catch(l){Ut(e,s,l)}break;case 5:var a=e.return;try{sf(e)}catch(l){Ut(e,a,l)}}}catch(l){Ut(e,e.return,l)}if(e===t){Ce=null;break}var o=e.sibling;if(o!==null){o.return=e.return,Ce=o;break}Ce=e.return}}var ZS=Math.ceil,Sc=tr.ReactCurrentDispatcher,$h=tr.ReactCurrentOwner,Qn=tr.ReactCurrentBatchConfig,lt=0,Jt=null,Vt=null,nn=0,On=0,$s=Fr(0),$t=0,wo=null,ls=0,$c=0,Yh=0,io=null,An=null,Kh=0,ha=1/0,ji=null,Mc=!1,lf=null,Cr=null,sl=!1,yr=null,Ec=0,ro=0,cf=null,Vl=-1,Wl=0;function yn(){return lt&6?Bt():Vl!==-1?Vl:Vl=Bt()}function Ar(t){return t.mode&1?lt&2&&nn!==0?nn&-nn:LS.transition!==null?(Wl===0&&(Wl=Y0()),Wl):(t=ht,t!==0||(t=window.event,t=t===void 0?16:tv(t.type)),t):1}function mi(t,e,n,i){if(50<ro)throw ro=0,cf=null,Error(le(185));Lo(t,n,i),(!(lt&2)||t!==Jt)&&(t===Jt&&(!(lt&2)&&($c|=n),$t===4&&vr(t,nn)),Nn(t,i),n===1&<===0&&!(e.mode&1)&&(ha=Bt()+500,Hc&&Or()))}function Nn(t,e){var n=t.callbackNode;Ly(t,e);var i=ac(t,t===Jt?nn:0);if(i===0)n!==null&&qp(n),t.callbackNode=null,t.callbackPriority=0;else if(e=i&-i,t.callbackPriority!==e){if(n!=null&&qp(n),e===1)t.tag===0?DS(Gm.bind(null,t)):yv(Gm.bind(null,t)),RS(function(){!(lt&6)&&Or()}),n=null;else{switch(K0(i)){case 1:n=Sh;break;case 4:n=X0;break;case 16:n=sc;break;case 536870912:n=$0;break;default:n=sc}n=xx(n,dx.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function dx(t,e){if(Vl=-1,Wl=0,lt&6)throw Error(le(327));var n=t.callbackNode;if(na()&&t.callbackNode!==n)return null;var i=ac(t,t===Jt?nn:0);if(i===0)return null;if(i&30||i&t.expiredLanes||e)e=bc(t,i);else{e=i;var r=lt;lt|=2;var s=hx();(Jt!==t||nn!==e)&&(ji=null,ha=Bt()+500,ts(t,e));do try{eM();break}catch(o){fx(t,o)}while(!0);Lh(),Sc.current=s,lt=r,Vt!==null?e=0:(Jt=null,nn=0,e=$t)}if(e!==0){if(e===2&&(r=Id(t),r!==0&&(i=r,e=uf(t,r))),e===1)throw n=wo,ts(t,0),vr(t,i),Nn(t,Bt()),n;if(e===6)vr(t,i);else{if(r=t.current.alternate,!(i&30)&&!JS(r)&&(e=bc(t,i),e===2&&(s=Id(t),s!==0&&(i=s,e=uf(t,s))),e===1))throw n=wo,ts(t,0),vr(t,i),Nn(t,Bt()),n;switch(t.finishedWork=r,t.finishedLanes=i,e){case 0:case 1:throw Error(le(345));case 2:$r(t,An,ji);break;case 3:if(vr(t,i),(i&130023424)===i&&(e=Kh+500-Bt(),10<e)){if(ac(t,0)!==0)break;if(r=t.suspendedLanes,(r&i)!==i){yn(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=Hd($r.bind(null,t,An,ji),e);break}$r(t,An,ji);break;case 4:if(vr(t,i),(i&4194240)===i)break;for(e=t.eventTimes,r=-1;0<i;){var a=31-pi(i);s=1<<a,a=e[a],a>r&&(r=a),i&=~s}if(i=r,i=Bt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*ZS(i/1960))-i,10<i){t.timeoutHandle=Hd($r.bind(null,t,An,ji),i);break}$r(t,An,ji);break;case 5:$r(t,An,ji);break;default:throw Error(le(329))}}}return Nn(t,Bt()),t.callbackNode===n?dx.bind(null,t):null}function uf(t,e){var n=io;return t.current.memoizedState.isDehydrated&&(ts(t,e).flags|=256),t=bc(t,e),t!==2&&(e=An,An=n,e!==null&&df(e)),t}function df(t){An===null?An=t:An.push.apply(An,t)}function JS(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!gi(s(),r))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function vr(t,e){for(e&=~Yh,e&=~$c,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-pi(e),i=1<<n;t[n]=-1,e&=~i}}function Gm(t){if(lt&6)throw Error(le(327));na();var e=ac(t,0);if(!(e&1))return Nn(t,Bt()),null;var n=bc(t,e);if(t.tag!==0&&n===2){var i=Id(t);i!==0&&(e=i,n=uf(t,i))}if(n===1)throw n=wo,ts(t,0),vr(t,e),Nn(t,Bt()),n;if(n===6)throw Error(le(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,$r(t,An,ji),Nn(t,Bt()),null}function qh(t,e){var n=lt;lt|=1;try{return t(e)}finally{lt=n,lt===0&&(ha=Bt()+500,Hc&&Or())}}function cs(t){yr!==null&&yr.tag===0&&!(lt&6)&&na();var e=lt;lt|=1;var n=Qn.transition,i=ht;try{if(Qn.transition=null,ht=1,t)return t()}finally{ht=i,Qn.transition=n,lt=e,!(lt&6)&&Or()}}function Zh(){On=$s.current,Ct($s)}function ts(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,AS(n)),Vt!==null)for(n=Vt.return;n!==null;){var i=n;switch(kh(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&dc();break;case 3:da(),Ct(Pn),Ct(gn),jh();break;case 5:zh(i);break;case 4:da();break;case 13:Ct(kt);break;case 19:Ct(kt);break;case 10:Ih(i.type._context);break;case 22:case 23:Zh()}n=n.return}if(Jt=t,Vt=t=Rr(t.current,null),nn=On=e,$t=0,wo=null,Yh=$c=ls=0,An=io=null,Zr!==null){for(e=0;e<Zr.length;e++)if(n=Zr[e],i=n.interleaved,i!==null){n.interleaved=null;var r=i.next,s=n.pending;if(s!==null){var a=s.next;s.next=r,i.next=a}n.pending=i}Zr=null}return t}function fx(t,e){do{var n=Vt;try{if(Lh(),Bl.current=yc,_c){for(var i=Dt.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}_c=!1}if(os=0,Zt=Xt=Dt=null,to=!1,Mo=0,$h.current=null,n===null||n.return===null){$t=1,wo=e,Vt=null;break}e:{var s=t,a=n.return,o=n,l=e;if(e=nn,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,f=o,p=f.tag;if(!(f.mode&1)&&(p===0||p===11||p===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=Rm(a);if(m!==null){m.flags&=-257,Pm(m,a,o,s,e),m.mode&1&&Am(s,u,e),e=m,l=u;var x=e.updateQueue;if(x===null){var y=new Set;y.add(l),e.updateQueue=y}else x.add(l);break e}else{if(!(e&1)){Am(s,u,e),Jh();break e}l=Error(le(426))}}else if(Rt&&o.mode&1){var g=Rm(a);if(g!==null){!(g.flags&65536)&&(g.flags|=256),Pm(g,a,o,s,e),Nh(fa(l,o));break e}}s=l=fa(l,o),$t!==4&&($t=2),io===null?io=[s]:io.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var d=Kv(s,l,e);Mm(s,d);break e;case 1:o=l;var v=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Cr===null||!Cr.has(b)))){s.flags|=65536,e&=-e,s.lanes|=e;var M=qv(s,o,e);Mm(s,M);break e}}s=s.return}while(s!==null)}mx(n)}catch(E){e=E,Vt===n&&n!==null&&(Vt=n=n.return);continue}break}while(!0)}function hx(){var t=Sc.current;return Sc.current=yc,t===null?yc:t}function Jh(){($t===0||$t===3||$t===2)&&($t=4),Jt===null||!(ls&268435455)&&!($c&268435455)||vr(Jt,nn)}function bc(t,e){var n=lt;lt|=2;var i=hx();(Jt!==t||nn!==e)&&(ji=null,ts(t,e));do try{QS();break}catch(r){fx(t,r)}while(!0);if(Lh(),lt=n,Sc.current=i,Vt!==null)throw Error(le(261));return Jt=null,nn=0,$t}function QS(){for(;Vt!==null;)px(Vt)}function eM(){for(;Vt!==null&&!wy();)px(Vt)}function px(t){var e=vx(t.alternate,t,On);t.memoizedProps=t.pendingProps,e===null?mx(t):Vt=e,$h.current=null}function mx(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=$S(n,e),n!==null){n.flags&=32767,Vt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{$t=6,Vt=null;return}}else if(n=XS(n,e,On),n!==null){Vt=n;return}if(e=e.sibling,e!==null){Vt=e;return}Vt=e=t}while(e!==null);$t===0&&($t=5)}function $r(t,e,n){var i=ht,r=Qn.transition;try{Qn.transition=null,ht=1,tM(t,e,n,i)}finally{Qn.transition=r,ht=i}return null}function tM(t,e,n,i){do na();while(yr!==null);if(lt&6)throw Error(le(327));n=t.finishedWork;var r=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(le(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(Iy(t,s),t===Jt&&(Vt=Jt=null,nn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||sl||(sl=!0,xx(sc,function(){return na(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Qn.transition,Qn.transition=null;var a=ht;ht=1;var o=lt;lt|=4,$h.current=null,KS(t,n),cx(n,t),SS(Bd),oc=!!jd,Bd=jd=null,t.current=n,qS(n),Ty(),lt=o,ht=a,Qn.transition=s}else t.current=n;if(sl&&(sl=!1,yr=t,Ec=r),s=t.pendingLanes,s===0&&(Cr=null),Ry(n.stateNode),Nn(t,Bt()),e!==null)for(i=t.onRecoverableError,n=0;n<e.length;n++)r=e[n],i(r.value,{componentStack:r.stack,digest:r.digest});if(Mc)throw Mc=!1,t=lf,lf=null,t;return Ec&1&&t.tag!==0&&na(),s=t.pendingLanes,s&1?t===cf?ro++:(ro=0,cf=t):ro=0,Or(),null}function na(){if(yr!==null){var t=K0(Ec),e=Qn.transition,n=ht;try{if(Qn.transition=null,ht=16>t?16:t,yr===null)var i=!1;else{if(t=yr,yr=null,Ec=0,lt&6)throw Error(le(331));var r=lt;for(lt|=4,Ce=t.current;Ce!==null;){var s=Ce,a=s.child;if(Ce.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(Ce=u;Ce!==null;){var f=Ce;switch(f.tag){case 0:case 11:case 15:no(8,f,s)}var p=f.child;if(p!==null)p.return=f,Ce=p;else for(;Ce!==null;){f=Ce;var h=f.sibling,m=f.return;if(ax(f),f===u){Ce=null;break}if(h!==null){h.return=m,Ce=h;break}Ce=m}}}var x=s.alternate;if(x!==null){var y=x.child;if(y!==null){x.child=null;do{var g=y.sibling;y.sibling=null,y=g}while(y!==null)}}Ce=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,Ce=a;else e:for(;Ce!==null;){if(s=Ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:no(9,s,s.return)}var d=s.sibling;if(d!==null){d.return=s.return,Ce=d;break e}Ce=s.return}}var v=t.current;for(Ce=v;Ce!==null;){a=Ce;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,Ce=b;else e:for(a=v;Ce!==null;){if(o=Ce,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Xc(9,o)}}catch(E){Ut(o,o.return,E)}if(o===a){Ce=null;break e}var M=o.sibling;if(M!==null){M.return=o.return,Ce=M;break e}Ce=o.return}}if(lt=r,Or(),Ai&&typeof Ai.onPostCommitFiberRoot=="function")try{Ai.onPostCommitFiberRoot(Oc,t)}catch{}i=!0}return i}finally{ht=n,Qn.transition=e}}return!1}function Hm(t,e,n){e=fa(n,e),e=Kv(t,e,1),t=Tr(t,e,1),e=yn(),t!==null&&(Lo(t,1,e),Nn(t,e))}function Ut(t,e,n){if(t.tag===3)Hm(t,t,n);else for(;e!==null;){if(e.tag===3){Hm(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Cr===null||!Cr.has(i))){t=fa(n,t),t=qv(e,t,1),e=Tr(e,t,1),t=yn(),e!==null&&(Lo(e,1,t),Nn(e,t));break}}e=e.return}}function nM(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),e=yn(),t.pingedLanes|=t.suspendedLanes&n,Jt===t&&(nn&n)===n&&($t===4||$t===3&&(nn&130023424)===nn&&500>Bt()-Kh?ts(t,0):Yh|=n),Nn(t,e)}function gx(t,e){e===0&&(t.mode&1?(e=Ko,Ko<<=1,!(Ko&130023424)&&(Ko=4194304)):e=1);var n=yn();t=Zi(t,e),t!==null&&(Lo(t,e,n),Nn(t,n))}function iM(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),gx(t,n)}function rM(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(le(314))}i!==null&&i.delete(e),gx(t,n)}var vx;vx=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Pn.current)Rn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Rn=!1,WS(t,e,n);Rn=!!(t.flags&131072)}else Rn=!1,Rt&&e.flags&1048576&&Sv(e,pc,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Hl(t,e),t=e.pendingProps;var r=la(e,gn.current);ta(e,n),r=Gh(null,e,i,t,r,n);var s=Hh();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,kn(i)?(s=!0,fc(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Fh(e),r.updater=Wc,e.stateNode=r,r._reactInternals=e,qd(e,i,t,n),e=Qd(null,e,i,!0,s,n)):(e.tag=0,Rt&&s&&Ph(e),xn(null,e,r,n),e=e.child),e;case 16:i=e.elementType;e:{switch(Hl(t,e),t=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=aM(i),t=li(i,t),r){case 0:e=Jd(null,e,i,t,n);break e;case 1:e=Dm(null,e,i,t,n);break e;case 11:e=km(null,e,i,t,n);break e;case 14:e=Nm(null,e,i,li(i.type,t),n);break e}throw Error(le(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:li(i,r),Jd(t,e,i,r,n);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:li(i,r),Dm(t,e,i,r,n);case 3:e:{if(ex(e),t===null)throw Error(le(387));i=e.pendingProps,s=e.memoizedState,r=s.element,Cv(t,e),vc(e,i,null,n);var a=e.memoizedState;if(i=a.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=fa(Error(le(423)),e),e=Lm(t,e,i,n,r);break e}else if(i!==r){r=fa(Error(le(424)),e),e=Lm(t,e,i,n,r);break e}else for(Bn=wr(e.stateNode.containerInfo.firstChild),Gn=e,Rt=!0,ui=null,n=wv(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ca(),i===r){e=Ji(t,e,n);break e}xn(t,e,i,n)}e=e.child}return e;case 5:return Av(e),t===null&&$d(e),i=e.type,r=e.pendingProps,s=t!==null?t.memoizedProps:null,a=r.children,Gd(i,r)?a=null:s!==null&&Gd(i,s)&&(e.flags|=32),Qv(t,e),xn(t,e,a,n),e.child;case 6:return t===null&&$d(e),null;case 13:return tx(t,e,n);case 4:return Oh(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=ua(e,null,i,n):xn(t,e,i,n),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:li(i,r),km(t,e,i,r,n);case 7:return xn(t,e,e.pendingProps,n),e.child;case 8:return xn(t,e,e.pendingProps.children,n),e.child;case 12:return xn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,a=r.value,bt(mc,i._currentValue),i._currentValue=a,s!==null)if(gi(s.value,a)){if(s.children===r.children&&!Pn.current){e=Ji(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Xi(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Yd(s.return,n,e),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(le(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Yd(a,n,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}xn(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,ta(e,n),r=ei(r),i=i(r),e.flags|=1,xn(t,e,i,n),e.child;case 14:return i=e.type,r=li(i,e.pendingProps),r=li(i.type,r),Nm(t,e,i,r,n);case 15:return Zv(t,e,e.type,e.pendingProps,n);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:li(i,r),Hl(t,e),e.tag=1,kn(i)?(t=!0,fc(e)):t=!1,ta(e,n),Yv(e,i,r),qd(e,i,r,n),Qd(null,e,i,!0,t,n);case 19:return nx(t,e,n);case 22:return Jv(t,e,n)}throw Error(le(156,e.tag))};function xx(t,e){return W0(t,e)}function sM(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(t,e,n,i){return new sM(t,e,n,i)}function Qh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function aM(t){if(typeof t=="function")return Qh(t)?1:0;if(t!=null){if(t=t.$$typeof,t===xh)return 11;if(t===_h)return 14}return 2}function Rr(t,e){var n=t.alternate;return n===null?(n=Jn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deleti
vendor: 4,803 bytes, line 40
40ons=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Xl(t,e,n,i,r,s){var a=2;if(i=t,typeof t=="function")Qh(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Fs:return ns(n.children,r,s,e);case vh:a=8,r|=8;break;case yd:return t=Jn(12,n,e,r|2),t.elementType=yd,t.lanes=s,t;case Sd:return t=Jn(13,n,e,r),t.elementType=Sd,t.lanes=s,t;case Md:return t=Jn(19,n,e,r),t.elementType=Md,t.lanes=s,t;case A0:return Yc(n,r,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case T0:a=10;break e;case C0:a=9;break e;case xh:a=11;break e;case _h:a=14;break e;case hr:a=16,i=null;break e}throw Error(le(130,t==null?t:typeof t,""))}return e=Jn(a,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function ns(t,e,n,i){return t=Jn(7,t,i,e),t.lanes=n,t}function Yc(t,e,n,i){return t=Jn(22,t,i,e),t.elementType=A0,t.lanes=n,t.stateNode={isHidden:!1},t}function Pu(t,e,n){return t=Jn(6,t,null,e),t.lanes=n,t}function ku(t,e,n){return e=Jn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function oM(t,e,n,i,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=du(0),this.expirationTimes=du(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=du(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function ep(t,e,n,i,r,s,a,o,l){return t=new oM(t,e,n,o,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Jn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fh(s),t}function lM(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Us,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}function _x(t){if(!t)return Nr;t=t._reactInternals;e:{if(ps(t)!==t||t.tag!==1)throw Error(le(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(kn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(le(171))}if(t.tag===1){var n=t.type;if(kn(n))return _v(t,n,e)}return e}function yx(t,e,n,i,r,s,a,o,l){return t=ep(n,i,!0,t,r,s,a,o,l),t.context=_x(null),n=t.current,i=yn(),r=Ar(n),s=Xi(i,r),s.callback=e??null,Tr(n,s,r),t.current.lanes=r,Lo(t,r,i),Nn(t,i),t}function Kc(t,e,n,i){var r=e.current,s=yn(),a=Ar(r);return n=_x(n),e.context===null?e.context=n:e.pendingContext=n,e=Xi(s,a),e.payload={element:t},i=i===void 0?null:i,i!==null&&(e.callback=i),t=Tr(r,e,a),t!==null&&(mi(t,r,a,s),jl(t,r,a)),a}function wc(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Vm(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function tp(t,e){Vm(t,e),(t=t.alternate)&&Vm(t,e)}function cM(){return null}var Sx=typeof reportError=="function"?reportError:function(t){console.error(t)};function np(t){this._internalRoot=t}qc.prototype.render=np.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(le(409));Kc(t,e,null,null)};qc.prototype.unmount=np.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;cs(function(){Kc(null,t,null,null)}),e[qi]=null}};function qc(t){this._internalRoot=t}qc.prototype.unstable_scheduleHydration=function(t){if(t){var e=J0();t={blockedOn:null,target:t,priority:e};for(var n=0;n<gr.length&&e!==0&&e<gr[n].priority;n++);gr.splice(n,0,t),n===0&&ev(t)}};function ip(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Zc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Wm(){}function uM(t,e,n,i,r){if(r){if(typeof i=="function"){var s=i;i=function(){var u=wc(a);s.call(u)}}var a=yx(e,i,t,0,null,!1,!1,"",Wm);return t._reactRootContainer=a,t[qi]=a.current,vo(t.nodeType===8?t.parentNode:t),cs(),a}for(;r=t.lastChild;)t.removeChild(r);if(typeof i=="function"){var o=i;i=function(){var u=wc(l);o.call(u)}}var l=ep(t,0,!1,null,null,!1,!1,"",Wm);return t._reactRootContainer=l,t[qi]=l.current,vo(t.nodeType===8?t.parentNode:t),cs(function(){Kc(e,l,n,i)}),l}
vendor: 4,591 bytes, line 40
40function Jc(t,e,n,i,r){var s=n._reactRootContainer;if(s){var a=s;if(typeof r=="function"){var o=r;r=function(){var l=wc(a);o.call(l)}}Kc(e,a,t,r)}else a=uM(n,e,t,r,i);return wc(a)}q0=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ga(e.pendingLanes);n!==0&&(Mh(e,n|1),Nn(e,Bt()),!(lt&6)&&(ha=Bt()+500,Or()))}break;case 13:cs(function(){var i=Zi(t,1);if(i!==null){var r=yn();mi(i,t,1,r)}}),tp(t,1)}};Eh=function(t){if(t.tag===13){var e=Zi(t,134217728);if(e!==null){var n=yn();mi(e,t,134217728,n)}tp(t,134217728)}};Z0=function(t){if(t.tag===13){var e=Ar(t),n=Zi(t,e);if(n!==null){var i=yn();mi(n,t,e,i)}tp(t,e)}};J0=function(){return ht};Q0=function(t,e){var n=ht;try{return ht=t,e()}finally{ht=n}};Nd=function(t,e,n){switch(e){case"input":if(wd(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=Gc(i);if(!r)throw Error(le(90));P0(i),wd(i,r)}}}break;case"textarea":N0(t,n);break;case"select":e=n.value,e!=null&&Zs(t,!!n.multiple,e,!1)}};z0=qh;j0=cs;var dM={usingClientEntryPoint:!1,Events:[Uo,Bs,Gc,F0,O0,qh]},Na={findFiberByHostInstance:qr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fM={bundleType:Na.bundleType,version:Na.version,rendererPackageName:Na.rendererPackageName,rendererConfig:Na.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:tr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=H0(t),t===null?null:t.stateNode},findFiberByHostInstance:Na.findFiberByHostInstance||cM,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 al=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!al.isDisabled&&al.supportsFiber)try{Oc=al.inject(fM),Ai=al}catch{}}Vn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dM;Vn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ip(e))throw Error(le(200));return lM(t,e,null,n)};Vn.createRoot=function(t,e){if(!ip(t))throw Error(le(299));var n=!1,i="",r=Sx;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=ep(t,1,!1,null,null,n,!1,i,r),t[qi]=e.current,vo(t.nodeType===8?t.parentNode:t),new np(e)};Vn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(le(188)):(t=Object.keys(t).join(","),Error(le(268,t)));return t=H0(e),t=t===null?null:t.stateNode,t};Vn.flushSync=function(t){return cs(t)};Vn.hydrate=function(t,e,n){if(!Zc(e))throw Error(le(200));return Jc(null,t,e,!0,n)};Vn.hydrateRoot=function(t,e,n){if(!ip(t))throw Error(le(405));var i=n!=null&&n.hydratedSources||null,r=!1,s="",a=Sx;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),e=yx(e,null,t,1,n??null,r,!1,s,a),t[qi]=e.current,vo(t),i)for(t=0;t<i.length;t++)n=i[t],r=n._getVersion,r=r(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,r]:e.mutableSourceEagerHydrationData.push(n,r);return new qc(e)};Vn.render=function(t,e,n){if(!Zc(e))throw Error(le(200));return Jc(null,t,e,!1,n)};Vn.unmountComponentAtNode=function(t){if(!Zc(t))throw Error(le(40));return t._reactRootContainer?(cs(function(){Jc(null,null,t,!1,function(){t._reactRootContainer=null,t[qi]=null})}),!0):!1};Vn.unstable_batchedUpdates=qh;Vn.unstable_renderSubtreeIntoContainer=function(t,e,n,i){if(!Zc(n))throw Error(le(200));if(t==null||t._reactInternals===void 0)throw Error(le(38));return Jc(t,e,n,!1,i)};Vn.version="18.3.1-next-f1338f8080-20240426";function Mx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mx)}catch(t){console.error(t)}}Mx(),M0.exports=Vn;var hM=M0.exports,Xm=hM;xd.createRoot=Xm.createRoot,xd.hydrateRoot=Xm.hydrateRoot;const Ge=4,Sa=5.6,rp=13.4,Ex=.3;function is(t){var e;return ms((e=t==null?void 0:t.package)==null?void 0:e.widthCm,Sa)}function To(t){var e;
40return ms((e=t==null?void 0:t.package)==null?void 0:e.heightCm,rp)}function Co(t){var e;return ms((e=t==null?void 0:t.package)==null?void 0:e.depthCm,Sa)}function Tc(t){return ms(t.productWidthCm,Sa)}function Ao(t){return ms(t.productHeightCm,rp)}function ff(t){return ms(t.productDepthCm,Sa)}function Qc(t){return ms(t,Sa)+Ex}function sp(t,e=Sa){return t*Qc(e)-Ex}function Tn(t){return sp(t.facings,Tc(t))}function ms(t,e){return Number.isFinite(t)&&Number(t)>0?Number(t):e}const bx=[{id:"gondola-90",name:"Gondola 90",desc:"Supermarket aisle unit · 90 à 180 cm · 5 levels",widthCm:90,heightCm:180,levels:5},{id:"gondola-125",name:"Gondola 125",desc:"Wide supermarket unit · 125 à 200 cm · 6 levels",widthCm:125,heightCm:200,levels:6},{id:"cooler-60",name:"Cooler 60",desc:"Gas-station cooler shelf · 60 à 160 cm · 4 levels",widthCm:60,heightCm:160,levels:4},{id:"counter-60",name:"Counter unit",desc:"Small-shop countertop display · 60 à 90 cm · 3 levels",widthCm:60,heightCm:90,levels:3}],$m=[{id:"volt-original",name:"VOLT Original",brandColor:"#1b1f24",accentColor:"#8ef000",textColor:"#8ef000",defaultPrice:1.99,mine:!0},{id:"volt-zero",name:"VOLT Zero",brandColor:"#f2f4f6",accentColor:"#00b8d9",textColor:"#0b2530",defaultPrice:1.99,mine:!0},{id:"volt-berry",name:"VOLT Berry",brandColor:"#3b1042",accentColor:"#ff4fa3",textColor:"#ffd7ec",defaultPrice:2.09,mine:!0},{id:"nitro-rush",name:"Nitro Rush",brandColor:"#c0392b",accentColor:"#f5d020",textColor:"#fff6d8",defaultPrice:1.89,mine:!1},{id:"blue-bolt",name:"Blue Bolt",brandColor:"#0f3d91",accentColor:"#9bd3ff",textColor:"#e8f4ff",defaultPrice:1.79,mine:!1},{id:"panther",name:"Panther",brandColor:"#111111",accentColor:"#d4af37",textColor:"#d4af37",defaultPrice:2.29,mine:!1},{id:"citrus-surge",name:"Citrus Surge",brandColor:"#e8890c",accentColor:"#2e7d32",textColor:"#173a19",defaultPrice:1.59,mine:!1},{id:"night-owl",name:"Night Owl",brandColor:"#241d4f",accentColor:"#8f7bff",textColor:"#d9d2ff",defaultPrice:2.19,mine:!1},{id:"pink-pulse",name:"Pink Pulse",brandColor:"#e94f8a",accentColor:"#ffffff",textColor:"#ffffff",defaultPrice:1.99,mine:!1},{id:"iron-fuel",name:"Iron Fuel",brandColor:"#4a4f57",accentColor:"#ff5722",textColor:"#ffd9cc",defaultPrice:1.69,mine:!1}];function wx(t){return bx.find(e=>e.id===t)??null}const Va=2,Ys=6,zn=3,hf=1.2,$l=2.2;
40function Ro(t){return t.heightCm/t.levels}function Ks(t,e){return t.heightCm-e*Ro(t)}function Ym(t,e){let n=null,i=1/0;for(let r=0;r<t.levels;r++){const s=Ks(t,r),a=Math.abs(e-(s-Ro(t)/2));a<i&&(i=a,n=r)}return n===null?null:i<=Ro(t)*1.2?n:null}function so(t,e,n){return Math.min(Math.max(0,e),Math.max(0,t.widthCm-n))}function Tx(t,e,n){return t.filter(i=>i.level===e&&i.id!==n).map(i=>({start:i.xCm,end:i.xCm+Tn(i)})).sort((i,r)=>i.start-r.start)}function pM(t,e){return t.start<e.end-.01&&e.start<t.end-.01}function mM(t,e,n,i,r,s){const a=Tx(e,n,s),o=h=>h>=-.01&&h+r<=t.widthCm+.01&&!a.some(m=>pM({start:h,end:h+r},m)),l=so(t,i,r);if(o(l))return l;const u=[];for(const h of a)u.push(h.start-r),u.push(h.end);u.push(0,t.widthCm-r);let f=null,p=1/0;for(const h of u){if(!o(h))continue;const m=Math.abs(h-l);m<p&&(p=m,f=h)}return f}function Nu(t,e,n,i,r){const s=e.find(g=>g.id===n);if(!s)return null;const a=(g,d)=>{const v=g.map(M=>({...M})),b=()=>v.reduce((M,E)=>M+Tn(E),0);for(;b()>d+.01;){const M=v.filter(E=>E.facings>1).sort((E,w)=>w.facings-E.facings)[0];if(!M)return null;M.facings-=1}return v};let o=s.facings,l=0,u=0,f=null,p=null;for(;o>=1;o--){if(l=sp(o,Tc(s)),l>t.widthCm+.01)continue;u=so(t,r,l);const g=u+l/2,d=e.filter(M=>M.level===i&&M.id!==n),v=d.filter(M=>M.xCm+Tn(M)/2<=g),b=d.filter(M=>M.xCm+Tn(M)/2>g);if(f=a(v,u),p=a(b,t.widthCm-(u+l)),f&&p)break}if(!f||!p)return null;let h=u;for(const g of f.sort((d,v)=>v.xCm-d.xCm)){const d=Tn(g);g.xCm=Math.min(g.xCm,h-d),h=g.xCm}let m=0;for(const g of[...f].sort((d,v)=>d.xCm-v.xCm)){const d=Tn(g);g.xCm<m&&(g.xCm=m),m=g.xCm+d}h=u+l;for(const g of p.sort((d,v)=>d.xCm-v.xCm))g.xCm=Math.max(g.xCm,h),h=g.xCm+Tn(g);let x=t.widthCm;for(const g of[...p].sort((d,v)=>v.xCm-d.xCm)){const d=Tn(g);g.xCm+d>x&&(g.xCm=x-d),x=g.xCm}const y=new Map([...f,...p].map(g=>[g.id,g]));return e.map(g=>g.id===n?{...g,level:i,xCm:u,facings:o}:y.get(g.id)??g)}function gM(t,e,n){const i=Tx(e,n),r=[];let s=0;for(const a of i)a.start-s>.5&&r.push({start:s,end:a.start}),s=Math.max(s,a.end);return t.widthCm-s>.5&&r.push({start:s,end:t.widthCm}),r}const Cx="shelf-planner-catalog-v1";let vM=Date.now();const wi=()=>`id-${(vM++).toString(36)}`;function xM(){return Math.random().toString(36).slice(2,8).toUpperCase()}function _M(){return{categories:[{id:"cat-energy",name:"Energy drinks",groups:[{id:"grp-own",name:"VOLT (your brand)",products:$m.filter(t=>t.mine)},{id:"grp-comp",name:"Competitors",products:$m.filter(t=>!t.mine)}]}],shares:[{id:"share-demo",label:"Demo client",code:"DEMO01",categoryIds:["cat-energy"],groupIds:[]}]}}function Km(){try{const t=localStorage.getItem(Cx);if(t){const e=JSON.parse(t);if(Array.isArray(e.categories))return{...e,shares:e.shares??[]}}}catch{}return _M()}function yM(t){try{localStorage.setItem(Cx,JSON.stringify(t))}catch(e){console.warn("catalog too large for localStorage",e)}}function SM(t){return t.categories.flatMap(e=>e.groups.flatMap(n=>n.products))}function Ax(t,e){const n=e.trim().toUpperCase();return t.shares.find(i=>i.code.toUpperCase()===n)??null}function MM(t,e){if(!e)return SM(t);const n=Ax(t,e);if(!n)return[];const i=[];for(const r of t.categories){const s=n.categoryIds.includes(r.id);for(const a of r.groups)(s||n.groupIds.includes(a.id))&&i.push(...a.products)}return i}const Rx={id:"missing",name:"Unknown",brandColor:"#9aa0a6",accentColor:"#c4c9cf",textColor:"#ffffff",defaultPrice:0,mine:!1};function Wa(t,e){const n=parseInt(t.slice(1),16),i=Math.min(255,Math.round((n>>16&255)*e)),r=Math.min(255,Math.round((n>>8&255)*e)),s=Math.min(255,Math.round((n&255)*e));return`#${(i<<16|r<<8|s).toString(16).padStart(6,"0")}`}const Cc="#ffffff",Ac="#111827";function ap(t,e="#374151",n="#ffffff"){const i=/^#([0-9a-f]{6})$/i.exec(t);if(!i)return e;const r=parseInt(i[1],16),s=[r>>16&255,r>>8&255,r&255].map(o=>{const l=o/255;return l<=.04045?l/12.92:((l+.055)/1.055)**2.4});return .2126*s[0]+.7152*s[1]+.0722*s[2]>.43?e:n}function EM(t){return(t==null?void 0:t.trim().toUpperCase())||"EUR"}function wn(t,e){const n=EM(e);try{return new Intl.NumberFormat(n==="RSD"?"sr-RS":"en-IE",{style:"currency",currency:n,minimumFractionDigits:n==="RSD"?0:2,maximumFractionDigits:2}).format(t)}catch{return`${t.toFixed(2)} ${n}`}}function Du(t,e,n,i=.56){const r=t.trim().replace(/\s+/g," ");
40if(!r)return"";const s=Math.max(2,Math.floor(e/Math.max(1,n*i)));return r.length<=s?r:`${r.slice(0,Math.max(1,s-1)).trimEnd()}â¦`}function Px(t,e,n,i=2,r=.56){const s=t.trim().replace(/\s+/g," ");if(!s)return[];const a=Math.max(2,Math.floor(e/Math.max(1,n*r))),o=s.split(" "),l=[];let u="";for(let f=0;f<o.length;f++){const p=u?`${u} ${o[f]}`:o[f];if(p.length<=a){u=p;continue}if(u&&l.push(Du(u,e,n,r)),u=o[f],l.length===i-1){u=Du([u,...o.slice(f+1)].join(" "),e,n,r);break}}return u&&l.length<i&&l.push(Du(u,e,n,r)),l.slice(0,i)}function kx(t,e,n,i,r=.58){return t?Math.max(i,Math.min(n,e/(t.length*r))):n}function bM(t,e,n,i,r){switch(t){case"squeeze-bottle":case"bottle":return[`M ${e+i*.36} ${n}`,`H ${e+i*.64}`,`V ${n+r*.09}`,`C ${e+i*.7} ${n+r*.11}, ${e+i*.88} ${n+r*.16}, ${e+i*.91} ${n+r*.25}`,`L ${e+i*.98} ${n+r*.9}`,`Q ${e+i} ${n+r}, ${e+i*.88} ${n+r}`,`H ${e+i*.12}`,`Q ${e} ${n+r}, ${e+i*.02} ${n+r*.9}`,`L ${e+i*.09} ${n+r*.25}`,`C ${e+i*.12} ${n+r*.16}, ${e+i*.3} ${n+r*.11}, ${e+i*.36} ${n+r*.09}`,"Z"].join(" ");case"pouch":return`M ${e+i*.08} ${n} H ${e+i*.92} L ${e+i} ${n+r*.96} Q ${e+i} ${n+r}
40 ${e+i*.9} ${n+r} H ${e+i*.1} Q ${e} ${n+r} ${e} ${n+r*.96} Z`;case"jar":return`M ${e+i*.08} ${n} H ${e+i*.92} V ${n+r*.1} Q ${e+i} ${n+r*.13} ${e+i} ${n+r*.22} V ${n+r*.92} Q ${e+i} ${n+r} ${e+i*.88} ${n+r} H ${e+i*.12} Q ${e} ${n+r} ${e} ${n+r*.92} V ${n+r*.22} Q ${e} ${n+r*.13} ${e+i*.08} ${n+r*.1} Z`;case"box":return`M ${e} ${n} H ${e+i} V ${n+r} H ${e} Z`;default:return`M ${e+2} ${n} H ${e+i-2} Q ${e+i} ${n} ${e+i} ${n+2} V ${n+r-2} Q ${e+i} ${n+r} ${e+i-2} ${n+r} H ${e+2} Q ${e} ${n+r} ${e} ${n+r-2} V ${n+2} Q ${e} ${n} ${e+2} ${n} Z`}}function wM({product:t,x:e,baseY:n,view:i}){var p;const r=is(t)*Ge,s=To(t)*Ge,a=n-s,o=((p=t.package)==null?void 0:p.shape)??"can";if(t.image)return c.jsx("image",{href:t.image,x:e,y:a,width:r,height:s,preserveAspectRatio:"xMidYMax meet"});const l=bM(o,e,a,r,s),u=`package-${t.id.replace(/[^a-zA-Z0-9_-]/g,"-")}-${Math.round(e*10)}-${Math.round(n*10)}`,f=o==="can";return c.jsxs("g",{children:[c.jsx("defs",{children:c.jsx("clipPath",{id:u,children:c.jsx("path",{d:l})})}),c.jsx("path",{d:l,fill:t.brandColor,stroke:"#7f8791",strokeWidth:.45}),c.jsx("path",{d:l,fill:`url(#grad-${t.id})`}),c.jsx("rect",{x:e,y:a+s*.58,width:r,height:s*.14,fill:t.accentColor,opacity:.95,clipPath:`url(#${u})`}),c.jsx("text",{x:e+r/2,y:a+s*.46,textAnchor:"middle",fontSize:r*.58,fontWeight:800,fontFamily:"system-ui, sans-serif",fill:t.textColor,children:t.name.charAt(0)}),c.jsx("path",{d:l,fill:f?"url(#grad-cyl)":"url(#grad-package)",opacity:.16,pointerEvents:"none"}),f&&(i==="2.5d"?c.jsx("ellipse",{cx:e+r/2,cy:a+1.8,rx:r/2,ry:2.6,fill:"url(#grad-lid)",stroke:"#9aa0a6",strokeWidth:.4}):c.jsx("rect",{x:e,y:a,width:r,height:3,rx:1.2,fill:"url(#grad-lid)"})),(o==="squeeze-bottle"||o==="bottle")&&c.jsx("rect",{x:e+r*.35,y:a,width:r*.3,height:Math.max(2,
40s*.035),rx:1,fill:"#c52828",opacity:.65})]})}function qm({product:t,xPx:e,baseYPx:n,facings:i,rows:r,view:s,ghost:a}){const o=t??Rx,l=[],u=s==="2.5d"?r:1,f=Qc(is(o))*Ge,p=Math.max(.7,Co(o)/5.6);for(let h=u-1;h>=0;h--){const m=[];for(let x=0;x<i;x++)m.push(c.jsx(wM,{product:o,x:e+x*f+h*hf*Ge*p,baseY:n-h*$l*Ge*p,view:s},x));l.push(c.jsx("g",{style:h>0?{filter:`brightness(${1-.16*h})`}:void 0,children:m},h))}return c.jsx("g",{opacity:a?.55:1,children:l})}const Vi=12;function ol(t,e,n){const i=t.createSVGPoint();i.x=e,i.y=n;const r=i.matrixTransform(t.getScreenCTM().inverse());return{xCm:r.x/Ge-(Vi+zn),yCm:r.y/Ge-Vi}}function Zm(t,e,n,i,r,s=-Math.PI/2){const a=[];for(let o=0;o<r*2;o++){const l=o%2===0?n:i,u=s+o*Math.PI/r;a.push(`${t+l*Math.cos(u)},${e+l*Math.sin(u)}`)}return a.join(" ")}function TM({shape:t,x:e,y:n,r:i,color:r}){switch(t){case"star":return c.jsx("polygon",{points:Zm(e,n,i*1.25,i*.62,5),fill:r,stroke:"#ffffff",strokeWidth:2,strokeLinejoin:"round"});case"burst":return c.jsx("polygon",{points:Zm(e,n,i*1.25,i*.88,12),fill:r,stroke:"#ffffff",strokeWidth:2,strokeLinejoin:"round"});case"tag":return c.jsxs("g",{transform:`rotate(-8 ${e} ${n})`,children:[c.jsx("rect",{x:e-i*1.25,y:n-i*.62,width:i*2.5,height:i*1.24,rx:4,fill:r,stroke:"#ffffff",strokeWidth:2}),c.jsx("circle",{cx:e-i*1.02,cy:n,r:2.4,fill:"#ffffff"})]});case"arrow":return c.jsx("polygon",{points:`${e-i*1.4},${n-i*.55} ${e+i*.55},${n-i*.55} ${e+i*.55},${n-i*.95} ${e+i*1.45},${n} ${e+i*.55},${n+i*.95} ${e+i*.55},${n+i*.55} ${e-i*1.4},${n+i*.55}`,fill:r,stroke:"#ffffff",strokeWidth:2,strokeLinejoin:"round"});default:return c.jsx("circle",{cx:e,cy:n,r:i,fill:r,stroke:"#ffffff",strokeWidth:2})}}function Lu({x:t,y:e,onDelete:n}){return c.jsxs("g",{style:{cursor:"pointer"},onPointerDown:i=>{i.stopPropagation(),i.preventDefault(),n()},children:[c.jsx("circle",{cx:t,cy:e,r:7,fill:"#d84332",stroke:"#ffffff",strokeWidth:1.6}),c.jsx("text",{x:t,y:e+3.2,textAnchor:"middle",fontSize:9,fontWeight:700,fontFamily:"system-ui, sans-serif",fill:"#ffffff",children:"â"})]})}const CM=q.forwardRef(function({shelf:e,groups:n,marketing:i,products:r,view:s,selectedId:a,ghost:o,onGroupPointerDown:l,onMarketingPointerDown:u,onBackgroundClick:f,onDeleteItem:p,dimmedId:h,groupInteractionMode:m},x){const y=e.widthCm*Ge,g=e.heightCm*Ge,d=zn*Ge,v=Vi*Ge,b=y+2*d+2*v,M=g+d+2*v,E=v+d,w=v,A=s==="2.5d",_=hf*Ge*4,T=$l*Ge*4,N=Array.from({length:e.levels},(R,D)=>D),L=Object.values(r);return c.jsxs("svg",{ref:x,viewBox:`0 0 ${b} ${M}`,style:{width:"100%",height:"100%",display:"block",touchAction:"none"},children:[c.jsxs("defs",{children:[L.map(R=>c.jsxs("linearGradient",{id:`grad-${R.id}`,x1:"0",y1:"0",x2:"1",y2:"0",children:[c.jsx("stop",{offset:"0",stopColor:Wa(R.brandColor,.55)}),c.jsx("stop",{offset:"0.25",stopColor:R.brandColor}),c.jsx("stop",{offset:"0.55",stopColor:Wa(R.brandColor,1.35)}),c.jsx("stop",{offset:"0.8",stopColor:R.brandColor}),c.jsx("stop",{offset:"1",stopColor:Wa(R.brandColor,.5)})]},R.id)),c.jsxs("linearGradient",{id:"grad-lid",x1:"0",y1:"0",x2:"1",y2:"0",children:[c.jsx("stop",{offset:"0",stopColor:"#8d949c"}),c.jsx("stop",{offset:"0.5",stopColor:"#e8ebee"}),c.jsx("stop",{offset:"1",stopColor:"#7d848c"})]}),c.jsxs("linearGradient",{id:"grad-cyl",x1:"0",y1:"0",x2:"1",y2:"0",children:[c.jsx("stop",{offset:"0",stopColor:"#000000",stopOpacity:"0.42"}),c.jsx("stop",{offset:"0.22",stopColor:"#000000",stopOpacity:"0.05"}),c.jsx("stop",{offset:"0.45",stopColor:"#ffffff",stopOpacity:"0.28"}),c.jsx("stop",{offset:"0.62",stopColor:"#ffffff",stopOpacity:"0.04"}),c.jsx("stop",{offset:"1",stopColor:"#000000",stopOpacity:"0.45"})]}),c.jsxs("linearGradient",{id:"grad-package",x1:"0",y1:"0",x2:"1",y2:"0",children:[c.jsx("stop",{offset:"0",stopColor:"#000000",stopOpacity:"0.28"}),c.jsx("stop",{offset:"0.24",stopColor:"#ffffff",stopOpacity:"0.06"}),c.jsx("stop",{offset:"0.52",stopColor:"#ffffff",stopOpacity:"0.32"}),c.jsx("stop",{offset:"0.78",stopColor:"#ffffff",stopOpacity:"0.02"}),c.jsx("stop",{offset:"1",stopColor:"#000000",stopOpacity:"0.3"})]}),c.jsxs("linearGradient",{id:"grad-back",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"0",stopColor:"#e6e9ee"}),c.jsx("stop",{offset:"1",stopColor:"#cdd2d9"})]}),c.jsxs("linearGradient",{id:"grad-room",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"0",stopColor:"#fafbfc"}),c.jsx("stop",{offset:"1",stopColor:"#eef0f4"})]}),c.jsx("clipPath",{id:"canclip-round",clipPathUnits:"objectBoundingBox",children:c.jsx("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.1",ry:"0.042"})}),c.jsx("filter",{id:"soft-blur",x:"-40%",y:"-40%",width:"180%",height:"180%",children:c.jsx("feGaussianBlur",{stdDeviation:"6"})})]}),c.jsx("rect",{x:0,y:0,width:b,height:M,fill:"url(#grad-room)",onPointerDown:f}),c.jsx("ellipse",{cx:b/2,cy:w+g+d*.6,rx:y*.62,ry:10,fill:"#0f1420",opacity:.18,filter:"url
40(#soft-blur)"}),c.jsx("rect",{x:E,y:w,width:y,height:g,fill:"url(#grad-back)"}),A&&c.jsx("polygon",{points:`${E-d},${w} ${E+y+d},${w} ${E+y+d+_},${w-T} ${E-d+_},${w-T}`,fill:"#a7adb5"}),c.jsx("rect",{x:E-d,y:w,width:d,height:g+Va*Ge,fill:"#9298a1"}),c.jsx("rect",{x:E+y,y:w,width:d,height:g+Va*Ge,fill:"#878d96"}),c.jsx("rect",{x:E-d,y:w,width:y+2*d,height:Va*Ge,fill:"#b4bac2"}),N.map(R=>{const D=w+Ks(e,R)*Ge;return c.jsxs("g",{children:[A&&c.jsx("polygon",{points:`${E},${D} ${E+y},${D} ${E+y+_},${D-T} ${E+_},${D-T}`,fill:"#c2c7ce"}),c.jsx("rect",{x:E-d,y:D,width:y+2*d,height:Va*Ge,fill:"#b4bac2"}),c.jsx("rect",{x:E-d,y:D,width:y+2*d,height:Ys*Ge,fill:"#f4f5f7",stroke:"#d0d4da",strokeWidth:.6})]},R)}),[...n].sort((R,D)=>D.level-R.level).map(R=>{const D=w+Ks(e,R.level)*Ge,F=E+R.xCm*Ge,k=Tn(R)*Ge,B=Ao(R)*Ge,z=Math.max(.7,ff(R)/5.6),I=R.id===a,V=R.id===h,Q=D-B-(A?(R.rows-1)*$l*Ge*z:0),re=k+4+(A?(R.rows-1)*hf*Ge*z:0);return c.jsxs("g",{style:{cursor:m?"crosshair":"grab"},onPointerDown:ae=>l(R.id,ae),opacity:V?.35:1,children:[c.jsx(qm,{product:r[R.productId],xPx:F,baseYPx:D,facings:R.facings,rows:R.rows,view:s}),I&&!V&&c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:F-2,y:Q-4,width:re,height:B+(A?(R.rows-1)*$l*Ge*z:0)+6,fill:"none",stroke:"#2f80ed",strokeWidth:1.6,strokeDasharray:"5 3",rx:3}),!m&&c.jsx(Lu,{x:F-2+re,y:Q-4,onDelete:()=>p(R.id)})]}),c.jsx("rect",{x:F,y:D-B,width:k,height:B,fill:"transparent"})]},R.id)}),n.map(R=>{const D=w+Ks(e,R.level)*Ge,F=Tn(R)*Ge,k=E+R.xCm*Ge+F/2,B=Math.min(18*Ge,Math.max(9*Ge,F*.92)),z=Ys*Ge-2,I=D+1,V=B-6,Q=5.1,re=Px(R.name,V,Q,2),ae=wn(R.price,R.currency),Fe=kx(ae,V,7.4,5.4),je=R.labelColor??Cc,Oe=R.priceColor??Ac,ee=ap(je);return c.jsxs("g",{pointerEvents:"none",children:[c.jsx("rect",{x:k-B/2,y:I,width:B,height:z,rx:1.5,fill:je,stroke:Wa(je,.72),strokeWidth:.65}),c.jsx("text",{x:k,textAnchor:"middle",fontSize:Q,fontWeight:600,fontFamily:"system-ui, sans-serif",fill:ee,children:re.map((ue,oe)=>c.jsx("tspan",{x:k,y:I+(re.length===1?7.8:5.4+oe*5.2),children:ue},oe))}),c.jsx("text",{x:k,y:I+z-2.2,textAnchor:"middle",fontSize:Fe,fontWeight:800,fontFamily:"system-ui, sans-serif",fill:Oe,children:ae})]},`label-${R.id}`)}),o&&c.jsx("g",{pointerEvents:"none",children:c.jsx(qm,{product:r[o.productId],xPx:E+o.xCm*Ge,baseYPx:w+Ks(e,o.level)*Ge,facings:1,rows:1,view:s,ghost:!0})}),i.map(R=>{const D=E+R.xCm*Ge,F=w+R.yCm*Ge,k=R.id===a,B={cursor:"grab"};if(R.kind==="wobbler"){const V=5*Ge,Q=R.shape??"circle";return c.jsxs("g",{style:B,onPointerDown:re=>u(R.id,re),children:[c.jsx("line",{x1:D,y1:F-V-8,x2:D,y2:F-V*.4,stroke:"#8a8f98",strokeWidth:1}),c.jsx(TM,{shape:Q,x:D,y:F,r:V,color:R.color}),c.jsx("text",{x:D,y:F+2.4,textAnchor:"middle",fontSize:Math.min(7,V*1.7/Math.max(3,R.text.length)),fontWeight:800,fontFamily:"system-ui, sans-serif",fill:"#ffffff",children:R.text}),k&&c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:D,cy:F,r:V*1.5,fill:"none",stroke:"#2f80ed",strokeWidth:1.4,strokeDasharray:"4 3"}),c.jsx(Lu,{x:D+V*1.3,y:F-V*1.3,onDelete:()=>p(R.id)})]})]},R.id)}const z=R.kind==="banner-h"?R.lengthCm*Ge:6*Ge,I=R.kind==="banner-h"?6*Ge:R.lengthCm*Ge;return c.jsxs("g",{style:B,onPointerDown:V=>u(R.id,V),children:[c.jsx("rect",{x:D,y:F,width:z,height:I,rx:2,fill:R.color,stroke:k?"#2f80ed":"#ffffff",strokeWidth:k?1.8:1.5}),R.kind==="banner-h"?c.jsx("text",{x:D+z/2,y:F+I*.68,textAnchor:"middle",fontSize:I*.52,fontWeight:800,fontFamily:"system-ui, sans-serif",fill:"#ffffff",letterSpacing:"1",children:R.text}):c.jsx("text",{x:D+z*.68,y:F+I/2,textAnchor:"middle",fontSize:z*.52,fontWeight:800,fontFamily:"system-ui, sans-serif",fill:"#ffffff",letterSpacing:"1",transform:`rotate(-90 ${D+z*.68} ${F+I/2})`,children:R.text}),k&&c.jsx(Lu,{x:D+z,y:F,onDelete:()=>p(R.id)})]},R.id)})]})}),AM=[{key:"language.switch",en:"Switch language",sr:"Promeni jezik"},{key:"language.english",en:"English",sr:"Engleski"},{key:"language.serbian",en:"Serbian Latin",sr:"Srpski latinica"},{key:"common.add",en:"Add",sr:"Dodaj"},{key:"common.cancel",en:"Cancel",sr:"Otkaži"},{key:"common.delete",en:"Delete",sr:"ObriÅ¡i"},{key:"common.rename",en:"Rename",sr:"Preimenuj"},{key:"common.products",en:"Products",sr:"Proizvodi"},{key:"common.competition",en:"Competition",sr:"Konkurencija"},{key:"common.marketing",en:"Marketing",sr:"Marketing"},{key:"common.category",en:"Category",sr:"Kategorija"},{key:"common.productGroup",en:"Product group",sr:"Grupa proizvoda"},{key:"common.source",en:"source â",sr:"izvor â"},{key:"common.ownBrand",en:"own brand",sr:"sopstveni brend"},{key:"common.snapshot",en:"Snapshot",sr:"Snimak"},{key:"common.processing",en:"Processingâ¦",sr:"Obradaâ¦"},{key:"common.next",en:"Next",sr:"Dalje"},{key:"common.back",en:"Back",sr:"Nazad"},{key:"common.close",en:"Close",sr:"Zatvori"},{key:"common.and",en:"and",sr:"i"},{key:"app.tagline",en:"plan · test · sell",sr:"planiraj · testiraj · prodaj"},{key:"app.clientView",en:"client view · {{label}}",sr:"prikaz klijenta · {{label}}"},{key:"app.invalidCode",en:"invalid code",sr:"nevažeÄi kod"},{key:"app.studio",en:"studio",sr:"studio"},{key:"app.productsStep",en:"Products",sr:"Proizvodi"},{key:"app.competitionStep",en:"Competition",sr:"Konkurencija"},{key:"app.marketingStep",en:"Marketing",sr:"Marketing"},{key:"app.zoom3dHint",en:"Use the mouse wheel to zoom in 3D",sr:"Koristite toÄkiÄ miÅ¡a za zumiranje u 3D prikazu"},{key:"app.zoomShelf",en:"Zoom the shelf view",sr:"Zumiraj prikaz police"},{key:"app.zoomOut",en:"Zoom out",sr:"Umanji prikaz"},{key:"app.zoomIn",en:"Zoom in",sr:"UveÄaj prikaz"},{key:"app.resetZoom",en:"Reset zoom to 100%",sr:"Vrati zum na 100%"},{key:"app.exportStudy",en:"Export for study",sr:"Izvezi za studiju"},{key:"app.exportStudy3dTitle",en:"Switch to 2D or 2.5D view to export for a study",sr:"Prebacite se na 2D ili 2.5D prikaz da biste izvezli za studiju"},{key:"app.exportStudyTitle",en:"Download this planogram as a study file for the Study Builder",sr:"Preuzmite ovaj planogram kao datoteku studije za alat za izradu studija"},{key:"app.sendAnalysis",en:"Submit",sr:"PoÅ¡alji"},{key:"app.statistics",en:"Statistics",sr:"Statistika"},{key:"app.reset",en:"Reset",sr:"Resetuj"},{key:"app.resetConfirm",en:"Start over? This clears the whole plan.",sr:"PoÄeti ispoÄetka? Ovo briÅ¡e ceo plan."},{key:"app.logout",en:"Log out",sr:"Odjavi se"},{key:"app.logoutTitle",en:"Back to the landing page",sr:"Nazad na poÄetnu stranicu"},{key:"app.tour",en:"Tour",sr:"Obilazak"},{key:"app.tourTitle",en:"Replay the guided tour",sr:"Ponovo pokreni voÄeni obilazak"},{key:"app.chooseShelfEmpty",en:"Choose a shelf on the left to start planning.",sr:"Izaberite policu sa leve strane da biste poÄeli planiranje."},{key:"app.removeShelfToast",en:"Release to remove from shelf",sr:"Otpustite da uklonite sa police"},{key:"app.preview3dToast",en:"3D is a preview â switch to 2D or 2.5D to edit the shelf.",sr:"3D je pregled â prebacite se na 2D ili 2.5D da biste ureÄivali policu."},{key:"app.noShelfSpace",en:"Not enough free space on this shelf level for that many facings.",sr:"Na ovom nivou police nema dovoljno slobodnog prostora za toliki broj lica proizvoda."},{key:"app.removeProductConfirm",en:"Remove this product? Any groups of it on the shelf will be removed too.",sr:"Ukloniti ovaj proizvod? BiÄe uklonjene i sve njegove grupe sa police."},{key:"app.noCompetitors",en:"No competitor products available in this catalog view.",sr:"U ovom prikazu kataloga nema dostupnih konkurentskih proizvoda."},{key:"app.sentToast",en:"Planogram submitted successfully.",sr:"Planogram je uspeÅ¡no poslat."},{key:"app.sentLocalFallback",en:"The shared service was unavailable. This planogram was saved only on this device; please try submitting it again later.",sr:"ZajedniÄka usluga nije bila dostupna. Ovaj planogram je saÄuvan samo na ovom ureÄaju; pokuÅ¡ajte ponovo da ga poÅ¡aljete kasnije."},{key:"app.invalidAccessCode",en:'The code "{{code}}" is not active. Enter a valid access code.',sr:"Kod â{{code}}â nije aktivan. Unesite važeÄi pristupni kod."},{key:"app.openingClientSpace",en:"Opening your ShelfLab spaceâ¦",sr:"Otvaramo vaÅ¡ ShelfLab prostorâ¦"},{key:"app.loadingSecureCatalog",en:"Loading your products and client settings securely.",sr:"Bezbedno uÄitavamo vaÅ¡e proizvode i podeÅ¡avanja klijenta."}
40,{key:"app.secureCatalogError",en:"ShelfLab could not connect to the secure catalog. Please try again shortly.",sr:"ShelfLab nije mogao da se poveže sa bezbednim katalogom. PokuÅ¡ajte ponovo uskoro."},{key:"app.defaultSale",en:"SALE!",sr:"AKCIJA!"},{key:"app.defaultBanner",en:"ENERGY WEEK â 2 FOR 1",sr:"ENERGETSKA NEDELJA â 2 ZA 1"},{key:"draft.toolbar",en:"Save / open",sr:"SaÄuvaj / otvori"},{key:"draft.toolbarTitle",en:"Save this planogram online or reopen a saved planogram",sr:"SaÄuvajte ovaj planogram onlajn ili ponovo otvorite saÄuvani planogram"},{key:"draft.title",en:"Saved planograms",sr:"SaÄuvani planogrami"},{key:"draft.description",en:"Saved drafts stay in this client workspace. You can return with the same access code, open a draft and continue editing it. Saving does not count as a submitted try.",sr:"SaÄuvane radne verzije ostaju u prostoru ovog klijenta. Možete se vratiti sa istim pristupnim kodom, otvoriti radnu verziju i nastaviti ureÄivanje. Äuvanje se ne raÄuna kao poslati pokuÅ¡aj."},{key:"draft.defaultTitle",en:"Planogram {{count}}",sr:"Planogram {{count}}"},{key:"draft.namePlaceholder",en:"Planogram name",sr:"Naziv planograma"},{key:"draft.saveCurrent",en:"Save current",sr:"SaÄuvaj trenutni"},{key:"draft.saving",en:"Savingâ¦",sr:"Äuvanjeâ¦"},{key:"draft.saveHint",en:"Choose a shelf and place at least one product before saving.",sr:"Izaberite policu i postavite najmanje jedan proizvod pre Äuvanja."},{key:"draft.loading",en:"Loading saved planogramsâ¦",sr:"UÄitavanje saÄuvanih planogramaâ¦"},{key:"draft.empty",en:"No saved planograms yet.",sr:"JoÅ¡ nema saÄuvanih planograma."},{key:"draft.updated",en:"Updated {{date}}",sr:"Izmenjeno {{date}}"},{key:"draft.open",en:"Open and edit",sr:"Otvori i uredi"},{key:"draft.update",en:"Replace with current",sr:"Zameni trenutnim"},{key:"draft.opened",en:"Opened â{{title}}â. You can continue editing it.",sr:"Otvoren je â{{title}}â. Možete nastaviti ureÄivanje."},{key:"draft.deleteConfirm",en:"Delete saved planogram â{{title}}â?",sr:"Obrisati saÄuvani planogram â{{title}}â?"},{key:"draft.loadError",en:"Could not load saved planograms.",sr:"Nije moguÄe uÄitati saÄuvane planograme."},{key:"draft.saveError",en:"Could not save this planogram.",sr:"Nije moguÄe saÄuvati ovaj planogram."},{key:"draft.deleteError",en:"Could not delete this saved planogram.",sr:"Nije moguÄe obrisati ovaj saÄuvani planogram."},{key:"landing.unknownCode",en:"Unknown code. Check the code from your invitation email and try again.",sr:"Nepoznat kod. Proverite kod iz pozivnog imejla i pokuÅ¡ajte ponovo."},{key:"landing.by",en:"by",sr:"od"},{key:"landing.kicker",en:"Planogram design & biometric validation",sr:"Dizajn planograma i biometrijska validacija"},{key:"landing.heading1",en:"Stop guessing how shoppers react to your product on the shelf.",sr:"Prestanite da nagaÄate kako potroÅ¡aÄi reaguju na vaÅ¡ proizvod na polici."},{key:"landing.heading2",en:"Design, Test and Measure.",sr:"Dizajnirajte, testirajte i izmerite."},{key:"landing.description",en:"Build your ideal retail shelf in minutes â your products, the competition, prices and promo material. Then have it validated with real shopper eye-tracking and surveys, not opinions.",sr:"Napravite idealnu maloprodajnu policu za nekoliko minuta â vaÅ¡i proizvodi, konkurencija, cene i promotivni materijali. Zatim je validirajte sa stvarnim kupcima, praÄenjem pogleda i anketama, a ne miÅ¡ljenjima."},{key:"landing.enterCode",en:"Enter your access code",sr:"Unesite pristupni kod"},{key:"landing.enterSpace",en:"Enter your space",sr:"UÄite u svoj prostor"},{key:"landing.codeHint",en:"Your code is in the invitation you received. One code â your products, your shelf space.",sr:"Kod se nalazi u pozivu koji ste primili. Jedan kod â vaÅ¡i proizvodi, vaÅ¡ prostor na polici."},{key:"landing.chipHardware",en:"Real eye-tracking hardware",sr:"Profesionalna oprema za praÄenje pogleda"},{key:"landing.chipShoppers",en:"Real shoppers, real reactions",sr:"Stvarni kupci, stvarne reakcije"}
40,{key:"landing.chipFixes",en:"Concrete fixes, not 200-page reports",sr:"Konkretna poboljÅ¡anja, ne izveÅ¡taji od 200 strana"},{key:"landing.liveGaze",en:"LIVE GAZE",sr:"PRAÄENJE"},{key:"landing.requestDemo",en:"Request a demo",sr:"Zatražite demo"},{key:"landing.backToXR4MARK",en:"Back to XR4MARK",sr:"Nazad na XR4MARK"},{key:"landing.caption",en:"Your planogram, seen through your shoppers' eyes.",sr:"VaÅ¡ planogram, viÄen oÄima vaÅ¡ih kupaca."},{key:"landing.features.kicker",en:"Your products. Your shelf. Shopper evidence.",sr:"VaÅ¡i proizvodi. VaÅ¡a polica. Uvidi o kupcima."},{key:"landing.features.title",en:"Everything your brand needs to design, review and validate a planogram.",sr:"Sve Å¡to je vaÅ¡em brendu potrebno za dizajn, pregled i validaciju planograma."},{key:"landing.features.intro",en:"Build planograms with your own products, compare them with the competition and validate your decisions with measurable shopper insight.",sr:"Napravite planograme sa sopstvenim proizvodima, uporedite ih sa konkurencijom i validirajte odluke merljivim uvidima o kupcima."},{key:"landing.features.build.title",en:"Design precise planograms",sr:"Dizajnirajte precizne planograme"},{key:"landing.features.build.description",en:"Choose the fixture, add your products and competitors, then adjust facings, depth, names, prices, wobblers and banners directly on the shelf.",sr:"Izaberite regal, dodajte svoje i konkurentske proizvode, a zatim direktno na polici podesite broj lica, dubinu, nazive, cene, voblere i banere."},{key:"landing.features.views.title",en:"Inspect every detail",sr:"Pregledajte svaki detalj"},{key:"landing.features.views.description",en:"Switch between 2D, 2.5D and 3D, rotate the 3D shelf and zoom from 50% to 250% to check labels and price tickets.",sr:"Prebacujte se izmeÄu 2D, 2.5D i 3D prikaza, rotirajte 3D policu i zumirajte od 50% do 250% kako biste proverili etikete i cenovne oznake."},{key:"landing.features.catalog.title",en:"Work with your real product range",sr:"Radite sa svojim stvarnim asortimanom"},{key:"landing.features.catalog.description",en:"Bring in your product photos, names and prices, organize the range by product group or category, and place it beside the real competition.",sr:"Dodajte fotografije, nazive i cene svojih proizvoda, organizujte asortiman po grupi proizvoda ili kategoriji i postavite ga uz stvarnu konkurenciju."},{key:"landing.features.share.title",en:"Use your dedicated workspace",sr:"Koristite svoj namenski prostor"},{key:"landing.features.share.description",en:"Open your ShelfLab space with an access code, follow the guided tour, download snapshots and submit finished planograms for review and testing.",sr:"Otvorite svoj ShelfLab prostor pristupnim kodom, pratite voÄeni obilazak, preuzmite snimke i poÅ¡aljite zavrÅ¡ene planograme na pregled i testiranje."},{key:"landing.features.stats.title",en:"Understand shelf performance",sr:"Razumite performanse police"},{key:"landing.features.stats.description",en:"With statistics-enabled plans, review shelf share, placement quality, on-shelf value, price position and stock coverage before research begins.",sr:"U paketima sa statistikom pregledajte udeo na polici, kvalitet pozicije, vrednost robe, cenovno pozicioniranje i pokrivenost zalihama pre poÄetka istraživanja."},{key:"landing.features.validate.title",en:"Validate your decisions with real shoppers",sr:"Validirajte svoje odluke sa stvarnim kupcima"},{key:"landing.features.validate.description",en:"Turn your approved planogram into an eye-tracking and survey study, then use gaze replays, AOI metrics, heatmaps, attention and answers to improve the shelf.",sr:"Pretvorite odobreni planogram u studiju praÄenja pogleda i anketu, a zatim upotrebite snimke pogleda, AOI metrike, toplotne mape, pažnju i odgovore da unapredite policu."},{key:"landing.demo.kicker",en:"See ShelfLab with your own products",sr:"Pogledajte ShelfLab sa svojim proizvodima"},{key:"landing.demo.title",en:"Request a personalized demo.",sr:"Zatražite personalizovani demo."},{key:"landing.demo.description",en:"Tell us about your products, category and what you want to test. We will show you how your range can be built, compared and validated in ShelfLab.",sr:"Recite nam viÅ¡e o svojim proizvodima, kategoriji i onome Å¡to želite da testirate. PokazaÄemo vam kako vaÅ¡ asortiman može da se napravi, uporedi i validira u ShelfL
40ab-u."},{key:"landing.footer",en:"Biometric consumer research",sr:"Biometrijsko istraživanje potroÅ¡aÄa"},{key:"landing.admin",en:"Admin",sr:"Administracija"},{key:"shelf.gondola90.name",en:"Gondola 90",sr:"Gondola 90"},{key:"shelf.gondola90.desc",en:"Supermarket aisle unit · 90 à 180 cm · 5 levels",sr:"Regal za prolaz u supermarketu · 90 à 180 cm · 5 nivoa"},{key:"shelf.gondola125.name",en:"Gondola 125",sr:"Gondola 125"},{key:"shelf.gondola125.desc",en:"Wide supermarket unit · 125 à 200 cm · 6 levels",sr:"Å iroki regal za supermarket · 125 à 200 cm · 6 nivoa"},{key:"shelf.cooler60.name",en:"Cooler 60",sr:"Rashladni regal 60"},{key:"shelf.cooler60.desc",en:"Gas-station cooler shelf · 60 à 160 cm · 4 levels",sr:"Rashladna polica za benzinsku stanicu · 60 à 160 cm · 4 nivoa"},{key:"shelf.counter60.name",en:"Counter unit",sr:"Pultni regal"},{key:"shelf.counter60.desc",en:"Small-shop countertop display · 60 à 90 cm · 3 levels",sr:"Pultni displej za malu prodavnicu · 60 à 90 cm · 3 nivoa"},{key:"sidebar.dragTitle",en:"Drag onto the shelf",sr:"Prevucite na policu"},{key:"sidebar.removeProductTitle",en:"Remove this product",sr:"Ukloni ovaj proizvod"},{key:"sidebar.chooseShelf",en:"Choose a shelf",sr:"Izaberite policu"},{key:"sidebar.chooseShelfHint",en:"Pick the fixture your client will plan on.",sr:"Izaberite regal na kom Äe klijent planirati."},{key:"sidebar.yourProducts",en:"Your products",sr:"VaÅ¡i proizvodi"},{key:"sidebar.productHint",en:"Drag a can onto a shelf level. It snaps to the shelf; release to place, then set facings and depth.",sr:"Prevucite limenku na nivo police. Automatski se poravnava; otpustite je, zatim podesite broj lica i dubinu."},{key:"sidebar.competitionHint",en:"Auto-fill the remaining space, or drag competitor cans manually. Click any group to tweak price, facings and rows.",sr:"Automatski popunite preostali prostor ili ruÄno prevucite konkurentske limenke. Kliknite na grupu da podesite cenu, broj lica i redove."},{key:"sidebar.randomPopulate",en:"Randomly populate",sr:"NasumiÄno popuni"},{key:"sidebar.clearCompetition",en:"Clear competition",sr:"Ukloni konkurenciju"},{key:"sidebar.yourBrand",en:"Your brand",sr:"VaÅ¡ brend"},{key:"sidebar.noOwnProducts",en:"No own products in this catalog.",sr:"U ovom katalogu nema sopstvenih proizvoda."},{key:"sidebar.noCompetitors",en:"No competitor products in this catalog.",sr:"U ovom katalogu nema konkurentskih proizvoda."},{key:"sidebar.addProduct",en:"Add product (photo, name, price)",sr:"Dodaj proizvod (fotografija, naziv, cena)"},{key:"sidebar.marketingHint",en:"Add promo material, then drag it into position. Click an item to edit its text, shape, color and size.",sr:"Dodajte promotivni materijal, zatim ga prevucite na željeno mesto. Kliknite na element da uredite tekst, oblik, boju i veliÄinu."},{key:"sidebar.addWobbler",en:"Wobbler (SALE tag)",sr:"Vobler (oznaka AKCIJA)"},{key:"sidebar.addBannerH",en:"Horizontal banner",sr:"Horizontalni baner"},{key:"sidebar.addBannerV",en:"Vertical banner",sr:"Vertikalni baner"},{key:"promo.priceLabels",en:"Promotional price labels",sr:"Promotivne oznake cena"},{key:"promo.labelColor",en:"Label color",sr:"Boja oznake"},{key:"promo.priceColor",en:"Price color",sr:"Boja cene"},{key:"promo.modeHint",en:"Choose what to recolor, then click a product on the shelf. The tool stays active so you can style several products.",sr:"Izaberite Å¡ta želite da obojite, zatim kliknite na proizvod na polici. Alat ostaje aktivan kako biste mogli da uredite viÅ¡e proizvoda."},{key:"promo.clickProduct",en:"Now click a product on the shelf. Click Done when you finish.",sr:"Sada kliknite na proizvod na polici. Kliknite na Gotovo kada zavrÅ¡ite."},{key:"promo.done",en:"Done",sr:"Gotovo"},{key:"promo.promotionStyle",en:"Promotion style",sr:"Stil promocije"},{key:"promo.labelDialogTitle",en:"Change label color",sr:"Promenite boju oznake"},{key:"promo.priceDialogTitle",en:"Change price color",sr:"Promenite boju cene"},{key:"promo.labelDialogDescription",en:"Choose a background color for the price label under â{{name}}â.",sr:"Izaberite boju pozadine oznake cene ispod proizvoda â{{name}}â."},{key:"promo.priceDialogDescription",en:"Choose a color for the price shown under â{{name}}â.",sr:"Izaberite boju cene prikazane ispod proizvoda â{{name}}â."},{key:"promo.chooseColor",en:"Choose color",sr:"Izaberite boju"},{key:"promo.hexColor",en:"Hex color value",sr:"Hex vrednost boje"},{key:"promo.presetColors",en:"Preset colors",sr:"Unapred definisane boje"},{key:"promo.resetOriginal",en:"Reset to original",sr:"Vrati original"},{key:"promo.applyColor",en:"Apply color",sr:"Primeni boju"},{key:"promo.labelApplied",en:"Label color applied. Click another product or choose Done.",sr:"Boja oznake je primenjena. Kliknite na drugi proizvod ili izaberite Gotovo."},{key:"promo.priceApplied",en:"Price color applied. Click another product or choose Done.",sr:"Boja cene je primenjena. Kliknite na drugi proizvod ili izaberite Gotovo."},{key:"promo.labelReset",en:"Original label color restored. Click another product or choose Done.",sr:"Originalna boja oznake je vraÄena. Kliknite na drugi proizvod ili izaberite Gotovo."},{key:"promo.priceReset",en:"Original price color restored. Click another product or choose Done.",sr:"Originalna boja cene je vraÄena. Kliknite na drugi proizvod ili izaberite Gotovo."},{key:"product.add",en:"Add product",sr:"Dodaj proizvod"},{key:"product.unknown",en:"Unknown product",sr:"Nepoznat proizvod"},{key:"product.imageError",en:"Could not read that image file.",sr:"Datoteka slike nije mogla da se uÄita."},{key:"product.replacePhoto",en:"Click or drop to replace",sr:"Kliknite ili prevucite da zamenite"},{key:"product.dropPhoto",en:"Drop a product photo here, or click to browse",sr:"Prevucite fotografiju proizvoda ovde ili kliknite za izbor"},{key:"product.name",en:"Product name",sr:"Naziv proizvoda"},{key:"product.namePlaceholder",en:"e.g. VOLT Tropical",sr:"npr. VOLT Tropical"},{key:"product.price",en:"Price",sr:"Cena"},{key:"product.currency",en:"Currency",sr:"Valuta"},{key:"product.ownBrandHint",en:"Own brand (shown in step 1; unchecked = competitor, step 2)",sr:"Sopstveni brend (prikazuje se u koraku 1; neoznaÄeno = konkurencija, korak 2)"},{key:"placement.placeProduct",en:"Place {{name}}",sr:"Postavi {{name}}"},{key:"placement.facings",en:"Facings (cans in a row)",sr:"Broj lica (limenke u redu)"},{key:"placement.extendSide",en:"Extend to which side of the placed can?",sr:"Na koju stranu proÅ¡iriti grupu od postavljene limenke?"},{key:"placement.left",en:"Left",sr:"Levo"},{key:"placement.right",en:"Right",sr:"Desno"},{key:"placement.depth",en:"Depth (rows behind the front row)",sr:"Dubina (redovi iza prednjeg reda)"},{key:"placement.groupName",en:"Group name",sr:"Naziv grupe"},{key:"placement.placeGroup",en:"Place group",sr:"Postavi grupu"},{key:"editor.editGroup",en:"Edit group",sr:"Uredi grupu"},{key:"editor.name",en:"Name",sr:"Naziv"},{key:"editor.facings",en:"Facings",sr:"Broj lica"},{key:"editor.rows",en:"Rows (depth)",sr:"Redovi (dubina)"},{key:"editor.cansTotal",en:"{{count}} cans total · drag the group to move it",sr:"Ukupno {{count}} limenki · prevucite grupu da je pomerite"},{key:"editor.deleteGroup",en:"Delete group",sr:"ObriÅ¡i grupu"},{key:"editor.wobbler",en:"wobbler",sr:"vobler"},{key:"editor.bannerH",en:"horizontal banner",sr:"horizontalni baner"},{key:"editor.bannerV",en:"vertical banner",sr:"vertikalni baner"},{key:"editor.editItem",en:"Edit {{item}}",sr:"Uredi: {{item}}"},{key:"editor.text",en:"Text",sr:"Tekst"},{key:"editor.shape",en:"Shape",sr:"Oblik"},{key:"editor.length",en:"Length (cm)",sr:"Dužina (cm)"},{key:"editor.color",en:"Color",sr:"Boja"},{key:"shape.circle",en:"Circle",sr:"Krug"},{key:"shape.star",en:"Star",sr:"Zvezda"},{key:"shape.burst",en:"Burst",sr:"Eksplozija"},{key:"shape.tag",en:"Tag",sr:"Oznaka"},{key:"shape.arrow",en:"Arrow",sr:"Strelica"},{key:"import.title",en:"Import product-group folder",sr:"Uvezi fasciklu grupe proizvoda"},{key:"import.description",en:"Drop the complete collector output folder. ShelfLab reads
40its manifest, images, market, source links, and prices together.",sr:"Prevucite kompletnu izlaznu fasciklu kolektora. ShelfLab zajedno uÄitava manifest, slike, tržiÅ¡te, linkove izvora i cene."},{key:"import.preparing",en:"Preparing products and imagesâ¦",sr:"Priprema proizvoda i slikaâ¦"},{key:"import.ready",en:"{{count}} products ready",sr:"{{count}} proizvoda je spremno"},{key:"import.summary",en:"{{market}} · {{brands}} brands · collected {{date}}",sr:"{{market}} · {{brands}} brendova · prikupljeno {{date}}"},{key:"import.dropFolder",en:"Drop a ShelfLab product folder here",sr:"Prevucite ShelfLab fasciklu proizvoda ovde"},{key:"import.chooseFolder",en:"or click to choose a folder",sr:"ili kliknite da izaberete fasciklu"},{key:"import.createGroup",en:"Create a new group from this package",sr:"Napravi novu grupu iz ovog paketa"},{key:"import.createCategory",en:"Create a new category from this package",sr:"Napravi novu kategoriju iz ovog paketa"},{key:"import.newCategoryName",en:"New category name",sr:"Naziv nove kategorije"},{key:"import.addUpdate",en:"Add/update in {{name}}",sr:"Dodaj/ažuriraj u grupi {{name}}"},{key:"import.newGroupName",en:"New group name",sr:"Naziv nove grupe"},{key:"import.moreProducts",en:"+ {{count}} more products",sr:"+ joÅ¡ {{count}} proizvoda"},{key:"import.importProducts",en:"Import {{count}} products",sr:"Uvezi {{count}} proizvoda"},{key:"import.readError",en:"Could not read this product package.",sr:"Paket proizvoda nije mogao da se uÄita."},{key:"import.noManifest",en:"This folder does not contain manifest.json.",sr:"Ova fascikla ne sadrži manifest.json."},{key:"import.unsupported",en:"Unsupported ShelfLab product package.",sr:"Nepodržan ShelfLab paket proizvoda."},{key:"import.noMarket",en:"The package has no market/currency definition.",sr:"Paket nema definisano tržiÅ¡te/valutu."},{key:"import.badCount",en:"A package must contain between 1 and 250 products.",sr:"Paket mora da sadrži izmeÄu 1 i 250 proizvoda."},{key:"import.missingImage",en:"Missing image for {{name}}: {{image}}",sr:"Nedostaje slika za {{name}}: {{image}}"},{key:"import.success",en:"Imported {{count}} products into {{group}}.",sr:"Uvezeno je {{count}} proizvoda u grupu {{group}}."},{key:"import.selectedGroup",en:"the selected group",sr:"izabrana grupa"},{key:"analysis.title",en:"Submit this planogram",sr:"PoÅ¡aljite ovaj planogram"},{key:"analysis.description",en:"Submitting saves this planogram as one completed try. Enter your details below to confirm.",sr:"Slanjem se ovaj planogram Äuva kao jedan zavrÅ¡en pokuÅ¡aj. Unesite svoje podatke ispod da biste potvrdili."},{key:"analysis.yourName",en:"Your name",sr:"VaÅ¡e ime"},{key:"analysis.namePlaceholder",en:"Name / company",sr:"Ime / kompanija"},{key:"analysis.email",en:"Email for the results",sr:"Imejl za rezultate"},{key:"analysis.question",en:"What would you like analyzed? (optional)",sr:"Å ta želite da analiziramo? (opciono)"},{key:"analysis.notesPlaceholder",en:"e.g. Does the new can design win attention vs. Nitro Rush at eye level?",sr:"npr. Da li novi dizajn limenke privlaÄi viÅ¡e pažnje od Nitro Rush proizvoda u nivou oÄiju?"},{key:"analysis.clientCode",en:"Submitting as client code: {{code}}",sr:"Slanje pod klijentskim kodom: {{code}}"},{key:"analysis.submit",en:"Submit planogram",sr:"PoÅ¡alji planogram"},{key:"pricing.nav",en:"Pricing",sr:"Cenovnik"},{key:"pricing.kicker",en:"ShelfLab plans",sr:"ShelfLab paketi"},{key:"pricing.title",en:"Choose how you plan",sr:"Izaberite naÄin koriÅ¡Äenja"},{key:"pricing.description",en:"Use a monthly plan for recurring work or pay only for each completed planogram.",sr:"Izaberite meseÄni paket za redovan rad ili platite samo svaki zavrÅ¡eni planogram."},{key:"pricing.close",en:"Close pricing",sr:"Zatvori cenovnik"},{key:"pricing.monthly",en:"Monthly plans",sr:"MeseÄni paketi"},{key:"pricing.recommended",en:"Recommended",sr:"PreporuÄeno"},{key:"pricing.month",en:"month",sr:"mesec"},{key:"pricing.choose",en:"Choose plan",sr:"Izaberi paket"},{key:"pricing.flexible",en:"Flexible option",sr:"Fleksibilna opcija"}
40,{key:"pricing.perPlanogram",en:"Pay per planogram",sr:"PlaÄanje po planogramu"},{key:"pricing.perPlanogramDescription",en:"Pay once for each completed planogram.",sr:"Platite jednokratno za svaki zavrÅ¡eni planogram."},{key:"pricing.perPlanogramProducts",en:"Up to 5 custom products",sr:"Do 5 prilagoÄenih proizvoda"},{key:"pricing.perPlanogramGroups",en:"1 product group",sr:"1 grupa proizvoda"},{key:"pricing.perPlanogramIncluded",en:"Snapshot and statistics included",sr:"Snimak i statistika su ukljuÄeni"},{key:"pricing.perPlanogramUnit",en:"per planogram",sr:"po planogramu"},{key:"pricing.note",en:"Recommended launch pricing. Taxes, billing terms and any final changes are shown before payment.",sr:"PreporuÄene poÄetne cene. Porezi, uslovi naplate i sve konaÄne izmene prikazuju se pre plaÄanja."},{key:"pricing.free.name",en:"Free access",sr:"Besplatan pristup"},{key:"pricing.monthly-starter.name",en:"Starter",sr:"PoÄetni"},{key:"pricing.monthly-starter.planograms",en:"3 planograms per month",sr:"3 planograma meseÄno"},{key:"pricing.monthly-starter.products",en:"Up to 3 custom products",sr:"Do 3 prilagoÄena proizvoda"},{key:"pricing.monthly-starter.groups",en:"1 product group",sr:"1 grupa proizvoda"},{key:"pricing.monthly-starter.statistics",en:"Statistics not included",sr:"Statistika nije ukljuÄena"},{key:"pricing.monthly-pro.name",en:"Pro",sr:"Pro"},{key:"pricing.monthly-pro.planograms",en:"5 planograms per month",sr:"5 planograma meseÄno"},{key:"pricing.monthly-pro.products",en:"Up to 5 custom products",sr:"Do 5 prilagoÄenih proizvoda"},{key:"pricing.monthly-pro.groups",en:"Up to 3 product groups",sr:"Do 3 grupe proizvoda"},{key:"pricing.monthly-pro.statistics",en:"Statistics included",sr:"Statistika je ukljuÄena"},{key:"pricing.monthly-unlimited.name",en:"Company",sr:"Kompanija"},{key:"pricing.monthly-unlimited.planograms",en:"Unlimited planograms",sr:"NeograniÄen broj planograma"},{key:"pricing.monthly-unlimited.products",en:"Unlimited custom products",sr:"NeograniÄen broj prilagoÄenih proizvoda"},{key:"pricing.monthly-unlimited.groups",en:"Up to 5 product groups",sr:"Do 5 grupa proizvoda"},{key:"pricing.monthly-unlimited.statistics",en:"Statistics included",sr:"Statistika je ukljuÄena"},{key:"pricing.extraGroupFee",en:"Each additional product group: â¬100 one-time fee",sr:"Svaka dodatna grupa proizvoda: jednokratno â¬100"},{key:"pricing.categoryFrom",en:"1 product category from â¬1,000",sr:"1 kategorija proizvoda od â¬1.000"},{key:"billing.paymentRequired",en:"Payment required",sr:"Potrebno je plaÄanje"},{key:"billing.paymentDescription",en:"This code uses pay-per-planogram access. Complete payment to submit this planogram.",sr:"Ovaj kod koristi plaÄanje po planogramu. ZavrÅ¡ite uplatu da biste poslali ovaj planogram."},{key:"billing.productsOnPlanogram",en:"{{count}} products on this planogram",sr:"{{count}} proizvoda na ovom planogramu"},{key:"billing.screenshotAfterPayment",en:"Statistics are available now; snapshot download unlocks after confirmed payment and submission.",sr:"Statistika je veÄ dostupna; preuzimanje snimka se otkljuÄava nakon potvrÄene uplate i slanja."},{key:"billing.continuePayment",en:"Continue to secure payment",sr:"Nastavi na bezbedno plaÄanje"},{key:"billing.contactOpened",en:"Payment setup is being finalized. An email to {{email}} has been opened so we can activate this planogram.",sr:"PodeÅ¡avanje plaÄanja je u zavrÅ¡noj fazi. Otvoren je imejl za {{email}} kako bismo aktivirali ovaj planogram."},{key:"billing.checkoutError",en:"Checkout could not start. Please contact {{email}}.",sr:"PlaÄanje nije moglo da se pokrene. Kontaktirajte {{email}}."},{key:"billing.thankYou",en:"Thank you for your feedback.",sr:"Hvala vam na povratnim informacijama."},{key:"billing.freeComplete",en:"For more tries, please contact {{email}}. We will send you a new code for another two planograms.",sr:"Za dodatne pokuÅ¡aje kontaktirajte {{email}}. PoslaÄemo vam novi kod za joÅ¡ dva planograma."},{key:"billing.finish",en:"Finish",sr:"ZavrÅ¡i"},{key:"billing.codeExhausted",en:"This access code has already been used for two planograms. For more tries, contact [email protected].",sr:"Ovaj pristupni kod je veÄ iskoriÅ¡Äen za dva planograma. Za dodatne pokuÅ¡aje kontaktirajte [email protected]."},{key:"billing.changeBeforeResubmit",en:"This planogram was already submitted. Change or reset it before using another try.",sr:"Ovaj planogram je veÄ poslat. Izmenite ga ili resetujte pre koriÅ¡Äenja sledeÄeg pokuÅ¡aja."},{key:"billing.monthlyLimitReached",en:"The monthly planogram limit has been reached.",sr:"Dostignut je meseÄni limit planograma."},{key:"billing.submittedRemaining",en:"Planogram submitted. Remaining tries: {{count}}.",sr:"Planogram je poslat. Preostalo pokuÅ¡aja: {{count}}."}
40,{key:"billing.remainingBadge",en:"Tries left: {{count}}",sr:"Preostalo: {{count}}"},{key:"billing.screenshotLocked",en:"Snapshot download unlocks after this planogram is paid and submitted.",sr:"Preuzimanje snimka se otkljuÄava nakon uplate i slanja ovog planograma."},{key:"billing.statsAfterFirst",en:"Statistics unlock after your first submitted planogram.",sr:"Statistika se otkljuÄava nakon prvog poslatog planograma."},{key:"billing.statsNotIncluded",en:"Statistics are not included in this plan.",sr:"Statistika nije ukljuÄena u ovaj paket."},{key:"billing.customProductLimit",en:"This plan allows up to {{count}} custom products.",sr:"Ovaj paket dozvoljava do {{count}} prilagoÄenih proizvoda."},{key:"stats.title",en:"Shelf statistics",sr:"Statistika police"},{key:"stats.empty",en:"Place products on the shelf to see statistics.",sr:"Postavite proizvode na policu da biste videli statistiku."},{key:"stats.money",en:"Money on the shelf",sr:"Vrednost robe na polici"},{key:"stats.mixedCurrency",en:"This plan mixes {{currencies}}. Currency totals and price index are hidden because adding them would be misleading.",sr:"Ovaj plan koristi viÅ¡e valuta: {{currencies}}. Ukupne vrednosti i indeks cene su skriveni jer bi njihovo sabiranje bilo obmanjujuÄe."},{key:"stats.yours",en:"Yours",sr:"VaÅ¡e"},{key:"stats.cans",en:"{{count}} cans",sr:"{{count}} limenki"},{key:"stats.competition",en:"Competition",sr:"Konkurencija"},{key:"stats.valueShare",en:"{{pct}}% of on-shelf value is yours",sr:"{{pct}}% vrednosti robe na polici pripada vaÅ¡im proizvodima"},{key:"stats.share",en:"Share of shelf",sr:"Udeo na polici"},{key:"stats.facingsShare",en:"Facings share",sr:"Udeo lica proizvoda"},{key:"stats.qualityShare",en:"Quality-adjusted share",sr:"Udeo prilagoÄen kvalitetu pozicije"},{key:"stats.qualityTitle",en:"Facings weighted by shelf zone: eye level counts most, floor least",sr:"Lica proizvoda ponderisana zonom police: nivo oÄiju vredi najviÅ¡e, pod najniže"},{key:"stats.placementScore",en:"Placement quality score",sr:"Ocena kvaliteta pozicije"},{key:"stats.yoursLower",en:"yours",sr:"vaÅ¡e"},{key:"stats.competitionLower",en:"competition",sr:"konkurencija"},{key:"stats.scoreIntro",en:"100 = all facings at eye level.",sr:"100 = sva lica proizvoda su u nivou oÄiju."},{key:"stats.betterYours",en:"You hold the better positions.",sr:"VaÅ¡i proizvodi zauzimaju bolje pozicije."},{key:"stats.betterCompetition",en:"Competition holds better positions â negotiate higher shelves.",sr:"Konkurencija zauzima bolje pozicije â pregovarajte za viÅ¡e nivoe police."},{key:"stats.pricePosition",en:"Price position",sr:"Pozicioniranje cene"},{key:"stats.yourAvg",en:"Your avg price",sr:"VaÅ¡a proseÄna cena"},{key:"stats.competitionAvg",en:"Competition avg",sr:"Prosek konkurencije"},{key:"stats.priceIndex",en:"Price index",sr:"Indeks cene"},{key:"stats.premium",en:"You are priced as premium â make sure placement and promo support it.",sr:"Pozicionirani ste kao premijum â proverite da li pozicija i promocija to podržavaju."},{key:"stats.valuePosition",en:"You are priced below the competition â a value position.",sr:"Cena vam je niža od konkurencije â pozicija povoljne kupovine."},{key:"stats.inLine",en:"You are priced in line with the competition.",sr:"Cena vam je usklaÄena s
40a konkurencijom."},{key:"stats.stock",en:"Stock & replenishment",sr:"Zalihe i dopuna"},{key:"stats.velocity",en:"Expected sales per facing per day",sr:"OÄekivana dnevna prodaja po licu proizvoda"},{key:"stats.dailySell",en:"Your daily sell-through",sr:"VaÅ¡a dnevna prodaja"},{key:"stats.firstEmpty",en:"First empty facing",sr:"Prvo prazno lice proizvoda"},{key:"stats.days",en:"{{count}} days",sr:"{{count}} dana"},{key:"stats.onShelf",en:"{{count}} on shelf",sr:"{{count}} na polici"},{key:"stats.cover",en:"{{count}}d cover",sr:"pokriÄe {{count}} d."},{key:"stats.backroom",en:"To keep the shelf full for a week, hold â{{count}} cans in backroom stock.",sr:"Da bi polica ostala puna nedelju dana, držite â{{count}} limenki u magacinskoj zalihi."},{key:"stats.noOwn",en:"No own products on the shelf yet.",sr:"Na polici joÅ¡ nema sopstvenih proizvoda."},{key:"stats.opportunityTitle",en:"Missing sales opportunity",sr:"PropuÅ¡tena prodajna prilika"},{key:"stats.simulator",en:"Scenario simulator",sr:"Simulator scenarija"},{key:"stats.opportunityIntro",en:"Estimate the demand, sales and gross profit at risk when your shelf is partly empty or completely out of stock.",sr:"Procenite tražnju, prodaju i bruto dobit pod rizikom kada je vaÅ¡a polica delimiÄno prazna ili je proizvod potpuno nestao sa police."},{key:"stats.simulateProduct",en:"Product group to simulate",sr:"Grupa proizvoda za simulaciju"},{key:"stats.productOption",en:"{{name}} · L{{level}} · {{count}} units",sr:"{{name}} · N{{level}} · {{count}} kom."},{key:"stats.onShelfAvailability",en:"On-shelf availability",sr:"Dostupnost na polici"},{key:"stats.availableUnits",en:"{{available}} of {{total}} shelf units available",sr:"Dostupno {{available}} od {{total}} jedinica na polici"},{key:"stats.fullShelf",en:"Full shelf",sr:"Puna polica"},{key:"stats.halfEmpty",en:"Half empty",sr:"Pola prazno"},{key:"stats.fullOos",en:"Fully out of stock",sr:"Potpuno nema na stanju"},{key:"stats.unitsMissing",en:"Units missing from shelf",sr:"Jedinice koje nedostaju na polici"},{key:"stats.expectedProductDemand",en:"Expected product sales / day",sr:"OÄekivana prodaja proizvoda / dan"},{key:"stats.gapDuration",en:"Gap duration (hours)",sr:"Trajanje praznine (sati)"},{key:"stats.demandRecovery",en:"Demand retained by brand",sr:"Tražnja zadržana u brendu"},{key:"stats.demandRecoveryHelp",en:"Share of at-risk demand still retained through a delayed purchase, the same product in another store, or another product from your brand. The 67% default is a research-based brand-owner starting point; adjust it for your category.",sr:"Deo ugrožene tražnje koji se ipak zadržava kroz odloženu kupovinu, isti proizvod u drugoj prodavnici ili drugi proizvod vaÅ¡eg brenda. Podrazumevanih 67% je poÄetna pretpostavka za vlasnika brenda zasnovana na istraživanju; prilagodite je svojoj kategoriji."},{key:"stats.margin",en:"Gross / contribution margin",sr:"Bruto / kontribuciona marža"},{key:"stats.marginHelp",en:"Percentage of the shelf selling price retained after product cost and relevant retail or trade costs. Use contribution margin if that better reflects your real economics.",sr:"Procenat prodajne cene na polici koji ostaje nakon troÅ¡ka proizvoda i relevantnih maloprodajnih ili trgovaÄkih troÅ¡kova. Koristite kontribucionu maržu ako ona bolje odražava vaÅ¡u stvarnu ekonomiku."},{key:"stats.unitsAtRisk",en:"Units at risk",sr:"Ugrožene jedinice"},{key:"stats.missedUnits",en:"Missed brand units",sr:"PropuÅ¡tene jedinice brenda"},{key:"stats.missedSales",en:"Missed sales (shelf price)",sr:"PropuÅ¡tena prodaja (cena na polici)"},{key:"stats.missedProfit",en:"Missed gross profit",sr:"PropuÅ¡tena bruto dobit"},{key:"stats.monthlyEquivalent",en:"If this gap repeats every day: â{{amount}} missed gross profit per month.",sr:"Ako se ova praznina ponavlja svakog dana: â{{amount}} propuÅ¡tene bruto dobiti meseÄno."},{key:"stats.howCalculated",en:"How this estimate is calculated",sr:"Kako se izraÄunava ova procena"},{key:"stats.formulaExplanation",en:"Expected demand à affected time à missing shelf share gives units at risk. Demand retained by your brand is removed to estimate directly missed brand units. A partial gap is estimated proportionally; a full out-of-stock puts all expected demand at risk.",sr:"OÄekivana tražnja à trajanje problema à udeo praznog prostora daje broj ugroženih jedinica. Tražnja koja ostaje u vaÅ¡em brendu oduzima se da b
40i se procenile direktno propuÅ¡tene jedinice brenda. DelimiÄna praznina procenjuje se proporcionalno; potpuni nedostatak proizvoda ugrožava svu oÄekivanu tražnju."},{key:"stats.marginExplanation",en:"Missed gross profit = missed units à shelf price à your margin. This is a scenario estimate, not a sales forecast; actual POS demand produces the best result.",sr:"PropuÅ¡tena bruto dobit = propuÅ¡tene jedinice à cena na polici à vaÅ¡a marža. Ovo je procena scenarija, a ne prognoza prodaje; stvarni POS podaci o tražnji daju najbolji rezultat."},{key:"stats.researchBasis",en:"Research basis: shopper response to retail out-of-stocks",sr:"Osnova istraživanja: reakcije kupaca na nedostatak proizvoda u maloprodaji"},{key:"stats.productsOnShelf",en:"Products on shelf",sr:"Proizvodi na polici"},{key:"stats.facingsShort",en:"f",sr:"l"},{key:"stats.rowsShort",en:"r",sr:"r"},{key:"stats.submitHint",en:"Submit this completed planogram.",sr:"PoÅ¡aljite ovaj zavrÅ¡eni planogram."},{key:"zone.Stretch",en:"Stretch",sr:"Iznad dosega"},{key:"zone.Eye level",en:"Eye level",sr:"Nivo oÄiju"},{key:"zone.Hands",en:"Hands",sr:"Nivo ruku"},{key:"zone.Stoop",en:"Stoop",sr:"Nisko"},{key:"zone.Floor",en:"Floor",sr:"Pod"},{key:"admin.title",en:"Admin · Product catalog",sr:"Administracija · Katalog proizvoda"},{key:"admin.catalog",en:"Catalog",sr:"Katalog"},{key:"admin.clientSharing",en:"Client sharing",sr:"Deljenje sa klijentima"},{key:"admin.submissions",en:"Submissions",sr:"Poslati rezultati"},{key:"admin.exit",en:"Exit admin",sr:"IzaÄi iz administracije"},{key:"admin.categories",en:"Categories",sr:"Kategorije"},{key:"admin.categoryName",en:"Category name",sr:"Naziv kategorije"},{key:"admin.deleteCategory",en:'Delete category "{{name}}" and all its products?',sr:"Obrisati kategoriju â{{name}}â i sve njene proizvode?"},{key:"admin.newCategory",en:"New categoryâ¦",sr:"Nova kategorijaâ¦"},{key:"admin.productGroups",en:"Product groups",sr:"Grupe proizvoda"},{key:"admin.groupName",en:"Group name",sr:"Naziv grupe"},{key:"admin.deleteGroup",en:'Delete group "{{name}}"?',sr:"Obrisati grupu â{{name}}â?"},{key:"admin.newGroup",en:"New groupâ¦",sr:"Nova grupaâ¦"},{key:"admin.selectCategory",en:"Select a category first.",sr:"Prvo izaberite kategoriju."},{key:"admin.deleteProduct",en:"Delete product",sr:"ObriÅ¡i proizvod"},{key:"admin.addProductDrop",en:"Add product (drop a photo)",sr:"Dodaj proizvod (prevucite fotografiju)"},{key:"admin.selectGroup",en:"Select a product group.",sr:"Izaberite grupu proizvoda."},{key:"admin.addProductTo",en:"Add product to {{name}}",sr:"Dodaj proizvod u grupu {{name}}"},{key:"admin.submissionsIntro",en:"Every submitted planogram appears here, organized per client. Download Study JSON to transfer the shelf image and product AOIs into the survey and eye-tracking Study Builder. Saved client drafts do not appear here until the client submits them.",sr:"Svaki poslati planogram pojavljuje se ovde, organizovan po klijentu. Preuzmite Study JSON da prenesete sliku police i AOI oblasti proizvoda u alat za izradu anketa i studija praÄenja pogleda. SaÄuvane radne verzije klijenta ne pojavljuju se ovde dok ih klijent ne poÅ¡alje."},{key:"admin.noSubmissions",en:"No submissions yet.",sr:"JoÅ¡ nema poslatih rezultata."},{key:"admin.loadingSubmissions",en:"Loading shared submissionsâ¦",sr:"UÄitavamo zajedniÄke rezultateâ¦"},{key:"admin.remoteSubmissionsError",en:"Could not load the shared submissions.",sr:"Nije moguÄe uÄitati zajedniÄke rezultate."},{key:"admin.unknownClient",en:"Unknown client ({{code}})",sr:"Nepoznat klijent ({{code}})"},{key:"admin.studioDirect",en:"Studio / direct",sr:"Studio / direktno"},{key:"admin.downloadSnapshot",en:"Download snapshot",sr:"Preuzmi snimak"},{key:"admin.shelfSnapshotAlt",en:"shelf snapshot",sr:"snimak police"},{key:"admin.submissionMeta",en:"{{email}} · {{groups}} product groups · {{marketing}} marketing items",sr:"{{email}} · {{groups}} grupa proizvoda · {{marketing}} marketinÅ¡kih elemenata"},{key:"admin.openPlanner",en:"Open in planner",sr:"Otvori u planeru"},{key:"admin.studyJson",en:"Study JSON",sr:"Study JSON"},{key:"admin.studyJsonTitle",en:"Download the planogram image and product AOIs for the survey and eye-tracking Study Builder",sr:"Preuzmite sliku planograma i AOI oblasti proizvoda za alat za izradu anketa i studija praÄenja pogleda"},{key:"admin.studyJsonUnavailable",en:"This older submission has no stored shelf image. Open it in the planner before preparing a study export.",sr:"Ovaj stariji poslati planogram nema saÄuvanu sliku police. Otvorite ga u planeru pre pripreme izvoza za studiju."},{key:"admin.backupJson",en:"Backup data",sr:"Rezervni podaci"},{key:"admin.backupJsonTitle",en:"Download the raw submission data for backup or troubleshooting",sr:"Preuzmite sirove podatke poslatog planograma za rezervnu kopiju ili reÅ¡avanje problema"},{key:"admin.deleteSubmission",en:"Delete this submission?",sr:"Obrisati ovaj poslati rezultat?"},{key:"admin.sharesIntro",en:"Create the client access code here and select which categories or product groups the client can use. Submitted shelves appear under Submissions, not Client sharing.",sr:"Ovde napravite pristupni kod klijenta i izaberite koje kategorije ili grupe proizvoda klijent može da koristi. Poslati planogrami pojavljuju se u odeljku Poslati rezultati, a ne u Deljenju sa klijentima."},{key:"admin.accessPlan",en:"Access plan",sr:"Paket pristupa"},{key:"admin.planogramsUsed",en:"{{count}} planograms used",sr:"IskoriÅ¡Äeno planograma: {{count}}"}
40,{key:"admin.prepaidCredits",en:"Paid credits",sr:"PlaÄeni krediti"},{key:"admin.resetUsage",en:"Reset usage",sr:"Resetuj koriÅ¡Äenje"},{key:"admin.resetUsageConfirm",en:"Reset all recorded usage for code {{code}}?",sr:"Resetovati svu zabeleženu upotrebu za kod {{code}}?"},{key:"admin.clientName",en:"Client name",sr:"Naziv klijenta"},{key:"admin.code",en:"Code:",sr:"Kod:"},{key:"admin.deleteShare",en:"Delete share",sr:"ObriÅ¡i deljenje"},{key:"admin.deleteShareConfirm",en:"Delete this share?",sr:"Obrisati ovo deljenje?"},{key:"admin.wholeCategory",en:"whole category",sr:"cela kategorija"},{key:"admin.copied",en:"Copied",sr:"Kopirano"},{key:"admin.copyLink",en:"Copy link",sr:"Kopiraj link"},{key:"admin.newClient",en:"New client",sr:"Novi klijent"},{key:"admin.newClientShare",en:"New client share",sr:"Novo deljenje sa klijentom"},{key:"adminGate.checking",en:"Checking secure accessâ¦",sr:"Proveravamo bezbedan pristupâ¦"},{key:"adminGate.loading",en:"Loading the shared catalogâ¦",sr:"UÄitavamo zajedniÄki katalogâ¦"},{key:"adminGate.connecting",en:"Connecting to Firebase.",sr:"Povezivanje sa Firebase sistemom."},{key:"adminGate.signInTitle",en:"Studio sign-in",sr:"Prijava u studio"},{key:"adminGate.signInDescription",en:"Only approved ShelfLab administrators can open the catalog, client sharing and submissions.",sr:"Samo odobreni ShelfLab administratori mogu da otvore katalog, deljenje sa klijentima i poslate rezultate."},{key:"adminGate.signingIn",en:"Signing inâ¦",sr:"Prijavljivanjeâ¦"},{key:"adminGate.continueGoogle",en:"Continue with Google",sr:"Nastavi pomoÄu Google naloga"},{key:"adminGate.approvalTitle",en:"Administrator approval required",sr:"Potrebno je odobrenje administratora"},{key:"adminGate.approvalDescription",en:"Signed in as {{email}}, but this account is not in the Firebase administrator list.",sr:"Prijavljeni ste kao {{email}}, ali ovaj nalog nije na listi Firebase administratora."},{key:"adminGate.googleUser",en:"Google user",sr:"Google korisnik"},{key:"adminGate.approvalHint",en:"Approve this UID in admins/{{uid}} or the verified email in adminEmails/{{email}}, then refresh the page.",sr:"Odobrite ovaj UID u admins/{{uid}} ili verifikovanu adresu u adminEmails/{{email}}, zatim osvežite stranicu."},{key:"adminGate.otherAccount",en:"Use another Google account",sr:"Koristi drugi Google nalog"},{key:"adminGate.return",en:"Return to ShelfLab",sr:"Nazad na ShelfLab"},{key:"adminGate.signInFailed",en:"Google sign-in failed.",sr:"Prijava pomoÄu Google naloga nije uspela."},{key:"adminGate.firebaseUnavailable",en:"Firebase is unavailable. Admin access remains locked.",sr:"Firebase nije dostupan. Administratorski pristup ostaje zakljuÄan."},{key:"adminGate.catalogLoadError",en:"Could not load the Firebase catalog.",sr:"Nije moguÄe uÄitati Firebase katalog."},{key:"adminGate.catalogSaveError",en:"Could not publish catalog changes.",sr:"Nije moguÄe objaviti izmene kataloga."},{key:"tour.aria",en:"ShelfLab guided tour",sr:"ShelfLab voÄeni obilazak"},{key:"tour.quick",en:"Quick tour · {{current}} of {{total}}",sr:"Kratak obilazak · {{current}} od {{total}}"},{key:"tour.welcomeTitle",en:"Welcome to ShelfLab",sr:"Dobro doÅ¡li u ShelfLab"},{key:"tour.welcomeText",en:"This quick tour shows you how to build, inspect, and submit a shelf. You can replay it any time from the Tour button.",sr:"Ovaj kratki obilazak pokazuje kako da napravite, pregledate i poÅ¡aljete policu. Možete ga ponovo pokrenuti u bilo kom trenutku dugmetom Obilazak."},{key:"tour.shelfTitle",en:"Choose and stock the shelf",sr:"Izaberite i popunite policu"},{key:"tour.shelfText",en:"Start by choosing a fixture. Then drag products from this panel onto a shelf level and set their facings, depth, name, and price.",sr:"PoÄnite izborom regala. Zatim prevucite proizvode iz ovog panela na nivo police i podesite broj lica, dubinu, naziv i cenu."},{key:"tour.stepsTitle",en:"Work through three steps",sr:"ProÄite kroz tri koraka"},{key:"tour.stepsText",en:"Add your products first, fill the remaining space with competition, and finish with wobblers or banners.",sr:"Prvo dodajte svoje proizvode, popunite preostali prostor konkurencijom i zavrÅ¡ite voblerima ili banerima."},{key:"tour.arrangeTitle",en:"Arrange the shelf",sr:"Rasporedite policu"},{key:"tour.arrangeText",en:"Drag products and marketing material to reposition them. Click an item to edit it, or drag it outside the shelf to remove it.",sr:"Prevucite proizvode i marketinÅ¡ki materijal da promenite njihov položaj. Kliknite na element da ga uredite ili ga prevucite van police da ga uklonite."},{key:"tour.zoomTitle",en:"Inspect labels closely",sr:"Detaljno pregledajte etikete"},{key:"tour.zoomText",en:"Use â and + to zoom from 50% to 250%. Click the percentage to return to 100%. Ctrl/â-wheel also zooms toward your pointer.",sr:"Koristite â i + za zumiranje od 50% do 250%. Kliknite na procenat da se vratite na 100%. Ctrl/â i toÄkiÄ takoÄe zumiraju prema pokazivaÄu."},{key:"tour.draftsTitle",en:"Save and continue later",sr:"SaÄuvajte i nastavite
40kasnije"},{key:"tour.draftsText",en:"Save a named draft online without consuming a try. Return with the same access code to open, edit or replace any saved planogram.",sr:"SaÄuvajte imenovanu radnu verziju onlajn bez troÅ¡enja pokuÅ¡aja. Vratite se sa istim pristupnim kodom da otvorite, uredite ili zamenite bilo koji saÄuvani planogram."},{key:"tour.reviewTitle",en:"Review and submit",sr:"Pregledajte i poÅ¡aljite"},{key:"tour.reviewText",en:"Submit the finished planogram when it is ready. Statistics availability depends on your access plan.",sr:"PoÅ¡aljite zavrÅ¡eni planogram kada bude spreman. Dostupnost statistike zavisi od vaÅ¡eg paketa pristupa."},{key:"tour.skip",en:"Skip tour",sr:"PreskoÄi obilazak"},{key:"tour.start",en:"Start planning",sr:"PoÄni planiranje"},{key:"shelf3d.hint",en:"3D preview â drag to rotate, scroll to zoom. Switch to 2D / 2.5D to edit.",sr:"3D pregled â prevucite za rotaciju, koristite toÄkiÄ za zumiranje. Prebacite se na 2D / 2.5D za ureÄivanje."}],RM=new Map(AM.map(t=>[t.key,t])),Nx="shelflab-language-v1";function PM(t,e){return e?t.replace(/\{\{(\w+)\}\}/g,(n,i)=>String(e[i]??`{{${i}}}`)):t}const Dx=q.createContext(null);function kM(){try{return localStorage.getItem(Nx)==="sr-Latn"?"sr-Latn":"en"}catch{return"en"}}function NM({children:t}){const[e,n]=q.useState(kM),i=q.useCallback(a=>{n(a);try{localStorage.setItem(Nx,a)}catch{}},[]),r=q.useCallback((a,o)=>{const l=RM.get(a);return PM(l?e==="sr-Latn"?l.sr:l.en:a,o)},[e]);q.useEffect(()=>{document.documentElement.lang=e,document.title=e==="sr-Latn"?"ShelfLab â planiraj · testiraj · prodaj":"ShelfLab â plan · test · sell"},[e]);const s=q.useMemo(()=>({language:e,locale:e==="sr-Latn"?"sr-Latn-RS":"en-US",setLanguage:i,t:r}),[e,i,r]);return c.jsx(Dx.Provider,{value:s,children:t})}function Pt(){const t=q.useContext(Dx);if(!t)throw new Error("useI18n must be used inside LanguageProvider");return t}function eu({dark:t=!1}){const{language:e,setLanguage:n,t:i}=Pt();return c.jsxs("div",{className:`language-switch ${t?"dark":""}`,role:"group","aria-label":i("language.switch"),title:i("language.switch"),children:[c.jsx("button",{className:e==="en"?"on":"","aria-label":i("language.english"),onClick:()=>n("en"),children:"EN"}),c.jsx("button",{className:e==="sr-Latn"?"on":"","aria-label":i("language.serbian"),onClick:()=>n("sr-Latn"),children:"SR"})]})}function DM(t,e){if(e==="This folder does not contain manifest.json.")return t("import.noManifest");if(e==="Unsupported ShelfLab product package.")return t("import.unsupported");if(e==="The package has no market/currency definition.")return t("import.noMarket");if(e==="A package must contain between 1 and 250 products.")return t("import.badCount");const n=/^Missing image for (.*): (.*)$/.exec(e);return n?t("import.missingImage",{name:n[1],image:n[2]}):e}function Lx({p:t}){var n;const e=((n=t.package)==null?void 0:n.shape)??"can";return t.image?c.jsx("div",{className:`mini-can photo shape-${e}`,children:c.jsx("img",{src:t.image,alt:t.name})}):c.jsx("div",{className:`mini-can shape-${e}`,style:{background:`linear-gradient(90deg, ${t.brandColor}, ${t.accentColor} 120%)`},children:c.jsx("span",{style:{color:t.textColor},children:t.name.charAt(0)})})}function LM({p:t,onDragStart:e,onRemove:n}){const{t:i}=Pt();return c.jsxs("div",{className:"product-card",onPointerDown:r=>e(t.id,r),title:i("sidebar.dragTitle"),children:[c.jsx(Lx,{p:t}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsx("div",{className:"pc-name",children:t.name}),c.jsx("div",{className:"pc-price",children:wn(t.defaultPrice,t.currency)})]}),n&&c.jsx("button",{className:"pc-remove",title:i("sidebar.removeProductTitle"),onPointerDown:r=>r.stopPropagation(),onClick:()=>n(t.id),children:"â"})]})}function IM({step:t,hasShelf:e,products:n,onChooseShelf:i,onProductDragStart:r,onRandomCompetition:s,onClearCompetition:a,onAddMarketing:o,priceColorMode:l,onPriceColorModeChange:u,onAddProduct:f,customIds:p,onRemoveProduct:h}){const{t:m}=Pt(),x=(y,g)=>m(`shelf.${y==="gondola-90"?"gondola90":y==="gondola-125"?"gondola125":y==="cooler-60"?"cooler60":"counter60"}.${g}`);if(!e)return c.jsxs("aside",{className:"sidebar","data-tour":"sidebar",children:[c.jsxs("h2",{children:["1 · ",m("sidebar.chooseShelf")]}),c.jsx("p",{className:"hint",children:m("sidebar.chooseShelfHint")}),bx.map(y=>c.jsxs("button",{className:"shelf-card",onClick:()=>i(y.id),children:[c.jsx("div",{className:"sc-name",children:x(y.id,"name")}),c.jsx("div",{className:"sc-desc",children:x(y.id,"desc")})]},y.id))]});if(t===1||t===2){const y=n.filter(v=>v.mine),g=n.filter(v=>!v.mine),d=v=>v.map(b=>c.jsx(LM,{p:b,onDragStart:r,onRemove:p.includes(b.id)?h:void 0},b.id));return c.jsxs("aside",{className:"sidebar","data-tour":"sidebar",children:[c.jsx("h2",{children:t===1?`1 · ${m("sidebar.yourProducts")}`:`2 · ${m("common.competition")}`}),c.jsx("p",{className:"hint",children:m(t===1?"sidebar.productHint":"sidebar.competitionHint")}),t===2&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"btn primary block",onClick:s,children:["ð² ",m("sidebar.randomPopulate")]}),c.jsx("button",{className:"btn block",onClick:a,children:m("sidebar.clearCompetition")}),c.jsx("div",{className:"divider"})]}),c.jsx("h5",{className:"side-sect",children:m("sidebar.yourBrand")}
40),d(y),y.length===0&&c.jsx("p",{className:"hint",children:m("sidebar.noOwnProducts")}),c.jsx("h5",{className:"side-sect",children:m("common.competition")}),d(g),g.length===0&&c.jsx("p",{className:"hint",children:m("sidebar.noCompetitors")}),c.jsxs("button",{className:"btn block dashed",onClick:f,children:["ï¼ ",m("sidebar.addProduct")]})]})}return c.jsxs("aside",{className:"sidebar","data-tour":"sidebar",children:[c.jsxs("h2",{children:["3 · ",m("common.marketing")]}),c.jsx("p",{className:"hint",children:m("sidebar.marketingHint")}),c.jsxs("button",{className:"btn block",onClick:()=>o("wobbler"),children:["â ",m("sidebar.addWobbler")]}),c.jsxs("button",{className:"btn block",onClick:()=>o("banner-h"),children:["â ",m("sidebar.addBannerH")]}),c.jsxs("button",{className:"btn block",onClick:()=>o("banner-v"),children:["â ",m("sidebar.addBannerV")]}),c.jsx("div",{className:"divider"}),c.jsx("h5",{className:"side-sect promo-side-title",children:m("promo.priceLabels")}),c.jsx("p",{className:"hint",children:m(l?"promo.clickProduct":"promo.modeHint")}),c.jsxs("button",{className:`btn block promo-mode-button ${l==="label"?"on":""}`,"aria-pressed":l==="label",onClick:()=>u(l==="label"?null:"label"),children:[c.jsx("span",{className:"promo-button-icon",children:"â°"})," ",m("promo.labelColor")]}),c.jsxs("button",{className:`btn block promo-mode-button ${l==="price"?"on":""}`,"aria-pressed":l==="price",onClick:()=>u(l==="price"?null:"price"),children:[c.jsx("span",{className:"promo-button-icon price",children:"â¬"})," ",m("promo.priceColor")]}),l&&c.jsxs("button",{className:"btn primary block",onClick:()=>u(null),children:["â ",m("promo.done")]})]})}function UM({pending:t,product:e,onConfirm:n,onCancel:i}){const{t:r}=Pt(),[s,a]=q.useState(3),[o,l]=q.useState("right"),[u,f]=q.useState(2),[p,h]=q.useState(e.name),[m,x]=q.useState(e.defaultPrice);return c.jsx("div",{className:"modal-backdrop",onClick:i,children:c.jsxs("div",{className:"modal",onClick:y=>y.stopPropagation(),children:[c.jsx("h3",{children:r("placement.placeProduct",{name:e.name})}),c.jsxs("label",{children:[r("placement.facings"),c.jsx("input",{type:"number",min:1,max:20,value:s,onChange:y=>a(Math.max(1,Number(y.target.value)||1))})]}),c.jsxs("label",{children:[r("placement.extendSide"),c.jsxs("div",{className:"seg",children:[c.jsxs("button",{className:o==="left"?"on":"",onClick:()=>l("left"),children:["â ",r("placement.left")]}),c.jsxs("button",{className:o==="right"?"on":"",onClick:()=>l("right"),children:[r("placement.right")," â"]})]})]}),c.jsxs("label",{children:[r("placement.depth"),c.jsx("input",{type:"number",min:1,max:6,value:u,onChange:y=>f(Math.max(1,Number(y.target.value)||1))})]}),c.jsxs("label",{children:[r("placement.groupName"),c.jsx("input",{type:"text",value:p,onChange:y=>h(y.target.value)})]}),c.jsxs("label",{children:[r("product.price")," (",e.currency??"EUR",")",c.jsx("input",{type:"number",step:.01,min:0,value:m,onChange:y=>x(Number(y.target.value)||0)})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{className:"btn",onClick:i,children:r("common.cancel")}),c.jsx("button",{className:"btn primary",onClick:()=>n({facings:s,side:o,rows:u,name:p,price:m}),children:r("placement.placeGroup")})]})]})})}const FM=[{id:"circle",icon:"â",key:"shape.circle"},{id:"star",icon:"â
",key:"shape.star"},{id:"burst",icon:"â¹",key:"shape.burst"},{id:"tag",icon:"ð·",key:"shape.tag"},{id:"arrow",icon:"â",key:"shape.arrow"}];function OM({group:t,onChange:e,onDelete:n,onClose:i}){const{t:r}=Pt();return c.jsxs("div",{className:"editor-panel",children:[c.jsxs("div",{className:"ep-head",children:[c.jsx("h3",{children:r("editor.editGroup")}),c.jsx("button",{className:"icon-btn",onClick:i,children:"â"})]}),c.jsxs("label",{children:[r("editor.name"),c.jsx("input",{type:"text",value:t.name,onChange:s=>e({name:s.target.value})})]}),c.jsxs("label",{children:[r("product.price")," (",t.currency??"EUR",")",c.jsx("input",{type:"number",step:.01,min:0,value:t.price,onChange:s=>e({price:Number(s.target.value)||0})})]}),c.jsxs("label",{children:[r("editor.facings"),c.jsx("input",{type:"number",min:1,max:20,value:t.facings,onChange:s=>e({facings:Math.max(1,Number(s.target.value)||1)})})]}),c.jsxs("label",{children:[r("editor.rows"),c.jsx("input",{type:"number",min:1,max:6,value:t.rows,onChange:s=>e({rows:Math.max(1,Number(s.target.value)||1)})})]}),c.jsx("p",{className:"hint",children:r("editor.cansTotal",{count:t.facings*t.rows})}),c.jsx("button",{className:"btn danger block",onClick:n,children:r("editor.deleteGroup")})]})}
40const zM=["#e02020","#f2994a","#f2c94c","#27ae60","#2f80ed","#9b51e0","#111827"];function jM({item:t,onChange:e,onDelete:n,onClose:i}){const{t:r}=Pt(),s=t.kind==="wobbler"?r("editor.wobbler"):t.kind==="banner-h"?r("editor.bannerH"):r("editor.bannerV");return c.jsxs("div",{className:"editor-panel",children:[c.jsxs("div",{className:"ep-head",children:[c.jsx("h3",{children:r("editor.editItem",{item:s})}),c.jsx("button",{className:"icon-btn",onClick:i,children:"â"})]}),c.jsxs("label",{children:[r("editor.text"),c.jsx("input",{type:"text",value:t.text,onChange:a=>e({text:a.target.value})})]}),t.kind==="wobbler"&&c.jsxs("label",{children:[r("editor.shape"),c.jsx("div",{className:"shape-picker",children:FM.map(a=>c.jsxs("button",{className:`btn small ${(t.shape??"circle")===a.id?"on":""}`,onClick:()=>e({shape:a.id}),children:[a.icon," ",r(a.key)]},a.id))})]}),t.kind!=="wobbler"&&c.jsxs("label",{children:[r("editor.length"),c.jsx("input",{type:"number",min:10,max:300,value:t.lengthCm,onChange:a=>e({lengthCm:Math.max(10,Number(a.target.value)||10)})})]}),c.jsxs("label",{children:[r("editor.color"),c.jsx("div",{className:"swatches",children:zM.map(a=>c.jsx("button",{className:`swatch ${t.color===a?"on":""}`,style:{background:a},onClick:()=>e({color:a})},a))})]}),c.jsx("button",{className:"btn danger block",onClick:n,children:r("common.delete")})]})}async function BM(t){return Ix(t,{aspectRatio:180/396,fit:"cover"})}async function Ix(t,e={}){const n=await new Promise((d,v)=>{const b=new FileReader;b.onload=()=>d(String(b.result)),b.onerror=()=>v(new Error("could not read file")),b.readAsDataURL(t)}),i=new Image;await new Promise((d,v)=>{i.onload=()=>d(),i.onerror=()=>v(new Error("not a valid image")),i.src=n});const r=400,s=Math.max(64,Math.min(360,Math.round(r*(e.aspectRatio??i.width/Math.max(1,i.height))))),a=document.createElement("canvas");a.width=s,a.height=r;const o=a.getContext("2d"),l=(e.fit??"contain")==="cover"?Math.max(s/i.width,r/i.height):Math.min(s/i.width,r/i.height),u=i.width*l,f=i.height*l;o.drawImage(i,(s-u)/2,(r-f)/2,u,f),(e.fit??"contain")==="contain"&&(GM(o,s,r),HM(o,s,r),VM(o,s,r));const p=o.getImageData(0,0,s,r).data;let h=0,m=0,x=0,y=0;for(let d=0;d<p.length;d+=40)p[d+3]<32||(h+=p[d],m+=p[d+1],x+=p[d+2],y++);const g=y>0?`#${[h,m,x].map(d=>Math.round(d/y).toString(16).padStart(2,"0")).join("")}`:"#9aa0a6";return{dataUrl:a.toDataURL("image/webp",.86),avgColor:g}}function GM(t,e,n){const i=t.getImageData(0,0,e,n),r=i.data,s=new Uint8Array(e*n),a=[],o=u=>{const f=u*4,p=r[f],h=r[f+1],m=r[f+2],x=Math.min(p,h,m),y=Math.max(p,h,m);return r[f+3]===0||x>218&&y-x<34},l=u=>{s[u]||!o(u)||(s[u]=1,a.push(u))};for(let u=0;u<e;u++)l(u),l((n-1)*e+u);for(let u=0;u<n;u++)l(u*e),l(u*e+e-1);for(let u=0;u<a.length;u++){const f=a[u],p=f%e,h=Math.floor(f/e);r[f*4+3]=0,p>0&&l(f-1),p+1<e&&l(f+1),h>0&&l(f-e),h+1<n&&l(f+e)}t.putImageData(i,0,0)}function HM(t,e,n){const i=t.getImageData(0,0,e,n),r=i.data;for(let s=0;s<2;s++){const a=new Uint8Array(e*n);for(let o=0;o<a.length;o++)a[o]=r[o*4+3];for(let o=1;o+1<n;o++)for(let l=1;l+1<e;l++){const u=o*e+l;if(a[u]===0)continue;const f=u*4,p=Math.min(r[f],r[f+1],r[f+2]),h=Math.max(r[f],r[f+1],r[f+2]);if(p<205||h-p>=40)continue;(a[u-1]===0||a[u+1]===0||a[u-e]===0||a[u+e]===0)&&(r[f+3]=0)}}t.putImageData(i,0,0)}function VM(t,e,n){const r=t.getImageData(0,0,e,n).data;let s=e,a=n,o=-1,l=-1;for(let y=0;y<n;y++)for(let g=0;g<e;g++)r[(y*e+g)*4+3]<24||(s=Math.min(s,g),a=Math.min(a,y),o=Math.max(o,g),l=Math.max(l,y));if(o<s||l<a)return;const u=o-s+1,f=l-a+1,p=document.createElement("canvas");p.width=u,p.height=f,p.getContext("2d").putImageData(t.getImageData(s,a,u,f),0,0);const h=Math.min(e*.98/u,n*.99/f),m=u*h,x=f*h;t.clearRect(0,0,e,n),t.drawImage(p,(e-m)/2,n-x,m,x)}function Ux({title:t,defaultMine:e=!0,showMineToggle:n=!0,onConfirm:i,onCancel:r}){const{t:s}=Pt(),[a,o]=q.useState(""),[l,u]=q.useState(1.99),[f,p]=q.useState("EUR"),[h,m]=q.useState(e),[x,y]=q.useState(null),[g,d]=q.useState("#5f6672"),[v,b]=q.useState(!1),[M,E]=q.useState(!1),w=q.useCallback(async A=>{b(!0);try{const{dataUrl:_,avgColor:T}=await BM(A);y(_),d(T)}catch{alert(s("product.imageError"))}finally{b(!1)}},[s]);return c.jsx("div",{className:"modal-backdrop",onClick:r,children:c.jsxs("div",{className:"modal",onClick:A=>A.stopPropagation(),children:[c.jsx("h3",{children:t??s("product.add")}),c.jsxs("div",{className:`dropzone ${M?"over":""}`,onDragOver:A=>{A.preventDefault(),E(!0)},onDragLeave:()=>E(!1),onDrop:A=>{A.preventDefault(),E(!1);const _=A.dataTransfer.files[0];_&&w(_)},onClick:()=>{var A;
40return(A=document.getElementById("apm-file"))==null?void 0:A.click()},children:[x?c.jsxs("div",{className:"dz-preview",children:[c.jsxs("div",{className:"can-preview",children:[c.jsx("img",{src:x,alt:s("product.name")}),c.jsx("div",{className:"can-shine"})]}),c.jsx("span",{className:"hint",children:s("product.replacePhoto")})]}):c.jsx("span",{children:v?s("common.processing"):`ð· ${s("product.dropPhoto")}`}),c.jsx("input",{id:"apm-file",type:"file",accept:"image/*",hidden:!0,onChange:A=>{var T;const _=(T=A.target.files)==null?void 0:T[0];_&&w(_)}})]}),c.jsxs("label",{children:[s("product.name"),c.jsx("input",{type:"text",value:a,onChange:A=>o(A.target.value),placeholder:s("product.namePlaceholder")})]}),c.jsxs("div",{className:"form-row",children:[c.jsxs("label",{children:[s("product.price"),c.jsx("input",{type:"number",step:.01,min:0,value:l,onChange:A=>u(Number(A.target.value)||0)})]}),c.jsxs("label",{children:[s("product.currency"),c.jsxs("select",{value:f,onChange:A=>p(A.target.value),children:[c.jsx("option",{value:"EUR",children:"EUR"}),c.jsx("option",{value:"RSD",children:"RSD"}),c.jsx("option",{value:"USD",children:"USD"}),c.jsx("option",{value:"GBP",children:"GBP"})]})]})]}),n&&c.jsxs("label",{className:"check",children:[c.jsx("input",{type:"checkbox",checked:h,onChange:A=>m(A.target.checked)})," ",s("product.ownBrandHint")]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{className:"btn",onClick:r,children:s("common.cancel")}),c.jsx("button",{className:"btn primary",disabled:!a.trim(),onClick:()=>i({id:wi(),name:a.trim(),brandColor:g,accentColor:"#ffffff",textColor:"#ffffff",defaultPrice:l,currency:f,mine:h,image:x??void 0}),children:s("product.add")})]})]})})}function Jm(t,e){const n=document.createElement("a");n.href=t,n.download=e,n.click()}const Fx="shelf-planner-submissions-v1";function Ox(){try{const t=localStorage.getItem(Fx);if(t)return JSON.parse(t)}catch{}return[]}function zx(t){try{localStorage.setItem(Fx,JSON.stringify(t))}catch(e){console.warn("submissions too large for localStorage",e)}}function WM(t,e){const n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=e,r.click(),URL.revokeObjectURL(i)}function ao(t){return t.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\//,"")}function XM(t){return new Promise((e,n)=>{const i=new FileReader;i.onload=()=>e(String(i.result)),i.onerror=()=>n(new Error(`Could not read ${t.name}`)),i.readAsText(t)})}function jx(t){return Array.from(t).map(e=>({file:e,path:ao(e.webkitRelativePath||e.name)}))}async function Bx(t){if(t.isFile&&t.file){const i=await new Promise((r,s)=>t.file(r,s));return[{file:i,path:ao(t.fullPath||i.name)}]}if(!t.isDirectory||!t.createReader)return[];const e=t.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>e.readEntries(r,s));if(i.length===0)break;n.push(...i)}return(await Promise.all(n.map(Bx))).flat()}async function $M(t){const e=Array.from(t.items).flatMap(n=>{var r;const i=(r=n.webkitGetAsEntry)==null?void 0:r.call(n);return i?[i]:[]});return e.length>0?(await Promise.all(e.map(Bx))).flat():jx(t.files)}async function YM(t){var s,a,o,l,u;const e=t.find(f=>ao(f.path).endsWith("/manifest.json"))??t.find(f=>f.file.name==="manifest.json");if(!e)throw new Error("This folder does not contain manifest.json.");const n=JSON.parse(await XM(e.file));if(n.schemaVersion!==1||n.packageType!=="shelflab-product-group"||!Array.isArray(n.products))throw new Error("Unsupported ShelfLab product package.");if(!((s=n.market)!=null&&s.code)||!((a=n.market)!=null&&a.currency))throw new Error("The package has no market/currency definition.");if(n.products.length===0||n.products.length>250)throw new Error("A package must contain between 1 and 250 products.");const i=new Map(t.map(f=>[ao(f.path),f.file])),r=[];for(const f of n.products){const p=ao(f.image),h=i.get(p)??((o=[...i.entries()].find(([g])=>g.endsWith(`/${p}`)))==null?void 0:o[1]);if(!h)throw new Error(`Missing image for ${f.name}: ${f.image}`);const m=(l=f.package)!=null&&l.widthCm&&((u=f.package)!=null&&u.heightCm)?f.package.widthCm/f.package.heightCm:void 0,{dataUrl:x,avgColor:y}=await Ix(h,{aspectRatio:m,fit:"contain"});r.push({...f,id:f.id||`import-${crypto.randomUUID()}
40`,name:f.name.trim(),defaultPrice:Number(f.defaultPrice)||0,currency:f.currency||n.market.currency,market:f.market||n.market.code,brandColor:f.brandColor||y,accentColor:f.accentColor||"#ffffff",textColor:f.textColor||"#ffffff",image:x})}return{manifest:n,products:r}}function KM({catalog:t,initialCategoryId:e,initialGroupId:n,onConfirm:i,onCancel:r}){var R;const{t:s,locale:a}=Pt(),[o,l]=q.useState(null),[u,f]=q.useState(e??((R=t.categories[0])==null?void 0:R.id)??""),[p,h]=q.useState(""),[m,x]=q.useState(n??"__new__"),[y,g]=q.useState(""),[d,v]=q.useState(!1),[b,M]=q.useState(!1),[E,w]=q.useState(null),A=t.categories.find(D=>D.id===u),_=(A==null?void 0:A.groups)??[],T=o?`${o.manifest.market.name} (${o.manifest.market.code}) · ${o.manifest.market.currency}`:"",N=q.useMemo(()=>o?new Set(o.products.map(D=>D.brand).filter(Boolean)).size:0,[o]),L=async D=>{M(!0),w(null);try{const F=await YM(D);l(F),g(F.manifest.groupName),h(F.manifest.categoryName),t.categories.some(k=>k.name.toLocaleLowerCase()===F.manifest.categoryName.toLocaleLowerCase())||(f("__new__"),x("__new__"))}catch(F){l(null),w(F instanceof Error?DM(s,F.message):s("import.readError"))}finally{M(!1)}};return c.jsx("div",{className:"modal-backdrop",onClick:r,children:c.jsxs("div",{className:"modal import-modal",onClick:D=>D.stopPropagation(),children:[c.jsx("h3",{children:s("import.title")}),c.jsx("p",{className:"hint",children:s("import.description")}),c.jsxs("div",{className:`package-dropzone ${d?"over":""}`,onDragOver:D=>{D.preventDefault(),v(!0)},onDragLeave:()=>v(!1),onDrop:D=>{D.preventDefault(),v(!1),$M(D.dataTransfer).then(L)},onClick:()=>{var D;return(D=document.getElementById("package-folder-input"))==null?void 0:D.click()},children:[b?c.jsx("strong",{children:s("import.preparing")}):o?c.jsxs(c.Fragment,{children:[c.jsxs("strong",{children:["â ",s("import.ready",{count:o.products.length})]}),c.jsx("span",{children:s("import.summary",{market:T,brands:N,date:new Date(o.manifest.collectedAt).toLocaleDateString(a)})})]}):c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:s("import.dropFolder")}),c.jsx("span",{children:s("import.chooseFolder")})]}),c.jsx("input",{id:"package-folder-input",type:"file",multiple:!0,hidden:!0,webkitdirectory:"",directory:"",onCh
40ange:D=>D.target.files&&void L(jx(D.target.files))})]}),E&&c.jsx("p",{className:"code-error",children:E}),o&&c.jsxs("div",{className:"import-targets",children:[c.jsxs("label",{children:[s("common.category"),c.jsxs("select",{value:u,onChange:D=>{f(D.target.value),x("__new__")},children:[c.jsx("option",{value:"__new__",children:s("import.createCategory")}),t.categories.map(D=>c.jsx("option",{value:D.id,children:D.name},D.id))]})]}),u==="__new__"&&c.jsxs("label",{children:[s("import.newCategoryName"),c.jsx("input",{value:p,onChange:D=>h(D.target.value)})]}),c.jsxs("label",{children:[s("common.productGroup"),c.jsxs("select",{value:m,onChange:D=>x(D.target.value),children:[c.jsx("option",{value:"__new__",children:s("import.createGroup")}),_.map(D=>c.jsx("option",{value:D.id,children:s("import.addUpdate",{name:D.name})},D.id))]})]}),m==="__new__"&&c.jsxs("label",{children:[s("import.newGroupName"),c.jsx("input",{value:y,onChange:D=>g(D.target.value)})]}),c.jsxs("div",{className:"import-preview-list",children:[o.products.slice(0,6).map(D=>c.jsxs("div",{className:"import-preview-product",children:[D.image&&c.jsx("img",{src:D.image,alt:""}),c.jsx("span",{children:D.name}),c.jsxs("strong",{children:[D.defaultPrice.toFixed(2)," ",D.currency]})]},D.id)),o.products.length>6&&c.jsx("div",{className:"hint",children:s("import.moreProducts",{count:o.products.length-6})})]})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{className:"btn",onClick:r,children:s("common.cancel")}),c.jsx("button",{className:"btn primary",disabled:!o||!u||u==="__new__"&&!p.trim()||m==="__new__"&&!y.trim(),onClick:()=>o&&i({categoryId:u==="__new__"?null:u,categoryName:p.trim(),groupId:m==="__new__"?null:m,groupName:y.trim(),products:o.products}),children:s("import.importProducts",{count:(o==null?void 0:o.products.length)??""})})]})]})})}const Yl={free:{id:"free",monthlyPriceEur:0,planogramLimit:2,limitPeriod:"total",customProductLimit:null,statistics:"after-first-submit"},"monthly-starter":{id:"monthly-starter",monthlyPriceEur:49,planogramLimit:3,limitPeriod:"month",customProductLimit:3,statistics:"never"},"monthly-pro":{id:"monthly-pro",monthlyPriceEur:99,planogramLimit:5,limitPeriod:"month",customProductLimit:5,statistics:"always"},"monthly-unlimited":{id:"monthly-unlimited",monthlyPriceEur:300,planogramLimit:null,limitPeriod:null,customProductLimit:null,statistics:"always"},"per-planogram":{id:"per-planogram",monthlyPriceEur:null,planogramLimit:null,limitPeriod:null,customProductLimit:5,statistics:"always"}},Gx=29,op="shelflab-code-usage-v1";function lp(){try{const t=localStorage.getItem(op);if(t)return JSON.parse(t)}catch{}return{}}function cp(t){return(t==null?void 0:t.trim().toUpperCase())??""}function Hx(t){const e=cp(t),n=lp()[e];return n?{...n,submissions:n.submissions??[]}:{code:e,submissions:[]}}function qM(t){const e=lp();e[cp(t.code)]=t,localStorage.setItem(op,JSON.stringify(e))}function ZM(t){const e=lp();delete e[cp(t)],localStorage.setItem(op,JSON.stringify(e))}function Oo(t){return Yl[t??"free"]}function Qm(t){const e=typeof t=="string"?new Date(t):t;return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}`}function JM(t,e=new Date){const n=Qm(e);return t.submissions.filter(i=>Qm(i.date)===n).length}function Vx(t,e){return Oo(t).limitPeriod==="month"?JM(e):e.submissions.length}function pf(t,e){const n=Oo(t);return n.planogramLimit===null?null:Math.max(0,n.planogramLimit-Vx(t,e))}function Wx(t,e){return pf(t,e)===0}function QM(t,e){return Oo(t).limitPeriod==="total"&&Wx(t,e)}function eE(t,e){const n=Oo(t).statistics;return n==="always"||n==="after-first-submit"&&e.submissions.length>0}function tE(t,e){const n={...t,submissions:[...t.submissions,e]};return qM(n),n}function nE(t,e){return t.submissions.some(n=>n.signature===e)}function iE(t,e){return t.submissions.some(n=>n.signature===e&&n.paid)}function eg(){return Gx}function rE(t){const e=JSON.stringify({shelfId:t.shelfId,groups:t.groups,marketing:t.marketing,customProducts:t.customProducts.map(({id:i,name:r,defaultPrice:s,currency:a,mine:o})=>
40({id:i,name:r,defaultPrice:s,currency:a,mine:o}))});let n=2166136261;for(let i=0;i<e.length;i++)n^=e.charCodeAt(i),n=Math.imul(n,16777619);return(n>>>0).toString(36)}const Xa="firestore-asset:",sE=4e3,up="https://firestore.googleapis.com/v1/projects/shelflab-xr4mark/databases/(default)/documents",aE=65e4;let mf=new Set,gf=new Set,Iu=Promise.resolve();const oE=t=>new Promise(e=>setTimeout(e,t));function vi(){var t,e,n,i;return!!((e=(t=window.firebase)==null?void 0:t.apps)!=null&&e.length&&((n=window.firebase)!=null&&n.firestore)&&((i=window.firebase)!=null&&i.auth))}async function gs(){if(vi())return!0;const t=Date.now()+sE;for(;Date.now()<t;)if(await oE(100),vi())return!0;return!1}function rn(){if(!vi())throw new Error("Firebase is not configured on this host.");return window.firebase.firestore()}function lE(t){return t.trim().toUpperCase()}async function Xx(t){const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e);return[...new Uint8Array(n)].map(i=>i.toString(16).padStart(2,"0")).join("")}async function Ma(t){return Xx(`shelflab-access-v1:${lE(t)}`)}function tg(t,e){return{...t,categories:t.categories.map(n=>({...n,groups:n.groups.map(i=>({...i,products:i.products.map(e)}))}))}}async function cE(t){const e=new Map,n=new Map,i=await Promise.all(t.categories.map(async r=>({...r,groups:await Promise.all(r.groups.map(async s=>({...s,products:await Promise.all(s.products.map(async a=>{var u;if(!((u=a.image)!=null&&u.startsWith("data:")))return a;let o=n.get(a.image);o||(o=Xx(a.image).then(f=>`img-${f}`),n.set(a.image,o));const l=await o;return e.set(l,a.image),{...a,image:`${Xa}${l}`}}))})))})));return{catalog:{...t,categories:i},assets:e}}async function $x(t,e){const n=new Set;tg(t,r=>{var s;return(s=r.image)!=null&&s.startsWith(Xa)&&n.add(r.image.slice(Xa.length)),r});const i=new Map;return await Promise.all([...n].map(async r=>{const s=await e(r);s&&(i.set(r,s),mf.add(r))})),tg(t,r=>{var a;const s=(a=r.image)!=null&&a.startsWith(Xa)?r.image.slice(Xa.length):null;return{...r,image:s?i.get(s):r.image}})}async function Yx(t){return $x(t,async e=>{var r;const n=await rn().collection("assets").doc(e).get(),i=n.exists?(r=n.data())==null?void 0:r.dataUrl:null;return typeof i=="string"?i:null})}function vf(t){return!t||typeof t!="object"?null:"stringValue"in t?t.stringValue:"booleanValue"in t?t.booleanValue:"integerValue"in t?Number(t.integerValue):"doubleValue"in t?Number(t.doubleValue):"nullValue"in t?null:"timestampValue"in t?t.timestampValue:"arrayValue"in t?(t.arrayValue.values??[]).map(vf):"mapValue"in t?Object.fromEntries(Object.entries(t.mapValue.fields??{}).map(([e,n])=>[e,vf(n)])):null}async function Rc(t){const e=await fetch(`${up}/${t}`);if(e.status===404)return null;if(!e.ok)throw new Error(`Secure catalog request failed (${e.status}).`);const n=await e.json();return Object.fromEntries(Object.entries(n.fields??{}).map(([i,r])=>[i,vf(r)]))}function xf(t){return t==null?{nullValue:null}:typeof t=="string"?{stringValue:t}:typeof t=="boolean"?{booleanValue:t}:typeof t=="number"?Number.isInteger(t)?{integerValue:String(t)}:{doubleValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(xf)}}:typeof t=="object"?{mapValue:{fields:Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>[e,xf(n)]))}}:{nullValue:null}}async function Pc(t,e){const n=await fetch(`${up}/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fields:Object.fromEntries(Object.entries(e).map(([i,r])=>[i,xf(r)]))})});if(!n.ok)throw new Error(`Draft save failed (${n.status}).`)}async function uE(t){const e=await fetch(`${up}/${t}`,{method:"DELETE"});if(!e.ok&&e.status!==404)throw new Error(`Draft deletion failed (${e.status}).`)}function dE(t,e){return{categories:t.categories.map(i=>{const r=e.categoryIds.includes(i.id),s=i.groups.filter(a=>r||e.groupIds.includes(a.id));return{...i,groups:s}}).filter(i=>i.groups.length>0),shares:[e]}}async function fE(t){var i,r;const e=await Ma(t);if(vi()){const s=await rn().collection("clientViews").doc(e).get();if(!s.exists||((i=s.data())==null?void 0:i.active)!==!0)return null;const a=(r=s.data())==null?void 0:r.catalog;return a?Yx(a):null}const n=await Rc(`clientViews/${e}`);return!n||n.active!==!0||!n.catalog?null:$x(n.catalog,async s=>{const a=await Rc(`assets/${s}`);
40return typeof(a==null?void 0:a.dataUrl)=="string"?a.dataUrl:null})}async function hE(){if(!await gs())return null;const t=await rn().collection("catalog").doc("state").get();if(!t.exists)return null;const e=t.data();return gf=new Set(Array.isArray(e==null?void 0:e.publishedHashes)?e.publishedHashes:[]),e!=null&&e.catalog?Yx(e.catalog):null}async function pE(t){if(!await gs())throw new Error("Firebase is not available; catalog changes were not published.");const e=rn(),n=await cE(t);for(const[o,l]of n.assets)if(!mf.has(o)){if(l.length>9e5)throw new Error("One product image is too large for the Spark/Firestore asset limit.");await e.collection("assets").doc(o).set({dataUrl:l,contentType:l.slice(5,l.indexOf(";"))||"image/webp",updatedAt:new Date().toISOString()}),mf.add(o)}const i=n.catalog.shares.filter(o=>o.active!==!1),r=await Promise.all(i.map(o=>Ma(o.code))),s=new Set(r),a=e.batch();i.forEach((o,l)=>{a.set(e.collection("clientViews").doc(r[l]),{active:!0,label:o.label,catalog:dE(n.catalog,o),updatedAt:new Date().toISOString()})});for(const o of gf)s.has(o)||a.delete(e.collection("clientViews").doc(o));a.set(e.collection("catalog").doc("state"),{catalog:n.catalog,publishedHashes:r,updatedAt:new Date().toISOString()}),await a.commit(),gf=s}function ng(t){return Iu=Iu.catch(()=>{}).then(()=>pE(t)),Iu}function mE(t){return vi()?window.firebase.auth().onAuthStateChanged(t):()=>{}}async function gE(){if(!await gs())throw new Error("Firebase Authentication is not available.");const t=new window.firebase.auth.GoogleAuthProvider,e=window.firebase.auth();await e.setPersistence(window.firebase.auth.Auth.Persistence.LOCAL),await e.signInWithRedirect(t)}async function vE(){vi()&&await window.firebase.auth().signOut()}async function xE(t,e){return await gs()?(await rn().collection("admins").doc(t).get()).exists?!0:e?(await rn().collection("adminEmails").doc(e.toLowerCase()).get()).exists:!1:!1}function Kx(t){return JSON.parse(JSON.stringify(t))}async function _E(t){if(!t.clientCode)return!1;const e=await Ma(t.clientCode),n=Kx(t);n.snapshot&&n.snapshot.length>aE&&delete n.snapshot;const i={...n,clientViewId:e};return vi()?await rn().collection("submissions").doc(n.id).set(i):await Pc(`submissions/${n.id}`,i),!0}async function yE(){return await gs()?(await rn().collection("submissions").orderBy("date","desc").get()).docs.map(e=>{const n=e.data();return delete n.clientViewId,n}):null}async function SE(t){return await gs()?(await rn().collection("submissions").doc(t).delete(),!0):!1}function dp(t,e){return`${t}--${e}`}async function fp(t){var n;if(vi()){const i=await rn().collection("clientDraftIndexes").doc(t).get();return i.exists&&Array.isArray((n=i.data())==null?void 0:n.drafts)?i.data().drafts:[]}const e=await Rc(`clientDraftIndexes/${t}`);return Array.isArray(e==null?void 0:e.drafts)?e.drafts:[]}async function ME(t){const e=await Ma(t),n=await fp(e);return(await Promise.all(n.map(async r=>{const s=dp(e,r.id);if(vi()){const a=await rn().collection("clientDrafts").doc(s).get();return a.exists?a.data():null}return await Rc(`clientDrafts/${s}`)}))).filter(r=>!!(r!=null&&r.state&&(r!=null&&r.id))).sort((r,s)=>s.updatedAt.localeCompare(r.updatedAt))}async function ig(t,e){const n=await Ma(t),i=await fp(n);if(!i.some(f=>f.id===e.id)&&i.length>=20)throw new Error("A client workspace can contain up to 20 saved planograms.");const s=Kx({...e,clientViewId:n}),a={id:e.id,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt},o=[...i.filter(f=>f.id!==e.id),a].sort((f,p)=>p.updatedAt.localeCompare(f.updatedAt)),l={clientViewId:n,drafts:o,updatedAt:e.updatedAt},u=dp(n,e.id);if(vi()){const f=rn().batch();f.set(rn().collection("clientDrafts").doc(u),s),f.set(rn().collection("clientDraftIndexes").doc(n),l),await f.commit();return}await Pc(`clientDrafts/${u}`,s),await Pc(`clientDraftIndexes/${n}`,l)}async function EE(t,e){const n=await Ma(t),r=(await fp(n)).filter(o=>o.id!==e),s={clientViewId:n,drafts:r,updatedAt:new Date().toISOString()},a=dp(n,e);if(vi()){const o=rn().batch();o.delete(rn().collection("clientDrafts").doc(a)),o.set(rn().collection("clientDraftIndexes").doc(n),s),await o.commit();return}await uE(`clientDrafts/${a}`),await Pc(`clientDraftIndexes/${n}`,s)}
40async function bE(t,e=4,n="image/png",i=.85){const r=t.cloneNode(!0),s=t.viewBox.baseVal;r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("width",String(s.width*e)),r.setAttribute("height",String(s.height*e));const a=new XMLSerializer().serializeToString(r),o=new Blob([a],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(o);try{const u=new Image;await new Promise((h,m)=>{u.onload=()=>h(),u.onerror=()=>m(new Error("snapshot render failed")),u.src=l});const f=document.createElement("canvas");f.width=s.width*e,f.height=s.height*e;const p=f.getContext("2d");return p.fillStyle="#f7f8fa",p.fillRect(0,0,f.width,f.height),p.drawImage(u,0,0,f.width,f.height),f.toDataURL(n,i)}finally{URL.revokeObjectURL(l)}}async function wE(t,e=62e4){if(t.length<=e)return t;const n=new Image;await new Promise((a,o)=>{n.onload=()=>a(),n.onerror=()=>o(new Error("snapshot compression failed")),n.src=t});let i=Math.min(n.naturalWidth,1500),r=Math.round(n.naturalHeight*(i/n.naturalWidth)),s=t;for(const a of[.78,.68,.58,.48]){const o=document.createElement("canvas");o.width=Math.max(480,Math.round(i)),o.height=Math.max(320,Math.round(r));const l=o.getContext("2d");if(l.fillStyle="#f7f8fa",l.fillRect(0,0,o.width,o.height),l.drawImage(n,0,0,o.width,o.height),s=o.toDataURL("image/jpeg",a),s.length<=e)return s;i*=.78,r*=.78}return s}async function TE(t,e=4){const n=t.cloneNode(!0),i=t.viewBox.baseVal;n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("width",String(i.width*e)),n.setAttribute("height",String(i.height*e));const r=new XMLSerializer().serializeToString(n),s=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(s);try{const o=new Image;await new Promise((p,h)=>{o.onload=()=>p(),o.onerror=()=>h(new Error("snapshot render failed")),o.src=a});const l=document.createElement("canvas");l.width=i.width*e,l.height=i.height*e;const u=l.getContext("2d");u.fillStyle="#f7f8fa",u.fillRect(0,0,l.width,l.height),u.drawImage(o,0,0,l.width,l.height);const f=document.createElement("a");f.href=l.toDataURL("image/png"),f.download=`shelf-snapshot-${new Date().toISOString().slice(0,19).replace(/[:T]/g,"-")}.png`,f.click()}finally{URL.revokeObjectURL(a)}}function CE(t){const e=(t.widthCm+2*zn+2*Vi)*Ge,n=(t.heightCm+zn+2*Vi)*Ge;return e/n}function AE(t){const e=new Blob([JSON.stringify(t)],{type:"application/json"}),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=`planogram-study-${new Date().toISOString().slice(0,19).replace(/[:T]/g,"-")}.json`,i.click(),URL.revokeObjectURL(n)}function RE(t,e,n){const i=(t.widthCm+2*zn+2*Vi)*Ge,r=(t.heightCm+zn+2*Vi)*Ge;return e.map(s=>{const a=n[s.productId],o=(Vi+zn+s.xCm)*Ge,l=(Vi+Ks(t,s.level))*Ge,u=Tn(s)*Ge,f=Ao(s)*Ge;return{id:s.id,label:`${(a==null?void 0:a.name)??s.name} (level ${s.level+1})`,productId:s.productId,productName:(a==null?void 0:a.name)??s.name,brand:a==null?void 0:a.brand,isCompetitor:s.isCompetitor,level:s.level,facings:s.facings,labelColor:s.labelColor,priceColor:s.priceColor,x:o/i,y:(l-f)/r,w:u/i,h:f/r}})}function PE(t,e,n,i){AE({format:"shelflab-study",version:1,exportedAt:new Date().toISOString(),shelf:{id:e.id,name:e.name,widthCm:e.widthCm,heightCm:e.heightCm,levels:e.levels},image:{dataUrl:t,aspect:CE(e)},aois:RE(e,n,i)})}function kE({catalog:t,setCatalog:e,onBack:n,onLoadSubmission:i}){var T,N,L;const{t:r}=Pt(),[s,a]=q.useState("catalog"),[o,l]=q.useState(((T=t.categories[0])==null?void 0:T.id)??null),[u,f]=q.useState(((L=(N=t.categories[0])==null?void 0:N.groups[0])==null?void 0:L.id)??null),[p,h]=q.useState(!1),[m,x]=q.useState(!1),[y,g]=q.useState(null),[d,v]=q.useState(""),[b,M]=q.useState(""),E=t.categories.find(R=>R.id===o)??null,w=(E==null?void 0:E.groups.find(R=>R.id===u))??null,A=(R,D)=>e(F=>({...F,categories:F.categories.map(k=>k.id===R?D(k):k).filter(k=>k!==null)})),_=(R,D,F)=>A(R,k=>({...k,groups:k.groups.map(B=>B.id===D?F(B):B).filter(B=>B!==null)}));return c.jsxs("div",{className:"admin",children:[c.jsxs("header",{className:"topbar",children:[c.jsxs("div",{className:"brand",children:["âï¸ ",r("admin.title")]}),c.jsxs("nav",{className:"steps",children:[c.jsx("button",{className:`step ${s==="catalog"?"on":""}`,onClick:()=>a("catalog"),children:r("admin.catalog")}),c.jsx("button",{className:`step ${s==="shares"?"on":""}`,onClick:()=>a("shares"),children:r("admin.clientSharing")}),c.jsx("button",{className:`step ${s==="submissions"?"on":""}`,onClick:()=>a("submissions"),children:r("admin.submissions")})]}),c.jsxs("div",{className:"toolbar",children:[c.jsx(eu,{dark:!0}),c.jsxs("button",{className:"btn",onClick:n,children:["â ",r("admin.exit")]})]})]}),s==="catalog"?c.jsxs("div",{className:"admin-cols",children:[c.jsxs("section",{className:"admin-col",children:[c.jsx("h3",{children:r("admin.categories")}),t.categories.map(R=>c.jsxs("div",{className:`admin-item ${R.id===o?"on":""}`,onClick:()=>{var D;l(R.id),f(((D=R.groups[0])==null?void 0:D.id)??null)},children:[c.jsx("span",{className:"ai-name",children:R.name}),c.jsx("span",{className:"ai-meta",children:R.groups.reduce((D,F)=>D+F.products.length,0)}),c.jsx("button",{className:"icon-btn",title:r("common.rename"),onClick:D=>{D.stopPropagation();const F=prompt(r("admin.categoryName"),R.name);F&&A(R.id,k=>({...k,name:F}))},children:"â"}),c.jsx("button",{className:"icon-btn",title:r("common.delete"),onClick:D=>
40{D.stopPropagation(),confirm(r("admin.deleteCategory",{name:R.name}))&&A(R.id,()=>null)},children:"â"})]},R.id)),c.jsxs("div",{className:"add-row",children:[c.jsx("input",{value:d,onChange:R=>v(R.target.value),placeholder:r("admin.newCategory")}),c.jsx("button",{className:"btn",disabled:!d.trim(),onClick:()=>{const R={id:wi(),name:d.trim(),groups:[]};e(D=>({...D,categories:[...D.categories,R]})),l(R.id),f(null),v("")},children:r("common.add")})]})]}),c.jsxs("section",{className:"admin-col",children:[c.jsxs("h3",{children:[r("admin.productGroups")," ",E?`· ${E.name}`:""]}),E==null?void 0:E.groups.map(R=>c.jsxs("div",{className:`admin-item ${R.id===u?"on":""}`,onClick:()=>f(R.id),children:[c.jsx("span",{className:"ai-name",children:R.name}),c.jsx("span",{className:"ai-meta",children:R.products.length}),c.jsx("button",{className:"icon-btn",title:r("common.rename"),onClick:D=>{D.stopPropagation();const F=prompt(r("admin.groupName"),R.name);F&&E&&_(E.id,R.id,k=>({...k,name:F}))},children:"â"}),c.jsx("button",{className:"icon-btn",title:r("common.delete"),onClick:D=>{D.stopPropagation(),E&&confirm(r("admin.deleteGroup",{name:R.name}))&&_(E.id,R.id,()=>null)},children:"â"})]},R.id)),E&&c.jsxs("div",{className:"add-row",children:[c.jsx("input",{value:b,onChange:R=>M(R.target.value),placeholder:r("admin.newGroup")}),c.jsx("button",{className:"btn",disabled:!b.trim(),onClick:()=>{const R={id:wi(),name:b.trim(),products:[]};A(E.id,D=>({...D,groups:[...D.groups,R]})),f(R.id),M("")},children:r("common.add")})]}),!E&&c.jsx("p",{className:"hint",children:r("admin.selectCategory")})]}),c.jsxs("section",{className:"admin-col wide",children:[c.jsxs("h3",{children:[r("common.products")," ",w?`· ${w.name}`:""]}),w&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"product-grid",children:w.products.map(R=>c.jsxs("div",{className:"admin-product",children:[c.jsx(Lx,{p:R}),c.jsxs("div",{className:"ap-fields",children:[c.jsx("input",{value:R.name,onChange:D=>E&&_(E.id,w.id,F=>({...F,products:F.products.map(k=>k.id===R.id?{...k,name:D.target.value}:k)}))}),c.jsxs("div",{className:"ap-price",children:[c.jsx("input",{type:"number",step:.01,value:R.defaultPrice,onChange:D=>E&&_(E.id,w.id,F=>({...F,products:F.products.map(k=>k.id===R.id?{...k,defaultPrice:Number(D.target.value)||0}:k)}))}),c.jsx("span",{children:R.currency??"EUR"})]}),(R.market||R.sourceUrl)&&c.jsxs("div",{className:"product-source",children:[R.market&&c.jsx("span",{children:R.market}),R.sourceUrl&&c.jsx("a",{href:R.sourceUrl,target:"_blank",rel:"noreferrer",children:r("common.source")})]}),c.jsxs("label",{className:"check small",children:[c.jsx("input",{type:"checkbox",checked:R.mine,onChange:D=>E&&_(E.id,w.id,F=>({...F,products:F.products.map(k=>k.id===R.id?{...k,mine:D.target.checked}:k)}))}),r("common.ownBrand")]})]}),c.jsx("button",{className:"icon-btn",title:r("admin.deleteProduct"),onClick:()=>E&&_(E.id,w.id,D=>({...D,products:D.products.filter(F=>F.id!==R.id)})),children:"â"})]},R.id))}),c.jsxs("button",{className:"btn dashed block",onClick:()=>h(!0),children:["ï¼ ",r("admin.addProductDrop")]}),c.jsxs("button",{className:"btn primary block",onClick:()=>x(!0),children:["ð¦ ",r("import.title")]})]}),!w&&E&&c.jsxs("button",{className:"btn primary block",onClick:()=>x(!0),children:["ð¦ ",r("import.title")]}),!w&&c.jsx("p",{className:"hint",children:r("admin.selectGroup")}),y&&c.jsx("p",{className:"import-success",children:y})]})]}):s==="shares"?c.jsx(DE,{catalog:t,setCatalog:e}):c.jsx(NE,{catalog:t,onLoad:i}),p&&E&&w&&c.jsx(Ux,{title:r("admin.addProductTo",{name:w.name}),onConfirm:R=>{_(E.id,w.id,D=>({...D,products:[...D.products,R]})),h(!1)},onCancel:()=>h(!1)}),m&&c.jsx(KM,{catalog:t,initialCategoryId:o,initialGroupId:u,onConfirm:({categoryId:R,categoryName:D,groupId:F,groupName:k,products:B})=>{var V,Q;const z=R??wi(),I=F??wi();e(re=>({...re,categories:R?re.categories.map(ae=>ae.id!==z?ae:F?{...ae,groups:ae.groups.map(Fe=>{if(Fe.id!==F)return Fe;const je=new Set(B.map(Oe=>Oe.id));return{...Fe,products:[...Fe.products.filter(Oe=>!je.has(Oe.id)),...B]}})}:{...ae,groups:[...ae.groups,{id:I,name:k,products:B}]}):[...re.categories,{id:z,name:D,groups:[{id:I,name:k,products:B}]}]})),l(z),f(I),g(r("import.success",{count:B.length,group:k||((Q=(V=t.categories.find(re=>re.id===z))==null?void 0:V.groups.find(re=>re.id===F))==null?void 0:Q.name)||r("import.selectedGroup")})),x(!1)},onCancel:()=>x(!1)})]})}function NE({catalog:t,onLoad:e}){const{t:n,locale:i}=Pt(),[r,s]=q.useState(Ox),[a,o]=q.useState(!1),[l,u]=q.useState(!0),[f,p]=q.useState(null),h=Object.fromEntries(t.categories.flatMap(g=>g.groups.flatMap(d=>d.products)).map(g=>[g.id,g]));q.useEffect(()=>{let g=!1;return yE().then(d=>{g||d&&(s(d),o(!0))}).catch(d=>{g||p(d instanceof Error?d.message:n("admin.remoteSubmissionsError"))}).finally(()=>{g||u(!1)}),()=>{g=!0}},[]);const m=async g=>{a&&await SE(g);const d=r.filter(v=>v.id!==g);s(d),a||zx(d)},x=new Map;for(const g of[...r].reverse()){const d=g.clientCode??"__studio__";if(!x.has(d)){const v=g.clientCode?t.shares.find(b=>b.code.toUpperCase()===g.clientCode.toUpperCase()):null;x.set(d,{label:v?`${v.label} (${v.code})`:g.clientCode?n("admin.unknownClient",{code:g.clientCode}):n("admin.studioDirect"),items:[]})}x.get(d).items.push(g)}const y=g=>`${(g.contactName||"client").replace(/\W+/g,"-").toLowerCase()}-${g.date.slice(0,10)}-${g.id.slice(-4)}`;return c.jsxs("div",{className:"shares",children:[c.jsx("p",{className:"hint",children:n("admin.submissionsIntro")}),l&&c.jsx("p",{className:"hint",children:n("admin.loadingSubmissions")}),f&&c.jsx("p",{className:"code-error",children:f}
40),!l&&r.length===0&&c.jsx("p",{className:"hint",children:n("admin.noSubmissions")}),[...x.entries()].map(([g,d])=>c.jsxs("section",{className:"client-folder",children:[c.jsxs("h3",{children:["ð ",d.label," ",c.jsx("span",{className:"ai-meta",children:d.items.length})]}),d.items.map(v=>{const b=wx(v.state.shelfId),M={...h,...Object.fromEntries((v.state.customProducts??[]).map(w=>[w.id,w]))},E=!!(v.snapshot&&b);return c.jsxs("div",{className:"share-card sub-card",children:[v.snapshot&&c.jsx("button",{className:"sub-thumb",title:n("admin.downloadSnapshot"),onClick:()=>Jm(v.snapshot,`${y(v)}.jpg`),children:c.jsx("img",{src:v.snapshot,alt:n("admin.shelfSnapshotAlt")})}),c.jsxs("div",{className:"sub-body",children:[c.jsxs("div",{className:"share-head",children:[c.jsx("strong",{style:{flex:1},children:v.contactName}),c.jsx("span",{className:"ai-meta",children:new Date(v.date).toLocaleString(i)})]}),c.jsxs("p",{className:"hint",style:{marginBottom:8},children:[n("admin.submissionMeta",{email:v.contactEmail,groups:v.state.groups.length,marketing:v.state.marketing.length}),v.notes?c.jsxs(c.Fragment,{children:[c.jsx("br",{}),'"',v.notes,'"']}):null]}),c.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[c.jsx("button",{className:"btn primary",onClick:()=>e(v),children:n("admin.openPlanner")}),c.jsxs("button",{className:"btn primary",disabled:!E,title:n(E?"admin.studyJsonTitle":"admin.studyJsonUnavailable"),onClick:()=>v.snapshot&&b&&PE(v.snapshot,b,v.state.groups,M),children:["ð¯ ",n("admin.studyJson")]}),c.jsx("button",{className:"btn",title:n("admin.backupJsonTitle"),onClick:()=>WM(v,`${y(v)}-submission.json`),children:n("admin.backupJson")}),v.snapshot&&c.jsx("button",{className:"btn",onClick:()=>Jm(v.snapshot,`${y(v)}.jpg`),children:n("common.snapshot")}),c.jsx("button",{className:"btn danger",onClick:()=>confirm(n("admin.deleteSubmission"))&&void m(v.id),children:n("common.delete")})]})]})]},v.id)})]},g))]})}function DE({catalog:t,setCatalog:e}){const{t:n}=Pt(),[i,r]=q.useState(null),[,s]=q.useState(0),a=(l,u)=>e(f=>({...f,shares:f.shares.map(p=>p.id===l?u(p):p).filter(p=>p!==null)})),o=l=>`${location.origin}${location.pathname}?code=${encodeURIComponent(l.code)}`;return c.jsxs("div",{className:"shares",children:[c.jsx("p",{className:"hint",children:n("admin.sharesIntro")}),t.shares.map(l=>c.jsxs("div",{className:"share-card",children:[c.jsxs("div",{className:"share-head",children:[c.jsx("input",{className:"share-label",value:l.label,onChange:u=>a(l.id,f=>({...f,label:u.target.value})),placeholder:n("admin.clientName")}),c.jsx("span",{children:n("admin.code")}),c.jsx("input",{className:"share-code",value:l.code,onChange:u=>a(l.id,f=>({...f,code:u.target.value.toUpperCase()}))}),c.jsx("button",{className:"icon-btn",title:n("admin.deleteShare"),onClick:()=>confirm(n("admin.deleteShareConfirm"))&&a(l.id,()=>null),children:"â"})]}),c.jsxs("div",{className:"share-billing",children:[c.jsxs("label",{children:[c.jsx("span",{children:n("admin.accessPlan")}),c.jsxs("select",{value:l.plan??"free",onChange:u=>a(l.id,f=>({...f,plan:u.target.value})),children:[c.jsx("option",{value:"free",children:n("pricing.free.name")}),c.jsx("option",{value:"monthly-starter",children:n("pricing.monthly-starter.name")}),c.jsx("option",{value:"monthly-pro",children:n("pricing.monthly-pro.name")}),c.jsx("option",{value:"monthly-unlimited",children:n("pricing.monthly-unlimited.name")}),c.jsx("option",{value:"per-planogram",children:n("pricing.perPlanogram")})]})]}),c.jsx("span",{className:"share-usage",children:n("admin.planogramsUsed",{count:Vx(l.plan,Hx(l.code))})}),(l.plan??"free")==="per-planogram"&&c.jsxs("label",{children:[c.jsx("span",{children:n("admin.prepaidCredits")}),c.jsx("input",{type:"number",min:0,step:1,value:l.prepaidPlanograms??0,onChange:u=>a(l.id,f=>({...f,prepaidPlanograms:Math.max(0,Math.floor(Number(u.target.value)||0))}))})]}),c.jsx("button",{className:"btn small",onClick:()=>{confirm(n("admin.resetUsageConfirm",{code:l.code}))&&(ZM(l.code),s(u=>u+1))},children:n("admin.resetUsage")})]}),c.jsx("div",{className:"share-scope",children:t.categories.map(u=>{const f=l.categoryIds.includes(u.id);return c.jsxs("div",{className:"scope-cat",children:[c.jsxs("label",{className:"check",children:[c.jsx("input",{type:"checkbox",checked:f,onChange:p=>a(l.id,h=>({...h,categoryIds:p.target.checked?[...h.categoryIds,u.id]:h.categoryIds.filter(m=>m!==u.id)}
40))}),c.jsx("strong",{children:u.name})," (",n("admin.wholeCategory"),")"]}),c.jsx("div",{className:"scope-groups",children:u.groups.map(p=>c.jsxs("label",{className:`check small ${f?"muted":""}`,children:[c.jsx("input",{type:"checkbox",disabled:f,checked:f||l.groupIds.includes(p.id),onChange:h=>a(l.id,m=>({...m,groupIds:h.target.checked?[...m.groupIds,p.id]:m.groupIds.filter(x=>x!==p.id)}))}),p.name]},p.id))})]},u.id)})}),c.jsxs("div",{className:"share-link",children:[c.jsx("code",{children:o(l)}),c.jsx("button",{className:"btn",onClick:()=>{navigator.clipboard.writeText(o(l)).then(()=>{r(l.id),setTimeout(()=>r(null),1500)})},children:i===l.id?`â ${n("admin.copied")}`:n("admin.copyLink")})]})]},l.id)),c.jsxs("button",{className:"btn primary",onClick:()=>e(l=>({...l,shares:[...l.shares,{id:wi(),label:n("admin.newClient"),code:xM(),categoryIds:[],groupIds:[],plan:"free",prepaidPlanograms:0,active:!0,createdAt:new Date().toISOString()}]})),children:["ï¼ ",n("admin.newClientShare")]})]})}const hp="ShelfLab",Pr="[email protected]";function LE({status:t,uid:e,email:n,error:i}){const{t:r}=Pt(),[s,a]=q.useState(!1),[o,l]=q.useState(null),u=async()=>{a(!0),l(null);try{await gE()}catch(f){l(f instanceof Error?f.message:r("adminGate.signInFailed"))}finally{a(!1)}};return c.jsx("div",{className:"landing admin-gate",children:c.jsxs("main",{className:"access-panel",children:[c.jsxs("div",{className:"admin-gate-head",children:[c.jsxs("div",{className:"landing-logo",children:[c.jsx("span",{className:"logo",children:"â¤"})," ",hp]}),c.jsx(eu,{dark:!0})]}),t==="checking"||t==="loading"?c.jsxs(c.Fragment,{children:[c.jsx("h1",{children:r(t==="checking"?"adminGate.checking":"adminGate.loading")}),c.jsx("p",{className:"landing-sub",children:r("adminGate.connecting")})]}):t==="signed-out"?c.jsxs(c.Fragment,{children:[c.jsx("h1",{children:r("adminGate.signInTitle")}),c.jsx("p",{className:"landing-sub",children:r("adminGate.signInDescription")}),c.jsx("button",{className:"cta",disabled:s,onClick:()=>void u(),children:r(s?"adminGate.signingIn":"adminGate.continueGoogle")})]}):c.jsxs(c.Fragment,{children:[c.jsx("h1",{children:r("adminGate.approvalTitle")}),c.jsx("p",{className:"landing-sub",children:r("adminGate.approvalDescription",{email:n||r("adminGate.googleUser")})}),c.jsxs("p",{className:"uid-box",children:["UID: ",c.jsx("code",{children:e})]}),c.jsx("p",{className:"code-hint",children:r("adminGate.approvalHint",{uid:e||"",email:n||""})}),c.jsx("button",{className:"btn",onClick:()=>void vE(),children:r("adminGate.otherAccount")})]}),(i||o)&&c.jsx("p",{className:"code-error",children:i||o}),c.jsx("p",{children:c.jsxs("a",{className:"studio-link",href:"./",children:["â ",r("adminGate.return")]})})]})})}function IE({onClose:t}){const{t:e}=Pt(),n=[Yl["monthly-starter"],Yl["monthly-pro"],Yl["monthly-unlimited"]],i=r=>`mailto:${Pr}?subject=${encodeURIComponent(`ShelfLab ${r}`)}`;return c.jsx("div",{className:"modal-backdrop billing-backdrop",onClick:t,children:c.jsxs("div",{className:"modal pricing-modal",onClick:r=>r.stopPropagation(),children:[c.jsxs("div",{className:"pricing-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"pricing-kicker",children:e("pricing.kicker")}),c.jsx("h2",{children:e("pricing.title")}),c.jsx("p",{children:e("pricing.description")})]}),c.jsx("button",{className:"icon-btn pricing-close","aria-label":e("pricing.close"),onClick:t,children:"â"})]}),c.jsx("h3",{className:"pricing-section-title",children:e("pricing.monthly")}),c.jsx("div",{className:"pricing-grid",children:n.map(r=>c.jsxs("article",{className:`pricing-card ${r.id==="monthly-pro"?"featured":""}`,children:[r.id==="monthly-pro"&&c.jsx("span",{className:"pricing-badge",children:e("pricing.recommended")}),c.jsx("h3",{children:e(`pricing.${r.id}.name`)}),c.jsxs("div",{className:"pricing-price",children:[c.jsxs("strong",{children:["â¬",r.monthlyPriceEur]}),c.jsxs("span",{children:["/",e("pricing.month")]})]}),c.jsxs("ul",{children:[c.jsx("li",{children:e(`pricing.${r.id}.planograms`)}),c.jsx("li",{children:e(`pricing.${r.id}.products`)}),c.jsx("li",{children:e(`pricing.${r.id}.groups`)}),c.jsx("li",{children:e("pricing.extraGroupFee")}),c.jsx("li",{children:e("pricing.categoryFrom")}),c.jsx("li",{children:e(`pricing.${r.id}.statistics`)})]}),c.jsx("a",{className:"btn primary",href:i(e(`pricing.${r.id}.name`)),children:e("pricing.choose")})]},r.id))}),c.jsxs("section",{className:"payg-card",children:[c.jsxs("div",{children:[c.jsx("p",{className:"pricing-kicker",children:e("pricing.flexible")}),c.jsx("h3",{children:e("pricing.perPlanogram")}),c.jsx("p",{children:e("pricing.perPlanogramDescription")}),c.jsxs("ul",{className:"payg-features",children:[c.jsx("li",{children:e("pricing.perPlanogramProducts")}),c.jsx("li",{children:e("pricing.perPlanogramGroups")}),c.jsx("li",{children:e("pricing.perPlanogramIncluded")})]})]}),c.jsx("div",{className:"payg-prices",children:c.jsxs("div",{children:[c.jsxs("strong",{children:["â¬",Gx]}),c.jsx("span",{children:e("pricing.perPlanogramUnit")})]})}),c.jsx("a",{className:"btn primary",href:i(e("pricing.perPlanogram")),children:e("pricing.choose")})]}),c.jsx("p",{className:"pricing-note",children:e("pricing.note")})]})})}
40function UE({amountEur:t,productCount:e,onPay:n,onCancel:i}){const{t:r}=Pt(),[s,a]=q.useState(!1),[o,l]=q.useState(null),u=async()=>{a(!0),l(null);try{await n()==="contact"&&l(r("billing.contactOpened",{email:Pr}))}catch{l(r("billing.checkoutError",{email:Pr}))}finally{a(!1)}};return c.jsx("div",{className:"modal-backdrop",onClick:i,children:c.jsxs("div",{className:"modal payment-modal",onClick:f=>f.stopPropagation(),children:[c.jsx("div",{className:"payment-icon",children:"ð"}),c.jsx("h3",{children:r("billing.paymentRequired")}),c.jsx("p",{className:"hint",children:r("billing.paymentDescription")}),c.jsxs("div",{className:"payment-summary",children:[c.jsx("span",{children:r("billing.productsOnPlanogram",{count:e})}),c.jsxs("strong",{children:["â¬",t]})]}),c.jsx("p",{className:"hint",children:r("billing.screenshotAfterPayment")}),o&&c.jsx("p",{className:"payment-message",children:o}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{className:"btn",disabled:s,onClick:i,children:r("common.cancel")}),c.jsx("button",{className:"btn primary",disabled:s,onClick:()=>void u(),children:r(s?"common.processing":"billing.continuePayment")})]})]})})}function FE({onClose:t}){const{t:e}=Pt();return c.jsx("div",{className:"modal-backdrop",children:c.jsxs("div",{className:"modal completion-modal",children:[c.jsx("div",{className:"completion-icon",children:"â"}),c.jsx("h3",{children:e("billing.thankYou")}),c.jsx("p",{children:e("billing.freeComplete",{email:Pr})}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("a",{className:"btn",href:`mailto:${Pr}`,children:Pr}),c.jsx("button",{className:"btn primary",onClick:t,children:e("billing.finish")})]})]})})}const OE=[["#353b46","#4a515d","#626b78","#7b8490","#555d69","#8b939d","#424954"],["#737b87","#4b535f","#9299a2","#5f6874","#3d444f","#7f8792","#555e6b","#9ca2aa"],["#444c57","#6d7581","#858d98","#515a67","#979da6","#626b77","#3b424d"]];function zE(){const{t}=Pt();return c.jsxs("svg",{viewBox:"0 0 460 360",className:"landing-art","aria-hidden":!0,children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"hero-frame",x1:"0",y1:"0",x2:"1",y2:"1",children:[c.jsx("stop",{offset:"0",stopColor:"#303743"}),c.jsx("stop",{offset:"1",stopColor:"#171c25"})]}),c.jsxs("linearGradient",{id:"hero-can-shine",x1:"0",y1:"0",x2:"1",y2:"0",children:[c.jsx("stop",{offset:"0",stopColor:"#000000",stopOpacity:".42"}),c.jsx("stop",{offset:".38",stopColor:"#ffffff",stopOpacity:".28"}),c.jsx("stop",{offset:".65",stopColor:"#ffffff",stopOpacity:".04"}),c.jsx("stop",{offset:"1",stopColor:"#000000",stopOpacity:".35"})]}),c.jsxs("radialGradient",{id:"hero-heat-hot",children:[c.jsx("stop",{offset:"0",stopColor:"#ff3b30",stopOpacity:".92"}),c.jsx("stop",{offset:".26",stopColor:"#ff7a00",stopOpacity:".72"}),c.jsx("stop",{offset:".55",stopColor:"#ffd60a",stopOpacity:".42"}),c.jsx("stop",{offset:"1",stopColor:"#ffd60a",stopOpacity:"0"})]}),c.jsxs("radialGradient",{id:"hero-heat-cool",children:[c.jsx("stop",{offset:"0",stopColor:"#ffcc00",stopOpacity:".65"}),c.jsx("stop",{offset:".5",stopColor:"#24c8ff",stopOpacity:".28"}),c.jsx("stop",{offset:"1",stopColor:"#2f80ed",stopOpacity:"0"})]}),c.jsxs("filter",{id:"hero-glow",x:"-100%",y:"-100%",width:"300%",height:"300%",children:[c.jsx("feGaussianBlur",{stdDeviation:"4",result:"blur"}),c.jsxs("feMerge",{children:[c.jsx("feMergeNode",{in:"blur"}),c.jsx("feMergeNode",{in:"SourceGraphic"})]})]}),c.jsx("path",{id:"hero-gaze-path",d:"M 90 82 C 150 38 246 65 286 124 S 215 218 152 198 S 183 294 300 268 S 390 196 364 170"})]}),c.jsx("ellipse",{cx:"230",cy:"334",rx:"196",ry:"17",fill:"#000000",opacity:".34"}),c.jsx("rect",{x:"24",y:"12",width:"412",height:"310",rx:"13",fill:"url(#hero-frame)",stroke:"#424b5a",strokeWidth:"2"}),c.jsx("rect",{x:"39",y:"28",width:"382",height:"274",rx:"5",fill:"#11161e"}),OE.map((e,n)=>{const i=111+n*92,r=58+n%2*8;return c.jsxs("g",{children:[c.jsx("rect",{x:"39",y:i,width:"382",height:"13",fill:"#39414d"}),c.jsx("rect",{x:"39",y:i+1,width:"382",height:"3",fill:"#657080",opacity:".5"}),e.map((s,a)=>c.jsxs("g",{transform:`translate(${r+a*45} ${i-66})`,children:[c.jsx("rect",{width:"32",height:"66",rx:"6",fill:s}),c.jsx("rect",{width:"32",height:"66",rx:"6",fill:"url(#hero-can-s
40hine)"}),c.jsx("ellipse",{cx:"16",cy:"2.5",rx:"15",ry:"4.5",fill:"#aeb5be"}),c.jsx("ellipse",{cx:"16",cy:"3",rx:"10",ry:"2.3",fill:"#737b86"}),c.jsx("rect",{x:"7",y:"30",width:"18",height:"4",rx:"2",fill:"#cbd0d6",opacity:".38"}),c.jsx("rect",{x:"10",y:"39",width:"12",height:"2.5",rx:"1.25",fill:"#e4e7eb",opacity:".24"})]},a))]},n)}),c.jsxs("g",{className:"hero-heatmap",children:[c.jsxs("ellipse",{cx:"276",cy:"124",rx:"26",ry:"20",fill:"url(#hero-heat-hot)",opacity:"0",children:[c.jsx("animate",{attributeName:"opacity",dur:"12s",repeatCount:"indefinite",values:"0;0;.88;.68;.42;.16;0",keyTimes:"0;.10;.18;.30;.62;.92;1"}),c.jsx("animate",{attributeName:"rx",dur:"12s",repeatCount:"indefinite",values:"26;26;70;68;62;40;26",keyTimes:"0;.10;.18;.30;.62;.92;1"}),c.jsx("animate",{attributeName:"ry",dur:"12s",repeatCount:"indefinite",values:"20;20;55;53;48;31;20",keyTimes:"0;.10;.18;.30;.62;.92;1"})]}),c.jsxs("ellipse",{cx:"152",cy:"198",rx:"24",ry:"18",fill:"url(#hero-heat-cool)",opacity:"0",children:[c.jsx("animate",{attributeName:"opacity",dur:"12s",repeatCount:"indefinite",values:"0;0;.76;.62;.35;.14;0",keyTimes:"0;.39;.47;.60;.76;.93;1"}),c.jsx("animate",{attributeName:"rx",dur:"12s",repeatCount:"indefinite",values:"24;24;58;56;50;34;24",keyTimes:"0;.39;.47;.60;.76;.93;1"}),c.jsx("animate",{attributeName:"ry",dur:"12s",repeatCount:"indefinite",values:"18;18;46;44;39;27;18",keyTimes:"0;.39;.47;.60;.76;.93;1"})]}),c.jsxs("ellipse",{cx:"300",cy:"268",rx:"25",ry:"19",fill:"url(#hero-heat-hot)",opacity:"0",children:[c.jsx("animate",{attributeName:"opacity",dur:"12s",repeatCount:"indefinite",values:"0;0;.92;.74;.30;0",keyTimes:"0;.69;.77;.90;.95;1"}),c.jsx("animate",{attributeName:"rx",dur:"12s",repeatCount:"indefinite",values:"25;25;64;62;42;25",keyTimes:"0;.69;.77;.90;.95;1"}),c.jsx("animate",{attributeName:"ry",dur:"12s",repeatCount:"indefinite",values:"19;19;48;46;31;19",keyTimes:"0;.69;.77;.90;.95;1"})]})]}),c.jsxs("g",{className:"hero-gaze-dot",filter:"url(#hero-glow)",children:[c.jsx("circle",{r:"13",fill:"#56c8ff",opacity:".18"}),c.jsx("circle",{r:"5.5",fill:"#d9f5ff",stroke:"#56c8ff",strokeWidth:"2"}),c.jsx("animateTransform",{id:"hero-gaze-animation",attributeName:"transform",type:"translate",dur:"12s",repeatCount:"indefinite",values:"90 82;276 124;276 124;152 198;152 198;300 268;300 268;90 82",keyTimes:"0;.10;.30;.39;.60;.69;.90;1",calcMode:"spline",keySplines:".4 0 .2 1;0 0 1 1;.4 0 .2 1;0 0 1 1;.4 0 .2 1;0 0 1 1;.4 0 .2 1"})]}),c.jsxs("g",{className:"hero-live-pill",transform:"translate(302 31)",children:[c.jsx("rect",{width:"101",height:"27",rx:"13.5",fill:"#0c1118",stroke:"#465162"}),c.jsx("circle",{cx:"15",cy:"13.5",r:"4",fill:"#39d98a"}),c.jsx("text",{x:"27",y:"17",fill:"#cbd5e1",fontFamily:"system-ui, sans-serif",fontSize:"10",fontWeight:"700",letterSpacing:"1",children:t("landing.liveGaze")})]})]})}function jE({kind:t}){return t==="build"?c.jsx("div",{className:"feature-motion feature-build","aria-hidden":"true",children:c.jsxs("div",{className:"motion-shelf",children:[c.jsx("span",{className:"motion-shelf-rail top"}),c.jsx("span",{className:"motion-shelf-rail bottom"}),[0,1,2,3,4].map(e=>c.jsx("span",{className:`motion-can motion-can-${e}`},e)),c.jsx("span",{className:"motion-can motion-drag-can"}),c.jsx("span",{className:"motion-price",children:"â¬2.49"}),c.jsx("span",{className:"motion-wobbler",children:"SALE"})]})}):t==="views"?c.jsxs("div",{className:"feature-motion feature-views","aria-hidden":"true",children:[c.jsxs("div",{className:"motion-view-tabs",children:[c.jsx("span",{children:"2D"}),c.jsx("span",{children:"2.5D"}),c.jsx("span",{children:"3D"})]}),c.jsxs("div",{className:"motion-view-stage",children:[c.jsxs("div",{className:"motion-view-shelf",children:[c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{})]}),c.jsx("span",{className:"motion-zoom-ring",children:"+"})]})]}):t==="catalog"?c.jsxs("div",{className:"feature-motion feature-catalog","aria-hidden":"true",children:[c.jsxs("div",{className:"motion-catalog-tree",children:[c.jsx("span",{className:"motion-category",children:"ENERGY DRINKS"}),c.jsx("span",{className:"motion-group own",children:"YOUR BRAND"}),c.jsx("span",{className:"motion-group competition",children:"COMPETITION"})]}),c.jsxs("div",{className:"motion-client-card",children:[c.jsx("span",{children:"YOUR RANGE"}),c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{})]}),c.jsx("span",{className:"motion-access-line"})]}):t==="share"?c.jsxs("div",{className:"feature-motion feature-share","aria-hidden":"true",children:[c.jsxs("div",{className:"motion-browser",children:[c.jsx("span",{className:"motion-browser-bar"}),c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{})]}),c.jsx("span",{className:"motion-code-token",children:"XR4â¢29"}),c.jsx("span",{className:"motion-submit-check",children:"â"})]}):t==="stats"?c.jsxs("div",{className:"feature-motion feature-stats","aria-hidden":"true",children:[c.jsx("div",{className:"motion-chart",children:[62,84,48,72,91].map((e,n)=>c.jsx("i",{style:{"--bar-height":`${e}%`}},n))}),c.jsxs("div",{className:"motion-stat-score",children:[c.jsx("strong",{children:"78"}),c.jsx("span",{children:"SHELF SCORE"})]}),c.jsx("span",{className:"motion-trend",children:"â 12%"})]}):c.jsx("div",{className:"feature-motion feature-validate","aria-hidden":"true",children:c.jsxs("svg",{viewBox:"0 0 360 170",children:[c.jsxs("defs",{children:[c.jsxs("radialGradient",{id:"feature-heat-red",children:[c.jsx("stop",{offset:"0",stopColor:"#ff4d4d",stopOpacity:".82"}),c.jsx("stop",{offset:".45",stopColor:"#ffb800",stopOpacity:".36"}),c.jsx("stop",{offset:"1",stopColor:"#ffb800",stopOpacity:"0"})]}),c.jsx("filter",{id:"feature-dot-glow",x:"-100%",y:"-100%",width:"300%",height:"300%",children:c.jsx("feGaussianBlur",{stdDeviation:"3"})})]}
40),c.jsx("rect",{x:"24",y:"23",width:"204",height:"124",rx:"9",fill:"#121923",stroke:"#344155"}),c.jsx("path",{d:"M24 81h204M24 137h204",stroke:"#526177",strokeWidth:"5"}),[0,1,2,3,4].map(e=>c.jsx("rect",{x:37+e*37,y:"42",width:"23",height:"39",rx:"5",fill:e===2?"#3186da":"#697587"},`a-${e}`)),[0,1,2,3,4].map(e=>c.jsx("rect",{x:37+e*37,y:"98",width:"23",height:"39",rx:"5",fill:e===3?"#25a667":"#5b6677"},`b-${e}`)),c.jsx("circle",{className:"feature-heat-pulse one",cx:"130",cy:"61",r:"42",fill:"url(#feature-heat-red)"}),c.jsx("circle",{className:"feature-heat-pulse two",cx:"169",cy:"117",r:"38",fill:"url(#feature-heat-red)"}),c.jsx("circle",{r:"9",fill:"#55cfff",opacity:".25",filter:"url(#feature-dot-glow)",children:c.jsx("animateMotion",{dur:"6s",repeatCount:"indefinite",path:"M52 55 C86 30 120 47 130 61 C155 82 186 91 169 117 C145 143 94 119 70 104"})}),c.jsx("circle",{r:"4.5",fill:"#dff8ff",stroke:"#55cfff",strokeWidth:"2",children:c.jsx("animateMotion",{dur:"6s",repeatCount:"indefinite",path:"M52 55 C86 30 120 47 130 61 C155 82 186 91 169 117 C145 143 94 119 70 104"})}),c.jsxs("g",{className:"motion-survey-bars",children:[c.jsx("rect",{x:"253",y:"43",width:"80",height:"9",rx:"4.5",fill:"#2a3546"}),c.jsx("rect",{x:"253",y:"43",width:"60",height:"9",rx:"4.5",fill:"#2f80ed"}),c.jsx("rect",{x:"253",y:"71",width:"80",height:"9",rx:"4.5",fill:"#2a3546"}),c.jsx("rect",{x:"253",y:"71",width:"42",height:"9",rx:"4.5",fill:"#27ae60"}),c.jsx("rect",{x:"253",y:"99",width:"80",height:"9",rx:"4.5",fill:"#2a3546"}),c.jsx("rect",{x:"253",y:"99",width:"69",height:"9",rx:"4.5",fill:"#8b5cf6"}),c.jsx("circle",{cx:"263",cy:"130",r:"5",fill:"#39d98a"}),c.jsx("path",{d:"m260 130 2 2 4-5",fill:"none",stroke:"#0d151d",strokeWidth:"1.5"})]})]})})}function ll({initialError:t}){const{t:e}=Pt(),[n,i]=q.useState(""),[r,s]=q.useState(!1),a=`mailto:${Pr}?subject=${encodeURIComponent("ShelfLab demo request")}`,o=[{kind:"build",title:e("landing.features.build.title"),description:e("landing.features.build.description")},{kind:"views",title:e("landing.features.views.title"),description:e("landing.features.views.description")},{kind:"catalog",title:e("landing.features.catalog.title"),description:e("landing.features.catalog.description")},{kind:"share",title:e("landing.features.share.title"),description:e("landing.features.share.description")},{kind:"stats",title:e("landing.features.stats.title"),description:e("landing.features.stats.description")},{kind:"validate",title:e("landing.features.validate.title"),description:e("landing.features.validate.description")}],l=()=>{const u=n.trim().toUpperCase();u&&(window.location.search=`?code=${encodeURIComponent(u)}`)};return c.jsxs("div",{className:"landing",children:[c.jsxs("header",{className:"landing-top",children:[c.jsxs("div",{className:"landing-logo",children:[c.jsx("span",{className:"logo",children:"â¤"})," ",hp,c.jsxs("span",{className:"landing-by",children:[e("landing.by")," ",c.jsx("strong",{children:"XR4MARK"})]})]}),c.jsxs("div",{className:"landing-actions",children:[c.jsx("button",{className:"landing-xr4mark-link",onClick:()=>s(!0),children:e("pricing.nav")}),c.jsx("a",{className:"landing-xr4mark-link landing-demo-link",href:a,children:e("landing.requestDemo")}),c.jsxs("a",{className:"landing-xr4mark-link",href:"https://www.xr4mark.com",children:[e("landing.backToXR4MARK")," â"]}),c.jsx(eu,{dark:!0})]})]}),c.jsxs("main",{className:"landing-hero",children:[c.jsxs("div",{className:"landing-copy",children:[c.jsx("p",{className:"landing-kicker",children:e("landing.kicker")}),c.jsxs("h1",{children:[e("landing.heading1"),c.jsx("br",{}),c.jsx("span",{className:"grad",children:e("landing.heading2")})]}),c.jsx("p",{className:"landing-sub",children:e("landing.description")}),c.jsxs("div",{className:"code-card",children:[c.jsx("label",{htmlFor:"access-code",children:e("landing.enterCode")}),c.jsxs("div",{className:"code-row",children:[c.jsx("input",{id:"access-code",type:"text",value:n,maxLength:12,onChange:u=>{i(u.target.value.toUpperCase())},onKeyDown:u=>u.key==="Enter"&&n.trim()&&l(),autoFocus:!0}),c.jsxs("button",{className:"cta",disabled:!n.trim(),onClick:l,children:[e("landing.enterSpace")," â"]})]}),t&&c.jsx("p",{className:"code-error",children:t}),c.jsx("p",{className:"code-hint",children:e("landing.codeHint")})]}),c.jsxs("ul",{className:"landing-chips",children:[c.jsx("li",{children:e("landing.chipHardware")}
40),c.jsx("li",{children:e("landing.chipShoppers")}),c.jsx("li",{children:e("landing.chipFixes")})]})]}),c.jsxs("div",{className:"landing-visual",children:[c.jsx(zE,{}),c.jsx("p",{className:"landing-caption",children:e("landing.caption")})]})]}),c.jsxs("section",{className:"landing-features","aria-labelledby":"landing-features-title",children:[c.jsxs("div",{className:"landing-features-head",children:[c.jsx("p",{className:"landing-kicker",children:e("landing.features.kicker")}),c.jsx("h2",{id:"landing-features-title",children:e("landing.features.title")}),c.jsx("p",{children:e("landing.features.intro")})]}),c.jsx("div",{className:"landing-feature-grid",children:o.map((u,f)=>c.jsxs("article",{className:"landing-feature-card",children:[c.jsx(jE,{kind:u.kind}),c.jsxs("div",{className:"landing-feature-copy",children:[c.jsx("span",{className:"landing-feature-number",children:String(f+1).padStart(2,"0")}),c.jsx("h3",{children:u.title}),c.jsx("p",{children:u.description})]})]},u.kind))}),c.jsxs("div",{className:"landing-demo-cta",children:[c.jsxs("div",{children:[c.jsx("p",{className:"landing-kicker",children:e("landing.demo.kicker")}),c.jsx("h2",{children:e("landing.demo.title")}),c.jsx("p",{children:e("landing.demo.description")})]}),c.jsxs("a",{className:"cta landing-demo-cta-button",href:a,children:[e("landing.requestDemo")," â"]})]})]}),c.jsxs("footer",{className:"landing-footer",children:[c.jsxs("span",{children:["© XR4MARK · ",e("landing.footer")," â ",c.jsx("a",{href:"https://www.xr4mark.com",target:"_blank",rel:"noreferrer",children:"www.xr4mark.com"})]}),c.jsxs("a",{className:"studio-link",href:"?admin",children:["âï¸ ",e("landing.admin")," â"]})]}),r&&c.jsx(IE,{onClose:()=>s(!1)})]})}/** 41 * @license 42 * Copyright 2010-2026 Three.js Authors 43 * SPDX-License-Identifier: MIT 44 */const pp="185",ia={ROTATE:0,DOLLY:1,PAN:2},qs={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},BE=0,rg=1,GE=2,Kl=1,HE=2,$a=3,Dr=0,Dn=1,di=2,$i=0,ra=1,sg=2,ag=3,og=4,VE=5,Yr=100,WE=101,XE=102,$E=103,YE=104,KE=200,qE=201,ZE=202,JE=203,_f=204,yf=205,QE=206,eb=207,tb=208,nb=209,ib=210,rb=211,sb=212,ab=213,ob=214,Sf=0,Mf=1,Ef=2,pa=3,bf=4,wf=5,Tf=6,Cf=7,qx=0,lb=1,cb=2,Pi=0,Zx=1,Jx=2,Qx=3,e_=4,t_=5,n_=6,i_=7,r_=300,us=301,ma=302,Uu=303,Fu=304,tu=306,Af=1e3,Wi=1001,Rf=1002,tn=1003,ub=1004,cl=1005,pn=1006,Ou=1007,Qr=1008,jn=1009,s_=1010,a_=1011,Po=1012,mp=1013,Di=1014,Ti=1015,Qi=1016,gp=1017,vp=1018,ko=1020,o_=35902,l_=35899,c_=1021,u_=1022,hi=1023,er=1026,es=1027,d_=1028,xp=1029,ds=1030,_p=1031,yp=1033,ql=33776,Zl=33777,Jl=33778,Ql=33779,Pf=35840,kf=35841,Nf=35842,Df=35843,Lf=36196,If=37492,Uf=37496,Ff=37488,Of=37489,kc=37490,zf=37491,jf=37808,Bf=37809,Gf=37810,Hf=37811,Vf=37812,Wf=37813,Xf=37814,$f=37815,Yf=37816,Kf=37817,qf=37818,Zf=37819,Jf=37820,Qf=37821,eh=36492,th=36494,nh=36495,ih=36283,rh=36284,Nc=36285,sh=36286,db=3200,ah=0,fb=1,xr="",Cn="srgb",Dc="srgb-linear",Lc="linear",ft="srgb",ys=7680,lg=519,hb=512,pb=513,mb=514,Sp=515,gb=516,vb=517,Mp=518,xb=519,cg=35044,ug="300 es",Ci=2e3,No=2001;function _b(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Ic(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function yb(){const t=Ic("canvas");return t.style.display="block",t}const dg={};function fg(...t){const e="THREE."+t.shift();console.log(e,...t)}function f_(t){const e=t[0];if(typeof e=="string"&&e.startsWith("TSL:")){const n=t[1];n&&n.isStackTrace?t[0]+=" "+n.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function He(...t){t=f_(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.warn(n.getError(e)):console.warn(e,...t)}}function ot(...t){t=f_(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.error(n.getError(e)):console.error(e,...t)}}function sa(...t){const e=t.join(" ");e in dg||(dg[e]=!0,He(...t))}function Sb(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}const Mb={[Sf]:Mf,[Ef]:Tf,[bf]:Cf,[pa]:wf,[Mf]:Sf,[Tf]:Ef,[Cf]:bf,[wf]:pa};class zr{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const dn=["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
445","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"],ec=Math.PI/180,oh=180/Math.PI;function zo(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(dn[t&255]+dn[t>>8&255]+dn[t>>16&255]+dn[t>>24&255]+"-"+dn[e&255]+dn[e>>8&255]+"-"+dn[e>>16&15|64]+dn[e>>24&255]+"-"+dn[n&63|128]+dn[n>>8&255]+"-"+dn[n>>16&255]+dn[n>>24&255]+dn[i&255]+dn[i>>8&255]+dn[i>>16&255]+dn[i>>24&255]).toLowerCase()}function et(t,e,n){return Math.max(e,Math.min(n,t))}function Eb(t,e){return(t%e+e)%e}function zu(t,e,n){return(1-n)*t+n*e}function Da(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function En(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const bb={DEG2RAD:ec},Np=class Np{constructor(e=0,n=0){this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("THREE.Vector2: 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("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=et(this.x,e.x,n.x),this.y=et(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=et(this.x,e,n),this.y=et(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(et(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}
vendor: 8,919 bytes, line 44
44roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(et(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*r+e.x,this.y=s*r+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Np.prototype.isVector2=!0;let De=Np;class Lr{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,a,o){let l=i[r+0],u=i[r+1],f=i[r+2],p=i[r+3],h=s[a+0],m=s[a+1],x=s[a+2],y=s[a+3];if(p!==y||l!==h||u!==m||f!==x){let g=l*h+u*m+f*x+p*y;g<0&&(h=-h,m=-m,x=-x,y=-y,g=-g);let d=1-o;if(g<.9995){const v=Math.acos(g),b=Math.sin(v);d=Math.sin(d*v)/b,o=Math.sin(o*v)/b,l=l*d+h*o,u=u*d+m*o,f=f*d+x*o,p=p*d+y*o}else{l=l*d+h*o,u=u*d+m*o,f=f*d+x*o,p=p*d+y*o;const v=1/Math.sqrt(l*l+u*u+f*f+p*p);l*=v,u*=v,f*=v,p*=v}}e[n]=l,e[n+1]=u,e[n+2]=f,e[n+3]=p}static multiplyQuaternionsFlat(e,n,i,r,s,a){const o=i[r],l=i[r+1],u=i[r+2],f=i[r+3],p=s[a],h=s[a+1],m=s[a+2],x=s[a+3];return e[n]=o*x+f*p+l*m-u*h,e[n+1]=l*x+f*h+u*p-o*m,e[n+2]=u*x+f*m+o*h-l*p,e[n+3]=f*x-o*p-l*h-u*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,u=o(i/2),f=o(r/2),p=o(s/2),h=l(i/2),m=l(r/2),x=l(s/2);switch(a){case"XYZ":this._x=h*f*p+u*m*x,this._y=u*m*p-h*f*x,this._z=u*f*x+h*m*p,this._w=u*f*p-h*m*x;break;case"YXZ":this._x=h*f*p+u*m*x,this._y=u*m*p-h*f*x,this._z=u*f*x-h*m*p,this._w=u*f*p+h*m*x;break;case"ZXY":this._x=h*f*p-u*m*x,this._y=u*m*p+h*f*x,this._z=u*f*x+h*m*p,this._w=u*f*p-h*m*x;break;case"ZYX":this._x=h*f*p-u*m*x,this._y=u*m*p+h*f*x,this._z=u*f*x-h*m*p,this._w=u*f*p+h*m*x;break;case"YZX":this._x=h*f*p+u*m*x,this._y=u*m*p+h*f*x,this._z=u*f*x-h*m*p,this._w=u*f*p-h*m*x;break;case"XZY":this._x=h*f*p-u*m*x,this._y=u*m*p-h*f*x,this._z=u*f*x+h*m*p,this._w=u*f*p+h*m*x;break;default:He("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],s=n[8],a=n[1],o=n[5],l=n[9],u=n[2],f=n[6],p=n[10],h=i+o+p;if(h>0){const m=.5/Math.sqrt(h+1);this._w=.25/m,this._x=(f-l)*m,this._y=(s-u)*m,this._z=(a-r)*m}else if(i>o&&i>p){const m=2*Math.sqrt(1+i-o-p);this._w=(f-l)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(s+u)/m}else if(o>p){const m=2*Math.sqrt(1+o-i-p);this._w=(s-u)/m,this._x=(r+a)/m,this._y=.25*m,this._z=(l+f)/m}else{const m=2*Math.sqrt(1+p-i-o);this._w=(a-r)/m,this._x=(s+u)/m,this._y=(l+f)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(et(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,s=e._z,a=e._w,o=n._x,l=n._y,u=n._z,f=n._w;return this._x=i*f+a*o+r*u-s*l,this._y=r*f+a*l+s*o-i*u,this._z=s*f+a*u+i*l-r*o,this._w=a*f-i*o-r*l-s*u,this._onChangeCallback(),this}slerp(e,n){let i=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let l=1-n;if(o<.9995){const u=Math.acos(o),f=Math.sin(u);l=Math.sin(l*u)/f,n=Math.sin(n*u)/f,this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+a*n,this._onChangeCallback()}else this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+a*n,this.normalize();return this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Dp=class Dp{constructor(e=0,n=0,i=0){this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("THREE.Vector3: 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("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(hg.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(hg.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.elements,a=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*a,this}
vendor: 6,208 bytes, line 44
44applyQuaternion(e){const n=this.x,i=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,u=2*(a*r-o*i),f=2*(o*n-s*r),p=2*(s*i-a*n);return this.x=n+l*u+a*p-o*f,this.y=i+l*f+o*u-s*p,this.z=r+l*p+s*f-a*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 n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=et(this.x,e.x,n.x),this.y=et(this.y,e.y,n.y),this.z=et(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=et(this.x,e,n),this.y=et(this.y,e,n),this.z=et(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(et(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.z,a=n.x,o=n.y,l=n.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return ju.copy(this).projectOnVector(e),this.sub(ju)}reflect(e){return this.sub(ju.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(et(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Dp.prototype.isVector3=!0;let H=Dp;const ju=new H,hg=new Lr,Lp=class Lp{constructor(e,n,i,r,s,a,o,l,u){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,a,o,l,u)}set(e,n,i,r,s,a,o,l,u){const f=this.elements;return f[0]=e,f[1]=r,f[2]=o,f[3]=n,f[4]=s,f[5]=l,f[6]=i,f[7]=a,f[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,a=i[0],o=i[3],l=i[6],u=i[1],f=i[4],p=i[7],h=i[2],m=i[5],x=i[8],y=r[0],g=r[3],d=r[6],v=r[1],b=r[4],M=r[7],E=r[2],w=r[5],A=r[8];return s[0]=a*y+o*v+l*E,s[3]=a*g+o*b+l*w,s[6]=a*d+o*M+l*A,s[1]=u*y+f*v+p*E,s[4]=u*g+f*b+p*w,s[7]=u*d+f*M+p*A,s[2]=h*y+m*v+x*E,s[5]=h*g+m*b+x*w,s[8]=h*d+m*M+x*A,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],f=e[8];return n*a*f-n*o*u-i*s*f+i*o*l+r*s*u-r*a*l}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],f=e[8],p=f*a-o*u,h=o*l-f*s,m=u*s-a*l,x=n*p+i*h+r*m;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/x;return e[0]=p*y,e[1]=(r*u-f*i)*y,e[2]=(o*i-r*a)*y,e[3]=h*y,e[4]=(f*n-r*l)*y,e[5]=(r*s-o*n)
vendor: 65,373 bytes, line 44
44*y,e[6]=m*y,e[7]=(i*l-u*n)*y,e[8]=(a*n-i*s)*y,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,s,a,o){const l=Math.cos(s),u=Math.sin(s);return this.set(i*l,i*u,-i*(l*a+u*o)+a+e,-r*u,r*l,-r*(-u*a+l*o)+o+n,0,0,1),this}scale(e,n){return sa("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Bu.makeScale(e,n)),this}rotate(e){return sa("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Bu.makeRotation(-e)),this}translate(e,n){return sa("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Bu.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Lp.prototype.isMatrix3=!0;let Ye=Lp;const Bu=new Ye,pg=new Ye().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),mg=new Ye().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function wb(){const t={enabled:!0,workingColorSpace:Dc,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===ft&&(r.r=Yi(r.r),r.g=Yi(r.g),r.b=Yi(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===ft&&(r.r=aa(r.r),r.g=aa(r.g),r.b=aa(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===xr?Lc:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return sa("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return sa("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Dc]:{primaries:e,whitePoint:i,transfer:Lc,toXYZ:pg,fromXYZ:mg,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Cn},outputColorSpaceConfig:{drawingBufferColorSpace:Cn}},[Cn]:{primaries:e,whitePoint:i,transfer:ft,toXYZ:pg,fromXYZ:mg,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Cn}}}),t}const rt=wb();function Yi(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function aa(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Ss;class Tb{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Ss===void 0&&(Ss=Ic("canvas")),Ss.width=e.width,Ss.height=e.height;const r=Ss.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Ss}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Ic("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=Yi(s[a]/255)*255;return i.putImageData(r,0,0),n}else if(e.data){const n=e.data.slice(0);for(let i=0;i<n.length;i++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[i]=Math.floor(Yi(n[i]/255)*255):n[i]=Yi(n[i]);return{data:n,width:e.width,height:e.height}}else return He("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Cb=0;class Ep{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Cb++}),this.uuid=zo(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):typeof VideoFrame<"u"&&n instanceof VideoFrame?e.set(n.displayWidth,n.displayHeight,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(Gu(r[a].image)):s.push(Gu(r[a]))}else s=Gu(r);i.url=s}return n||(e.images[this.uuid]=i),i}}function Gu(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?Tb.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(He("Texture: Unable to serialize Texture."),{})}let Ab=0;const Hu=new H;class mn extends zr{constructor(e=mn.DEFAULT_IMAGE,n=mn.DEFAULT_MAPPING,i=Wi,r=Wi,s=pn,a=Qr,o=hi,l=jn,u=mn.DEFAULT_ANISOTROPY,f=xr){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ab++}),this.uuid=zo(),this.name="",this.source=new Ep(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=l,this.offset=new De(0,0),this.repeat=new De(1,1),this.center=new De(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ye,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=f,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Hu).x}get height(){return this.source.getSize(Hu).y}get depth(){return this.source.getSize(Hu).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){He(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){He(`Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,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&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==r_)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Af:e.x=e.x-Math.floor(e.x);break;case Wi:e.x=e.x<0?0:1;break;case Rf: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 Af:e.y=e.y-Math.floor(e.y);break;case Wi:e.y=e.y<0?0:1;break;case Rf: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++}}mn.DEFAULT_IMAGE=null;mn.DEFAULT_MAPPING=r_;mn.DEFAULT_ANISOTROPY=1;const Ip=class Ip{constructor(e=0,n=0,i=0,r=1){this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("THREE.Vector4: 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("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*n+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*n+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*n+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*n+a[7]*i+a[11]*r+a[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 n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const l=e.elements,u=l[0],f=l[4],p=l[8],h=l[1],m=l[5],x=l[9],y=l[2],g=l[6],d=l[10];if(Math.abs(f-h)<.01&&Math.abs(p-y)<.01&&Math.abs(x-g)<.01){if(Math.abs(f+h)<.1&&Math.abs(p+y)<.1&&Math.abs(x+g)<.1&&Math.abs(u+m+d-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(u+1)/2,M=(m+1)/2,E=(d+1)/2,w=(f+h)/4,A=(p+y)/4,_=(x+g)/4;return b>M&&b>E?b<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(b),r=w/i,s=A/i):M>E?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=w/r,s=_/r):E<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(E),i=A/s,r=_/s),this.set(i,r,s,n),this}let v=Math.sqrt((g-x)*(g-x)+(p-y)*(p-y)+(h-f)*(h-f));return Math.abs(v)<.001&&(v=1),this.x=(g-x)/v,this.y=(p-y)/v,this.z=(h-f)/v,this.w=Math.acos((u+m+d-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=et(this.x,e.x,n.x),this.y=et(this.y,e.y,n.y),this.z=et(this.z,e.z,n.z),this.w=et(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=et(this.x,e,n),this.y=et(this.y,e,n),this.z=et(this.z,e,n),this.w=et(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(et(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};Ip.prototype.isVector4=!0;let Nt=Ip;class Rb extends zr{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:pn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new Nt(0,0,e,n),this.scissorTest=!1,this.viewport=new Nt(0,0,e,n),this.textures=[];const r={width:e,height:n,depth:i.depth},s=new mn(r),a=i.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview,this.useArrayDepthTexture=i.useArrayDepthTexture}_setTextureOptions(e={}){const n={minFilter:pn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(n)}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,n,i=1){if(this.width!==e||this.height!==n||this.depth!==i){this.width=e,this.height=n,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=n,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const r=Object.assign({},e.textures[n].image);this.textures[n].source=new Ep(r)}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.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ki extends Rb{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class h_ extends mn{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=tn,this.minFilter=tn,this.wrapR=Wi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Pb extends mn{constructor(e=null,n=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=tn,this.minFilter=tn,this.wrapR=Wi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Uc=class Uc{constructor(e,n,i,r,s,a,o,l,u,f,p,h,m,x,y,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,a,o,l,u,f,p,h,m,x,y,g)}set(e,n,i,r,s,a,o,l,u,f,p,h,m,x,y,g){const d=this.elements;return d[0]=e,d[4]=n,d[8]=i,d[12]=r,d[1]=s,d[5]=a,d[9]=o,d[13]=l,d[2]=u,d[6]=f,d[10]=p,d[14]=h,d[3]=m,d[7]=x,d[11]=y,d[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Uc().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return this.determinantAffine()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();const n=this.elements,i=e.elements,r=1/Ms.setFromMatrixColumn(e,0).length(),s=1/Ms.setFromMatrixColumn(e,1).length(),a=1/Ms.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*a,n[9]=i[9]*a,n[10]=i[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),u=Math.sin(r),f=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const h=a*f,m=a*p,x=o*f,y=o*p;n[0]=l*f,n[4]=-l*p,n[8]=u,n[1]=m+x*u,n[5]=h-y*u,n[9]=-o*l,n[2]=y-h*u,n[6]=x+m*u,n[10]=a*l}else if(e.order==="YXZ"){const h=l*f,m=l*p,x=u*f,y=u*p;n[0]=h+y*o,n[4]=x*o-m,n[8]=a*u,n[1]=a*p,n[5]=a*f,n[9]=-o,n[2]=m*o-x,n[6]=y+h*o,n[10]=a*l}else if(e.order==="ZXY"){const h=l*f,m=l*p,x=u*f,y=u*p;n[0]=h-y*o,n[4]=-a*p,n[8]=x+m*o,n[1]=m+x*o,n[5]=a*f,n[9]=y-h*o,n[2]=-a*u,n[6]=o,n[10]=a*l}else if(e.order==="ZYX"){const h=a*f,m=a*p,x=o*f,y=o*p;n[0]=l*f,n[4]=x*u-m,n[8]=h*u+y,n[1]=l*p,n[5]=y*u+h,n[9]=m*u-x,n[2]=-u,n[6]=o*l,n[10]=a*l}else if(e.order==="YZX"){const h=a*l,m=a*u,x=o*l,y=o*u;n[0]=l*f,n[4]=y-h*p,n[8]=x*p+m,n[1]=p,n[5]=a*f,n[9]=-o*f,n[2]=-u*f,n[6]=m*p+x,n[10]=h-y*p}else if(e.order==="XZY"){const h=a*l,m=a*u,x=o*l,y=o*u;n[0]=l*f,n[4]=-p,n[8]=u*f,n[1]=h*p+y,n[5]=a*f,n[9]=m*p-x,n[2]=x*p-m,n[6]=o*f,n[10]=y*p+h}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(kb,e,Nb)}lookAt(e,n,i){const r=this.elements;return Un.subVectors(e,n),Un.lengthSq()===0&&(Un.z=1),Un.normalize(),ar.crossVectors(i,Un),ar.lengthSq()===0&&(Math.abs(i.z)===1?Un.x+=1e-4:Un.z+=1e-4,Un.normalize(),ar.crossVectors(i,Un)),ar.normalize(),ul.crossVectors(Un,ar),r[0]=ar.x,r[4]=ul.x,r[8]=Un.x,r[1]=ar.y,r[5]=ul.y,r[9]=Un.y,r[2]=ar.z,r[6]=ul.z,r[10]=Un.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,a=i[0],o=i[4],l=i[8],u=i[12],f=i[1],p=i[5],h=i[9],m=i[13],x=i[2],y=i[6],g=i[10],d=i[14],v=i[3],b=i[7],M=i[11],E=i[15],w=r[0],A=r[4],_=r[8],T=r[12],N=r[1],L=r[5],R=r[9],D=r[13],F=r[2],k=r[6],B=r[10],z=r[14],I=r[3],V=r[7],Q=r[11],re=r[15];return s[0]=a*w+o*N+l*F+u*I,s[4]=a*A+o*L+l*k+u*V,s[8]=a*_+o*R+l*B+u*Q,s[12]=a*T+o*D+l*z+u*re,s[1]=f*w+p*N+h*F+m*I,s[5]=f*A+p*L+h*k+m*V,s[9]=f*_+p*R+h*B+m*Q,s[13]=f*T+p*D+h*z+m*re,s[2]=x*w+y*N+g*F+d*I,s[6]=x*A+y*L+g*k+d*V,s[10]=x*_+y*R+g*B+d*Q,s[14]=x*T+y*D+g*z+d*re,s[3]=v*w+b*N+M*F+E*I,s[7]=v*A+b*L+M*k+E*V,s[11]=v*_+b*R+M*B+E*Q,s[15]=v*T+b*D+M*z+E*re,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],u=e[13],f=e[2],p=e[6],h=e[10],m=e[14],x=e[3],y=e[7],g=e[11],d=e[15],v=l*m-u*h,b=o*m-u*p,M=o*h-l*p,E=a*m-u*f,w=a*h-l*f,A=a*p-o*f;return n*(y*v-g*b+d*M)-i*(x*v-g*E+d*w)+r*(x*b-y*E+d*A)-s*(x*M-y*w+g*A)}determinantAffine(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],u=e[6],f=e[10];return n*(a*f-o*u)-i*(s*f-o*l)+r*(s*u-a*l)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],f=e[8],p=e[9],h=e[10],m=e[11],x=e[12],y=e[13],g=e[14],d=e[15],v=n*o-i*a,b=n*l-r*a,M=n*u-s*a,E=i*l-r*o,w=i*u-s*o,A=r*u-s*l,_=f*y-p*x,T=f*g-h*x,N=f*d-m*x,L=p*g-h*y,R=p*d-m*y,D=h*d-m*g,F=v*D-b*R+M*L+E*N-w*T+A*_;if(F===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const k=1/F;return e[0]=(o*D-l*R+u*L)*k,e[1]=(r*R-i*D-s*L)*k,e[2]=(y*A-g*w+d*E)*k,e[3]=(h*w-p*A-m*E)*k,e[4]=(l*N-a*D-u*T)*k,e[5]=(n*D-r*N+s*T)*k,e[6]=(g*M-x*A-d*b)*k,e[7]=(f*A-h*M+m*b)*k,e[8]=(a*R-o*N+u*_)*k,e[9]=(i*N-n*R-s*_)*k,e[10]=(x*w-y*M+d*v)*k,e[11]=(p*M-f*w-m*v)*k,e[12]=(o*T-a*L-l*_)*k,e[13]=(n*L-i*T+r*_)*k,e[14]=(y*b-x*E-g*v)*k,e[15]=(f*E-p*b+h*v)*k,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,a=e.x,o=e.y,l=e.z,u=s*a,f=s*o;return this.set(u*a+i,u*o-r*l,u*l+r*o,0,u*o+r*l,f*o+i,f*l-r*a,0,u*l-r*o,f*l+r*a,s*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,a){return this.set(1,i,s,0,e,1,a,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,a=n._y,o=n._z,l=n._w,u=s+s,f=a+a,p=o+o,h=s*u,m=s*f,x=s*p,y=a*f,g=a*p,d=o*p,v=l*u,b=l*f,M=l*p,E=i.x,w=i.y,A=i.z;return r[0]=(1-(y+d))*E,r[1]=(m+M)*E,r[2]=(x-b)*E,r[3]=0,r[4]=(m-M)*w,r[5]=(1-(h+d))*w,r[6]=(g+v)*w,r[7]=0,r[8]=(x+b)*A,r[9]=(g-v)*A,r[10]=(1-(h+y))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinantAffine();if(s===0)return i.set(1,1,1),n.identity(),this;let a=Ms.set(r[0],r[1],r[2]).length();const o=Ms.set(r[4],r[5],r[6]).length(),l=Ms.set(r[8],r[9],r[10]).length();s<0&&(a=-a),si.copy(this);const u=1/a,f=1/o,p=1/l;return si.elements[0]*=u,si.elements[1]*=u,si.elements[2]*=u,si.elements[4]*=f,si.elements[5]*=f,si.elements[6]*=f,si.elements[8]*=p,si.elements[9]*=p,si.elements[10]*=p,n.setFromRotationMatrix(si),i.x=a,i.y=o,i.z=l,this}makePerspective(e,n,i,r,s,a,o=Ci,l=!1){const u=this.elements,f=2*s/(n-e),p=2*s/(i-r),h=(n+e)/(n-e),m=(i+r)/(i-r);let x,y;if(l)x=s/(a-s),y=a*s/(a-s);else if(o===Ci)x=-(a+s)/(a-s),y=-2*a*s/(a-s);else if(o===No)x=-a/(a-s),y=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return u[0]=f,u[4]=0,u[8]=h,u[12]=0,u[1]=0,u[5]=p,u[9]=m,u[13]=0,u[2]=0,u[6]=0,u[10]=x,u[14]=y,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,n,i,r,s,a,o=Ci,l=!1){const u=this.elements,f=2/(n-e),p=2/(i-r),h=-(n+e)/(n-e),m=-(i+r)/(i-r);let x,y;if(l)x=1/(a-s),y=a/(a-s);else if(o===Ci)x=-2/(a-s),y=-(a+s)/(a-s);else if(o===No)x=-1/(a-s),y=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return u[0]=f,u[4]=0,u[8]=0,u[12]=h,u[1]=0,u[5]=p,u[9]=0,u[13]=m,u[2]=0,u[6]=0,u[10]=x,u[14]=y,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}};Uc.prototype.isMatrix4=!0;let Ft=Uc;const Ms=new H,si=new Ft,kb=new H(0,0,0),Nb=new H(1,1,1),ar=new H,ul=new H,Un=new H,gg=new Ft,vg=new Lr;class Ir{constructor(e=0,n=0,i=0,r=Ir.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],u=r[5],f=r[9],p=r[2],h=r[6],m=r[10];switch(n){case"XYZ":this._y=Math.asin(et(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-f,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-et(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(et(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-p,m),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-et(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(h,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin(et(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,u),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-et(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-f,m),this._y=0);break;default:He("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return gg.makeRotationFromQuaternion(e),this.setFromRotationMatrix(gg,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return vg.setFromEuler(this),this.setFromQuaternion(vg,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ir.DEFAULT_ORDER="XYZ";class p_{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 Db=0;const xg=new H,Es=new Lr,Ii=new Ft,dl=new H,La=new H,Lb=new H,Ib=new Lr,_g=new H(1,0,0),yg=new H(0,1,0),Sg=new H(0,0,1),Mg={type:"added"},Ub={type:"removed"},bs={type:"childadded",child:null},Vu={type:"childremoved",child:null};class sn extends zr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Db++}),this.uuid=zo(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=sn.DEFAULT_UP.clone();const e=new H,n=new Ir,i=new Lr,r=new H(1,1,1);function s(){i.setFromEuler(n,!1)}function a(){n.setFromQuaternion(i,void 0,!1)}n._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ft},normalMatrix:{value:new Ye}}),this.matrix=new Ft,this.matrixWorld=new Ft,this.matrixAutoUpdate=sn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new p_,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.static=!1,this.userData={},this.pivot=null}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,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return Es.setFromAxisAngle(e,n),this.quaternion.multiply(Es),this}rotateOnWorldAxis(e,n){return Es.setFromAxisAngle(e,n),this.quaternion.premultiply(Es),this}rotateX(e){return this.rotateOnAxis(_g,e)}rotateY(e){return this.rotateOnAxis(yg,e)}rotateZ(e){return this.rotateOnAxis(Sg,e)}translateOnAxis(e,n){return xg.copy(e).applyQuaternion(this.quaternion),this.position.add(xg.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(_g,e)}translateY(e){return this.translateOnAxis(yg,e)}translateZ(e){return this.translateOnAxis(Sg,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ii.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?dl.copy(e):dl.set(e,n,i);const r=this.parent;this.updateWorldMatrix(!0,!1),La.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ii.lookAt(La,dl,this.up):Ii.lookAt(dl,La,this.up),this.quaternion.setFromRotationMatrix(Ii),r&&(Ii.extractRotation(r.matrixWorld),Es.setFromRotationMatrix(Ii),this.quaternion.premultiply(Es.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(ot("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(Mg),bs.child=e,this.dispatchEvent(bs),bs.child=null):ot("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Ub),Vu.child=e,this.dispatchEvent(Vu),Vu.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),Ii.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ii.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ii),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Mg),bs.child=e,this.dispatchEvent(bs),bs.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(e,n);if(a!==void 0)return a}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(La,e,Lb),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(La,Ib,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const n=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=n-s[0]*n-s[4]*i-s[8]*r,s[13]+=i-s[1]*n-s[5]*i-s[9]*r,s[14]+=r-s[2]*n-s[6]*i-s[10]*r}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 n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n,i=!1){const r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,i=!0),n===!0){const s=this.children;for(let a=0,o=s.length;a<o;a++)s[a].updateWorldMatrix(!1,!0,i)}}toJSON(e){const n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let u=0,f=l.length;u<f;u++){const p=l[u];s(e.shapes,p)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,u=this.material.length;l<u;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(n){const o=a(e.geometries),l=a(e.materials),u=a(e.textures),f=a(e.images),p=a(e.shapes),h=a(e.skeletons),m=a(e.animations),x=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),f.length>0&&(i.images=f),p.length>0&&(i.shapes=p),h.length>0&&(i.skeletons=h),m.length>0&&(i.animations=m),x.length>0&&(i.nodes=x)}return i.object=r,i;function a(o){const l=[];for(const u in o){const f=o[u];delete f.metadata,l.push(f)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}sn.DEFAULT_UP=new H(0,1,0);sn.DEFAULT_MATRIX_AUTO_UPDATE=!0;sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class Ya extends sn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Fb={type:"move"};class Wu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ya,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 Ya,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new H,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new H),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ya,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new H,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new H,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){a=!0;for(const y of e.hand.values()){const g=n.getJointPose(y,i),d=this._getHandJoint(u,y);g!==null&&(d.matrix.fromArray(g.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,d.jointRadius=g.radius),d.visible=g!==null}const f=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],h=f.position.distanceTo(p.position),m=.02,x=.005;u.inputState.pinching&&h>m+x?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&h<=m-x&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Fb)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new Ya;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}const m_={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},or={h:0,s:0,l:0},fl={h:0,s:0,l:0};function Xu(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class st{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Cn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,rt.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=rt.workingColorSpace){return this.r=e,this.g=n,this.b=i,rt.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=rt.workingColorSpace){if(e=Eb(e,1),n=et(n,0,1),i=et(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,a=2*i-s;this.r=Xu(a,s,e+1/3),this.g=Xu(a,s,e),this.b=Xu(a,s,e-1/3)}return rt.colorSpaceToWorking(this,r),this}setStyle(e,n=Cn){function i(s){s!==void 0&&parseFloat(s)<1&&He("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(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,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(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,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:He("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(s,16),n);He("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Cn){const i=m_[e.toLowerCase()];return i!==void 0?this.setHex(i,n):He("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=Yi(e.r),this.g=Yi(e.g),this.b=Yi(e.b),this}copyLinearToSRGB(e){return this.r=aa(e.r),this.g=aa(e.g),this.b=aa(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cn){return rt.workingToColorSpace(fn.copy(this),e),Math.round(et(fn.r*255,0,255))*65536+Math.round(et(fn.g*255,0,255))*256+Math.round(et(fn.b*255,0,255))}getHexString(e=Cn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=rt.workingColorSpace){rt.workingToColorSpace(fn.copy(this),n);const i=fn.r,r=fn.g,s=fn.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,u;const f=(o+a)/2;if(o===a)l=0,u=0;else{const p=a-o;switch(u=f<=.5?p/(a+o):p/(2-a-o),a){case i:l=(r-s)/p+(r<s?6:0);break;case r:l=(s-i)/p+2;break;case s:l=(i-r)/p+4;break}l/=6}return e.h=l,e.s=u,e.l=f,e}getRGB(e,n=rt.workingColorSpace){return rt.workingToColorSpace(fn.copy(this),n),e.r=fn.r,e.g=fn.g,e.b=fn.b,e}getStyle(e=Cn){rt.workingToColorSpace(fn.copy(this),e);const n=fn.r,i=fn.g,r=fn.b;return e!==Cn?`color(${e} ${n.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,n,i){return this.getHSL(or),this.setHSL(or.h+e,or.s+n,or.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.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,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,i){return this.r=e.r+(n.r-e.r)*i,this.g=e.g+(n.g-e.g)*i,this.b=e.b+(n.b-e.b)*i,this}lerpHSL(e,n){this.getHSL(or),e.getHSL(fl);const i=zu(or.h,fl.h,n),r=zu(or.s,fl.s,n),s=zu(or.l,fl.l,n);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*n+s[3]*i+s[6]*r,this.g=s[1]*n+s[4]*i+s[7]*r,this.b=s[2]*n+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const fn=new st;st.NAMES=m_;class Ob extends sn{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 Ir,this.environmentIntensity=1,this.environmentRotation=new Ir,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}const ai=new H,Ui=new H,$u=new H,Fi=new H,ws=new H,Ts=new H,Eg=new H,Yu=new H,Ku=new H,qu=new H,Zu=new Nt,Ju=new Nt,Qu=new Nt;class fi{constructor(e=new H,n=new H,i=new H){this.a=e,this.b=n,this.c=i}static getNormal(e,n,i,r){r.subVectors(i,n),ai.subVectors(e,n),r.cross(ai);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){ai.subVectors(r,n),Ui.subVectors(i,n),$u.subVectors(e,n);const a=ai.dot(ai),o=ai.dot(Ui),l=ai.dot($u),u=Ui.dot(Ui),f=Ui.dot($u),p=a*u-o*o;if(p===0)return s.set(0,0,0),null;const h=1/p,m=(u*l-o*f)*h,x=(a*f-o*l)*h;return s.set(1-m-x,x,m)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,Fi)===null?!1:Fi.x>=0&&Fi.y>=0&&Fi.x+Fi.y<=1}static getInterpolation(e,n,i,r,s,a,o,l){return this.getBarycoord(e,n,i,r,Fi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Fi.x),l.addScaledVector(a,Fi.y),l.addScaledVector(o,Fi.z),l)}static getInterpolatedAttribute(e,n,i,r,s,a){return Zu.setScalar(0),Ju.setScalar(0),Qu.setScalar(0),Zu.fromBufferAttribute(e,n),Ju.fromBufferAttribute(e,i),Qu.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Zu,s.x),a.addScaledVector(Ju,s.y),a.addScaledVector(Qu,s.z),a}static isFrontFacing(e,n,i,r){return ai.subVectors(i,n),Ui.subVectors(e,n),ai.cross(Ui).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),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 ai.subVectors(this.c,this.b),Ui.subVectors(this.a,this.b),ai.cross(Ui).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return fi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return fi.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return fi.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return fi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return fi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let a,o;ws.subVectors(r,i),Ts.subVectors(s,i),Yu.subVectors(e,i);const l=ws.dot(Yu),u=Ts.dot(Yu);if(l<=0&&u<=0)return n.copy(i);Ku.subVectors(e,r);const f=ws.dot(Ku),p=Ts.dot(Ku);if(f>=0&&p<=f)return n.copy(r);const h=l*p-f*u;if(h<=0&&l>=0&&f<=0)return a=l/(l-f),n.copy(i).addScaledVector(ws,a);qu.subVectors(e,s);const m=ws.dot(qu),x=Ts.dot(qu);if(x>=0&&m<=x)return n.copy(s);const y=m*u-l*x;if(y<=0&&u>=0&&x<=0)return o=u/(u-x),n.copy(i).addScaledVector(Ts,o);const g=f*x-m*p;if(g<=0&&p-f>=0&&m-x>=0)return Eg.subVectors(s,r),o=(p-f)/(p-f+(m-x)),n.copy(r).addScaledVector(Eg,o);const d=1/(g+y+h);return a=y*d,o=h*d,n.copy(i).addScaledVector(ws,a).addScaledVector(Ts,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class jo{constructor(e=new H(1/0,1/0,1/0),n=new H(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n+=3)this.expandByPoint(oi.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(oi.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=oi.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}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,n=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,oi):oi.fromBufferAttribute(s,a),oi.applyMatrix4(e.matrixWorld),this.expandByPoint(oi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),hl.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),hl.copy(i.boundingBox)),hl.applyMatrix4(e.matrixWorld),this.union(hl)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],n);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,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,oi),oi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ia),pl.subVectors(this.max,Ia),Cs.subVectors(e.a,Ia),As.subVectors(e.b,Ia),Rs.subVectors(e.c,Ia),lr.subVectors(As,Cs),cr.subVectors(Rs,As),Gr.subVectors(Cs,Rs);let n=[0,-lr.z,lr.y,0,-cr.z,cr.y,0,-Gr.z,Gr.y,lr.z,0,-lr.x,cr.z,0,-cr.x,Gr.z,0,-Gr.x,-lr.y,lr.x,0,-cr.y,cr.x,0,-Gr.y,Gr.x,0];return!ed(n,Cs,As,Rs,pl)||(n=[1,0,0,0,1,0,0,0,1],!ed(n,Cs,As,Rs,pl))?!1:(ml.crossVectors(lr,cr),n=[ml.x,ml.y,ml.z],ed(n,Cs,As,Rs,pl))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,oi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(oi).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:(Oi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Oi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Oi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Oi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Oi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Oi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Oi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Oi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Oi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Oi=[new H,new H,new H,new H,new H,new H,new H,new H],oi=new H,hl=new jo,Cs=new H,As=new H,Rs=new H,lr=new H,cr=new H,Gr=new H,Ia=new H,pl=new H,ml=new H,Hr=new H;function ed(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){Hr.fromArray(t,s);const o=r.x*Math.abs(Hr.x)+r.y*Math.abs(Hr.y)+r.z*Math.abs(Hr.z),l=e.dot(Hr),u=n.dot(Hr),f=i.dot(Hr);if(Math.max(-Math.max(l,u,f),Math.min(l,u,f))>o)return!1}return!0}const Ht=new H,gl=new De;let zb=0;class Ni extends zr{constructor(e,n,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:zb++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=cg,this.updateRanges=[],this.gpuType=Ti,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;
vendor: 3,121 bytes, line 44
44for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=n.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,i=this.count;n<i;n++)gl.fromBufferAttribute(this,n),gl.applyMatrix3(e),this.setXY(n,gl.x,gl.y);else if(this.itemSize===3)for(let n=0,i=this.count;n<i;n++)Ht.fromBufferAttribute(this,n),Ht.applyMatrix3(e),this.setXYZ(n,Ht.x,Ht.y,Ht.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)Ht.fromBufferAttribute(this,n),Ht.applyMatrix4(e),this.setXYZ(n,Ht.x,Ht.y,Ht.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)Ht.fromBufferAttribute(this,n),Ht.applyNormalMatrix(e),this.setXYZ(n,Ht.x,Ht.y,Ht.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)Ht.fromBufferAttribute(this,n),Ht.transformDirection(e),this.setXYZ(n,Ht.x,Ht.y,Ht.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let i=this.array[e*this.itemSize+n];return this.normalized&&(i=Da(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=En(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Da(n,this.array)),n}setX(e,n){return this.normalized&&(n=En(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Da(n,this.array)),n}setY(e,n){return this.normalized&&(n=En(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=Da(n,this.array)),n}setZ(e,n){return this.normalized&&(n=En(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=Da(n,this.array)),n}setW(e,n){return this.normalized&&(n=En(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=En(n,this.array),i=En(i,this.array)),this.array[e+0]=n,this.array[e+1]=i,this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=En(n,this.array),i=En(i,this.array),r=En(r,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,n,i,r,s){return e*=this.itemSize,this.normalized&&(n=En(n,this.array),i=En(i,this.array),r=En(r,this.array),s=En(s,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(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!==cg&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class g_ extends Ni{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class v_ extends Ni{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class Qt extends Ni{constructor(e,n,i){super(new Float32Array(e),n,i)}}const jb=new jo,Ua=new H,td=new H;class bp{constructor(e=new H,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}
vendor: 14,327 bytes, line 44
44setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):jb.setFromPoints(e).getCenter(i);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),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 n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const i=this.center.distanceToSquared(e);return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ua.subVectors(e,this.center);const n=Ua.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(Ua,r/i),this.radius+=r}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):(td.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ua.copy(e.center).add(td)),this.expandByPoint(Ua.copy(e.center).sub(td))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let Bb=0;const Yn=new Ft,nd=new sn,Ps=new H,Fn=new jo,Fa=new jo,qt=new H;class ni extends zr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Bb++}),this.uuid=zo(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(_b(e)?v_:g_)(e,1):this.index=e,this}setIndirect(e,n=0){return this.indirect=e,this.indirectOffset=n,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,i=0){this.groups.push({start:e,count:n,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new Ye().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return Yn.makeRotationFromQuaternion(e),this.applyMatrix4(Yn),this}rotateX(e){return Yn.makeRotationX(e),this.applyMatrix4(Yn),this}rotateY(e){return Yn.makeRotationY(e),this.applyMatrix4(Yn),this}rotateZ(e){return Yn.makeRotationZ(e),this.applyMatrix4(Yn),this}translate(e,n,i){return Yn.makeTranslation(e,n,i),this.applyMatrix4(Yn),this}scale(e,n,i){return Yn.makeScale(e,n,i),this.applyMatrix4(Yn),this}lookAt(e){return nd.lookAt(e),nd.updateMatrix(),this.applyMatrix4(nd.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ps).negate(),this.translate(Ps.x,Ps.y,Ps.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Qt(i,3))}else{const i=Math.min(e.length,n.count);for(let r=0;r<i;r++){const s=e[r];n.setXYZ(r,s.x,s.y,s.z||0)}e.length>n.count&&He("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new jo);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){ot("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new H(-1/0,-1/0,-1/0),new H(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i<r;i++){const s=n[i];Fn.setFromBufferAttribute(s),this.morphTargetsRelative?(qt.addVectors(this.boundingBox.min,Fn.min),this.boundingBox.expandByPoint(qt),qt.addVectors(this.boundingBox.max,Fn.max),this.boundingBox.expandByPoint(qt)):(this.boundingBox.expandByPoint(Fn.min),this.boundingBox.expandByPoint(Fn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&ot('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 bp);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){ot("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new H,1/0);return}if(e){const i=this.boundingSphere.center;if(Fn.setFromBufferAttribute(e),n)for(let s=0,a=n.length;s<a;s++){const o=n[s];Fa.setFromBufferAttribute(o),this.morphTargetsRelative?(qt.addVectors(Fn.min,Fa.min),Fn.expandByPoint(qt),qt.addVectors(Fn.max,Fa.max),Fn.expandByPoint(qt)):(Fn.expandByPoint(Fa.min),Fn.expandByPoint(Fa.max))}Fn.getCenter(i);let r=0;for(let s=0,a=e.count;s<a;s++)qt.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(qt));if(n)for(let s=0,a=n.length;s<a;s++){const o=n[s],l=this.morphTargetsRelative;for(let u=0,f=o.count;u<f;u++)qt.fromBufferAttribute(o,u),l&&(Ps.fromBufferAttribute(e,u),qt.add(Ps)),r=Math.max(r,i.distanceToSquared(qt))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&ot('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){ot("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=n.position,r=n.normal,s=n.uv;let a=this.getAttribute("tangent");(a===void 0||a.count!==i.count)&&(a=new Ni(new Float32Array(4*i.count),4),this.setAttribute("tangent",a));const o=[],l=[];for(let _=0;_<i.count;_++)o[_]=new H,l[_]=new H;const u=new H,f=new H,p=new H,h=new De,m=new De,x=new De,y=new H,g=new H;function d(_,T,N){u.fromBufferAttribute(i,_),f.fromBufferAttribute(i,T),p.fromBufferAttribute(i,N),h.fromBufferAttribute(s,_),m.fromBufferAttribute(s,T),x.fromBufferAttribute(s,N),f.sub(u),p.sub(u),m.sub(h),x.sub(h);const L=1/(m.x*x.y-x.x*m.y);isFinite(L)&&(y.copy(f).multiplyScalar(x.y).addScaledVector(p,-m.y).multiplyScalar(L),g.copy(p).multiplyScalar(m.x).addScaledVector(f,-x.x).multiplyScalar(L),o[_].add(y),o[T].add(y),o[N].add(y),l[_].add(g),l[T].add(g),l[N].add(g))}let v=this.groups;v.length===0&&(v=[{start:0,count:e.count}]);for(let _=0,T=v.length;_<T;++_){const N=v[_],L=N.start,R=N.count;for(let D=L,F=L+R;D<F;D+=3)d(e.getX(D+0),e.getX(D+1),e.getX(D+2))}const b=new H,M=new H,E=new H,w=new H;function A(_){E.fromBufferAttribute(r,_),w.copy(E);const T=o[_];b.copy(T),b.sub(E.multiplyScalar(E.dot(T))).normalize(),M.crossVectors(w,T);const L=M.dot(l[_])<0?-1:1;a.setXYZW(_,b.x,b.y,b.z,L)}for(let _=0,T=v.length;_<T;++_){const N=v[_],L=N.start,R=N.count;for(let D=L,F=L+R;D<F;D+=3)A(e.getX(D+0)),A(e.getX(D+1)),A(e.getX(D+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let i=this.getAttribute("normal");if(i===void 0||i.count!==n.count)i=new Ni(new Float32Array(n.count*3),3),this.setAttribute("normal",i);else for(let h=0,m=i.count;h<m;h++)i.setXYZ(h,0,0,0);const r=new H,s=new H,a=new H,o=new H,l=new H,u=new H,f=new H,p=new H;if(e)for(let h=0,m=e.count;h<m;h+=3){const x=e.getX(h+0),y=e.getX(h+1),g=e.getX(h+2);r.fromBufferAttribute(n,x),s.fromBufferAttribute(n,y),a.fromBufferAttribute(n,g),f.subVectors(a,s),p.subVectors(r,s),f.cross(p),o.fromBufferAttribute(i,x),l.fromBufferAttribute(i,y),u.fromBufferAttribute(i,g),o.add(f),l.add(f),u.add(f),i.setXYZ(x,o.x,o.y,o.z),i.setXYZ(y,l.x,l.y,l.z),i.setXYZ(g,u.x,u.y,u.z)}else for(let h=0,m=n.count;h<m;h+=3)r.fromBufferAttribute(n,h+0),s.fromBufferAttribute(n,h+1),a.fromBufferAttribute(n,h+2),f.subVectors(a,s),p.subVectors(r,s),f.cross(p),i.setXYZ(h+0,f.x,f.y,f.z),i.setXYZ(h+1,f.x,f.y,f.z),i.setXYZ(h+2,f.x,f.y,f.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,i=e.count;n<i;n++)qt.fromBufferAttribute(e,n),qt.normalize(),e.setXYZ(n,qt.x,qt.y,qt.z)}toNonIndexed(){function e(o,l){const u=o.array,f=o.itemSize,p=o.normalized,h=new u.constructor(l.length*f);let m=0,x=0;for(let y=0,g=l.length;y<g;y++){o.isInterleavedBufferAttribute?m=l[y]*o.data.stride+o.offset:m=l[y]*f;for(let d=0;d<f;d++)h[x++]=u[m++]}return new Ni(h,f,p)}if(this.index===null)return He("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new ni,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],u=e(l,i);n.setAttribute(o,u)}const s=this.morphAttributes;for(const o in s){const l=[],u=s[o];for(let f=0,p=u.length;f<p;f++){const h=u[f],m=e(h,i);l.push(m)}n.morphAttributes[o]=l}n.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const u=a[o];n.addGroup(u.start,u.count,u.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?"BufferGeometry":this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],f=[];for(let p=0,h=u.length;p<h;p++){const m=u[p];f.push(m.toJSON(e.data))}f.length>0&&(r[l]=f,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const u in r){const f=r[u];this.setAttribute(u,f.clone(n))}const s=e.morphAttributes;for(const u in s){const f=[],p=s[u];for(let h=0,m=p.length;h<m;h++)f.push(p[h].clone(n));this.morphAttributes[u]=f}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let u=0,f=a.length;u<f;u++){const p=a[u];this.addGroup(p.start,p.count,p.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}let Gb=0;class Bo extends zr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Gb++}),this.uuid=zo(),this.name="",this.type="Material",this.blending=ra,this.side=Dr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=_f,this.blendDst=yf,this.blendEquation=Yr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new st(0,0,0),this.blendAlpha=0,this.depthFunc=pa,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=lg,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ys,this.stencilZFail=ys,this.stencilZPass=ys,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 n in e){const i=e[n];if(i===void 0){He(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){He(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector2&&i&&i.isVector2||r&&r.isEuler&&i&&i.isEuler||r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 16,661 bytes, line 44
44i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==ra&&(i.blending=this.blending),this.side!==Dr&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==_f&&(i.blendSrc=this.blendSrc),this.blendDst!==yf&&(i.blendDst=this.blendDst),this.blendEquation!==Yr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==pa&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==lg&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ys&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ys&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ys&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(n){const s=r(e.textures),a=r(e.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}fromJSON(e,n){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new st().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=n[e.map]||null),e.matcap!==void 0&&(this.matcap=n[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=n[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=n[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=n[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let i=e.normalScale;Array.isArray(i)===!1&&(i=[i,i]),this.normalScale=new De().fromArray(i)}return e.displacementMap!==void 0&&(this.displacementMap=n[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=n[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=n[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=n[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=n[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=n[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=n[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=n[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=n[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=n[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=n[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=n[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=n[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=n[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new De().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=n[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=n[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=n[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=n[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=n[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=n[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=n[e.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 16,287 bytes, line 44
44adows,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.allowOverride=e.allowOverride,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++}}const zi=new H,id=new H,vl=new H,ur=new H,rd=new H,xl=new H,sd=new H;class x_{constructor(e=new H,n=new H(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,zi)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=zi.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(zi.copy(this.origin).addScaledVector(this.direction,n),zi.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){id.copy(e).add(n).multiplyScalar(.5),vl.copy(n).sub(e).normalize(),ur.copy(this.origin).sub(id);const s=e.distanceTo(n)*.5,a=-this.direction.dot(vl),o=ur.dot(this.direction),l=-ur.dot(vl),u=ur.lengthSq(),f=Math.abs(1-a*a);let p,h,m,x;if(f>0)if(p=a*l-o,h=a*o-l,x=s*f,p>=0)if(h>=-x)if(h<=x){const y=1/f;p*=y,h*=y,m=p*(p+a*h+2*o)+h*(a*p+h+2*l)+u}else h=s,p=Math.max(0,-(a*h+o)),m=-p*p+h*(h+2*l)+u;else h=-s,p=Math.max(0,-(a*h+o)),m=-p*p+h*(h+2*l)+u;else h<=-x?(p=Math.max(0,-(-a*s+o)),h=p>0?-s:Math.min(Math.max(-s,-l),s),m=-p*p+h*(h+2*l)+u):h<=x?(p=0,h=Math.min(Math.max(-s,-l),s),m=h*(h+2*l)+u):(p=Math.max(0,-(a*s+o)),h=p>0?s:Math.min(Math.max(-s,-l),s),m=-p*p+h*(h+2*l)+u);else h=a>0?-s:s,p=Math.max(0,-(a*h+o)),m=-p*p+h*(h+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(id).addScaledVector(vl,h),m}intersectSphere(e,n){zi.subVectors(e.center,this.origin);const i=zi.dot(this.direction),r=zi.dot(zi)-i*i,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,n):this.at(o,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,a,o,l;const u=1/this.direction.x,f=1/this.direction.y,p=1/this.direction.z,h=this.origin;return u>=0?(i=(e.min.x-h.x)*u,r=(e.max.x-h.x)*u):(i=(e.max.x-h.x)*u,r=(e.min.x-h.x)*u),f>=0?(s=(e.min.y-h.y)*f,a=(e.max.y-h.y)*f):(s=(e.max.y-h.y)*f,a=(e.min.y-h.y)*f),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=a),p>=0?(o=(e.min.z-h.z)*p,l=(e.max.z-h.z)*p):(o=(e.max.z-h.z)*p,l=(e.min.z-h.z)*p),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,zi)!==null}intersectTriangle(e,n,i,r,s){rd.subVectors(n,e),xl.subVectors(i,e),sd.crossVectors(rd,xl);let a=this.direction.dot(sd),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;ur.subVectors(this.origin,e);const l=o*this.direction.dot(xl.crossVectors(ur,xl));if(l<0)return null;const u=o*this.direction.dot(rd.cross(ur));if(u<0||l+u>a)return null;const f=-o*ur.dot(sd);return f<0?null:this.at(f/a,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 oo extends Bo{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new st(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 Ir,this.combine=qx,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 bg=new Ft,Vr=new x_,_l=new bp,wg=new H,yl=new H,Sl=new H,Ml=new H,ad=new H,El=new H,Tg=new H,bl=new H;class _n extends sn{constructor(e=new ni,n=new oo){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),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 n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,n){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;n.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){El.set(0,0,0);for(let l=0,u=s.length;l<u;l++){const f=o[l],p=s[l];f!==0&&(ad.fromBufferAttribute(p,e),a?El.addScaledVector(ad,f):El.addScaledVector(ad.sub(n),f))}n.add(El)}return n}raycast(e,n){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),_l.copy(i.boundingSphere),_l.applyMatrix4(s),Vr.copy(e.ray).recast(e.near),!(_l.containsPoint(Vr.origin)===!1&&(Vr.intersectSphere(_l,wg)===null||Vr.origin.distanceToSquared(wg)>(e.far-e.near)**2))&&(bg.copy(s).invert(),Vr.copy(e.ray).applyMatrix4(bg),!(i.boundingBox!==null&&Vr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Vr)))}_computeIntersections(e,n,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,u=s.attributes.uv,f=s.attributes.uv1,p=s.attributes.normal,h=s.groups,m=s.drawRange;if(o!==null)if(Array.isArray(a))for(let x=0,y=h.length;x<y;x++){const g=h[x],d=a[g.materialIndex],v=Math.max(g.start,m.start),b=Math.min(o.count,Math.min(g.start+g.count,m.start+m.count));for(let M=v,E=b;M<E;M+=3){const w=o.getX(M),A=o.getX(M+1),_=o.getX(M+2);r=wl(this,d,e,i,u,f,p,w,A,_),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=g.materialIndex,n.push(r))}}else{const x=Math.max(0,m.start),y=Math.min(o.count,m.start+m.count);for(let g=x,d=y;g<d;g+=3){const v=o.getX(g),b=o.getX(g+1),M=o.getX(g+2);r=wl(this,a,e,i,u,f,p,v,b,M),r&&(r.faceIndex=Math.floor(g/3),n.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let x=0,y=h.length;x<y;x++){const g=h[x],d=a[g.materialIndex],v=Math.max(g.start,m.start),b=Math.min(l.count,Math.min(g.start+g.count,m.start+m.count));for(let M=v,E=b;M<E;M+=3){const w=M,A=M+1,_=M+2;r=wl(this,d,e,i,u,f,p,w,A,_),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=g.materialIndex,n.push(r))}}else{const x=Math.max(0,m.start),y=Math.min(l.count,m.start+m.count);for(let g=x,d=y;g<d;g+=3){const v=g,b=g+1,M=g+2;r=wl(this,a,e,i,u,f,p,v,b,M),r&&(r.faceIndex=Math.floor(g/3),n.push(r))}}}}function Hb(t,e,n,i,r,s,a,o){let l;if(e.side===Dn?l=i.intersectTriangle(a,s,r,!0,o):l=i.intersectTriangle(r,s,a,e.side===Dr,o),l===null)return null;bl.copy(o),bl.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(bl);return u<n.near||u>n.far?null:{distance:u,point:bl.clone(),object:t}}function wl(t,e,n,i,r,s,a,o,l,u){t.getVertexPosition(o,yl),t.getVertexPosition(l,Sl),t.getVertexPosition(u,Ml);const f=Hb(t,e,n,i,yl,Sl,Ml,Tg);if(f){const p=new H;fi.getBarycoord(Tg,yl,Sl,Ml,p),r&&(f.uv=fi.getInterpolatedAttribute(r,o,l,u,p,new De)),s&&(f.uv1=fi.getInterpolatedAttribute(s,o,l,u,p,new De)),a&&(f.normal=fi.getInterpolatedAttribute(a,o,l,u,p,new H),f.normal.dot(i.direction)>0&&f.normal.multiplyScalar(-1));const h={a:o,b:l,c:u,normal:new H,materialIndex:0};fi.getNormal(yl,Sl,Ml,h.normal),f.face=h,f.barycoord=p}return f}class Vb extends mn{constructor(e=null,n=1,i=1,r,s,a,o,l,u=tn,f=tn,p,h){super(null,a,o,l,u,f,r,s,p,h),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const od=new H,Wb=new H,Xb=new Ye;class mr{constructor(e=new H(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=od.subVectors(i,n).cross(Wb.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,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,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n,i=!0){const r=e.delta(od),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return i===!0&&(a<0||a>1)?null:n.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||Xb.getNormalMatrix(e),r=this.coplanarPoint(od).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.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 Wr=new bp,$b=new De(.5,.5),Tl=new H;class wp{constructor(e=new mr,n=new mr,i=new mr,r=new mr,s=new mr,a=new mr){this.planes=[e,n,i,r,s,a]}set(e,n,i,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Ci,i=!1){const r=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],u=s[3],f=s[4],p=s[5],h=s[6],m=s[7],x=s[8],y=s[9],g=s[10],d=s[11],v=s[12],b=s[13],M=s[14],E=s[15];if(r[0].setComponents(u-a,m-f,d-x,E-v).normalize(),r[1].setComponents(u+a,m+f,d+x,E+v).normalize(),r[2].setComponents(u+o,m+p,d+y,E+b).normalize(),r[3].setComponents(u-o,m-p,d-y,E-b).normalize(),i)r[4].setComponents(l,h,g,M).normalize(),r[5].setComponents(u-l,m-h,d-g,E-M).normalize();else if(r[4].setComponents(u-l,m-h,d-g,E-M).normalize(),n===Ci)r[5].setComponents(u+l,m+h,d+g,E+M).normalize();else if(n===No)r[5].setComponents(l,h,g,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Wr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Wr.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Wr)}intersectsSprite(e){Wr.center.set(0,0,0);const n=$b.distanceTo(e.center);return Wr.radius=.7071067811865476+n,Wr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Wr)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const n=this.planes;for(let i=0;i<6;i++){const r=n[i];if(Tl.x=r.normal.x>0?e.max.x:e.min.x,Tl.y=r.normal.y>0?e.max.y:e.min.y,Tl.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Tl)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class __ extends mn{constructor(e=[],n=us,i,r,s,a,o,l,u,f){super(e,n,i,r,s,a,o,l,u,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class y_ extends mn{constructor(e,n,i,r,s,a,o,l,u){super(e,n,i,r,s,a,o,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class ga extends mn{constructor(e,n,i=Di,r,s,a,o=tn,l=tn,u,f=er,p=1){if(f!==er&&f!==es)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const h={width:e,height:n,depth:p};super(h,r,s,a,o,l,f,i,u),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Ep(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class Yb extends ga{constructor(e,n=Di,i=us,r,s,a=tn,o=tn,l,u=er){const f={width:e,height:e,depth:1},p=[f,f,f,f,f,f];super(e,e,n,i,r,s,a,o,l,u),this.image=p,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class S_ extends mn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class fs extends ni{constructor(e=1,n=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],u=[],f=[],p=[];let h=0,m=0;x("z","y","x",-1,-1,i,n,e,a,s,0),x("z","y","x",1,-1,i,n,-e,a,s,1),x("x","z","y",1,1,e,i,n,r,a,2),x("x","z","y",1,-1,e,i,-n,r,a,3),x("x","y","z",1,-1,e,n,i,r,s,4),x("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Qt(u,3)),this.setAttribute("normal",new Qt(f,3)),this.setAttribute("uv",new Qt(p,2));function x(y,g,d,v,b,M,E,w,A,_,T){const N=M/A,L=E/_,R=M/2,D=E/2,F=w/2,k=A+1,B=_+1;let z=0,I=0;const V=new H;for(let Q=0;Q<B;Q++){const re=Q*L-D;for(let ae=0;ae<k;ae++){const Fe=ae*N-R;V[y]=Fe*v,V[g]=re*b,V[d]=F,u.push(V.x,V.y,V.z),V[y]=0,V[g]=0,V[d]=w>0?1:-1,f.push(V.x,V.y,V.z),p.push(ae/A),p.push(1-Q/_),z+=1}}for(let Q=0;Q<_;Q++)for(let re=0;re<A;re++){const ae=h+re+k*Q,Fe=h+re+k*(Q+1),je=h+(re+1)+k*(Q+1),Oe=h+(re+1)+k*Q;l.push(ae,Fe,Oe),l.push(Fe,je,Oe),I+=6}o.addGroup(m,I,T),m+=I,h+=z}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fs(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Tp extends ni{constructor(e=1,n=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radiu
vendor: 3,998 bytes, line 44
44s:e,segments:n,thetaStart:i,thetaLength:r},n=Math.max(3,n);const s=[],a=[],o=[],l=[],u=new H,f=new De;a.push(0,0,0),o.push(0,0,1),l.push(.5,.5);for(let p=0,h=3;p<=n;p++,h+=3){const m=i+p/n*r;u.x=e*Math.cos(m),u.y=e*Math.sin(m),a.push(u.x,u.y,u.z),o.push(0,0,1),f.x=(a[h]/e+1)/2,f.y=(a[h+1]/e+1)/2,l.push(f.x,f.y)}for(let p=1;p<=n;p++)s.push(p,p+1,0);this.setIndex(s),this.setAttribute("position",new Qt(a,3)),this.setAttribute("normal",new Qt(o,3)),this.setAttribute("uv",new Qt(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Tp(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Cp extends ni{constructor(e=1,n=1,i=1,r=32,s=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:i,radialSegments:r,heightSegments:s,openEnded:a,thetaStart:o,thetaLength:l};const u=this;r=Math.floor(r),s=Math.floor(s);const f=[],p=[],h=[],m=[];let x=0;const y=[],g=i/2;let d=0;v(),a===!1&&(e>0&&b(!0),n>0&&b(!1)),this.setIndex(f),this.setAttribute("position",new Qt(p,3)),this.setAttribute("normal",new Qt(h,3)),this.setAttribute("uv",new Qt(m,2));function v(){const M=new H,E=new H;let w=0;const A=(n-e)/i;for(let _=0;_<=s;_++){const T=[],N=_/s,L=N*(n-e)+e;for(let R=0;R<=r;R++){const D=R/r,F=D*l+o,k=Math.sin(F),B=Math.cos(F);E.x=L*k,E.y=-N*i+g,E.z=L*B,p.push(E.x,E.y,E.z),M.set(k,A,B).normalize(),h.push(M.x,M.y,M.z),m.push(D,1-N),T.push(x++)}y.push(T)}for(let _=0;_<r;_++)for(let T=0;T<s;T++){const N=y[T][_],L=y[T+1][_],R=y[T+1][_+1],D=y[T][_+1];(e>0||T!==0)&&(f.push(N,L,D),w+=3),(n>0||T!==s-1)&&(f.push(L,R,D),w+=3)}u.addGroup(d,w,0),d+=w}function b(M){const E=x,w=new De,A=new H;let _=0;const T=M===!0?e:n,N=M===!0?1:-1;for(let R=1;R<=r;R++)p.push(0,g*N,0),h.push(0,N,0),m.push(.5,.5),x++;const L=x;for(let R=0;R<=r;R++){const F=R/r*l+o,k=Math.cos(F),B=Math.sin(F);A.x=T*B,A.y=g*N,A.z=T*k,p.push(A.x,A.y,A.z),h.push(0,N,0),w.x=k*.5+.5,w.y=B*.5*N+.5,m.push(w.x,w.y),x++}for(let R=0;R<r;R++){const D=E+R,F=L+R;M===!0?f.push(F,F+1,D):f.push(F+1,F,D),_+=3}u.addGroup(d,_,M===!0?1:2),d+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Cp(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ap extends ni{constructor(e=[new De(0,-.5),new De(.5,0),new De(0,.5)],n=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:i,phiLength:r},n=Math.floor(n),r=et(r,0,Math.PI*2);const s=[],a=[],o=[],l=[],u=[],f=1/n,p=new H,h=new De,m=new H,x=new H,y=new H;let g=0,d=0;for(let v=0;v<=e.length-1;v++)switch(v){case 0:g=e[v+1].x-e[v].x,d=e[v+1].y-e[v].y,m.x=d*1,m.y=-g,m.z=d*0,y.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(y.x,y.y,y.z);break;default:g=e[v+1].x-e[v].x,d=e[v+1].y-e[v].y,m.x=d*1,m.y=-g,m.z=d*0,x.copy(m),m.x+=y.x,m.y+=y.y,m.z+=y.z,m.normalize(),l.push(m.x,m.y,m.z),y.copy(x)}for(let v=0;v<=n;v++){const b=i+v*f*r,M=Math.sin(b),E=Math.cos(b);for(let w=0;w<=e.length-1;w++){p.x=e[w].x*M,p.y=e[w].y,p.z=e[w].x*E,a.push(p.x,p.y,p.z),h.x=v/n,h.y=w/(e.length-1),o.push(h.x,h.y);const A=l[3*w+0]*M,_=l[3*w+1],T=l[3*w+0]*E;u.push(A,_,T)}}for(let v=0;v<n;v++)for(let b=0;b<e.length-1;b++){const M=b+v*e.length,E=M,w=M+e.length,A=M+e.length+1,_=M+1;s.push(E,w,_),s.push(A,_,w)}this.setIndex(s),this.setAttribute("position",new Qt(a,3)),this.setAttribute("uv",new Qt(o,2)),this.setAttribute("normal",new Qt(u,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ap(e.points,e.segments,e.phiStart,e.phiLength)}}class rs extends ni{constructor(e=1,n=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:i,heightSegments:r};const s=e/2,a=n/2,o=Math.floor(i),l=Math.floor(r),u=o+1,f=l+1,p=e/o,h=n/l,m=[],x=[],y=[],g=[];for(let d=0;d<f;d++){const v=d*h-a;for(let b=0;b<u;b++){const M=b*p-s;
vendor: 4,091 bytes, lines 44-48
44x.push(M,-v,0),y.push(0,0,1),g.push(b/o),g.push(1-d/l)}}for(let d=0;d<l;d++)for(let v=0;v<o;v++){const b=v+u*d,M=v+u*(d+1),E=v+1+u*(d+1),w=v+1+u*d;m.push(b,M,w),m.push(M,E,w)}this.setIndex(m),this.setAttribute("position",new Qt(x,3)),this.setAttribute("normal",new Qt(y,3)),this.setAttribute("uv",new Qt(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rs(e.width,e.height,e.widthSegments,e.heightSegments)}}function va(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];if(Cg(r))r.isRenderTargetTexture?(He("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone();else if(Array.isArray(r))if(Cg(r[0])){const s=[];for(let a=0,o=r.length;a<o;a++)s[a]=r[a].clone();e[n][i]=s}else e[n][i]=r.slice();else e[n][i]=r}}return e}function vn(t){const e={};for(let n=0;n<t.length;n++){const i=va(t[n]);for(const r in i)e[r]=i[r]}return e}function Cg(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}function Kb(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function M_(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:rt.workingColorSpace}const qb={clone:va,merge:vn};var Zb=`void main() { 45 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 46}`,Jb=`void main() { 47 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 48}`;class Li extends Bo{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Zb,this.fragmentShader=Jb,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=va(e.uniforms),this.uniformsGroups=Kb(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.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const r in this.uniforms){const a=this.uniforms[r].value;a&&a.isTexture?n.uniforms[r]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?n.uniforms[r]={type:"c",value:a.getHex()}:a&&a.isVector2?n.uniforms[r]={type:"v2",value:a.toArray()}:a&&a.isVector3?n.uniforms[r]={type:"v3",value:a.toArray()}:a&&a.isVector4?n.uniforms[r]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?n.uniforms[r]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?n.uniforms[r]={type:"m4",value:a.toArray()}:n.uniforms[r]={value:a}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}fromJSON(e,n){if(super.fromJSON(e,n),e.uniforms!==void 0)for(const i in e.uniforms){const r=e.uniforms[i];switch(this.uniforms[i]={},r.type){case"t":this.uniforms[i].value=n[r.value]||null;break;case"c":this.uniforms[i].value=new st().setHex(r.value);break;case"v2":this.uniforms[i].value=new De().fromArray(r.value);break;case"v3":this.uniforms[i].value=new H().fromArray(r.value);break;case"v4":this.uniforms[i].value=new Nt().fromArray(r.value);break;case"m3":this.uniforms[i].value=new Ye().fromArray(r.value);break;
48case"m4":this.uniforms[i].value=new Ft().fromArray(r.value);break;default:this.uniforms[i].value=r.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(const i in e.extensions)this.extensions[i]=e.extensions[i];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}}class Qb extends Li{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ks extends Bo{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new st(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 st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ah,this.normalScale=new De(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 Ir,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 ew extends Bo{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=db,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 tw extends Bo{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 Rp extends sn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new st(e),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}class nw extends Rp{constructor(e,n,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new st(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}toJSON(e){const n=super.toJSON(e);return n.object.groundColor=this.groundColor.getHex(),n}}const ld=new Ft,Ag=new H,Rg=new H;class iw{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new De(512,512),this.mapType=jn,this.map=null,this.mapPass=null,this.matrix=new Ft,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new wp,this._frameExtents=new De(1,1),this._viewportCount=1,this._viewports=[new Nt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;Ag.setFromMatrixPosition(e.matrixWorld),n.position.copy(Ag),Rg.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(Rg),n.updateMatrixWorld(),ld.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ld,n.coordinateSystem,n.reversedDepth),n.coordinateSystem===No||n.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(ld)}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.n
vendor: 4,103 bytes, line 48
48ormalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,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}}const Cl=new H,Al=new Lr,yi=new H;class E_ extends sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ft,this.projectionMatrix=new Ft,this.projectionMatrixInverse=new Ft,this.coordinateSystem=Ci,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(Cl,Al,yi),yi.x===1&&yi.y===1&&yi.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Cl,Al,yi.set(1,1,1)).invert()}updateWorldMatrix(e,n,i=!1){super.updateWorldMatrix(e,n,i),this.matrixWorld.decompose(Cl,Al,yi),yi.x===1&&yi.y===1&&yi.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Cl,Al,yi.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const dr=new H,Pg=new De,kg=new De;class Zn extends E_{constructor(e=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=oh*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ec*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return oh*2*Math.atan(Math.tan(ec*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,i){dr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(dr.x,dr.y).multiplyScalar(-e/dr.z),dr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(dr.x,dr.y).multiplyScalar(-e/dr.z)}getViewSize(e,n){return this.getViewBounds(e,Pg,kg),n.subVectors(kg,Pg)}setViewOffset(e,n,i,r,s,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(ec*.5*this.fov)/this.zoom,i=2*n,r=this.aspect*i,s=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,u=a.fullHeight;s+=a.offsetX*r/l,n-=a.offsetY*i/u,r*=a.width/l,i*=a.height/u}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,n,n-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}
vendor: 9,953 bytes, lines 48-52
48class Pp extends E_{constructor(e=-1,n=1,i=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=i,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,i,r,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,a=i+e,o=r+n,l=r-n;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,a=s+u*this.view.width,o-=f*this.view.offsetY,l=o-f*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class rw extends iw{constructor(){super(new Pp(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Ng extends Rp{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.target=new sn,this.shadow=new rw}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}class sw extends Rp{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}const Ns=-90,Ds=1;class aw extends sn{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Zn(Ns,Ds,e,n);r.layers=this.layers,this.add(r);const s=new Zn(Ns,Ds,e,n);s.layers=this.layers,this.add(s);const a=new Zn(Ns,Ds,e,n);a.layers=this.layers,this.add(a);const o=new Zn(Ns,Ds,e,n);o.layers=this.layers,this.add(o);const l=new Zn(Ns,Ds,e,n);l.layers=this.layers,this.add(l);const u=new Zn(Ns,Ds,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,r,s,a,o,l]=n;for(const u of n)this.remove(u);if(e===Ci)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===No)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,u,f]=this.children,p=e.getRenderTarget(),h=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),x=e.xr.enabled;e.xr.enabled=!1;const y=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let g=!1;e.isWebGLRenderer===!0?g=e.state.buffers.depth.getReversed():g=e.reversedDepthBuffer,e.setRenderTarget(i,0,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(n,s),e.setRenderTarget(i,1,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(n,a),e.setRenderTarget(i,2,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(n,o),e.setRenderTarget(i,3,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(n,l),e.setRenderTarget(i,4,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(n,u),i.texture.generateMipmaps=y,e.setRenderTarget(i,5,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(n,f),e.setRenderTarget(p,h,m),e.xr.enabled=x,i.texture.needsPMREMUpdate=!0}}class ow extends Zn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Dg{constructor(e=1,n=0,i=0){this.radius=e,this.phi=n,this.theta=i}set(e,n,i){return this.radius=e,this.phi=n,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=et(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,i){return this.radius=Math.sqrt(e*e+n*n+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(et(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Up=class Up{constructor(e,n,i,r){this.elements=[1,0,0,1],e!==void 0&&this.set(e,n,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,n=0){for(let i=0;i<4;i++)this.elements[i]=e[i+n];return this}set(e,n,i,r){const s=this.elements;return s[0]=e,s[2]=n,s[1]=i,s[3]=r,this}};Up.prototype.isMatrix2=!0;let Lg=Up;class lw extends zr{constructor(e,n=null){super(),this.object=e,this.domElement=n,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){He("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function Ig(t,e,n,i){const r=cw(i);switch(n){case c_:return t*e;case d_:return t*e/r.components*r.byteLength;case xp:return t*e/r.components*r.byteLength;case ds:return t*e*2/r.components*r.byteLength;case _p:return t*e*2/r.components*r.byteLength;case u_:return t*e*3/r.components*r.byteLength;case hi:return t*e*4/r.components*r.byteLength;case yp:return t*e*4/r.components*r.byteLength;case ql:case Zl:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case Jl:case Ql:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case kf:case Df:return Math.max(t,16)*Math.max(e,8)/4;case Pf:case Nf:return Math.max(t,8)*Math.max(e,8)/2;case Lf:case If:case Ff:case Of:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case Uf:case kc:case zf:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case jf:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case Bf:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case Gf:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case Hf:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case Vf:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case Wf:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case Xf:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case $f:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case Yf:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case Kf:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case qf:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case Zf:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case Jf:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case Qf:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case eh:case th:case nh:return Math.ceil(t/4)*Math.ceil(e/4)*16;case ih:case rh:return Math.ceil(t/4)*Math.ceil(e/4)*8;case Nc:case sh:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function cw(t){switch(t){case jn:case s_:return{byteLength:1,components:1};case Po:case a_:case Qi:return{byteLength:2,components:1};case gp:case vp:return{byteLength:2,components:4};case Di:case mp:case Ti:return{byteLength:4,components:1};case o_:case l_:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${t}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:pp}}));typeof window<"u"&&(window.__THREE__?He("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=pp);/** 49 * @license 50 * Copyright 2010-2026 Three.js Authors 51 * SPDX-License-Identifier: MIT 52 */function b_(){let t=null,e=!1,n=null,i=null;function r(s,a){n(s,a),i=t.requestAnimationFrame(r)}return{start:function(){e!==!0&&n!==null&&t!==null&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t!==null&&t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){n=s},setContext:function(s){t=s}}}function uw(t){const e=new WeakMap;function n(o,l){const u=o.array,f=o.usage,p=u.byteLength,h=t.createBuffer();t.bindBuffer(l,h),t.bufferData(l,u,f),o.onUploadCallback();let m;if(u instanceof Float32Array)m=t.FLOAT;else if(typeof Float16Array<"u"&&u instanceof Float16Array)m=t.HALF_FLOAT;else if(u instanceof Uint16Array)o.isFloat16BufferAttribute?m=t.HALF_FLOAT:m=t.UNSIGNED_SHORT;else if(u instanceof Int16Array)m=t.SHORT;else if(u instanceof Uint32Array)m=t.UNSIGNED_INT;else if(u instanceof Int32Array)m=t.INT;else if(u instanceof Int8Array)m=t.BYTE;else if(u instanceof Uint8Array)m=t.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)m=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:h,type:m,bytesPerElement:u.BYTES_PER_ELEMENT,version:o.version,size:p}}function i(o,l,u){const f=l.array,p=l.updateRanges;if(t.bindBuffer(u,o),p.length===0)t.bufferSubData(u,0,f);else{p.sort((m,x)=>m.start-x.start);let h=0;for(let m=1;m<p.length;m++){const x=p[h],y=p[m];
vendor: 5,158 bytes, lines 52-165
52y.start<=x.start+x.count+1?x.count=Math.max(x.count,y.start+y.count-x.start):(++h,p[h]=y)}p.length=h+1;for(let m=0,x=p.length;m<x;m++){const y=p[m];t.bufferSubData(u,y.start*f.BYTES_PER_ELEMENT,f,y.start,y.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(t.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const f=e.get(o);(!f||f.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const u=e.get(o);if(u===void 0)e.set(o,n(o,l));else if(u.version<o.version){if(u.size!==o.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.");i(u.buffer,o,l),u.version=o.version}}return{get:r,remove:s,update:a}}var dw=`#ifdef USE_ALPHAHASH 53 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 54#endif`,fw=`#ifdef USE_ALPHAHASH 55 const float ALPHA_HASH_SCALE = 0.05; 56 float hash2D( vec2 value ) { 57 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 58 } 59 float hash3D( vec3 value ) { 60 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 61 } 62 float getAlphaHashThreshold( vec3 position ) { 63 float maxDeriv = max( 64 length( dFdx( position.xyz ) ), 65 length( dFdy( position.xyz ) ) 66 ); 67 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 68 vec2 pixScales = vec2( 69 exp2( floor( log2( pixScale ) ) ), 70 exp2( ceil( log2( pixScale ) ) ) 71 ); 72 vec2 alpha = vec2( 73 hash3D( floor( pixScales.x * position.xyz ) ), 74 hash3D( floor( pixScales.y * position.xyz ) ) 75 ); 76 float lerpFactor = fract( log2( pixScale ) ); 77 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 78 float a = min( lerpFactor, 1.0 - lerpFactor ); 79 vec3 cases = vec3( 80 x * x / ( 2.0 * a * ( 1.0 - a ) ), 81 ( x - 0.5 * a ) / ( 1.0 - a ), 82 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 83 ); 84 float threshold = ( x < ( 1.0 - a ) ) 85 ? ( ( x < a ) ? cases.x : cases.y ) 86 : cases.z; 87 return clamp( threshold , 1.0e-6, 1.0 ); 88 } 89#endif`,hw=`#ifdef USE_ALPHAMAP 90 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 91#endif`,pw=`#ifdef USE_ALPHAMAP 92 uniform sampler2D alphaMap; 93#endif`,mw=`#ifdef USE_ALPHATEST 94 #ifdef ALPHA_TO_COVERAGE 95 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 96 if ( diffuseColor.a == 0.0 ) discard; 97 #else 98 if ( diffuseColor.a < alphaTest ) discard; 99 #endif 100#endif`,gw=`#ifdef USE_ALPHATEST 101 uniform float alphaTest; 102#endif`,vw=`#ifdef USE_AOMAP 103 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 104 reflectedLight.indirectDiffuse *= ambientOcclusion; 105 #if defined( USE_CLEARCOAT ) 106 clearcoatSpecularIndirect *= ambientOcclusion; 107 #endif 108 #if defined( USE_SHEEN ) 109 sheenSpecularIndirect *= ambientOcclusion; 110 #endif 111 #if defined( USE_ENVMAP ) && defined( STANDARD ) 112 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 113 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 114 #endif 115#endif`,xw=`#ifdef USE_AOMAP 116 uniform sampler2D aoMap; 117 uniform float aoMapIntensity; 118#endif`,_w=`#ifdef USE_BATCHING 119 #if ! defined( GL_ANGLE_multi_draw ) 120 #define gl_DrawID _gl_DrawID 121 uniform int _gl_DrawID; 122 #endif 123 uniform highp sampler2D batchingTexture; 124 uniform highp usampler2D batchingIdTexture; 125 mat4 getBatchingMatrix( const in float i ) { 126 int size = textureSize( batchingTexture, 0 ).x; 127 int j = int( i ) * 4; 128 int x = j % size; 129 int y = j / size; 130 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 131 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 132 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 133 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 134 return mat4( v1, v2, v3, v4 ); 135 } 136 float getIndirectIndex( const in int i ) { 137 int size = textureSize( batchingIdTexture, 0 ).x; 138 int x = i % size; 139 int y = i / size; 140 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 141 } 142#endif 143#ifdef USE_BATCHING_COLOR 144 uniform sampler2D batchingColorTexture; 145 vec4 getBatchingColor( const in float i ) { 146 int size = textureSize( batchingColorTexture, 0 ).x; 147 int j = int( i ); 148 int x = j % size; 149 int y = j / size; 150 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ); 151 } 152#endif`,yw=`#ifdef USE_BATCHING 153 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 154#endif`,Sw=`vec3 transformed = vec3( position ); 155#ifdef USE_ALPHAHASH 156 vPosition = vec3( position ); 157#endif`,Mw=`vec3 objectNormal = vec3( normal ); 158#ifdef USE_TANGENT 159 vec3 objectTangent = vec3( tangent.xyz ); 160#endif`,Ew=`float G_BlinnPhong_Implicit( ) { 161 return 0.25; 162} 163float D_BlinnPhong( const in float shininess, const in float dotNH ) { 164 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 165}
166vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 167 vec3 halfDir = normalize( lightDir + viewDir ); 168 float dotNH = saturate( dot( normal, halfDir ) ); 169 float dotVH = saturate( dot( viewDir, halfDir ) ); 170 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 171 float G = G_BlinnPhong_Implicit( ); 172 float D = D_BlinnPhong( shininess, dotNH ); 173 return F * ( G * D ); 174} // validated`,bw=`#ifdef USE_IRIDESCENCE 175 const mat3 XYZ_TO_REC709 = mat3( 176 3.2404542, -0.9692660, 0.0556434, 177 -1.5371385, 1.8760108, -0.2040259, 178 -0.4985314, 0.0415560, 1.0572252 179 ); 180 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 181 vec3 sqrtF0 = sqrt( fresnel0 ); 182 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 183 } 184 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 185 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 186 } 187 float IorToFresnel0( float transmittedIor, float incidentIor ) { 188 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 189 } 190 vec3 evalSensitivity( float OPD, vec3 shift ) { 191 float phase = 2.0 * PI * OPD * 1.0e-9; 192 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 193 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 194 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 195 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 196 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 ) ); 197 xyz /= 1.0685e-7; 198 vec3 rgb = XYZ_TO_REC709 * xyz; 199 return rgb; 200 } 201 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 202 vec3 I; 203 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 204 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 205 float cosTheta2Sq = 1.0 - sinTheta2Sq; 206 if ( cosTheta2Sq < 0.0 ) { 207 return vec3( 1.0 ); 208 } 209 float cosTheta2 = sqrt( cosTheta2Sq ); 210 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); 211 float R12 = F_Schlick( R0, 1.0, cosTheta1 );
212 float T121 = 1.0 - R12; 213 float phi12 = 0.0; 214 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 215 float phi21 = PI - phi12; 216 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 217 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 218 vec3 phi23 = vec3( 0.0 ); 219 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 220 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 221 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 222 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 223 vec3 phi = vec3( phi21 ) + phi23; 224 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 225 vec3 r123 = sqrt( R123 ); 226 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 227 vec3 C0 = R12 + Rs; 228 I = C0; 229 vec3 Cm = Rs - T121; 230 for ( int m = 1; m <= 2; ++ m ) { 231 Cm *= r123; 232 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 233 I += Cm * Sm; 234 } 235 return max( I, vec3( 0.0 ) ); 236 } 237#endif`,ww=`#ifdef USE_BUMPMAP 238 uniform sampler2D bumpMap; 239 uniform float bumpScale; 240 vec2 dHdxy_fwd() { 241 vec2 dSTdx = dFdx( vBumpMapUv ); 242 vec2 dSTdy = dFdy( vBumpMapUv ); 243 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 244 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 245 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 246 return vec2( dBx, dBy ); 247 } 248 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 249 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 250 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 251 vec3 vN = surf_norm; 252 vec3 R1 = cross( vSigmaY, vN ); 253 vec3 R2 = cross( vN, vSigmaX ); 254 float fDet = dot( vSigmaX, R1 ) * faceDirection; 255 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 256 return normalize( abs( fDet ) * surf_norm - vGrad ); 257 } 258#endif`,Tw=`#if NUM_CLIPPING_PLANES > 0 259 vec4 plane; 260 #ifdef ALPHA_TO_COVERAGE 261 float distanceToPlane, distanceGradient; 262 float clipOpacity = 1.0; 263 #pragma unroll_loop_start 264 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 265 plane = clippingPlanes[ i ]; 266 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 267 distanceGradient = fwidth( distanceToPlane ) / 2.0; 268 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 269 if ( clipOpacity == 0.0 ) discard; 270 } 271 #pragma unroll_loop_end 272 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 273 float unionClipOpacity = 1.0; 274 #pragma unroll_loop_start 275 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 276 plane = clippingPlanes[ i ]; 277 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 278 distanceGradient = fwidth( distanceToPlane ) / 2.0; 279 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 280 } 281 #pragma unroll_loop_end 282 clipOpacity *= 1.0 - unionClipOpacity; 283 #endif 284 diffuseColor.a *= clipOpacity; 285 if ( diffuseColor.a == 0.0 ) discard; 286 #else 287 #pragma unroll_loop_start 288 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 289 plane = clippingPlanes[ i ]; 290 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 291 } 292 #pragma unroll_loop_end 293 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 294 bool clipped = true; 295 #pragma unroll_loop_start 296 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 297 plane = clippingPlanes[ i ]; 298 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 299 } 300 #pragma unroll_loop_end 301 if ( clipped ) discard; 302 #endif 303 #endif 304#endif`,Cw=`#if NUM_CLIPPING_PLANES > 0 305 varying vec3 vClipPosition; 306 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 307#endif`,Aw=`#if NUM_CLIPPING_PLANES > 0 308 varying vec3 vClipPosition; 309#endif`,Rw=`#if NUM_CLIPPING_PLANES > 0 310 vClipPosition = - mvPosition.xyz; 311#endif`,Pw=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) 312 diffuseColor *= vColor; 313#endif`,kw=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) 314 varying vec4 vColor; 315#endif`,Nw=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 316 varying vec4 vColor; 317#endif`,Dw=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 318 vColor = vec4( 1.0 ); 319#endif 320#ifdef USE_COLOR_ALPHA 321 vColor *= color; 322#elif defined( USE_COLOR ) 323 vColor.rgb *= color; 324#endif 325#ifdef USE_INSTANCING_COLOR 326 vColor.rgb *= instanceColor.rgb; 327#endif 328#ifdef USE_BATCHING_COLOR 329 vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) ); 330#endif`,Lw=`#define PI 3.141592653589793 331#define PI2 6.283185307179586 332#define PI_HALF 1.5707963267948966 333#define RECIPROCAL_PI 0.3183098861837907 334#define RECIPROCAL_PI2 0.15915494309189535 335#define EPSILON 1e-6 336#ifndef saturate 337#define saturate( a ) clamp( a, 0.0, 1.0 ) 338#endif 339#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 340float pow2( const in float x ) { return x*x; } 341vec3 pow2( const in vec3 x ) { return x*x; } 342float pow3( const in float x ) { return x*x*x; } 343float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 344float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 345float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 346highp float rand( const in vec2 uv ) { 347 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 348 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 349 return fract( sin( sn ) * c ); 350} 351#ifdef HIGH_PRECISION 352 float precisionSafeLength( vec3 v ) { return length( v ); } 353#else 354 float precisionSafeLength( vec3 v ) { 355 float maxComponent = max3( abs( v ) ); 356 return length( v / maxComponent ) * maxComponent; 357 } 358#endif 359struct IncidentLight { 360 vec3 color; 361 vec3 direction; 362 bool visible; 363}; 364struct ReflectedLight { 365 vec3 directDiffuse; 366 vec3 directSpecular; 367 vec3 indirectDiffuse; 368 vec3 indirectSpecular; 369}; 370#ifdef USE_ALPHAHASH 371 varying vec3 vPosition; 372#endif 373vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 374 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 375} 376#define inverseTransformDirection transformDirectionByInverseViewMatrix 377vec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) { 378 return normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz ); 379} 380vec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) { 381 return normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz ); 382} 383bool isPerspectiveMatrix( mat4 m ) { 384 return m[ 2 ][ 3 ] == - 1.0; 385} 386vec2 equirectUv( in vec3 dir ) { 387 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 388 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 389 return vec2( u, v ); 390}
391vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 392 return RECIPROCAL_PI * diffuseColor; 393} 394vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 395 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 396 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 397} 398float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 399 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 400 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 401} // validated`,Iw=`#ifdef ENVMAP_TYPE_CUBE_UV 402 #define cubeUV_minMipLevel 4.0 403 #define cubeUV_minTileSize 16.0 404 float getFace( vec3 direction ) { 405 vec3 absDirection = abs( direction ); 406 float face = - 1.0; 407 if ( absDirection.x > absDirection.z ) { 408 if ( absDirection.x > absDirection.y ) 409 face = direction.x > 0.0 ? 0.0 : 3.0; 410 else 411 face = direction.y > 0.0 ? 1.0 : 4.0; 412 } else { 413 if ( absDirection.z > absDirection.y ) 414 face = direction.z > 0.0 ? 2.0 : 5.0; 415 else 416 face = direction.y > 0.0 ? 1.0 : 4.0; 417 } 418 return face; 419 } 420 vec2 getUV( vec3 direction, float face ) { 421 vec2 uv; 422 if ( face == 0.0 ) { 423 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 424 } else if ( face == 1.0 ) { 425 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 426 } else if ( face == 2.0 ) { 427 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 428 } else if ( face == 3.0 ) { 429 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 430 } else if ( face == 4.0 ) { 431 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 432 } else { 433 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 434 } 435 return 0.5 * ( uv + 1.0 ); 436 } 437 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 438 float face = getFace( direction ); 439 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 440 mipInt = max( mipInt, cubeUV_minMipLevel ); 441 float faceSize = exp2( mipInt ); 442 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 443 if ( face > 2.0 ) { 444 uv.y += faceSize; 445 face -= 3.0; 446 } 447 uv.x += face * faceSize; 448 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 449 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 450 uv.x *= CUBEUV_TEXEL_WIDTH; 451 uv.y *= CUBEUV_TEXEL_HEIGHT; 452 #ifdef texture2DGradEXT 453 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 454 #else 455 return texture2D( envMap, uv ).rgb; 456 #endif 457 } 458 #define cubeUV_r0 1.0 459 #define cubeUV_m0 - 2.0 460 #define cubeUV_r1 0.8 461 #define cubeUV_m1 - 1.0 462 #define cubeUV_r4 0.4 463 #define cubeUV_m4 2.0 464 #define cubeUV_r5 0.305 465 #define cubeUV_m5 3.0 466 #define cubeUV_r6 0.21 467 #define cubeUV_m6 4.0 468 float roughnessToMip( float roughness ) { 469 float mip = 0.0; 470 if ( roughness >= cubeUV_r1 ) { 471 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 472 } else if ( roughness >= cubeUV_r4 ) { 473 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 474 } else if ( roughness >= cubeUV_r5 ) { 475 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 476 } else if ( roughness >= cubeUV_r6 ) { 477 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 478 } else { 479 mip = - 2.0 * log2( 1.16 * roughness ); } 480 return mip; 481 } 482 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 483 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 484 float mipF = fract( mip ); 485 float mipInt = floor( mip ); 486 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 487 if ( mipF == 0.0 ) { 488 return vec4( color0, 1.0 ); 489 } else { 490 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 491 return vec4( mix( color0, color1, mipF ), 1.0 ); 492 } 493 } 494#endif`,Uw=`vec3 transformedNormal = objectNormal; 495#ifdef USE_TANGENT 496 vec3 transformedTangent = objectTangent; 497#endif 498#ifdef USE_BATCHING 499 mat3 bm = mat3( batchingMatrix ); 500 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 501 transformedNormal = bm * transformedNormal; 502 #ifdef USE_TANGENT 503 transformedTangent = bm * transformedTangent; 504 #endif 505#endif 506#ifdef USE_INSTANCING 507 mat3 im = mat3( instanceMatrix ); 508 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 509 transformedNormal = im * transformedNormal; 510 #ifdef USE_TANGENT 511 transformedTangent = im * transformedTangent; 512 #endif 513#endif 514transformedNormal = normalMatrix * transformedNormal; 515#ifdef FLIP_SIDED 516 transformedNormal = - transformedNormal; 517#endif 518#ifdef USE_TANGENT 519 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 520#endif`,Fw=`#ifdef USE_DISPLACEMENTMAP 521 uniform sampler2D displacementMap; 522 uniform float displacementScale; 523 uniform float displacementBias; 524#endif`,Ow=`#ifdef USE_DISPLACEMENTMAP 525 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
525placementBias ); 526#endif`,zw=`#ifdef USE_EMISSIVEMAP 527 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 528 #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE 529 emissiveColor = sRGBTransferEOTF( emissiveColor ); 530 #endif 531 totalEmissiveRadiance *= emissiveColor.rgb; 532#endif`,jw=`#ifdef USE_EMISSIVEMAP 533 uniform sampler2D emissiveMap; 534#endif`,Bw="gl_FragColor = linearToOutputTexel( gl_FragColor );",Gw=`vec4 LinearTransferOETF( in vec4 value ) { 535 return value; 536} 537vec4 sRGBTransferEOTF( in vec4 value ) { 538 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 ); 539} 540vec4 sRGBTransferOETF( in vec4 value ) { 541 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 ); 542}`,Hw=`#ifdef USE_ENVMAP 543 #ifdef ENV_WORLDPOS 544 vec3 cameraToFrag; 545 if ( isOrthographic ) { 546 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 547 } else { 548 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 549 } 550 vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); 551 #ifdef ENVMAP_MODE_REFLECTION 552 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 553 #else 554 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 555 #endif 556 #else 557 vec3 reflectVec = vReflect; 558 #endif 559 #ifdef ENVMAP_TYPE_CUBE 560 vec4 envColor = textureCube( envMap, envMapRotation * reflectVec ); 561 #ifdef ENVMAP_BLENDING_MULTIPLY 562 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 563 #elif defined( ENVMAP_BLENDING_MIX ) 564 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 565 #elif defined( ENVMAP_BLENDING_ADD ) 566 outgoingLight += envColor.xyz * specularStrength * reflectivity; 567 #endif 568 #endif 569#endif`,Vw=`#ifdef USE_ENVMAP 570 uniform float envMapIntensity; 571 uniform mat3 envMapRotation; 572 #ifdef ENVMAP_TYPE_CUBE 573 uniform samplerCube envMap; 574 #else 575 uniform sampler2D envMap; 576 #endif 577#endif`,Ww=`#ifdef USE_ENVMAP 578 uniform float reflectivity; 579 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 580 #define ENV_WORLDPOS 581 #endif 582 #ifdef ENV_WORLDPOS 583 varying vec3 vWorldPosition; 584 uniform float refractionRatio; 585 #else 586 varying vec3 vReflect; 587 #endif 588#endif`,Xw=`#ifdef USE_ENVMAP 589 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 590 #define ENV_WORLDPOS 591 #endif 592 #ifdef ENV_WORLDPOS 593 594 varying vec3 vWorldPosition; 595 #else 596 varying vec3 vReflect; 597 uniform float refractionRatio; 598 #endif 599#endif`,$w=`#ifdef USE_ENVMAP 600 #ifdef ENV_WORLDPOS 601 vWorldPosition = worldPosition.xyz; 602 #else 603 vec3 cameraToVertex; 604 if ( isOrthographic ) { 605 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 606 } else {
607 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 608 } 609 vec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix ); 610 #ifdef ENVMAP_MODE_REFLECTION 611 vReflect = reflect( cameraToVertex, worldNormal ); 612 #else 613 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 614 #endif 615 #endif 616#endif`,Yw=`#ifdef USE_FOG 617 vFogDepth = - mvPosition.z; 618#endif`,Kw=`#ifdef USE_FOG 619 varying float vFogDepth; 620#endif`,qw=`#ifdef USE_FOG 621 #ifdef FOG_EXP2 622 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 623 #else 624 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 625 #endif 626 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 627#endif`,Zw=`#ifdef USE_FOG 628 uniform vec3 fogColor; 629 varying float vFogDepth; 630 #ifdef FOG_EXP2 631 uniform float fogDensity; 632 #else 633 uniform float fogNear; 634 uniform float fogFar; 635 #endif 636#endif`,Jw=`#ifdef USE_GRADIENTMAP 637 uniform sampler2D gradientMap; 638#endif 639vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 640 float dotNL = dot( normal, lightDirection ); 641 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 642 #ifdef USE_GRADIENTMAP 643 return vec3( texture2D( gradientMap, coord ).r ); 644 #else 645 vec2 fw = fwidth( coord ) * 0.5; 646 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 647 #endif 648}`,Qw=`#ifdef USE_LIGHTMAP 649 uniform sampler2D lightMap; 650 uniform float lightMapIntensity; 651#endif`,e1=`LambertMaterial material; 652material.diffuseColor = diffuseColor.rgb; 653material.specularStrength = specularStrength;`,t1=`varying vec3 vViewPosition; 654struct LambertMaterial { 655 vec3 diffuseColor; 656 float specularStrength; 657}; 658void 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 ) { 659 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 660 vec3 irradiance = dotNL * directLight.color; 661 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 662} 663void 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 ) { 664 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 665} 666#define RE_Direct RE_Direct_Lambert 667#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,n1=`uniform bool receiveShadow; 668uniform vec3 ambientLightColor; 669#if defined( USE_LIGHT_PROBES ) 670 uniform vec3 lightProbe[ 9 ]; 671#endif 672vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 673 float x = normal.x, y = normal.y, z = normal.z; 674 vec3 result = shCoefficients[ 0 ] * 0.886227; 675 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 676 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 677 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 678 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 679 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 680 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 681 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 682 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 683 return result; 684} 685vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 686 vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); 687 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 688 return irradiance; 689} 690vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 691 vec3 irradiance = ambientLightColor; 692 return irradiance; 693} 694float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 695 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 696 if ( cutoffDistance > 0.0 ) { 697 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 698 } 699 return distanceFalloff; 700} 701float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 702 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 703} 704#if NUM_DIR_LIGHTS > 0 705 struct DirectionalLight { 706 vec3 direction; 707 vec3 color; 708 }; 709 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 710 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 711 light.color = directionalLight.color; 712 light.direction = directionalLight.direction; 713 light.visible = true; 714 } 715#endif 716#if NUM_POINT_LIGHTS > 0 717 struct PointLight { 718 vec3 position; 719 vec3 color; 720 float distance; 721 float decay; 722 }; 723 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 724 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 725 vec3 lVector = pointLight.position - geometryPosition; 726 light.direction = normalize( lVector ); 727 float lightDistance = length( lVector ); 728 light.color = pointLight.color; 729 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 730 light.visible = ( light.color != vec3( 0.0 ) ); 731 } 732#endif
733#if NUM_SPOT_LIGHTS > 0 734 struct SpotLight { 735 vec3 position; 736 vec3 direction; 737 vec3 color; 738 float distance; 739 float decay; 740 float coneCos; 741 float penumbraCos; 742 }; 743 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 744 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 745 vec3 lVector = spotLight.position - geometryPosition; 746 light.direction = normalize( lVector ); 747 float angleCos = dot( light.direction, spotLight.direction ); 748 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 749 if ( spotAttenuation > 0.0 ) { 750 float lightDistance = length( lVector ); 751 light.color = spotLight.color * spotAttenuation; 752 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 753 light.visible = ( light.color != vec3( 0.0 ) ); 754 } else { 755 light.color = vec3( 0.0 ); 756 light.visible = false; 757 } 758 } 759#endif 760#if NUM_RECT_AREA_LIGHTS > 0 761 struct RectAreaLight { 762 vec3 color; 763 vec3 position; 764 vec3 halfWidth; 765 vec3 halfHeight; 766 }; 767 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 768 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 769#endif 770#if NUM_HEMI_LIGHTS > 0 771 struct HemisphereLight { 772 vec3 direction; 773 vec3 skyColor; 774 vec3 groundColor; 775 }; 776 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 777 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 778 float dotNL = dot( normal, hemiLight.direction ); 779 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 780 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 781 return irradiance; 782 } 783#endif 784#include <lightprobes_pars_fragment>`,i1=`#ifdef USE_ENVMAP 785 vec3 getIBLIrradiance( const in vec3 normal ) { 786 #ifdef ENVMAP_TYPE_CUBE_UV 787 vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); 788 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 789 return PI * envMapColor.rgb * envMapIntensity; 790 #else 791 return vec3( 0.0 ); 792 #endif 793 } 794 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 795 #ifdef ENVMAP_TYPE_CUBE_UV 796 vec3 reflectVec = reflect( - viewDir, normal ); 797 reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); 798 reflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix ); 799 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 800 return envMapColor.rgb * envMapIntensity; 801 #else 802 return vec3( 0.0 ); 803 #endif 804 } 805 #ifdef USE_ANISOTROPY 806 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 807 #ifdef ENVMAP_TYPE_CUBE_UV 808 vec3 bentNormal = cross( bitangent, viewDir ); 809 bentNormal = normalize( cross( bentNormal, bitangent ) ); 810 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 811 return getIBLRadiance( viewDir, bentNormal, roughness ); 812 #else 813 return vec3( 0.0 ); 814 #endif 815 } 816 #endif 817#endif`,r1=`ToonMaterial material; 818material.diffuseColor = diffuseColor.rgb;`,s1=`varying vec3 vViewPosition; 819struct ToonMaterial { 820 vec3 diffuseColor; 821}; 822void 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 ) { 823 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 824 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 825} 826void 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 ) { 827 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 828} 829#define RE_Direct RE_Direct_Toon 830#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,a1=`BlinnPhongMaterial material; 831material.diffuseColor = diffuseColor.rgb; 832material.specularColor = specular; 833material.specularShininess = shininess; 834material.specularStrength = specularStrength;`,o1=`varying vec3 vViewPosition; 835struct BlinnPhongMaterial { 836 vec3 diffuseColor; 837 vec3 specularColor; 838 float specularShininess; 839 float specularStrength; 840}; 841void 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 ) {
842 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 843 vec3 irradiance = dotNL * directLight.color; 844 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 845 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 846} 847void 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 ) { 848 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 849} 850#define RE_Direct RE_Direct_BlinnPhong 851#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,l1=`PhysicalMaterial material; 852material.diffuseColor = diffuseColor.rgb; 853material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 854material.metalness = metalnessFactor; 855vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 856float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 857material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 858material.roughness = min( material.roughness, 1.0 ); 859#ifdef IOR 860 material.ior = ior; 861 #ifdef USE_SPECULAR 862 float specularIntensityFactor = specularIntensity; 863 vec3 specularColorFactor = specularColor; 864 #ifdef USE_SPECULAR_COLORMAP 865 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 866 #endif 867 #ifdef USE_SPECULAR_INTENSITYMAP 868 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 869 #endif 870 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 871 #else 872 float specularIntensityFactor = 1.0; 873 vec3 specularColorFactor = vec3( 1.0 ); 874 material.specularF90 = 1.0; 875 #endif 876 material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; 877 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 878#else 879 material.specularColor = vec3( 0.04 ); 880 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 881 material.specularF90 = 1.0; 882#endif 883#ifdef USE_CLEARCOAT 884 material.clearcoat = clearcoat; 885 material.clearcoatRoughness = clearcoatRoughness; 886 material.clearcoatF0 = vec3( 0.04 ); 887 material.clearcoatF90 = 1.0; 888 #ifdef USE_CLEARCOATMAP 889 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 890 #endif 891 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 892 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 893 #endif 894 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 895 material.clearcoatRoughness += geometryRoughness; 896 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 897#endif 898#ifdef USE_DISPERSION 899 material.dispersion = dispersion; 900#endif 901#ifdef USE_IRIDESCENCE 902 material.iridescence = iridescence; 903 material.iridescenceIOR = iridescenceIOR; 904 #ifdef USE_IRIDESCENCEMAP 905 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 906 #endif 907 #ifdef USE_IRIDESCENCE_THICKNESSMAP 908 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 909 #else 910 material.iridescenceThickness = iridescenceThicknessMaximum; 911 #endif 912#endif 913#ifdef USE_SHEEN 914 material.sheenColor = sheenColor; 915 #ifdef USE_SHEEN_COLORMAP 916 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 917 #endif 918 material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); 919 #ifdef USE_SHEEN_ROUGHNESSMAP 920 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 921 #endif 922#endif 923#ifdef USE_ANISOTROPY 924 #ifdef USE_ANISOTROPYMAP 925 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 926 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 927 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 928 #else 929 vec2 anisotropyV = anisotropyVector; 930 #endif 931 material.anisotropy = length( anisotropyV ); 932 if( material.anisotropy == 0.0 ) { 933 anisotropyV = vec2( 1.0, 0.0 ); 934 } else { 935 anisotropyV /= material.anisotropy; 936 material.anisotropy = saturate( material.anisotropy ); 937 } 938 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
939 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 940 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 941#endif`,c1=`uniform sampler2D dfgLUT; 942struct PhysicalMaterial { 943 vec3 diffuseColor; 944 vec3 diffuseContribution; 945 vec3 specularColor; 946 vec3 specularColorBlended; 947 float roughness; 948 float metalness; 949 float specularF90; 950 float dispersion; 951 #ifdef USE_CLEARCOAT 952 float clearcoat; 953 float clearcoatRoughness; 954 vec3 clearcoatF0; 955 float clearcoatF90; 956 #endif 957 #ifdef USE_IRIDESCENCE 958 float iridescence; 959 float iridescenceIOR; 960 float iridescenceThickness; 961 vec3 iridescenceFresnel; 962 vec3 iridescenceF0; 963 vec3 iridescenceFresnelDielectric; 964 vec3 iridescenceFresnelMetallic; 965 #endif 966 #ifdef USE_SHEEN 967 vec3 sheenColor; 968 float sheenRoughness; 969 #endif 970 #ifdef IOR 971 float ior; 972 #endif 973 #ifdef USE_TRANSMISSION 974 float transmission; 975 float transmissionAlpha; 976 float thickness; 977 float attenuationDistance; 978 vec3 attenuationColor; 979 #endif 980 #ifdef USE_ANISOTROPY 981 float anisotropy; 982 float alphaT; 983 vec3 anisotropyT; 984 vec3 anisotropyB; 985 #endif 986}; 987vec3 clearcoatSpecularDirect = vec3( 0.0 ); 988vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 989vec3 sheenSpecularDirect = vec3( 0.0 ); 990vec3 sheenSpecularIndirect = vec3(0.0 ); 991vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 992 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 993 float x2 = x * x; 994 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 995 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 996} 997float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 998 float a2 = pow2( alpha ); 999 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1000 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1001 return 0.5 / max( gv + gl, EPSILON ); 1002} 1003float D_GGX( const in float alpha, const in float dotNH ) { 1004 float a2 = pow2( alpha ); 1005 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1006 return RECIPROCAL_PI * a2 / pow2( denom ); 1007} 1008#ifdef USE_ANISOTROPY 1009 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 ) { 1010 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1011 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1012 return 0.5 / max( gv + gl, EPSILON )
vendor: 7,372 bytes, lines 1012-1171
1012; 1013 } 1014 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1015 float a2 = alphaT * alphaB; 1016 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1017 highp float v2 = dot( v, v ); 1018 float w2 = a2 / v2; 1019 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1020 } 1021#endif 1022#ifdef USE_CLEARCOAT 1023 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1024 vec3 f0 = material.clearcoatF0; 1025 float f90 = material.clearcoatF90; 1026 float roughness = material.clearcoatRoughness; 1027 float alpha = pow2( roughness ); 1028 vec3 halfDir = normalize( lightDir + viewDir ); 1029 float dotNL = saturate( dot( normal, lightDir ) ); 1030 float dotNV = saturate( dot( normal, viewDir ) ); 1031 float dotNH = saturate( dot( normal, halfDir ) ); 1032 float dotVH = saturate( dot( viewDir, halfDir ) ); 1033 vec3 F = F_Schlick( f0, f90, dotVH ); 1034 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1035 float D = D_GGX( alpha, dotNH ); 1036 return F * ( V * D ); 1037 } 1038#endif 1039vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1040 vec3 f0 = material.specularColorBlended; 1041 float f90 = material.specularF90; 1042 float roughness = material.roughness; 1043 float alpha = pow2( roughness ); 1044 vec3 halfDir = normalize( lightDir + viewDir ); 1045 float dotNL = saturate( dot( normal, lightDir ) ); 1046 float dotNV = saturate( dot( normal, viewDir ) ); 1047 float dotNH = saturate( dot( normal, halfDir ) ); 1048 float dotVH = saturate( dot( viewDir, halfDir ) ); 1049 vec3 F = F_Schlick( f0, f90, dotVH ); 1050 #ifdef USE_IRIDESCENCE 1051 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1052 #endif 1053 #ifdef USE_ANISOTROPY 1054 float dotTL = dot( material.anisotropyT, lightDir ); 1055 float dotTV = dot( material.anisotropyT, viewDir ); 1056 float dotTH = dot( material.anisotropyT, halfDir ); 1057 float dotBL = dot( material.anisotropyB, lightDir ); 1058 float dotBV = dot( material.anisotropyB, viewDir ); 1059 float dotBH = dot( material.anisotropyB, halfDir ); 1060 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1061 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1062 #else 1063 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1064 float D = D_GGX( alpha, dotNH ); 1065 #endif 1066 return F * ( V * D ); 1067} 1068vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1069 const float LUT_SIZE = 64.0; 1070 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1071 const float LUT_BIAS = 0.5 / LUT_SIZE; 1072 float dotNV = saturate( dot( N, V ) ); 1073 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1074 uv = uv * LUT_SCALE + LUT_BIAS; 1075 return uv; 1076} 1077float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1078 float l = length( f ); 1079 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1080} 1081vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1082 float x = dot( v1, v2 ); 1083 float y = abs( x ); 1084 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1085 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1086 float v = a / b; 1087 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1088 return cross( v1, v2 ) * theta_sintheta; 1089} 1090vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1091 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1092 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1093 vec3 lightNormal = cross( v1, v2 ); 1094 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1095 vec3 T1, T2; 1096 T1 = normalize( V - N * dot( V, N ) ); 1097 T2 = - cross( N, T1 ); 1098 mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); 1099 vec3 coords[ 4 ]; 1100 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1101 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1102 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1103 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1104 coords[ 0 ] = normalize( coords[ 0 ] ); 1105 coords[ 1 ] = normalize( coords[ 1 ] ); 1106 coords[ 2 ] = normalize( coords[ 2 ] ); 1107 coords[ 3 ] = normalize( coords[ 3 ] ); 1108 vec3 vectorFormFactor = vec3( 0.0 ); 1109 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1110 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1111 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1112 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1113 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1114 return vec3( result ); 1115} 1116#if defined( USE_SHEEN ) 1117float D_Charlie( float roughness, float dotNH ) { 1118 float alpha = pow2( roughness ); 1119 float invAlpha = 1.0 / alpha; 1120 float cos2h = dotNH * dotNH; 1121 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1122 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1123} 1124float V_Neubelt( float dotNV, float dotNL ) { 1125 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1126} 1127vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1128 vec3 halfDir = normalize( lightDir + viewDir ); 1129 float dotNL = saturate( dot( normal, lightDir ) ); 1130 float dotNV = saturate( dot( normal, viewDir ) ); 1131 float dotNH = saturate( dot( normal, halfDir ) ); 1132 float D = D_Charlie( sheenRoughness, dotNH ); 1133 float V = V_Neubelt( dotNV, dotNL ); 1134 return sheenColor * ( D * V ); 1135} 1136#endif 1137float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1138 float dotNV = saturate( dot( normal, viewDir ) ); 1139 float r2 = roughness * roughness; 1140 float rInv = 1.0 / ( roughness + 0.1 ); 1141 float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; 1142 float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; 1143 float DG = exp( a * dotNV + b ); 1144 return saturate( DG ); 1145} 1146vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1147 float dotNV = saturate( dot( normal, viewDir ) ); 1148 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1149 return specularColor * fab.x + specularF90 * fab.y; 1150} 1151#ifdef USE_IRIDESCENCE 1152void 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 ) { 1153#else 1154void 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 ) { 1155#endif 1156 float dotNV = saturate( dot( normal, viewDir ) ); 1157 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1158 #ifdef USE_IRIDESCENCE 1159 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1160 #else 1161 vec3 Fr = specularColor; 1162 #endif 1163 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1164 float Ess = fab.x + fab.y; 1165 float Ems = 1.0 - Ess; 1166 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1167 singleScatter += FssEss; 1168 multiScatter += Fms * Ems; 1169} 1170vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1171 vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 1172-1301
1172 float dotNL = saturate( dot( normal, lightDir ) ); 1173 float dotNV = saturate( dot( normal, viewDir ) ); 1174 vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; 1175 vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; 1176 vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; 1177 vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; 1178 float Ess_V = dfgV.x + dfgV.y; 1179 float Ess_L = dfgL.x + dfgL.y; 1180 float Ems_V = 1.0 - Ess_V; 1181 float Ems_L = 1.0 - Ess_L; 1182 vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; 1183 vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); 1184 float compensationFactor = Ems_V * Ems_L; 1185 vec3 multiScatter = Fms * compensationFactor; 1186 return singleScatter + multiScatter; 1187} 1188#if NUM_RECT_AREA_LIGHTS > 0 1189 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 ) { 1190 vec3 normal = geometryNormal; 1191 vec3 viewDir = geometryViewDir; 1192 vec3 position = geometryPosition; 1193 vec3 lightPos = rectAreaLight.position; 1194 vec3 halfWidth = rectAreaLight.halfWidth; 1195 vec3 halfHeight = rectAreaLight.halfHeight; 1196 vec3 lightColor = rectAreaLight.color; 1197 float roughness = material.roughness; 1198 vec3 rectCoords[ 4 ]; 1199 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1200 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1201 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1202 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1203 vec4 t1 = texture2D( ltc_1, uv ); 1204 vec4 t2 = texture2D( ltc_2, uv ); 1205 mat3 mInv = mat3( 1206 vec3( t1.x, 0, t1.y ), 1207 vec3( 0, 1, 0 ), 1208 vec3( t1.z, 0, t1.w ) 1209 ); 1210 vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y ); 1211 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1212 reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1213 #ifdef USE_CLEARCOAT 1214 vec3 Ncc = geometryClearcoatNormal; 1215 vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness ); 1216 vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat ); 1217 vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat ); 1218 mat3 mInvClearcoat = mat3( 1219 vec3( t1Clearcoat.x, 0, t1Clearcoat.y ), 1220 vec3( 0, 1, 0 ), 1221 vec3( t1Clearcoat.z, 0, t1Clearcoat.w ) 1222 ); 1223 vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y; 1224 clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords ); 1225 #endif 1226 } 1227#endif 1228void 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 ) { 1229 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1230 vec3 irradiance = dotNL * directLight.color; 1231 #ifdef USE_CLEARCOAT 1232 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1233 vec3 ccIrradiance = dotNLcc * directLight.color; 1234 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1235 #endif 1236 #ifdef USE_SHEEN 1237 1238 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1239 1240 float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1241 float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); 1242 1243 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); 1244 1245 irradiance *= sheenEnergyComp; 1246 1247 #endif 1248 reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); 1249 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); 1250} 1251void 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 ) { 1252 vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); 1253 #ifdef USE_SHEEN 1254 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1255 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1256 diffuse *= sheenEnergyComp; 1257 #endif 1258 reflectedLight.indirectDiffuse += diffuse; 1259} 1260void 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) { 1261 #ifdef USE_CLEARCOAT 1262 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1263 #endif 1264 #ifdef USE_SHEEN 1265 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; 1266 #endif 1267 vec3 singleScatteringDielectric = vec3( 0.0 ); 1268 vec3 multiScatteringDielectric = vec3( 0.0 ); 1269 vec3 singleScatteringMetallic = vec3( 0.0 ); 1270 vec3 multiScatteringMetallic = vec3( 0.0 ); 1271 #ifdef USE_IRIDESCENCE 1272 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1273 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1274 #else 1275 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1276 computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1277 #endif 1278 vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); 1279 vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); 1280 vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; 1281 vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); 1282 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1283 vec3 indirectSpecular = radiance * singleScattering; 1284 indirectSpecular += multiScattering * cosineWeightedIrradiance; 1285 vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; 1286 #ifdef USE_SHEEN 1287 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1288 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1289 indirectSpecular *= sheenEnergyComp; 1290 indirectDiffuse *= sheenEnergyComp; 1291 #endif 1292 reflectedLight.indirectSpecular += indirectSpecular; 1293 reflectedLight.indirectDiffuse += indirectDiffuse; 1294} 1295#define RE_Direct RE_Direct_Physical 1296#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1297#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1298#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1299float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1300 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1301}`,
1301u1=` 1302vec3 geometryPosition = - vViewPosition; 1303vec3 geometryNormal = normal; 1304vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1305vec3 geometryClearcoatNormal = vec3( 0.0 ); 1306#ifdef USE_CLEARCOAT 1307 geometryClearcoatNormal = clearcoatNormal; 1308#endif 1309#ifdef USE_IRIDESCENCE 1310 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1311 if ( material.iridescenceThickness == 0.0 ) { 1312 material.iridescence = 0.0; 1313 } else { 1314 material.iridescence = saturate( material.iridescence ); 1315 } 1316 if ( material.iridescence > 0.0 ) { 1317 material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1318 material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); 1319 material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); 1320 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1321 } 1322#endif 1323IncidentLight directLight; 1324#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1325 PointLight pointLight; 1326 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1327 PointLightShadow pointLightShadow; 1328 #endif 1329 #pragma unroll_loop_start 1330 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1331 pointLight = pointLights[ i ]; 1332 getPointLightInfo( pointLight, geometryPosition, directLight ); 1333 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 1334 pointLightShadow = pointLightShadows[ i ]; 1335 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1336 #endif 1337 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1338 } 1339 #pragma unroll_loop_end 1340#endif 1341#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1342 SpotLight spotLight; 1343 vec4 spotColor; 1344 vec3 spotLightCoord; 1345 bool inSpotLightMap; 1346 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1347 SpotLightShadow spotLightShadow; 1348 #endif 1349 #pragma unroll_loop_start 1350 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1351 spotLight = spotLights[ i ]; 1352 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1353 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1354 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1355 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1356 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1357 #else 1358 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1359 #endif 1360 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1361 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1362 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1363 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1364 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1365 #endif 1366 #undef SPOT_LIGHT_MAP_INDEX 1367 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1368 spotLightShadow = spotLightShadows[ i ]; 1369 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1370 #endif 1371 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1372 } 1373 #pragma unroll_loop_end 1374#endif 1375#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1376 DirectionalLight directionalLight; 1377 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1378 DirectionalLightShadow directionalLightShadow; 1379 #endif 1380 #pragma unroll_loop_start 1381 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1382 directionalLight = directionalLights[ i ]; 1383 getDirectionalLightInfo( directionalLight, directLight ); 1384 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1385 directionalLightShadow = directionalLightShadows[ i ]; 1386 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1387 #endif 1388 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1389 } 1390 #pragma unroll_loop_end 1391#endif 1392#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1393 RectAreaLight rectAreaLight; 1394 #pragma unroll_loop_start 1395 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1396 rectAreaLight = rectAreaLights[ i ]; 1397 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1398 } 1399 #pragma unroll_loop_end 1400#endif 1401#if defined( RE_IndirectDiffuse ) 1402 vec3 iblIrradiance = vec3( 0.0 ); 1403 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1404 #if defined( USE_LIGHT_PROBES ) 1405 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1406 #endif 1407 #if ( NUM_HEMI_LIGHTS > 0 ) 1408 #pragma unroll_loop_start 1409 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1410 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1411 } 1412 #pragma unroll_loop_end 1413 #endif 1414 #ifdef USE_LIGHT_PROBES_GRID 1415 vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz; 1416 vec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix ); 1417 irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal ); 1418 #endif 1419#endif 1420#if defined( RE_IndirectSpecular ) 1421 vec3 radiance = vec3( 0.0 ); 1422 vec3 clearcoatRadiance = vec3( 0.0 ); 1423#endif`,d1=`#if defined( RE_IndirectDiffuse ) 1424 #ifdef USE_LIGHTMAP 1425 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1426 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1427 irradiance += lightMapIrradiance; 1428 #endif 1429 #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV ) 1430 #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG ) 1431 iblIrradiance += getIBLIrradiance( geometryNormal ); 1432 #endif 1433 #endif 1434#endif 1435#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1436 #ifdef USE_ANISOTROPY 1437 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1438 #else 1439 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1440 #endif 1441 #ifdef USE_CLEARCOAT 1442 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1443 #endif 1444#endif`,f1=`#if defined( RE_IndirectDiffuse ) 1445 #if defined( LAMBERT ) || defined( PHONG ) 1446 irradiance += iblIrradiance; 1447 #endif 1448 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1449#endif 1450#if defined( RE_IndirectSpecular ) 1451 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1452#endif`,h1=`#ifdef USE_LIGHT_PROBES_GRID 1453uniform highp sampler3D probesSH; 1454uniform vec3 probesMin; 1455uniform vec3 probesMax; 1456uniform vec3 probesResolution; 1457vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) { 1458 vec3 res = probesResolution; 1459 vec3 gridRange = probesMax - probesMin; 1460 vec3 resMinusOne = res - 1.0; 1461 vec3 probeSpacing = gridRange / resMinusOne; 1462 vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5; 1463 vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 ); 1464 uvw = uvw * resMinusOne / res + 0.5 / res; 1465 float nz = res.z; 1466 float paddedSlices = nz + 2.0; 1467 float atlasDepth = 7.0 * paddedSlices; 1468 float uvZBase = uvw.z * nz + 1.0; 1469 vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) ); 1470 vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) ); 1471 vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) ); 1472 vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) ); 1473 vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) ); 1474 vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) ); 1475 vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) ); 1476 vec3 c0 = s0.xyz; 1477 vec3 c1 = vec3( s0.w, s1.xy ); 1478 vec3 c2 = vec3( s1.zw, s2.x ); 1479 vec3 c3 = s2.yzw; 1480 vec3 c4 = s3.xyz; 1481 vec3 c5 = vec3( s3.w, s4.xy ); 1482 vec3 c6 = vec3( s4.zw, s5.x ); 1483 vec3 c7 = s5.yzw; 1484 vec3 c8 = s6.xyz; 1485 float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z; 1486 vec3 result = c0 * 0.886227; 1487 result += c1 * 2.0 * 0.511664 * y; 1488 result += c2 * 2.0 * 0.511664 * z; 1489 result += c3 * 2.0 * 0.511664 * x; 1490 result += c4 * 2.0 * 0.429043 * x * y; 1491 result += c5 * 2.0 * 0.429043 * y * z; 1492 result += c6 * ( 0.743125 * z * z - 0.247708 ); 1493 result += c7 * 2.0 * 0.429043 * x * z; 1494 result += c8 * 0.429043 * ( x * x - y * y ); 1495 return max( result, vec3( 0.0 ) ); 1496} 1497#endif`,p1=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1498 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1499#endif`,m1=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1500 uniform float logDepthBufFC; 1501 varying float vFragDepth; 1502 varying float vIsPerspective; 1503#endif`,g1=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1504 varying float vFragDepth; 1505 varying float vIsPerspective; 1506#endif`,v1=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1507 vFragDepth = 1.0 + gl_Position.w; 1508 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1509#endif`,x1=`#ifdef USE_MAP 1510 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1511 #ifdef DECODE_VIDEO_TEXTURE 1512 sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); 1513 #endif 1514 diffuseColor *= sampledDiffuseColor; 1515#endif`,_1=`#ifdef USE_MAP 1516 uniform sampler2D map; 1517#endif`,y1=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1518 #if defined( USE_POINTS_UV ) 1519 vec2 uv = vUv; 1520 #else 1521 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1522 #endif 1523#endif 1524#ifdef USE_MAP 1525 diffuseColor *= texture2D( map, uv ); 1526#endif 1527#ifdef USE_ALPHAMAP 1528 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1529#endif`,S1=`#if defined( USE_POINTS_UV ) 1530 varying vec2 vUv; 1531#else 1532 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1533 uniform mat3 uvTransform; 1534 #endif 1535#endif 1536#ifdef USE_MAP 1537 uniform sampler2D map; 1538#endif 1539#ifdef USE_ALPHAMAP 1540 uniform sampler2D alphaMap; 1541#endif`,M1=`float metalnessFactor = metalness; 1542#ifdef USE_METALNESSMAP 1543 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1544 metalnessFactor *= texelMetalness.b; 1545#endif`,E1=`#ifdef USE_METALNESSMAP 1546 uniform sampler2D metalnessMap; 1547#endif`,b1=`#ifdef USE_INSTANCING_MORPH 1548 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1549 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1550 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1551 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1552 } 1553#endif`,w1=`#if defined( USE_MORPHCOLORS ) 1554 vColor *= morphTargetBaseInfluence; 1555 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1556 #if defined( USE_COLOR_ALPHA ) 1557 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1558 #elif defined( USE_COLOR ) 1559 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1560 #endif 1561 }
1562#endif`,T1=`#ifdef USE_MORPHNORMALS 1563 objectNormal *= morphTargetBaseInfluence; 1564 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1565 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1566 } 1567#endif`,C1=`#ifdef USE_MORPHTARGETS 1568 #ifndef USE_INSTANCING_MORPH 1569 uniform float morphTargetBaseInfluence; 1570 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1571 #endif 1572 uniform sampler2DArray morphTargetsTexture; 1573 uniform ivec2 morphTargetsTextureSize; 1574 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1575 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1576 int y = texelIndex / morphTargetsTextureSize.x; 1577 int x = texelIndex - y * morphTargetsTextureSize.x; 1578 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1579 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1580 } 1581#endif`,A1=`#ifdef USE_MORPHTARGETS 1582 transformed *= morphTargetBaseInfluence; 1583 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1584 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1585 } 1586#endif`,R1=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1587#ifdef FLAT_SHADED 1588 vec3 fdx = dFdx( vViewPosition ); 1589 vec3 fdy = dFdy( vViewPosition ); 1590 vec3 normal = normalize( cross( fdx, fdy ) ); 1591#else 1592 vec3 normal = normalize( vNormal ); 1593 #ifdef DOUBLE_SIDED 1594 normal *= faceDirection; 1595 #endif 1596#endif 1597#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1598 #ifdef USE_TANGENT 1599 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1600 #else 1601 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1602 #if defined( USE_NORMALMAP ) 1603 vNormalMapUv 1604 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1605 vClearcoatNormalMapUv 1606 #else 1607 vUv 1608 #endif 1609 ); 1610 #endif 1611 #ifdef DOUBLE_SIDED 1612 tbn[0] *= faceDirection; 1613 tbn[1] *= faceDirection; 1614 #endif 1615#endif 1616#ifdef USE_CLEARCOAT_NORMALMAP 1617 #ifdef USE_TANGENT 1618 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1619 #else 1620 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1621 #endif 1622 #ifdef DOUBLE_SIDED 1623 tbn2[0] *= faceDirection; 1624 tbn2[1] *= faceDirection; 1625 #endif 1626#endif 1627vec3 nonPerturbedNormal = normal;`,P1=`#ifdef USE_NORMALMAP_OBJECTSPACE 1628 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1629 #ifdef FLIP_SIDED 1630 normal = - normal; 1631 #endif 1632 #ifdef DOUBLE_SIDED 1633 normal = normal * faceDirection; 1634 #endif 1635 normal = normalize( normalMatrix * normal ); 1636#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1637 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1638 #if defined( USE_PACKED_NORMALMAP ) 1639 mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) ); 1640 #endif 1641 mapN.xy *= normalScale; 1642 normal = normalize( tbn * mapN ); 1643#elif defined( USE_BUMPMAP ) 1644 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1645#endif`,k1=`#ifndef FLAT_SHADED 1646 varying vec3 vNormal; 1647 #ifdef USE_TANGENT 1648 varying vec3 vTangent; 1649 varying vec3 vBitangent; 1650 #endif 1651#endif`,N1=`#ifndef FLAT_SHADED 1652 varying vec3 vNormal; 1653 #ifdef USE_TANGENT 1654 varying vec3 vTangent; 1655 varying vec3 vBitangent; 1656 #endif 1657#endif`,D1=`#ifndef FLAT_SHADED 1658 vNormal = normalize( transformedNormal ); 1659 #ifdef USE_TANGENT 1660 vTangent = normalize( transformedTangent ); 1661 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1662 #ifdef FLIP_SIDED 1663 vBitangent = - vBitangent; 1664 #endif 1665 #endif 1666#endif`,L1=`#ifdef USE_NORMALMAP 1667 uniform sampler2D normalMap; 1668 uniform vec2 normalScale; 1669#endif 1670#ifdef USE_NORMALMAP_OBJECTSPACE 1671 uniform mat3 normalMatrix; 1672#endif 1673#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1674 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1675 vec3 q0 = dFdx( eye_pos.xyz ); 1676 vec3 q1 = dFdy( eye_pos.xyz ); 1677 vec2 st0 = dFdx( uv.st ); 1678 vec2 st1 = dFdy( uv.st ); 1679 vec3 N = surf_norm; 1680 vec3 q1perp = cross( q1, N ); 1681 vec3 q0perp = cross( N, q0 ); 1682 vec3 T = q1perp * st0.x + q0perp * st1.x; 1683 vec3 B = q1perp * st0.y + q0perp * st1.y; 1684 float det = max( dot( T, T ), dot( B, B ) ); 1685 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1686 return mat3( T * scale, B * scale, N ); 1687 } 1688#endif`,I1=`#ifdef USE_CLEARCOAT 1689 vec3 clearcoatNormal = nonPerturbedNormal; 1690#endif`,U1=`#ifdef USE_CLEARCOAT_NORMALMAP 1691 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1692 clearcoatMapN.xy *= clearcoatNormalScale; 1693 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1694#endif`,F1=`#ifdef USE_CLEARCOATMAP 1695 uniform sampler2D clearcoatMap; 1696#endif 1697#ifdef USE_CLEARCOAT_NORMALMAP 1698 uniform sampler2D clearcoatNormalMap; 1699 uniform vec2 clearcoatNormalScale; 1700#endif 1701#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1702 uniform sampler2D clearcoatRoughnessMap;
1703#endif`,O1=`#ifdef USE_IRIDESCENCEMAP 1704 uniform sampler2D iridescenceMap; 1705#endif 1706#ifdef USE_IRIDESCENCE_THICKNESSMAP 1707 uniform sampler2D iridescenceThicknessMap; 1708#endif`,z1=`#ifdef OPAQUE 1709diffuseColor.a = 1.0; 1710#endif 1711#ifdef USE_TRANSMISSION 1712diffuseColor.a *= material.transmissionAlpha; 1713#endif 1714gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,j1=`vec3 packNormalToRGB( const in vec3 normal ) { 1715 return normalize( normal ) * 0.5 + 0.5; 1716} 1717vec3 unpackRGBToNormal( const in vec3 rgb ) { 1718 return 2.0 * rgb.xyz - 1.0; 1719} 1720const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 1721const float Inv255 = 1. / 255.; 1722const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 1723const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 1724const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 1725const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 1726vec4 packDepthToRGBA( const in float v ) { 1727 if( v <= 0.0 ) 1728 return vec4( 0., 0., 0., 0. ); 1729 if( v >= 1.0 ) 1730 return vec4( 1., 1., 1., 1. ); 1731 float vuf; 1732 float af = modf( v * PackFactors.a, vuf ); 1733 float bf = modf( vuf * ShiftRight8, vuf ); 1734 float gf = modf( vuf * ShiftRight8, vuf ); 1735 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 1736} 1737vec3 packDepthToRGB( const in float v ) { 1738 if( v <= 0.0 ) 1739 return vec3( 0., 0., 0. ); 1740 if( v >= 1.0 ) 1741 return vec3( 1., 1., 1. ); 1742 float vuf; 1743 float bf = modf( v * PackFactors.b, vuf ); 1744 float gf = modf( vuf * ShiftRight8, vuf ); 1745 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 1746} 1747vec2 packDepthToRG( const in float v ) { 1748 if( v <= 0.0 ) 1749 return vec2( 0., 0. ); 1750 if( v >= 1.0 ) 1751 return vec2( 1., 1. ); 1752 float vuf; 1753 float gf = modf( v * 256., vuf ); 1754 return vec2( vuf * Inv255, gf ); 1755} 1756float unpackRGBAToDepth( const in vec4 v ) { 1757 return dot( v, UnpackFactors4 ); 1758} 1759float unpackRGBToDepth( const in vec3 v ) { 1760 return dot( v, UnpackFactors3 ); 1761} 1762float unpackRGToDepth( const in vec2 v ) { 1763 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 1764} 1765vec4 pack2HalfToRGBA( const in vec2 v ) { 1766 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1767 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1768} 1769vec2 unpackRGBATo2Half( const in vec4 v ) { 1770 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1771} 1772float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1773 return ( viewZ + near ) / ( near - far ); 1774} 1775float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1776 #ifdef USE_REVERSED_DEPTH_BUFFER 1777 1778 return depth * ( far - near ) - far; 1779 #else 1780 return depth * ( near - far ) - near; 1781 #endif 1782} 1783float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1784 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1785} 1786float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1787 1788 #ifdef USE_REVERSED_DEPTH_BUFFER 1789 return ( near * far ) / ( ( near - far ) * depth - near ); 1790 #else 1791 return ( near * far ) / ( ( far - near ) * depth - far ); 1792 #endif 1793}`,B1=`#ifdef PREMULTIPLIED_ALPHA 1794 gl_FragColor.rgb *= gl_FragColor.a; 1795#endif`,G1=`vec4 mvPosition = vec4( transformed, 1.0 ); 1796#ifdef USE_BATCHING 1797 mvPosition = batchingMatrix * mvPosition; 1798#endif 1799#ifdef USE_INSTANCING 1800 mvPosition = instanceMatrix * mvPosition; 1801#endif 1802mvPosition = modelViewMatrix * mvPosition; 1803gl_Position = projectionMatrix * mvPosition;`,H1=`#ifdef DITHERING 1804 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1805#endif`,V1=`#ifdef DITHERING 1806 vec3 dithering( vec3 color ) { 1807 float grid_position = rand( gl_FragCoord.xy ); 1808 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1809 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1810 return color + dither_shift_RGB; 1811 } 1812#endif`,W1=`float roughnessFactor = roughness; 1813#ifdef USE_ROUGHNESSMAP 1814 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1815 roughnessFactor *= texelRoughness.g; 1816#endif`,X1=`#ifdef USE_ROUGHNESSMAP 1817 uniform sampler2D roughnessMap;
1818#endif`,$1=`#if NUM_SPOT_LIGHT_COORDS > 0 1819 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1820#endif 1821#if NUM_SPOT_LIGHT_MAPS > 0 1822 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1823#endif 1824#ifdef USE_SHADOWMAP 1825 #if NUM_DIR_LIGHT_SHADOWS > 0 1826 #if defined( SHADOWMAP_TYPE_PCF ) 1827 uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1828 #else 1829 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1830 #endif 1831 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1832 struct DirectionalLightShadow { 1833 float shadowIntensity; 1834 float shadowBias; 1835 float shadowNormalBias; 1836 float shadowRadius; 1837 vec2 shadowMapSize; 1838 }; 1839 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1840 #endif 1841 #if NUM_SPOT_LIGHT_SHADOWS > 0 1842 #if defined( SHADOWMAP_TYPE_PCF ) 1843 uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1844 #else 1845 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1846 #endif 1847 struct SpotLightShadow { 1848 float shadowIntensity; 1849 float shadowBias; 1850 float shadowNormalBias; 1851 float shadowRadius; 1852 vec2 shadowMapSize; 1853 }; 1854 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1855 #endif 1856 #if NUM_POINT_LIGHT_SHADOWS > 0 1857 #if defined( SHADOWMAP_TYPE_PCF ) 1858 uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1859 #elif defined( SHADOWMAP_TYPE_BASIC ) 1860 uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1861 #endif 1862 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1863 struct PointLightShadow { 1864 float shadowIntensity; 1865 float shadowBias; 1866 float shadowNormalBias; 1867 float shadowRadius; 1868 vec2 shadowMapSize; 1869 float shadowCameraNear; 1870 float shadowCameraFar; 1871 }; 1872 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1873 #endif 1874 #if defined( SHADOWMAP_TYPE_PCF ) 1875 float interleavedGradientNoise( vec2 position ) { 1876 return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); 1877 } 1878 vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { 1879 const float goldenAngle = 2.399963229728653; 1880 float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); 1881 float theta = float( sampleIndex ) * goldenAngle + phi; 1882 return vec2( cos( theta ), sin( theta ) ) * r; 1883 } 1884 #endif 1885 #if defined( SHADOWMAP_TYPE_PCF ) 1886 float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1887 float shadow = 1.0; 1888 shadowCoord.xyz /= shadowCoord.w; 1889 shadowCoord.z += shadowBias; 1890 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1891 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1892 if ( frustumTest ) { 1893 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1894 float radius = shadowRadius * texelSize.x; 1895 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; 1896 shadow = ( 1897 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + 1898 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + 1899 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + 1900 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + 1901 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) 1902 ) * 0.2; 1903 } 1904 return mix( 1.0, shadow, shadowIntensity ); 1905 } 1906 #elif defined( SHADOWMAP_TYPE_VSM ) 1907 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1908 float shadow = 1.0; 1909 shadowCoord.xyz /= shadowCoord.w; 1910 #ifdef USE_REVERSED_DEPTH_BUFFER 1911 shadowCoord.z -= shadowBias; 1912 #else 1913 shadowCoord.z += shadowBias; 1914 #endif 1915 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1916 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1917 if ( frustumTest ) { 1918 vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; 1919 float mean = distribution.x; 1920 float variance = distribution.y * distribution.y; 1921 #ifdef USE_REVERSED_DEPTH_BUFFER 1922 float hard_shadow = step( mean, shadowCoord.z ); 1923 #else 1924 float hard_shadow = step( shadowCoord.z, mean ); 1925 #endif 1926 1927 if ( hard_shadow == 1.0 ) { 1928 shadow = 1.0; 1929 } else { 1930 variance = max( variance, 0.0000001 ); 1931 float d = shadowCoord.z - mean; 1932 float p_max = variance / ( variance + d * d ); 1933 p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); 1934 shadow = max( hard_shadow, p_max ); 1935 } 1936 } 1937 return mix( 1.0, shadow, shadowIntensity ); 1938 } 1939 #else 1940 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1941 float shadow = 1.0; 1942 shadowCoord.xyz /= shadowCoord.w; 1943 #ifdef USE_REVERSED_DEPTH_BUFFER 1944 shadowCoord.z -= shadowBias; 1945 #else 1946 shadowCoord.z += shadowBias; 1947 #endif 1948 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1949 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1950 if ( frustumTest ) { 1951 float depth = texture2D( shadowMap, shadowCoord.xy ).r; 1952 #ifdef USE_REVERSED_DEPTH_BUFFER 1953 shadow = step( depth, shadowCoord.z ); 1954 #else 1955 shadow = step( shadowCoord.z, depth ); 1956 #endif 1957 } 1958 return mix( 1.0, shadow, shadowIntensity ); 1959 } 1960 #endif 1961 #if NUM_POINT_LIGHT_SHADOWS > 0 1962 #if defined( SHADOWMAP_TYPE_PCF ) 1963 float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1964 float shadow = 1.0; 1965 vec3 lightToPosition = shadowCoord.xyz; 1966 vec3 bd3D = normalize( lightToPosition ); 1967 vec3 absVec = abs( lightToPosition ); 1968 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 1969 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 1970 #ifdef USE_REVERSED_DEPTH_BUFFER 1971 float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1972 dp -= shadowBias; 1973 #else 1974 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 1975 dp += shadowBias; 1976 #endif 1977 float texelSize = shadowRadius / shadowMapSize.x; 1978 vec3 absDir = abs( bd3D ); 1979 vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); 1980 tangent = normalize( cross( bd3D, tangent ) ); 1981 vec3 bitangent = cross( bd3D, tangent ); 1982 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; 1983 vec2 sample0 = vogelDiskSample( 0, 5, phi ); 1984 vec2 sample1 = vogelDiskSample( 1, 5, phi ); 1985 vec2 sample2 = vogelDiskSample( 2, 5, phi ); 1986 vec2 sample3 = vogelDiskSample( 3, 5, phi ); 1987 vec2 sample4 = vogelDiskSample( 4, 5, phi ); 1988 shadow = ( 1989 texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) + 1990 texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) + 1991 texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) + 1992 texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) + 1993 texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) ) 1994 ) * 0.2; 1995 } 1996 return mix( 1.0, shadow, shadowIntensity ); 1997 } 1998 #elif defined( SHADOWMAP_TYPE_BASIC ) 1999 float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 2000 float shadow = 1.0; 2001 vec3 lightToPosition = shadowCoord.xyz; 2002 vec3 absVec = abs( lightToPosition ); 2003 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 2004 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 2005 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 2006 dp += shadowBias; 2007 vec3 bd3D = normalize( lightToPosition ); 2008 float depth = textureCube( shadowMap, bd3D ).r; 2009 #ifdef USE_REVERSED_DEPTH_BUFFER 2010 depth = 1.0 - depth; 2011 #endif 2012 shadow = step( dp, depth ); 2013 } 2014 return mix( 1.0, shadow, shadowIntensity ); 2015 } 2016 #endif 2017 #endif 2018#endif`,Y1=`#if NUM_SPOT_LIGHT_COORDS > 0 2019 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 2020 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 2021#endif 2022#ifdef USE_SHADOWMAP 2023 #if NUM_DIR_LIGHT_SHADOWS > 0 2024 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 2025 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 2026 struct DirectionalLightShadow { 2027 float shadowIntensity; 2028 float shadowBias; 2029 float shadowNormalBias; 2030 float shadowRadius; 2031 vec2 shadowMapSize; 2032 }; 2033 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 2034 #endif 2035 #if NUM_SPOT_LIGHT_SHADOWS > 0 2036 struct SpotLightShadow { 2037 float shadowIntensity; 2038 float shadowBias; 2039 float shadowNormalBias; 2040 float shadowRadius; 2041 vec2 shadowMapSize; 2042 }; 2043 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 2044 #endif 2045 #if NUM_POINT_LIGHT_SHADOWS > 0 2046 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 2047 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 2048 struct PointLightShadow { 2049 float shadowIntensity; 2050 float shadowBias; 2051 float shadowNormalBias; 2052 float shadowRadius; 2053 vec2 shadowMapSize; 2054 float shadowCameraNear; 2055 float shadowCameraFar; 2056 }; 2057 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2058 #endif 2059#endif`,K1=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 2060 #ifdef HAS_NORMAL 2061 vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix ); 2062 #else 2063 vec3 shadowWorldNormal = vec3( 0.0 ); 2064 #endif 2065 vec4 shadowWorldPosition; 2066#endif 2067#if defined( USE_SHADOWMAP ) 2068 #if NUM_DIR_LIGHT_SHADOWS > 0 2069 #pragma unroll_loop_start 2070 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2071 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 2072 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 2073 } 2074 #pragma unroll_loop_end 2075 #endif 2076 #if NUM_POINT_LIGHT_SHADOWS > 0 2077 #pragma unroll_loop_start 2078 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2079 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 2080 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 2081 } 2082 #pragma unroll_loop_end 2083 #endif 2084#endif
2085#if NUM_SPOT_LIGHT_COORDS > 0 2086 #pragma unroll_loop_start 2087 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 2088 shadowWorldPosition = worldPosition; 2089 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2090 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 2091 #endif 2092 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 2093 } 2094 #pragma unroll_loop_end 2095#endif`,q1=`float getShadowMask() { 2096 float shadow = 1.0; 2097 #ifdef USE_SHADOWMAP 2098 #if NUM_DIR_LIGHT_SHADOWS > 0 2099 DirectionalLightShadow directionalLight; 2100 #pragma unroll_loop_start 2101 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2102 directionalLight = directionalLightShadows[ i ]; 2103 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2104 } 2105 #pragma unroll_loop_end 2106 #endif 2107 #if NUM_SPOT_LIGHT_SHADOWS > 0 2108 SpotLightShadow spotLight; 2109 #pragma unroll_loop_start 2110 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 2111 spotLight = spotLightShadows[ i ]; 2112 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2113 } 2114 #pragma unroll_loop_end 2115 #endif 2116 #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 2117 PointLightShadow pointLight; 2118 #pragma unroll_loop_start 2119 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2120 pointLight = pointLightShadows[ i ]; 2121 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2122 } 2123 #pragma unroll_loop_end 2124 #endif 2125 #endif 2126 return shadow; 2127}`,Z1=`#ifdef USE_SKINNING 2128 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2129 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2130 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2131 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2132#endif`,J1=`#ifdef USE_SKINNING 2133 uniform mat4 bindMatrix; 2134 uniform mat4 bindMatrixInverse; 2135 uniform highp sampler2D boneTexture; 2136 mat4 getBoneMatrix( const in float i ) { 2137 int size = textureSize( boneTexture, 0 ).x; 2138 int j = int( i ) * 4; 2139 int x = j % size; 2140 int y = j / size; 2141 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2142 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2143 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2144 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2145 return mat4( v1, v2, v3, v4 ); 2146 } 2147#endif`,Q1=`#ifdef USE_SKINNING 2148 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2149 vec4 skinned = vec4( 0.0 ); 2150 skinned += boneMatX * skinVertex * skinWeight.x; 2151 skinned += boneMatY * skinVertex * skinWeight.y; 2152 skinned += boneMatZ * skinVertex * skinWeight.z; 2153 skinned += boneMatW * skinVertex * skinWeight.w; 2154 transformed = ( bindMatrixInverse * skinned ).xyz; 2155#endif`,eT=`#ifdef USE_SKINNING 2156 mat4 skinMatrix = mat4( 0.0 ); 2157 skinMatrix += skinWeight.x * boneMatX; 2158 skinMatrix += skinWeight.y * boneMatY; 2159 skinMatrix += skinWeight.z * boneMatZ; 2160 skinMatrix += skinWeight.w * boneMatW; 2161 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2162 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2163 #ifdef USE_TANGENT 2164 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2165 #endif 2166#endif`,tT=`float specularStrength; 2167#ifdef USE_SPECULARMAP 2168 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2169 specularStrength = texelSpecular.r; 2170#else 2171 specularStrength = 1.0; 2172#endif`,nT=`#ifdef USE_SPECULARMAP 2173 uniform sampler2D specularMap; 2174#endif`,iT=`#if defined( TONE_MAPPING ) 2175 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2176#endif`,rT=`#ifndef saturate 2177#define saturate( a ) clamp( a, 0.0, 1.0 ) 2178#endif 2179uniform float toneMappingExposure; 2180vec3 LinearToneMapping( vec3 color ) { 2181 return saturate( toneMappingExposure * color ); 2182} 2183vec3 ReinhardToneMapping( vec3 color ) { 2184 color *= toneMappingExposure; 2185 return saturate( color / ( vec3( 1.0 ) + color ) ); 2186} 2187vec3 CineonToneMapping( vec3 color ) { 2188 color *= toneMappingExposure; 2189 color = max( vec3( 0.0 ), color - 0.004 ); 2190 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2191} 2192vec3 RRTAndODTFit( vec3 v ) { 2193 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2194 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2195 return a / b; 2196} 2197vec3 ACESFilmicToneMapping( vec3 color ) { 2198 const mat3 ACESInputMat = mat3( 2199 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2200 vec3( 0.04823, 0.01566, 0.83777 ) 2201 ); 2202 const mat3 ACESOutputMat = mat3( 2203 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2204 vec3( -0.07367, -0.00605, 1.07602 ) 2205 ); 2206 color *= toneMappingExposure / 0.6; 2207 color = ACESInputMat * color; 2208 color = RRTAndODTFit( color ); 2209 color = ACESOutputMat * color; 2210 return saturate( color ); 2211} 2212const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2213 vec3( 1.6605, - 0.1246, - 0.0182 ), 2214 vec3( - 0.5876, 1.1329, - 0.1006 ), 2215 vec3( - 0.0728, - 0.0083, 1.1187 ) 2216); 2217const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2218 vec3( 0.6274, 0.0691, 0.0164 ), 2219 vec3( 0.3293, 0.9195, 0.0880 ), 2220 vec3( 0.0433, 0.0113, 0.8956 ) 2221); 2222vec3 agxDefaultContrastApprox( vec3 x ) { 2223 vec3 x2 = x * x; 2224 vec3 x4 = x2 * x2; 2225 return + 15.5 * x4 * x2 2226 - 40.14 * x4 * x 2227 + 31.96 * x4 2228 - 6.868 * x2 * x 2229 + 0.4298 * x2 2230 + 0.1191 * x 2231 - 0.00232; 2232} 2233vec3 AgXToneMapping( vec3 color ) { 2234 const mat3 AgXInsetMatrix = mat3( 2235 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2236 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2237 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2238 );
2239 const mat3 AgXOutsetMatrix = mat3( 2240 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2241 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2242 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2243 ); 2244 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2245 color *= toneMappingExposure; 2246 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2247 color = AgXInsetMatrix * color; 2248 color = max( color, 1e-10 ); color = log2( color ); 2249 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2250 color = clamp( color, 0.0, 1.0 ); 2251 color = agxDefaultContrastApprox( color ); 2252 color = AgXOutsetMatrix * color; 2253 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2254 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2255 color = clamp( color, 0.0, 1.0 ); 2256 return color; 2257} 2258vec3 NeutralToneMapping( vec3 color ) { 2259 const float StartCompression = 0.8 - 0.04; 2260 const float Desaturation = 0.15; 2261 color *= toneMappingExposure; 2262 float x = min( color.r, min( color.g, color.b ) ); 2263 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2264 color -= offset; 2265 float peak = max( color.r, max( color.g, color.b ) ); 2266 if ( peak < StartCompression ) return color; 2267 float d = 1. - StartCompression; 2268 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2269 color *= newPeak / peak; 2270 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2271 return mix( color, vec3( newPeak ), g ); 2272} 2273vec3 CustomToneMapping( vec3 color ) { return color; }`,sT=`#ifdef USE_TRANSMISSION 2274 material.transmission = transmission; 2275 material.transmissionAlpha = 1.0; 2276 material.thickness = thickness; 2277 material.attenuationDistance = attenuationDistance; 2278 material.attenuationColor = attenuationColor; 2279 #ifdef USE_TRANSMISSIONMAP 2280 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2281 #endif 2282 #ifdef USE_THICKNESSMAP 2283 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2284 #endif 2285 vec3 pos = vWorldPosition; 2286 vec3 v = normalize( cameraPosition - pos ); 2287 vec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix ); 2288 vec4 transmitted = getIBLVolumeRefraction( 2289 n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, 2290 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2291 material.attenuationColor, material.attenuationDistance ); 2292 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2293 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2294#endif`,aT=`#ifdef USE_TRANSMISSION 2295 uniform float transmission; 2296 uniform float thickness; 2297 uniform float attenuationDistance; 2298 uniform vec3 attenuationColor; 2299 #ifdef USE_TRANSMISSIONMAP 2300 uniform sampler2D transmissionMap; 2301 #endif 2302 #ifdef USE_THICKNESSMAP 2303 uniform sampler2D thicknessMap; 2304 #endif 2305 uniform vec2 transmissionSamplerSize; 2306 uniform sampler2D transmissionSamplerMap; 2307 uniform mat4 modelMatrix; 2308 uniform mat4 projectionMatrix; 2309 varying vec3 vWorldPosition; 2310 float w0( float a ) { 2311 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2312 } 2313 float w1( float a ) { 2314 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2315 } 2316 float w2( float a ){ 2317 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2318 } 2319 float w3( float a ) { 2320 return ( 1.0 / 6.0 ) * ( a * a * a ); 2321 } 2322 float g0( float a ) { 2323 return w0( a ) + w1( a ); 2324 } 2325 float g1( float a ) { 2326 return w2( a ) + w3( a ); 2327 } 2328 float h0( float a ) { 2329 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2330 } 2331 float h1( float a ) { 2332 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2333 } 2334 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2335 uv = uv * texelSize.zw + 0.5; 2336 vec2 iuv = floor( uv ); 2337 vec2 fuv = fract( uv ); 2338 float g0x = g0( fuv.x ); 2339 float g1x = g1( fuv.x ); 2340 float h0x = h0( fuv.x ); 2341 float h1x = h1( fuv.x ); 2342 float h0y = h0( fuv.y ); 2343 float h1y = h1( fuv.y ); 2344 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2345 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2346 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2347 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2348 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2349 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2350 } 2351 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2352 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2353 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2354 vec2 fLodSizeInv = 1.0 / fLodSize; 2355 vec2 cLodSizeInv = 1.0 / cLodSize; 2356 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2357 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2358 return mix( fSample, cSample, fract( lod ) ); 2359 } 2360 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2361 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2362 vec3 modelScale; 2363 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2364 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2365 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2366 return normalize( refractionVector ) * thickness * modelScale; 2367 } 2368 float applyIorToRoughness( const in float roughness, const in float ior ) { 2369 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2370 } 2371 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2372 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2373 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2374 } 2375 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2376 if ( isinf( attenuationDistance ) ) { 2377 return vec3( 1.0 ); 2378 } else { 2379 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2380 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2381 } 2382 } 2383 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2384 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2385 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2386 const in vec3 attenuationColor, const in float attenuationDistance ) { 2387 vec4 transmittedLight; 2388 vec3 transmittance; 2389 #ifdef USE_DISPERSION 2390 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2391 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2392 for ( int i = 0; i < 3; i ++ ) { 2393 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2394 vec3 refractedRayExit = position + transmissionRay; 2395 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2396 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2397 refractionCoords += 1.0; 2398 refractionCoords /= 2.0; 2399 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2400 transmittedLight[ i ] = transmissionSample[ i ]; 2401 transmittedLight.a += transmissionSample.a; 2402 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2403 } 2404 transmittedLight.a /= 3.0; 2405 #else 2406 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2407 vec3 refractedRayExit = position + transmissionRay; 2408 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2409 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2410 refractionCoords += 1.0; 2411 refractionCoords /= 2.0; 2412 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2413 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2414 #endif 2415 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2416 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2417 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2418 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2419 } 2420#endif`,oT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2421 varying vec2 vUv; 2422#endif 2423#ifdef USE_MAP 2424 varying vec2 vMapUv; 2425#endif 2426#ifdef USE_ALPHAMAP
2427 varying vec2 vAlphaMapUv; 2428#endif 2429#ifdef USE_LIGHTMAP 2430 varying vec2 vLightMapUv; 2431#endif 2432#ifdef USE_AOMAP 2433 varying vec2 vAoMapUv; 2434#endif 2435#ifdef USE_BUMPMAP 2436 varying vec2 vBumpMapUv; 2437#endif 2438#ifdef USE_NORMALMAP 2439 varying vec2 vNormalMapUv; 2440#endif 2441#ifdef USE_EMISSIVEMAP 2442 varying vec2 vEmissiveMapUv; 2443#endif 2444#ifdef USE_METALNESSMAP 2445 varying vec2 vMetalnessMapUv; 2446#endif 2447#ifdef USE_ROUGHNESSMAP 2448 varying vec2 vRoughnessMapUv; 2449#endif 2450#ifdef USE_ANISOTROPYMAP 2451 varying vec2 vAnisotropyMapUv; 2452#endif 2453#ifdef USE_CLEARCOATMAP 2454 varying vec2 vClearcoatMapUv; 2455#endif 2456#ifdef USE_CLEARCOAT_NORMALMAP 2457 varying vec2 vClearcoatNormalMapUv; 2458#endif 2459#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2460 varying vec2 vClearcoatRoughnessMapUv; 2461#endif 2462#ifdef USE_IRIDESCENCEMAP 2463 varying vec2 vIridescenceMapUv; 2464#endif 2465#ifdef USE_IRIDESCENCE_THICKNESSMAP 2466 varying vec2 vIridescenceThicknessMapUv; 2467#endif 2468#ifdef USE_SHEEN_COLORMAP 2469 varying vec2 vSheenColorMapUv; 2470#endif 2471#ifdef USE_SHEEN_ROUGHNESSMAP 2472 varying vec2 vSheenRoughnessMapUv; 2473#endif 2474#ifdef USE_SPECULARMAP 2475 varying vec2 vSpecularMapUv; 2476#endif 2477#ifdef USE_SPECULAR_COLORMAP 2478 varying vec2 vSpecularColorMapUv; 2479#endif 2480#ifdef USE_SPECULAR_INTENSITYMAP 2481 varying vec2 vSpecularIntensityMapUv; 2482#endif 2483#ifdef USE_TRANSMISSIONMAP 2484 uniform mat3 transmissionMapTransform; 2485 varying vec2 vTransmissionMapUv; 2486#endif 2487#ifdef USE_THICKNESSMAP 2488 uniform mat3 thicknessMapTransform; 2489 varying vec2 vThicknessMapUv; 2490#endif`,lT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2491 varying vec2 vUv; 2492#endif 2493#ifdef USE_MAP 2494 uniform mat3 mapTransform; 2495 varying vec2 vMapUv; 2496#endif 2497#ifdef USE_ALPHAMAP 2498 uniform mat3 alphaMapTransform; 2499 varying vec2 vAlphaMapUv; 2500#endif 2501#ifdef USE_LIGHTMAP 2502 uniform mat3 lightMapTransform; 2503 varying vec2 vLightMapUv; 2504#endif 2505#ifdef USE_AOMAP 2506 uniform mat3 aoMapTransform; 2507 varying vec2 vAoMapUv; 2508#endif 2509#ifdef USE_BUMPMAP 2510 uniform mat3 bumpMapTransform; 2511 varying vec2 vBumpMapUv; 2512#endif 2513#ifdef USE_NORMALMAP 2514 uniform mat3 normalMapTransform; 2515 varying vec2 vNormalMapUv; 2516#endif 2517#ifdef USE_DISPLACEMENTMAP 2518 uniform mat3 displacementMapTransform; 2519 varying vec2 vDisplacementMapUv; 2520#endif 2521#ifdef USE_EMISSIVEMAP 2522 uniform mat3 emissiveMapTransform; 2523 varying vec2 vEmissiveMapUv; 2524#endif 2525#ifdef USE_METALNESSMAP 2526 uniform mat3 metalnessMapTransform; 2527 varying vec2 vMetalnessMapUv; 2528#endif 2529#ifdef USE_ROUGHNESSMAP 2530 uniform mat3 roughnessMapTransform; 2531 varying vec2 vRoughnessMapUv; 2532#endif 2533#ifdef USE_ANISOTROPYMAP 2534 uniform mat3 anisotropyMapTransform; 2535 varying vec2 vAnisotropyMapUv; 2536#endif 2537#ifdef USE_CLEARCOATMAP 2538 uniform mat3 clearcoatMapTransform; 2539 varying vec2 vClearcoatMapUv; 2540#endif 2541#ifdef USE_CLEARCOAT_NORMALMAP 2542 uniform mat3 clearcoatNormalMapTransform; 2543 varying vec2 vClearcoatNormalMapUv; 2544#endif 2545#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2546 uniform mat3 clearcoatRoughnessMapTransform; 2547 varying vec2 vClearcoatRoughnessMapUv; 2548#endif 2549#ifdef USE_SHEEN_COLORMAP 2550 uniform mat3 sheenColorMapTransform; 2551 varying vec2 vSheenColorMapUv; 2552#endif 2553#ifdef USE_SHEEN_ROUGHNESSMAP 2554 uniform mat3 sheenRoughnessMapTransform; 2555 varying vec2 vSheenRoughnessMapUv; 2556#endif 2557#ifdef USE_IRIDESCENCEMAP 2558 uniform mat3 iridescenceMapTransform; 2559 varying vec2 vIridescenceMapUv; 2560#endif 2561#ifdef USE_IRIDESCENCE_THICKNESSMAP 2562 uniform mat3 iridescenceThicknessMapTransform; 2563 varying vec2 vIridescenceThicknessMapUv; 2564#endif 2565#ifdef USE_SPECULARMAP 2566 uniform mat3 specularMapTransform; 2567 varying vec2 vSpecularMapUv; 2568#endif 2569#ifdef USE_SPECULAR_COLORMAP 2570 uniform mat3 specularColorMapTransform; 2571 varying vec2 vSpecularColorMapUv; 2572#endif 2573#ifdef USE_SPECULAR_INTENSITYMAP 2574 uniform mat3 specularIntensityMapTransform; 2575 varying vec2 vSpecularIntensityMapUv; 2576#endif 2577#ifdef USE_TRANSMISSIONMAP 2578 uniform mat3 transmissionMapTransform; 2579 varying vec2 vTransmissionMapUv; 2580#endif 2581#ifdef USE_THICKNESSMAP 2582 uniform mat3 thicknessMapTransform; 2583 varying vec2 vThicknessMapUv; 2584#endif`,cT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2585 vUv = vec3( uv, 1 ).xy; 2586#endif 2587#ifdef USE_MAP 2588 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2589#endif 2590#ifdef USE_ALPHAMAP 2591 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2592#endif 2593#ifdef USE_LIGHTMAP 2594 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2595#endif 2596#ifdef USE_AOMAP 2597 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2598#endif 2599#ifdef USE_BUMPMAP 2600 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2601#endif 2602#ifdef USE_NORMALMAP 2603 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2604#endif 2605#ifdef USE_DISPLACEMENTMAP 2606 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2607#endif 2608#ifdef USE_EMISSIVEMAP 2609 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2610#endif 2611#ifdef USE_METALNESSMAP 2612 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2613#endif 2614#ifdef USE_ROUGHNESSMAP 2615 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2616#endif 2617#ifdef USE_ANISOTROPYMAP 2618 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2619#endif 2620#ifdef USE_CLEARCOATMAP 2621 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2622#endif 2623#ifdef USE_CLEARCOAT_NORMALMAP 2624 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2625#endif 2626#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2627 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2628#endif
2629#ifdef USE_IRIDESCENCEMAP 2630 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2631#endif 2632#ifdef USE_IRIDESCENCE_THICKNESSMAP 2633 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2634#endif 2635#ifdef USE_SHEEN_COLORMAP 2636 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2637#endif 2638#ifdef USE_SHEEN_ROUGHNESSMAP 2639 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2640#endif 2641#ifdef USE_SPECULARMAP 2642 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2643#endif 2644#ifdef USE_SPECULAR_COLORMAP 2645 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2646#endif 2647#ifdef USE_SPECULAR_INTENSITYMAP 2648 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2649#endif 2650#ifdef USE_TRANSMISSIONMAP 2651 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2652#endif 2653#ifdef USE_THICKNESSMAP 2654 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2655#endif`,uT=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2656 vec4 worldPosition = vec4( transformed, 1.0 ); 2657 #ifdef USE_BATCHING 2658 worldPosition = batchingMatrix * worldPosition; 2659 #endif 2660 #ifdef USE_INSTANCING 2661 worldPosition = instanceMatrix * worldPosition; 2662 #endif 2663 worldPosition = modelMatrix * worldPosition; 2664#endif`;const dT=`varying vec2 vUv; 2665uniform mat3 uvTransform; 2666void main() { 2667 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2668 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2669}`,fT=`uniform sampler2D t2D; 2670uniform float backgroundIntensity; 2671varying vec2 vUv; 2672void main() { 2673 vec4 texColor = texture2D( t2D, vUv ); 2674 #ifdef DECODE_VIDEO_TEXTURE 2675 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 ); 2676 #endif 2677 texColor.rgb *= backgroundIntensity; 2678 gl_FragColor = texColor; 2679 #include <tonemapping_fragment> 2680 #include <colorspace_fragment> 2681}`,hT=`varying vec3 vWorldDirection; 2682#include <common> 2683void main() { 2684 vWorldDirection = transformDirection( position, modelMatrix ); 2685 #include <begin_vertex> 2686 #include <project_vertex> 2687 gl_Position.z = gl_Position.w; 2688}`,pT=`#ifdef ENVMAP_TYPE_CUBE 2689 uniform samplerCube envMap; 2690#elif defined( ENVMAP_TYPE_CUBE_UV ) 2691 uniform sampler2D envMap; 2692#endif 2693uniform float backgroundBlurriness; 2694uniform float backgroundIntensity; 2695uniform mat3 backgroundRotation; 2696varying vec3 vWorldDirection; 2697#include <cube_uv_reflection_fragment> 2698void main() { 2699 #ifdef ENVMAP_TYPE_CUBE 2700 vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection ); 2701 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2702 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2703 #else 2704 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2705 #endif 2706 texColor.rgb *= backgroundIntensity; 2707 gl_FragColor = texColor; 2708 #include <tonemapping_fragment> 2709 #include <colorspace_fragment> 2710}`,mT=`varying vec3 vWorldDirection; 2711#include <common> 2712void main() { 2713 vWorldDirection = transformDirection( position, modelMatrix ); 2714 #include <begin_vertex> 2715 #include <project_vertex> 2716 gl_Position.z = gl_Position.w; 2717}`,gT=`uniform samplerCube tCube; 2718uniform float tFlip; 2719uniform float opacity; 2720varying vec3 vWorldDirection; 2721void main() { 2722 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2723 gl_FragColor = texColor; 2724 gl_FragColor.a *= opacity; 2725 #include <tonemapping_fragment> 2726 #include <colorspace_fragment> 2727}`,vT=`#include <common> 2728#include <batching_pars_vertex> 2729#include <uv_pars_vertex> 2730#include <displacementmap_pars_vertex> 2731#include <morphtarget_pars_vertex> 2732#include <skinning_pars_vertex> 2733#include <logdepthbuf_pars_vertex> 2734#include <clipping_planes_pars_vertex> 2735varying vec2 vHighPrecisionZW; 2736void main() { 2737 #include <uv_vertex> 2738 #include <batching_vertex> 2739 #include <skinbase_vertex> 2740 #include <morphinstance_vertex> 2741 #ifdef USE_DISPLACEMENTMAP 2742 #include <beginnormal_vertex> 2743 #include <morphnormal_vertex> 2744 #include <skinnormal_vertex> 2745 #endif 2746 #include <begin_vertex> 2747 #include <morphtarget_vertex> 2748 #include <skinning_vertex> 2749 #include <displacementmap_vertex> 2750 #include <project_vertex> 2751 #include <logdepthbuf_vertex> 2752 #include <clipping_planes_vertex> 2753 vHighPrecisionZW = gl_Position.zw; 2754}`,xT=`#if DEPTH_PACKING == 3200 2755 uniform float opacity; 2756#endif 2757#include <common> 2758#include <packing> 2759#include <uv_pars_fragment> 2760#include <map_pars_fragment> 2761#include <alphamap_pars_fragment> 2762#include <alphatest_pars_fragment> 2763#include <alphahash_pars_fragment> 2764#include <logdepthbuf_pars_fragment> 2765#include <clipping_planes_pars_fragment> 2766varying vec2 vHighPrecisionZW; 2767void main() { 2768 vec4 diffuseColor = vec4( 1.0 ); 2769 #include <clipping_planes_fragment> 2770 #if DEPTH_PACKING == 3200 2771 diffuseColor.a = opacity; 2772 #endif 2773 #include <map_fragment> 2774 #include <alphamap_fragment> 2775 #include <alphatest_fragment> 2776 #include <alphahash_fragment> 2777 #include <logdepthbuf_fragment> 2778 #ifdef USE_REVERSED_DEPTH_BUFFER 2779 float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; 2780 #else 2781 float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; 2782 #endif 2783 #if DEPTH_PACKING == 3200 2784 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2785 #elif DEPTH_PACKING == 3201 2786 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2787 #elif DEPTH_PACKING == 3202 2788 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 2789 #elif DEPTH_PACKING == 3203 2790 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 2791 #endif 2792}`,_T=`#define DISTANCE 2793varying vec3 vWorldPosition; 2794#include <common> 2795#include <batching_pars_vertex> 2796#include <uv_pars_vertex> 2797#include <displacementmap_pars_vertex> 2798#include <morphtarget_pars_vertex> 2799#include <skinning_pars_vertex> 2800#include <clipping_planes_pars_vertex> 2801void main() { 2802 #include <uv_vertex> 2803 #include <batching_vertex> 2804 #include <skinbase_vertex> 2805 #include <morphinstance_vertex> 2806 #ifdef USE_DISPLACEMENTMAP 2807 #include <beginnormal_vertex> 2808 #include <morphnormal_vertex> 2809 #include <skinnormal_vertex> 2810 #endif 2811 #include <begin_vertex> 2812 #include <morphtarget_vertex> 2813 #include <skinning_vertex> 2814 #include <displacementmap_vertex> 2815 #include <project_vertex> 2816 #include <worldpos_vertex> 2817 #include <clipping_planes_vertex> 2818 vWorldPosition = worldPosition.xyz; 2819}`,yT=`#define DISTANCE 2820uniform vec3 referencePosition; 2821uniform float nearDistance; 2822uniform float farDistance; 2823varying vec3 vWorldPosition; 2824#include <common> 2825#include <uv_pars_fragment> 2826#include <map_pars_fragment> 2827#include <alphamap_pars_fragment> 2828#include <alphatest_pars_fragment> 2829#include <alphahash_pars_fragment> 2830#include <clipping_planes_pars_fragment> 2831void main() { 2832 vec4 diffuseColor = vec4( 1.0 ); 2833 #include <clipping_planes_fragment> 2834 #include <map_fragment> 2835 #include <alphamap_fragment> 2836 #include <alphatest_fragment> 2837 #include <alphahash_fragment> 2838 float dist = length( vWorldPosition - referencePosition ); 2839 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2840 dist = saturate( dist ); 2841 gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); 2842}`,ST=`varying vec3 vWorldDirection; 2843#include <common> 2844void main() { 2845 vWorldDirection = transformDirection( position, modelMatrix ); 2846 #include <begin_vertex> 2847 #include <project_vertex> 2848}`,MT=`uniform sampler2D tEquirect; 2849varying vec3 vWorldDirection; 2850#include <common> 2851void main() { 2852 vec3 direction = normalize( vWorldDirection ); 2853 vec2 sampleUV = equirectUv( direction ); 2854 gl_FragColor = texture2D( tEquirect, sampleUV ); 2855 #include <tonemapping_fragment> 2856 #include <colorspace_fragment> 2857}`,ET=`uniform float scale; 2858attribute float lineDistance; 2859varying float vLineDistance; 2860#include <common> 2861#include <uv_pars_vertex> 2862#include <color_pars_vertex> 2863#include <fog_pars_vertex> 2864#include <morphtarget_pars_vertex> 2865#include <logdepthbuf_pars_vertex> 2866#include <clipping_planes_pars_vertex> 2867void main() { 2868 vLineDistance = scale * lineDistance; 2869 #include <uv_vertex> 2870 #include <color_vertex> 2871 #include <morphinstance_vertex> 2872 #include <morphcolor_vertex> 2873 #include <begin_vertex> 2874 #include <morphtarget_vertex> 2875 #include <project_vertex> 2876 #include <logdepthbuf_vertex> 2877 #include <clipping_planes_vertex> 2878 #include <fog_vertex> 2879}`,bT=`uniform vec3 diffuse; 2880uniform float opacity; 2881uniform float dashSize; 2882uniform float totalSize; 2883varying float vLineDistance; 2884#include <common> 2885#include <color_pars_fragment> 2886#include <uv_pars_fragment> 2887#include <map_pars_fragment> 2888#include <fog_pars_fragment> 2889#include <logdepthbuf_pars_fragment> 2890#include <clipping_planes_pars_fragment> 2891void main() { 2892 vec4 diffuseColor = vec4( diffuse, opacity ); 2893 #include <clipping_planes_fragment> 2894 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2895 discard; 2896 } 2897 vec3 outgoingLight = vec3( 0.0 ); 2898 #include <logdepthbuf_fragment> 2899 #include <map_fragment> 2900 #include <color_fragment> 2901 outgoingLight = diffuseColor.rgb; 2902 #include <opaque_fragment> 2903 #include <tonemapping_fragment> 2904 #include <colorspace_fragment> 2905 #include <fog_fragment> 2906 #include <premultiplied_alpha_fragment> 2907}`,wT=`#include <common> 2908#include <batching_pars_vertex> 2909#include <uv_pars_vertex> 2910#include <envmap_pars_vertex> 2911#include <color_pars_vertex> 2912#include <fog_pars_vertex> 2913#include <morphtarget_pars_vertex> 2914#include <skinning_pars_vertex> 2915#include <logdepthbuf_pars_vertex> 2916#include <clipping_planes_pars_vertex> 2917void main() { 2918 #include <uv_vertex> 2919 #include <color_vertex> 2920 #include <morphinstance_vertex> 2921 #include <morphcolor_vertex> 2922 #include <batching_vertex> 2923 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2924 #include <beginnormal_vertex> 2925 #include <morphnormal_vertex> 2926 #include <skinbase_vertex> 2927 #include <skinnormal_vertex> 2928 #include <defaultnormal_vertex> 2929 #endif 2930 #include <begin_vertex> 2931 #include <morphtarget_vertex> 2932 #include <skinning_vertex> 2933 #include <project_vertex> 2934 #include <logdepthbuf_vertex> 2935 #include <clipping_planes_vertex> 2936 #include <worldpos_vertex> 2937 #include <envmap_vertex> 2938 #include <fog_vertex> 2939}`,TT=`uniform vec3 diffuse; 2940uniform float opacity; 2941#ifndef FLAT_SHADED 2942 varying vec3 vNormal; 2943#endif 2944#include <common> 2945#include <dithering_pars_fragment> 2946#include <color_pars_fragment> 2947#include <uv_pars_fragment> 2948#include <map_pars_fragment> 2949#include <alphamap_pars_fragment> 2950#include <alphatest_pars_fragment> 2951#include <alphahash_pars_fragment> 2952#include <aomap_pars_fragment> 2953#include <lightmap_pars_fragment> 2954#include <envmap_common_pars_fragment> 2955#include <envmap_pars_fragment> 2956#include <fog_pars_fragment> 2957#include <specularmap_pars_fragment> 2958#include <logdepthbuf_pars_fragment> 2959#include <clipping_planes_pars_fragment> 2960void main() { 2961 vec4 diffuseColor = vec4( diffuse, opacity ); 2962 #include <clipping_planes_fragment> 2963 #include <logdepthbuf_fragment> 2964 #include <map_fragment> 2965 #include <color_fragment> 2966 #include <alphamap_fragment> 2967 #include <alphatest_fragment> 2968 #include <alphahash_fragment> 2969 #include <specularmap_fragment> 2970 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2971 #ifdef USE_LIGHTMAP 2972 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2973 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 2974 #else 2975 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2976 #endif 2977 #include <aomap_fragment> 2978 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2979 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2980 #include <envmap_fragment> 2981 #include <opaque_fragment> 2982 #include <tonemapping_fragment> 2983 #include <colorspace_fragment> 2984 #include <fog_fragment> 2985 #include <premultiplied_alpha_fragment> 2986 #include <dithering_fragment> 2987}`,CT=`#define LAMBERT 2988varying vec3 vViewPosition; 2989#include <common> 2990#include <batching_pars_vertex> 2991#include <uv_pars_vertex> 2992#include <displacementmap_pars_vertex> 2993#include <envmap_pars_vertex> 2994#include <color_pars_vertex> 2995#include <fog_pars_vertex> 2996#include <normal_pars_vertex> 2997#include <morphtarget_pars_vertex> 2998#include <skinning_pars_vertex> 2999#include <shadowmap_pars_vertex> 3000#include <logdepthbuf_pars_vertex> 3001#include <clipping_planes_pars_vertex> 3002void main() { 3003 #include <uv_vertex> 3004 #include <color_vertex> 3005 #include <morphinstance_vertex> 3006 #include <morphcolor_vertex> 3007 #include <batching_vertex> 3008 #include <beginnormal_vertex> 3009 #include <morphnormal_vertex> 3010 #include <skinbase_vertex> 3011 #include <skinnormal_vertex> 3012 #include <defaultnormal_vertex> 3013 #include <normal_vertex> 3014 #include <begin_vertex> 3015 #include <morphtarget_vertex> 3016 #include <skinning_vertex> 3017 #include <displacementmap_vertex> 3018 #include <project_vertex> 3019 #include <logdepthbuf_vertex> 3020 #include <clipping_planes_vertex> 3021 vViewPosition = - mvPosition.xyz; 3022 #include <worldpos_vertex> 3023 #include <envmap_vertex> 3024 #include <shadowmap_vertex> 3025 #include <fog_vertex> 3026}`,AT=`#define LAMBERT 3027uniform vec3 diffuse; 3028uniform vec3 emissive; 3029uniform float opacity; 3030#include <common> 3031#include <dithering_pars_fragment> 3032#include <color_pars_fragment> 3033#include <uv_pars_fragment> 3034#include <map_pars_fragment> 3035#include <alphamap_pars_fragment> 3036#include <alphatest_pars_fragment> 3037#include <alphahash_pars_fragment> 3038#include <aomap_pars_fragment> 3039#include <lightmap_pars_fragment> 3040#include <emissivemap_pars_fragment> 3041#include <cube_uv_reflection_fragment> 3042#include <envmap_common_pars_fragment> 3043#include <envmap_pars_fragment> 3044#include <envmap_physical_pars_fragment> 3045#include <fog_pars_fragment> 3046#include <bsdfs> 3047#include <lights_pars_begin> 3048#include <normal_pars_fragment> 3049#include <lights_lambert_pars_fragment> 3050#include <shadowmap_pars_fragment> 3051#include <bumpmap_pars_fragment> 3052#include <normalmap_pars_fragment> 3053#include <specularmap_pars_fragment> 3054#include <logdepthbuf_pars_fragment> 3055#include <clipping_planes_pars_fragment> 3056void main() { 3057 vec4 diffuseColor = vec4( diffuse, opacity ); 3058 #include <clipping_planes_fragment> 3059 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3060 vec3 totalEmissiveRadiance = emissive; 3061 #include <logdepthbuf_fragment> 3062 #include <map_fragment> 3063 #include <color_fragment> 3064 #include <alphamap_fragment> 3065 #include <alphatest_fragment> 3066 #include <alphahash_fragment> 3067 #include <specularmap_fragment> 3068 #include <normal_fragment_begin> 3069 #include <normal_fragment_maps> 3070 #include <emissivemap_fragment> 3071 #include <lights_lambert_fragment> 3072 #include <lights_fragment_begin> 3073 #include <lights_fragment_maps> 3074 #include <lights_fragment_end> 3075 #include <aomap_fragment> 3076 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3077 #include <envmap_fragment> 3078 #include <opaque_fragment> 3079 #include <tonemapping_fragment> 3080 #include <colorspace_fragment> 3081 #include <fog_fragment> 3082 #include <premultiplied_alpha_fragment> 3083 #include <dithering_fragment> 3084}`,RT=`#define MATCAP 3085varying vec3 vViewPosition; 3086#include <common> 3087#include <batching_pars_vertex> 3088#include <uv_pars_vertex> 3089#include <color_pars_vertex> 3090#include <displacementmap_pars_vertex> 3091#include <fog_pars_vertex> 3092#include <normal_pars_vertex> 3093#include <morphtarget_pars_vertex> 3094#include <skinning_pars_vertex> 3095#include <logdepthbuf_pars_vertex> 3096#include <clipping_planes_pars_vertex> 3097void main() { 3098 #include <uv_vertex> 3099 #include <color_vertex> 3100 #include <morphinstance_vertex> 3101 #include <morphcolor_vertex> 3102 #include <batching_vertex> 3103 #include <beginnormal_vertex> 3104 #include <morphnormal_vertex> 3105 #include <skinbase_vertex> 3106 #include <skinnormal_vertex> 3107 #include <defaultnormal_vertex> 3108 #include <normal_vertex> 3109 #include <begin_vertex> 3110 #include <morphtarget_vertex> 3111 #include <skinning_vertex> 3112 #include <displacementmap_vertex> 3113 #include <project_vertex> 3114 #include <logdepthbuf_vertex> 3115 #include <clipping_planes_vertex> 3116 #include <fog_vertex> 3117 vViewPosition = - mvPosition.xyz; 3118}`,PT=`#define MATCAP 3119uniform vec3 diffuse; 3120uniform float opacity; 3121uniform sampler2D matcap; 3122varying vec3 vViewPosition; 3123#include <common> 3124#include <dithering_pars_fragment> 3125#include <color_pars_fragment> 3126#include <uv_pars_fragment> 3127#include <map_pars_fragment> 3128#include <alphamap_pars_fragment> 3129#include <alphatest_pars_fragment> 3130#include <alphahash_pars_fragment> 3131#include <fog_pars_fragment> 3132#include <normal_pars_fragment> 3133#include <bumpmap_pars_fragment> 3134#include <normalmap_pars_fragmen
3134t> 3135#include <logdepthbuf_pars_fragment> 3136#include <clipping_planes_pars_fragment> 3137void main() { 3138 vec4 diffuseColor = vec4( diffuse, opacity ); 3139 #include <clipping_planes_fragment> 3140 #include <logdepthbuf_fragment> 3141 #include <map_fragment> 3142 #include <color_fragment> 3143 #include <alphamap_fragment> 3144 #include <alphatest_fragment> 3145 #include <alphahash_fragment> 3146 #include <normal_fragment_begin> 3147 #include <normal_fragment_maps> 3148 vec3 viewDir = normalize( vViewPosition ); 3149 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3150 vec3 y = cross( viewDir, x ); 3151 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3152 #ifdef USE_MATCAP 3153 vec4 matcapColor = texture2D( matcap, uv ); 3154 #else 3155 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3156 #endif 3157 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3158 #include <opaque_fragment> 3159 #include <tonemapping_fragment> 3160 #include <colorspace_fragment> 3161 #include <fog_fragment> 3162 #include <premultiplied_alpha_fragment> 3163 #include <dithering_fragment> 3164}`,kT=`#define NORMAL 3165#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3166 varying vec3 vViewPosition; 3167#endif 3168#include <common> 3169#include <batching_pars_vertex> 3170#include <uv_pars_vertex> 3171#include <displacementmap_pars_vertex> 3172#include <normal_pars_vertex> 3173#include <morphtarget_pars_vertex> 3174#include <skinning_pars_vertex> 3175#include <logdepthbuf_pars_vertex> 3176#include <clipping_planes_pars_vertex> 3177void main() { 3178 #include <uv_vertex> 3179 #include <batching_vertex> 3180 #include <beginnormal_vertex> 3181 #include <morphinstance_vertex> 3182 #include <morphnormal_vertex> 3183 #include <skinbase_vertex> 3184 #include <skinnormal_vertex> 3185 #include <defaultnormal_vertex> 3186 #include <normal_vertex> 3187 #include <begin_vertex> 3188 #include <morphtarget_vertex> 3189 #include <skinning_vertex> 3190 #include <displacementmap_vertex> 3191 #include <project_vertex> 3192 #include <logdepthbuf_vertex> 3193 #include <clipping_planes_vertex> 3194#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3195 vViewPosition = - mvPosition.xyz; 3196#endif 3197}`,NT=`#define NORMAL 3198uniform float opacity; 3199#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3200 varying vec3 vViewPosition; 3201#endif 3202#include <uv_pars_fragment> 3203#include <normal_pars_fragment> 3204#include <bumpmap_pars_fragment> 3205#include <normalmap_pars_fragment> 3206#include <logdepthbuf_pars_fragment> 3207#include <clipping_planes_pars_fragment> 3208void main() { 3209 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3210 #include <clipping_planes_fragment> 3211 #include <logdepthbuf_fragment> 3212 #include <normal_fragment_begin> 3213 #include <normal_fragment_maps> 3214 gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); 3215 #ifdef OPAQUE 3216 gl_FragColor.a = 1.0; 3217 #endif 3218}`,DT=`#define PHONG 3219varying vec3 vViewPosition; 3220#include <common> 3221#include <batching_pars_vertex> 3222#include <uv_pars_vertex> 3223#include <displacementmap_pars_vertex> 3224#include <envmap_pars_vertex> 3225#include <color_pars_vertex> 3226#include <fog_pars_vertex> 3227#include <normal_pars_vertex> 3228#include <morphtarget_pars_vertex> 3229#include <skinning_pars_vertex> 3230#include <shadowmap_pars_vertex> 3231#include <logdepthbuf_pars_vertex> 3232#include <clipping_planes_pars_vertex> 3233void main() { 3234 #include <uv_vertex> 3235 #include <color_vertex> 3236 #include <morphcolor_vertex> 3237 #include <batching_vertex> 3238 #include <beginnormal_vertex> 3239 #include <morphinstance_vertex> 3240 #include <morphnormal_vertex> 3241 #include <skinbase_vertex> 3242 #include <skinnormal_vertex> 3243 #include <defaultnormal_vertex> 3244 #include <normal_vertex> 3245 #include <begin_vertex> 3246 #include <morphtarget_vertex> 3247 #include <skinning_vertex> 3248 #include <displacementmap_vertex> 3249 #include <project_vertex> 3250 #include <logdepthbuf_vertex> 3251 #include <clipping_planes_vertex> 3252 vViewPosition = - mvPosition.xyz; 3253 #include <worldpos_vertex> 3254 #include <envmap_vertex> 3255 #include <shadowmap_vertex> 3256 #include <fog_vertex> 3257}`,LT=`#define PHONG 3258uniform vec3 diffuse; 3259uniform vec3 emissive; 3260uniform vec3 specular; 3261uniform float shininess; 3262uniform float opacity; 3263#include <common> 3264#include <dithering_pars_fragment> 3265#include <color_pars_fragment> 3266#include <uv_pars_fragment> 3267#include <map_pars_fragment> 3268#include <alphamap_pars_fragment> 3269#include <alphatest_pars_fragment> 3270#include <alphahash_pars_fragment> 3271#include <aomap_pars_fragment> 3272#include <lightmap_pars_fragment> 3273#include <emissivemap_pars_fragment> 3274#include <cube_uv_reflection_fragment> 3275#include <envmap_common_pars_fragment> 3276#include <envmap_pars_fragment> 3277#include <envmap_physical_pars_fragment> 3278#include <fog_pars_fragment> 3279#include <bsdfs> 3280#include <lights_pars_begin> 3281#include <normal_pars_fragment> 3282#include <lights_phong_pars_fragment> 3283#include <shadowmap_pars_fragment> 3284#include <bumpmap_pars_fragment> 3285#include <normalmap_pars_fragment> 3286#include <specularmap_pars_fragment> 3287#include <logdepthbuf_pars_fragment> 3288#include <clipping_planes_pars_fragment> 3289void main() { 3290 vec4 diffuseColor = vec4( diffuse, opacity ); 3291 #include <clipping_planes_fragment> 3292 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3293 vec3 totalEmissiveRadiance = emissive; 3294 #include <logdepthbuf_fragment> 3295 #include <map_fragment> 3296 #include <color_fragment> 3297 #include <alphamap_fragment> 3298 #include <alphatest_fragment> 3299 #include <alphahash_fragment> 3300 #include <specularmap_fragment> 3301 #include <normal_fragment_begin> 3302 #include <normal_fragment_maps> 3303 #include <emissivemap_fragment> 3304 #include <lights_phong_fragment> 3305 #include <lights_fragment_begin> 3306 #include <lights_fragment_maps> 3307 #include <lights_fragment_end> 3308 #include <aomap_fragment> 3309 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3310 #include <envmap_fragment> 3311 #include <opaque_fragment> 3312 #include <tonemapping_fragment> 3313 #include <colorspace_fragment> 3314 #include <fog_fragment> 3315 #include <premultiplied_alpha_fragment> 3316 #include <dithering_fragment> 3317}`,IT=`#define STANDARD 3318varying vec3 vViewPosition; 3319#ifdef USE_TRANSMISSION 3320 varying vec3 vWorldPosition; 3321#endif 3322#include <common> 3323#include <batching_pars_vertex> 3324#include <uv_pars_vertex> 3325#include <displacementmap_pars_vertex> 3326#include <color_pars_vertex> 3327#include <fog_pars_vertex> 3328#include <normal_pars_vertex> 3329#include <morphtarget_pars_vertex> 3330#include <skinning_pars_vertex> 3331#include <shadowmap_pars_vertex> 3332#include <logdepthbuf_pars_vertex> 3333#include <clipping_planes_pars_vertex> 3334void main() { 3335 #include <uv_vertex> 3336 #include <color_vertex> 3337 #include <morphinstance_vertex> 3338 #include <morphcolor_vertex> 3339 #include <batching_vertex> 3340 #include <beginnormal_vertex> 3341 #include <morphnormal_vertex> 3342 #include <skinbase_vertex> 3343 #include <skinnormal_vertex> 3344 #include <defaultnormal_vertex> 3345 #include <normal_vertex> 3346 #include <begin_vertex> 3347 #include <morphtarget_vertex> 3348 #include <skinning_vertex> 3349 #include <displacementmap_vertex> 3350 #include <project_vertex> 3351 #include <logdepthbuf_vertex> 3352 #include <clipping_planes_vertex> 3353 vViewPosition = - mvPosition.xyz; 3354 #include <worldpos_vertex> 3355 #include <shadowmap_vertex> 3356 #include <fog_vertex> 3357#ifdef USE_TRANSMISSION 3358 vWorldPosition = worldPosition.xyz; 3359#endif 3360}`,UT=`#define STANDARD 3361#ifdef PHYSICAL 3362 #define IOR 3363 #define USE_SPECULAR 3364#endif 3365uniform vec3 diffuse; 3366uniform vec3 emissive; 3367uniform float roughness; 3368uniform float metalness; 3369uniform float opacity; 3370#ifdef IOR 3371 uniform float ior; 3372#endif 3373#ifdef USE_SPECULAR 3374 uniform float specularIntensity; 3375 uniform vec3 specularColor; 3376 #ifdef USE_SPECULAR_COLORMAP 3377 uniform sampler2D specularColorMap; 3378 #endif 3379 #ifdef USE_SPECULAR_INTENSITYMAP 3380 uniform sampler2D specularIntensityMap; 3381 #endif 3382#endif 3383#ifdef USE_CLEARCOAT 3384 uniform float clearcoat; 3385 uniform float clearcoatRoughness; 3386#endif 3387#ifdef USE_DISPERSION 3388 uniform float dispersion; 3389#endif
3390#ifdef USE_IRIDESCENCE 3391 uniform float iridescence; 3392 uniform float iridescenceIOR; 3393 uniform float iridescenceThicknessMinimum; 3394 uniform float iridescenceThicknessMaximum; 3395#endif 3396#ifdef USE_SHEEN 3397 uniform vec3 sheenColor; 3398 uniform float sheenRoughness; 3399 #ifdef USE_SHEEN_COLORMAP 3400 uniform sampler2D sheenColorMap; 3401 #endif 3402 #ifdef USE_SHEEN_ROUGHNESSMAP 3403 uniform sampler2D sheenRoughnessMap; 3404 #endif 3405#endif 3406#ifdef USE_ANISOTROPY 3407 uniform vec2 anisotropyVector; 3408 #ifdef USE_ANISOTROPYMAP 3409 uniform sampler2D anisotropyMap; 3410 #endif 3411#endif 3412varying vec3 vViewPosition; 3413#include <common> 3414#include <dithering_pars_fragment> 3415#include <color_pars_fragment> 3416#include <uv_pars_fragment> 3417#include <map_pars_fragment> 3418#include <alphamap_pars_fragment> 3419#include <alphatest_pars_fragment> 3420#include <alphahash_pars_fragment> 3421#include <aomap_pars_fragment> 3422#include <lightmap_pars_fragment> 3423#include <emissivemap_pars_fragment> 3424#include <iridescence_fragment> 3425#include <cube_uv_reflection_fragment> 3426#include <envmap_common_pars_fragment> 3427#include <envmap_physical_pars_fragment> 3428#include <fog_pars_fragment> 3429#include <lights_pars_begin> 3430#include <normal_pars_fragment> 3431#include <lights_physical_pars_fragment> 3432#include <transmission_pars_fragment> 3433#include <shadowmap_pars_fragment> 3434#include <bumpmap_pars_fragment> 3435#include <normalmap_pars_fragment> 3436#include <clearcoat_pars_fragment> 3437#include <iridescence_pars_fragment> 3438#include <roughnessmap_pars_fragment> 3439#include <metalnessmap_pars_fragment> 3440#include <logdepthbuf_pars_fragment> 3441#include <clipping_planes_pars_fragment> 3442void main() { 3443 vec4 diffuseColor = vec4( diffuse, opacity ); 3444 #include <clipping_planes_fragment> 3445 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3446 vec3 totalEmissiveRadiance = emissive; 3447 #include <logdepthbuf_fragment> 3448 #include <map_fragment> 3449 #include <color_fragment> 3450 #include <alphamap_fragment> 3451 #include <alphatest_fragment> 3452 #include <alphahash_fragment> 3453 #include <roughnessmap_fragment> 3454 #include <metalnessmap_fragment> 3455 #include <normal_fragment_begin> 3456 #include <normal_fragment_maps> 3457 #include <clearcoat_normal_fragment_begin> 3458 #include <clearcoat_normal_fragment_maps> 3459 #include <emissivemap_fragment> 3460 #include <lights_physical_fragment> 3461 #include <lights_fragment_begin> 3462 #include <lights_fragment_maps> 3463 #include <lights_fragment_end> 3464 #include <aomap_fragment> 3465 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3466 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3467 #include <transmission_fragment> 3468 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3469 #ifdef USE_SHEEN 3470 3471 outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; 3472 3473 #endif 3474 #ifdef USE_CLEARCOAT 3475 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3476 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3477 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3478 #endif 3479 #include <opaque_fragment> 3480 #include <tonemapping_fragment> 3481 #include <colorspace_fragment> 3482 #include <fog_fragment> 3483 #include <premultiplied_alpha_fragment> 3484 #include <dithering_fragment> 3485}`,FT=`#define TOON 3486varying vec3 vViewPosition; 3487#include <common> 3488#include <batching_pars_vertex> 3489#include <uv_pars_vertex> 3490#include <displacementmap_pars_vertex> 3491#include <color_pars_vertex> 3492#include <fog_pars_vertex> 3493#include <normal_pars_vertex> 3494#include <morphtarget_pars_vertex> 3495#include <skinning_pars_vertex> 3496#include <shadowmap_pars_vertex> 3497#include <logdepthbuf_pars_vertex> 3498#include <clipping_planes_pars_vertex> 3499void main() { 3500 #include <uv_vertex> 3501 #include <color_vertex> 3502 #include <morphinstance_vertex> 3503 #include <morphcolor_vertex> 3504 #include <batching_vertex> 3505 #include <beginnormal_vertex> 3506 #include <morphnormal_vertex> 3507 #include <skinbase_vertex> 3508 #include <skinnormal_vertex> 3509 #include <defaultnormal_vertex> 3510 #include <normal_vertex> 3511 #include <begin_vertex> 3512 #include <morphtarget_vertex> 3513 #include <skinning_vertex> 3514 #include <displacementmap_vertex> 3515 #include <project_vertex> 3516 #include <logdepthbuf_vertex> 3517 #include <clipping_planes_vertex> 3518 vViewPosition = - mvPosition.xyz; 3519 #include <worldpos_vertex> 3520 #include <shadowmap_vertex> 3521 #include <fog_vertex> 3522}`,OT=`#define TOON 3523uniform vec3 diffuse; 3524uniform vec3 emissive; 3525uniform float opacity; 3526#include <common> 3527#include <dithering_pars_fragment> 3528#include <color_pars_fragment> 3529#include <uv_pars_fragment> 3530#include <map_pars_fragment> 3531#include <alphamap_pars_fragment> 3532#include <alphatest_pars_fragment> 3533#include <alphahash_pars_fragment> 3534#include <aomap_pars_fragment> 3535#include <lightmap_pars_fragment> 3536#include <emissivemap_pars_fragment> 3537#include <gradientmap_pars_fragment> 3538#include <fog_pars_fragment> 3539#include <bsdfs> 3540#include <lights_pars_begin> 3541#include <normal_pars_fragment> 3542#include <lights_toon_pars_fragment> 3543#include <shadowmap_pars_fragment> 3544#include <bumpmap_pars_fragment> 3545#include <normalmap_pars_fragment> 3546#include <logdepthbuf_pars_fragment> 3547#include <clipping_planes_pars_fragment> 3548void main() { 3549 vec4 diffuseColor = vec4( diffuse, opacity ); 3550 #include <clipping_planes_fragment> 3551 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3552 vec3 totalEmissiveRadiance = emissive; 3553 #include <logdepthbuf_fragment> 3554 #include <map_fragment> 3555 #include <color_fragment> 3556 #include <alphamap_fragment> 3557 #include <alphatest_fragment> 3558 #include <alphahash_fragment> 3559 #include <normal_fragment_begin> 3560 #include <normal_fragment_maps> 3561 #include <emissivemap_fragment> 3562 #include <lights_toon_fragment> 3563 #include <lights_fragment_begin> 3564 #include <lights_fragment_maps> 3565 #include <lights_fragment_end> 3566 #include <aomap_fragment> 3567 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3568 #include <opaque_fragment> 3569 #include <tonemapping_fragment> 3570 #include <colorspace_fragment> 3571 #include <fog_fragment> 3572 #include <premultiplied_alpha_fragment> 3573 #include <dithering_fragment> 3574}`,zT=`uniform float size; 3575uniform float scale; 3576#include <common> 3577#include <color_pars_vertex> 3578#include <fog_pars_vertex> 3579#include <morphtarget_pars_vertex> 3580#include <logdepthbuf_pars_vertex> 3581#include <clipping_planes_pars_vertex> 3582#ifdef USE_POINTS_UV 3583 varying vec2 vUv; 3584 uniform mat3 uvTransform; 3585#endif 3586void main() { 3587 #ifdef USE_POINTS_UV 3588 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3589 #endif 3590 #include <color_vertex> 3591 #include <morphinstance_vertex> 3592 #include <morphcolor_vertex> 3593 #include <begin_vertex> 3594 #include <morphtarget_vertex> 3595 #include <project_vertex> 3596 gl_PointSize = size; 3597 #ifdef USE_SIZEATTENUATION 3598 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3599 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3600 #endif 3601 #include <logdepthbuf_vertex> 3602 #include <clipping_planes_vertex> 3603 #include <worldpos_vertex> 3604 #include <fog_vertex> 3605}`,jT=`uniform vec3 diffuse; 3606uniform float opacity; 3607#include <common> 3608#include <color_pars_fragment> 3609#include <map_particle_pars_fragment> 3610#include <alphatest_pars_fragment> 3611#include <alphahash_pars_fragment> 3612#include <fog_pars_fragment> 3613#include <logdepthbuf_pars_fragment> 3614#include <clipping_planes_pars_fragment> 3615void main() { 3616 vec4 diffuseColor = vec4( diffuse, opacity ); 3617 #include <clipping_planes_fragment> 3618 vec3 outgoingLight = vec3( 0.0 ); 3619 #include <logdepthbuf_fragment> 3620 #include <map_particle_fragment> 3621 #include <color_fragment> 3622 #include <alphatest_fragment> 3623 #include <alphahash_fragment> 3624 outgoingLight = diffuseColor.rgb; 3625 #include <opaque_fragment> 3626 #include <tonemapping_fragment> 3627 #include <colorspace_fragment> 3628 #include <fog_fragment> 3629 #include <premultiplied_alpha_fragment> 3630}`,BT=`#include <common> 3631#include <batching_pars_vertex> 3632#include <fog_pars_vertex> 3633#include <morphtarget_pars_vertex> 3634#include <skinning_pars_vertex> 3635#include <logdepthbuf_pars_vertex> 3636#include <shadowmap_pars_vertex> 3637void main() { 3638 #include <batching_vertex> 3639 #include <beginnormal_vertex> 3640 #include <morphinstance_vertex> 3641 #include <morphnormal_vertex> 3642 #include <skinbase_vertex> 3643 #include <skinnormal_vertex> 3644 #include <defaultnormal_vertex> 3645 #include <begin_vertex> 3646 #include <morphtarget_vertex> 3647 #include <skinning_vertex> 3648 #include <project_vertex> 3649 #include <logdepthbuf_vertex> 3650 #include <worldpos_vertex> 3651 #include <shadowmap_vertex> 3652 #include <fog_vertex> 3653}`,GT=`uniform vec3 color; 3654uniform float opacity; 3655#include <common> 3656#include <fog_pars_fragment> 3657#include <bsdfs> 3658#include <lights_pars_begin> 3659#include <logdepthbuf_pars_fragment> 3660#include <shadowmap_pars_fragment> 3661#include <shadowmask_pars_fragment> 3662void main() { 3663 #include <logdepthbuf_fragment> 3664 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3665 #include <tonemapping_fragment> 3666 #include <colorspace_fragment> 3667 #include <fog_fragment> 3668 #include <premultiplied_alpha_fragment> 3669}`,HT=`uniform float rotation; 3670uniform vec2 center; 3671#include <common> 3672#include <uv_pars_vertex> 3673#include <fog_pars_vertex> 3674#include <logdepthbuf_pars_vertex> 3675#include <clipping_planes_pars_vertex> 3676void main() { 3677 #include <uv_vertex> 3678 vec4 mvPosition = modelViewMatrix[ 3 ]; 3679 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3680 #ifndef USE_SIZEATTENUATION 3681 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3682 if ( isPerspective ) scale *= - mvPosition.z; 3683 #endif 3684 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3685 vec2 rotatedPosition; 3686 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3687 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3688 mvPosition.xy += rotatedPosition; 3689 gl_Position = projectionMatrix * mvPosition; 3690 #include <logdepthbuf_vertex> 3691 #include <clipping_planes_vertex> 3692 #include <fog_vertex> 3693}`,VT=`uniform vec3 diffuse; 3694uniform float opacity; 3695#include <common> 3696#include <uv_pars_fragment> 3697#include <map_pars_fragment> 3698#include <alphamap_pars_fragment> 3699#include <alphatest_pars_fragment> 3700#include <alphahash_pars_fragment> 3701#include <fog_pars_fragment> 3702#include <logdepthbuf_pars_fragment> 3703#include <clipping_planes_pars_fragment> 3704void main() { 3705 vec4 diffuseColor = vec4( diffuse, opacity ); 3706 #include <clipping_planes_fragment> 3707 vec3 outgoingLight = vec3( 0.0 ); 3708 #include <logdepthbuf_fragment> 3709 #include <map_fragment> 3710 #include <alphamap_fragment> 3711 #include <alphatest_fragment> 3712 #include <alphahash_fragment> 3713 outgoingLight = diffuseColor.rgb; 3714 #include <opaque_fragment> 3715 #include <tonemapping_fragment> 3716 #include <colorspace_fragment> 3717 #include <fog_fragment> 3718}`,Ze={alphahash_fragment:dw,alphahash_pars_fragment:fw,alphamap_fragment:hw,alphamap_pars_fragment:pw,alphatest_fragment:mw,alphatest_pars_fragment:gw,aomap_fragment:vw,aomap_pars_fragment:xw,batching_pars_vertex:_w,batching_vertex:yw,begin_vertex:Sw,beginnormal_vertex:Mw,bsdfs:Ew,iridescence_fragment:bw,bumpmap_pars_fragment:ww,clipping_planes_fragment:Tw,clipping_planes_pars_fragment:Cw,clipping_planes_pars_vertex:Aw,clipping_planes_vertex:Rw,color_fragment:Pw,color_pars_fragment:kw,color_pars_vertex:Nw,color_vertex:Dw,common:Lw,cube_uv_reflection_fragment:Iw,defaultnormal_vertex:Uw,displacementmap_pars_vertex:Fw,displacementmap_vertex:Ow,emissivemap_fragment:zw,emissivemap_pars_fragment:jw,colorspace_fragment:Bw,colorspace_pars_fragment:Gw,envmap_fragment:Hw,envmap_common_pars_fragment:Vw,envmap_pars_fragment:Ww,envmap_pars_vertex:Xw,envmap_physical_pars_fragment:i1,envmap_vertex:$w,fog_vertex:Yw,fog_pars_vertex:Kw,fog_fragment:qw,fog_pars_fragment:Zw,gradientmap_pars_fragment:Jw,lightmap_pars_fragment:Qw,lights_lambert_fragment:e1,lights_lambert_pars_fragment:t1,lights_pars_begin:n1,lights_toon_fragment:r1,lights_toon_pars_fragment:s1,lights_phong_fragment:a1,lights_phong_pars_fragment:o1,lights_physical_fragment:l1,lights_physical_pars_fragment:c1,lights_fragment_begin:u1,lights_fragment_maps:d1,lights_fragment_end:f1,lightprobes_pars_fragment:h1,logdepthbuf_fragment:p1,logdepthbuf_pars_fragment:m1,logdepthbuf_pars_vertex:g1,logdepthbuf_vertex:v1,map_fragment:x1,map_pars_fragment:_1,map_particle_fragment:y1,map_particle_pars_fragment:S1,metalnessmap_fragment:M1,metalnessmap_pars_fragment:E1,morphinstance_vertex:b1,morphcolor_vertex:w1,morphnormal_vertex:T1,morphtarget_pars_vertex:C1,morphtarget_vertex:A1,normal_fragment_begin:R1,normal_fragment_maps:P1,normal_pars_fragment:k1,normal_pars_vertex:N1,normal_vertex:D1,normalmap_pars_fragment:L1,clearcoat_normal_fragment_begin:I1,clearcoat_normal_fragment_maps:U1,clearcoat_pars_fragment:F1,iridescence_pars_fragment:O1,opaque_fragment:z1,packing:j1,premultiplied_alpha_fragment:B1,project_vertex:G1,dithering_fragment:H1,dithering_pars_fragment:V1,roughnessmap_fragment:W1,roughnessmap_pars_fragment:X1,shadowmap_pars_fragment:$1,shadowmap_pars_vertex:Y1,shadowmap_vertex:K1,shadowmask_pars_fragment:q1,skinbase_vertex:Z1,skinning_pars_vertex:J1,skinning_vertex:Q1,skinnormal_vertex:eT,specularmap_fragment:tT,specularmap_pars_fragment:nT,tonemapping_fragment:iT,tonemapping_pars_fragment:rT,transmission_fragment:sT,transmission_pars_fragment:aT,uv_pars_fragment:oT,uv_pars_vertex:lT,uv_vertex:cT,worldpos_vertex:uT,background_vert:dT,background_frag:fT,backgroundCube_vert:hT,backgroundCube_frag:pT,cube_vert:mT,cube_frag:gT,depth_vert:vT,depth_frag:xT,distance_vert:_T,distance_frag:yT,equirect_vert:ST,equirect_frag:MT,linedashed_vert:ET,linedashed_frag:bT,meshbasic_vert:wT,meshbasic_frag:TT,meshlambert_vert:CT,meshlambert_frag:AT,meshmatcap_vert:RT,meshmatcap_frag:PT,meshnormal_vert:kT,meshnormal_frag:NT,meshphong_vert:DT,meshphong_frag:LT,meshphysical_vert:IT,meshphysical_frag:UT,meshtoon_vert:FT,meshtoon_frag:OT,points_vert:zT,points_frag:jT,shadow_vert:BT,shadow_frag:GT,sprite_vert:HT,sprite_frag:VT},_e={common:{diffuse:{value:new st(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ye},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ye}},envmap:{envMap:{value:null},envMapRotation:{value:new Ye},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ye}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ye}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ye},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ye},normalScale:{value:new De(1,1)}}
vendor: 7,568 bytes, line 3718
3718,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ye},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ye}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ye}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ye}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new st(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new H},probesMax:{value:new H},probesResolution:{value:new H}},points:{diffuse:{value:new st(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0},uvTransform:{value:new Ye}},sprite:{diffuse:{value:new st(16777215)},opacity:{value:1},center:{value:new De(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ye},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0}}},Ei={basic:{uniforms:vn([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.fog]),vertexShader:Ze.meshbasic_vert,fragmentShader:Ze.meshbasic_frag},lambert:{uniforms:vn([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,_e.lights,{emissive:{value:new st(0)},envMapIntensity:{value:1}}]),vertexShader:Ze.meshlambert_vert,fragmentShader:Ze.meshlambert_frag},phong:{uniforms:vn([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,_e.lights,{emissive:{value:new st(0)},specular:{value:new st(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Ze.meshphong_vert,fragmentShader:Ze.meshphong_frag},standard:{uniforms:vn([_e.common,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.roughnessmap,_e.metalnessmap,_e.fog,_e.lights,{emissive:{value:new st(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ze.meshphysical_vert,fragmentShader:Ze.meshphysical_frag},toon:{uniforms:vn([_e.common,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.gradientmap,_e.fog,_e.lights,{emissive:{value:new st(0)}}]),vertexShader:Ze.meshtoon_vert,fragmentShader:Ze.meshtoon_frag},matcap:{uniforms:vn([_e.common,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,{matcap:{value:null}}]),vertexShader:Ze.meshmatcap_vert,fragmentShader:Ze.meshmatcap_frag},points:{uniforms:vn([_e.points,_e.fog]),vertexShader:Ze.points_vert,fragmentShader:Ze.points_frag},dashed:{uniforms:vn([_e.common,_e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ze.linedashed_vert,fragmentShader:Ze.linedashed_frag},depth:{uniforms:vn([_e.common,_e.displacementmap]),vertexShader:Ze.depth_vert,fragmentShader:Ze.depth_frag},normal:{uniforms:vn([_e.common,_e.bumpmap,_e.normalmap,_e.displacementmap,{opacity:{value:1}}]),vertexShader:Ze.meshnormal_vert,fragmentShader:Ze.meshnormal_frag},sprite:{uniforms:vn([_e.sprite,_e.fog]),vertexShader:Ze.sprite_vert,fragmentShader:Ze.sprite_frag},background:{uniforms:{uvTransform:{value:new Ye},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ze.background_vert,fragmentShader:Ze.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ye}},vertexShader:Ze.backgroundCube_vert,fragmentShader:Ze.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ze.cube_vert,fragmentShader:Ze.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ze.equirect_vert,fragmentShader:Ze.equirect_frag},distance:{uniforms:vn([_e.common,_e.displacementmap,{referencePosition:{value:new H},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ze.distance_vert,fragmentShader:Ze.distance_frag},shadow:{uniforms:vn([_e.lights,_e.fog,{color:{value:new st(0)},opacity:{value:1}}]),vertexShader:Ze.shadow_vert,fragmentShader:Ze.shadow_frag}};Ei.physical={uniforms:vn([Ei.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ye},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ye},clearcoatNormalScale:{value:new De(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ye},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ye},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ye},sheen:{value:0},sheenColor:{value:new st(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ye},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ye},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ye},transmissionSamplerSize:{value:new De},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ye},attenuationDistance:{value:0},attenuationColor:{value:new st(0)},specularColor:{value:new st(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ye},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ye},anisotropyVector:{value:new De},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ye}}]),vertexShader:Ze.meshphysical_vert,fragmentShader:Ze.meshphysical_frag};const Rl={r:0,b:0,g:0},WT=new Ft,w_=new Ye;w_.set(-1,0,0,0,1,0,0,0,1);function XT(t,e,n,i,r,s){const a=new st(0);let o=r===!0?0:1,l,u,f=null,p=0,h=null;function m(v){let b=v.isScene===!0?v.background:null;if(b&&b.isTexture){const M=v.backgroundBlurriness>0;b=e.get(b,M)}return b}function x(v){let b=!1;const M=m(v);M===null?g(a,o):M&&M.isColor&&(g(M,1),b=!0);const E=t.xr.getEnvironmentBlendMode();E==="additive"?n.buffers.color.setClear(0,0,0,1,s):E==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,s),(t.autoClear||b)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function y(v,b){const M=m(b);M&&(M.isCubeTexture||M.mapping===tu)?(u===void 0&&(u=new _n(new fs(1,1,1),new Li({name:"Backgroun
3718dCubeMaterial",uniforms:va(Ei.backgroundCube.uniforms),vertexShader:Ei.backgroundCube.vertexShader,fragmentShader:Ei.backgroundCube.fragmentShader,side:Dn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,w,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=M,u.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(WT.makeRotationFromEuler(b.backgroundRotation)).transpose(),M.isCubeTexture&&M.isRenderTargetTexture===!1&&u.material.uniforms.backgroundRotation.value.premultiply(w_),u.material.toneMapped=rt.getTransfer(M.colorSpace)!==ft,(f!==M||p!==M.version||h!==t.toneMapping)&&(u.material.needsUpdate=!0,f=M,p=M.version,h=t.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(l===void 0&&(l=new _n(new rs(2,2),new Li({name:"BackgroundMaterial",uniforms:va(Ei.background.uniforms),vertexShader:Ei.background.vertexShader,fragmentShader:Ei.background.fragmentShader,side:Dr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=M,l.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,l.material.toneMapped=rt.getTransfer(M.colorSpace)!==ft,M.matrixAutoUpdate===!0&&M.updateMatrix(),l.material.uniforms.uvTransform.value.copy(M.matrix),(f!==M||p!==M.version||h!==t.toneMapping)&&(l.material.needsUpdate=!0,f=M,p=M.version,h=t.toneMapping),l.layers.enableAll(),v.unshift(l,l.geometry,l.material,0,0,null))}function g(v,b){v.getRGB(Rl,M_(t)),n.buffers.color.setClear(Rl.r,Rl.g,Rl.b,b,s)}function d(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return a},setClearColor:function(v,b=1){a.set(v),o=b,g(a,o)},getClearAlpha:function(){return o},setClearAlpha:function(v){o=v,g(a,o)},render:x,addToRenderList:y,dispose:d}}function $T(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=h(null);let s=r,a=!1;function o(L,R,D,F,k){let B=!1;const z=p(L,F,D,R);s!==z&&(s=z,u(s.object)),B=m(L,F,D,k),B&&x(L,F,D,k),k!==null&&e.update(k,t.ELEMENT_ARRAY_BUFFER),(B||a)&&(a=!1,M(L,R,D,F),k!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(k).buffer))}function l(){return t.createVertexArray()}function u(L){return t.bindVertexArray(L)}function f(L){return t.deleteVertexArray(L)}function p(L,R,D,F){const k=F.wireframe===!0;let B=i[R.id];B===void 0&&(B={},i[R.id]=B);const z=L.isInstancedMesh===!0?L.id:0;let I=B[z];I===void 0&&(I={},B[z]=I);let V=I[D.id];V===void 0&&(V={},I[D.id]=V);let Q=V[k];return Q===void 0&&(Q=h(l()),V[k]=Q),Q}function h(L){const R=[],D=[],F=[];for(let k=0;k<n;k++)R[k]=0,D[k]=0,F[k]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:D,attributeDivisors:F,object:L,attributes:{},index:null}}function m(L,R,D,F){const k=s.attributes,B=R.attributes;let z=0;const I=D.getAttributes();for(const V in I)if(I[V].location>=0){const re=k[V];let ae=B[V];if(ae===void 0&&(V==="instanceMatrix"&&L.instanceMatrix&&(ae=L.instanceMatrix),V==="instanceColor"&&L.instanceColor&&(ae=L.instanceColor)),re===void 0||re.attribute!==ae||ae&&re.data!==ae.data)return!0;z++}return s.attributesNum!==z||s.index!==F}function x(L,R,D,F){const k={},B=R.attributes;let z=0;const I=D.getAttributes();for(const V in I)if(I[V].location>=0){let re=B[V];re===void 0&&(V==="instanceMatrix"&&L.instanceMatrix&&(re=L.instanceMatrix),V==="instanceColor"&&L.instanceColor&&(re=L.instanceColor));const ae={};ae.attribute=re,re&&re.data&&(ae.data=re.data),k[V]=ae,z++}s.attributes=k,s.attributesNum=z,s.index=F}function y(){const L=s.newAttributes;for(let R=0,D=L.length;R<D;R++)L[R]=0}function g(L){d(L,0)}function d(L,R){const D=s.newAttributes,F=s.enabledAttributes,k=s.attributeDivisors;D[L]=1,F[L]===0&&(t.enableVertexAttribArray(L),F[L]=1),k[L]!==R&&(t.vertexAttribDivisor(L,R),k[L]=R)}function v(){const L=s.newAttributes,R=s.enabledAttributes;for(let D=0,F=R.length;D<F;D++)R[D]!==L[D]&&(t.disableVertexAttribArray(D),R[D]=0)}function b(L,R,D,F,k,B,z){z===!0?t.vertexAttribIPointer(L,R,D,k,B):t.vertexAttribPointer(L,R,D,F,k,B)}function M(L,R,D,F){y();const k=F.attributes,B=D.getAttributes(),z=R.defaultAttributeValues;for(const I in B){const V=B[I];if(V.location>=0){let Q=k[I];if(Q===void 0&&(I==="instanceMatrix"&&L.instanceMatrix&&(Q=L.instanceMatrix),I==="instanceColor"&&L.instanceColor&&(Q=L.instanceColor)),Q!==void 0){const re=Q.normalized,ae=Q.itemSize,Fe=e.get(Q);if(Fe===void 0)continue;const je=Fe.buffer,Oe=Fe.type,ee=Fe.bytesPerElement,ue=Oe===t.INT||Oe===t.UNSIGNED_INT||Q.gpuType===mp;if(Q.isInterleavedBufferAttribute){const oe=Q.data,Be=oe.stride,$e=Q.offset;if(oe.isInstancedInterleavedBuffer){for(let Pe=0;Pe<V.locationSize;Pe++)d(V.location+Pe,oe.meshPerAttribute);L.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=oe.meshPerAttribute*oe.count)}else for(let Pe=0;Pe<V.locationSize;Pe++)g(V.location+Pe);t.bindBuffer(t.ARRAY_BUFFER,je);for(let Pe=0;Pe<V.locationSize;Pe++)b(V.location+Pe,ae/V.locationSize,Oe,re,Be*ee,($e+ae/V.locationSize*Pe)*ee,ue)}else{if(Q.isInstancedBufferAttribute){for(let oe=0;oe<V.locationSize;oe++)d(V.location+oe,Q.meshPerAttribute);L.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=Q.meshPerAttribute*Q.count)}
vendor: 14,941 bytes, lines 3718-3791
3718else for(let oe=0;oe<V.locationSize;oe++)g(V.location+oe);t.bindBuffer(t.ARRAY_BUFFER,je);for(let oe=0;oe<V.locationSize;oe++)b(V.location+oe,ae/V.locationSize,Oe,re,ae*ee,ae/V.locationSize*oe*ee,ue)}}else if(z!==void 0){const re=z[I];if(re!==void 0)switch(re.length){case 2:t.vertexAttrib2fv(V.location,re);break;case 3:t.vertexAttrib3fv(V.location,re);break;case 4:t.vertexAttrib4fv(V.location,re);break;default:t.vertexAttrib1fv(V.location,re)}}}}v()}function E(){T();for(const L in i){const R=i[L];for(const D in R){const F=R[D];for(const k in F){const B=F[k];for(const z in B)f(B[z].object),delete B[z];delete F[k]}}delete i[L]}}function w(L){if(i[L.id]===void 0)return;const R=i[L.id];for(const D in R){const F=R[D];for(const k in F){const B=F[k];for(const z in B)f(B[z].object),delete B[z];delete F[k]}}delete i[L.id]}function A(L){for(const R in i){const D=i[R];for(const F in D){const k=D[F];if(k[L.id]===void 0)continue;const B=k[L.id];for(const z in B)f(B[z].object),delete B[z];delete k[L.id]}}}function _(L){for(const R in i){const D=i[R],F=L.isInstancedMesh===!0?L.id:0,k=D[F];if(k!==void 0){for(const B in k){const z=k[B];for(const I in z)f(z[I].object),delete z[I];delete k[B]}delete D[F],Object.keys(D).length===0&&delete i[R]}}}function T(){N(),a=!0,s!==r&&(s=r,u(s.object))}function N(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:o,reset:T,resetDefaultState:N,dispose:E,releaseStatesOfGeometry:w,releaseStatesOfObject:_,releaseStatesOfProgram:A,initAttributes:y,enableAttribute:g,disableUnusedAttributes:v}}function YT(t,e,n){let i;function r(l){i=l}function s(l,u){t.drawArrays(i,l,u),n.update(u,i,1)}function a(l,u,f){f!==0&&(t.drawArraysInstanced(i,l,u,f),n.update(u,i,f))}function o(l,u,f){if(f===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,l,0,u,0,f);let h=0;for(let m=0;m<f;m++)h+=u[m];n.update(h,i,1)}this.setMode=r,this.render=s,this.renderInstances=a,this.renderMultiDraw=o}function KT(t,e,n,i){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function a(A){return!(A!==hi&&i.convert(A)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(A){const _=A===Qi&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==jn&&i.convert(A)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==Ti&&!_)}function l(A){if(A==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=n.precision!==void 0?n.precision:"highp";const f=l(u);f!==u&&(He("WebGLRenderer:",u,"not supported, using",f,"instead."),u=f);const p=n.logarithmicDepthBuffer===!0,h=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control");n.reversedDepthBuffer===!0&&h===!1&&He("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const m=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),x=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y=t.getParameter(t.MAX_TEXTURE_SIZE),g=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),d=t.getParameter(t.MAX_VERTEX_ATTRIBS),v=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),b=t.getParameter(t.MAX_VARYING_VECTORS),M=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),E=t.getParameter(t.MAX_SAMPLES),w=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:u,logarithmicDepthBuffer:p,reversedDepthBuffer:h,maxTextures:m,maxVertexTextures:x,maxTextureSize:y,maxCubemapSize:g,maxAttributes:d,maxVertexUniforms:v,maxVaryings:b,maxFragmentUniforms:M,maxSamples:E,samples:w}}function qT(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new mr,o=new Ye,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(p,h){const m=p.length!==0||h||i!==0||r;return r=h,i=p.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,h){n=f(p,h,0)},this.setState=function(p,h,m){const x=p.clippingPlanes,y=p.clipIntersection,g=p.clipShadows,d=t.get(p);if(!r||x===null||x.length===0||s&&!g)s?f(null):u();else{const v=s?0:i,b=v*4;let M=d.clippingState||null;l.value=M,M=f(x,h,b,m);for(let E=0;E!==b;++E)M[E]=n[E];d.clippingState=M,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=v}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(p,h,m,x){const y=p!==null?p.length:0;let g=null;if(y!==0){if(g=l.value,x!==!0||g===null){const d=m+y*4,v=h.matrixWorldInverse;o.getNormalMatrix(v),(g===null||g.length<d)&&(g=new Float32Array(d));for(let b=0,M=m;b!==y;++b,M+=4)a.copy(p[b]).applyMatrix4(v,o),a.normal.toArray(g,M),g[M+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=y,e.numIntersection=0,g}}const Sr=4,Ug=[.125,.215,.35,.446,.526,.582],Kr=20,ZT=256,Oa=new Pp,Fg=new st;let cd=null,ud=0,dd=0,fd=!1;const JT=new H;class Og{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,n=0,i=.1,r=100,s={}){const{size:a=256,position:o=JT}=s;cd=this._renderer.getRenderTarget(),ud=this._renderer.getActiveCubeFace(),dd=this._renderer.getActiveMipmapLevel(),fd=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,o),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Bg(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=jg(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.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._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(cd,ud,dd),this._renderer.xr.enabled=fd,e.scissorTest=!1,Ls(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===us||e.mapping===ma?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),cd=this._renderer.getRenderTarget(),ud=this._renderer.getActiveCubeFace(),dd=this._renderer.getActiveMipmapLevel(),fd=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=n||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,i={magFilter:pn,minFilter:pn,generateMipmaps:!1,type:Qi,format:hi,colorSpace:Dc,depthBuffer:!1},r=zg(e,n,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=zg(e,n,i);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=QT(s)),this._blurMaterial=tC(s,e,n),this._ggxMaterial=eC(s,e,n)}return r}_compileMaterial(e){const n=new _n(new ni,e);this._renderer.compile(n,Oa)}_sceneToCubeUV(e,n,i,r,s){const l=new Zn(90,1,n,i),u=[1,-1,1,1,1,1],f=[1,1,1,-1,-1,-1],p=this._renderer,h=p.autoClear,m=p.toneMapping;p.getClearColor(Fg),p.toneMapping=Pi,p.autoClear=!1,p.state.buffers.depth.getReversed()&&(p.setRenderTarget(r),p.clearDepth(),p.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new _n(new fs,new oo({name:"PMREM.Background",side:Dn,depthWrite:!1,depthTest:!1})));const y=this._backgroundBox,g=y.material;let d=!1;const v=e.background;v?v.isColor&&(g.color.copy(v),e.background=null,d=!0):(g.color.copy(Fg),d=!0);for(let b=0;b<6;b++){const M=b%3;M===0?(l.up.set(0,u[b],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+f[b],s.y,s.z)):M===1?(l.up.set(0,0,u[b]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+f[b],s.z)):(l.up.set(0,u[b],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+f[b]));const E=this._cubeSize;Ls(r,M*E,b>2?E:0,E,E),p.setRenderTarget(r),d&&p.render(y,l),p.render(e,l)}p.toneMapping=m,p.autoClear=h,e.background=v}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===us||e.mapping===ma;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Bg()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=jg());const s=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=s;const o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;Ls(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(a,Oa)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;s<r;s++)this._applyGGXFilter(e,s-1,s);n.autoClear=i}_applyGGXFilter(e,n,i){const r=this._renderer,s=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[i];o.material=a;const l=a.uniforms,u=i/(this._lodMeshes.length-1),f=n/(this._lodMeshes.length-1),p=Math.sqrt(u*u-f*f),h=0+u*1.25,m=p*h,{_lodMax:x}=this,y=this._sizeLods[i],g=3*y*(i>x-Sr?i-x+Sr:0),d=4*(this._cubeSize-y);l.envMap.value=e.texture,l.roughness.value=m,l.mipInt.value=x-n,Ls(s,g,d,3*y,2*y),r.setRenderTarget(s),r.render(o,Oa),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=x-i,Ls(e,g,d,3*y,2*y),r.setRenderTarget(e),r.render(o,Oa)}_blur(e,n,i,r,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,n,i,r,"latitudinal",s),this._halfBlur(a,e,i,i,r,"longitudinal",s)}_halfBlur(e,n,i,r,s,a,o){const l=this._renderer,u=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&ot("blur direction must be either latitudinal or longitudinal!");const f=3,p=this._lodMeshes[r];p.material=u;const h=u.uniforms,m=this._sizeLods[i]-1,x=isFinite(s)?Math.PI/(2*m):2*Math.PI/(2*Kr-1),y=s/x,g=isFinite(s)?1+Math.floor(f*y):Kr;g>Kr&&He(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Kr}`);const d=[];let v=0;for(let A=0;A<Kr;++A){const _=A/y,T=Math.exp(-_*_/2);d.push(T),A===0?v+=T:A<g&&(v+=2*T)}for(let A=0;A<d.length;A++)d[A]=d[A]/v;h.envMap.value=e.texture,h.samples.value=g,h.weights.value=d,h.latitudinal.value=a==="latitudinal",o&&(h.poleAxis.value=o);const{_lodMax:b}=this;h.dTheta.value=x,h.mipInt.value=b-i;const M=this._sizeLods[r],E=3*M*(r>b-Sr?r-b+Sr:0),w=4*(this._cubeSize-M);Ls(n,E,w,3*M,2*M),l.setRenderTarget(n),l.render(p,Oa)}}function QT(t){const e=[],n=[],i=[];let r=t;const s=t-Sr+1+Ug.length;for(let a=0;a<s;a++){const o=Math.pow(2,r);e.push(o);let l=1/o;a>t-Sr?l=Ug[a-t+Sr-1]:a===0&&(l=0),n.push(l);const u=1/(o-2),f=-u,p=1+u,h=[f,f,p,f,p,p,f,f,p,p,f,p],m=6,x=6,y=3,g=2,d=1,v=new Float32Array(y*x*m),b=new Float32Array(g*x*m),M=new Float32Array(d*x*m);for(let w=0;w<m;w++){const A=w%3*2/3-1,_=w>2?0:-1,T=[A,_,0,A+2/3,_,0,A+2/3,_+1,0,A,_,0,A+2/3,_+1,0,A,_+1,0];v.set(T,y*x*w),b.set(h,g*x*w);const N=[w,w,w,w,w,w];M.set(N,d*x*w)}const E=new ni;E.setAttribute("position",new Ni(v,y)),E.setAttribute("uv",new Ni(b,g)),E.setAttribute("faceIndex",new Ni(M,d)),i.push(new _n(E,null)),r>Sr&&r--}return{lodMeshes:i,sizeLods:e,sigmas:n}}function zg(t,e,n){const i=new ki(t,e,n);return i.texture.mapping=tu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Ls(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function eC(t,e,n){return new Li({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:ZT,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:nu(),fragmentShader:` 3719 3720 precision highp float; 3721 precision highp int; 3722 3723 varying vec3 vOutputDirection; 3724 3725 uniform sampler2D envMap; 3726 uniform float roughness; 3727 uniform float mipInt; 3728 3729 #define ENVMAP_TYPE_CUBE_UV 3730 #include <cube_uv_reflection_fragment> 3731 3732 #define PI 3.14159265359 3733 3734 // Van der Corput radical inverse 3735 float radicalInverse_VdC(uint bits) { 3736 bits = (bits << 16u) | (bits >> 16u); 3737 bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); 3738 bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); 3739 bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); 3740 bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); 3741 return float(bits) * 2.3283064365386963e-10; // / 0x100000000 3742 } 3743 3744 // Hammersley sequence 3745 vec2 hammersley(uint i, uint N) { 3746 return vec2(float(i) / float(N), radicalInverse_VdC(i)); 3747 } 3748 3749 // GGX VNDF importance sampling (Eric Heitz 2018) 3750 // "Sampling the GGX Distribution of Visible Normals" 3751 // https://jcgt.org/published/0007/04/01/ 3752 vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { 3753 float alpha = roughness * roughness; 3754 3755 // Section 4.1: Orthonormal basis 3756 vec3 T1 = vec3(1.0, 0.0, 0.0); 3757 vec3 T2 = cross(V, T1); 3758 3759 // Section 4.2: Parameterization of projected area 3760 float r = sqrt(Xi.x); 3761 float phi = 2.0 * PI * Xi.y; 3762 float t1 = r * cos(phi); 3763 float t2 = r * sin(phi); 3764 float s = 0.5 * (1.0 + V.z); 3765 t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; 3766 3767 // Section 4.3: Reprojection onto hemisphere 3768 vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; 3769 3770 // Section 3.4: Transform back to ellipsoid configuration 3771 return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); 3772 } 3773 3774 void main() { 3775 vec3 N = normalize(vOutputDirection); 3776 vec3 V = N; // Assume view direction equals normal for pre-filtering 3777 3778 vec3 prefilteredColor = vec3(0.0); 3779 float totalWeight = 0.0; 3780 3781 // For very low roughness, just sample the environment directly 3782 if (roughness < 0.001) { 3783 gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); 3784 return; 3785 } 3786 3787 // Tangent space basis for VNDF sampling 3788 vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); 3789 vec3 tangent = normalize(cross(up, N)); 3790 vec3 bitangent = cross(N, tangent); 3791
3792 for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { 3793 vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); 3794 3795 // For PMREM, V = N, so in tangent space V is always (0, 0, 1) 3796 vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); 3797 3798 // Transform H back to world space 3799 vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); 3800 vec3 L = normalize(2.0 * dot(V, H) * H - V); 3801 3802 float NdotL = max(dot(N, L), 0.0); 3803 3804 if(NdotL > 0.0) { 3805 // Sample environment at fixed mip level 3806 // VNDF importance sampling handles the distribution filtering 3807 vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); 3808 3809 // Weight by NdotL for the split-sum approximation 3810 // VNDF PDF naturally accounts for the visible microfacet distribution 3811 prefilteredColor += sampleColor * NdotL; 3812 totalWeight += NdotL; 3813 } 3814 } 3815 3816 if (totalWeight > 0.0) { 3817 prefilteredColor = prefilteredColor / totalWeight; 3818 } 3819 3820 gl_FragColor = vec4(prefilteredColor, 1.0); 3821 } 3822 `,blending:$i,depthTest:!1,depthWrite:!1})}function tC(t,e,n){const i=new Float32Array(Kr),r=new H(0,1,0);return new Li({name:"SphericalGaussianBlur",defines:{n:Kr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:nu(),fragmentShader:` 3823 3824 precision mediump float; 3825 precision mediump int; 3826 3827 varying vec3 vOutputDirection; 3828 3829 uniform sampler2D envMap; 3830 uniform int samples; 3831 uniform float weights[ n ]; 3832 uniform bool latitudinal; 3833 uniform float dTheta; 3834 uniform float mipInt; 3835 uniform vec3 poleAxis; 3836 3837 #define ENVMAP_TYPE_CUBE_UV 3838 #include <cube_uv_reflection_fragment> 3839 3840 vec3 getSample( float theta, vec3 axis ) { 3841 3842 float cosTheta = cos( theta ); 3843 // Rodrigues' axis-angle rotation 3844 vec3 sampleDirection = vOutputDirection * cosTheta 3845 + cross( axis, vOutputDirection ) * sin( theta ) 3846 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3847 3848 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3849 3850 } 3851 3852 void main() { 3853 3854 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3855 3856 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3857 3858 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3859 3860 } 3861 3862 axis = normalize( axis ); 3863 3864 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3865 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3866 3867 for ( int i = 1; i < n; i++ ) { 3868 3869 if ( i >= samples ) { 3870 3871 break; 3872 3873 } 3874 3875 float theta = dTheta * float( i ); 3876 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3877 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3878 3879 } 3880 3881 } 3882 `,blending:$i,depthTest:!1,depthWrite:!1})}function jg(){return new Li({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:nu(),fragmentShader:` 3883 3884 precision mediump float; 3885 precision mediump int; 3886 3887 varying vec3 vOutputDirection; 3888 3889 uniform sampler2D envMap; 3890 3891 #include <common> 3892 3893 void main() { 3894 3895 vec3 outputDirection = normalize( vOutputDirection ); 3896 vec2 uv = equirectUv( outputDirection ); 3897 3898 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3899 3900 } 3901 `,blending:$i,depthTest:!1,depthWrite:!1})}function Bg(){return new Li({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:nu(),fragmentShader:` 3902 3903 precision mediump float; 3904 precision mediump int; 3905 3906 uniform float flipEnvMap; 3907 3908 varying vec3 vOutputDirection; 3909 3910 uniform samplerCube envMap; 3911 3912 void main() { 3913 3914 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3915 3916 } 3917 `,blending:$i,depthTest:!1,depthWrite:!1})}function nu(){return` 3918 3919 precision mediump float; 3920 precision mediump int; 3921 3922 attribute float faceIndex; 3923 3924 varying vec3 vOutputDirection; 3925 3926 // RH coordinate system; PMREM face-indexing convention 3927 vec3 getDirection( vec2 uv, float face ) { 3928 3929 uv = 2.0 * uv - 1.0; 3930 3931 vec3 direction = vec3( uv, 1.0 ); 3932 3933 if ( face == 0.0 ) { 3934 3935 direction = direction.zyx; // ( 1, v, u ) pos x 3936 3937 } else if ( face == 1.0 ) { 3938 3939 direction = direction.xzy; 3940 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3941 3942 } else if ( face == 2.0 ) { 3943 3944 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3945 3946 } else if ( face == 3.0 ) { 3947 3948 direction = direction.zyx; 3949 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3950 3951 } else if ( face == 4.0 ) { 3952 3953 direction = direction.xzy; 3954 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3955 3956 } else if ( face == 5.0 ) { 3957 3958 direction.z *= -1.0; // ( u, v, -1 ) neg z 3959 3960 } 3961 3962 return direction; 3963 3964 } 3965 3966 void main() { 3967 3968 vOutputDirection = getDirection( uv, faceIndex ); 3969 gl_Position = vec4( position, 1.0 ); 3970 3971 } 3972 `}class T_ extends ki{constructor(e=1,n={}
vendor: 25,798 bytes, lines 3972-4088
3972){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new __(r),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` 3973 3974 varying vec3 vWorldDirection; 3975 3976 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 3977 3978 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 3979 3980 } 3981 3982 void main() { 3983 3984 vWorldDirection = transformDirection( position, modelMatrix ); 3985 3986 #include <begin_vertex> 3987 #include <project_vertex> 3988 3989 } 3990 `,fragmentShader:` 3991 3992 uniform sampler2D tEquirect; 3993 3994 varying vec3 vWorldDirection; 3995 3996 #include <common> 3997 3998 void main() { 3999 4000 vec3 direction = normalize( vWorldDirection ); 4001 4002 vec2 sampleUV = equirectUv( direction ); 4003 4004 gl_FragColor = texture2D( tEquirect, sampleUV ); 4005 4006 } 4007 `},r=new fs(5,5,5),s=new Li({name:"CubemapFromEquirect",uniforms:va(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Dn,blending:$i});s.uniforms.tEquirect.value=n;const a=new _n(r,s),o=n.minFilter;return n.minFilter===Qr&&(n.minFilter=pn),new aw(1,10,this).update(e,a),n.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,n=!0,i=!0,r=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,i,r);e.setRenderTarget(s)}}function nC(t){let e=new WeakMap,n=new WeakMap,i=null;function r(h,m=!1){return h==null?null:m?a(h):s(h)}function s(h){if(h&&h.isTexture){const m=h.mapping;if(m===Uu||m===Fu)if(e.has(h)){const x=e.get(h).texture;return o(x,h.mapping)}else{const x=h.image;if(x&&x.height>0){const y=new T_(x.height);return y.fromEquirectangularTexture(t,h),e.set(h,y),h.addEventListener("dispose",u),o(y.texture,h.mapping)}else return null}}return h}function a(h){if(h&&h.isTexture){const m=h.mapping,x=m===Uu||m===Fu,y=m===us||m===ma;if(x||y){let g=n.get(h);const d=g!==void 0?g.texture.pmremVersion:0;if(h.isRenderTargetTexture&&h.pmremVersion!==d)return i===null&&(i=new Og(t)),g=x?i.fromEquirectangular(h,g):i.fromCubemap(h,g),g.texture.pmremVersion=h.pmremVersion,n.set(h,g),g.texture;if(g!==void 0)return g.texture;{const v=h.image;return x&&v&&v.height>0||y&&v&&l(v)?(i===null&&(i=new Og(t)),g=x?i.fromEquirectangular(h):i.fromCubemap(h),g.texture.pmremVersion=h.pmremVersion,n.set(h,g),h.addEventListener("dispose",f),g.texture):null}}}return h}function o(h,m){return m===Uu?h.mapping=us:m===Fu&&(h.mapping=ma),h}function l(h){let m=0;const x=6;for(let y=0;y<x;y++)h[y]!==void 0&&m++;return m===x}function u(h){const m=h.target;m.removeEventListener("dispose",u);const x=e.get(m);x!==void 0&&(e.delete(m),x.dispose())}function f(h){const m=h.target;m.removeEventListener("dispose",f);const x=n.get(m);x!==void 0&&(n.delete(m),x.dispose())}function p(){e=new WeakMap,n=new WeakMap,i!==null&&(i.dispose(),i=null)}return{get:r,dispose:p}}function iC(t){const e={};function n(i){if(e[i]!==void 0)return e[i];const r=t.getExtension(i);return e[i]=r,r}return{has:function(i){return n(i)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(i){const r=n(i);return r===null&&sa("WebGLRenderer: "+i+" extension not supported."),r}}}function rC(t,e,n,i){const r={},s=new WeakMap;function a(p){const h=p.target;h.index!==null&&e.remove(h.index);for(const x in h.attributes)e.remove(h.attributes[x]);h.removeEventListener("dispose",a),delete r[h.id];const m=s.get(h);m&&(e.remove(m),s.delete(h)),i.releaseStatesOfGeometry(h),h.isInstancedBufferGeometry===!0&&delete h._maxInstanceCount,n.memory.geometries--}function o(p,h){return r[h.id]===!0||(h.addEventListener("dispose",a),r[h.id]=!0,n.memory.geometries++),h}function l(p){const h=p.attributes;for(const m in h)e.update(h[m],t.ARRAY_BUFFER)}function u(p){const h=[],m=p.index,x=p.attributes.position;let y=0;if(x===void 0)return;if(m!==null){const v=m.array;y=m.version;for(let b=0,M=v.length;b<M;b+=3){const E=v[b+0],w=v[b+1],A=v[b+2];h.push(E,w,w,A,A,E)}}else{const v=x.array;y=x.version;for(let b=0,M=v.length/3-1;b<M;b+=3){const E=b+0,w=b+1,A=b+2;h.push(E,w,w,A,A,E)}}const g=new(x.count>=65535?v_:g_)(h,1);g.version=y;const d=s.get(p);d&&e.remove(d),s.set(p,g)}function f(p){const h=s.get(p);if(h){const m=p.index;m!==null&&h.version<m.version&&u(p)}else u(p);return s.get(p)}return{get:o,update:l,getWireframeAttribute:f}}function sC(t,e,n){let i;function r(p){i=p}let s,a;function o(p){s=p.type,a=p.bytesPerElement}function l(p,h){t.drawElements(i,h,s,p*a),n.update(h,i,1)}function u(p,h,m){m!==0&&(t.drawElementsInstanced(i,h,s,p*a,m),n.update(h,i,m))}function f(p,h,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,h,0,s,p,0,m);let y=0;for(let g=0;g<m;g++)y+=h[g];n.update(y,i,1)}this.setMode=r,this.setIndex=o,this.render=l,this.renderInstances=u,this.renderMultiDraw=f}function aC(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,a,o){switch(n.calls++,a){case t.TRIANGLES:n.triangles+=o*(s/3);break;case t.LINES:n.lines+=o*(s/2);break;case t.LINE_STRIP:n.lines+=o*(s-1);break;case t.LINE_LOOP:n.lines+=o*s;break;case t.POINTS:n.points+=o*s;break;default:ot("WebGLInfo: Unknown draw mode:",a);break}}function r(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:r,update:i}}function oC(t,e,n){const i=new WeakMap,r=new Nt;function s(a,o,l){const u=a.morphTargetInfluences,f=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,p=f!==void 0?f.length:0;let h=i.get(o);if(h===void 0||h.count!==p){let N=function(){_.dispose(),i.delete(o),o.removeEventListener("dispose",N)};var m=N;h!==void 0&&h.texture.dispose();const x=o.morphAttributes.position!==void 0,y=o.morphAttributes.normal!==void 0,g=o.morphAttributes.color!==void 0,d=o.morphAttributes.position||[],v=o.morphAttributes.normal||[],b=o.morphAttributes.color||[];let M=0;x===!0&&(M=1),y===!0&&(M=2),g===!0&&(M=3);let E=o.attributes.position.count*M,w=1;E>e.maxTextureSize&&(w=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const A=new Float32Array(E*w*4*p),_=new h_(A,E,w,p);_.type=Ti,_.needsUpdate=!0;const T=M*4;for(let L=0;L<p;L++){const R=d[L],D=v[L],F=b[L],k=E*w*4*L;for(let B=0;B<R.count;B++){const z=B*T;x===!0&&(r.fromBufferAttribute(R,B),A[k+z+0]=r.x,A[k+z+1]=r.y,A[k+z+2]=r.z,A[k+z+3]=0),y===!0&&(r.fromBufferAttribute(D,B),A[k+z+4]=r.x,A[k+z+5]=r.y,A[k+z+6]=r.z,A[k+z+7]=0),g===!0&&(r.fromBufferAttribute(F,B),A[k+z+8]=r.x,A[k+z+9]=r.y,A[k+z+10]=r.z,A[k+z+11]=F.itemSize===4?r.w:1)}}h={count:p,texture:_,size:new De(E,w)},i.set(o,h),o.addEventListener("dispose",N)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(t,"morphTexture",a.morphTexture,n);else{let x=0;for(let g=0;g<u.length;g++)x+=u[g];const y=o.morphTargetsRelative?1:1-x;l.getUniforms().setValue(t,"morphTargetBaseInfluence",y),l.getUniforms().setValue(t,"morphTargetInfluences",u)}l.getUniforms().setValue(t,"morphTargetsTexture",h.texture,n),l.getUniforms().setValue(t,"morphTargetsTextureSize",h.size)}return{update:s}}function lC(t,e,n,i,r){let s=new WeakMap;function a(u){const f=r.render.frame,p=u.geometry,h=e.get(u,p);if(s.get(h)!==f&&(e.update(h),s.set(h,f)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),s.get(u)!==f&&(n.update(u.instanceMatrix,t.ARRAY_BUFFER),u.instanceColor!==null&&n.update(u.instanceColor,t.ARRAY_BUFFER),s.set(u,f))),u.isSkinnedMesh){const m=u.skeleton;s.get(m)!==f&&(m.update(),s.set(m,f))}return h}function o(){s=new WeakMap}function l(u){const f=u.target;f.removeEventListener("dispose",l),i.releaseStatesOfObject(f),n.remove(f.instanceMatrix),f.instanceColor!==null&&n.remove(f.instanceColor)}return{update:a,dispose:o}}const cC={[Zx]:"LINEAR_TONE_MAPPING",[Jx]:"REINHARD_TONE_MAPPING",[Qx]:"CINEON_TONE_MAPPING",[e_]:"ACES_FILMIC_TONE_MAPPING",[n_]:"AGX_TONE_MAPPING",[i_]:"NEUTRAL_TONE_MAPPING",[t_]:"CUSTOM_TONE_MAPPING"};function uC(t,e,n,i,r,s){const a=new ki(e,n,{type:t,depthBuffer:r,stencilBuffer:s,samples:i?4:0,depthTexture:r?new ga(e,n):void 0}),o=new ki(e,n,{type:Qi,depthBuffer:!1,stencilBuffer:!1}),l=new ni;l.setAttribute("position",new Qt([-1,3,0,-1,-1,0,3,-1,0],3)),l.setAttribute("uv",new Qt([0,2,0,0,2,0],2));const u=new Qb({uniforms:{tDiffuse:{value:null}},vertexShader:` 4008 precision highp float; 4009 4010 uniform mat4 modelViewMatrix; 4011 uniform mat4 projectionMatrix; 4012 4013 attribute vec3 position; 4014 attribute vec2 uv; 4015 4016 varying vec2 vUv; 4017 4018 void main() { 4019 vUv = uv; 4020 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4021 }`,fragmentShader:` 4022 precision highp float; 4023 4024 uniform sampler2D tDiffuse; 4025 4026 varying vec2 vUv; 4027 4028 #include <tonemapping_pars_fragment> 4029 #include <colorspace_pars_fragment> 4030 4031 void main() { 4032 gl_FragColor = texture2D( tDiffuse, vUv ); 4033 4034 #ifdef LINEAR_TONE_MAPPING 4035 gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); 4036 #elif defined( REINHARD_TONE_MAPPING ) 4037 gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); 4038 #elif defined( CINEON_TONE_MAPPING ) 4039 gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); 4040 #elif defined( ACES_FILMIC_TONE_MAPPING ) 4041 gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); 4042 #elif defined( AGX_TONE_MAPPING ) 4043 gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); 4044 #elif defined( NEUTRAL_TONE_MAPPING ) 4045 gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); 4046 #elif defined( CUSTOM_TONE_MAPPING ) 4047 gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); 4048 #endif 4049 4050 #ifdef SRGB_TRANSFER 4051 gl_FragColor = sRGBTransferOETF( gl_FragColor ); 4052 #endif 4053 }`,depthTest:!1,depthWrite:!1}),f=new _n(l,u),p=new Pp(-1,1,1,-1,0,1);let h=null,m=null,x=!1,y,g=null,d=[],v=!1;this.setSize=function(b,M){a.setSize(b,M),o.setSize(b,M);for(let E=0;E<d.length;E++){const w=d[E];w.setSize&&w.setSize(b,M)}},this.setEffects=function(b){d=b,v=d.length>0&&d[0].isRenderPass===!0;const M=a.width,E=a.height;for(let w=0;w<d.length;w++){const A=d[w];A.setSize&&A.setSize(M,E)}},this.begin=function(b,M){if(x||b.toneMapping===Pi&&d.length===0)return!1;if(g=M,M!==null){const E=M.width,w=M.height;(a.width!==E||a.height!==w)&&this.setSize(E,w)}return v===!1&&b.setRenderTarget(a),y=b.toneMapping,b.toneMapping=Pi,!0},this.hasRenderPass=function(){return v},this.end=function(b,M){b.toneMapping=y,x=!0;let E=a,w=o;for(let A=0;A<d.length;A++){const _=d[A];if(_.enabled!==!1&&(_.render(b,w,E,M),_.needsSwap!==!1)){const T=E;E=w,w=T}}if(h!==b.outputColorSpace||m!==b.toneMapping){h=b.outputColorSpace,m=b.toneMapping,u.defines={},rt.getTransfer(h)===ft&&(u.defines.SRGB_TRANSFER="");const A=cC[m];A&&(u.defines[A]=""),u.needsUpdate=!0}u.uniforms.tDiffuse.value=E.texture,b.setRenderTarget(g),b.render(f,p),g=null,x=!1},this.isCompositing=function(){return x},this.dispose=function(){a.depthTexture&&a.depthTexture.dispose(),a.dispose(),o.dispose(),l.dispose(),u.dispose()}}const C_=new mn,lh=new ga(1,1),A_=new h_,R_=new Pb,P_=new __,Gg=[],Hg=[],Vg=new Float32Array(16),Wg=new Float32Array(9),Xg=new Float32Array(4);function Ea(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let s=Gg[r];if(s===void 0&&(s=new Float32Array(r),Gg[r]=s),e!==0){i.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=n,t[a].toArray(s,o)}return s}function Yt(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Kt(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function iu(t,e){let n=Hg[e];n===void 0&&(n=new Int32Array(e),Hg[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function dC(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function fC(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Yt(n,e))return;t.uniform2fv(this.addr,e),Kt(n,e)}}function hC(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(e.r!==void 0)(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Yt(n,e))return;t.uniform3fv(this.addr,e),Kt(n,e)}}function pC(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Yt(n,e))return;t.uniform4fv(this.addr,e),Kt(n,e)}}function mC(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(Yt(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Kt(n,e)}else{if(Yt(n,i))return;Xg.set(i),t.uniformMatrix2fv(this.addr,!1,Xg),Kt(n,i)}}function gC(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(Yt(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Kt(n,e)}else{if(Yt(n,i))return;Wg.set(i),t.uniformMatrix3fv(this.addr,!1,Wg),Kt(n,i)}}function vC(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(Yt(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Kt(n,e)}else{if(Yt(n,i))return;Vg.set(i),t.uniformMatrix4fv(this.addr,!1,Vg),Kt(n,i)}}function xC(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function _C(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Yt(n,e))return;t.uniform2iv(this.addr,e),Kt(n,e)}}function yC(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Yt(n,e))return;t.uniform3iv(this.addr,e),Kt(n,e)}}function SC(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Yt(n,e))return;t.uniform4iv(this.addr,e),Kt(n,e)}}function MC(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function EC(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Yt(n,e))return;t.uniform2uiv(this.addr,e),Kt(n,e)}}function bC(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Yt(n,e))return;t.uniform3uiv(this.addr,e),Kt(n,e)}}function wC(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Yt(n,e))return;t.uniform4uiv(this.addr,e),Kt(n,e)}}function TC(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r);let s;this.type===t.SAMPLER_2D_SHADOW?(lh.compareFunction=n.isReversedDepthBuffer()?Mp:Sp,s=lh):s=C_,n.setTexture2D(e||s,r)}function CC(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||R_,r)}function AC(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||P_,r)}function RC(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||A_,r)}function PC(t){switch(t){case 5126:return dC;case 35664:return fC;case 35665:return hC;case 35666:return pC;case 35674:return mC;case 35675:return gC;case 35676:return vC;case 5124:case 35670:return xC;case 35667:case 35671:return _C;case 35668:case 35672:return yC;case 35669:case 35673:return SC;case 5125:return MC;case 36294:return EC;case 36295:return bC;case 36296:return wC;case 35678:case 36198:case 36298:case 36306:case 35682:return TC;case 35679:case 36299:case 36307:return CC;case 35680:case 36300:case 36308:case 36293:return AC;case 36289:case 36303:case 36311:case 36292:return RC}}function kC(t,e){t.uniform1fv(this.addr,e)}function NC(t,e){const n=Ea(e,this.size,2);t.uniform2fv(this.addr,n)}function DC(t,e){const n=Ea(e,this.size,3);t.uniform3fv(this.addr,n)}function LC(t,e){const n=Ea(e,this.size,4);t.uniform4fv(this.addr,n)}function IC(t,e){const n=Ea(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function UC(t,e){const n=Ea(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function FC(t,e){const n=Ea(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function OC(t,e){t.uniform1iv(this.addr,e)}function zC(t,e){t.uniform2iv(this.addr,e)}function jC(t,e){t.uniform3iv(this.addr,e)}function BC(t,e){t.uniform4iv(this.addr,e)}function GC(t,e){t.uniform1uiv(this.addr,e)}function HC(t,e){t.uniform2uiv(this.addr,e)}function VC(t,e){t.uniform3uiv(this.addr,e)}function WC(t,e){t.uniform4uiv(this.addr,e)}function XC(t,e,n){const i=this.cache,r=e.length,s=iu(n,r);Yt(i,s)||(t.uniform1iv(this.addr,s),Kt(i,s));let a;this.type===t.SAMPLER_2D_SHADOW?a=lh:a=C_;for(let o=0;o!==r;++o)n.setTexture2D(e[o]||a,s[o])}function $C(t,e,n){const i=this.cache,r=e.length,s=iu(n,r);Yt(i,s)||(t.uniform1iv(this.addr,s),Kt(i,s));for(let a=0;a!==r;++a)n.setTexture3D(e[a]||R_,s[a])}function YC(t,e,n){const i=this.cache,r=e.length,s=iu(n,r);Yt(i,s)||(t.uniform1iv(this.addr,s),Kt(i,s));for(let a=0;a!==r;++a)n.setTextureCube(e[a]||P_,s[a])}function KC(t,e,n){const i=this.cache,r=e.length,s=iu(n,r);Yt(i,s)||(t.uniform1iv(this.addr,s),Kt(i,s));for(let a=0;a!==r;++a)n.setTexture2DArray(e[a]||A_,s[a])}function qC(t){switch(t){case 5126:return kC;case 35664:return NC;case 35665:return DC;case 35666:return LC;case 35674:return IC;case 35675:return UC;case 35676:return FC;case 5124:case 35670:return OC;case 35667:case 35671:return zC;case 35668:case 35672:return jC;case 35669:case 35673:return BC;case 5125:return GC;case 36294:return HC;case 36295:return VC;case 36296:return WC;case 35678:case 36198:case 36298:case 36306:case 35682:return XC;case 35679:case 36299:case 36307:return $C;case 35680:case 36300:case 36308:case 36293:return YC;case 36289:case 36303:case 36311:case 36292:return KC}}class ZC{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.setValue=PC(n.type)}}class JC{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=qC(n.type)}}class QC{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,i){const r=this.seq;for(let s=0,a=r.length;s!==a;++s){const o=r[s];o.setValue(e,n[o.id],i)}}}const hd=/(\w+)(\])?(\[|\.)?/g;function $g(t,e){t.seq.push(e),t.map[e.id]=e}function eA(t,e,n){const i=t.name,r=i.length;for(hd.lastIndex=0;;){const s=hd.exec(i),a=hd.lastIndex;let o=s[1];const l=s[2]==="]",u=s[3];if(l&&(o=o|0),u===void 0||u==="["&&a+2===r){$g(n,u===void 0?new ZC(o,t,e):new JC(o,t,e));break}else{let p=n.map[o];p===void 0&&(p=new QC(o),$g(n,p)),n=p}}}class tc{constructor(e,n){this.seq=[],this.map={};const i=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let a=0;a<i;++a){const o=e.getActiveUniform(n,a),l=e.getUniformLocation(n,o.name);eA(o,l,this)}const r=[],s=[];for(const a of this.seq)a.type===e.SAMPLER_2D_SHADOW||a.type===e.SAMPLER_CUBE_SHADOW||a.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(a):s.push(a);r.length>0&&(this.seq=r.concat(s))}setValue(e,n,i,r){const s=this.map[n];s!==void 0&&s.setValue(e,i,r)}setOptional(e,n,i){const r=n[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,n,i,r){for(let s=0,a=n.length;s!==a;++s){const o=n[s],l=i[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,r)}}static seqWithValue(e,n){const i=[];for(let r=0,s=e.length;r!==s;++r){const a=e[r];a.id in n&&i.push(a)}return i}}function Yg(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}const tA=37297;let nA=0;function iA(t,e){const n=t.split(` 4054`),i=[],r=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let a=r;a<s;a++){const o=a+1;i.push(`${o===e?">":" "} ${o}: ${n[a]}`)}return i.join(` 4055`)}const Kg=new Ye;function rA(t){rt._getMatrix(Kg,rt.workingColorSpace,t);const e=`mat3( ${Kg.elements.map(n=>n.toFixed(4))} )`;switch(rt.getTransfer(t)){case Lc:return[e,"LinearTransferOETF"];case ft:return[e,"sRGBTransferOETF"];default:return He("WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function qg(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),s=(t.getShaderInfoLog(e)||"").trim();if(i&&s==="")return"";const a=/ERROR: 0:(\d+)/.exec(s);if(a){const o=parseInt(a[1]);return n.toUpperCase()+` 4056 4057`+s+` 4058 4059`+iA(t.getShaderSource(e),o)}else return s}function sA(t,e){const n=rA(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(` 4060`)}const aA={[Zx]:"Linear",[Jx]:"Reinhard",[Qx]:"Cineon",[e_]:"ACESFilmic",[n_]:"AgX",[i_]:"Neutral",[t_]:"Custom"};function oA(t,e){const n=aA[e];return n===void 0?(He("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+t+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const Pl=new H;function lA(){rt.getLuminanceCoefficients(Pl);const t=Pl.x.toFixed(4),e=Pl.y.toFixed(4),n=Pl.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` 4061`)}function cA(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ka).join(` 4062`)}function uA(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(` 4063`)}function dA(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const s=t.getActiveAttrib(e,r),a=s.name;let o=1;s.type===t.FLOAT_MAT2&&(o=2),s.type===t.FLOAT_MAT3&&(o=3),s.type===t.FLOAT_MAT4&&(o=4),n[a]={type:s.type,location:t.getAttribLocation(e,a),locationSize:o}}return n}function Ka(t){return t!==""}function Zg(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.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,n).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 Jg(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const fA=/^[ \t]*#include +<([\w\d./]+)>/gm;function ch(t){return t.replace(fA,pA)}const hA=new Map;function pA(t,e){let n=Ze[e];if(n===void 0){const i=hA.get(e);if(i!==void 0)n=Ze[i],He('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("THREE.WebGLProgram: Can not resolve #include <"+e+">")}return ch(n)}const mA=/#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 Qg(t){return t.replace(mA,gA)}function gA(t,e,n,i){let r="";for(let s=parseInt(e);s<parseInt(n);s++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function e0(t){let e=`precision ${t.precision} float; 4064 precision ${t.precision} int; 4065 precision ${t.precision} sampler2D; 4066 precision ${t.precision} samplerCube; 4067 precision ${t.precision} sampler3D; 4068 precision ${t.precision} sampler2DArray; 4069 precision ${t.precision} sampler2DShadow; 4070 precision ${t.precision} samplerCubeShadow; 4071 precision ${t.precision} sampler2DArrayShadow; 4072 precision ${t.precision} isampler2D; 4073 precision ${t.precision} isampler3D; 4074 precision ${t.precision} isamplerCube; 4075 precision ${t.precision} isampler2DArray; 4076 precision ${t.precision} usampler2D; 4077 precision ${t.precision} usampler3D; 4078 precision ${t.precision} usamplerCube; 4079 precision ${t.precision} usampler2DArray; 4080 `;return t.precision==="highp"?e+=` 4081#define HIGH_PRECISION`:t.precision==="mediump"?e+=` 4082#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=` 4083#define LOW_PRECISION`),e}const vA={[Kl]:"SHADOWMAP_TYPE_PCF",[$a]:"SHADOWMAP_TYPE_VSM"};function xA(t){return vA[t.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const _A={[us]:"ENVMAP_TYPE_CUBE",[ma]:"ENVMAP_TYPE_CUBE",[tu]:"ENVMAP_TYPE_CUBE_UV"};function yA(t){return t.envMap===!1?"ENVMAP_TYPE_CUBE":_A[t.envMapMode]||"ENVMAP_TYPE_CUBE"}const SA={[ma]:"ENVMAP_MODE_REFRACTION"};function MA(t){return t.envMap===!1?"ENVMAP_MODE_REFLECTION":SA[t.envMapMode]||"ENVMAP_MODE_REFLECTION"}const EA={[qx]:"ENVMAP_BLENDING_MULTIPLY",[lb]:"ENVMAP_BLENDING_MIX",[cb]:"ENVMAP_BLENDING_ADD"};function bA(t){return t.envMap===!1?"ENVMAP_BLENDING_NONE":EA[t.combine]||"ENVMAP_BLENDING_NONE"}function wA(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),7*16)),texelHeight:i,maxMip:n}}function TA(t,e,n,i){const r=t.getContext(),s=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=xA(n),u=yA(n),f=MA(n),p=bA(n),h=wA(n),m=cA(n),x=uA(s),y=r.createProgram();let g,d,v=n.glslVersion?"#version "+n.glslVersion+` 4084`:"";n.isRawShaderMaterial?(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(Ka).join(` 4085`),g.length>0&&(g+=` 4086`),d=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(Ka).join(` 4087`),d.length>0&&(d+=` 4088`)):(g=[e0(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.extensionCl
vendor: 8,692 bytes, lines 4088-4090
4088ipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexNormals?"#define HAS_NORMAL":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","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",` 4089`].filter(Ka).join(` 4090`),d=[e0(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",n.envMap?"#define "+p:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas||n.batchingColor?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Pi?"#define TONE_MAPPING":"",n.toneMapping!==Pi?Ze.tonemapping_pars_fragment:"",n.toneMapping!==Pi?oA("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Ze.colorspace_pars_fragment,sA("linearToOutputTexel",n.outputColorSpace),lA(
vendor: 5,238 bytes, lines 4090-4104
4090),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` 4091`].filter(Ka).join(` 4092`)),a=ch(a),a=Zg(a,n),a=Jg(a,n),o=ch(o),o=Zg(o,n),o=Jg(o,n),a=Qg(a),o=Qg(o),n.isRawShaderMaterial!==!0&&(v=`#version 300 es 4093`,g=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` 4094`)+` 4095`+g,d=["#define varying in",n.glslVersion===ug?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===ug?"":"#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(` 4096`)+` 4097`+d);const b=v+g+a,M=v+d+o,E=Yg(r,r.VERTEX_SHADER,b),w=Yg(r,r.FRAGMENT_SHADER,M);r.attachShader(y,E),r.attachShader(y,w),n.index0AttributeName!==void 0?r.bindAttribLocation(y,0,n.index0AttributeName):n.hasPositionAttribute===!0&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y);function A(L){if(t.debug.checkShaderErrors){const R=r.getProgramInfoLog(y)||"",D=r.getShaderInfoLog(E)||"",F=r.getShaderInfoLog(w)||"",k=R.trim(),B=D.trim(),z=F.trim();let I=!0,V=!0;if(r.getProgramParameter(y,r.LINK_STATUS)===!1)if(I=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(r,y,E,w);else{const Q=qg(r,E,"vertex"),re=qg(r,w,"fragment");ot("WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(y,r.VALIDATE_STATUS)+` 4098 4099Material Name: `+L.name+` 4100Material Type: `+L.type+` 4101 4102Program Info Log: `+k+` 4103`+Q+` 4104`+re)}else k!==""?He("WebGLProgram: Program Info Log:",k):(B===""||z==="")&&(V=!1);V&&(L.diagnostics={runnable:I,programLog:k,vertexShader:{log:B,prefix:g},fragmentShader:{log:z,prefix:d}})}r.deleteShader(E),r.deleteShader(w),_=new tc(r,y),T=dA(r,y)}let _;this.getUniforms=function(){return _===void 0&&A(this),_};let T;this.getAttributes=function(){return T===void 0&&A(this),T};let N=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return N===!1&&(N=r.getProgramParameter(y,tA)),N},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=nA++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=E,this.fragmentShader=w,this}let CA=0;class AA{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,n,i){const r=this._getShaderCacheForMaterial(e);return r.has(n)===!1&&(r.add(n),n.usedTimes++),r.has(i)===!1&&(r.add(i),i.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new RA(e),n.set(e,i)),i}}class RA{constructor(e){this.id=CA++,this.code=e,this.usedTimes=0}}function PA(t){return t===ds||t===kc||t===Nc}function kA(t,e,n,i,r,s){const a=new p_,o=new AA,l=new Set,u=[],f=new Map,p=i.logarithmicDepthBuffer;let h=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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 x(_){return l.add(_),_===0?"uv":`uv${_}`}function y(_,T,N,L,R,D){const F=L.fog,k=R.geometry,B=_.isMeshStandardMaterial||_.isMeshLambertMaterial||_.isMeshPhongMaterial?L.environment:null,z=_.isMeshStandardMaterial||_.isMeshLambertMaterial&&!_.envMap||_.isMeshPhongMaterial&&!_.envMap,I=e.get(_.envMap||B,z),V=I&&I.mapping===tu?I.image.height:null,Q=m[_.type];_.precision!==null&&(h=i.getMaxPrecision(_.precision),h!==_.precision&&He("WebGLProgram.getParameters:",_.precision,"not supported, using",h,"instead."));const re=k.morphAttributes.position||k.morphAttributes.normal||k.morphAttributes.color,ae=re!==void 0?re.length:0;let Fe=0;k.morphAttributes.position!==void 0&&(Fe=1),k.morphAttributes.normal!==void 0&&(Fe=2),k.morphAttributes.color!==void 0&&(Fe=3);let je,Oe,ee,ue;if(Q){const be=Ei[Q];je=be.vertexShader,Oe=be.fragmentShader}else{je=_.vertexShader,Oe=_.fragmentShader;const be=o.getVertexShaderStage(_),xt=o.getFragmentShaderStage(_);o.update(_,be,xt),ee=be.id,ue=xt.id}const oe=t.getRenderTarget(),Be=t.state.buffers.depth.getReversed(),$e=R.isInstancedMesh===!0,Pe=R.isBatchedMesh===!0,wt=!!_.map,Qe=!!_.matcap,ut=!!I,Xe=!!_.aoMap,tt=!!_.lightMap,St=!!_.bumpMap&&_.wireframe===!1,ve=!!_.normalMap,At=!!_.displacementMap,Gt=!!_.emissiveMap,Mt=!!_.metalnessMap,pt=!!_.roughnessMap,O
vendor: 4,923 bytes, line 4104
4104=_.anisotropy>0,on=_.clearcoat>0,ct=_.dispersion>0,P=_.iridescence>0,S=_.sheen>0,G=_.transmission>0,$=O&&!!_.anisotropyMap,Z=on&&!!_.clearcoatMap,ce=on&&!!_.clearcoatNormalMap,fe=on&&!!_.clearcoatRoughnessMap,J=P&&!!_.iridescenceMap,te=P&&!!_.iridescenceThicknessMap,he=S&&!!_.sheenColorMap,Ae=S&&!!_.sheenRoughnessMap,xe=!!_.specularMap,me=!!_.specularColorMap,Le=!!_.specularIntensityMap,ze=G&&!!_.transmissionMap,We=G&&!!_.thicknessMap,U=!!_.gradientMap,pe=!!_.alphaMap,ie=_.alphaTest>0,ge=!!_.alphaHash,ye=!!_.extensions;let se=Pi;_.toneMapped&&(oe===null||oe.isXRRenderTarget===!0)&&(se=t.toneMapping);const Re={shaderID:Q,shaderType:_.type,shaderName:_.name,vertexShader:je,fragmentShader:Oe,defines:_.defines,customVertexShaderID:ee,customFragmentShaderID:ue,isRawShaderMaterial:_.isRawShaderMaterial===!0,glslVersion:_.glslVersion,precision:h,batching:Pe,batchingColor:Pe&&R._colorsTexture!==null,instancing:$e,instancingColor:$e&&R.instanceColor!==null,instancingMorph:$e&&R.morphTexture!==null,outputColorSpace:oe===null?t.outputColorSpace:oe.isXRRenderTarget===!0?oe.texture.colorSpace:rt.workingColorSpace,alphaToCoverage:!!_.alphaToCoverage,map:wt,matcap:Qe,envMap:ut,envMapMode:ut&&I.mapping,envMapCubeUVHeight:V,aoMap:Xe,lightMap:tt,bumpMap:St,normalMap:ve,displacementMap:At,emissiveMap:Gt,normalMapObjectSpace:ve&&_.normalMapType===fb,normalMapTangentSpace:ve&&_.normalMapType===ah,packedNormalMap:ve&&_.normalMapType===ah&&PA(_.normalMap.format),metalnessMap:Mt,roughnessMap:pt,anisotropy:O,anisotropyMap:$,clearcoat:on,clearcoatMap:Z,clearcoatNormalMap:ce,clearcoatRoughnessMap:fe,dispersion:ct,iridescence:P,iridescenceMap:J,iridescenceThicknessMap:te,sheen:S,sheenColorMap:he,sheenRoughnessMap:Ae,specularMap:xe,specularColorMap:me,specularIntensityMap:Le,transmission:G,transmissionMap:ze,thicknessMap:We,gradientMap:U,opaque:_.transparent===!1&&_.blending===ra&&_.alphaToCoverage===!1,alphaMap:pe,alphaTest:ie,alphaHash:ge,combine:_.combine,mapUv:wt&&x(_.map.channel),aoMapUv:Xe&&x(_.aoMap.channel),lightMapUv:tt&&x(_.lightMap.channel),bumpMapUv:St&&x(_.bumpMap.channel),normalMapUv:ve&&x(_.normalMap.channel),displacementMapUv:At&&x(_.displacementMap.channel),emissiveMapUv:Gt&&x(_.emissiveMap.channel),metalnessMapUv:Mt&&x(_.metalnessMap.channel),roughnessMapUv:pt&&x(_.roughnessMap.channel),anisotropyMapUv:$&&x(_.anisotropyMap.channel),clearcoatMapUv:Z&&x(_.clearcoatMap.channel),clearcoatNormalMapUv:ce&&x(_.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:fe&&x(_.clearcoatRoughnessMap.channel),iridescenceMapUv:J&&x(_.iridescenceMap.channel),iridescenceThicknessMapUv:te&&x(_.iridescenceThicknessMap.channel),sheenColorMapUv:he&&x(_.sheenColorMap.channel),sheenRoughnessMapUv:Ae&&x(_.sheenRoughnessMap.channel),specularMapUv:xe&&x(_.specularMap.channel),specularColorMapUv:me&&x(_.specularColorMap.channel),specularIntensityMapUv:Le&&x(_.specularIntensityMap.channel),transmissionMapUv:ze&&x(_.transmissionMap.channel),thicknessMapUv:We&&x(_.thicknessMap.channel),alphaMapUv:pe&&x(_.alphaMap.channel),vertexTangents:!!k.attributes.tangent&&(ve||O),vertexNormals:!!k.attributes.normal,vertexColors:_.vertexColors,vertexAlphas:_.vertexColors===!0&&!!k.attributes.color&&k.attributes.color.itemSize===4,pointsUvs:R.isPoints===!0&&!!k.attributes.uv&&(wt||pe),fog:!!F,useFog:_.fog===!0,fogExp2:!!F&&F.isFogExp2,flatShading:_.wireframe===!1&&(_.flatShading===!0||k.attributes.normal===void 0&&ve===!1&&(_.isMeshLambertMaterial||_.isMeshPhongMaterial||_.isMeshStandardMaterial||_.isMeshPhysicalMaterial)),sizeAttenuation:_.sizeAttenuation===!0,logarithmicDepthBuffer:p,reversedDepthBuffer:Be,skinning:R.isSkinnedMesh===!0,hasPositionAttribute:k.attributes.position!==void 0,morphTargets:k.morphAttributes.position!==void 0,morphNormals:k.morphAttributes.normal!==void 0,morphColors:k.morphAttributes.color!==void 0,morphTargetsCount:ae,morphTextureStride:Fe,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numLightProbes:T.numLightProbes,numLightProbeGrids:D.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:_.dithering,shadowMapEnabled:t.shadowMap.enabled&&N.length>0,shadowMapType:t.shadowMap.type,toneMapping:se,decodeVideoTexture:wt&&_.map.isVideoTexture===!0&&rt.getTransfer(_.map.colorSpace)===ft,decodeVideoTextureEmissive:Gt&&_.emissiveMap.isVideoTexture===!0&&rt.getTransfer(_.emissiveMap.colorSpace)===ft,premultipliedAlpha:_.premultipliedAlpha,doubleSided:_.side===di,flipSided:_.side===Dn,useDepthPacking:_.depthPacking>=0,depthPacking:_.depthPacking||0,index0AttributeName:_.index0AttributeName,extensionCl
vendor: 12,951 bytes, line 4104
4104ipCullDistance:ye&&_.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ye&&_.extensions.multiDraw===!0||Pe)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:_.customProgramCacheKey()};return Re.vertexUv1s=l.has(1),Re.vertexUv2s=l.has(2),Re.vertexUv3s=l.has(3),l.clear(),Re}function g(_){const T=[];if(_.shaderID?T.push(_.shaderID):(T.push(_.customVertexShaderID),T.push(_.customFragmentShaderID)),_.defines!==void 0)for(const N in _.defines)T.push(N),T.push(_.defines[N]);return _.isRawShaderMaterial===!1&&(d(T,_),v(T,_),T.push(t.outputColorSpace)),T.push(_.customProgramCacheKey),T.join()}function d(_,T){_.push(T.precision),_.push(T.outputColorSpace),_.push(T.envMapMode),_.push(T.envMapCubeUVHeight),_.push(T.mapUv),_.push(T.alphaMapUv),_.push(T.lightMapUv),_.push(T.aoMapUv),_.push(T.bumpMapUv),_.push(T.normalMapUv),_.push(T.displacementMapUv),_.push(T.emissiveMapUv),_.push(T.metalnessMapUv),_.push(T.roughnessMapUv),_.push(T.anisotropyMapUv),_.push(T.clearcoatMapUv),_.push(T.clearcoatNormalMapUv),_.push(T.clearcoatRoughnessMapUv),_.push(T.iridescenceMapUv),_.push(T.iridescenceThicknessMapUv),_.push(T.sheenColorMapUv),_.push(T.sheenRoughnessMapUv),_.push(T.specularMapUv),_.push(T.specularColorMapUv),_.push(T.specularIntensityMapUv),_.push(T.transmissionMapUv),_.push(T.thicknessMapUv),_.push(T.combine),_.push(T.fogExp2),_.push(T.sizeAttenuation),_.push(T.morphTargetsCount),_.push(T.morphAttributeCount),_.push(T.numDirLights),_.push(T.numPointLights),_.push(T.numSpotLights),_.push(T.numSpotLightMaps),_.push(T.numHemiLights),_.push(T.numRectAreaLights),_.push(T.numDirLightShadows),_.push(T.numPointLightShadows),_.push(T.numSpotLightShadows),_.push(T.numSpotLightShadowsWithMaps),_.push(T.numLightProbes),_.push(T.shadowMapType),_.push(T.toneMapping),_.push(T.numClippingPlanes),_.push(T.numClipIntersection),_.push(T.depthPacking)}function v(_,T){a.disableAll(),T.instancing&&a.enable(0),T.instancingColor&&a.enable(1),T.instancingMorph&&a.enable(2),T.matcap&&a.enable(3),T.envMap&&a.enable(4),T.normalMapObjectSpace&&a.enable(5),T.normalMapTangentSpace&&a.enable(6),T.clearcoat&&a.enable(7),T.iridescence&&a.enable(8),T.alphaTest&&a.enable(9),T.vertexColors&&a.enable(10),T.vertexAlphas&&a.enable(11),T.vertexUv1s&&a.enable(12),T.vertexUv2s&&a.enable(13),T.vertexUv3s&&a.enable(14),T.vertexTangents&&a.enable(15),T.anisotropy&&a.enable(16),T.alphaHash&&a.enable(17),T.batching&&a.enable(18),T.dispersion&&a.enable(19),T.batchingColor&&a.enable(20),T.gradientMap&&a.enable(21),T.packedNormalMap&&a.enable(22),T.vertexNormals&&a.enable(23),_.push(a.mask),a.disableAll(),T.fog&&a.enable(0),T.useFog&&a.enable(1),T.flatShading&&a.enable(2),T.logarithmicDepthBuffer&&a.enable(3),T.reversedDepthBuffer&&a.enable(4),T.skinning&&a.enable(5),T.morphTargets&&a.enable(6),T.morphNormals&&a.enable(7),T.morphColors&&a.enable(8),T.premultipliedAlpha&&a.enable(9),T.shadowMapEnabled&&a.enable(10),T.doubleSided&&a.enable(11),T.flipSided&&a.enable(12),T.useDepthPacking&&a.enable(13),T.dithering&&a.enable(14),T.transmission&&a.enable(15),T.sheen&&a.enable(16),T.opaque&&a.enable(17),T.pointsUvs&&a.enable(18),T.decodeVideoTexture&&a.enable(19),T.decodeVideoTextureEmissive&&a.enable(20),T.alphaToCoverage&&a.enable(21),T.numLightProbeGrids>0&&a.enable(22),T.hasPositionAttribute&&a.enable(23),_.push(a.mask)}function b(_){const T=m[_.type];let N;if(T){const L=Ei[T];N=qb.clone(L.uniforms)}else N=_.uniforms;return N}function M(_,T){let N=f.get(T);return N!==void 0?++N.usedTimes:(N=new TA(t,T,_,r),u.push(N),f.set(T,N)),N}function E(_){if(--_.usedTimes===0){const T=u.indexOf(_);u[T]=u[u.length-1],u.pop(),f.delete(_.cacheKey),_.destroy()}}function w(_){o.remove(_)}function A(){o.dispose()}return{getParameters:y,getProgramCacheKey:g,getUniforms:b,acquireProgram:M,releaseProgram:E,releaseShaderCache:w,programs:u,dispose:A}}function NA(){let t=new WeakMap;function e(a){return t.has(a)}function n(a){let o=t.get(a);return o===void 0&&(o={},t.set(a,o)),o}function i(a){t.delete(a)}function r(a,o,l){t.get(a)[o]=l}function s(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:s}}function DA(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.materialVariant!==e.materialVariant?t.materialVariant-e.materialVariant:t.z!==e.z?t.z-e.z:t.id-e.id}function t0(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function n0(){const t=[];let e=0;const n=[],i=[],r=[];function s(){e=0,n.length=0,i.length=0,r.length=0}function a(h){let m=0;return h.isInstancedMesh&&(m+=2),h.isSkinnedMesh&&(m+=1),m}function o(h,m,x,y,g,d){let v=t[e];return v===void 0?(v={id:h.id,object:h,geometry:m,material:x,materialVariant:a(h),groupOrder:y,renderOrder:h.renderOrder,z:g,group:d},t[e]=v):(v.id=h.id,v.object=h,v.geometry=m,v.material=x,v.materialVariant=a(h),v.groupOrder=y,v.renderOrder=h.renderOrder,v.z=g,v.group=d),e++,v}function l(h,m,x,y,g,d){const v=o(h,m,x,y,g,d);x.transmission>0?i.push(v):x.transparent===!0?r.push(v):n.push(v)}function u(h,m,x,y,g,d){const v=o(h,m,x,y,g,d);x.transmission>0?i.unshift(v):x.transparent===!0?r.unshift(v):n.unshift(v)}function f(h,m,x){n.length>1&&n.sort(h||DA),i.length>1&&i.sort(m||t0),r.length>1&&r.sort(m||t0),x&&(n.reverse(),i.reverse(),r.reverse())}function p(){for(let h=e,m=t.length;h<m;h++){const x=t[h];if(x.id===null)break;x.id=null,x.object=null,x.geometry=null,x.material=null,x.group=null}}return{opaque:n,transmissive:i,transparent:r,init:s,push:l,unshift:u,finish:p,sort:f}}function LA(){let t=new WeakMap;function e(i,r){const s=t.get(i);let a;return s===void 0?(a=new n0,t.set(i,[a])):r>=s.length?(a=new n0,s.push(a)):a=s[r],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function IA(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new H,color:new st};break;case"SpotLight":n={position:new H,direction:new H,color:new st,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new H,color:new st,distance:0,decay:0};break;case"HemisphereLight":n={direction:new H,skyColor:new st,groundColor:new st};break;case"RectAreaLight":n={color:new st,position:new H,halfWidth:new H,halfHeight:new H};break}return t[e.id]=n,n}}}function UA(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let FA=0;function OA(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function zA(t){const e=new IA,n=UA(),i={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++)i.probe.push(new H);const r=new H,s=new Ft,a=new Ft;function o(u){let f=0,p=0,h=0;for(let T=0;T<9;T++)i.probe[T].set(0,0,0);let m=0,x=0,y=0,g=0,d=0,v=0,b=0,M=0,E=0,w=0,A=0;u.sort(OA);for(let T=0,N=u.length;T<N;T++){const L=u[T],R=L.color,D=L.intensity,F=L.distance;let k=null;if(L.shadow&&L.shadow.map&&(L.shadow.map.texture.format===ds?k=L.shadow.map.texture:k=L.shadow.map.depthTexture||L.shadow.map.texture),L.isAmbientLight)f+=R.r*D,p+=R.g*D,h+=R.b*D;else if(L.isLightProbe){for(let B=0;B<9;B++)i.probe[B].addScaledVector(L.sh.coefficients[B],D);A++}else if(L.isDirectionalLight){const B=e.get(L);if(B.color.copy(L.color).multiplyScalar(L.intensity),L.castShadow){const z=L.shadow,I=n.get(L);I.shadowIntensity=z.intensity,I.shadowBias=z.bias,I.shadowNormalBias=z.normalBias,I.shadowRadius=z.radius,I.shadowMapSize=z.mapSize,i.directionalShadow[m]=I,i.directionalShadowMap[m]=k,i.directionalShadowMatrix[m]=L.shadow.matrix,v++}i.directional[m]=B,m++}else if(L.isSpotLight){const B=e.get(L);B.position.setFromMatrixPosition(L.matrixWorld),B.color.copy(R).multiplyScalar(D),B.distance=F,B.coneCos=Math.cos(L.angle),B.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),B.decay=L.decay,i.spot[y]=B;const z=L.shadow;if(L.map&&(i.spotLightMap[E]=L.map,E++,z.updateMatrices(L),L.castShadow&&w++),i.spotLightMatrix[y]=z.matrix,L.castShadow){const I=n.get(L);I.shadowIntensity=z.intensity,I.shadowBias=z.bias,I.shadowNormalBias=z.normalBias,I.shadowRadius=z.radius,I.shadowMapSize=z.mapSize,i.spotShadow[y]=I,i.spotShadowMap[y]=k,M++}y++}else if(L.isRectAreaLight){const B=e.get(L);B.color.copy(R).multiplyScalar(D),B.halfWidth.set(L.width*.5,0,0),B.halfHeight.set(0,L.height*.5,0),i.rectArea[g]=B,g++}else if(L.isPointLight){const B=e.get(L);if(B.color.copy(L.color).multiplyScalar(L.intensity),B.distance=L.distance,B.decay=L.decay,L.castShadow){const z=L.shadow,I=n.get(L);I.shadowIntensity=z.intensity,I.shadowBias=z.bias,I.shadowNormalBias=z.normalBias,I.shadowRadius=z.radius,I.shadowMapSize=z.mapSize,I.shadowCameraNear=z.camera.near,I.shadowCameraFar=z.camera.far,i.pointShadow[x]=I,i.pointShadowMap[x]=k,i.pointShadowMatrix[x]=L.shadow.matrix,b++}i.point[x]=B,x++}else if(L.isHemisphereLight){const B=e.get(L);B.skyColor.copy(L.color).multiplyScalar(D),B.groundColor.copy(L.groundColor).multiplyScalar(D),i.hemi[d]=B,d++}}g>0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=_e.LTC_FLOAT_1,i.rectAreaLTC2=_e.LTC_FLOAT_2):(i.rectAreaLTC1=_e.LTC_HALF_1,i.rectAreaLTC2=_e.LTC_HALF_2)),i.ambient[0]=f,i.ambient[1]=p,i.ambient[2]=h;const _=i.hash;(_.directionalLength!==m||_.pointLength!==x||_.spotLength!==y||_.rectAreaLength!==g||_.hemiLength!==d||_.numDirectionalShadows!==v||_.numPointShadows!==b||_.numSpotShadows!==M||_.numSpotMaps!==E||_.numLightProbes!==A)&&(i.directional.length=m,i.spot.length=y,i.rectArea.length=g,i.point.length=x,i.hemi.length=d,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=M+E-w,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=w,i.numLightProbes=A,_.directionalLength=m,_.pointLength=x,_.spotLength=y,_.rectAreaLength=g,_.hemiLength=d,_.numDirectionalShadows=v,_.numPointShadows=b,_.numSpotShadows=M,_.numSpotMaps=E,_.numLightProbes=A,i.version=FA++)}function l(u,f){let p=0,h=0,m=0,x=0,y=0;const g=f.matrixWorldInverse;for(let d=0,v=u.length;d<v;d++){const b=u[d];if(b.isDirectionalLight){const M=i.directional[p];M.direction.setFromMatrixPosition(b.matrixWorld),r.setFromMatrixPosition(b.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(g),p++}else if(b.isSpotLight){const M=i.spot[m];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),M.direction.setFromMatrixPosition(b.matrixWorld),r.setFromMatrixPosition(b.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(g),m++}else if(b.isRectAreaLight){const M=i.rectArea[x];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),a.identity(),s.copy(b.matrixWorld),s.premultiply(g),a.extractRotation(s),M.halfWidth.set(b.width*.5,0,0),M.halfHeight.set(0,b.height*.5,0),M.halfWidth.applyMatrix4(a),M.halfHeight.applyMatrix4(a),x++}else if(b.isPointLight){const M=i.point[h];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),h++}else if(b.isHemisphereLight){const M=i.hemi[y];M.direction.setFromMatrixPosition(b.matrixWorld),M.direction.transformDirection(g),y++}}}return{setup:o,setupView:l,state:i}}function i0(t){const e=new zA(t),n=[],i=[],r=[];function s(h){p.camera=h,n.length=0,i.length=0,r.length=0}function a(h){n.push(h)}function o(h){i.push(h)}function l(h){r.push(h)}function u(){e.setup(n)}function f(h){e.setupView(n,h)}const p={lightsArray:n,shadowsArray:i,lightProbeGridArray:r,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:s,state:p,setupLights:u,setupLightsView:f,pushLight:a,pushShadow:o,pushLightProbeGrid:l}}function jA(t){let e=new WeakMap;function n(r,s=0){const a=e.get(r);let o;return a===void 0?(o=new i0(t),e.set(r,[o])):s>=a.length?(o=new i0(t),a.push(o)):o=a[s],o}
vendor: 4,127 bytes, lines 4104-4131
4104function i(){e=new WeakMap}return{get:n,dispose:i}}const BA=`void main() { 4105 gl_Position = vec4( position, 1.0 ); 4106}`,GA=`uniform sampler2D shadow_pass; 4107uniform vec2 resolution; 4108uniform float radius; 4109void main() { 4110 const float samples = float( VSM_SAMPLES ); 4111 float mean = 0.0; 4112 float squared_mean = 0.0; 4113 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 4114 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 4115 for ( float i = 0.0; i < samples; i ++ ) { 4116 float uvOffset = uvStart + i * uvStride; 4117 #ifdef HORIZONTAL_PASS 4118 vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; 4119 mean += distribution.x; 4120 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 4121 #else 4122 float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; 4123 mean += depth; 4124 squared_mean += depth * depth; 4125 #endif 4126 } 4127 mean = mean / samples; 4128 squared_mean = squared_mean / samples; 4129 float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); 4130 gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); 4131}`,HA=[new H(1,0,0),new H(-1,0,0),new H(0,1,0),new H(0,-1,0),new H(0,0,1),new H(0,0,-1)],VA=[new H(0,-1,0),new H(0,-1,0),new H(0,0,1),new H(0,0,-1),new H(0,-1,0),new H(0,-1,0)],r0=new Ft,za=new H,pd=new H;function WA(t,e,n){let i=new wp;const r=new De,s=new De,a=new Nt,o=new ew,l=new tw,u={},f=n.maxTextureSize,p={[Dr]:Dn,[Dn]:Dr,[di]:di},h=new Li({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new De},radius:{value:4}},vertexShader:BA,fragmentShader:GA}),m=h.clone();m.defines.HORIZONTAL_PASS=1;const x=new ni;x.setAttribute("position",new Ni(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new _n(x,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Kl;let d=this.type;this.render=function(w,A,_){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||w.length===0)return;this.type===HE&&(He("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Kl);const T=t.getRenderTarget(),N=t.getActiveCubeFace(),L=t.getActiveMipmapLevel(),R=t.state;R.setBlending($i),R.buffers.depth.getReversed()===!0?R.buffers.color.setClear(0,0,0,0):R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);const D=d!==this.type;D&&A.traverse(function(F){F.material&&(Array.isArray(F.material)?F.material.forEach(k=>k.needsUpdate=!0):F.material.needsUpdate=!0)});for(let F=0,k=w.length;F<k;F++){const B=w[F],z=B.shadow;if(z===void 0){He("WebGLShadowMap:",B,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;r.copy(z.mapSize);const I=z.getFrameExtents();r.multiply(I),s.copy(z.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/I.x),r.x=s.x*I.x,z.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/I.y),r.y=s.y*I.y,z.mapSize.y=s.y));const V=t.state.buffers.depth.getReversed();if(z.camera._reversedDepth=V,z.map===null||D===!0){if(z.map!==null&&(z.map.depthTexture!==null&&(z.map.depthTexture.dispose(),z.map.depthTexture=null),z.map.dispose()),this.type===$a){if(B.isPointLight){He("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}z.map=new ki(r.x,r.y,{format:ds,type:Qi,minFilter:pn,magFilter:pn,generateMipmaps:!1}),z.map.texture.name=B.name+".shadowMap",z.map.depthTexture=new ga(r.x,r.y,Ti),z.map.depthTexture.name=B.name+".shadowMapDepth",z.map.depthTexture.format=er,z.map.depthTexture.compareFunction=null,z.map.depthTexture.minFilter=tn,z.map.depthTexture.magFilter=tn}else B.isPointLight?(z.map=new T_(r.x),z.map.depthTexture=new Yb(r.x,Di)):(z.map=new ki(r.x,r.y),z.map.depthTexture=new ga(r.x,r.y,Di)),z.map.depthTexture.name=B.name+".shadowMap",z.map.depthTexture.format=er,this.type===Kl?(z.map.depthTexture.compareFunction=V?Mp:Sp,z.map.depthTexture.minFilter=pn,z.map.depthTexture.magFilter=pn):(z.map.depthTexture.compareFunction=null,z.map.depthTexture.minFilter=tn,z.map.depthTexture.magFilter=tn);z.camera.updateProjectionMatrix()}const Q=z.map.isWebGLCubeRenderTarget?6:1;for(let re=0;re<Q;
vendor: 7,946 bytes, line 4131
4131re++){if(z.map.isWebGLCubeRenderTarget)t.setRenderTarget(z.map,re),t.clear();else{re===0&&(t.setRenderTarget(z.map),t.clear());const ae=z.getViewport(re);a.set(s.x*ae.x,s.y*ae.y,s.x*ae.z,s.y*ae.w),R.viewport(a)}if(B.isPointLight){const ae=z.camera,Fe=z.matrix,je=B.distance||ae.far;je!==ae.far&&(ae.far=je,ae.updateProjectionMatrix()),za.setFromMatrixPosition(B.matrixWorld),ae.position.copy(za),pd.copy(ae.position),pd.add(HA[re]),ae.up.copy(VA[re]),ae.lookAt(pd),ae.updateMatrixWorld(),Fe.makeTranslation(-za.x,-za.y,-za.z),r0.multiplyMatrices(ae.projectionMatrix,ae.matrixWorldInverse),z._frustum.setFromProjectionMatrix(r0,ae.coordinateSystem,ae.reversedDepth)}else z.updateMatrices(B);i=z.getFrustum(),M(A,_,z.camera,B,this.type)}z.isPointLightShadow!==!0&&this.type===$a&&v(z,_),z.needsUpdate=!1}d=this.type,g.needsUpdate=!1,t.setRenderTarget(T,N,L)};function v(w,A){const _=e.update(y);h.defines.VSM_SAMPLES!==w.blurSamples&&(h.defines.VSM_SAMPLES=w.blurSamples,m.defines.VSM_SAMPLES=w.blurSamples,h.needsUpdate=!0,m.needsUpdate=!0),w.mapPass===null&&(w.mapPass=new ki(r.x,r.y,{format:ds,type:Qi})),h.uniforms.shadow_pass.value=w.map.depthTexture,h.uniforms.resolution.value=w.mapSize,h.uniforms.radius.value=w.radius,t.setRenderTarget(w.mapPass),t.clear(),t.renderBufferDirect(A,null,_,h,y,null),m.uniforms.shadow_pass.value=w.mapPass.texture,m.uniforms.resolution.value=w.mapSize,m.uniforms.radius.value=w.radius,t.setRenderTarget(w.map),t.clear(),t.renderBufferDirect(A,null,_,m,y,null)}function b(w,A,_,T){let N=null;const L=_.isPointLight===!0?w.customDistanceMaterial:w.customDepthMaterial;if(L!==void 0)N=L;else if(N=_.isPointLight===!0?l:o,t.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0||A.alphaToCoverage===!0){const R=N.uuid,D=A.uuid;let F=u[R];F===void 0&&(F={},u[R]=F);let k=F[D];k===void 0&&(k=N.clone(),F[D]=k,A.addEventListener("dispose",E)),N=k}if(N.visible=A.visible,N.wireframe=A.wireframe,T===$a?N.side=A.shadowSide!==null?A.shadowSide:A.side:N.side=A.shadowSide!==null?A.shadowSide:p[A.side],N.alphaMap=A.alphaMap,N.alphaTest=A.alphaToCoverage===!0?.5:A.alphaTest,N.map=A.map,N.clipShadows=A.clipShadows,N.clippingPlanes=A.clippingPlanes,N.clipIntersection=A.clipIntersection,N.displacementMap=A.displacementMap,N.displacementScale=A.displacementScale,N.displacementBias=A.displacementBias,N.wireframeLinewidth=A.wireframeLinewidth,N.linewidth=A.linewidth,_.isPointLight===!0&&N.isMeshDistanceMaterial===!0){const R=t.properties.get(N);R.light=_}return N}function M(w,A,_,T,N){if(w.visible===!1)return;if(w.layers.test(A.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&N===$a)&&(!w.frustumCulled||i.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,w.matrixWorld);const D=e.update(w),F=w.material;if(Array.isArray(F)){const k=D.groups;for(let B=0,z=k.length;B<z;B++){const I=k[B],V=F[I.materialIndex];if(V&&V.visible){const Q=b(w,V,T,N);w.onBeforeShadow(t,w,A,_,D,Q,I),t.renderBufferDirect(_,null,D,Q,w,I),w.onAfterShadow(t,w,A,_,D,Q,I)}}}else if(F.visible){const k=b(w,F,T,N);w.onBeforeShadow(t,w,A,_,D,k,null),t.renderBufferDirect(_,null,D,k,w,null),w.onAfterShadow(t,w,A,_,D,k,null)}}const R=w.children;for(let D=0,F=R.length;D<F;D++)M(R[D],A,_,T,N)}function E(w){w.target.removeEventListener("dispose",E);for(const _ in u){const T=u[_],N=w.target.uuid;N in T&&(T[N].dispose(),delete T[N])}}}function XA(t,e){function n(){let U=!1;const pe=new Nt;let ie=null;const ge=new Nt(0,0,0,0);return{setMask:function(ye){ie!==ye&&!U&&(t.colorMask(ye,ye,ye,ye),ie=ye)},setLocked:function(ye){U=ye},setClear:function(ye,se,Re,be,xt){xt===!0&&(ye*=be,se*=be,Re*=be),pe.set(ye,se,Re,be),ge.equals(pe)===!1&&(t.clearColor(ye,se,Re,be),ge.copy(pe))},reset:function(){U=!1,ie=null,ge.set(-1,0,0,0)}}}function i(){let U=!1,pe=!1,ie=null,ge=null,ye=null;return{setReversed:function(se){if(pe!==se){const Re=e.get("EXT_clip_control");se?Re.clipControlEXT(Re.LOWER_LEFT_EXT,Re.ZERO_TO_ONE_EXT):Re.clipControlEXT(Re.LOWER_LEFT_EXT,Re.NEGATIVE_ONE_TO_ONE_EXT),pe=se;const be=ye;ye=null,this.setClear(be)}},getReversed:function(){return pe},setTest:function(se){se?oe(t.DEPTH_TEST):Be(t.DEPTH_TEST)},setMask:function(se){ie!==se&&!U&&(t.depthMask(se),ie=se)},setFunc:function(se){if(pe&&(se=Mb[se]),ge!==se){switch(se){case Sf:t.depthFunc(t.NEVER);break;case Mf:t.depthFunc(t.ALWAYS);break;case Ef:t.depthFunc(t.LESS);break;case pa:t.depthFunc(t.LEQUAL);break;case bf:t.depthFunc(t.EQUAL);break;case wf:t.depthFunc(t.GEQUAL);break;case Tf:t.depthFunc(t.GREATER);break;case Cf:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}ge=se}},setLocked:function(se){U=se},setClear:function(se){ye!==se&&(ye=se,pe&&(se=1-se),t.clearDepth(se))},reset:function(){U=!1,ie=null,ge=null,ye=null,pe=!1}}}function r(){let U=!1,pe=null,ie=null,ge=null,ye=null,se=null,Re=null,be=null,xt=null;return{setTest:function(mt){U||(mt?oe(t.STENCIL_TEST):Be(t.STENCIL_TEST))},setMask:function(mt){pe!==mt&&!U&&(t.stencilMask(mt),pe=mt)},setFunc:function(mt,Xn,Ln){(ie!==mt||ge!==Xn||ye!==Ln)&&(t.stencilFunc(mt,Xn,Ln),ie=mt,ge=Xn,ye=Ln)},setOp:function(mt,Xn,Ln){(se!==mt||Re!==Xn||be!==Ln)&&(t.stencilOp(mt,Xn,Ln),se=mt,Re=Xn,be=Ln)},setLocked:function(mt){U=mt},setClear:function(mt){xt!==mt&&(t.clearStencil(mt),xt=mt)},reset:function(){U=!1,pe=null,ie=null,ge=null,ye=null,se=null,Re=null,be=null,xt=null}}}const s=new n,a=new i,o=new r,l=new WeakMap,u=new WeakMap;let f={},p={},h={},m=new WeakMap,x=[],y=null,g=!1,d=null,v=null,b=null,M=null,E=null,w=null,A=null,_=new st(0,0,0),T=0,N=!1,L=null,R=null,D=null,F=null,k=null;const B=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let z=!1,I=0;const V=t.getParameter(t.VERSION);V.indexOf("WebGL")!==-1?(I=parseFloat(/^WebGL (\d)/.exec(V)[1]),z=I>=1):V.indexOf("OpenGL ES")!==-1&&(I=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),z=I>=2);let Q=null,re={};const ae=t.getParameter(t.SCISSOR_BOX),Fe=t.getParameter(t.VIEWPORT),je=new Nt().fromArray(ae),Oe=new Nt().fromArray(Fe);function ee(U,pe,ie,ge){const ye=new Uint8Array(4),se=t.createTexture();t.bindTexture(U,se),t.texParameteri(U,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(U,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Re=0;Re<ie;Re++)U===t.TEXTURE_3D||U===t.TEXTURE_2D_ARRAY?t.texImage3D(pe,0,t.RGBA,1,1,ge,0,t.RGBA,t.UNSIGNED_BYTE,ye):t.texImage2D(pe+Re,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,ye);return se}const ue={};ue[t.TEXTURE_2D]=ee(t.TEXTURE_2D,t.TEXTURE_2D,1),ue[t.TEXTURE_CUBE_MAP]=ee(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),ue[t.TEXTURE_2D_ARRAY]=ee(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),ue[t.TEXTURE_3D]=ee(t.TEXTURE_3D,t.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),oe(t.DEPTH_TEST),a.setFunc(pa),St(!1),ve(rg),oe(t.CULL_FACE),Xe($i);function oe(U){f[U]!==!0&&(t.enable(U),f[U]=!0)}function Be(U){f[U]!==!1&&(t.disable(U),f[U]=!1)}function $e(U,pe){return h[U]!==pe?(t.bindFramebuffer(U,pe),h[U]=pe,U===t.DRAW_FRAMEBUFFER&&(h[t.FRAMEBUFFER]=pe),U===t.FRAMEBUFFER&&(h[t.DRAW_FRAMEBUFFER]=pe),!0):!1}function Pe(U,pe){let ie=x,ge=!1;if(U){ie=m.get(pe),ie===void 0&&(ie=[],m.set(pe,ie));const ye=U.textures;if(ie.length!==ye.length||ie[0]!==t.COLOR_ATTACHMENT0){for(let se=0,Re=ye.length;se<Re;se++)ie[se]=t.COLOR_ATTACHMENT0+se;ie.length=ye.length,ge=!0}}else ie[0]!==t.BACK&&(ie[0]=t.BACK,ge=!0);ge&&t.drawBuffers(ie)}function wt(U){return y!==U?(t.useProgram(U),y=U,!0):!1}const Qe={[Yr]:t.FUNC_ADD,[WE]:t.FUNC_SUBTRACT,[XE]:t.FUNC_REVERSE_SUBTRACT};Qe[$E]=t.MIN,Qe[YE]=t.MAX;const ut={[KE]:t.ZERO,[qE]:t.ONE,[ZE]:t.SRC_COLOR,[_f]:t.SRC_ALPHA,[ib]:t.SRC_ALPHA_SATURATE,[tb]:t.DST_COLOR,[QE]:t.DST_ALPHA,[JE]:t.ONE_MINUS_SRC_COLOR,[yf]:t.ONE_MINUS_SRC_ALPHA,[nb]:t.ONE_MINUS_DST_COLOR,[eb]:t.ONE_MINUS_DST_ALPHA,[rb]:t.CONSTANT_COLOR,[sb]:t.ONE_MINUS_CONSTANT_COLOR,[ab]:t.CONSTANT_ALPHA,[ob]:t.O
vendor: 11,399 bytes, line 4131
4131NE_MINUS_CONSTANT_ALPHA};function Xe(U,pe,ie,ge,ye,se,Re,be,xt,mt){if(U===$i){g===!0&&(Be(t.BLEND),g=!1);return}if(g===!1&&(oe(t.BLEND),g=!0),U!==VE){if(U!==d||mt!==N){if((v!==Yr||E!==Yr)&&(t.blendEquation(t.FUNC_ADD),v=Yr,E=Yr),mt)switch(U){case ra:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case sg:t.blendFunc(t.ONE,t.ONE);break;case ag:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case og:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:ot("WebGLState: Invalid blending: ",U);break}else switch(U){case ra:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case sg:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case ag:ot("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case og:ot("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:ot("WebGLState: Invalid blending: ",U);break}b=null,M=null,w=null,A=null,_.set(0,0,0),T=0,d=U,N=mt}return}ye=ye||pe,se=se||ie,Re=Re||ge,(pe!==v||ye!==E)&&(t.blendEquationSeparate(Qe[pe],Qe[ye]),v=pe,E=ye),(ie!==b||ge!==M||se!==w||Re!==A)&&(t.blendFuncSeparate(ut[ie],ut[ge],ut[se],ut[Re]),b=ie,M=ge,w=se,A=Re),(be.equals(_)===!1||xt!==T)&&(t.blendColor(be.r,be.g,be.b,xt),_.copy(be),T=xt),d=U,N=!1}function tt(U,pe){U.side===di?Be(t.CULL_FACE):oe(t.CULL_FACE);let ie=U.side===Dn;pe&&(ie=!ie),St(ie),U.blending===ra&&U.transparent===!1?Xe($i):Xe(U.blending,U.blendEquation,U.blendSrc,U.blendDst,U.blendEquationAlpha,U.blendSrcAlpha,U.blendDstAlpha,U.blendColor,U.blendAlpha,U.premultipliedAlpha),a.setFunc(U.depthFunc),a.setTest(U.depthTest),a.setMask(U.depthWrite),s.setMask(U.colorWrite);const ge=U.stencilWrite;o.setTest(ge),ge&&(o.setMask(U.stencilWriteMask),o.setFunc(U.stencilFunc,U.stencilRef,U.stencilFuncMask),o.setOp(U.stencilFail,U.stencilZFail,U.stencilZPass)),Gt(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),U.alphaToCoverage===!0?oe(t.SAMPLE_ALPHA_TO_COVERAGE):Be(t.SAMPLE_ALPHA_TO_COVERAGE)}function St(U){L!==U&&(U?t.frontFace(t.CW):t.frontFace(t.CCW),L=U)}function ve(U){U!==BE?(oe(t.CULL_FACE),U!==R&&(U===rg?t.cullFace(t.BACK):U===GE?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):Be(t.CULL_FACE),R=U}function At(U){U!==D&&(z&&t.lineWidth(U),D=U)}function Gt(U,pe,ie){U?(oe(t.POLYGON_OFFSET_FILL),(F!==pe||k!==ie)&&(F=pe,k=ie,a.getReversed()&&(pe=-pe),t.polygonOffset(pe,ie))):Be(t.POLYGON_OFFSET_FILL)}function Mt(U){U?oe(t.SCISSOR_TEST):Be(t.SCISSOR_TEST)}function pt(U){U===void 0&&(U=t.TEXTURE0+B-1),Q!==U&&(t.activeTexture(U),Q=U)}function O(U,pe,ie){ie===void 0&&(Q===null?ie=t.TEXTURE0+B-1:ie=Q);let ge=re[ie];ge===void 0&&(ge={type:void 0,texture:void 0},re[ie]=ge),(ge.type!==U||ge.texture!==pe)&&(Q!==ie&&(t.activeTexture(ie),Q=ie),t.bindTexture(U,pe||ue[U]),ge.type=U,ge.texture=pe)}function on(){const U=re[Q];U!==void 0&&U.type!==void 0&&(t.bindTexture(U.type,null),U.type=void 0,U.texture=void 0)}function ct(){try{t.compressedTexImage2D(...arguments)}catch(U){ot("WebGLState:",U)}}function P(){try{t.compressedTexImage3D(...arguments)}catch(U){ot("WebGLState:",U)}}function S(){try{t.texSubImage2D(...arguments)}catch(U){ot("WebGLState:",U)}}function G(){try{t.texSubImage3D(...arguments)}catch(U){ot("WebGLState:",U)}}function $(){try{t.compressedTexSubImage2D(...arguments)}catch(U){ot("WebGLState:",U)}}function Z(){try{t.compressedTexSubImage3D(...arguments)}catch(U){ot("WebGLState:",U)}}function ce(){try{t.texStorage2D(...arguments)}catch(U){ot("WebGLState:",U)}}function fe(){try{t.texStorage3D(...arguments)}catch(U){ot("WebGLState:",U)}}function J(){try{t.texImage2D(...arguments)}catch(U){ot("WebGLState:",U)}}function te(){try{t.texImage3D(...arguments)}catch(U){ot("WebGLState:",U)}}function he(U){return p[U]!==void 0?p[U]:t.getParameter(U)}function Ae(U,pe){p[U]!==pe&&(t.pixelStorei(U,pe),p[U]=pe)}function xe(U){je.equals(U)===!1&&(t.scissor(U.x,U.y,U.z,U.w),je.copy(U))}function me(U){Oe.equals(U)===!1&&(t.viewport(U.x,U.y,U.z,U.w),Oe.copy(U))}function Le(U,pe){let ie=u.get(pe);ie===void 0&&(ie=new WeakMap,u.set(pe,ie));let ge=ie.get(U);ge===void 0&&(ge=t.getUniformBlockIndex(pe,U.name),ie.set(U,ge))}function ze(U,pe){const ge=u.get(pe).get(U);l.get(pe)!==ge&&(t.uniformBlockBinding(pe,ge,U.__bindingPointIndex),l.set(pe,ge))}function We(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),a.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),t.pixelStorei(t.PACK_ALIGNMENT,4),t.pixelStorei(t.UNPACK_ALIGNMENT,4),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.BROWSER_DEFAULT_WEBGL),t.pixelStorei(t.PACK_ROW_LENGTH,0),t.pixelStorei(t.PACK_SKIP_PIXELS,0),t.pixelStorei(t.PACK_SKIP_ROWS,0),t.pixelStorei(t.UNPACK_ROW_LENGTH,0),t.pixelStorei(t.UNPACK_IMAGE_HEIGHT,0),t.pixelStorei(t.UNPACK_SKIP_PIXELS,0),t.pixelStorei(t.UNPACK_SKIP_ROWS,0),t.pixelStorei(t.UNPACK_SKIP_IMAGES,0),f={},p={},Q=null,re={},h={},m=new WeakMap,x=[],y=null,g=!1,d=null,v=null,b=null,M=null,E=null,w=null,A=null,_=new st(0,0,0),T=0,N=!1,L=null,R=null,D=null,F=null,k=null,je.set(0,0,t.canvas.width,t.canvas.height),Oe.set(0,0,t.canvas.width,t.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:oe,disable:Be,bindFramebuffer:$e,drawBuffers:Pe,useProgram:wt,setBlending:Xe,setMaterial:tt,setFlipSided:St,setCullFace:ve,setLineWidth:At,setPolygonOffset:Gt,setScissorTest:Mt,activeTexture:pt,bindTexture:O,unbindTexture:on,compressedTexImage2D:ct,compressedTexImage3D:P,texImage2D:J,texImage3D:te,pixelStorei:Ae,getParameter:he,updateUBOMapping:Le,uniformBlockBinding:ze,texStorage2D:ce,texStorage3D:fe,texSubImage2D:S,texSubImage3D:G,compressedTexSubImage2D:$,compressedTexSubImage3D:Z,scissor:xe,viewport:me,reset:We}}function $A(t,e,n,i,r,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new De,f=new WeakMap,p=new Set;let h;const m=new WeakMap;let x=!1;try{x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(P,S){return x?new OffscreenCanvas(P,S):Ic("canvas")}function g(P,S,G){let $=1;const Z=ct(P);if((Z.width>G||Z.height>G)&&($=G/Math.max(Z.width,Z.height)),$<1)if(typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&P instanceof ImageBitmap||typeof VideoFrame<"u"&&P instanceof VideoFrame){const ce=Math.floor($*Z.width),fe=Math.floor($*Z.height);h===void 0&&(h=y(ce,fe));const J=S?y(ce,fe):h;return J.width=ce,J.height=fe,J.getContext("2d").drawImage(P,0,0,ce,fe),He("WebGLRenderer: Texture has been resized from ("+Z.width+"x"+Z.height+") to ("+ce+"x"+fe+")."),J}else return"data"in P&&He("WebGLRenderer: Image in DataTexture is too big ("+Z.width+"x"+Z.height+")."),P;return P}function d(P){return P.generateMipmaps}function v(P){t.generateMipmap(P)}function b(P){return P.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:P.isWebGL3DRenderTarget?t.TEXTURE_3D:P.isWebGLArrayRenderTarget||P.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function M(P,S,G,$,Z,ce=!1){if(P!==null){if(t[P]!==void 0)return t[P];He("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+P+"'")}let fe;$&&(fe=e.get("EXT_texture_norm16"),fe||He("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let J=S;if(S===t.RED&&(G===t.FLOAT&&(J=t.R32F),G===t.HALF_FLOAT&&(J=t.R16F),G===t.UNSIGNED_BYTE&&(J=t.R8),G===t.UNSIGNED_SHORT&&fe&&(J=fe.R16_EXT),G===t.SHORT&&fe&&(J=fe.R16_SNORM_EXT)),S===t.RED_INTEGER&&(G===t.UNSIGNED_BYTE&&(J=t.R8UI),G===t.UNSIGNED_SHORT&&(J=t.R16UI),G===t.UNSIGNED_INT&&(J=t.R32UI),G===t.BYTE&&(J=t.R8I),G===t.SHORT&&(J=t.R16I),G===t.INT&&(J=t.R32I)),S===t.RG&&(G===t.FLOAT&&(J=t.RG32F),G===t.HALF_FLOAT&&(J=t.RG16F),G===t.UNSIGNED_BYTE&&(J=t.RG8),G===t.UNSIGNED_SHORT&&fe&&(J=fe.RG16_EXT),G===t.SHORT&&fe&&(J=fe.RG16_SNORM_EXT)),S===t.RG_INTEGER&&(G===t.UNSIGNED_BYTE&&(J=t.RG8UI),G===t.UNSIGNED_SHORT&&(J=t.RG16UI),G===t.UNSIGNED_INT&&(J=t.RG32UI),G===t.BYTE&&(J=t.RG8I),G===t.SHORT&&(J=t.RG16I),G===t.INT&&(J=t.RG32I)),S===t.RGB_INTEGER&&(G===t.UNSIGNED_BYTE&&(J=t.RGB8UI),G===t.UNSIGNED_SHORT&&(J=t.RGB16UI),G===t.UNSIGNED_INT&&(J=t.RGB32UI),G===t.BYTE&&(J=t.RGB8I),G===t.SHORT&&(J=t.RGB16I),G===t.INT&&(J=t.RGB32I)),S===t.RGBA_INTEGER&&(G===t.UNSIGNED_BYTE&&(J=t.RGBA8UI),G===t.UNSIGNED_SHORT&&(J=t.RGBA16UI),G===t.UNSIGNED_INT&&(J=t.RGBA32UI),G===t.BYTE&&(J=t.RGBA8I),G===t.SHORT&&(J=t.RGBA16I),G===t.INT&&(J=t.RGBA32I)),S===t.RGB&&(G===t.UNSIGNED_SHORT&&fe&&(J=fe.RGB16_EXT),G===t.SHORT&&fe&&(J=fe.RGB16_SNORM_EXT),G===t.UNSIGNED_INT_5_9_9_9_REV&&(J=t.RGB9_E5),G===t.UNSIGNED_INT_10F_11F_11F_REV&&(J=t.R11F_G11F_B10F)),S===t.RGBA){const te=ce?Lc:rt.getTransfer(Z);G===t.FLOAT&&(J=t.RGBA32F),G===t.HALF_FLOAT&&(J=t.RGBA16F),G===t.UNSIGNED_BYTE&&(J=te===ft?t.SRGB8_ALPHA8:t.RGBA8),G===t.UNSIGNED_SHORT&&fe&&(J=fe.RGBA16_EXT),G===t.SHORT&&fe&&(J=fe.RGBA16_SNORM_EXT),G===t.UNSIGNED_SHORT_4_4_4_4&&(J=t.RGBA4),G===t.UNSIGNED_SHORT_5_5_5_1&&(J=t.RGB5_A1)}return(J===t.R16F||J===t.R32F||J===t.RG16F||J===t.RG32F||J===t.RGBA16F||J===t.RGBA32F)&&e.get("EXT_color_buffer_float"),J}function E(P,S){let G;return P?S===null||S===Di||S===ko?G=t.DEPTH24_STENCIL8:S===Ti?G=t.DEPTH32F_STENCIL8:S===Po&&(G=t.DEPTH24_STENCIL8,He("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):S===null||S===Di||S===ko?G=t.DEPTH_COMPONENT24:S===Ti?G=t.DEPTH_COMPONENT32F:S===Po&&(G=t.DEPTH_COMPONENT16),G}function w(P,S){return d(P)===!0||P.isFramebufferTexture&&P.minFilter!==tn&&P.minFilter!==pn?Math.log2(Math.max(S.width,S.height))+1:P.mipmaps!==void 0&&P.mipmaps.length>0?P.mipmaps.length:P.isCompressedTexture&&Array.isArray(P.image)?S.mipmaps.length:1}function A(P){const S=P.target;S.removeEventListener("dispose",A),T(S),S.isVideoTexture&&f.delete(S),S.isHTMLTexture&&p.delete(S)}function _(P){const S=P.target;S.removeEventListener("dispose",_),L(S)}function T(P){const S=i.get(P);if(S.__webglInit===void 0)return;const G=P.source,$=m.get(G);if($){const Z=$[S.__cacheKey];Z.usedTimes--,Z.usedTimes===0&&N(P),Object.keys($).length===0&&m.delete(G)}i.remove(P)}function N(P){const S=i.get(P);t.deleteTexture(S.__webglTexture);const G=P.source,$=m.get(G);delete $[S.__cacheKey],a.memory.textures--}function L(P){const S=i.get(P);if(P.depthTexture&&(P.depthTexture.dispose(),i.remove(P.depthTexture)),P.isWebGLCubeRen
vendor: 6,254 bytes, line 4131
4131derTarget)for(let $=0;$<6;$++){if(Array.isArray(S.__webglFramebuffer[$]))for(let Z=0;Z<S.__webglFramebuffer[$].length;Z++)t.deleteFramebuffer(S.__webglFramebuffer[$][Z]);else t.deleteFramebuffer(S.__webglFramebuffer[$]);S.__webglDepthbuffer&&t.deleteRenderbuffer(S.__webglDepthbuffer[$])}else{if(Array.isArray(S.__webglFramebuffer))for(let $=0;$<S.__webglFramebuffer.length;$++)t.deleteFramebuffer(S.__webglFramebuffer[$]);else t.deleteFramebuffer(S.__webglFramebuffer);if(S.__webglDepthbuffer&&t.deleteRenderbuffer(S.__webglDepthbuffer),S.__webglMultisampledFramebuffer&&t.deleteFramebuffer(S.__webglMultisampledFramebuffer),S.__webglColorRenderbuffer)for(let $=0;$<S.__webglColorRenderbuffer.length;$++)S.__webglColorRenderbuffer[$]&&t.deleteRenderbuffer(S.__webglColorRenderbuffer[$]);S.__webglDepthRenderbuffer&&t.deleteRenderbuffer(S.__webglDepthRenderbuffer)}const G=P.textures;for(let $=0,Z=G.length;$<Z;$++){const ce=i.get(G[$]);ce.__webglTexture&&(t.deleteTexture(ce.__webglTexture),a.memory.textures--),i.remove(G[$])}i.remove(P)}let R=0;function D(){R=0}function F(){return R}function k(P){R=P}function B(){const P=R;return P>=r.maxTextures&&He("WebGLTextures: Trying to use "+P+" texture units while this GPU supports only "+r.maxTextures),R+=1,P}function z(P){const S=[];return S.push(P.wrapS),S.push(P.wrapT),S.push(P.wrapR||0),S.push(P.magFilter),S.push(P.minFilter),S.push(P.anisotropy),S.push(P.internalFormat),S.push(P.format),S.push(P.type),S.push(P.generateMipmaps),S.push(P.premultiplyAlpha),S.push(P.flipY),S.push(P.unpackAlignment),S.push(P.colorSpace),S.join()}function I(P,S){const G=i.get(P);if(P.isVideoTexture&&O(P),P.isRenderTargetTexture===!1&&P.isExternalTexture!==!0&&P.version>0&&G.__version!==P.version){const $=P.image;if($===null)He("WebGLRenderer: Texture marked for update but no image data found.");else if($.complete===!1)He("WebGLRenderer: Texture marked for update but image is incomplete");else{Be(G,P,S);return}}else P.isExternalTexture&&(G.__webglTexture=P.sourceTexture?P.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,G.__webglTexture,t.TEXTURE0+S)}function V(P,S){const G=i.get(P);if(P.isRenderTargetTexture===!1&&P.version>0&&G.__version!==P.version){Be(G,P,S);return}else P.isExternalTexture&&(G.__webglTexture=P.sourceTexture?P.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,G.__webglTexture,t.TEXTURE0+S)}function Q(P,S){const G=i.get(P);if(P.isRenderTargetTexture===!1&&P.version>0&&G.__version!==P.version){Be(G,P,S);return}n.bindTexture(t.TEXTURE_3D,G.__webglTexture,t.TEXTURE0+S)}function re(P,S){const G=i.get(P);if(P.isCubeDepthTexture!==!0&&P.version>0&&G.__version!==P.version){$e(G,P,S);return}n.bindTexture(t.TEXTURE_CUBE_MAP,G.__webglTexture,t.TEXTURE0+S)}const ae={[Af]:t.REPEAT,[Wi]:t.CLAMP_TO_EDGE,[Rf]:t.MIRRORED_REPEAT},Fe={[tn]:t.NEAREST,[ub]:t.NEAREST_MIPMAP_NEAREST,[cl]:t.NEAREST_MIPMAP_LINEAR,[pn]:t.LINEAR,[Ou]:t.LINEAR_MIPMAP_NEAREST,[Qr]:t.LINEAR_MIPMAP_LINEAR},je={[hb]:t.NEVER,[xb]:t.ALWAYS,[pb]:t.LESS,[Sp]:t.LEQUAL,[mb]:t.EQUAL,[Mp]:t.GEQUAL,[gb]:t.GREATER,[vb]:t.NOTEQUAL};function Oe(P,S){if(S.type===Ti&&e.has("OES_texture_float_linear")===!1&&(S.magFilter===pn||S.magFilter===Ou||S.magFilter===cl||S.magFilter===Qr||S.minFilter===pn||S.minFilter===Ou||S.minFilter===cl||S.minFilter===Qr)&&He("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(P,t.TEXTURE_WRAP_S,ae[S.wrapS]),t.texParameteri(P,t.TEXTURE_WRAP_T,ae[S.wrapT]),(P===t.TEXTURE_3D||P===t.TEXTURE_2D_ARRAY)&&t.texParameteri(P,t.TEXTURE_WRAP_R,ae[S.wrapR]),t.texParameteri(P,t.TEXTURE_MAG_FILTER,Fe[S.magFilter]),t.texParameteri(P,t.TEXTURE_MIN_FILTER,Fe[S.minFilter]),S.compareFunction&&(t.texParameteri(P,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(P,t.TEXTURE_COMPARE_FUNC,je[S.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(S.magFilter===tn||S.minFilter!==cl&&S.minFilter!==Qr||S.type===Ti&&e.has("OES_texture_float_linear")===!1)return;if(S.anisotropy>1||i.get(S).__currentAnisotropy){const G=e.get("EXT_texture_filter_anisotropic");t.texParameterf(P,G.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(S.anisotropy,r.getMaxAnisotropy())),i.get(S).__currentAnisotropy=S.anisotropy}}}function ee(P,S){let G=!1;P.__webglInit===void 0&&(P.__webglInit=!0,S.addEventListener("dispose",A));const $=S.source;let Z=m.get($);Z===void 0&&(Z={},m.set($,Z));const ce=z(S);if(ce!==P.__cacheKey){Z[ce]===void 0&&(Z[ce]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,G=!0),Z[ce].usedTimes++;const fe=Z[P.__cacheKey];fe!==void 0&&(Z[P.__cacheKey].usedTimes--,fe.usedTimes===0&&N(S)),P.__cacheKey=ce,P.__webglTexture=Z[ce].texture}return G}function ue(P,S,G){return Math.floor(Math.floor(P/G)/S)}function oe(P,S,G,$){const ce=P.updateRanges;if(ce.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,S.width,S.height,G,$,S.data);else{ce.sort((Ae,xe)=>Ae.start-xe.start);let fe=0;for(let Ae=1;Ae<ce.length;Ae++){const xe=ce[fe],me=ce[Ae],Le=xe.start+xe.count,ze=ue(me.start,S.width,4),We=ue(xe.start,S.width,4);me.start<=Le+1&&ze===We&&ue(me.start+me.count-1,S.width,4)===ze?xe.count=Math.max(xe.count,me.start+me.count-xe.start):(++fe,ce[fe]=me)}ce.length=fe+1;const J=n.getParameter(t.UNPACK_ROW_LENGTH),te=n.getParameter(t.UNPACK_SKIP_PIXELS),he=n.getParameter(t.UNPACK_SKIP_ROWS);n.pixelStorei(t.UNPACK_ROW_LENGTH,S.width);for(let Ae=0,xe=ce.length;Ae<xe;Ae++){const me=ce[Ae],Le=Math.floor(me.start/4),ze=Math.ceil(me.count/4),We=Le%S.width,U=Math.floor(Le/S.width),pe=ze,ie=1;n.pixelStorei(t.UNPACK_SKIP_PIXELS,We),n.pixelStorei(t.UNPACK_SKIP_ROWS,U),n.texSubImage2D(t.TEXTURE_2D,0,We,U,pe,ie,G,$,S.data)}P.clearUpdateRanges(),n.pixelStorei(t.UNPACK_ROW_LENGTH,J),n.pixelStorei(t.UNPACK_SKIP_PIXELS,te),n.pixelStorei(t.UNPACK_SKIP_ROWS,he)}}function Be(P,S,G){let $=t.TEXTURE_2D;(S.isDataArrayTexture||S.isCompressedArrayTexture)&&($=t.TEXTURE_2D_ARRAY),S.isData3DTexture&&($=t.TEXTURE_3D);const Z=ee(P,S),ce=S.source;n.bindTexture($,P.__webglTexture,t.TEXTURE0+G);const fe=i.get(ce);if(ce.version!==fe.__version||Z===!0){if(n.activeTexture(t.TEXTURE0+G),(typeof ImageBitmap<"u"&&S.image instanceof ImageBitmap)===!1){const ie=rt.getPrimaries(rt.workingColorSpace),ge=S.colorSpace
vendor: 5,038 bytes, line 4131
4131===xr?null:rt.getPrimaries(S.colorSpace),ye=S.colorSpace===xr||ie===ge?t.NONE:t.BROWSER_DEFAULT_WEBGL;n.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,S.flipY),n.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S.premultiplyAlpha),n.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,ye)}n.pixelStorei(t.UNPACK_ALIGNMENT,S.unpackAlignment);let te=g(S.image,!1,r.maxTextureSize);te=on(S,te);const he=s.convert(S.format,S.colorSpace),Ae=s.convert(S.type);let xe=M(S.internalFormat,he,Ae,S.normalized,S.colorSpace,S.isVideoTexture);Oe($,S);let me;const Le=S.mipmaps,ze=S.isVideoTexture!==!0,We=fe.__version===void 0||Z===!0,U=ce.dataReady,pe=w(S,te);if(S.isDepthTexture)xe=E(S.format===es,S.type),We&&(ze?n.texStorage2D(t.TEXTURE_2D,1,xe,te.width,te.height):n.texImage2D(t.TEXTURE_2D,0,xe,te.width,te.height,0,he,Ae,null));else if(S.isDataTexture)if(Le.length>0){ze&&We&&n.texStorage2D(t.TEXTURE_2D,pe,xe,Le[0].width,Le[0].height);for(let ie=0,ge=Le.length;ie<ge;ie++)me=Le[ie],ze?U&&n.texSubImage2D(t.TEXTURE_2D,ie,0,0,me.width,me.height,he,Ae,me.data):n.texImage2D(t.TEXTURE_2D,ie,xe,me.width,me.height,0,he,Ae,me.data);S.generateMipmaps=!1}else ze?(We&&n.texStorage2D(t.TEXTURE_2D,pe,xe,te.width,te.height),U&&oe(S,te,he,Ae)):n.texImage2D(t.TEXTURE_2D,0,xe,te.width,te.height,0,he,Ae,te.data);else if(S.isCompressedTexture)if(S.isCompressedArrayTexture){ze&&We&&n.texStorage3D(t.TEXTURE_2D_ARRAY,pe,xe,Le[0].width,Le[0].height,te.depth);for(let ie=0,ge=Le.length;ie<ge;ie++)if(me=Le[ie],S.format!==hi)if(he!==null)if(ze){if(U)if(S.layerUpdates.size>0){const ye=Ig(me.width,me.height,S.format,S.type);for(const se of S.layerUpdates){const Re=me.data.subarray(se*ye/me.data.BYTES_PER_ELEMENT,(se+1)*ye/me.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,ie,0,0,se,me.width,me.height,1,he,Re)}S.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,ie,0,0,0,me.width,me.height,te.depth,he,me.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,ie,xe,me.width,me.height,te.depth,0,me.data,0,0);else He("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ze?U&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,ie,0,0,0,me.width,me.height,te.depth,he,Ae,me.data):n.texImage3D(t.TEXTURE_2D_ARRAY,ie,xe,me.width,me.height,te.depth,0,he,Ae,me.data)}else{ze&&We&&n.texStorage2D(t.TEXTURE_2D,pe,xe,Le[0].width,Le[0].height);for(let ie=0,ge=Le.length;ie<ge;ie++)me=Le[ie],S.format!==hi?he!==null?ze?U&&n.compressedTexSubImage2D(t.TEXTURE_2D,ie,0,0,me.width,me.height,he,me.data):n.compressedTexImage2D(t.TEXTURE_2D,ie,xe,me.width,me.height,0,me.data):He("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ze?U&&n.texSubImage2D(t.TEXTURE_2D,ie,0,0,me.width,me.height,he,Ae,me.data):n.texImage2D(t.TEXTURE_2D,ie,xe,me.width,me.height,0,he,Ae,me.data)}else if(S.isDataArrayTexture)if(ze){if(We&&n.texStorage3D(t.TEXTURE_2D_ARRAY,pe,xe,te.width,te.height,te.depth),U)if(S.layerUpdates.size>0){const ie=Ig(te.width,te.height,S.format,S.type);for(const ge of S.layerUpdates){const ye=te.data.subarray(ge*ie/te.data.BYTES_PER_ELEMENT,(ge+1)*ie/te.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,ge,te.width,te.height,1,he,Ae,ye)}S.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,te.width,te.height,te.depth,he,Ae,te.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,xe,te.width,te.height,te.depth,0,he,Ae,te.data);else if(S.isData3DTexture)ze?(We&&n.texStorage3D(t.TEXTURE_3D,pe,xe,te.width,te.height,te.depth),U&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,te.width,te.height,te.depth,he,Ae,te.data)):n.texImage3D(t.TEXTURE_3D,0,xe,te.width,te.height,te.depth,0,he,Ae,te.data);else if(S.isFramebufferTexture){if(We)if(ze)n.texStorage2D(t.TEXTURE_2D,pe,xe,te.width,te.height);else{let ie=te.width,ge=te.height;for(let ye=0;ye<pe;ye++)n.texImage2D(t.TEXTURE_2D,ye,xe,ie,ge,0,he,Ae,null),ie>>=1,ge>>=1}}else if(S.isHTMLTexture){if("texElementImage2D"in t){const ie=t.canvas;if(ie.hasAttribute("layoutsubtree")||ie.setAttribute("layoutsubtree","true"),te.parentNode!==ie){ie.appendChild(te),p.add(S),ie.onpaint=ge=>{const ye=ge.changedElements;for(const se of p)ye.includes(se.image)&&(se.needsUpdate=!0)},ie.requestPaint();return}if(t.texElementImage2D.length===3)t.texElementImage2D(t.TEXTURE_2D,t.RGBA8,te);else{const ye=t.RGBA,se=t.RGBA,Re=t.UNSIGNED_BYTE;t.texElementImage2D(t.TEXTURE_2D,0,ye,se,Re,te)}t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}}else if(Le.length>0){if(ze&&We){const ie=ct(Le[0]);n.texStorage2D(t.TEXTURE_2D,pe,xe,ie.width,ie.height)}for(let ie=0,ge=Le.length;ie<ge;ie++)me=Le[ie],ze?U&&n.texSubImage2D(t.TEXTURE_2D,ie,0,0,he,Ae,me):n.texImage2D(t.TEXTURE_2D,ie,xe,he,Ae,me);S.generateMipmaps=!1}else if(ze){if(We){const ie=ct(te);n.texStorage2D(t.TEXTURE_2D,pe,xe,ie.width,ie.height)}U&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,he,Ae,te)}else n.texImage2D(t.TEXTURE_2D,0,xe,he,Ae,te);
vendor: 35,926 bytes, lines 4131-4155
4131d(S)&&v($),fe.__version=ce.version,S.onUpdate&&S.onUpdate(S)}P.__version=S.version}function $e(P,S,G){if(S.image.length!==6)return;const $=ee(P,S),Z=S.source;n.bindTexture(t.TEXTURE_CUBE_MAP,P.__webglTexture,t.TEXTURE0+G);const ce=i.get(Z);if(Z.version!==ce.__version||$===!0){n.activeTexture(t.TEXTURE0+G);const fe=rt.getPrimaries(rt.workingColorSpace),J=S.colorSpace===xr?null:rt.getPrimaries(S.colorSpace),te=S.colorSpace===xr||fe===J?t.NONE:t.BROWSER_DEFAULT_WEBGL;n.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,S.flipY),n.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S.premultiplyAlpha),n.pixelStorei(t.UNPACK_ALIGNMENT,S.unpackAlignment),n.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,te);const he=S.isCompressedTexture||S.image[0].isCompressedTexture,Ae=S.image[0]&&S.image[0].isDataTexture,xe=[];for(let se=0;se<6;se++)!he&&!Ae?xe[se]=g(S.image[se],!0,r.maxCubemapSize):xe[se]=Ae?S.image[se].image:S.image[se],xe[se]=on(S,xe[se]);const me=xe[0],Le=s.convert(S.format,S.colorSpace),ze=s.convert(S.type),We=M(S.internalFormat,Le,ze,S.normalized,S.colorSpace),U=S.isVideoTexture!==!0,pe=ce.__version===void 0||$===!0,ie=Z.dataReady;let ge=w(S,me);Oe(t.TEXTURE_CUBE_MAP,S);let ye;if(he){U&&pe&&n.texStorage2D(t.TEXTURE_CUBE_MAP,ge,We,me.width,me.height);for(let se=0;se<6;se++){ye=xe[se].mipmaps;for(let Re=0;Re<ye.length;Re++){const be=ye[Re];S.format!==hi?Le!==null?U?ie&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,Re,0,0,be.width,be.height,Le,be.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,Re,We,be.width,be.height,0,be.data):He("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):U?ie&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,Re,0,0,be.width,be.height,Le,ze,be.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,Re,We,be.width,be.height,0,Le,ze,be.data)}}}else{if(ye=S.mipmaps,U&&pe){ye.length>0&&ge++;const se=ct(xe[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,ge,We,se.width,se.height)}for(let se=0;se<6;se++)if(Ae){U?ie&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,0,0,xe[se].width,xe[se].height,Le,ze,xe[se].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,We,xe[se].width,xe[se].height,0,Le,ze,xe[se].data);for(let Re=0;Re<ye.length;Re++){const xt=ye[Re].image[se].image;U?ie&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,Re+1,0,0,xt.width,xt.height,Le,ze,xt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,Re+1,We,xt.width,xt.height,0,Le,ze,xt.data)}}else{U?ie&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,0,0,Le,ze,xe[se]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,We,Le,ze,xe[se]);for(let Re=0;Re<ye.length;Re++){const be=ye[Re];U?ie&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,Re+1,0,0,Le,ze,be.image[se]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+se,Re+1,We,Le,ze,be.image[se])}}}d(S)&&v(t.TEXTURE_CUBE_MAP),ce.__version=Z.version,S.onUpdate&&S.onUpdate(S)}P.__version=S.version}function Pe(P,S,G,$,Z,ce){const fe=s.convert(G.format,G.colorSpace),J=s.convert(G.type),te=M(G.internalFormat,fe,J,G.normalized,G.colorSpace),he=i.get(S),Ae=i.get(G);if(Ae.__renderTarget=S,!he.__hasExternalTextures){const xe=Math.max(1,S.width>>ce),me=Math.max(1,S.height>>ce);Z===t.TEXTURE_3D||Z===t.TEXTURE_2D_ARRAY?n.texImage3D(Z,ce,te,xe,me,S.depth,0,fe,J,null):n.texImage2D(Z,ce,te,xe,me,0,fe,J,null)}n.bindFramebuffer(t.FRAMEBUFFER,P),pt(S)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,$,Z,Ae.__webglTexture,0,Mt(S)):(Z===t.TEXTURE_2D||Z>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&Z<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,$,Z,Ae.__webglTexture,ce),n.bindFramebuffer(t.FRAMEBUFFER,null)}function wt(P,S,G){if(t.bindRenderbuffer(t.RENDERBUFFER,P),S.depthBuffer){const $=S.depthTexture,Z=$&&$.isDepthTexture?$.type:null,ce=E(S.stencilBuffer,Z),fe=S.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;pt(S)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Mt(S),ce,S.width,S.height):G?t.renderbufferStorageMultisample(t.RENDERBUFFER,Mt(S),ce,S.width,S.height):t.renderbufferStorage(t.RENDERBUFFER,ce,S.width,S.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,fe,t.RENDERBUFFER,P)}else{const $=S.textures;for(let Z=0;Z<$.length;Z++){const ce=$[Z],fe=s.convert(ce.format,ce.colorSpace),J=s.convert(ce.type),te=M(ce.internalFormat,fe,J,ce.normalized,ce.colorSpace);pt(S)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Mt(S),te,S.width,S.height):G?t.renderbufferStorageMultisample(t.RENDERBUFFER,Mt(S),te,S.width,S.height):t.renderbufferStorage(t.RENDERBUFFER,te,S.width,S.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function Qe(P,S,G){const $=S.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(t.FRAMEBUFFER,P),!(S.depthTexture&&S.depthTexture.isDepthTexture))throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");const Z=i.get(S.depthTexture);if(Z.__renderTarget=S,(!Z.__webglTexture||S.depthTexture.image.width!==S.width||S.depthTexture.image.height!==S.height)&&(S.depthTexture.image.width=S.width,S.depthTexture.image.height=S.height,S.depthTexture.needsUpdate=!0),$){if(Z.__webglInit===void 0&&(Z.__webglInit=!0,S.depthTexture.addEventListener("dispose",A)),Z.__webglTexture===void 0){Z.__webglTexture=t.createTexture(),n.bindTexture(t.TEXTURE_CUBE_MAP,Z.__webglTexture),Oe(t.TEXTURE_CUBE_MAP,S.depthTexture);const he=s.convert(S.depthTexture.format),Ae=s.convert(S.depthTexture.type);let xe;S.depthTexture.format===er?xe=t.DEPTH_COMPONENT24:S.depthTexture.format===es&&(xe=t.DEPTH24_STENCIL8);for(let me=0;me<6;me++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+me,0,xe,S.width,S.height,0,he,Ae,null)}}else I(S.depthTexture,0);const ce=Z.__webglTexture,fe=Mt(S),J=$?t.TEXTURE_CUBE_MAP_POSITIVE_X+G:t.TEXTURE_2D,te=S.depthTexture.format===es?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(S.depthTexture.format===er)pt(S)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,te,J,ce,0,fe):t.framebufferTexture2D(t.FRAMEBUFFER,te,J,ce,0);else if(S.depthTexture.format===es)pt(S)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,te,J,ce,0,fe):t.framebufferTexture2D(t.FRAMEBUFFER,te,J,ce,0);else throw new Error("THREE.WebGLTextures: Unknown depthTexture format.")}function ut(P){const S=i.get(P),G=P.isWebGLCubeRenderTarget===!0;if(S.__boundDepthTexture!==P.depthTexture){const $=P.depthTexture;if(S.__depthDisposeCallback&&S.__depthDisposeCallback(),$){const Z=()=>{delete S.__boundDepthTexture,delete S.__depthDisposeCallback,$.removeEventListener("dispose",Z)};$.addEventListener("dispose",Z),S.__depthDisposeCallback=Z}S.__boundDepthTexture=$}if(P.depthTexture&&!S.__autoAllocateDepthBuffer)if(G)for(let $=0;$<6;$++)Qe(S.__webglFramebuffer[$],P,$);else{const $=P.texture.mipmaps;$&&$.length>0?Qe(S.__webglFramebuffer[0],P,0):Qe(S.__webglFramebuffer,P,0)}else if(G){S.__webglDepthbuffer=[];for(let $=0;$<6;$++)if(n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer[$]),S.__webglDepthbuffer[$]===void 0)S.__webglDepthbuffer[$]=t.createRenderbuffer(),wt(S.__webglDepthbuffer[$],P,!1);else{const Z=P.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ce=S.__webglDepthbuffer[$];t.bindRenderbuffer(t.RENDERBUFFER,ce),t.framebufferRenderbuffer(t.FRAMEBUFFER,Z,t.RENDERBUFFER,ce)}}else{const $=P.texture.mipmaps;if($&&$.length>0?n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer),S.__webglDepthbuffer===void 0)S.__webglDepthbuffer=t.createRenderbuffer(),wt(S.__webglDepthbuffer,P,!1);else{const Z=P.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ce=S.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,ce),t.framebufferRenderbuffer(t.FRAMEBUFFER,Z,t.RENDERBUFFER,ce)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function Xe(P,S,G){const $=i.get(P);S!==void 0&&Pe($.__webglFramebuffer,P,P.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),G!==void 0&&ut(P)}function tt(P){const S=P.texture,G=i.get(P),$=i.get(S);P.addEventListener("dispose",_);const Z=P.textures,ce=P.isWebGLCubeRenderTarget===!0,fe=Z.length>1;if(fe||($.__webglTexture===void 0&&($.__webglTexture=t.createTexture()),$.__version=S.version,a.memory.textures++),ce){G.__webglFramebuffer=[];for(let J=0;J<6;J++)if(S.mipmaps&&S.mipmaps.length>0){G.__webglFramebuffer[J]=[];for(let te=0;te<S.mipmaps.length;te++)G.__webglFramebuffer[J][te]=t.createFramebuffer()}else G.__webglFramebuffer[J]=t.createFramebuffer()}else{if(S.mipmaps&&S.mipmaps.length>0){G.__webglFramebuffer=[];for(let J=0;J<S.mipmaps.length;J++)G.__webglFramebuffer[J]=t.createFramebuffer()}else G.__webglFramebuffer=t.createFramebuffer();if(fe)for(let J=0,te=Z.length;J<te;J++){const he=i.get(Z[J]);he.__webglTexture===void 0&&(he.__webglTexture=t.createTexture(),a.memory.textures++)}if(P.samples>0&&pt(P)===!1){G.__webglMultisampledFramebuffer=t.createFramebuffer(),G.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,G.__webglMultisampledFramebuffer);for(let J=0;J<Z.length;J++){const te=Z[J];G.__webglColorRenderbuffer[J]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,G.__webglColorRenderbuffer[J]);const he=s.convert(te.format,te.colorSpace),Ae=s.convert(te.type),xe=M(te.internalFormat,he,Ae,te.normalized,te.colorSpace,P.isXRRenderTarget===!0),me=Mt(P);t.renderbufferStorageMultisample(t.RENDERBUFFER,me,xe,P.width,P.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+J,t.RENDERBUFFER,G.__webglColorRenderbuffer[J])}t.bindRenderbuffer(t.RENDERBUFFER,null),P.depthBuffer&&(G.__webglDepthRenderbuffer=t.createRenderbuffer(),wt(G.__webglDepthRenderbuffer,P,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(ce){n.bindTexture(t.TEXTURE_CUBE_MAP,$.__webglTexture),Oe(t.TEXTURE_CUBE_MAP,S);for(let J=0;J<6;J++)if(S.mipmaps&&S.mipmaps.length>0)for(let te=0;te<S.mipmaps.length;te++)Pe(G.__webglFramebuffer[J][te],P,S,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+J,te);else Pe(G.__webglFramebuffer[J],P,S,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+J,0);d(S)&&v(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(fe){for(let J=0,te=Z.length;J<te;J++){const he=Z[J],Ae=i.get(he);let xe=t.TEXTURE_2D;(P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(xe=P.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(xe,Ae.__webglTexture),Oe(xe,he),Pe(G.__webglFramebuffer,P,he,t.COLOR_ATTACHMENT0+J,xe,0),d(he)&&v(xe)}n.unbindTexture()}else{let J=t.TEXTURE_2D;if((P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(J=P.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(J,$.__webglTexture),Oe(J,S),S.mipmaps&&S.mipmaps.length>0)for(let te=0;te<S.mipmaps.length;te++)Pe(G.__webglFramebuffer[te],P,S,t.COLOR_ATTACHMENT0,J,te);else Pe(G.__webglFramebuffer,P,S,t.COLOR_ATTACHMENT0,J,0);d(S)&&v(J),n.unbindTexture()}P.depthBuffer&&ut(P)}function St(P){const S=P.textures;for(let G=0,$=S.length;G<$;G++){const Z=S[G];if(d(Z)){const ce=b(P),fe=i.get(Z).__webglTexture;n.bindTexture(ce,fe),v(ce),n.unbindTexture()}}}const ve=[],At=[];function Gt(P){if(P.samples>0){if(pt(P)===!1){const S=P.textures,G=P.width,$=P.height;let Z=t.COLOR_BUFFER_BIT;const ce=P.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,fe=i.get(P),J=S.length>1;if(J)for(let he=0;he<S.length;he++)n.bindFramebuffer(t.FRAMEBUFFER,fe.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+he,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,fe.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+he,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,fe.__webglMultisampledFramebuffer);const te=P.texture.mipmaps;te&&te.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,fe.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,fe.__webglFramebuffer);for(let he=0;he<S.length;he++){if(P.resolveDepthBuffer&&(P.depthBuffer&&(Z|=t.DEPTH_BUFFER_BIT),P.stencilBuffer&&P.resolveStencilBuffer&&(Z|=t.STENCIL_BUFFER_BIT)),J){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,fe.__webglColorRenderbuffer[he]);const Ae=i.get(S[he]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Ae,0)}t.blitFramebuffer(0,0,G,$,0,0,G,$,Z,t.NEAREST),l===!0&&(ve.length=0,At.length=0,ve.push(t.COLOR_ATTACHMENT0+he),P.depthBuffer&&P.resolveDepthBuffer===!1&&(ve.push(ce),At.push(ce),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,At)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,ve))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),J)for(let he=0;he<S.length;he++){n.bindFramebuffer(t.FRAMEBUFFER,fe.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+he,t.RENDERBUFFER,fe.__webglColorRenderbuffer[he]);const Ae=i.get(S[he]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,fe.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+he,t.TEXTURE_2D,Ae,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,fe.__webglMultisampledFramebuffer)}else if(P.depthBuffer&&P.resolveDepthBuffer===!1&&l){const S=P.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[S])}}}function Mt(P){return Math.min(r.maxSamples,P.samples)}function pt(P){const S=i.get(P);return P.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&S.__useRenderToTexture!==!1}function O(P){const S=a.render.frame;f.get(P)!==S&&(f.set(P,S),P.update())}function on(P,S){const G=P.colorSpace,$=P.format,Z=P.type;return P.isCompressedTexture===!0||P.isVideoTexture===!0||G!==Dc&&G!==xr&&(rt.getTransfer(G)===ft?($!==hi||Z!==jn)&&He("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):ot("WebGLTextures: Unsupported texture color space:",G)),S}function ct(P){return typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement?(u.width=P.naturalWidth||P.width,u.height=P.naturalHeight||P.height):typeof VideoFrame<"u"&&P instanceof VideoFrame?(u.width=P.displayWidth,u.height=P.displayHeight):(u.width=P.width,u.height=P.height),u}this.allocateTextureUnit=B,this.resetTextureUnits=D,this.getTextureUnits=F,this.setTextureUnits=k,this.setTexture2D=I,this.setTexture2DArray=V,this.setTexture3D=Q,this.setTextureCube=re,this.rebindTextures=Xe,this.setupRenderTarget=tt,this.updateRenderTargetMipmap=St,this.updateMultisampleRenderTarget=Gt,this.setupDepthRenderbuffer=ut,this.setupFrameBufferTexture=Pe,this.useMultisampledRTT=pt,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function YA(t,e){function n(i,r=xr){let s;const a=rt.getTransfer(r);if(i===jn)return t.UNSIGNED_BYTE;if(i===gp)return t.UNSIGNED_SHORT_4_4_4_4;if(i===vp)return t.UNSIGNED_SHORT_5_5_5_1;if(i===o_)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===l_)return t.UNSIGNED_INT_10F_11F_11F_REV;if(i===s_)return t.BYTE;if(i===a_)return t.SHORT;if(i===Po)return t.UNSIGNED_SHORT;if(i===mp)return t.INT;if(i===Di)return t.UNSIGNED_INT;if(i===Ti)return t.FLOAT;if(i===Qi)return t.HALF_FLOAT;if(i===c_)return t.ALPHA;if(i===u_)return t.RGB;if(i===hi)return t.RGBA;if(i===er)return t.DEPTH_COMPONENT;if(i===es)return t.DEPTH_STENCIL;if(i===d_)return t.RED;if(i===xp)return t.RED_INTEGER;if(i===ds)return t.RG;if(i===_p)return t.RG_INTEGER;if(i===yp)return t.RGBA_INTEGER;if(i===ql||i===Zl||i===Jl||i===Ql)if(a===ft)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===ql)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Zl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Jl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Ql)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===ql)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Zl)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Jl)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Ql)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Pf||i===kf||i===Nf||i===Df)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Pf)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===kf)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Nf)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Df)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Lf||i===If||i===Uf||i===Ff||i===Of||i===kc||i===zf)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Lf||i===If)return a===ft?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Uf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===Ff)return s.COMPRESSED_R11_EAC;if(i===Of)return s.COMPRESSED_SIGNED_R11_EAC;if(i===kc)return s.COMPRESSED_RG11_EAC;if(i===zf)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===jf||i===Bf||i===Gf||i===Hf||i===Vf||i===Wf||i===Xf||i===$f||i===Yf||i===Kf||i===qf||i===Zf||i===Jf||i===Qf)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===jf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Bf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Gf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Hf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Vf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Wf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Xf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===$f)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Yf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Kf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===qf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Zf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Jf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Qf)return a===ft?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===eh||i===th||i===nh)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===eh)return a===ft?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===th)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===nh)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===ih||i===rh||i===Nc||i===sh)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===ih)return s.COMPRESSED_RED_RGTC1_EXT;if(i===rh)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Nc)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===sh)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ko?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}const KA=` 4132void main() { 4133 4134 gl_Position = vec4( position, 1.0 ); 4135 4136}`,qA=` 4137uniform sampler2DArray depthColor; 4138uniform float depthWidth; 4139uniform float depthHeight; 4140 4141void main() { 4142 4143 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 4144 4145 if ( coord.x >= 1.0 ) { 4146 4147 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 4148 4149 } else { 4150 4151 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 4152 4153 } 4154 4155}`;class ZA{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new S_(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new Li({vertexShader:KA,fragmentShader:qA,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new _n(new rs(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class JA extends zr{constructor(e,n){super();const i=this;let r=null,s=1,a=null,o="local-floor",l=1,u=null,f=null,p=null,h=null,m=null,x=null;const y=typeof XRWebGLBinding<"u",g=new ZA,d={},v=n.getContextAttributes();let b=null,M=null;const E=[],w=[],A=new De;let _=null;const T=new Zn;T.viewport=new Nt;const N=new Zn;N.viewport=new Nt;const L=[T,N],R=new ow;let D=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ee){let ue=E[ee];return ue===void 0&&(ue=new Wu,E[ee]=ue),ue.getTargetRaySpace()},this.getControllerGrip=function(ee){let ue=E[ee];return ue===void 0&&(ue=new Wu,E[ee]=ue),ue.getGripSpace()},this.getHand=function(ee){let ue=E[ee];return ue===void 0&&(ue=new Wu,E[ee]=ue),ue.getHandSpace()};function k(ee){const ue=w.indexOf(ee.inputSource);if(ue===-1)return;const oe=E[ue];oe!==void 0&&(oe.update(ee.inputSource,ee.frame,u||a),oe.dispatchEvent({type:ee.type,data:ee.inputSource}))}function B(){r.removeEventListener("select",k),r.removeEventListener("selectstart",k),r.removeEventListener("selectend",k),r.removeEventListener("squeeze",k),r.removeEventListener("squeezestart",k),r.removeEventListener("squeezeend",k),r.removeEventListener("end",B),r.removeEventListener("inputsourceschange",z);for(let ee=0;ee<E.length;ee++){const ue=w[ee];ue!==null&&(w[ee]=null,E[ee].disconnect(ue))}D=null,F=null,g.reset();for(const ee in d)delete d[ee];e.setRenderTarget(b),m=null,h=null,p=null,r=null,M=null,Oe.stop(),i.isPresenting=!1,e.setPixelRatio(_),e.setSize(A.width,A.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ee){s=ee,i.isPresenting===!0&&He("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ee){o=ee,i.isPresenting===!0&&He("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||a},this.setReferenceSpace=function(ee){u=ee},this.getBaseLayer=function(){return h!==null?h:m},this.getBinding=function(){return p===null&&y&&(p=new XRWebGLBinding(r,n)),p},this.getFrame=function(){return x},this.getSession=function(){return r},this.setSession=async function(ee){if(r=ee,r!==null){if(b=e.getRenderTarget(),r.addEventListener("select",k),r.addEventListener("selectstart",k),r.addEventListener("selectend",k),r.addEventListener("squeeze",k),r.addEventListener("squeezestart",k),r.addEventListener("squeezeend",k),r.addEventListener("end",B),r.addEventListener("inputsourceschange",z),v.xrCompatible!==!0&&await n.makeXRCompatible(),_=e.getPixelRatio(),e.getSize(A),y&&"createProjectionLayer"in XRWebGLBinding.prototype){let oe=null,Be=null,$e=null;v.depth&&($e=v.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,oe=v.stencil?es:er,Be=v.stencil?ko:Di);const Pe={colorFormat:n.RGBA8,depthFormat:$e,scaleFactor:s};p=this.getBinding(),h=p.createProjectionLayer(Pe),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),M=new ki(h.textureWidth,h.textureHeight,{format:hi,type:jn,depthTexture:new ga(h.textureWidth,h.textureHeight,Be,void 0,void 0,void 0,void 0,void 0,void 0,oe),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1})}else{const oe={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,n,oe),r.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),M=new ki(m.framebufferWidth,m.framebufferHeight,{format:hi,type:jn,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}M.isXRRenderTarget=!0,this.setFoveation(l),u=null,a=await r.requestReferenceSpace(o),Oe.setContext(r),Oe.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function z(ee){for(let ue=0;ue<ee.removed.length;ue++){const oe=ee.removed[ue],Be=w.indexOf(oe);Be>=0&&(w[Be]=null,E[Be].disconnect(oe))}for(let ue=0;ue<ee.added.length;ue++){const oe=ee.added[ue];let Be=w.indexOf(oe);if(Be===-1){for(let Pe=0;Pe<E.length;Pe++)if(Pe>=w.length){w.push(oe),Be=Pe;break}else if(w[Pe]===null){w[Pe]=oe,Be=Pe;break}if(Be===-1)break}const $e=E[Be];$e&&$e.connect(oe)}}const I=new H,V=new H;function Q(ee,ue,oe){I.setFromMatrixPosition(ue.matrixWorld),V.setFromMatrixPosition(oe.matrixWorld);const Be=I.distanceTo(V),$e=ue.projectionMatrix.elements,Pe=oe.projectionMatrix.elements,wt=$e[14]/($e[10]-1),Qe=$e[14]/($e[10]+1),ut=($e[9]+1)/$e[5],Xe=($e[9]-1)/$e[5],tt=($e[8]-1)/$e[0],St=(Pe[8]+1)/Pe[0],ve=wt*tt,At=wt*St,Gt=Be/(-tt+St),Mt=Gt*-tt;if(ue.matrixWorld.decompose(ee.position,ee.quaternion,ee.scale),ee.translateX(Mt),ee.translateZ(Gt),ee.matrixWorld.compose(ee.position,ee.quaternion,ee.scale),ee.matrixWorldInverse.copy(ee.matrixWorld).invert(),$e[10]===-1)ee.projectionMatrix.copy(ue.projectionMatrix),ee.projectionMatrixInverse.copy(ue.projectionMatrixInverse);else{const pt=wt+Gt,O=Qe+Gt,on=ve-Mt,ct=At+(Be-Mt),P=ut*Qe/O*pt,S=Xe*Qe/O*pt;ee.projectionMatrix.makePerspective(on,ct,P,S,pt,O),ee.projectionMatrixInverse.copy(ee.projectionMatrix).invert()}}function re(ee,ue){ue===null?ee.matrixWorld.copy(ee.matrix):ee.matrixWorld.multiplyMatrices(ue.matrixWorld,ee.matrix),ee.matrixWorldInverse.copy(ee.matrixWorld).invert()}this.updateCamera=function(ee){if(r===null)return;let ue=ee.near,oe=ee.far;g.texture!==null&&(g.depthNear>0&&(ue=g.depthNear),g.depthFar>0&&(oe=g.depthFar)),R.near=N.near=T.near=ue,R.far=N.far=T.far=oe,(D!==R.near||F!==R.far)&&(r.updateRenderState({depthNear:R.near,depthFar:R.far}),D=R.near,F=R.far),R.layers.mask=ee.layers.mask|6,T.layers.mask=R.layers.mask&-5,N.layers.mask=R.layers.mask&-3;const Be=ee.parent,$e=R.cameras;re(R,Be);for(let Pe=0;Pe<$e.length;Pe++)re($e[Pe],Be);$e.length===2?Q(R,T,N):R.projectionMatrix.copy(T.projectionMatrix),ae(ee,R,Be)};function ae(ee,ue,oe){oe===null?ee.matrix.copy(ue.matrixWorld):(ee.matrix.copy(oe.matrixWorld),ee.matrix.invert(),ee.matrix.multiply(ue.matrixWorld)),ee.matrix.decompose(ee.position,ee.quaternion,ee.scale),ee.updateMatrixWorld(!0),ee.projectionMatrix.copy(ue.projectionMatrix),ee.projectionMatrixInverse.copy(ue.projectionMatrixInverse),ee.isPerspectiveCamera&&(ee.fov=oh*2*Math.atan(1/ee.projectionMatrix.elements[5]),ee.zoom=1)}this.getCamera=function(){return R},this.getFoveation=function(){if(!(h===null&&m===null))return l},this.setFoveation=function(ee){l=ee,h!==null&&(h.fixedFoveation=ee),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=ee)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(R)},this.getCameraTexture=function(ee){return d[ee]};let Fe=null;function je(ee,ue){if(f=ue.getViewerPose(u||a),x=ue,f!==null){const oe=f.views;m!==null&&(e.setRenderTargetFramebuffer(M,m.framebuffer),e.setRenderTarget(M));let Be=!1;oe.length!==R.cameras.length&&(R.cameras.length=0,Be=!0);for(let Qe=0;Qe<oe.length;Qe++){const ut=oe[Qe];let Xe=null;if(m!==null)Xe=m.getViewport(ut);else{const St=p.getViewSubImage(h,ut);Xe=St.viewport,Qe===0&&(e.setRenderTargetTextures(M,St.colorTexture,St.depthStencilTexture),e.setRenderTarget(M))}let tt=L[Qe];tt===void 0&&(tt=new Zn,tt.layers.enable(Qe),tt.viewport=new Nt,L[Qe]=tt),tt.matrix.fromArray(ut.transform.matrix),tt.matrix.decompose(tt.position,tt.quaternion,tt.scale),tt.projectionMatrix.fromArray(ut.projectionMatrix),tt.projectionMatrixInverse.copy(tt.projectionMatrix).invert(),tt.viewport.set(Xe.x,Xe.y,Xe.width,Xe.height),Qe===0&&(R.matrix.copy(tt.matrix),R.matrix.decompose(R.position,R.quaternion,R.scale)),Be===!0&&R.cameras.push(tt)}const $e=r.enabledFeatures;if($e&&$e.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&y){p=i.getBinding();const Qe=p.getDepthInformation(oe[0]);Qe&&Qe.isValid&&Qe.texture&&g.init(Qe,r.renderState)}if($e&&$e.includes("camera-access")&&y){e.state.unbindTexture(),p=i.getBinding();for(let Qe=0;Qe<oe.length;Qe++){const ut=oe[Qe].camera;if(ut){let Xe=d[ut];Xe||(Xe=new S_,d[ut]=Xe);const tt=p.getCameraImage(ut);Xe.sourceTexture=tt}}}}for(let oe=0;oe<E.length;oe++){const Be=w[oe],$e=E[oe];Be!==null&&$e!==void 0&&$e.update(Be,ue,u||a)}Fe&&Fe(ee,ue),ue.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:ue}),x=null}const Oe=new b_;Oe.setAnimationLoop(je),this.setAnimationLoop=function(ee){Fe=ee},this.dispose=function(){}}}const QA=new Ft,k_=new Ye;k_.set(-1,0,0,0,1,0,0,0,1);function eR(t,e){function n(g,d){g.matrixAutoUpdate===!0&&g.updateMatrix(),d.value.copy(g.matrix)}function i(g,d){d.color.getRGB(g.fogColor.value,M_(t)),d.isFog?(g.fogNear.value=d.near,g.fogFar.value=d.far):d.isFogExp2&&(g.fogDensity.value=d.density)}function r(g,d,v,b,M){d.isNodeMaterial?d.uniformsNeedUpdate=!1:d.isMeshBasicMaterial?s(g,d):d.isMeshLambertMaterial?(s(g,d),d.envMap&&(g.envMapIntensity.value=d.envMapIntensity)):d.isMeshToonMaterial?(s(g,d),p(g,d)):d.isMeshPhongMaterial?(s(g,d),f(g,d),d.envMap&&(g.envMapIntensity.value=d.envMapIntensity)):d.isMeshStandardMaterial?(s(g,d),h(g,d),d.isMeshPhysicalMaterial&&m(g,d,M)):d.isMeshMatcapMaterial?(s(g,d),x(g,d)):d.isMeshDepthMaterial?s(g,d):d.isMeshDistanceMaterial?(s(g,d),y(g,d)):d.isMeshNormalMaterial?s(g,d):d.isLineBasicMaterial?(a(g,d),d.isLineDashedMaterial&&o(g,d)):d.isPointsMaterial?l(g,d,v,b):d.isSpriteMaterial?u(g,d):d.isShadowMaterial?(g.color.value.copy(d.color),g.opacity.value=d.opacity):d.isShaderMaterial&&(d.uniformsNeedUpdate=!1)}function s(g,d){g.opacity.value=d.opacity,d.color&&g.diffuse.value.copy(d.color),d.emissive&&g.emissive.value.copy(d.emissive).multiplyScalar(d.emissiveIntensity),d.map&&(g.map.value=d.map,n(d.map,g.mapTransform)),d.alphaMap&&(g.alphaMap.value=d.alphaMap,n(d.alphaMap,g.alphaMapTransform)),d.bumpMap&&(g.bumpMap.value=d.bumpMap,n(d.bumpMap,g.bumpMapTransform),g.bumpScale.value=d.bumpScale,d.side===Dn&&(g.bumpScale.value*=-1)),d.normalMap&&(g.normalMap.value=d.normalMap,n(d.normalMap,g.normalMapTransform),g.normalScale.value.copy(d.normalScale),d.side===Dn&&g.normalScale.value.negate()),d.displacementMap&&(g.displacementMap.value=d.displacementMap,n(d.displacementMap,g.displacementMapTransform),g.displacementScale.value=d.displacementScale,g.displacementBias.value=d.displacementBias),d.emissiveMap&&(g.emissiveMap.value=d.emissiveMap,n(d.emissiveMap,g.emissiveMapTransform)),d.specularMap&&(g.specularMap.value=d.specularMap,n(d.specularMap,g.specularMapTransform)),d.alphaTest>0&&(g.alphaTest.value=d.alphaTest);const v=e.get(d),b=v.envMap,M=v.envMapRotation;b&&(g.envMap.value=b,g.envMapRotation.value.setFromMatrix4(QA.makeRotationFromEuler(M)).transpose(),b.isCubeTexture&&b.isRenderTargetTexture===!1&&g.envMapRotation.value.premultiply(k_),g.reflectivity.value=d.reflectivity,g.ior.value=d.ior,g.refractionRatio.value=d.refractionRatio),d.lightMap&&(g.lightMap.value=d.lightMap,g.lightMapIntensity.value=d.lightMapIntensity,n(d.lightMap,g.lightMapTransform)),d.aoMap&&(g.aoMap.value=d.aoMap,g.aoMapIntensity.value=d.aoMapIntensity,n(d.aoMap,g.aoMapTransform))}function a(g,d){g.diffuse.value.copy(d.color),g.opacity.value=d.opacity,d.map&&(g.map.value=d.map,n(d.map,g.mapTransform))}function o(g,d){g.dashSize.value=d.dashSize,g.totalSize.value=d.dashSize+d.gapSize,g.scale.value=d.scale}function l(g,d,v,b){g.diffuse.value.copy(d.color),g.opacity.value=d.opacity,g.size.value=d.size*v,g.scale.value=b*.5,d.map&&(g.map.value=d.map,n(d.map,g.uvTransform)),d.alphaMap&&(g.alphaMap.value=d.alphaMap,n(d.alphaMap,g.alphaMapTransform)),d.alphaTest>0&&(g.alphaTest.value=d.alphaTest)}function u(g,d){g.diffuse.value.copy(d.color),g.opacity.value=d.opacity,g.rotation.value=d.rotation,d.map&&(g.map.value=d.map,n(d.map,g.mapTransform)),d.alphaMap&&(g.alphaMap.value=d.alphaMap,n(d.alphaMap,g.alphaMapTransform)),d.alphaTest>0&&(g.alphaTest.value=d.alphaTest)}function f(g,d){g.specular.value.copy(d.specular),g.shininess.value=Math.max(d.shininess,1e-4)}function p(g,d){d.gradientMap&&(g.gradientMap.value=d.gradientMap)}function h(g,d){g.metalness.value=d.metalness,d.metalnessMap&&(g.metalnessMap.value=d.metalnessMap,n(d.metalnessMap,g.metalnessMapTransform)),g.roughness.value=d.roughness,d.roughnessMap&&(g.roughnessMap.value=d.roughnessMap,n(d.roughnessMap,g.roughnessMapTransform)),d.envMap&&(g.envMapIntensity.value=d.envMapIntensity)}function m(g,d,v){g.ior.value=d.ior,d.sheen>0&&(g.sheenColor.value.copy(d.sheenColor).multiplyScalar(d.sheen),g.sheenRoughness.value=d.sheenRoughness,d.sheenColorMap&&(g.sheenColorMap.value=d.sheenColorMap,n(d.sheenColorMap,g.sheenColorMapTransform)),d.sheenRoughnessMap&&(g.sheenRoughnessMap.value=d.sheenRoughnessMap,n(d.sheenRoughnessMap,g.sheenRoughnessMapTransform))),d.clearcoat>0&&(g.clearcoat.value=d.clearcoat,g.clearcoatRoughness.value=d.clearcoatRoughness,d.clearcoatMap&&(g.clearcoatMap.value=d.clearcoatMap,n(d.clearcoatMap,g.clearcoatMapTransform)),d.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=d.clearcoatRoughnessMap,n(d.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),d.clearcoatNormalMap&&(g.clearcoatNormalMap.value=d.clearcoatNormalMap,n(d.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(d.clearcoatNormalScale),d.side===Dn&&g.clearcoatNormalScale.value.negate())),d.dispersion>0&&(g.dispersion.value=d.dispersion),d.iridescence>0&&(g.iridescence.value=d.iridescence,g.iridescenceIOR.value=d.iridescenceIOR,g.iridescenceThicknessMinimum.value=d.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=d.iridescenceThicknessRange[1],d.iridescenceMap&&(g.iridescenceMap.value=d.iridescenceMap,n(d.iridescenceMap,g.iridescenceMapTransform)),d.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=d.iridescenceThicknessMap,n(d.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),d.transmission>0&&(g.transmission.value=d.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),d.transmissionMap&&(g.transmissionMap.value=d.transmissionMap,n(d.transmissionMap,g.transmissionMapTransform)),g.thickness.value=d.thickness,d.thicknessMap&&(g.thicknessMap.value=d.thicknessMap,n(d.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=d.attenuationDistance,g.attenuationColor.value.copy(d.attenuationColor)),d.anisotropy>0&&(g.anisotropyVector.value.set(d.anisotropy*Math.cos(d.anisotropyRotation),d.anisotropy*Math.sin(d.anisotropyRotation)),d.anisotropyMap&&(g.anisotropyMap.value=d.anisotropyMap,n(d.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=d.specularIntensity,g.specularColor.value.copy(d.specularColor),d.specularColorMap&&(g.specularColorMap.value=d.specularColorMap,n(d.specularColorMap,g.specularColorMapTransform)),d.specularIntensityMap&&(g.specularIntensityMap.value=d.specularIntensityMap,n(d.specularIntensityMap,g.specularIntensityMapTransform))}function x(g,d){d.matcap&&(g.matcap.value=d.matcap)}function y(g,d){const v=e.get(d).light;g.referencePosition.value.setFromMatrixPosition(v.matrixWorld),g.nearDistance.value=v.shadow.camera.near,g.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function tR(t,e,n,i){let r={},s={},a=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(M,E){const w=E.program;i.uniformBlockBinding(M,w)}function u(M,E){let w=r[M.id];w===void 0&&(g(M),w=f(M),r[M.id]=w,M.addEventListener("dispose",v));const A=E.program;i.updateUBOMapping(M,A);const _=e.render.frame;s[M.id]!==_&&(h(M),s[M.id]=_)}function f(M){const E=p();M.__bindingPointIndex=E;const w=t.createBuffer(),A=M.__size,_=M.usage;return t.bindBuffer(t.UNIFORM_BUFFER,w),t.bufferData(t.UNIFORM_BUFFER,A,_),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,E,w),w}function p(){for(let M=0;M<o;M++)if(a.indexOf(M)===-1)return a.push(M),M;return ot("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}
4155function h(M){const E=r[M.id],w=M.uniforms,A=M.__cache;t.bindBuffer(t.UNIFORM_BUFFER,E);for(let _=0,T=w.length;_<T;_++){const N=w[_];if(Array.isArray(N))for(let L=0,R=N.length;L<R;L++)m(N[L],_,L,A);else m(N,_,0,A)}t.bindBuffer(t.UNIFORM_BUFFER,null)}function m(M,E,w,A){if(y(M,E,w,A)===!0){const _=M.__offset,T=M.value;if(Array.isArray(T)){let N=0;for(let L=0;L<T.length;L++){const R=T[L],D=d(R);x(R,M.__data,N),typeof R!="number"&&typeof R!="boolean"&&!R.isMatrix3&&!ArrayBuffer.isView(R)&&(N+=D.storage/Float32Array.BYTES_PER_ELEMENT)}}else x(T,M.__data,0);t.bufferSubData(t.UNIFORM_BUFFER,_,M.__data)}}function x(M,E,w){typeof M=="number"||typeof M=="boolean"?E[0]=M:M.isMatrix3?(E[0]=M.elements[0],E[1]=M.elements[1],E[2]=M.elements[2],E[3]=0,E[4]=M.elements[3],E[5]=M.elements[4],E[6]=M.elements[5],E[7]=0,E[8]=M.elements[6],E[9]=M.elements[7],E[10]=M.elements[8],E[11]=0):ArrayBuffer.isView(M)?E.set(new M.constructor(M.buffer,M.byteOffset,E.length)):M.toArray(E,w)}function y(M,E,w,A){const _=M.value,T=E+"_"+w;if(A[T]===void 0)return typeof _=="number"||typeof _=="boolean"?A[T]=_:ArrayBuffer.isView(_)?A[T]=_.slice():A[T]=_.clone(),!0;{const N=A[T];if(typeof _=="number"||typeof _=="boolean"){if(N!==_)return A[T]=_,!0}else{if(ArrayBuffer.isView(_))return!0;if(N.equals(_)===!1)return N.copy(_),!0}}return!1}function g(M){const E=M.uniforms;let w=0;const A=16;for(let T=0,N=E.length;T<N;T++){const L=Array.isArray(E[T])?E[T]:[E[T]];for(let R=0,D=L.length;R<D;R++){const F=L[R],k=Array.isArray(F.value)?F.value:[F.value];for(let B=0,z=k.length;B<z;B++){const I=k[B],V=d(I),Q=w%A,re=Q%V.boundary,ae=Q+re;w+=re,ae!==0&&A-ae<V.storage&&(w+=A-ae),F.__data=new Float32Array(V.storage/Float32Array.BYTES_PER_ELEMENT),F.__offset=w,w+=V.storage}}}const _=w%A;return _>0&&(w+=A-_),M.__size=w,M.__cache={},this}function d(M){const E={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(E.boundary=4,E.storage=4):M.isVector2?(E.boundary=8,E.storage=8):M.isVector3||M.isColor?(E.boundary=16,E.storage=12):M.isVector4?(E.boundary=16,E.storage=16):M.isMatrix3?(E.boundary=48,E.storage=48):M.isMatrix4?(E.boundary=64,E.storage=64):M.isTexture?He("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(M)?(E.boundary=16,E.storage=M.byteLength):He("WebGLRenderer: Unsupported uniform value type.",M),E}function v(M){const E=M.target;E.removeEventListener("dispose",v);const w=a.indexOf(E.__bindingPointIndex);a.splice(w,1),t.deleteBuffer(r[E.id]),delete r[E.id],delete s[E.id]}function b(){for(const M in r)t.deleteBuffer(r[M]);a=[],r={},s={}}return{bind:l,update:u,dispose:b}}const nR=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,
vendor: 17,569 bytes, line 4155
415514942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Si=null;function iR(){return Si===null&&(Si=new Vb(nR,16,16,ds,Qi),Si.name="DFG_LUT",Si.minFilter=pn,Si.magFilter=pn,Si.wrapS=Wi,Si.wrapT=Wi,Si.generateMipmaps=!1,Si.needsUpdate=!0),Si}class rR{constructor(e={}){const{canvas:n=yb(),context:i=null,depth:r=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:p=!1,reversedDepthBuffer:h=!1,outputBufferType:m=jn}=e;this.isWebGLRenderer=!0;let x;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");x=i.getContextAttributes().alpha}else x=a;const y=m,g=new Set([yp,_p,xp]),d=new Set([jn,Di,Po,ko,gp,vp]),v=new Uint32Array(4),b=new Int32Array(4),M=new H;let E=null,w=null;const A=[],_=[];let T=null;this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Pi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const N=this;let L=!1,R=null,D=null,F=null,k=null;this._outputColorSpace=Cn;let B=0,z=0,I=null,V=-1,Q=null;const re=new Nt,ae=new Nt;let Fe=null;const je=new st(0);let Oe=0,ee=n.width,ue=n.height,oe=1,Be=null,$e=null;const Pe=new Nt(0,0,ee,ue),wt=new Nt(0,0,ee,ue);let Qe=!1;const ut=new wp;let Xe=!1,tt=!1;const St=new Ft,ve=new H,At=new Nt,Gt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Mt=!1;function pt(){return I===null?oe:1}let O=i;function on(C,j){return n.getContext(C,j)}try{const C={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:f,failIfMajorPerformanceCaveat:p};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${pp}`),n.addEventListener("webglcontextlost",xt,!1),n.addEventListener("webglcontextrestored",mt,!1),n.addEventListener("webglcontextcreationerror",Xn,!1),O===null){const j="webgl2";if(O=on(j,C),O===null)throw on(j)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(C){throw ot("WebGLRenderer: "+C.message),C}let ct,P,S,G,$,Z,ce,fe,J,te,he,Ae,xe,me,Le,ze,We,U,pe,ie,ge,ye,se;function Re(){ct=new iC(O),ct.init(),ge=new YA(O,ct),P=new KT(O,ct,e,ge),S=new XA(O,ct),P.reversedDepthBuffer&&h&&S.buffers.depth.setReversed(!0),D=O.createFramebuffer(),F=O.createFramebuffer(),k=O.createFramebuffer(),G=new aC(O),$=new NA,Z=new $A(O,ct,S,$,P,ge,G),ce=new nC(N),fe=new uw(O),ye=new $T(O,fe),J=new rC(O,fe,G,ye),te=new lC(O,J,fe,ye,G),U=new oC(O,P,Z),Le=new qT($),he=new kA(N,ce,ct,P,ye,Le),Ae=new eR(N,$),xe=new LA,me=new jA(ct),We=new XT(N,ce,S,te,x,l),ze=new WA(N,te,P),se=new tR(O,G,P,S),pe=new YT(O,ct,G),ie=new sC(O,ct,G),G.programs=he.programs,N.capabilities=P,N.extensions=ct,N.properties=$,N.renderLists=xe,N.shadowMap=ze,N.state=S,N.info=G}Re(),y!==jn&&(T=new uC(y,n.width,n.height,o,r,s));const be=new JA(N,O);this.xr=be,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){const C=ct.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=ct.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return oe},this.setPixelRatio=function(C){C!==void 0&&(oe=C,this.setSize(ee,ue,!1))},this.getSize=function(C){return C.set(ee,ue)},this.setSize=function(C,j,K=!0){if(be.isPresenting){He("WebGLRenderer: Can't change size while VR device is presenting.");return}ee=C,ue=j,n.width=Math.floor(C*oe),n.height=Math.floor(j*oe),K===!0&&(n.style.width=C+"px",n.style.height=j+"px"),T!==null&&T.setSize(n.width,n.height),this.setViewport(0,0,C,j)},this.getDrawingBufferSize=function(C){return C.set(ee*oe,ue*oe).floor()},this.setDrawingBufferSize=function(C,j,K){ee=C,ue=j,oe=K,n.width=Math.floor(C*K),n.height=Math.floor(j*K),this.setViewport(0,0,C,j)},this.setEffects=function(C){if(y===jn){ot("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(C){for(let j=0;j<C.length;j++)if(C[j].isOutputPass===!0){He("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}T.setEffects(C||[])},this.getCurrentViewport=function(C){return C.copy(re)},this.getViewport=function(C){return C.copy(Pe)},this.setViewport=function(C,j,K,W){C.isVector4?Pe.set(C.x,C.y,C.z,C.w):Pe.set(C,j,K,W),S.viewport(re.copy(Pe).multiplyScalar(oe).round())},this.getScissor=function(C){return C.copy(wt)},this.setScissor=function(C,j,K,W){C.isVector4?wt.set(C.x,C.y,C.z,C.w):wt.set(C,j,K,W),S.scissor(ae.copy(wt).multiplyScalar(oe).round())},this.getScissorTest=function(){return Qe},this.setScissorTest=function(C){S.setScissorTest(Qe=C)},this.setOpaqueSort=function(C){Be=C},this.setTransparentSort=function(C){$e=C},this.getClearColor=function(C){return C.copy(We.getClearColor())},this.setClearColor=function(){We.setClearColor(...arguments)},this.getClearAlpha=function(){return We.getClearAlpha()},this.setClearAlpha=function(){We.setClearAlpha(...arguments)},this.clear=function(C=!0,j=!0,K=!0){let W=0;if(C){let X=!1;if(I!==null){const Me=I.texture.format;X=g.has(Me)}if(X){const Me=I.texture.type,Te=d.has(Me),Se=We.getClearColor(),ke=We.getClearAlpha(),Ne=Se.r,qe=Se.g,Je=Se.b;Te?(v[0]=Ne,v[1]=qe,v[2]=Je,v[3]=ke,O.clearBufferuiv(O.COLOR,0,v)):(b[0]=Ne,b[1]=qe,b[2]=Je,b[3]=ke,O.clearBufferiv(O.COLOR,0,b))}else W|=O.COLOR_BUFFER_BIT}j&&(W|=O.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),K&&(W|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),W!==0&&O.clear(W)},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.setNodesHandler=function(C){C.setRenderer(this),R=C},this.dispose=function(){n.removeEventListener("webglcontextlost",xt,!1),n.removeEventListener("webglcontextrestored",mt,!1),n.removeEventListener("webglcontextcreationerror",Xn,!1),We.dispose(),xe.dispose(),me.dispose(),$.dispose(),ce.dispose(),te.dispose(),ye.dispose(),se.dispose(),he.dispose(),be.dispose(),be.removeEventListener("sessionstart",Ue),be.removeEventListener("sessionend",we),Ve.stop()};function xt(C){C.preventDefault(),fg("WebGLRenderer: Context Lost."),L=!0}function mt(){fg("WebGLRenderer: Context Restored."),L=!1;const C=G.autoReset,j=ze.enabled,K=ze.autoUpdate,W=ze.needsUpdate,X=ze.type;Re(),G.autoReset=C,ze.enabled=j,ze.autoUpdate=K,ze.needsUpdate=W,ze.type=X}function Xn(C){ot("WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function Ln(C){const j=C.target;j.removeEventListener("dispose",Ln),ru(j)}function ru(C){su(C),$.remove(C)}function su(C){const j=$.get(C).programs;j!==void 0&&(j.forEach(function(K){he.releaseProgram(K)}),C.isShaderMaterial&&he.releaseShaderCache(C))}this.renderBufferDirect=function(C,j,K,W,X,Me){j===null&&(j=Gt);const Te=X.isMesh&&X.matrixWorld.determinantAffine()<0,Se=F_(C,j,K,W,X);S.setMaterial(W,Te);let ke=K.index,Ne=1;if(W.wireframe===!0){if(ke=J.getWireframeAttribute(K),ke===void 0)return;Ne=2}const qe=K.drawRange,Je=K.attributes.position;let Ie=qe.start*Ne,gt=(qe.start+qe.count)*Ne;Me!==null&&(Ie=Math.max(Ie,Me.start*Ne),gt=Math.min(gt,(Me.start+Me.count)*Ne)),ke!==null?(Ie=Math.max(Ie,0),gt=Math.min(gt,ke.count)):Je!=null&&(Ie=Math.max(Ie,0),gt=Math.min(gt,Je.count));const Ot=gt-Ie;if(Ot<0||Ot===1/0)return;ye.setup(X,W,Se,K,ke);let It,_t=pe;if(ke!==null&&(It=fe.get(ke),_t=ie,_t.setIndex(It)),X.isMesh)W.wireframe===!0?(S.setLineWidth(W.wireframeLinewidth*pt()),_t.setMode(O.LINES)):_t.setMode(O.TRIANGLES);else if(X.isLine){let ln=W.linewidth;ln===void 0&&(ln=1),S.setLineWidth(ln*pt()),X.isLineSegments?_t.setMode(O.LINES):X.isLineLoop?_t.setMode(O.LINE_LOOP):_t.setMode(O.LINE_STRIP)}else X.isPoints?_t.setMode(O.POINTS):X.isSprite&&_t.setMode(O.TRIANGLES);if(X.isBatchedMesh)if(ct.get("WEBGL_multi_draw"))_t.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const ln=X._multiDrawStarts,Ee=X._multiDrawCounts,In=X._multiDrawCount,at=ke?fe.get(ke).bytesPerElement:1,$n=$.get(W).currentProgram.getUniforms();for(let xi=0;xi<In;xi++)$n.setValue(O,"_gl_DrawID",xi),_t.render(ln[xi]/at,Ee[xi])}else if(X.isInstancedMesh)_t.renderInstances(Ie,Ot,X.count);else if(K.isInstancedBufferGeometry){const ln=K._maxInstanceCount!==void 0?K._maxInstanceCount:1/0,Ee=Math.min(K.instanceCount,ln);_t.renderInstances(Ie,Ot,Ee)}else _t.render(Ie,Ot)};function Y(C,j,K){C.transparent===!0&&C.side===di&&C.forceSinglePass===!1?(C.side=Dn,C.needsUpdate=!0,Br(C,j,K),C.side=Dr,C.needsUpdate=!0,Br(C,j,K),C.side=di):Br(C,j,K)}this.compile=function(C,j,K=null){K===null&&(K=C),w=me.get(K),w.init(j),_.push(w),K.traverseVisible(function(X){X.isLight&&X.layers.test(j.layers)&&(w.pushLight(X),X.castShadow&&w.pushShadow(X))}),C!==K&&C.traverseVisible(function(X){X.isLight&&X.layers.test(j.layers)&&(w.pushLight(X),X.castShadow&&w.pushShadow(X))}),w.setupLights();const W=new Set;return C.traverse(function(X){if(!(X.isMesh||X.isPoints||X.isLine||X.isSprite))return;const Me=X.material;if(Me)if(Array.isArray(Me))for(let Te=0;Te<Me.length;Te++){const Se=Me[Te];Y(Se,K,X),W.add(Se)}else Y(Me,K,X),W.add(Me)}),w=_.pop(),W},this.compileAsync=function(C,j,K=null){const W=this.compile(C,j,K);return new Promise(X=>{function Me(){if(W.forEach(function(Te){$.get(Te).currentProgram.isReady()&&W.delete(Te)}),W.size===0){X(C);return}setTimeout(Me,10)}ct.get("KHR_parallel_shader_compile")!==null?Me():setTimeout(Me,10)})};let ne=null;function de(C){ne&&ne(C)}function Ue(){Ve.stop()}function we(){Ve.start()}const Ve=new b_;Ve.setAnimationLoop(de),typeof self<"u"&&Ve.setContext(self),this.setAnimationLoop=function(C){ne=C,be.setAnimationLoop(C),C===null?Ve.stop():Ve.start()},be.addEventListener("sessionstart",Ue),be.addEventListener("sessionend",we),this.render=function(C,j){if(j!==void 0&&j.isCamera!==!0){ot("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(L===!0)return;R!==null&&R.renderStart(C,j);const K=be.enabled===!0&&be.isPresenting===!0,W=T!==null&&(I===null||K)&&T.begin(N,I);if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),be.enabled===!0&&be.isPresenting===!0&&(T===null||T.isCompositing()===!1)&&(be.cameraAutoUpdate===!0&&be.updateCamera(j),j=be.getCamera()),C.isScene===!0&&C.onBeforeRender(N,C,j,I),w=me.get(C,_.length),w.init(j),w.state.textureUnits=Z.getTextureUnits(),_.push(w),St.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),ut.setFromProjectionMatrix(St,Ci,j.reversedDepth),tt=this.localClippingEnabled,Xe=Le.init(this.clippingPlanes,tt),E=xe.get(C,A.length),E.init(),A.push(E),be.enabled===!0&&be.isPresenting===!0){const Te=N.xr.getDepthSensingMesh();Te!==null&&Ke(Te,j,-1/0,N.sortObjects)}Ke(C,j,0,N.sortObjects),E.finish(),N.sortObjects===!0&&E.sort(Be,$e,j.reversedDepth),Mt=be.enabled===!1||be.isPresenting===!1||be.hasDepthSensing()===!1,Mt&&We.addToRenderList(E,C),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),Xe===!0&&Le.beginShadows();const X=w.state.shadowsArray;if(ze.render(X,C,j),Xe===!0&&Le.endShadows(),(W&&T.hasRenderPass())===!1){const Te=E.opaque,Se=E.transmissive;if(w.setupLights(),j.isArrayCamera){const ke=j.cameras;if(Se.length>0)for(let Ne=0,qe=ke.length;Ne<qe;Ne++){const Je=ke[Ne];dt(Te,Se,C,Je)}Mt&&We.render(C);for(let Ne=0,qe=ke.length;Ne<qe;Ne++){const Je=ke[Ne];it(E,C,Je,Je.viewport)}}else Se.length>0&&dt(Te,Se,C,j),Mt&&We.render(C),it(E,C,j)}I!==null&&z===0&&(Z.updateMultisampleRenderTarget(I),Z.updateRenderTargetMipmap(I)),W&&T.end(N),C.isScene===!0&&C.onAfterRender(N,C,j),ye.resetDefaultState(),V=-1,Q=null,_.pop(),_.length>0?(w=_[_.length-1],Z.setTextureUnits(w.state.textureUnits),Xe===!0&&Le.setGlobalState(N.clippingPlanes,w.state.camera)):w=null,A.pop(),A.length>0?E=A[A.length-1]:E=null,R!==null&&R.renderEnd()};function Ke(C,j,K,W){if(C.visible===!1)return;if(C.layers.test(j.layers)){if(C.isGroup)K=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(j);else if(C.isLightProbeGrid)w.pushLightProbeGrid(C);else if(C.isLight)w.pushLight(C),C.castShadow&&w.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||ut.intersectsSprite(C)){W&&At.setFromMatrixPosition(C.matrixWorld).applyMatrix4(St);const Te=te.update(C),Se=C.material;Se.visible&&E.push(C,Te,Se,K,At.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||ut.intersectsObject(C))){const Te=te.update(C),Se=C.material;if(W&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),At.copy(C.boundingSphere.center)):(Te.boundingSphere===null&&Te.computeBoundingSphere(),At.copy(Te.boundingSphere.center)),At.applyMatrix4(C.matrixWorld).applyMatrix4(St)),Array.isArray(Se)){const ke=Te.groups;for(let Ne=0,qe=ke.length;Ne<qe;Ne++){const Je=ke[Ne],Ie=Se[Je.materialIndex];Ie&&Ie.visible&&E.push(C,Te,Ie,K,At.z,Je)}}else Se.visible&&E.push(C,Te,Se,K,At.z,null)}}const Me=C.children;for(let Te=0,Se=Me.length;Te<Se;Te++)Ke(Me[Te],j,K,W)}function it(C,j,K,W){const{opaque:X,transmissive:Me,transparent:Te}=C;w.setupLightsView(K),Xe===!0&&Le.setGlobalState(N.clippingPlanes,K),W&&S.viewport(re.copy(W)),X.length>0&&ii(X,j,K),Me.length>0&&ii(Me,j,K),Te.length>0&&ii(Te,j,K),S.buffers.depth.setTest(!0),S.buffers.depth.setMask(!0),S.buffers.color.setMask(!0),S.setPolygonOffset(!1)}function dt(C,j,K,W){if((K.isScene===!0?K.overrideMaterial:null)!==null)return;if(w.state.transmissionRenderTarget[W.id]===void 0){const Ie=ct.has("EXT_color_buffer_half_float")||ct.has("EXT_color_buffer_float");w.state.transmissionRenderTarget[W.id]=new ki(1,1,{generateMipmaps:!0,type:Ie?Qi:jn,minFilter:Qr,samples:Math.max(4,P.samples),stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:rt.workingColorSpace})}const Me=w.state.transmissionRenderTarget[W.id],Te=W.viewport||re;Me.setSize(Te.z*N.transmissionResolutionScale,Te.w*N.transmissionResolutionScale);const Se=N.getRenderTarget(),ke=N.getActiveCubeFace(),Ne=N.getActiveMipmapLevel();N.setRenderTarget(Me),N.getClearColor(je),Oe=N.getClearAlpha(),Oe<1&&N.setClearColor(16777215,.5),N.clear(),Mt&&We.render(K);const qe=N.toneMapping;N.toneMapping=Pi;const Je=W.viewport;if(W.viewport!==void 0&&(W.viewport=void 0),w.setupLightsView(W),Xe===!0&&Le.setGlobalState(N.clippingPlanes,W),ii(C,K,W),Z.updateMultisampleRenderTarget(Me),Z.updateRenderTargetMipmap(Me),ct.has("WEBGL_multisampled_render_to_texture")===!1){let Ie=!1;for(let gt=0,Ot=j.length;gt<Ot;gt++){const It=j[gt],{object:_t,geometry:ln,material:Ee,group:In}=It;if(Ee.side===di&&_t.layers.test(W.layers)){const at=Ee.side;Ee.side=Dn,Ee.needsUpdate=!0,jr(_t,K,W,ln,Ee,In),Ee.side=at,Ee.needsUpdate=!0,Ie=!0}}Ie===!0&&(Z.updateMultisampleRenderTarget(Me),Z.updateRenderTargetMipmap(Me))}N.setRenderTarget(Se,ke,Ne),N.setClearColor(je,Oe),Je!==void 0&&(W.viewport=Je),N.toneMapping=qe}function ii(C,j,K){const W=j.isScene===!0?j.overrideMaterial:null;for(let X=0,Me=C.length;X<Me;X++){const Te=C[X],{object:Se,geometry:ke,group:Ne}=Te;let qe=Te.material;qe.allowOverride===!0&&W!==null&&(qe=W),Se.layers.test(K.layers)&&jr(Se,j,K,ke,qe,Ne)}}function jr(C,j,K,W,X,Me){C.onBeforeRender(N,j,K,W,X,Me),C.modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),X.onBeforeRender(N,j,K,W,C,Me),X.transparent===!0&&X.side===di&&X.forceSinglePass===!1?(X.side=Dn,
vendor: 10,330 bytes, line 4155
4155X.needsUpdate=!0,N.renderBufferDirect(K,j,W,X,C,Me),X.side=Dr,X.needsUpdate=!0,N.renderBufferDirect(K,j,W,X,C,Me),X.side=di):N.renderBufferDirect(K,j,W,X,C,Me),C.onAfterRender(N,j,K,W,X,Me)}function Br(C,j,K){j.isScene!==!0&&(j=Gt);const W=$.get(C),X=w.state.lights,Me=w.state.shadowsArray,Te=X.state.version,Se=he.getParameters(C,X.state,Me,j,K,w.state.lightProbeGridArray),ke=he.getProgramCacheKey(Se);let Ne=W.programs;W.environment=C.isMeshStandardMaterial||C.isMeshLambertMaterial||C.isMeshPhongMaterial?j.environment:null,W.fog=j.fog;const qe=C.isMeshStandardMaterial||C.isMeshLambertMaterial&&!C.envMap||C.isMeshPhongMaterial&&!C.envMap;W.envMap=ce.get(C.envMap||W.environment,qe),W.envMapRotation=W.environment!==null&&C.envMap===null?j.environmentRotation:C.envMapRotation,Ne===void 0&&(C.addEventListener("dispose",Ln),Ne=new Map,W.programs=Ne);let Je=Ne.get(ke);if(Je!==void 0){if(W.currentProgram===Je&&W.lightsStateVersion===Te)return Ho(C,Se),Je}else Se.uniforms=he.getUniforms(C),R!==null&&C.isNodeMaterial&&R.build(C,K,Se),C.onBeforeCompile(Se,N),Je=he.acquireProgram(Se,ke),Ne.set(ke,Je),W.uniforms=Se.uniforms;const Ie=W.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(Ie.clippingPlanes=Le.uniform),Ho(C,Se),W.needsLights=z_(C),W.lightsStateVersion=Te,W.needsLights&&(Ie.ambientLightColor.value=X.state.ambient,Ie.lightProbe.value=X.state.probe,Ie.directionalLights.value=X.state.directional,Ie.directionalLightShadows.value=X.state.directionalShadow,Ie.spotLights.value=X.state.spot,Ie.spotLightShadows.value=X.state.spotShadow,Ie.rectAreaLights.value=X.state.rectArea,Ie.ltc_1.value=X.state.rectAreaLTC1,Ie.ltc_2.value=X.state.rectAreaLTC2,Ie.pointLights.value=X.state.point,Ie.pointLightShadows.value=X.state.pointShadow,Ie.hemisphereLights.value=X.state.hemi,Ie.directionalShadowMatrix.value=X.state.directionalShadowMatrix,Ie.spotLightMatrix.value=X.state.spotLightMatrix,Ie.spotLightMap.value=X.state.spotLightMap,Ie.pointShadowMatrix.value=X.state.pointShadowMatrix),W.lightProbeGrid=w.state.lightProbeGridArray.length>0,W.currentProgram=Je,W.uniformsList=null,Je}function ba(C){if(C.uniformsList===null){const j=C.currentProgram.getUniforms();C.uniformsList=tc.seqWithValue(j.seq,C.uniforms)}return C.uniformsList}function Ho(C,j){const K=$.get(C);K.outputColorSpace=j.outputColorSpace,K.batching=j.batching,K.batchingColor=j.batchingColor,K.instancing=j.instancing,K.instancingColor=j.instancingColor,K.instancingMorph=j.instancingMorph,K.skinning=j.skinning,K.morphTargets=j.morphTargets,K.morphNormals=j.morphNormals,K.morphColors=j.morphColors,K.morphTargetsCount=j.morphTargetsCount,K.numClippingPlanes=j.numClippingPlanes,K.numIntersection=j.numClipIntersection,K.vertexAlphas=j.vertexAlphas,K.vertexTangents=j.vertexTangents,K.toneMapping=j.toneMapping}function U_(C,j){if(C.length===0)return null;if(C.length===1)return C[0].texture!==null?C[0]:null;M.setFromMatrixPosition(j.matrixWorld);for(let K=0,W=C.length;K<W;K++){const X=C[K];if(X.texture!==null&&X.boundingBox.containsPoint(M))return X}return null}function F_(C,j,K,W,X){j.isScene!==!0&&(j=Gt),Z.resetTextureUnits();const Me=j.fog,Te=W.isMeshStandardMaterial||W.isMeshLambertMaterial||W.isMeshPhongMaterial?j.environment:null,Se=I===null?N.outputColorSpace:I.isXRRenderTarget===!0?I.texture.colorSpace:rt.workingColorSpace,ke=W.isMeshStandardMaterial||W.isMeshLambertMaterial&&!W.envMap||W.isMeshPhongMaterial&&!W.envMap,Ne=ce.get(W.envMap||Te,ke),qe=W.vertexColors===!0&&!!K.attributes.color&&K.attributes.color.itemSize===4,Je=!!K.attributes.tangent&&(!!W.normalMap||W.anisotropy>0),Ie=!!K.morphAttributes.position,gt=!!K.morphAttributes.normal,Ot=!!K.morphAttributes.color;let It=Pi;W.toneMapped&&(I===null||I.isXRRenderTarget===!0)&&(It=N.toneMapping);const _t=K.morphAttributes.position||K.morphAttributes.normal||K.morphAttributes.color,ln=_t!==void 0?_t.length:0,Ee=$.get(W),In=w.state.lights;if(Xe===!0&&(tt===!0||C!==Q)){const Et=C===Q&&W.id===V;Le.setState(W,C,Et)}let at=!1;W.version===Ee.__version?(Ee.needsLights&&Ee.lightsStateVersion!==In.state.version||Ee.outputColorSpace!==Se||X.isBatchedMesh&&Ee.batching===!1||!X.isBatchedMesh&&Ee.batching===!0||X.isBatchedMesh&&Ee.batchingColor===!0&&X.colorTexture===null||X.isBatchedMesh&&Ee.batchingColor===!1&&X.colorTexture!==null||X.isInstancedMesh&&Ee.instancing===!1||!X.isInstancedMesh&&Ee.instancing===!0||X.isSkinnedMesh&&Ee.skinning===!1||!X.isSkinnedMesh&&Ee.skinning===!0||X.isInstancedMesh&&Ee.instancingColor===!0&&X.instanceColor===null||X.isInstancedMesh&&Ee.instancingColor===!1&&X.instanceColor!==null||X.isInstancedMesh&&Ee.instancingMorph===!0&&X.morphTexture===null||X.isInstancedMesh&&Ee.instancingMorph===!1&&X.morphTexture!==null||Ee.envMap!==Ne||W.fog===!0&&Ee.fog!==Me||Ee.numClippingPlanes!==void 0&&(Ee.numClippingPlanes!==Le.numPlanes||Ee.numIntersection!==Le.numIntersection)||Ee.vertexAlphas!==qe||Ee.vertexTangents!==Je||Ee.morphTargets!==Ie||Ee.morphNormals!==gt||Ee.morphColors!==Ot||Ee.toneMapping!==It||Ee.morphTargetsCount!==ln||!!Ee.lightProbeGrid!=w.state.lightProbeGridArray.length>0)&&(at=!0):(at=!0,Ee.__version=W.version);let $n=Ee.currentProgram;at===!0&&($n=Br(W,j,X),R&&W.isNodeMaterial&&R.onUpdateProgram(W,$n,Ee));let xi=!1,nr=!1,vs=!1;const yt=$n.getUniforms(),zt=Ee.uniforms;if(S.useProgram($n.program)&&(xi=!0,nr=!0,vs=!0),W.id!==V&&(V=W.id,nr=!0),Ee.needsLights){const Et=U_(w.state.lightProbeGridArray,X);Ee.lightProbeGrid!==Et&&(Ee.lightProbeGrid=Et,nr=!0)}if(xi||Q!==C){S.buffers.depth.getReversed()&&C.reversedDepth!==!0&&(C._reversedDepth=!0,C.updateProjectionMatrix()),yt.setValue(O,"projectionMatrix",C.projectionMatrix),yt.setValue(O,"viewMatrix",C.matrixWorldInverse);const rr=yt.map.cameraPosition;rr!==void 0&&rr.setValue(O,ve.setFromMatrixPosition(C.matrixWorld)),P.logarithmicDepthBuffer&&yt.setValue(O,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(W.isMeshPhongMaterial||W.isMeshToonMaterial||W.isMeshLambertMaterial||W.isMeshBasicMaterial||W.isMeshStandardMaterial||W.isShaderMaterial)&&yt.setValue(O,"isOrthographic",C.isOrthographicCamera===!0),Q!==C&&(Q=C,nr=!0,vs=!0)}if(Ee.needsLights&&(In.state.directionalShadowMap.length>0&&yt.setValue(O,"directionalShadowMap",In.state.directionalShadowMap,Z),In.state.spotShadowMap.length>0&&yt.setValue(O,"spotShadowMap",In.state.spotShadowMap,Z),In.state.pointShadowMap.length>0&&yt.setValue(O,"pointShadowMap",In.state.pointShadowMap,Z)),X.isSkinnedMesh){yt.setOptional(O,X,"bindMatrix"),yt.setOptional(O,X,"bindMatrixInverse");const Et=X.skeleton;Et&&(Et.boneTexture===null&&Et.computeBoneTexture(),yt.setValue(O,"boneTexture",Et.boneTexture,Z))}X.isBatchedMesh&&(yt.setOptional(O,X,"batchingTexture"),yt.setValue(O,"batchingTexture",X._matricesTexture,Z),yt.setOptional(O,X,"batchingIdTexture"),yt.setValue(O,"batchingIdTexture",X._indirectTexture,Z),yt.setOptional(O,X,"batchingColorTexture"),X._colorsTexture!==null&&yt.setValue(O,"batchingColorTexture",X._colorsTexture,Z));const ir=K.morphAttributes;if((ir.position!==void 0||ir.normal!==void 0||ir.color!==void 0)&&U.update(X,K,$n),(nr||Ee.receiveShadow!==X.receiveShadow)&&(Ee.receiveShadow=X.receiveShadow,yt.setValue(O,"receiveShadow",X.receiveShadow)),(W.isMeshStandardMaterial||W.isMeshLambertMaterial||W.isMeshPhongMaterial)&&W.envMap===null&&j.environment!==null&&(zt.envMapIntensity.value=j.environmentIntensity),zt.dfgLUT!==void 0&&(zt.dfgLUT.value=iR()),nr){if(yt.setValue(O,"toneMappingExposure",N.toneMappingExposure),Ee.needsLights&&O_(zt,vs),Me&&W.fog===!0&&Ae.refreshFogUniforms(zt,Me),Ae.refreshMaterialUniforms(zt,W,oe,ue,w.state.transmissionRenderTarget[C.id]),Ee.needsLights&&Ee.lightProbeGrid){const Et=Ee.lightProbeGrid;zt.probesSH.value=Et.texture,zt.probesMin.value.copy(Et.boundingBox.min),zt.probesMax.value.copy(Et.boundingBox.max),zt.probesResolution.value.copy(Et.resolution)}tc.upload(O,ba(Ee),zt,Z)}if(W.isShaderMaterial&&W.uniformsNeedUpdate===!0&&(tc.upload(O,ba(Ee),zt,Z),W.uniformsNeedUpdate=!1),W.isSpriteMaterial&&yt.setValue(O,"center",X.center),yt.setValue(O,"modelViewMatrix",X.modelViewMatrix),yt.setValue(O,"normalMatrix",X.normalMatrix),yt.setValue(O,"modelMatrix",X.matrixWorld),W.uniformsGroups!==void 0){const Et=W.uniformsGroups;for(let rr=0,xs=Et.length;rr<xs;rr++){const Fp=Et[rr];se.update(Fp,$n),se.bind(Fp,$n)}}return $n}function O_(C,j){C.ambientLightColor.needsUpdate=j,C.lightProbe.needsUpdate=j,C.directionalLights.needsUpdate=j,C.directionalLightShadows.needsUpdate=j,C.pointLights.needsUpdate=j,C.pointLightShadows.needsUpdate=j,C.spotLights.needsUpdate=j,C.spotLightShadows.needsUpdate=j,C.rectAreaLights.needsUpdate=j,C.hemisphereLights.needsUpdate=j}function z_(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return z},this.getRenderTarget=function(){return I},this.setRenderTargetTextures=function(C,j,K){const W=$.get(C);W.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,W.__autoAllocateDepthBuffer===!1&&(W.__useRenderToTexture=!1),$.get(C.texture).__webglTexture=j,$.get(C.depthTexture).__webglTexture=W.__autoAllocateDepthBuffer?void 0:K,W.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,j){const K=$.get(C);K.__webglFramebuffer=j,K.__useDefaultFramebuffer=j===void 0},this.setRenderTarget=function(C,j=0,K=0){I=C,B=j,z=K;let W=null,X=!1,Me=!1;if(C){const Se=$.get(C);if(Se.__useDefaultFramebuffer!==void 0){S.bindFramebuffer(O.FRAMEBUFFER,Se.__webglFramebuffer),re.copy(C.viewport),ae.copy(C.scissor),Fe=C.scissorTest,S.viewport(re),S.scissor(ae),S.setScissorTest(Fe),V=-1;return}else if(Se.__webglFramebuffer===void 0)Z.setupRenderTarget(C);else if(Se.__hasExternalTextures)Z.rebindTextures(C,$.get(C.texture).__webglTexture,$.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const qe=C.depthTexture;if(Se.__boundDepthTexture!==qe){if(qe!==null&&$.has(qe)&&(C.width!==qe.image.width||C.height!==qe.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");Z.setupDepthRenderbuffer(C)}}const ke=C.texture;(ke.isData3DTexture||ke.isDataArrayTexture||ke.isCompressedArrayTexture)&&(Me=!0);const Ne=$.get(C).__webglFramebuffer;
vendor: 4,963 bytes, line 4155
4155C.isWebGLCubeRenderTarget?(Array.isArray(Ne[j])?W=Ne[j][K]:W=Ne[j],X=!0):C.samples>0&&Z.useMultisampledRTT(C)===!1?W=$.get(C).__webglMultisampledFramebuffer:Array.isArray(Ne)?W=Ne[K]:W=Ne,re.copy(C.viewport),ae.copy(C.scissor),Fe=C.scissorTest}else re.copy(Pe).multiplyScalar(oe).floor(),ae.copy(wt).multiplyScalar(oe).floor(),Fe=Qe;if(K!==0&&(W=D),S.bindFramebuffer(O.FRAMEBUFFER,W)&&S.drawBuffers(C,W),S.viewport(re),S.scissor(ae),S.setScissorTest(Fe),X){const Se=$.get(C.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+j,Se.__webglTexture,K)}else if(Me){const Se=j;for(let ke=0;ke<C.textures.length;ke++){const Ne=$.get(C.textures[ke]);O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0+ke,Ne.__webglTexture,K,Se)}}else if(C!==null&&K!==0){const Se=$.get(C.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Se.__webglTexture,K)}V=-1},this.readRenderTargetPixels=function(C,j,K,W,X,Me,Te,Se=0){if(!(C&&C.isWebGLRenderTarget)){ot("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ke=$.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Te!==void 0&&(ke=ke[Te]),ke){S.bindFramebuffer(O.FRAMEBUFFER,ke);try{const Ne=C.textures[Se],qe=Ne.format,Je=Ne.type;if(C.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Se),!P.textureFormatReadable(qe)){ot("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!P.textureTypeReadable(Je)){ot("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=C.width-W&&K>=0&&K<=C.height-X&&O.readPixels(j,K,W,X,ge.convert(qe),ge.convert(Je),Me)}finally{const Ne=I!==null?$.get(I).__webglFramebuffer:null;S.bindFramebuffer(O.FRAMEBUFFER,Ne)}}},this.readRenderTargetPixelsAsync=async function(C,j,K,W,X,Me,Te,Se=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ke=$.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Te!==void 0&&(ke=ke[Te]),ke)if(j>=0&&j<=C.width-W&&K>=0&&K<=C.height-X){S.bindFramebuffer(O.FRAMEBUFFER,ke);const Ne=C.textures[Se],qe=Ne.format,Je=Ne.type;if(C.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Se),!P.textureFormatReadable(qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!P.textureTypeReadable(Je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ie=O.createBuffer();O.bindBuffer(O.PIXEL_PACK_BUFFER,Ie),O.bufferData(O.PIXEL_PACK_BUFFER,Me.byteLength,O.STREAM_READ),O.readPixels(j,K,W,X,ge.convert(qe),ge.convert(Je),0);const gt=I!==null?$.get(I).__webglFramebuffer:null;S.bindFramebuffer(O.FRAMEBUFFER,gt);const Ot=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0);return O.flush(),await Sb(O,Ot,4),O.bindBuffer(O.PIXEL_PACK_BUFFER,Ie),O.getBufferSubData(O.PIXEL_PACK_BUFFER,0,Me),O.deleteBuffer(Ie),O.deleteSync(Ot),Me}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,j=null,K=0){const W=Math.pow(2,-K),X=Math.floor(C.image.width*W),Me=Math.floor(C.image.height*W),Te=j!==null?j.x:0,Se=j!==null?j.y:0;Z.setTexture2D(C,0),O.copyTexSubImage2D(O.TEXTURE_2D,K,0,0,Te,Se,X,Me),S.unbindTexture()},this.copyTextureToTexture=function(C,j,K=null,W=null,X=0,Me=0){let Te,Se,ke,Ne,qe,Je,Ie,gt,Ot;const It=C.isCompressedTexture?C.mipmaps[Me]:C.image;if(K!==null)Te=K.max.x-K.min.x,Se=K.max.y-K.min.y,ke=K.isBox3?K.max.z-K.min.z:1,Ne=K.min.x,qe=K.min.y,Je=K.isBox3?K.min.z:0;else{const zt=Math.pow(2,-X);Te=Math.floor(It.width*zt),Se=Math.floor(It.height*zt),C.isDataArrayTexture?ke=It.depth:C.isData3DTexture?ke=Math.floor(It.depth*zt):ke=1,Ne=0,qe=0,Je=0}W!==null?(Ie=W.x,gt=W.y,Ot=W.z):(Ie=0,gt=0,Ot=0);const _t=ge.convert(j.format),ln=ge.convert(j.type);let Ee;j.isData3DTexture?(Z.setTexture3D(j,0),Ee=O.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(Z.setTexture2DArray(j,0),Ee=O.TEXTURE_2D_ARRAY):(Z.setTexture2D(j,0),Ee=O.TEXTURE_2D),S.activeTexture(O.TEXTURE0),S.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,j.flipY),S.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),S.pixelStorei(O.UNPACK_ALIGNMENT,j.unpackAlignment);const In=S.getParameter(O.UNPACK_ROW_LENGTH),at=S.getParameter(O.UNPACK_IMAGE_HEIGHT),$n=S.getParameter(O.UNPACK_SKIP_PIXELS),xi=S.getParameter(O.UNPACK_SKIP_ROWS),nr=S.getParameter(O.UNPACK_SKIP_IMAGES);S.pixelStorei(O.UNPACK_ROW_LENGTH,It.width),S.pixelStorei(O.UNPACK_IMAGE_HEIGHT,It.height),S.pixelStorei(O.UNPACK_SKIP_PIXELS,Ne),S.pixelStorei(O.UNPACK_SKIP_ROWS,qe),S.pixelStorei(O.UNPACK_SKIP_IMAGES,Je);const vs=C.isDataArrayTexture||C.isData3DTexture,yt=j.isDataArrayTexture||j.isData3DTexture;
vendor: 22,810 bytes, line 4155
4155if(C.isDepthTexture){const zt=$.get(C),ir=$.get(j),Et=$.get(zt.__renderTarget),rr=$.get(ir.__renderTarget);S.bindFramebuffer(O.READ_FRAMEBUFFER,Et.__webglFramebuffer),S.bindFramebuffer(O.DRAW_FRAMEBUFFER,rr.__webglFramebuffer);for(let xs=0;xs<ke;xs++)vs&&(O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,$.get(C).__webglTexture,X,Je+xs),O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,$.get(j).__webglTexture,Me,Ot+xs)),O.blitFramebuffer(Ne,qe,Te,Se,Ie,gt,Te,Se,O.DEPTH_BUFFER_BIT,O.NEAREST);S.bindFramebuffer(O.READ_FRAMEBUFFER,null),S.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else if(X!==0||C.isRenderTargetTexture||$.has(C)){const zt=$.get(C),ir=$.get(j);S.bindFramebuffer(O.READ_FRAMEBUFFER,F),S.bindFramebuffer(O.DRAW_FRAMEBUFFER,k);for(let Et=0;Et<ke;Et++)vs?O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,zt.__webglTexture,X,Je+Et):O.framebufferTexture2D(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,zt.__webglTexture,X),yt?O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,ir.__webglTexture,Me,Ot+Et):O.framebufferTexture2D(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,ir.__webglTexture,Me),X!==0?O.blitFramebuffer(Ne,qe,Te,Se,Ie,gt,Te,Se,O.COLOR_BUFFER_BIT,O.NEAREST):yt?O.copyTexSubImage3D(Ee,Me,Ie,gt,Ot+Et,Ne,qe,Te,Se):O.copyTexSubImage2D(Ee,Me,Ie,gt,Ne,qe,Te,Se);S.bindFramebuffer(O.READ_FRAMEBUFFER,null),S.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else yt?C.isDataTexture||C.isData3DTexture?O.texSubImage3D(Ee,Me,Ie,gt,Ot,Te,Se,ke,_t,ln,It.data):j.isCompressedArrayTexture?O.compressedTexSubImage3D(Ee,Me,Ie,gt,Ot,Te,Se,ke,_t,It.data):O.texSubImage3D(Ee,Me,Ie,gt,Ot,Te,Se,ke,_t,ln,It):C.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,Me,Ie,gt,Te,Se,_t,ln,It.data):C.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,Me,Ie,gt,It.width,It.height,_t,It.data):O.texSubImage2D(O.TEXTURE_2D,Me,Ie,gt,Te,Se,_t,ln,It);S.pixelStorei(O.UNPACK_ROW_LENGTH,In),S.pixelStorei(O.UNPACK_IMAGE_HEIGHT,at),S.pixelStorei(O.UNPACK_SKIP_PIXELS,$n),S.pixelStorei(O.UNPACK_SKIP_ROWS,xi),S.pixelStorei(O.UNPACK_SKIP_IMAGES,nr),Me===0&&j.generateMipmaps&&O.generateMipmap(Ee),S.unbindTexture()},this.initRenderTarget=function(C){$.get(C).__webglFramebuffer===void 0&&Z.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?Z.setTextureCube(C,0):C.isData3DTexture?Z.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?Z.setTexture2DArray(C,0):Z.setTexture2D(C,0),S.unbindTexture()},this.resetState=function(){B=0,z=0,I=null,S.reset(),ye.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ci}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=rt._getDrawingBufferColorSpace(e),n.unpackColorSpace=rt._getUnpackColorSpace()}}const s0={type:"change"},kp={type:"start"},N_={type:"end"},kl=new x_,a0=new mr,sR=Math.cos(70*bb.DEG2RAD),Wt=new H,bn=2*Math.PI,vt={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},md=1e-6;class aR extends lw{constructor(e,n=null){super(e,n),this.state=vt.NONE,this.target=new H,this.cursor=new H,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:ia.ROTATE,MIDDLE:ia.DOLLY,RIGHT:ia.PAN},this.touches={ONE:qs.ROTATE,TWO:qs.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new H,this._lastQuaternion=new Lr,this._lastTargetPosition=new H,this._quat=new Lr().setFromUnitVectors(e.up,new H(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Dg,this._sphericalDelta=new Dg,this._scale=1,this._panOffset=new H,this._rotateStart=new De,this._rotateEnd=new De,this._rotateDelta=new De,this._panStart=new De,this._panEnd=new De,this._panDelta=new De,this._dollyStart=new De,this._dollyEnd=new De,this._dollyDelta=new De,this._dollyDirection=new H,this._mouse=new De,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=lR.bind(this),this._onPointerDown=oR.bind(this),this._onPointerUp=cR.bind(this),this._onContextMenu=gR.bind(this),this._onMouseWheel=fR.bind(this),this._onKeyDown=hR.bind(this),this._onTouchStart=pR.bind(this),this._onTouchMove=mR.bind(this),this._onMouseDown=uR.bind(this),this._onMouseMove=dR.bind(this),this._interceptControlDown=vR.bind(this),this._interceptControlUp=xR.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=""}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(s0),this.update(),this.state=vt.NONE}pan(e,n){this._pan(e,n),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){const n=this.object.position;Wt.copy(n).sub(this.target),Wt.applyQuaternion(this._quat),this._spherical.setFromVector3(Wt),this.autoRotate&&this.state===vt.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(i)&&isFinite(r)&&(i<-Math.PI?i+=bn:i>Math.PI&&(i-=bn),r<-Math.PI?r+=bn:r>Math.PI&&(r-=bn),i<=r?this._spherical.theta=Math.max(i,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+r)/2?Math.max(i,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=a!=this._spherical.radius}if(Wt.setFromSpherical(this._spherical),Wt.applyQuaternion(this._quatInverse),n.copy(this.target).add(Wt),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=Wt.length();a=this._clampDistance(o*this._scale);const l=o-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const o=new H(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const u=new H(this._mouse.x,this._mouse.y,0);u.unproject(this.object),this.object.position.sub(u).add(o),this.object.updateMatrixWorld(),a=Wt.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(kl.origin.copy(this.object.position),kl.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(kl.direction))<sR?this.object.lookAt(this.target):(a0.setFromNormalAndCoplanarPoint(this.object.up,this.target),kl.intersectPlane(a0,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,this._performCursorZoom=!1,s||this._lastPosition.distanceToSquared(this.object.position)>md||8*(1-this._lastQuaternion.dot(this.object.quaternion))>md||this._lastTargetPosition.distanceToSquared(this.target)>md?(this.dispatchEvent(s0),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?bn/60*this.autoRotateSpeed*e:bn/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){Wt.setFromMatrixColumn(n,0),Wt.multiplyScalar(-e),this._panOffset.add(Wt)}_panUp(e,n){this.screenSpacePanning===!0?Wt.setFromMatrixColumn(n,1):(Wt.setFromMatrixColumn(n,0),Wt.crossVectors(this.object.up,Wt)),Wt.multiplyScalar(e),this._panOffset.add(Wt)}_pan(e,n){const i=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;Wt.copy(r).sub(this.target);let s=Wt.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/i.clientHeight,this.object.matrix),this._panUp(2*n*s/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),r=e-i.left,s=n-i.top,a=i.width,o=i.height;this._mouse.x=r/a*2-1,this._mouse.y=-(s/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(bn*this._rotateDelta.x/n.clientHeight),this._rotateUp(bn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(bn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-bn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(bn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-bn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._rotateStart.set(i,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._panStart.set(i,r)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const i=this._getSecondPointerPosition(e),r=.5*(e.pageX+i.x),s=.5*(e.pageY+i.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(bn*this._rotateDelta.x/n.clientHeight),this._rotateUp(bn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._panEnd.set(i,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+n.x)*.5,o=(e.pageY+n.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n<this._pointers.length;n++)if(this._pointers[n]==e.pointerId){this._pointers.splice(n,1);return}}_isTrackingPointer(e){for(let n=0;n<this._pointers.length;n++)if(this._pointers[n]==e.pointerId)return!0;return!1}_trackPointer(e){let n=this._pointerPositions[e.pointerId];n===void 0&&(n=new De,this._pointerPositions[e.pointerId]=n),n.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const n=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[n]}_customWheelEvent(e){const n=e.deltaMode,i={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(n){case 1:i.deltaY*=16;break;case 2:i.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(i.deltaY*=10),i}}function oR(t){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(t)&&(this._addPointer(t),t.pointerType==="touch"?this._onTouchStart(t):this._onMouseDown(t),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function lR(t){this.enabled!==!1&&(t.pointerType==="touch"?this._onTouchMove(t):this._onMouseMove(t))}function cR(t){switch(this._removePointer(t),this._pointers.length){case 0:this.domElement.releasePointerCapture(t.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(N_),this.state=vt.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const e=this._pointers[0],n=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:n.x,pageY:n.y});break}}function uR(t){let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case ia.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(t),this.state=vt.DOLLY;break;case ia.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(t),this.state=vt.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(t),this.state=vt.ROTATE}break;case ia.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(t),this.state=vt.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(t),this.state=vt.PAN}break;default:this.state=vt.NONE}this.state!==vt.NONE&&this.dispatchEvent(kp)}function dR(t){switch(this.state){case vt.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(t);break;case vt.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(t);break;case vt.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(t);break}}function fR(t){this.enabled===!1||this.enableZoom===!1||this.state!==vt.NONE||(t.preventDefault(),this.dispatchEvent(kp),this._handleMouseWheel(this._customWheelEvent(t)),this.dispatchEvent(N_))}function hR(t){this.enabled!==!1&&this._handleKeyDown(t)}function pR(t){switch(this._trackPointer(t),this._pointers.length){case 1:switch(this.touches.ONE){case qs.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(t),this.state=vt.TOUCH_ROTATE;break;case qs.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(t),this.state=vt.TOUCH_PAN;break;default:this.state=vt.NONE}break;case 2:switch(this.touches.TWO){case qs.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(t),this.state=vt.TOUCH_DOLLY_PAN;break;case qs.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(t),this.state=vt.TOUCH_DOLLY_ROTATE;break;default:this.state=vt.NONE}break;default:this.state=vt.NONE}this.state!==vt.NONE&&this.dispatchEvent(kp)}function mR(t){switch(this._trackPointer(t),this.state){case vt.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(t),this.update();break;case vt.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(t),this.update();break;case vt.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(t),this.update();break;case vt.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(t),this.update();break;default:this.state=vt.NONE}}function gR(t){this.enabled!==!1&&t.preventDefault()}function vR(t){t.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function xR(t){t.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const _R=36;function Go(t,e,n){const i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d");n(r);const s=new y_(i);
4155return s.colorSpace=Cn,s.anisotropy=4,s}function yR(t){return Go(512,512,e=>{e.fillStyle=t.brandColor,e.fillRect(0,0,512,512),e.fillStyle=t.accentColor,e.fillRect(0,512*.56,512,512*.14),e.fillStyle=t.textColor,e.textAlign="center",e.textBaseline="middle";const n=t.name.charAt(0),i=t.name.toUpperCase().slice(0,14);for(const r of[256,0,512])e.font="800 190px system-ui, sans-serif",e.fillText(n,r,512*.32),e.font="700 34px system-ui, sans-serif",e.fillText(i,r,512*.82)})}function SR(t){const e=document.createElement("canvas");e.width=512,e.height=512;const n=e.getContext("2d");n.fillStyle=t.brandColor,n.fillRect(0,0,512,512);const i=new y_(e);i.colorSpace=Cn,i.anisotropy=4;const r=new Image;return r.onload=()=>{const s=512/Math.PI;n.drawImage(r,256-s/2,0,s,512),n.drawImage(r,-s/2,0,s,512),n.drawImage(r,512-s/2,0,s,512),i.needsUpdate=!0},r.src=t.image,i}function MR(t,e,n,i,r){return Go(360,132,s=>{const o=Px(t,326,25,2),l=wn(e,n),u=kx(l,326,48,34),f=i??Cc;s.fillStyle=f,s.fillRect(0,0,360,132),s.strokeStyle=Wa(f,.72),s.lineWidth=3,s.strokeRect(1.5,1.5,357,129),s.fillStyle=ap(f,"#4b5563"),s.font="600 25px system-ui, sans-serif",s.textAlign="center",s.textBaseline="alphabetic",o.forEach((p,h)=>s.fillText(p,180,o.length===1?48:30+h*29,326)),s.fillStyle=r??Ac,s.font=`800 ${u}px system-ui, sans-serif`,s.fillText(l,180,119,326)})}function o0(t,e,n,i,r,s){t.beginPath();for(let a=0;a<s*2;a++){const o=a%2===0?i:r,l=-Math.PI/2+a*Math.PI/s,u=e+o*Math.cos(l),f=n+o*Math.sin(l);a===0?t.moveTo(u,f):t.lineTo(u,f)}t.closePath()}function ER(t,e,n){return Go(512,512,i=>{i.clearRect(0,0,512,512);const r=256,s=256;switch(i.fillStyle=e,i.strokeStyle="#ffffff",i.lineWidth=14,i.lineJoin="round",t){case"star":o0(i,r,s,240,120,5);break;case"burst":o0(i,r,s,240,172,12);break;case"tag":i.save(),i.translate(r,s),i.rotate(-.14),i.beginPath(),i.roundRect(-230,-115,460,230,26),i.restore();break;case"arrow":i.beginPath(),i.moveTo(16,s-100),i.lineTo(330,s-100),i.lineTo(330,s-170),i.lineTo(496,s),i.lineTo(330,s+170),i.lineTo(330,s+100),i.lineTo(16,s+100),i.closePath();break;default:i.beginPath(),i.arc(r,s,235,0,Math.PI*2)}i.fill(),i.stroke(),i.fillStyle="#ffffff";const a=Math.min(140,620/Math.max(3,n.length));i.font=`800 ${a}px system-ui, sans-serif`,i.textAlign="center",i.textBaseline="middle",i.fillText(n,r,s+6)})}function bR(t,e,n,i,r){const a=Math.round(n*10),o=Math.round(i*10);return Go(a,o,l=>{l.fillStyle=e,l.beginPath(),l.roundRect(0,0,a,o,8),l.fill(),l.strokeStyle="#ffffff",l.lineWidth=5,l.stroke(),l.fillStyle="#ffffff",l.textAlign="center",l.textBaseline="middle",r?(l.save(),l.translate(a/2,o/2),l.rotate(-Math.PI/2),l.font=`800 ${Math.min(a*.55,o*.9/Math.max(4,t.length*.62))}px system-ui, sans-serif`,l.fillText(t,0,0),l.restore()):(l.font=`800 ${Math.min(o*.55,a*.92/Math.max(4,t.length*.62))}px system-ui, sans-serif`,l.fillText(t,a/2,o/2))})}function wR({shelf:t,groups:e,marketing:n,products:i,onReadyCapture:r}){const{t:s}=Pt(),a=q.useRef(null),o=q.useRef(null);return q.useEffect(()=>{const l=a.current;if(!l)return;const u=new Ob;u.background=new st(15790837);const f=new Zn(40,1,1,4e3),p=t.widthCm/2,h=t.heightCm/2;f.position.set(p+t.widthCm*.52,t.heightCm*.83,t.heightCm*1.62);const m=new rR({antialias:!0,preserveDrawingBuffer:!0});m.setPixelRatio(Math.min(window.devicePixelRatio,2)),l.appendChild(m.domElement);const x=new aR(f,m.domElement);x.target.set(p,h-Ys*.35,0),x.enableDamping=!0,x.dampingFactor=.08,x.maxPolarAngle=Math.PI*.55,x.minDistance=40,x.maxDistance=900,u.add(new sw(16777215,1.2)),u.add(new nw(16777215,10068912,.7));const y=new Ng(16777215,1.8);y.position.set(p+120,t.heightCm+160,260),u.add(y);const g=new Ng(16777215,.6);g.position.set(p-150,t.heightCm*.5,-100),u.add(g);const d=new _n(new Tp(t.widthCm*2.2,48),new ks({color:14869994,roughness:.95}));d.rotation.x=-Math.PI/2,d.position.set(p,-8.8,0),u.add(d);const v=new Ya;o.current=v,u.add(v);const b=()=>{const A=l.clientWidth,_=l.clientHeight;m.setSize(A,_),f.aspect=A/Math.max(1,_),f.updateProjectionMatrix()};b();const M=new ResizeObserver(b);M.observe(l);let E=0;const w=()=>{E=requestAnimationFrame(w),x.update(),m.render(u,f)};return w(),r==null||r(()=>(m.render(u,f),m.domElement.toDataURL("image/png"))),()=>{cancelAnimationFrame(E),M.disconnect(),x.dispose(),m.dispose(),l.removeChild(m.domElement),o.current=null}},[t.id]),q.useEffect(()=>{var _;const l=o.current;if(!l)return;for(;l.children.length;)l.remove(l.children[0]);const u=new ks({color:11186360,roughness:.6,metalness:.25}),f=new ks({color:9278364,roughness:.6,metalness:.25}),p=new ks({color:16053751,roughness:.4}),h=new ks({color:14080734,roughness:.35,metalness:.7}),m=t.widthCm,x=t.heightCm,y=_R,g=Ro(t),d=Va,v=(T,N,L,R,D,F,k)=>{const B=new _n(new fs(T,N,L),R);B.position.set(D,F,k),l.add(B)};v(m+2*zn,x+d,2,f,m/2,(x+d)/2,-y/2-1),v(zn,x+d,y,f,-zn/2,(x+d)/2,0),v(zn,x+d,y,f,m+zn/2,(x+d)/2,0),v(m+2*zn,d,y,u,m/2,x+d/2,0);const b=T=>
4155T*g-Ys/2+d/2;for(let T=0;T<t.levels;T++){const N=T*g;v(m,d,y,u,m/2,N-d/2+.01,0),v(m,Ys,.8,p,m/2,b(T),y/2+.5)}const M=new Map,E=new Map,w=(T,N)=>{var I;const L=T?is(T):Tc(N),R=T?To(T):Ao(N),D=T?Co(T):ff(N),F=((I=T==null?void 0:T.package)==null?void 0:I.shape)??N.packageShape??"can",k=`${F}:${L}:${R}:${D}`,B=E.get(k);if(B)return B;let z;if(F==="can"||F==="jar")z=new Cp(L/2,L/2,R,28);else if(F==="squeeze-bottle"||F==="bottle"){const V=L/2;z=new Ap([new De(V*.82,0),new De(V,R*.08),new De(V*.94,R*.7),new De(V*.82,R*.78),new De(V*.46,R*.88),new De(V*.38,R)],28),z.translate(0,-R/2,0),z.scale(1,1,D/Math.max(L,.1))}else z=new fs(L,R,Math.max(1.2,D));return E.set(k,z),z},A=T=>{const N=(T==null?void 0:T.id)??"missing";let L=M.get(N);return L||(T!=null&&T.image?L=SR(T):T?L=yR(T):L=Go(8,8,D=>{D.fillStyle="#9aa0a6",D.fillRect(0,0,8,8)}),M.set(N,L)),[new ks({map:L,roughness:.45,metalness:.05}),h,h]};for(const T of e){const N=i[T.productId],L=A(N),R=((_=N==null?void 0:N.package)==null?void 0:_.shape)??T.packageShape??"can",D=N?is(N):Tc(T),F=N?To(N):Ao(T),k=N?Co(N):ff(T),B=Qc(D),z=w(N,T),I=T.level*g;for(let Fe=0;Fe<T.rows;Fe++)for(let je=0;je<T.facings;je++){const Oe=new _n(z,R==="can"||R==="jar"?L:L[0]);Oe.position.set(T.xCm+je*B+D/2,I+F/2,y/2-k/2-Fe*(k+.8)),Oe.rotation.y=Math.PI,l.add(Oe)}const V=Tn(T),Q=Math.min(18,Math.max(9,V*.92)),re=Ys-.8,ae=new _n(new rs(Q,re),new oo({map:MR(T.name,T.price,T.currency,T.labelColor,T.priceColor)}));ae.position.set(T.xCm+V/2,b(T.level),y/2+1.05),l.add(ae)}for(const T of n)if(T.kind==="wobbler"){const L=new _n(new rs(14,14),new oo({map:ER(T.shape??"circle",T.color,T.text),transparent:!0,side:di}));L.position.set(T.xCm,x-T.yCm,y/2+2.2),l.add(L)}else{const N=T.kind==="banner-h"?T.lengthCm:6,L=T.kind==="banner-h"?6:T.lengthCm,R=new _n(new rs(N,L),new oo({map:bR(T.text,T.color,N,L,T.kind==="banner-v"),transparent:!0,side:di}));R.position.set(T.xCm+N/2,x-T.yCm-L/2,y/2+1.8),l.add(R)}},[t,e,n,i]),c.jsx("div",{className:"shelf3d",ref:a,children:c.jsx("div",{className:"shelf3d-hint",children:s("shelf3d.hint")})})}function TR(t){return t>=175?{weight:.55,zone:"Stretch"}:t>=125?{weight:1,zone:"Eye level"}:t>=95?{weight:.85,zone:"Hands"}:t>=55?{weight:.6,zone:"Stoop"}:{weight:.4,zone:"Floor"}}function l0(){return{facings:0,units:0,value:0,groups:0,weightedFacings:0,avgPrice:0}}function CR(t,e,n){var x;const i=l0(),r=l0(),s=Ro(t),a=Array.from({length:t.levels},(y,g)=>{const d=e.filter(w=>w.level===g),v=d.length>0?d.reduce((w,A)=>w+Ao(A),0)/d.length:rp,b=g*s+v/2,{weight:M,zone:E}=TR(b);return{level:g,heightCm:b,zone:E,weight:M,mineFacings:0,compFacings:0}}),o=new Map;let l=0,u=0;for(const y of e){const g=y.isCompetitor?r:i,d=y.facings*y.rows,v=d*y.price,b=((x=a[y.level])==null?void 0:x.weight)??.5;g.facings+=y.facings,g.units+=d,g.value+=v,g.groups+=1,g.weightedFacings+=y.facings*b,y.isCompetitor?u+=y.price*y.facings:l+=y.price*y.facings,a[y.level]&&(y.isCompetitor?a[y.level].compFacings+=y.facings:a[y.level].mineFacings+=y.facings);const M=n[y.productId];if(M){const E=o.get(M.id)??{product:M,mine:!y.isCompetitor,facings:0,units:0,value:0,avgPrice:0};E.facings+=y.facings,E.units+=d,E.value+=v,E.avgPrice=E.units>0?E.value/E.units:0,o.set(M.id,E)}}i.avgPrice=i.facings>0?l/i.facings:0,r.avgPrice=r.facings>0?u/r.facings:0;const f=i.facings+r.facings,p=i.units+r.units,h=i.value+r.value,m=i.weightedFacings+r.weightedFacings;return{mine:i,comp:r,totalFacings:f,totalUnits:p,totalValue:h,shareFacingsPct:f>0?i.facings/f*100:0,shareValuePct:h>0?i.value/h*100:0,shareQualityPct:m>0?i.weightedFacings/m*100:0,placementScoreMine:i.facings>0?i.weightedFacings/i.facings*100:0,placementScoreComp:r.facings>0?r.weightedFacings/r.facings*100:0,priceIndex:i.avgPrice>0&&r.avgPrice>0?i.avgPrice/r.avgPrice*100:0,perLevel:a.slice().reverse(),byProduct:[...o.values()].sort((y,g)=>g.value-y.value)}}function AR(t,e,n){return t.filter(i=>!i.isCompetitor).map(i=>{const r=i.facings*i.rows,s=i.facings*n;return{group:i,productName:i.name,units:r,dailySales:s,coverDays:s>0?r/s:1/0}}).sort((i,r)=>i.coverDays-r.coverDays)}const Nl=(t,e,n)=>Math.min(n,Math.max(e,Number.isFinite(t)?t:e));function RR(t){const e=Math.max(0,t.shelfUnits),n=Nl(t.missingUnits,0,e),i=e>0?n/e:0,r=Nl(t.durationHours,0,24*365),s=Math.max(0,t.expectedDailyDemand),a=Nl(t.demandRecoveryPct,0,100)/100,o=Nl(t.grossMarginPct,0,100)/100,l=Math.max(0,t.sellingPrice),u=s*r/24,f=u*i,p=f*a,h=f-p,m=h*l,x=m*o,y=r>0?x*24/r:0;return{availabilityPct:(1-i)*100,demandDuringPeriod:u,unitsAtRisk:f,unitsRecovered:p,missedUnits:h,missedSales:m,missedGrossProfit:x,monthlyGrossProfitIfDaily:y*30}}function gd({pct:t,color:e="#2f80ed"}){return c.jsx("div",{className:"bar",children:c.jsx("div",{className:"bar-fill",style:{width:`${Math.min(100,Math.max(0,t))}%`,background:e}})})}
4155function fr(t,e,n){return t.toLocaleString(n,{minimumFractionDigits:e,maximumFractionDigits:e})}function PR({shelf:t,groups:e,productsById:n,assumptions:i,onAssumptionsChange:r,onClose:s,onSendForAnalysis:a}){var R,D,F;const{t:o,locale:l}=Pt(),u=Math.max(.1,(i==null?void 0:i.salesPerFacingPerDay)??6),f=Math.min(100,Math.max(0,(i==null?void 0:i.grossMarginPct)??30)),p=Math.min(168,Math.max(1,(i==null?void 0:i.opportunityHours)??24)),h=Math.min(100,Math.max(0,(i==null?void 0:i.demandRecoveryPct)??67)),m=q.useMemo(()=>CR(t,e,n),[t,e,n]),x=q.useMemo(()=>AR(e,n,u),[e,n,u]),y=new Set(e.map(k=>{var B;return k.currency??((B=n[k.productId])==null?void 0:B.currency)??"EUR"})),g=y.size===1?[...y][0]:"EUR",d=y.size>1,v=x[0],b=x.reduce((k,B)=>k+B.dailySales*B.group.price,0),M=e.filter(k=>!k.isCompetitor),E=M.find(k=>k.id===(i==null?void 0:i.opportunityGroupId))??M[0]??null,w=E?E.facings*E.rows:0,A=E?Math.min(w,Math.max(0,((R=i==null?void 0:i.missingUnitsByGroup)==null?void 0:R[E.id])??0)):0,_=E?Math.max(0,((D=i==null?void 0:i.dailyDemandByGroup)==null?void 0:D[E.id])??E.facings*u):0,T=q.useMemo(()=>
4155RR({shelfUnits:w,missingUnits:A,durationHours:p,expectedDailyDemand:_,demandRecoveryPct:h,sellingPrice:(E==null?void 0:E.price)??0,grossMarginPct:f}),[h,_,f,A,E==null?void 0:E.price,p,w]),N=(E==null?void 0:E.currency)??(E?(F=n[E.productId])==null?void 0:F.currency:void 0)??"EUR",L=(k,B)=>{E&&r({[k]:{...(i==null?void 0:i[k])??{},[E.id]:B}})};return c.jsxs("div",{className:"stats-drawer",children:[c.jsxs("div",{className:"ep-head",children:[c.jsxs("h3",{children:["ð ",o("stats.title")]}),c.jsx("button",{className:"icon-btn",onClick:s,children:"â"})]}),e.length===0?c.jsx("p",{className:"hint",children:o("stats.empty")}):c.jsxs(c.Fragment,{children:[d?c.jsxs("section",{className:"stat-section",children:[c.jsx("h4",{children:o("stats.money")}),c.jsx("p",{className:"stat-note warn",children:o("stats.mixedCurrency",{currencies:Array.from(y).join(` ${o("common.and")} `)})})]}):c.jsxs("section",{className:"stat-section",children:[c.jsx("h4",{children:o("stats.money")}),c.jsx("div",{className:"stat-big",children:wn(m.totalValue,g)}),c.jsxs("div",{className:"stat-row",children:[c.jsx("span",{className:"dot mine"})," ",o("stats.yours"),": ",c.jsx("strong",{children:wn(m.mine.value,g)})," · ",o("stats.cans",{count:m.mine.units})]}),c.jsxs("div",{className:"stat-row",children:[c.jsx("span",{className:"dot comp"})," ",o("stats.competition"),": ",c.jsx("strong",{children:wn(m.comp.value,g)})," · ",o("stats.cans",{count:m.comp.units})]}),c.jsx(gd,{pct:m.shareValuePct}),c.jsx("p",{className:"stat-note",children:o("stats.valueShare",{pct:fr(m.shareValuePct,1,l)})})]}),c.jsxs("section",{className:"stat-section",children:[c.jsx("h4",{children:o("stats.share")}),c.jsxs("div",{className:"stat-row spread",children:[c.jsx("span",{children:o("stats.facingsShare")}),c.jsxs("strong",{children:[fr(m.shareFacingsPct,1,l),"%"]})]}),c.jsx(gd,{pct:m.shareFacingsPct}),c.jsxs("div",{className:"stat-row spread",children:[c.jsxs("span",{children:[o("stats.qualityShare")," ",c.jsx("abbr",{title:o("stats.qualityTitle"),children:"â"})]}),c.jsxs("strong",{children:[fr(m.shareQualityPct,1,l),"%"]})]}),c.jsx(gd,{pct:m.shareQualityPct,color:"#27ae60"}),c.jsx("div",{className:"level-table",children:m.perLevel.map(k=>{const B=k.mineFacings+k.compFacings;return c.jsxs("div",{className:"level-row",children:[c.jsxs("span",{className:"lv-name",children:["L",k.level+1," ",c.jsx("em",{children:o(`zone.${k.zone}`)})]}),c.jsx("div",{className:"lv-bar",children:B>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"lv-mine",style:{width:`${k.mineFacings/B*100}%`}}),c.jsx("div",{className:"lv-comp",style:{width:`${k.compFacings/B*100}%`}})]}):c.jsx("div",{className:"lv-empty"})}),c.jsxs("span",{className:"lv-meta",children:[k.mineFacings,"/",B]})]},k.level)})})]}),c.jsxs("section",{className:"stat-section",children:[c.jsx("h4",{children:o("stats.placementScore")}),c.jsxs("div",{className:"score-pair",children:[c.jsxs("div",{className:"score-box",children:[c.jsx("div",{className:"score-num",children:Math.round(m.placementScoreMine)}),c.jsx("div",{className:"score-label",children:o("stats.yoursLower")})]}),c.jsxs("div",{className:"score-box comp",children:[c.jsx("div",{className:"score-num",children:Math.round(m.placementScoreComp)}),c.jsx("div",{className:"score-label",children:o("stats.competitionLower")})]})]}),c.jsxs("p",{className:"stat-note",children:[o("stats.scoreIntro")," ",m.placementScoreMine>=m.placementScoreComp?o("stats.betterYours"):o("stats.betterCompetition")]})]}),!d&&m.priceIndex>0&&c.jsxs("section",{className:"stat-section",children:[c.jsx("h4",{children:o("stats.pricePosition")}),c.jsxs("div",{className:"stat-row spread",children:[c.jsx("span",{children:o("stats.yourAvg")}),c.jsx("strong",{children:wn(m.mine.avgPrice,g)})]}),c.jsxs("div",{className:"stat-row spread",children:[c.jsx("span",{children:o("stats.competitionAvg")}),c.jsx("strong",{children:wn(m.comp.avgPrice,g)})]}),c.jsxs("div",{className:"stat-row spread",children:[c.jsx("span",{children:o("stats.priceIndex")}),c.jsx("strong",{className:m.priceIndex>110?"warn":"",children:Math.round(m.priceIndex)})]}),c.jsx("p",{className:"stat-note",children:m.priceIndex>110?o("stats.premium"):m.priceIndex<90?o("stats.valuePosition"):o("stats.inLine")})]}),E&&c.jsxs("section",{className:"stat-section opportunity-section",children:[c.jsxs("div",{className:"opportunity-heading",children:[c.jsx("h4",{children:o("stats.opportunityTitle")}),c.jsx("span",{children:o("stats.simulator")})]}),c.jsx("p",{className:"stat-note opportunity-intro",children:o("stats.opportunityIntro")}),c.jsxs("label",{className:"opportunity-field",children:[c.jsx("span",{children:o("stats.simulateProduct")}),c.jsx("select",{value:E.id,onChange:k=>r({opportunityGroupId:k.target.value}),children:M.map(k=>c.jsx("option",{value:k.id,children:o("stats.productOption",{name:k.name,level:k.level+1,count:k.facings*k.rows})},k.id))})]}),c.jsxs("div",{className:"opportunity-availability",children:[c.jsxs("div",{className:"opportunity-availability-meta",children:[c.jsx("span",{children:o("stats.onShelfAvailability")}),c.jsxs("strong",{className:T.availabilityPct<50?"warn":"",children:[fr(T.availabilityPct,0,l),"%"]})]}),c.jsx("div",{className:"opportunity-availability-bar",children:c.jsx("span",{style:{width:`${T.availabilityPct}%`}})}),c.jsx("small",{children:o("stats.availableUnits",{available:w-A,total:w})})]}),c.jsxs("div",{className:"opportunity-presets",children:[c.jsx("button",{className:`btn small ${A===0?"on":""}`,onClick:()=>L("missingUnitsByGroup",0),children:o("stats.fullShelf")}),c.jsx("button",{className:`btn small ${A===Math.ceil(w/2)?"on":""}`,onClick:()=>L("missingUnitsByGroup",Math.ceil(w/2)),children:o("stats.halfEmpty")}),c.jsx("button",{className:`btn small danger ${A===w?"on":""}`,onClick:()=>L("missingUnitsByGroup",w),children:o("stats.fullOos")})]}),c.jsxs("label",{className:"opportunity-field",children:[c.jsxs("span",{className:"spread-label",children:[c.jsx("span",{children:o("stats.unitsMissing")}),c.jsxs("strong",{children:[A," / ",w]})]}),c.jsx("input",{type:"range",min:0,max:w,step:1,value:A,onChange:k=>L("missingUnitsByGroup",Number(k.target.value))})]}),c.jsxs("div",{className:"opportunity-input-grid",children:[c.jsxs("label",{children:[o("stats.expectedProductDemand"),c.jsx("input",{type:"number",min:0,max:1e5,step:.1,value:_,onCh
4155ange:k=>L("dailyDemandByGroup",Math.max(0,Number(k.target.value)||0))})]}),c.jsxs("label",{children:[o("stats.gapDuration"),c.jsx("input",{type:"number",min:1,max:168,value:p,onChange:k=>r({opportunityHours:Math.min(168,Math.max(1,Number(k.target.value)||1))})})]}),c.jsxs("label",{children:[c.jsxs("span",{children:[o("stats.demandRecovery")," ",c.jsx("abbr",{title:o("stats.demandRecoveryHelp"),children:"â"})]}),c.jsxs("div",{className:"input-suffix",children:[c.jsx("input",{type:"number",min:0,max:100,value:h,onChange:k=>r({demandRecoveryPct:Math.min(100,Math.max(0,Number(k.target.value)||0))})}),c.jsx("span",{children:"%"})]})]}),c.jsxs("label",{children:[c.jsxs("span",{children:[o("stats.margin")," ",c.jsx("abbr",{title:o("stats.marginHelp"),children:"â"})]}),c.jsxs("div",{className:"input-suffix",children:[c.jsx("input",{type:"number",min:0,max:100,value:f,onChange:k=>r({grossMarginPct:Math.min(100,Math.max(0,Number(k.target.value)||0))})}),c.jsx("span",{children:"%"})]})]})]}),c.jsxs("div",{className:"opportunity-results",children:[c.jsxs("div",{children:[c.jsx("span",{children:o("stats.unitsAtRisk")}),c.jsx("strong",{children:fr(T.unitsAtRisk,1,l)})]}),c.jsxs("div",{children:[c.jsx("span",{children:o("stats.missedUnits")}),c.jsx("strong",{children:fr(T.missedUnits,1,l)})]}),c.jsxs("div",{children:[c.jsx("span",{children:o("stats.missedSales")}),c.jsx("strong",{children:wn(T.missedSales,N)})]}),c.jsxs("div",{className:"primary-result",children:[c.jsx("span",{children:o("stats.missedProfit")}),c.jsx("strong",{children:wn(T.missedGrossProfit,N)})]})]}),c.jsx("p",{className:"opportunity-monthly",children:o("stats.monthlyEquivalent",{amount:wn(T.monthlyGrossProfitIfDaily,N)})}),c.jsxs("details",{className:"opportunity-method",children:[c.jsx("summary",{children:o("stats.howCalculated")}),c.jsx("p",{children:o("stats.formulaExplanation")}),c.jsx("p",{children:o("stats.marginExplanation")}),c.jsxs("a",{href:"https://rfid.auburn.edu/papers/documents/RFIDImpactOutOfStock.pdf",target:"_blank",rel:"noreferrer",children:[o("stats.researchBasis")," â"]})]})]}),c.jsxs("section",{className:"stat-section",children:[c.jsx("h4",{children:o("stats.stock")}),c.jsxs("label",{className:"stat-input",children:[o("stats.velocity"),c.jsx("input",{type:"number",min:.1,max:50,step:.1,value:u,onChange:k=>r({salesPerFacingPerDay:Math.max(.1,Number(k.target.value)||.1)})})]}),x.length>0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"stat-row spread",children:[c.jsx("span",{children:o("stats.dailySell")}),c.jsxs("strong",{children:[o("stats.cans",{count:x.reduce((k,B)=>k+B.dailySales,0)}),d?"":` / ${wn(b,g)}`]})]}),v&&c.jsxs("div",{className:"stat-row spread",children:[c.jsx("span",{children:o("stats.firstEmpty")}),c.jsxs("strong",{className:v.coverDays<1?"warn":"",children:[v.productName," · ",o("stats.days",{count:fr(v.coverDays,1,l)})]})]}),c.jsx("div",{className:"stock-table",children:x.map(k=>c.jsxs("div",{className:"stock-row",children:[c.jsx("span",{className:"st-name",children:k.productName}),c.jsx("span",{className:"st-meta",children:o("stats.onShelf",{count:k.units})}),c.jsx("span",{className:`st-cover ${k.coverDays<1?"warn":""}`,children:o("stats.cover",{count:fr(k.coverDays,1,l)})})]},k.group.id))}),c.jsx("p",{className:"stat-note",children:o("stats.backroom",{count:Math.ceil(x.reduce((k,B)=>k+B.dailySales*7-B.units,0))})})]}):c.jsx("p",{className:"hint",children:o("stats.noOwn")})]}),c.jsxs("section",{className:"stat-section",children:[c.jsx("h4",{children:o("stats.productsOnShelf")}),c.jsx("div",{className:"stock-table",children:m.byProduct.map(k=>c.jsxs("div",{className:"stock-row",children:[c.jsx("span",{className:`dot ${k.mine?"mine":"comp"}`}),c.jsx("span",{className:"st-name",children:k.product.name}),c.jsxs("span",{className:"st-meta",children:[k.facings,o("stats.facingsShort")," à ",Math.round(k.units/Math.max(1,k.facings)),o("stats.rowsShort")]}),c.jsx("span",{className:"st-cover",children:wn(k.value,k.product.currency)})]},k.product.id))})]}),c.jsxs("button",{className:"btn primary block big",onClick:a,children:["ð¬ ",o("app.sendAnalysis")]}),c.jsx("p",{className:"stat-note center",children:o("stats.submitHint")})]})]})}function kR({clientCode:t,onConfirm:e,onCancel:n}){const{t:i}=Pt(),[r,s]=q.useState(""),[a,o]=q.useState(""),[l,u]=q.useState("");return c.jsx("div",{className:"modal-backdrop",onClick:n,children:c.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[c.jsxs("h3",{children:["ð¬ ",i("analysis.title")]}),c.jsx("p",{className:"hint",children:i("analysis.description")}),c.jsxs("label",{children:[i("analysis.yourName"),c.jsx("input",{type:"text",value:r,onChange:f=>s(f.target.value),placeholder:i("analysis.namePlaceholder")})]}),c.jsxs("label",{children:[i("analysis.email"),c.jsx("input",{type:"email",value:a,onChange:f=>o(f.target.value),placeholder:"[email protected]"})]}),c.jsxs("label",{children:[i("analysis.question"),c.jsx("textarea",{rows:3,value:l,onCh
4155ange:f=>u(f.target.value),placeholder:i("analysis.notesPlaceholder")})]}),t&&c.jsx("p",{className:"hint",children:i("analysis.clientCode",{code:t})}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{className:"btn",onClick:n,children:i("common.cancel")}),c.jsx("button",{className:"btn primary",disabled:!r.trim()||!a.includes("@"),onClick:()=>e({contactName:r.trim(),contactEmail:a.trim(),notes:l.trim()}),children:i("analysis.submit")})]})]})})}function NR(){return[...crypto.getRandomValues(new Uint8Array(10))].map(e=>e.toString(16).padStart(2,"0")).join("")}function DR({clientCode:t,currentState:e,onOpen:n,onClose:i}){const{t:r,locale:s}=Pt(),[a,o]=q.useState([]),[l,u]=q.useState(""),[f,p]=q.useState(!0),[h,m]=q.useState(null),[x,y]=q.useState(null),g=!!(e.shelfId&&e.groups.length>0),d=q.useCallback(async()=>{p(!0),y(null);try{const E=await ME(t);o(E),u(w=>w||r("draft.defaultTitle",{count:E.length+1}))}catch(E){y(E instanceof Error?E.message:r("draft.loadError"))}finally{p(!1)}},[t,r]);q.useEffect(()=>{d()},[d]);const v=async()=>{if(!g||!l.trim())return;const E=new Date().toISOString(),w={id:NR(),title:l.trim(),createdAt:E,updatedAt:E,state:e};m("new"),y(null);try{await ig(t,w),await d(),u(r("draft.defaultTitle",{count:a.length+2}))}catch(A){y(A instanceof Error?A.message:r("draft.saveError"))}finally{m(null)}},b=async E=>{m(E.id),y(null);try{await ig(t,{...E,updatedAt:new Date().toISOString(),state:e}),await d()}catch(w){y(w instanceof Error?w.message:r("draft.saveError"))}finally{m(null)}},M=async E=>{if(confirm(r("draft.deleteConfirm",{title:E.title}))){m(E.id),y(null);try{await EE(t,E.id),o(w=>w.filter(A=>A.id!==E.id))}catch(w){y(w instanceof Error?w.message:r("draft.deleteError"))}finally{m(null)}}};return c.jsx("div",{className:"modal-backdrop",onClick:i,children:c.jsxs("div",{className:"modal saved-planograms-modal",onClick:E=>E.stopPropagation(),children:[c.jsxs("h3",{children:["ð¾ ",r("draft.title")]}),c.jsx("p",{className:"hint",children:r("draft.description")}),c.jsxs("div",{className:"draft-save-row",children:[c.jsx("input",{value:l,maxLength:120,onChange:E=>u(E.target.value),placeholder:r("draft.namePlaceholder")}),c.jsx("button",{className:"btn primary",disabled:!g||!l.trim()||!!h,onClick:()=>void v(),children:r(h==="new"?"draft.saving":"draft.saveCurrent")})]}),!g&&c.jsx("p",{className:"hint",children:r("draft.saveHint")}),c.jsxs("div",{className:"draft-list",children:[f&&c.jsx("p",{className:"hint",children:r("draft.loading")}),!f&&a.length===0&&c.jsx("p",{className:"hint",children:r("draft.empty")}),a.map(E=>c.jsxs("article",{className:"draft-card",children:[c.jsxs("div",{children:[c.jsx("strong",{children:E.title}),c.jsx("span",{children:r("draft.updated",{date:new Date(E.updatedAt).toLocaleString(s)})})]}),c.jsxs("div",{className:"draft-actions",children:[c.jsx("button",{className:"btn primary",disabled:!!h,onClick:()=>n(E.state,E.title),children:r("draft.open")}),c.jsx("button",{className:"btn",disabled:!g||!!h,onClick:()=>void b(E),children:r("draft.update")}),c.jsx("button",{className:"btn danger",disabled:!!h,onClick:()=>void M(E),children:r("common.delete")})]})]},E.id))]}),x&&c.jsx("p",{className:"code-error",children:x}),c.jsx("div",{className:"modal-actions",children:c.jsx("button",{className:"btn",onClick:i,children:r("common.close")})})]})})}const LR=["#ffffff","#fff3a3","#ffd60a","#ffb3b3","#ff3b30","#34c759","#007aff","#111827"],IR=["#111827","#d90429","#f97316","#0a7f3f","#0066cc","#7c3aed","#ffffff"];function UR({mode:t,group:e,onApply:n,onClose:i}){const{t:r}=Pt(),s=t==="label"?Cc:Ac,[a,o]=q.useState(t==="label"?e.labelColor??s:e.priceColor??s),[l,u]=q.useState(a.toUpperCase()),f=t==="label"?a:e.labelColor??Cc,p=t==="price"?a:e.priceColor??Ac,h=t==="label"?LR:IR;return c.jsx("div",{className:"modal-backdrop",onClick:i,children:c.jsxs("div",{className:"modal price-color-modal",role:"dialog","aria-modal":"true",onClick:m=>m.stopPropagation(),children:[c.jsxs("div",{className:"price-color-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"price-color-kicker",children:r("promo.promotionStyle")}
4155),c.jsx("h3",{children:r(t==="label"?"promo.labelDialogTitle":"promo.priceDialogTitle")})]}),c.jsx("button",{className:"icon-btn","aria-label":r("common.close"),onClick:i,children:"â"})]}),c.jsx("p",{className:"hint price-color-description",children:r(t==="label"?"promo.labelDialogDescription":"promo.priceDialogDescription",{name:e.name})}),c.jsxs("div",{className:"price-label-preview",style:{backgroundColor:f},children:[c.jsx("span",{style:{color:ap(f)},children:e.name}),c.jsx("strong",{style:{color:p},children:wn(e.price,e.currency)})]}),c.jsxs("label",{className:"price-color-field",children:[r("promo.chooseColor"),c.jsxs("div",{className:"price-color-input-row",children:[c.jsx("input",{type:"color",value:a,onChange:m=>{o(m.target.value),u(m.target.value.toUpperCase())}}),c.jsx("input",{type:"text",value:l,maxLength:7,spellCheck:!1,onChange:m=>u(m.target.value.toUpperCase()),onBlur:()=>{/^#[0-9a-f]{6}$/i.test(l)?o(l.toLowerCase()):u(a.toUpperCase())},"aria-label":r("promo.hexColor")})]})]}),c.jsx("div",{className:"price-color-presets",role:"group","aria-label":r("promo.presetColors"),children:h.map(m=>c.jsx("button",{className:`price-color-swatch ${a.toLowerCase()===m?"on":""}`,style:{backgroundColor:m},"aria-label":m,"aria-pressed":a.toLowerCase()===m,onClick:()=>{o(m),u(m.toUpperCase())}},m))}),c.jsxs("div",{className:"modal-actions price-color-actions",children:[c.jsx("button",{className:"btn",onClick:()=>n(null),children:r("promo.resetOriginal")}),c.jsx("button",{className:"btn",onClick:i,children:r("common.cancel")}),c.jsx("button",{className:"btn primary",onClick:()=>n(a),children:r("promo.applyColor")})]})]})})}const Is=[{titleKey:"tour.welcomeTitle",textKey:"tour.welcomeText"},{target:'[data-tour="sidebar"]',titleKey:"tour.shelfTitle",textKey:"tour.shelfText"},{target:'[data-tour="workflow"]',titleKey:"tour.stepsTitle",textKey:"tour.stepsText"},{target:'[data-tour="canvas"]',titleKey:"tour.arrangeTitle",textKey:"tour.arrangeText"},{target:'[data-tour="zoom"]',titleKey:"tour.zoomTitle",textKey:"tour.zoomText"},{target:'[data-tour="drafts"]',titleKey:"tour.draftsTitle",textKey:"tour.draftsText"},{target:'[data-tour="analysis"]',titleKey:"tour.reviewTitle",textKey:"tour.reviewText"}];function FR({onFinish:t}){const{t:e}=Pt(),[n,i]=q.useState(0),[r,s]=q.useState(null),a=Is[n];q.useLayoutEffect(()=>{const p=()=>{if(!a.target){s(null);return}const h=document.querySelector(a.target);if(!h){s(null);return}const m=h.getBoundingClientRect(),x=7;s({left:Math.max(8,m.left-x),top:Math.max(8,m.top-x),right:Math.min(window.innerWidth-8,m.right+x),bottom:Math.min(window.innerHeight-8,m.bottom+x),width:Math.min(window.innerWidth-16,m.width+x*2),height:Math.min(window.innerHeight-16,m.height+x*2)})};return p(),window.addEventListener("resize",p),window.addEventListener("scroll",p,!0),()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,!0)}},[a.target]),q.useEffect(()=>{const p=h=>{h.key==="Escape"&&t(),h.key==="ArrowRight"&&(n===Is.length-1?t():i(m=>m+1)),h.key==="ArrowLeft"&&i(m=>Math.max(0,m-1))};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[n,t]);const o=Math.min(380,window.innerWidth-32),l=r?Math.max(16,Math.min(window.innerWidth-o-16,r.left+r.width/2-o/2)):(window.innerWidth-o)/2,u=r?r.bottom+230>window.innerHeight&&r.top>250:!1,f=r?u?Math.max(16,r.top-218):Math.max(12,Math.min(window.innerHeight-218,r.bottom+16)):Math.max(24,window.innerHeight/2-130);return c.jsxs("div",{className:`tour-layer ${r?"":"tour-welcome"}`,role:"dialog","aria-modal":"true","aria-label":e("tour.aria"),children:[r&&c.jsx("div",{className:"tour-spotlight",style:{left:r.left,top:r.top,width:r.width,height:r.height}}),c.jsxs("section",{className:"tour-card",style:{left:l,top:f,width:o},children:[c.jsx("div",{className:"tour-kicker",children:e("tour.quick",{current:n+1,total:Is.length})}),c.jsx("h2",{children:e(a.titleKey)}),c.jsx("p",{children:e(a.textKey)}),c.jsx("div",{className:"tour-progress","aria-hidden":"true",children:Is.map((p,h)=>c.jsx("span",{className:h===n?"on":""},h))}),c.jsxs("div",{className:"tour-actions",children:[c.jsx("button",{className:"btn",onClick:t,children:e("tour.skip")}),c.jsx("div",{className:"tour-spacer"}),n>0&&c.jsx("button",{className:"btn",onClick:()=>i(p=>p-1),children:e("common.back")}),c.jsx("button",{className:"btn primary",onClick:()=>{n===Is.length-1?t():i(p=>p+1)},children:n===Is.length-1?e("tour.start"):e("common.next")})]})]})]})}async function OR(t){{const e=encodeURIComponent(`ShelfLab planogram payment â ${t.code}`),n=encodeURIComponent(`I would like to pay â¬${t.amountEur}
4155 for a ShelfLab planogram with ${t.productCount} products. 4156 4157Access code: ${t.code} 4158Planogram: ${t.signature}`);return window.location.href=`mailto:${Pr}?subject=${e}&body=${n}`,"contact"}}const D_=new URLSearchParams(window.location.search),jt=D_.get("code"),vd=D_.has("admin");function L_(t){return t?`shelf-planner-v1:${t.trim().toUpperCase()}`:"shelf-planner-v1"}const I_=L_(jt);function zR(){try{const t=localStorage.getItem(I_);if(t){const e=JSON.parse(t);return{...e,customProducts:e.customProducts??[]}}}catch{}return{shelfId:null,groups:[],marketing:[],step:1,view:"2.5d",customProducts:[]}}const c0=.5,u0=2.5,Dl=.1,Ll=jt?`shelflab-client-tour-v1:${jt.trim().toUpperCase()}`:null;function jR(){const{t}=Pt(),[e,n]=q.useState(zR),[i,r]=q.useState(Km),[s,a]=q.useState(vd&&!jt),[o,l]=q.useState(null),[u,f]=q.useState(null),[p,h]=q.useState(null),[m,x]=q.useState(null),[y,g]=q.useState(null),[d,v]=q.useState(null),[b,M]=q.useState(!1),[E,w]=q.useState(!1),[A,_]=q.useState(!1),[T,N]=q.useState(!1),[L,R]=q.useState(!1),[D,F]=q.useState(!1),[k,B]=q.useState(()=>Hx(jt)),[z,I]=q.useState(null),[V,Q]=q.useState(!!jt),[re,ae]=q.useState(null),[Fe,je]=q.useState(vd?"checking":"local"),[Oe,ee]=q.useState(null),[ue,oe]=q.useState(null),[Be,$e]=q.useState(!1),[Pe,wt]=q.useState(1),[Qe,ut]=q.useState(()=>!!(Ll&&localStorage.getItem(Ll)!=="done")),Xe=q.useRef(null),tt=q.useRef(null),St=q.useRef(null),ve=wx(e.shelfId),At=q.useMemo(()=>rE(e),[e]),Gt=q.useMemo(()=>new Set(e.groups.map(Y=>Y.productId)).size,[e.groups]);q.useEffect(()=>{localStorage.setItem(I_,JSON.stringify(e))},[e]),q.useEffect(()=>{yM(i)},[i]),q.useEffect(()=>{if(!jt){Q(!1);return}let Y=!1;return fE(jt).then(ne=>{Y||(ne?r(ne):ae(t("landing.unknownCode")))}).catch(ne=>{Y||ae(ne instanceof Error?ne.message:t("app.secureCatalogError"))}).finally(()=>{Y||Q(!1)}),()=>{Y=!0}},[]),q.useEffect(()=>{if(!vd||jt)return;let Y=!1,ne=()=>{};return(async()=>{const de=await gs();if(!Y){if(!de){["localhost","127.0.0.1"].includes(location.hostname)?je("local"):(je("signed-out"),oe(t("adminGate.firebaseUnavailable")));return}ne=mE(Ue=>{(async()=>{if(Y)return;if(!Ue){ee(null),je("signed-out");return}const we={uid:Ue.uid,email:Ue.email};ee(we),je("checking");try{if(!await xE(Ue.uid,Ue.email)){Y||je("unauthorized");return}je("loading");const Ve=await hE();if(Y)return;Ve?r(Ve):await ng(Km()),$e(!0),je("ready")}catch(Ve){Y||(oe(Ve instanceof Error?Ve.message:t("adminGate.catalogLoadError")),je("unauthorized"))}})()})}})(),()=>{Y=!0,ne()}},[]),q.useEffect(()=>{if(!Be||Fe!=="ready")return;const Y=window.setTimeout(()=>{ng(i).then(()=>oe(null)).catch(ne=>{oe(ne instanceof Error?ne.message:t("adminGate.catalogSaveError"))})},900);return()=>window.clearTimeout(Y)},[Fe,i,Be]);const Mt=q.useCallback(Y=>r(Y),[]),pt=q.useCallback(Y=>n(ne=>({...ne,...Y})),[]),O=q.useCallback((Y,ne)=>{wt(de=>{const Ue=Math.min(u0,Math.max(c0,Math.round(Y*10)/10));if(Ue===de)return de;const we=tt.current;if(we){const Ve=we.getBoundingClientRect(),Ke=ne?ne.x-Ve.left:we.clientWidth/2,it=ne?ne.y-Ve.top:we.clientHeight/2,dt=Ue/de,ii=(we.scrollLeft+Ke)*dt-Ke,jr=(we.scrollTop+it)*dt-it;requestAnimationFrame(()=>{we.scrollLeft=ii,we.scrollTop=jr})}return Ue})},[]),on=q.useCallback(()=>{wt(1),requestAnimationFrame(()=>{var Y;(Y=tt.current)==null||Y.scrollTo({left:0,top:0,behavior:"smooth"})})},[]),ct=q.useCallback(()=>{Ll&&localStorage.setItem(Ll,"done"),ut(!1)},[]),P=jt?Ax(i,jt):null,S=Oo(P==null?void 0:P.plan),G=eE(P==null?void 0:P.plan,k),$=pf(P==null?void 0:P.plan,k),Z=nE(k,At),ce=Wx(P==null?void 0:P.plan,k),fe=S.customProductLimit,J=S.id!=="per-planogram"||iE(k,At),te=q.useMemo(()=>[...MM(i,jt),...e.customProducts],[i,e.customProducts]),he=q.useMemo(()=>{const Y={};for(const ne of te)Y[ne.id]=ne;return Y},[te]);q.useEffect(()=>{e.step!==3&&(g(null),v(null))},[e.step]);const Ae=q.useCallback(Y=>he[Y]??{...Rx,name:t("product.unknown")},[he,t]),xe=q.useCallback((Y,ne)=>{if(ne.preventDefault(),e.view==="3d"){I(t("app.preview3dToast")),setTimeout(()=>I(null),3500);return}x(null),l({productId:Y,clientX:ne.clientX,clientY:ne.clientY,snap:null})},[e.view,t]);q.useEffect(()=>{if(!o)return;const Y=de=>{let Ue=null;if(Xe.current&&ve){const{xCm:we,yCm:Ve}=ol(Xe.current,de.clientX,de.clientY),Ke=Ym(ve,Ve),it=Ae(o.productId),dt=is(it);Ke!==null&&we>-dt&&we<ve.widthCm+dt&&(Ue={level:Ke,xCm:so(ve,we-dt/2,dt)})}l(we=>we&&{...we,clientX:de.clientX,clientY:de.clientY,snap:Ue})},ne=()=>{l(de=>(de!=null&&de.snap&&f({productId:de.productId,level:de.snap.level,xCm:de.snap.xCm}),null))};return window.addEventListener("pointermove",Y),window.addEventListener("pointerup",ne),()=>{window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",ne)}},[o,Ae,ve]);const me=q.useCallback(Y=>{var it;if(!u||!ve)return;const ne=Ae(u.productId),de=is(ne),Ue=sp(Y.facings,de),we=Y.side==="right"?u.xCm:u.xCm+de-Ue,Ve={id:wi(),productId:u.productId,level:u.level,xCm:we,facings:Y.facings,rows:Y.rows,name:Y.name,price:Y.price,currency:ne.currency??"EUR",productWidthCm:de,productHeightCm:To(ne),productDepthCm:Co(ne),packageShape:((it=ne.package)==null?void 0:it.shape)??"can",isCompetitor:!ne.mine},Ke=Nu(ve,[...e.groups,Ve],Ve.id,u.level,we);
4158if(!Ke){alert(t("app.noShelfSpace"));return}n(dt=>({...dt,groups:Ke})),x(Ve.id),f(null)},[u,ve,e.groups,Ae,t]),Le=q.useCallback((Y,ne)=>{if(y){ne.stopPropagation(),ne.preventDefault(),x(Y),v(Y);return}if(!Xe.current||!ve)return;ne.stopPropagation(),ne.preventDefault();const de=e.groups.find(we=>we.id===Y);if(!de)return;const{xCm:Ue}=ol(Xe.current,ne.clientX,ne.clientY);h({kind:"group",id:Y,grabDx:Ue-de.xCm,grabDy:0,origin:{xCm:de.xCm,level:de.level},moved:!1,offShelf:!1})},[y,ve,e.groups]),ze=q.useCallback((Y,ne)=>{if(y){ne.stopPropagation(),ne.preventDefault();return}if(!Xe.current)return;ne.stopPropagation(),ne.preventDefault();const de=e.marketing.find(Ve=>Ve.id===Y);if(!de)return;const{xCm:Ue,yCm:we}=ol(Xe.current,ne.clientX,ne.clientY);h({kind:"marketing",id:Y,grabDx:Ue-de.xCm,grabDy:we-de.yCm,origin:{xCm:de.xCm,yCm:de.yCm},moved:!1,offShelf:!1})},[y,e.marketing]);q.useEffect(()=>{if(!p)return;const Y=de=>{if(!Xe.current||!ve)return;const{xCm:Ue,yCm:we}=ol(Xe.current,de.clientX,de.clientY);if(p.kind==="group"){const Ve=Ue<-8||Ue>ve.widthCm+8||we<-14||we>ve.heightCm+10;h(Ke=>Ke&&{...Ke,moved:!0,offShelf:Ve}),Ve||n(Ke=>({...Ke,groups:Ke.groups.map(it=>{if(it.id!==p.id)return it;const dt=Ym(ve,we)??it.level,ii=so(ve,Ue-p.grabDx,Tn(it));return{...it,xCm:ii,level:dt}})}))}else h(Ve=>Ve&&{...Ve,moved:!0}),n(Ve=>({...Ve,marketing:Ve.marketing.map(Ke=>Ke.id===p.id?{...Ke,xCm:Ue-p.grabDx,yCm:we-p.grabDy}:Ke)}))},ne=()=>{h(de=>(de&&(de.moved?de.kind==="group"&&de.offShelf?(n(Ue=>({...Ue,groups:Ue.groups.filter(we=>we.id!==de.id)})),x(null)):de.kind==="group"&&ve&&(n(Ue=>{const we=Ue.groups.find(Ke=>Ke.id===de.id);if(!we)return Ue;const Ve=Nu(ve,Ue.groups,we.id,we.level,we.xCm);return Ve?{...Ue,groups:Ve}:{...Ue,groups:Ue.groups.map(Ke=>Ke.id===de.id?{...Ke,xCm:de.origin.xCm,level:de.origin.level??Ke.level}:Ke)}}),x(de.id)):x(de.id)),null))};return window.addEventListener("pointermove",Y),window.addEventListener("pointerup",ne),()=>{window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",ne)}},[p==null?void 0:p.id,ve]);const We=q.useCallback(Y=>
4158{n(ne=>({...ne,groups:ne.groups.filter(de=>de.id!==Y),marketing:ne.marketing.filter(de=>de.id!==Y)})),x(ne=>ne===Y?null:ne)},[]);q.useEffect(()=>{const Y=ne=>{if(ne.key!=="Delete"&&ne.key!=="Backspace")return;const de=ne.target;de.tagName==="INPUT"||de.tagName==="TEXTAREA"||de.isContentEditable||m&&(ne.preventDefault(),We(m))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[m,We]);const U=q.useCallback(Y=>{confirm(t("app.removeProductConfirm"))&&(n(ne=>({...ne,customProducts:ne.customProducts.filter(de=>de.id!==Y),groups:ne.groups.filter(de=>de.productId!==Y)})),x(null))},[t]),pe=q.useCallback(()=>{if(!ve)return;const Y=te.filter(ne=>!ne.mine);if(Y.length===0){alert(t("app.noCompetitors"));return}n(ne=>{var Ue;const de=[...ne.groups];for(let we=0;we<ve.levels;we++)for(const Ve of gM(ve,de,we)){let Ke=Ve.start+.5;for(;Ve.end-Ke>=5;){const it=Y[Math.floor(Math.random()*Y.length)],dt=is(it),ii=Qc(dt),jr=Math.min(4,Math.floor((Ve.end-Ke+.3)/ii));if(jr<2)break;const Br=2+Math.floor(Math.random()*(jr-1)),ba=it.defaultPrice*(.85+Math.random()*.3),Ho=it.currency==="RSD"?Math.max(1,Math.round(ba*10)/10):Math.max(.49,Math.round(ba*10)/10-.01);de.push({id:wi(),productId:it.id,level:we,xCm:Ke,facings:Br,rows:1+Math.floor(Math.random()*3),name:it.name,price:Ho,currency:it.currency??"EUR",productWidthCm:dt,productHeightCm:To(it),productDepthCm:Co(it),packageShape:((Ue=it.package)==null?void 0:Ue.shape)??"can",isCompetitor:!0}),Ke+=Br*ii+1.5}}return{...ne,groups:de}})},[ve,te,t]),ie=q.useCallback(()=>{n(Y=>({...Y,groups:Y.groups.filter(ne=>!ne.isCompetitor)})),x(null)},[]),ge=q.useCallback(Y=>{if(!ve)return;const ne={id:wi(),kind:Y,text:t(Y==="wobbler"?"app.defaultSale":"app.defaultBanner"),color:"#e02020",xCm:0,yCm:0,lengthCm:Math.min(ve.widthCm*.8,70),shape:"circle"};Y==="wobbler"?(ne.xCm=ve.widthCm/2,ne.yCm=ve.heightCm/3):Y==="banner-h"?(ne.xCm=(ve.widthCm-ne.lengthCm)/2,ne.yCm=-9):(ne.xCm=ve.widthCm+4.5,ne.yCm=15,ne.lengthCm=Math.min(ve.heightCm*.5,80)),n(de=>({...de,marketing:[...de.marketing,ne]})),g(null),v(null),x(ne.id)},[ve,t]),ye=q.useCallback(Y=>{g(Y),v(null),x(null),w(!1),Y&&e.view==="3d"&&pt({view:"2.5d"}),Y&&(I(t("promo.clickProduct")),setTimeout(()=>I(null),3500))},[pt,e.view,t]),se=q.useCallback(()=>{if(!J){R(!0);return}x(null),setTimeout(()=>{if(e.view==="3d"&&St.current){const Y=document.createElement("a");Y.href=St.current(),Y.download=`shelf-3d-${new Date().toISOString().slice(0,19).replace(/[:T]/g,"-")}.png`,Y.click()}else Xe.current&&TE(Xe.current)},60)},[J,e.view]),Re=e.groups.find(Y=>Y.id===m)??null,be=e.marketing.find(Y=>Y.id===m)??null,xt=e.groups.find(Y=>Y.id===d)??null,mt=q.useCallback((Y,ne)=>{n(de=>{const Ue=de.groups.map(we=>we.id===Y?{...we,...ne}:we);if(ve&&(ne.facings!==void 0||ne.xCm!==void 0)){const we=Ue.find(dt=>dt.id===Y),Ve=Nu(ve,Ue,Y,we.level,we.xCm);if(Ve)return{...de,groups:Ve};const Ke=Tn(we),it=mM(ve,Ue,we.level,we.xCm,Ke,Y);return{...de,groups:Ue.map(dt=>dt.id===Y?{...dt,xCm:it??so(ve,dt.xCm,Ke)}:dt)}}return{...de,groups:Ue}})},[ve]),Xn=o!=null&&o.snap?{productId:o.productId,level:o.snap.level,xCm:o.snap.xCm}:null,Ln=q.useCallback(()=>{if(!(!ve||e.groups.length===0)){if(Z){I(t("billing.changeBeforeResubmit")),setTimeout(()=>I(null),4e3);return}if(ce){I(t(S.limitPeriod==="month"?"billing.monthlyLimitReached":"billing.codeExhausted")),setTimeout(()=>I(null),4500);return}if(S.id==="per-planogram"&&((P==null?void 0:P.prepaidPlanograms)??0)<1){R(!0);return}_(!0)}},[Z,ce,S.id,S.limitPeriod,P==null?void 0:P.prepaidPlanograms,ve,e.groups.length,t]),ru=q.useCallback(Y=>{if(!ve)return;if(Z||ce){_(!1);return}const ne=S.id==="per-planogram";if(ne&&((P==null?void 0:P.prepaidPlanograms)??0)<1){_(!1),R(!0);return}_(!1),x(null),setTimeout(()=>{(async()=>{let de;try{let it;e.view==="3d"&&St.current?it=St.current():Xe.current&&(it=await bE(Xe.current,1.5,"image/jpeg",.78)),it&&(de=await wE(it))}catch{}const Ue={id:wi(),date:new Date().toISOString(),clientCode:jt,plan:S.id,paid:ne,state:e,snapshot:de,...Y};let we=!1;try{we=await _E(Ue)}catch{we=!1}we||zx([...Ox(),Ue]);const Ve=tE(k,{id:Ue.id,date:Ue.date,signature:At,paid:ne});B(Ve),ne&&P&&Mt(it=>({...it,shares:it.shares.map(dt=>dt.id===P.id?{...dt,prepaidPlanograms:Math.max(0,(dt.prepaidPlanograms??0)-1)}:dt)}));const Ke=pf(P==null?void 0:P.plan,Ve);S.id==="free"&&Ke===0?F(!0):(I(we?Ke===null?t("app.sentToast"):t("billing.submittedRemaining",{count:Ke}):t("app.sentLocalFallback")),setTimeout(()=>I(null),5e3))})()},80)},[At,Z,ce,S.id,P,ve,e,t,k,Mt]),su=q.useCallback(Y=>{const ne={...Y.state,customProducts:Y.state.customProducts??[]};localStorage.setItem(L_(Y.clientCode),JSON.stringify(ne));const de=Y.clientCode?`?code=${encodeURIComponent(Y.clientCode)}`:"";window.location.href=`${window.location.pathname}${de}`},[]);return s?Fe!=="ready"&&Fe!=="local"?c.jsx(LE,{status:Fe,uid:Oe==null?void 0:Oe.uid,email:Oe==null?void 0:Oe.email,error:ue}):c.jsxs(c.Fragment,{children:[c.jsx(kE,{catalog:i,setCatalog:Mt,onBack:()=>{window.location.href=window.location.pathname},onLoadSubmission:su}),ue&&c.jsx("div",{className:"toast error",children:ue})]}):jt?V?c.jsx("div",{className:"landing admin-gate",children:c.jsxs("main",{className:"access-panel",children:[c.jsx("h1",{children:t("app.openingClientSpace")}),c.jsx("p",{className:"landing-sub",children:t("app.loadingSecureCatalog")})]})}):re?c.jsx(ll,{initialError:re}):P?QM(P.plan,k)&&!D?c.jsx(ll,{initialError:t("billing.codeExhausted")}):c.jsxs("div",{className:"app",children:[c.jsxs("header",{className:"topbar",children:[c.jsxs("div",{className:"brand",children:[c.jsx("span",{className:"logo",children:"â¤"})," ",hp," ",c.jsx("span",{className:"tagline",children:t("app.tagline")}),jt?c.jsx("span",{className:`tag ${P?"client":"error"}`,children:P?t("app.clientView",{label:P.label}):t("app.invalidCode")}):c.jsx("span",{className:"tag",children:t("app.studio")}
4158),$!==null&&c.jsx("span",{className:"tag plan",children:t("billing.remainingBadge",{count:$})})]}),c.jsx("nav",{className:"steps","data-tour":"workflow",children:[1,2,3].map(Y=>c.jsxs("button",{className:`step ${e.step===Y?"on":""}`,disabled:!ve,onClick:()=>pt({step:Y}),children:[Y,". ",t(Y===1?"app.productsStep":Y===2?"app.competitionStep":"app.marketingStep")]},Y))}),c.jsxs("div",{className:"toolbar",children:[c.jsxs("div",{className:"view-controls",children:[c.jsx("button",{className:`btn ${e.view==="2d"?"on":""}`,onClick:()=>pt({view:"2d"}),disabled:!ve,children:"2D"}),c.jsx("button",{className:`btn ${e.view==="2.5d"?"on":""}`,onClick:()=>pt({view:"2.5d"}),disabled:!ve,children:"2.5D"}),c.jsx("button",{className:`btn ${e.view==="3d"?"on":""}`,onClick:()=>pt({view:"3d"}),disabled:!ve||!!y,children:"3D"})]}),c.jsxs("div",{className:"zoom-controls","data-tour":"zoom",title:e.view==="3d"?t("app.zoom3dHint"):t("app.zoomShelf"),children:[c.jsx("button",{className:"btn zoom-button","aria-label":t("app.zoomOut"),title:t
4158("app.zoomOut"),disabled:!ve||e.view==="3d"||Pe<=c0,onClick:()=>O(Pe-Dl),children:"â"}),c.jsxs("button",{className:"btn zoom-value",title:e.view==="3d"?t("app.zoom3dHint"):t("app.resetZoom"),disabled:!ve||e.view==="3d",onClick:on,children:[Math.round(Pe*100),"%"]}),c.jsx("button",{className:"btn zoom-button","aria-label":t("app.zoomIn"),title:t("app.zoomIn"),disabled:!ve||e.view==="3d"||Pe>=u0,onClick:()=>O(Pe+Dl),children:"+"})]}),c.jsxs("button",{className:"btn","data-tour":"drafts",onClick:()=>N(!0),title:t("draft.toolbarTitle"),children:["ð¾ ",t("draft.toolbar")]}),c.jsxs("button",{className:"btn",onClick:se,disabled:!ve||e.groups.length===0,title:t(J?"common.snapshot":"billing.screenshotLocked"),children:["ð¸ ",t("common.snapshot"),J?"":" ð"]}),c.jsxs("button",{className:"btn send","data-tour":"analysis",disabled:!ve||e.groups.length===0||Z||ce,title:Z?t("billing.changeBeforeResubmit"):ce?t(S.limitPeriod==="month"?"billing.monthlyLimitReached":"billing.codeExhausted"):S.id==="per-planogram"&&(P.prepaidPlanograms??0)<1?t("billing.paymentRequired"):t("analysis.submit"),onClick:Ln,children:["ð¬ ",t("app.sendAnalysis")]}),c.jsxs("button",{className:`btn ${E?"on":""}`,disabled:!ve||!G,title:t(G?"app.statistics":S.statistics==="after-first-submit"?"billing.statsAfterFirst":"billing.statsNotIncluded"),onClick:()=>{x(null),w(Y=>!Y)},children:["ð ",t("app.statistics")]}),c.jsxs("button",{className:"btn",onClick:()=>{confirm(t("app.resetConfirm"))&&(n({shelfId:null,groups:[],marketing:[],step:1,view:e.view,customProducts:e.customProducts}),x(null))},children:["⺠",t("app.reset")]}),c.jsxs("button",{className:"btn",title:t("app.logoutTitle"),onClick:()=>{window.location.href=window.location.pathname},children:["â ",t("app.logout")]}),c.jsx(eu,{dark:!0}),c.jsxs("button",{className:"btn","data-tour":"help",title:t("app.tourTitle"),onClick:()=>ut(!0),children:["? ",t("app.tour")]})]})]}),c.jsxs("div",{className:"body",children:[c.jsx(IM,{step:e.step,hasShelf:!!ve,products:te,onChooseShelf:Y=>pt({shelfId:Y}),onProductDragStart:xe,onRandomCompetition:pe,onClearCompetition:ie,onAddMarketing:ge,priceColorMode:y,onPriceColorModeChange:ye,onAddProduct:()=>{if(fe!==null&&e.customProducts.length>=fe){I(t("billing.customProductLimit",{count:fe})),setTimeout(()=>I(null),4500);return}M(!0)},customIds:e.customProducts.map(Y=>Y.id),onRemoveProduct:U}),c.jsxs("main",{className:"canvas-wrap","data-tour":"canvas",ref:tt,onWheel:Y=>{!ve||e.view==="3d"||!Y.ctrlKey&&!Y.metaKey||(Y.preventDefault(),O(Pe+(Y.deltaY<0?Dl:-Dl),{x:Y.clientX,y:Y.clientY}))},children:[y&&c.jsxs("div",{className:"promo-canvas-prompt",children:["ð¨ ",t("promo.clickProduct")]}),ve&&e.view==="3d"?c.jsx(wR,{shelf:ve,groups:e.groups,marketing:e.marketing,products:he,onReadyCapture:Y=>{St.current=Y}}):ve?c.jsx("div",{className:"canvas-zoom-surface",style:{width:`${Pe*100}%`,height:`${Pe*100}%`,margin:Pe<1?"auto":0},children:c.jsx(CM,{ref:Xe,shelf:ve,groups:e.groups,marketing:e.marketing,products:he,view:e.view==="3d"?"2.5d":e.view,selectedId:m,ghost:Xn,onGroupPointerDown:Le,onMarketingPointerDown:ze,onBackgroundClick:()=>x(null),onDeleteItem:We,dimmedId:p!=null&&p.offShelf?p.id:null,groupInteractionMode:y})}):c.jsx("div",{className:"empty",children:t("app.chooseShelfEmpty")})]}),E&&ve&&c.jsx(PR,{shelf:ve,groups:e.groups,productsById:he,assumptions:e.statisticsAssumptions,onAssumptionsChange:Y=>n(ne=>({...ne,statisticsAssumptions:{...ne.statisticsAssumptions,...Y}})),onClose:()=>w(!1),onSendForAnalysis:Ln}),!E&&Re&&!y&&c.jsx(OM,{group:Re,onChange:Y=>mt(Re.id,Y),onDelete:()=>{n(Y=>({...Y,groups:Y.groups.filter(ne=>ne.id!==Re.id)})),x(null)},onClose:()=>x(null)}),!E&&be&&c.jsx(jM,{item:be,onChange:Y=>n(ne=>({...ne,marketing:ne.marketing.map(de=>de.id===be.id?{...de,...Y}:de)})),onDelete:()=>{n(Y=>({...Y,marketing:Y.marketing.filter(ne=>ne.id!==be.id)})),x(null)},onClose:()=>x(null)})]}),o&&!o.snap&&c.jsxs("div",{className:"drag-cursor",style:{left:o.clientX,top:o.clientY},children:["𥫠",Ae(o.productId).name]}),u&&c.jsx(UM,{pending:u,product:Ae(u.productId),onConfirm:me,onCancel:()=>f(null)}),y&&xt&&c.jsx(UR,{mode:y,group:xt,onApply:Y=>{const ne=y;n(de=>({...de,groups:de.groups.map(Ue=>{if(Ue.id!==xt.id)return Ue;const we={...Ue};
4158return ne==="label"?Y?we.labelColor=Y:delete we.labelColor:Y?we.priceColor=Y:delete we.priceColor,we})})),v(null),I(t(Y?ne==="label"?"promo.labelApplied":"promo.priceApplied":ne==="label"?"promo.labelReset":"promo.priceReset")),setTimeout(()=>I(null),3500)},onClose:()=>v(null)},`${y}-${xt.id}`),A&&c.jsx(kR,{clientCode:jt,onConfirm:ru,onCancel:()=>_(!1)}),T&&jt&&c.jsx(DR,{clientCode:jt,currentState:e,onOpen:(Y,ne)=>{n({...Y,customProducts:Y.customProducts??[]}),x(null),w(!1),wt(1),N(!1),I(t("draft.opened",{title:ne})),setTimeout(()=>I(null),3500)},onClose:()=>N(!1)}),z&&c.jsx("div",{className:"toast",children:z}),(p==null?void 0:p.offShelf)&&c.jsxs("div",{className:"toast danger",children:["ð ",t("app.removeShelfToast")]}),b&&c.jsx(Ux,{defaultMine:e.step===1,onConfirm:Y=>{n(ne=>fe!==null&&ne.customProducts.length>=fe?ne:{...ne,customProducts:[...ne.customProducts,Y]}),M(!1)},onCancel:()=>M(!1)}),Qe&&jt&&c.jsx(FR,{onFinish:ct}),L&&c.jsx(UE,{amountEur:eg(),productCount:Gt,onPay:()=>OR({code:jt??"",signature:At,productCount:Gt,amountEur:eg()}),onCancel:()=>R(!1)}),D&&c.jsx(FE,{onClose:()=>{window.location.href=window.location.pathname}})]}):c.jsx(ll,{initialError:t("app.invalidAccessCode",{code:jt})}):c.jsx(ll,{})}xd.createRoot(document.getElementById("root")).render(c.jsx(ny.StrictMode,{children:c.jsx(NM,{children:c.jsx(jR,{})})}));
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.