vendor: 9,577 bytes, lines 1-25
1var ive=Object.defineProperty;var sve=(n,e,t)=>e in n?ive(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var rr=(n,e,t)=>sve(n,typeof e!="symbol"?e+"":e,t);function Mie(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in n)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var jA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function F1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var b7={exports:{}},a3={},w7={exports:{}},xi={};/** 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 VH;function ave(){if(VH)return xi;VH=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.iterator;function f(Y){return Y===null||typeof Y!="object"?null:(Y=h&&Y[h]||Y["@@iterator"],typeof Y=="function"?Y:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,A={};function x(Y,re,_e){this.props=Y,this.context=re,this.refs=A,this.updater=_e||p}x.prototype.isReactComponent={},x.prototype.setState=function(Y,re){if(typeof Y!="object"&&typeof Y!="function"&&Y!=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,Y,re,"setState")},x.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function b(){}b.prototype=x.prototype;function _(Y,re,_e){this.props=Y,this.context=re,this.refs=A,this.updater=_e||p}var M=_.prototype=new b;M.constructor=_,g(M,x.prototype),M.isPureReactComponent=!0;var T=Array.isArray,L=Object.prototype.hasOwnProperty,D={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function O(Y,re,_e){var Ee,Ae={},te=null,ve=null;if(re!=null)for(Ee in re.ref!==void 0&&(ve=re.ref),re.key!==void 0&&(te=""+re.key),re)L.call(re,Ee)&&!P.hasOwnProperty(Ee)&&(Ae[Ee]=re[Ee]);var we=arguments.length-2;if(we===1)Ae.children=_e;else if(1<we){for(var Ue=Array(we),ze=0;ze<we;ze++)Ue[ze]=arguments[ze+2];Ae.children=Ue}if(Y&&Y.defaultProps)for(Ee in we=Y.defaultProps,we)Ae[Ee]===void 0&&(Ae[Ee]=we[Ee]);return{$$typeof:n,type:Y,key:te,ref:ve,props:Ae,_owner:D.current}}function F(Y,re){return{$$typeof:n,type:Y.type,key:re,ref:Y.ref,props:Y.props,_owner:Y._owner}}function U(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===n}function B(Y){var re={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(_e){return re[_e]})}var z=/\/+/g;function H(Y,re){return typeof Y=="object"&&Y!==null&&Y.key!=null?B(""+Y.key):re.toString(36)}function X(Y,re,_e,Ee,Ae){var te=typeof Y;(te==="undefined"||te==="boolean")&&(Y=null);var ve=!1;if(Y===null)ve=!0;else switch(te){case"string":case"number":ve=!0;break;case"object":switch(Y.$$typeof){case n:case e:ve=!0}}if(ve)return ve=Y,Ae=Ae(ve),Y=Ee===""?"."+H(ve,0):Ee,T(Ae)?(_e="",Y!=null&&(_e=Y.replace(z,"$&/")+"/"),X(Ae,re,_e,"",function(ze){return ze})):Ae!=null&&(U(Ae)&&(Ae=F(Ae,_e+(!Ae.key||ve&&ve.key===Ae.key?"":(""+Ae.key).replace(z,"$&/")+"/")+Y)),re.push(Ae)),1;if(ve=0,Ee=Ee===""?".":Ee+":",T(Y))for(var we=0;we<Y.length;we++){te=Y[we];var Ue=Ee+H(te,we);ve+=X(te,re,_e,Ue,Ae)}else if(Ue=f(Y),typeof Ue=="function")for(Y=Ue.call(Y),we=0;!(te=Y.next()).done;)te=te.value,Ue=Ee+H(te,we++),ve+=X(te,re,_e,Ue,Ae);else if(te==="object")throw re=String(Y),Error("Objects are not valid as a React child (found: "+(re==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":re)+"). If you meant to render a collection of children, use an array instead.");return ve}function W(Y,re,_e){if(Y==null)return Y;var Ee=[],Ae=0;return X(Y,Ee,"","",function(te){return re.call(_e,te,Ae++)}),Ee}function J(Y){if(Y._status===-1){var re=Y._result;re=re(),re.then(function(_e){(Y._status===0||Y._status===-1)&&(Y._status=1,Y._result=_e)},function(_e){(Y._status===0||Y._status===-1)&&(Y._status=2,Y._result=_e)}),Y._status===-1&&(Y._status=0,Y._result=re)}if(Y._status===1)return Y._result.default;throw Y._result}var ee={current:null},ae={transition:null},le={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:ae,ReactCurrentOwner:D};function Z(){throw Error("act(...) is not supported in production builds of React.")}return xi.Children={map:W,forEach:function(Y,re,_e){W(Y,function(){re.apply(this,arguments)},_e)},count:function(Y){var re=0;return W(Y,function(){re++}),re},toArray:function(Y){return W(Y,function(re){return re})||[]},only:function(Y){if(!U(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}},xi.Component=x,xi.Fragment=t,xi.Profiler=i,xi.PureComponent=_,xi.StrictMode=r,xi.Suspense=l,xi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=le,xi.act=Z,xi.cloneElement=function(Y,re,_e){if(Y==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Y+".");var Ee=g({},Y.props),Ae=Y.key,te=Y.ref,ve=Y._owner;if(re!=null){if(re.ref!==void 0&&(te=re.ref,ve=D.current),re.key!==void 0&&(Ae=""+re.key),Y.type&&Y.type.defaultProps)var we=Y.type.defaultProps;for(Ue in re)L.call(re,Ue)&&!P.hasOwnProperty(Ue)&&(Ee[Ue]=re[Ue]===void 0&&we!==void 0?we[Ue]:re[Ue])}var Ue=arguments.length-2;if(Ue===1)Ee.children=_e;else if(1<Ue){we=Array(Ue);for(var ze=0;ze<Ue;ze++)we[ze]=arguments[ze+2];Ee.children=we}return{$$typeof:n,type:Y.type,key:Ae,ref:te,props:Ee,_owner:ve}},xi.createContext=function(Y){return Y={$$typeof:a,_currentValue:Y,_currentValue2:Y,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Y.Provider={$$typeof:s,_context:Y},Y.Consumer=Y},xi.createElement=O,xi.createFactory=function(Y){var re=O.bind(null,Y);return re.type=Y,re},xi.createRef=function(){return{current:null}},xi.forwardRef=function(Y){return{$$typeof:o,render:Y}},xi.isValidElement=U,xi.lazy=function(Y){return{$$typeof:d,_payload:{_status:-1,_result:Y},_init:J}},xi.memo=function(Y,re){return{$$typeof:u,type:Y,compare:re===void 0?null:re}},xi.startTransition=function(Y){var re=ae.transition;ae.transition={};try{Y()}finally{ae.transition=re}},xi.unstable_act=Z,xi.useCallback=function(Y,re){return ee.current.useCallback(Y,re)},xi.useContext=function(Y){return ee.current.useContext(Y)},xi.useDebugValue=function(){},xi.useDeferredValue=function(Y){return ee.current.useDeferredValue(Y)},xi.useEffect=function(Y,re){return ee.current.useEffect(Y,re)},xi.useId=function(){return ee.current.useId()},xi.useImperativeHandle=function(Y,re,_e){return ee.current.useImperativeHandle(Y,re,_e)},xi.useInsertionEffect=function(Y,re){return ee.current.useInsertionEffect(Y,re)},xi.useLayoutEffect=function(Y,re){return ee.current.useLayoutEffect(Y,re)},xi.useMemo=function(Y,re){return ee.current.useMemo(Y,re)},xi.useReducer=function(Y,re,_e){return ee.current.useReducer(Y,re,_e)},xi.useRef=function(Y){return ee.current.useRef(Y)},xi.useState=function(Y){return ee.current.useState(Y)},xi.useSyncExternalStore=function(Y,re,_e){return ee.current.useSyncExternalStore(Y,re,_e)},xi.useTransition=function(){return ee.current.useTransition()},xi.version="18.3.1",xi}var zH;function f_(){return zH||(zH=1,w7.exports=ave()),w7.exports}/** 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 GH;function ove(){if(GH)return a3;GH=1;var n=f_(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(o,l,u){var d,h={},f=null,p=null;u!==void 0&&(f=""+u),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!s.hasOwnProperty(d)&&(h[d]=l[d]);if(o&&o.defaultProps)for(d in l=o.defaultProps,l)h[d]===void 0&&(h[d]=l[d]);return{$$typeof:e,type:o,key:f,ref:p,props:h,_owner:i.current}}return a3.Fragment=t,a3.jsx=a,a3.jsxs=a,a3}var qH;function lve(){return qH||(qH=1,b7.exports=ove()),b7.exports}var c=lve(),G=f_();const jn=F1(G),$b=Mie({__proto__:null,default:jn},[G]);var ME={},_7={exports:{}},Mu={},S7={exports:{}},T7={};/** 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 */var $H;function cve(){return $H||($H=1,(function(n){function e(ae,le){var Z=ae.length;ae.push(le);e:for(;0<Z;){var Y=Z-1>>>1,re=ae[Y];if(0<i(re,le))ae[Y]=le,ae[Z]=re,Z=Y;else break e}}function t(ae){return ae.length===0?null:ae[0]}function r(ae){if(ae.length===0)return null;var le=ae[0],Z=ae.pop();if(Z!==le){ae[0]=Z;e:for(var Y=0,re=ae.length,_e=re>>>1;Y<_e;){var Ee=2*(Y+1)-1,Ae=ae[Ee],te=Ee+1,ve=ae[te];
vendor: 52,040 bytes, lines 25-38
25if(0>i(Ae,Z))te<re&&0>i(ve,Ae)?(ae[Y]=ve,ae[te]=Z,Y=te):(ae[Y]=Ae,ae[Ee]=Z,Y=Ee);else if(te<re&&0>i(ve,Z))ae[Y]=ve,ae[te]=Z,Y=te;else break e}}return le}function i(ae,le){var Z=ae.sortIndex-le.sortIndex;return Z!==0?Z:ae.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();n.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,h=null,f=3,p=!1,g=!1,A=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(ae){for(var le=t(u);le!==null;){if(le.callback===null)r(u);else if(le.startTime<=ae)r(u),le.sortIndex=le.expirationTime,e(l,le);else break;le=t(u)}}function T(ae){if(A=!1,M(ae),!g)if(t(l)!==null)g=!0,J(L);else{var le=t(u);le!==null&&ee(T,le.startTime-ae)}}function L(ae,le){g=!1,A&&(A=!1,b(O),O=-1),p=!0;var Z=f;try{for(M(le),h=t(l);h!==null&&(!(h.expirationTime>le)||ae&&!B());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,f=h.priorityLevel;var re=Y(h.expirationTime<=le);le=n.unstable_now(),typeof re=="function"?h.callback=re:h===t(l)&&r(l),M(le)}else r(l);h=t(l)}if(h!==null)var _e=!0;else{var Ee=t(u);Ee!==null&&ee(T,Ee.startTime-le),_e=!1}return _e}finally{h=null,f=Z,p=!1}}var D=!1,P=null,O=-1,F=5,U=-1;function B(){return!(n.unstable_now()-U<F)}function z(){if(P!==null){var ae=n.unstable_now();U=ae;var le=!0;try{le=P(!0,ae)}finally{le?H():(D=!1,P=null)}}else D=!1}var H;if(typeof _=="function")H=function(){_(z)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,W=X.port2;X.port1.onmessage=z,H=function(){W.postMessage(null)}}else H=function(){x(z,0)};function J(ae){P=ae,D||(D=!0,H())}function ee(ae,le){O=x(function(){ae(n.unstable_now())},le)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(ae){ae.callback=null},n.unstable_continueExecution=function(){g||p||(g=!0,J(L))},n.unstable_forceFrameRate=function(ae){0>ae||125<ae?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<ae?Math.floor(1e3/ae):5},n.unstable_getCurrentPriorityLevel=function(){return f},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(ae){switch(f){case 1:case 2:case 3:var le=3;break;default:le=f}var Z=f;f=le;try{return ae()}finally{f=Z}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(ae,le){switch(ae){case 1:case 2:case 3:case 4:case 5:break;default:ae=3}var Z=f;f=ae;try{return le()}finally{f=Z}},n.unstable_scheduleCallback=function(ae,le,Z){var Y=n.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?Y+Z:Y):Z=Y,ae){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=Z+re,ae={id:d++,callback:le,priorityLevel:ae,startTime:Z,expirationTime:re,sortIndex:-1},Z>Y?(ae.sortIndex=Z,e(u,ae),t(l)===null&&ae===t(u)&&(A?(b(O),O=-1):A=!0,ee(T,Z-Y))):(ae.sortIndex=re,e(l,ae),g||p||(g=!0,J(L))),ae},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(ae){var le=f;return function(){var Z=f;f=le;try{return ae.apply(this,arguments)}finally{f=Z}}}})(T7)),T7}var HH;function uve(){return HH||(HH=1,S7.exports=cve()),S7.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 WH;function dve(){if(WH)return Mu;WH=1;var n=f_(),e=uve();function t(y){for(var E="https://reactjs.org/docs/error-decoder.html?invariant="+y,j=1;j<arguments.length;j++)E+="&args[]="+encodeURIComponent(arguments[j]);return"Minified React error #"+y+"; visit "+E+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function s(y,E){a(y,E),a(y+"Capture",E)}function a(y,E){for(i[y]=E,y=0;y<E.length;y++)r.add(E[y])}var o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},h={};function f(y){return l.call(h,y)?!0:l.call(d,y)?!1:u.test(y)?h[y]=!0:(d[y]=!0,!1)}function p(y,E,j,q){if(j!==null&&j.type===0)return!1;switch(typeof E){case"function":case"symbol":return!0;case"boolean":return q?!1:j!==null?!j.acceptsBooleans:(y=y.toLowerCase().slice(0,5),y!=="data-"&&y!=="aria-");default:return!1}}function g(y,E,j,q){if(E===null||typeof E>"u"||p(y,E,j,q))return!0;if(q)return!1;if(j!==null)switch(j.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 A(y,E,j,q,Q,se,Re){this.acceptsBooleans=E===2||E===3||E===4,this.attributeName=q,this.attributeNamespace=Q,this.mustUseProperty=j,this.propertyName=y,this.type=E,this.sanitizeURL=se,this.removeEmptyString=Re}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(y){x[y]=new A(y,0,!1,y,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(y){var E=y[0];x[E]=new A(E,1,!1,y[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(y){x[y]=new A(y,2,!1,y.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(y){x[y]=new A(y,2,!1,y,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(y){x[y]=new A(y,3,!1,y.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(y){x[y]=new A(y,3,!0,y,null,!1,!1)}),["capture","download"].forEach(function(y){x[y]=new A(y,4,!1,y,null,!1,!1)}),["cols","rows","size","span"].forEach(function(y){x[y]=new A(y,6,!1,y,null,!1,!1)}),["rowSpan","start"].forEach(function(y){x[y]=new A(y,5,!1,y.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function _(y){return y[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(y){var E=y.replace(b,_);x[E]=new A(E,1,!1,y,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(y){var E=y.replace(b,_);x[E]=new A(E,1,!1,y,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(y){var E=y.replace(b,_);x[E]=new A(E,1,!1,y,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(y){x[y]=new A(y,1,!1,y.toLowerCase(),null,!1,!1)}),x.xlinkHref=new A("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(y){x[y]=new A(y,1,!1,y.toLowerCase(),null,!0,!0)});function M(y,E,j,q){var Q=x.hasOwnProperty(E)?x[E]:null;(Q!==null?Q.type!==0:q||!(2<E.length)||E[0]!=="o"&&E[0]!=="O"||E[1]!=="n"&&E[1]!=="N")&&(g(E,j,Q,q)&&(j=null),q||Q===null?f(E)&&(j===null?y.removeAttribute(E):y.setAttribute(E,""+j)):Q.mustUseProperty?y[Q.propertyName]=j===null?Q.type===3?!1:"":j:(E=Q.attributeName,q=Q.attributeNamespace,j===null?y.removeAttribute(E):(Q=Q.type,j=Q===3||Q===4&&j===!0?"":""+j,q?y.setAttributeNS(q,E,j):y.setAttribute(E,j))))}var T=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),D=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),B=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),ee=Symbol.for("react.offscreen"),ae=Symbol.iterator;function le(y){return y===null||typeof y!="object"?null:(y=ae&&y[ae]||y["@@iterator"],typeof y=="function"?y:null)}var Z=Object.assign,Y;function re(y){if(Y===void 0)try{throw Error()}catch(j){var E=j.stack.trim().match(/\n( *(at )?)/);Y=E&&E[1]||""}return` 34`+Y+y}var _e=!1;function Ee(y,E){if(!y||_e)return"";_e=!0;var j=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(Vt){var q=Vt}Reflect.construct(y,[],E)}else{try{E.call()}catch(Vt){q=Vt}y.call(E.prototype)}else{try{throw Error()}catch(Vt){q=Vt}y()}}catch(Vt){if(Vt&&q&&typeof Vt.stack=="string"){for(var Q=Vt.stack.split(` 35`),se=q.stack.split(` 36`),Re=Q.length-1,rt=se.length-1;1<=Re&&0<=rt&&Q[Re]!==se[rt];)rt--;for(;1<=Re&&0<=rt;Re--,rt--)if(Q[Re]!==se[rt]){if(Re!==1||rt!==1)do if(Re--,rt--,0>rt||Q[Re]!==se[rt]){var gt=` 37`+Q[Re].replace(" at new "," at ");return y.displayName&>.includes("<anonymous>")&&(gt=gt.replace("<anonymous>",y.displayName)),gt}while(1<=Re&&0<=rt);break}}}finally{_e=!1,Error.prepareStackTrace=j}return(y=y?y.displayName||y.name:"")?re(y):""}function Ae(y){switch(y.tag){case 5:return re(y.type);case 16:return re("Lazy");case 13:return re("Suspense");case 19:return re("SuspenseList");case 0:case 2:case 15:return y=Ee(y.type,!1),y;case 11:return y=Ee(y.type.render,!1),y;case 1:return y=Ee(y.type,!0),y;default:return""}}function te(y){if(y==null)return null;if(typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case P:return"Fragment";case D:return"Portal";case F:return"Profiler";case O:return"StrictMode";case H:return"Suspense";case X:return"SuspenseList"}if(typeof y=="object")switch(y.$$typeof){case B:return(y.displayName||"Context")+".Consumer";case U:return(y._context.displayName||"Context")+".Provider";case z:var E=y.render;return y=y.displayName,y||(y=E.displayName||E.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case W:return E=y.displayName||null,E!==null?E:te(y.type)||"Memo";case J:E=y._payload,y=y._init;try{return te(y(E))}catch{}}return null}function ve(y){var E=y.type;switch(y.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 y=E.render,y=y.displayName||y.name||"",E.displayName||(y!==""?"ForwardRef("+y+")":"ForwardRef");case 7:return"Fragment";case 5:return E;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(E);case 8:return E===O?"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 we(y){switch(typeof y){case"boolean":case"number":case"string":case"undefined":return y;case"object":return y;default:return""}}function Ue(y){var E=y.type;return(y=y.nodeName)&&y.toLowerCase()==="input"&&(E==="checkbox"||E==="radio")}function ze(y){var E=Ue(y)?"checked":"value",j=Object.getOwnPropertyDescriptor(y.constructor.prototype,E),q=""+y[E];if(!y.hasOwnProperty(E)&&typeof j<"u"&&typeof j.get=="function"&&typeof j.set=="function"){var Q=j.get,se=j.set;return Object.defineProperty(y,E,{configurable:!0,get:function(){return Q.call(this)},set:function(Re){q=""+Re,se.call(this,Re)}}),Object.defineProperty(y,E,{enumerable:j.enumerable}),{getValue:function(){return q},setValue:function(Re){q=""+Re},stopTracking:function(){y._valueTracker=null,delete y[E]}}}}function yt(y){y._valueTracker||(y._valueTracker=ze(y))}function mt(y){if(!y)return!1;var E=y._valueTracker;if(!E)return!0;var j=E.getValue(),q="";return y&&(q=Ue(y)?y.checked?"true":"false":y.value),y=q,y!==j?(E.setValue(y),!0):!1}function bt(y){if(y=y||(typeof document<"u"?document:void 0),typeof y>"u")return null;try{return y.activeElement||y.body}catch{return y.body}}function dt(y,E){var j=E.checked;return Z({},E,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:j??y._wrapperState.initialChecked})}function St(y,E){var j=E.defaultValue==null?"":E.defaultValue,q=E.checked!=null?E.checked:E.defaultChecked;j=we(E.value!=null?E.value:j),y._wrapperState={initialChecked:q,initialValue:j,controlled:E.type==="checkbox"||E.type==="radio"?E.checked!=null:E.value!=null}}function kt(y,E){E=E.checked,E!=null&&M(y,"checked",E,!1)}function Fe(y,E){kt(y,E);var j=we(E.value),q=E.type;if(j!=null)q==="number"?(j===0&&y.value===""||y.value!=j)&&(y.value=""+j):y.value!==""+j&&(y.value=""+j);else if(q==="submit"||q==="reset"){y.removeAttribute("value");return}E.hasOwnProperty("value")?Ye(y,E.type,j):E.hasOwnProperty("defaultValue")&&Ye(y,E.type,we(E.defaultValue)),E.checked==null&&E.defaultChecked!=null&&(y.defaultChecked=!!E.defaultChecked)}function Ze(y,E,j){if(E.hasOwnProperty("value")||E.hasOwnProperty("defaultValue")){var q=E.type;if(!(q!=="submit"&&q!=="reset"||E.value!==void 0&&E.value!==null))return;E=""+y._wrapperState.initialValue,j||E===y.value||(y.value=E),y.defaultValue=E}j=y.name,j!==""&&(y.name=""),y.defaultChecked=!!y._wrapperState.initialChecked,j!==""&&(y.name=j)}function Ye(y,E,j){(E!=="number"||bt(y.ownerDocument)!==y)&&(j==null?y.defaultValue=""+y._wrapperState.initialValue:y.defaultValue!==""+j&&(y.defaultValue=""+j))}var ft=Array.isArray;function At(y,E,j,q){if(y=y.options,E){E={};for(var Q=0;Q<j.length;Q++)E["$"+j[Q]]=!0;for(j=0;j<y.length;j++)Q=E.hasOwnProperty("$"+y[j].value),y[j].selected!==Q&&(y[j].selected=Q),Q&&q&&(y[j].defaultSelected=!0)}else{for(j=""+we(j),E=null,Q=0;Q<y.length;Q++){if(y[Q].value===j){y[Q].selected=!0,q&&(y[Q].defaultSelected=!0);return}E!==null||y[Q].disabled||(E=y[Q])}E!==null&&(E.selected=!0)}}function Ce(y,E){if(E.dangerouslySetInnerHTML!=null)throw Error(t(91));return Z({},E,{value:void 0,defaultValue:void 0,children:""+y._wrapperState.initialValue})}function Se(y,E){var j=E.value;if(j==null){if(j=E.children,E=E.defaultValue,j!=null){if(E!=null)throw Error(t(92));if(ft(j)){if(1<j.length)throw Error(t(93));j=j[0]}E=j}E==null&&(E=""),j=E}y._wrapperState={initialValue:we(j)}}function qe(y,E){var j=we(E.value),q=we(E.defaultValue);j!=null&&(j=""+j,j!==y.value&&(y.value=j),E.defaultValue==null&&y.defaultValue!==j&&(y.defaultValue=j)),q!=null&&(y.defaultValue=""+q)}function pt(y){var E=y.textContent;E===y._wrapperState.initialValue&&E!==""&&E!==null&&(y.value=E)}function Te(y){switch(y){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 oe(y,E){return y==null||y==="http://www.w3.org/1999/xhtml"?Te(E):y==="http://www.w3.org/2000/svg"&&E==="foreignObject"?"http://www.w3.org/1999/xhtml":y}var ge,Ne=(function(y){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(E,j,q,Q){MSApp.execUnsafeLocalFunction(function(){return y(E,j,q,Q)})}:y})(function(y,E){if(y.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in y)y.innerHTML=E;else{for(ge=ge||document.createElement("div"),ge.innerHTML="<svg>"+E.valueOf().toString()+"</svg>",E=ge.firstChild;y.firstChild;)y.removeChild(y.firstChild);for(;E.firstChild;)y.appendChild(E.firstChild)}});function ke(y,E){if(E){var j=y.firstChild;if(j&&j===y.lastChild&&j.nodeType===3){j.nodeValue=E;return}}y.textContent=E}var Xe={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},et=["Webkit","ms","Moz","O"];Object.keys(Xe).forEach(function(y){et.forEach(function(E){E=E+y.charAt(0).toUpperCase()+y.substring(1),Xe[E]=Xe[y]})});function Qe(y,E,j){return E==null||typeof E=="boolean"||E===""?"":j||typeof E!="number"||E===0||Xe.hasOwnProperty(y)&&Xe[y]?(""+E).trim():E+"px"}function lt(y,E){y=y.style;for(var j in E)if(E.hasOwnProperty(j)){var q=j.indexOf("--")===0,Q=Qe(j,E[j],q);j==="float"&&(j="cssFloat"),q?y.setProperty(j,Q):y[j]=Q}}var tt=Z({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 Ft(y,E){if(E){if(tt[y]&&(E.children!=null||E.dangerouslySetInnerHTML!=null))throw Error(t(137,y));if(E.dangerouslySetInnerHTML!=null){if(E.children!=null)throw Error(t(60));if(typeof E.dangerouslySetInnerHTML!="object"||!("__html"in E.dangerouslySetInnerHTML))throw Error(t(61))}if(E.style!=null&&typeof E.style!="object")throw Error(t(62))}}function Mt(y,E){if(y.indexOf("-")===-1)return typeof E.is=="string";switch(y){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 Nt=null;function Je(y){return y=y.target||y.srcElement||window,y.correspondingUseElement&&(y=y.correspondingUseElement),y.nodeType===3?y.parentNode:y}var fn=null,Tn=null,nt=null;function Kt(y){if(y=de(y)){if(typeof fn!="function")throw Error(t(280));var E=y.stateNode;E&&(E=Be(E),fn(y.stateNode,y.type,E))}}function Lt(y){Tn?nt?nt.push(y):nt=[y]:Tn=y}function cn(){if(Tn){var y=Tn,E=nt;if(nt=Tn=null,Kt(y),E)for(y=0;y<E.length;y++)Kt(E[y])}}function dn(y,E){return y(E)}function Bt(){}var Ht=!1;function qt(y,E,j){if(Ht)return y(E,j);Ht=!0;try{return dn(y,E,j)}finally{Ht=!1,(Tn!==null||nt!==null)&&(Bt(),cn())}}function Fn(y,E){var j=y.stateNode;if(j===null)return null;var q=Be(j);if(q===null)return null;j=q[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":(q=!q.disabled)||(y=y.type,q=!(y==="button"||y==="input"||y==="select"||y==="textarea")),y=!q;break e;default:y=!1}if(y)return null;if(j&&typeof j!="function")throw Error(t(231,E,typeof j));return j}var xe=!1;if(o)try{var Oe={};Object.defineProperty(Oe,"passive",{get:function(){xe=!0}}),window.addEventListener("test",Oe,Oe),window.removeEventListener("test",Oe,Oe)}catch{xe=!1}function Ge(y,E,j,q,Q,se,Re,rt,gt){var Vt=Array.prototype.slice.call(arguments,3);try{E.apply(j,Vt)}catch(Sn){this.onError(Sn)}}var $e=!1,m=null,be=!1,en=null,on={onError:function(y){$e=!0,m=y}};function tn(y,E,j,q,Q,se,Re,rt,gt){$e=!1,m=null,Ge.apply(on,arguments)}function Qt(y,E,j,q,Q,se,Re,rt,gt){if(tn.apply(this,arguments),$e){if($e){var Vt=m;$e=!1,m=null}else throw Error(t(198));be||(be=!0,en=Vt)}}function Pt(y){var E=y,j=y;if(y.alternate)for(;E.return;)E=E.return;else{y=E;do E=y,(E.flags&4098)!==0&&(j=E.return),y=E.return;while(y)}return E.tag===3?j:null}function bn(y){if(y.tag===13){var E=y.memoizedState;if(E===null&&(y=y.alternate,y!==null&&(E=y.memoizedState)),E!==null)return E.dehydrated}return null}function wn(y){if(Pt(y)!==y)throw Error(t(188))}function zn(y){var E=y.alternate;if(!E){if(E=Pt(y),E===null)throw Error(t(188));return E!==y?null:y}for(var j=y,q=E;;){var Q=j.return;if(Q===null)break;var se=Q.alternate;if(se===null){if(q=Q.return,q!==null){j=q;continue}break}if(Q.child===se.child){for(se=Q.child;se;){if(se===j)return wn(Q),y;if(se===q)return wn(Q),E;se=se.sibling}throw Error(t(188))}if(j.return!==q.return)j=Q,q=se;else{for(var Re=!1,rt=Q.child;rt;){if(rt===j){Re=!0,j=Q,q=se;break}if(rt===q){Re=!0,q=Q,j=se;break}rt=rt.sibling}if(!Re){for(rt=se.child;rt;){if(rt===j){Re=!0,j=se,q=Q;break}if(rt===q){Re=!0,q=se,j=Q;break}rt=rt.sibling}if(!Re)throw Error(t(189))}}if(j.alternate!==q)throw Error(t(190))}if(j.tag!==3)throw Error(t(188));return j.stateNode.current===j?y:E}function Un(y){return y=zn(y),y!==null?_n(y):null}function _n(y){if(y.tag===5||y.tag===6)return y;for(y=y.child;y!==null;){var E=_n(y);if(E!==null)return E;y=y.sibling}return null}var xr=e.unstable_scheduleCallback,Ir=e.unstable_cancelCallback,is=e.unstable_shouldYield,si=e.unstable_requestPaint,vr=e.unstable_now,Yi=e.unstable_getCurrentPriorityLevel,Vi=e.unstable_ImmediatePriority,Pe=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,ce=e.unstable_LowPriority,at=e.unstable_IdlePriority,vt=null,vn=null;function Rn(y){if(vn&&typeof vn.onCommitFiberRoot=="function")try{vn.onCommitFiberRoot(vt,y,void 0,(y.current.flags&128)===128)}catch{}}var ln=Math.clz32?Math.clz32:Nr,kn=Math.log,pe=Math.LN2;function Nr(y){return y>>>=0,y===0?32:31-(kn(y)/pe|0)|0}var zr=64,sr=4194304;function Ai(y){switch(y&-y){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 y&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return y&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return y}}function Oi(y,E){var j=y.pendingLanes;if(j===0)return 0;var q=0,Q=y.suspendedLanes,se=y.pingedLanes,Re=j&268435455;if(Re!==0){var rt=Re&~Q;rt!==0?q=Ai(rt):(se&=Re,se!==0&&(q=Ai(se)))}else Re=j&~Q,Re!==0?q=Ai(Re):se!==0&&(q=Ai(se));if(q===0)return 0;if(E!==0&&E!==q&&(E&Q)===0&&(Q=q&-q,se=E&-E,Q>=se||Q===16&&(se&4194240)!==0))return E;if((q&4)!==0&&(q|=j&16),E=y.entangledLanes,E!==0)for(y=y.entanglements,E&=q;0<E;)j=31-ln(E),Q=1<<j,q|=y[j],E&=~Q;return q}function ss(y,E){switch(y){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 qi(y,E){for(var j=y.suspendedLanes,q=y.pingedLanes,Q=y.expirationTimes,se=y.pendingLanes;0<se;){var Re=31-ln(se),rt=1<<Re,gt=Q[Re];gt===-1?((rt&j)===0||(rt&q)!==0)&&(Q[Re]=ss(rt,E)):gt<=E&&(y.expiredLanes|=rt),se&=~rt}}function aa(y){return y=y.pendingLanes&-1073741825,y!==0?y:y&1073741824?1073741824:0}function Gn(){var y=zr;return zr<<=1,(zr&4194240)===0&&(zr=64),y}function ks(y){for(var E=[],j=0;31>j;j++)E.push(y);return E}function yr(y,E,j){y.pendingLanes|=E,E!==536870912&&(y.suspendedLanes=0,y.pingedLanes=0),y=y.eventTimes,E=31-ln(E),y[E]=j}function vl(y,E){var j=y.pendingLanes&~E;y.pendingLanes=E,y.suspendedLanes=0,y.pingedLanes=0,y.expiredLanes&=E,y.mutableReadLanes&=E,y.entangledLanes&=E,E=y.entanglements;var q=y.eventTimes;for(y=y.expirationTimes;0<j;){var Q=31-ln(j),se=1<<Q;E[Q]=0,q[Q]=-1,y[Q]=-1,j&=~se}}function Yo(y,E){var j=y.entangledLanes|=E;for(y=y.entanglements;j;){var q=31-ln(j),Q=1<<q;Q&E|y[q]&E&&(y[q]|=E),j&=~Q}}var ai=0;function Rc(y){return y&=-y,1<y?4<y?(y&268435455)!==0?16:536870912:4:1}var Qi,Rs,vu,Xn,$i,yl=!1,ah=[],Pc=null,pi=null,yu=null,tf=new Map,dp=new Map,Qo=[],oh="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 ql(y,E){switch(y){case"focusin":case"focusout":Pc=null;break;case"dragenter":case"dragleave":pi=null;break;case"mouseover":case"mouseout":yu=null;break;case"pointerover":case"pointerout":tf.delete(E.pointerId);break;case"gotpointercapture":case"lostpointercapture":dp.delete(E.pointerId)}}function lh(y,E,j,q,Q,se){return y===null||y.nativeEvent!==se?(y={blockedOn:E,domEventName:j,eventSystemFlags:q,nativeEvent:se,targetContainers:[Q]},E!==null&&(E=de(E),E!==null&&Rs(E)),y):(y.eventSystemFlags|=q,E=y.targetContainers,Q!==null&&E.indexOf(Q)===-1&&E.push(Q),y)}function oa(y,E,j,q,Q){switch(E){case"focusin":return Pc=lh(Pc,y,E,j,q,Q),!0;case"dragenter":return pi=lh(pi,y,E,j,q,Q),!0;case"mouseover":return yu=lh(yu,y,E,j,q,Q),!0;case"pointerover":var se=Q.pointerId;return tf.set(se,lh(tf.get(se)||null,y,E,j,q,Q)),!0;case"gotpointercapture":return se=Q.pointerId,dp.set(se,lh(dp.get(se)||null,y,E,j,q,Q)),!0}return!1}function ix(y){var E=Ad(y.target);if(E!==null){var j=Pt(E);if(j!==null){if(E=j.tag,E===13){if(E=bn(j),E!==null){y.blockedOn=E,$i(y.priority,function(){vu(j)});return}}else if(E===3&&j.stateNode.current.memoizedState.isDehydrated){y.blockedOn=j.tag===3?j.stateNode.containerInfo:null;return}}}y.blockedOn=null}function id(y){if(y.blockedOn!==null)return!1;for(var E=y.targetContainers;0<E.length;){var j=_g(y.domEventName,y.eventSystemFlags,E[0],y.nativeEvent);if(j===null){j=y.nativeEvent;var q=new j.constructor(j.type,j);Nt=q,j.target.dispatchEvent(q),Nt=null}else return E=de(j),E!==null&&Rs(E),y.blockedOn=j,!1;E.shift()}return!0}function bg(y,E,j){id(y)&&j.delete(E)}function Dy(){yl=!1,Pc!==null&&id(Pc)&&(Pc=null),pi!==null&&id(pi)&&(pi=null),yu!==null&&id(yu)&&(yu=null),tf.forEach(bg),dp.forEach(bg)}function nf(y,E){y.blockedOn===E&&(y.blockedOn=null,yl||(yl=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Dy)))}function sd(y){function E(Q){return nf(Q,y)}if(0<ah.length){nf(ah[0],y);for(var j=1;j<ah.length;j++){var q=ah[j];q.blockedOn===y&&(q.blockedOn=null)}}for(Pc!==null&&nf(Pc,y),pi!==null&&nf(pi,y),yu!==null&&nf(yu,y),tf.forEach(E),dp.forEach(E),j=0;j<Qo.length;j++)q=Qo[j],q.blockedOn===y&&(q.blockedOn=null);for(;0<Qo.length&&(j=Qo[0],j.blockedOn===null);)ix(j),j.blockedOn===null&&Qo.shift()}var rf=T.ReactCurrentBatchConfig,sx=!0;function U_(y,E,j,q){var Q=ai,se=rf.transition;rf.transition=null;try{ai=1,hp(y,E,j,q)}finally{ai=Q,rf.transition=se}}function Lo(y,E,j,q){var Q=ai,se=rf.transition;rf.transition=null;try{ai=4,hp(y,E,j,q)}finally{ai=Q,rf.transition=se}}function hp(y,E,j,q){if(sx){var Q=_g(y,E,j,q);if(Q===null)pd(y,E,q,wg,j),ql(y,q);else if(oa(Q,y,E,j,q))q.stopPropagation();else if(ql(y,q),E&4&&-1<oh.indexOf(y)){for(;Q!==null;){var se=de(Q);if(se!==null&&Qi(se),se=_g(y,E,j,q),se===null&&pd(y,E,q,wg,j),se===Q)break;Q=se}Q!==null&&q.stopPropagation()}else pd(y,E,q,null,j)}}var wg=null;function _g(y,E,j,q){if(wg=null,y=Je(q),y=Ad(y),y!==null)if(E=Pt(y),E===null)y=null;else if(j=E.tag,j===13){if(y=bn(E),y!==null)return y;y=null}else if(j===3){if(E.stateNode.current.memoizedState.isDehydrated)return E.tag===3?E.stateNode.containerInfo:null;y=null}else E!==y&&(y=null);return wg=y,null}function jy(y){switch(y){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(Yi()){case Vi:return 1;case Pe:return 4;case He:case ce:return 16;case at:return 536870912;default:return 16}default:return 16}}var ad=null,z0=null,G0=null;function q0(){if(G0)return G0;var y,E=z0,j=E.length,q,Q="value"in ad?ad.value:ad.textContent,se=Q.length;for(y=0;y<j&&E[y]===Q[y];y++);var Re=j-y;for(q=1;q<=Re&&E[j-q]===Q[se-q];q++);return G0=Q.slice(y,1<q?1-q:void 0)}function ax(y){var E=y.keyCode;return"charCode"in y?(y=y.charCode,y===0&&E===13&&(y=13)):y=E,y===10&&(y=13),32<=y||y===13?y:0}function od(){return!0}function $0(){return!1}function Oo(y){function E(j,q,Q,se,Re){this._reactName=j,this._targetInst=Q,this.type=q,this.nativeEvent=se,this.target=Re,this.currentTarget=null;for(var rt in y)y.hasOwnProperty(rt)&&(j=y[rt],this[rt]=j?j(se):se[rt]);return this.isDefaultPrevented=(se.defaultPrevented!=null?se.defaultPrevented:se.returnValue===!1)?od:$0,this.isPropagationStopped=$0,this}return Z(E.prototype,{preventDefault:function(){this.defaultPrevented=!0;var j=this.nativeEvent;j&&(j.preventDefault?j.preventDefault():typeof j.returnValue!="unknown"&&(j.returnValue=!1),this.isDefaultPrevented=od)},stopPropagation:function(){var j=this.nativeEvent;j&&(j.stopPropagation?j.stopPropagation():typeof j.cancelBubble!="unknown"&&(j.cancelBubble=!0),this.isPropagationStopped=od)},persist:function(){},isPersistent:od}),E}var fp={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(y){return y.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pp=Oo(fp),ld=Z({},fp,{view:0,detail:0}),H0=Oo(ld),W0,ox,ch,Ko=Z({},ld,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Er,button:0,buttons:0,relatedTarget:function(y){return y.relatedTarget===void 0?y.fromElement===y.srcElement?y.toElement:y.fromElement:y.relatedTarget},movementX:function(y){return"movementX"in y?y.movementX:(y!==ch&&(ch&&y.type==="mousemove"?(W0=y.screenX-ch.screenX,ox=y.screenY-ch.screenY):ox=W0=0,ch=y),W0)},movementY:function(y){return"movementY"in y?y.movementY:ox}}),X0=Oo(Ko),Do=Z({},Ko,{dataTransfer:0}),Lc=Oo(Do),$l=Z({},ld,{relatedTarget:0}),uh=Oo($l),Y0=Z({},fp,{animationName:0,elapsedTime:0,pseudoElement:0}),Q0=Oo(Y0),Iy=Z({},fp,{clipboardData:function(y){return"clipboardData"in y?y.clipboardData:window.clipboardData}}),B_=Oo(Iy),V_=Z({},fp,{data:0}),K0=Oo(V_),Fy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sg={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"},Tg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mp(y){var E=this.nativeEvent;return E.getModifierState?E.getModifierState(y):(y=Tg[y])?!!E[y]:!1}function Er(){return mp}var Hl=Z({},ld,{key:function(y){if(y.key){var E=Fy[y.key]||y.key;if(E!=="Unidentified")return E}return y.type==="keypress"?(y=ax(y),y===13?"Enter":String.fromCharCode(y)):y.type==="keydown"||y.type==="keyup"?Sg[y.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Er,charCode:function(y){return y.type==="keypress"?ax(y):0},keyCode:function(y){return y.type==="keydown"||y.type==="keyup"?y.keyCode:0},which:function(y){return y.type==="keypress"?ax(y):y.type==="keydown"||y.type==="keyup"?y.keyCode:0}}),Oc=Oo(Hl),cd=Z({},Ko,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bu=Oo(cd),Dc=Z({},ld,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Er}),sf=Oo(Dc),af=Z({},fp,{propertyName:0,elapsedTime:0,pseudoElement:0}),xa=Oo(af),wu=Z({},Ko,{deltaX:function(y){return"deltaX"in y?y.deltaX:"wheelDeltaX"in y?-y.wheelDeltaX:0},deltaY:function(y){return"deltaY"in y?y.deltaY:"wheelDeltaY"in y?-y.wheelDeltaY:"wheelDelta"in y?-y.wheelDelta:0},deltaZ:0,deltaMode:0}),Ao=Oo(wu),Eg=[9,13,27,32],ud=o&&"CompositionEvent"in window,gp=null;o&&"documentMode"in document&&(gp=document.documentMode);var Ni=o&&"TextEvent"in window&&!gp,jc=o&&(!ud||gp&&8<gp&&11>=gp),Ic=" ",Wl=!1;function ea(y,E){switch(y){case"keyup":return Eg.indexOf(E.keyCode)!==-1;case"keydown":return E.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xl(y){return y=y.detail,typeof y=="object"&&"data"in y?y.data:null}var ta=!1;function of(y,E){switch(y){case"compositionend":return Xl(E);case"keypress":return E.which!==32?null:(Wl=!0,Ic);case"textInput":return y=E.data,y===Ic&&Wl?null:y;default:return null}}function YT(y,E){if(ta)return y==="compositionend"||!ud&&ea(y,E)?(y=q0(),G0=z0=ad=null,ta=!1,y):null;switch(y){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 jc&&E.locale!=="ko"?null:E.data;default:return null}}var Uy={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 Ap(y){var E=y&&y.nodeName&&y.nodeName.toLowerCase();return E==="input"?!!Uy[y.type]:E==="textarea"}function xp(y,E,j,q){Lt(q),E=im(E,"onChange"),0<E.length&&(j=new pp("onChange","change",null,j,q),y.push({event:j,listeners:E}))}var dd=null,lf=null;function lx(y){Vy(y,0)}function dh(y){var E=me(y);if(mt(E))return y}function bl(y,E){if(y==="change")return E}var vp=!1;if(o){var Zo;if(o){var yp="oninput"in document;if(!yp){var Z0=document.createElement("div");Z0.setAttribute("oninput","return;"),yp=typeof Z0.oninput=="function"}Zo=yp}else Zo=!1;vp=Zo&&(!document.documentMode||9<document.documentMode)}function Di(){dd&&(dd.detachEvent("onpropertychange",Cg),lf=dd=null)}function Cg(y){if(y.propertyName==="value"&&dh(lf)){var E=[];xp(E,lf,y,Je(y)),qt(lx,E)}}function cx(y,E,j){y==="focusin"?(Di(),dd=E,lf=j,dd.attachEvent("onpropertychange",Cg)):y==="focusout"&&Di()}function ux(y){if(y==="selectionchange"||y==="keyup"||y==="keydown")return dh(lf)}function QT(y,E){if(y==="click")return dh(E)}function Yl(y,E){if(y==="input"||y==="change")return dh(E)}function KT(y,E){return y===E&&(y!==0||1/y===1/E)||y!==y&&E!==E}var Fc=typeof Object.is=="function"?Object.is:KT;function cf(y,E){if(Fc(y,E))return!0;if(typeof y!="object"||y===null||typeof E!="object"||E===null)return!1;var j=Object.keys(y),q=Object.keys(E);if(j.length!==q.length)return!1;for(q=0;q<j.length;q++){var Q=j[q];if(!l.call(E,Q)||!Fc(y[Q],E[Q]))return!1}return!0}function uf(y){for(;y&&y.firstChild;)y=y.firstChild;return y}function dx(y,E){var j=uf(y);y=0;for(var q;j;){if(j.nodeType===3){if(q=y+j.textContent.length,y<=E&&q>=E)return{node:j,offset:E-y};y=q}e:{for(;j;){if(j.nextSibling){j=j.nextSibling;break e}j=j.parentNode}j=void 0}j=uf(j)}}function By(y,E){return y&&E?y===E?!0:y&&y.nodeType===3?!1:E&&E.nodeType===3?By(y,E.parentNode):"contains"in y?y.contains(E):y.compareDocumentPosition?!!(y.compareDocumentPosition(E)&16):!1:!1}function Ng(){for(var y=window,E=bt();E instanceof y.HTMLIFrameElement;){try{var j=typeof E.contentWindow.location.href=="string"}catch{j=!1}if(j)y=E.contentWindow;else break;E=bt(y.document)}return E}function Mg(y){var E=y&&y.nodeName&&y.nodeName.toLowerCase();return E&&(E==="input"&&(y.type==="text"||y.type==="search"||y.type==="tel"||y.type==="url"||y.type==="password")||E==="textarea"||y.contentEditable==="true")}function ZT(y){var E=Ng(),j=y.focusedElem,q=y.selectionRange;if(E!==j&&j&&j.ownerDocument&&By(j.ownerDocument.documentElement,j)){if(q!==null&&Mg(j)){if(E=q.start,y=q.end,y===void 0&&(y=E),"selectionStart"in j)j.selectionStart=E,j.selectionEnd=Math.min(y,j.value.length);else if(y=(E=j.ownerDocument||document)&&E.defaultView||window,y.getSelection){y=y.getSelection();var Q=j.textContent.length,se=Math.min(q.start,Q);q=q.end===void 0?se:Math.min(q.end,Q),!y.extend&&se>q&&(Q=q,q=se,se=Q),Q=dx(j,se);var Re=dx(j,q);Q&&Re&&(y.rangeCount!==1||y.anchorNode!==Q.node||y.anchorOffset!==Q.offset||y.focusNode!==Re.node||y.focusOffset!==Re.offset)&&(E=E.createRange(),E.setStart(Q.node,Q.offset),y.removeAllRanges(),se>q?(y.addRange(E),y.extend(Re.node,Re.offset)):(E.setEnd(Re.node,Re.offset),y.addRange(E)))}}for(E=[],y=j;y=y.parentNode;)y.nodeType===1&&E.push({element:y,left:y.scrollLeft,top:y.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<E.length;j++)y=E[j],y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}var JT=o&&"documentMode"in document&&11>=document.documentMode,bp=null,hd=null,Uc=null,kg=!1;function J0(y,E,j){var q=j.window===j?j.document:j.nodeType===9?j:j.ownerDocument;kg||bp==null||bp!==bt(q)||(q=bp,"selectionStart"in q&&Mg(q)?q={start:q.selectionStart,end:q.selectionEnd}:(q=(q.ownerDocument&&q.ownerDocument.defaultView||window).getSelection(),q={anchorNode:q.anchorNode,anchorOffset:q.anchorOffset,focusNode:q.focusNode,focusOffset:q.focusOffset}),Uc&&cf(Uc,q)||(Uc=q,q=im(hd,"onSelect"),0<q.length&&(E=new pp("onSelect","select",null,E,j),y.push({event:E,listeners:q}),E.target=bp)))}function Rg(y,E){var j={};return j[y.toLowerCase()]=E.toLowerCase(),j["Webkit"+y]="webkit"+E,j["Moz"+y]="moz"+E,j}var em={animationend:Rg("Animation","AnimationEnd"),animationiteration:Rg("Animation","AnimationIteration"),animationstart:Rg("Animation","AnimationStart"),transitionend:Rg("Transition","TransitionEnd")},zi={},hh={};o&&(hh=document.createElement("div").style,"AnimationEvent"in window||(delete em.animationend.animation,delete em.animationiteration.animation,delete em.animationstart.animation),"TransitionEvent"in window||delete em.transitionend.transition);function df(y){if(zi[y])return zi[y];if(!em[y])return y;var E=em[y],j;for(j in E)if(E.hasOwnProperty(j)&&j in hh)return zi[y]=E[j];return y}var wp=df("animationend"),js=df("animationiteration"),tm=df("animationstart"),Pg=df("transitionend"),nm=new Map,hx="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 fh(y,E){nm.set(y,E),s(E,[y])}for(var rm=0;rm<hx.length;rm++){var Lg=hx[rm],z_=Lg.toLowerCase(),G_=Lg[0].toUpperCase()+Lg.slice(1);fh(z_,"on"+G_)}fh(wp,"onAnimationEnd"),fh(js,"onAnimationIteration"),fh(tm,"onAnimationStart"),fh("dblclick","onDoubleClick"),fh("focusin","onFocus"),fh("focusout","onBlur"),fh(Pg,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bc="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(" "),q_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bc));function fx(y,E,j){var q=y.type||"unknown-event";y.currentTarget=j,Qt(q,E,void 0,y),y.currentTarget=null}function Vy(y,E){E=(E&4)!==0;for(var j=0;j<y.length;j++){var q=y[j],Q=q.event;q=q.listeners;e:{var se=void 0;if(E)for(var Re=q.length-1;0<=Re;Re--){var rt=q[Re],gt=rt.instance,Vt=rt.currentTarget;if(rt=rt.listener,gt!==se&&Q.isPropagationStopped())break e;fx(Q,rt,Vt),se=gt}else for(Re=0;Re<q.length;Re++){if(rt=q[Re],gt=rt.instance,Vt=rt.currentTarget,rt=rt.listener,gt!==se&&Q.isPropagationStopped())break e;fx(Q,rt,Vt),se=gt}}}if(be)throw y=en,be=!1,en=null,y}function _s(y,E){var j=E[as];j===void 0&&(j=E[as]=new Set);var q=y+"__bubble";j.has(q)||(wl(E,y,2,!1),j.add(q))}function Og(y,E,j){var q=0;E&&(q|=4),wl(j,y,q,E)}var Dg="_reactListening"+Math.random().toString(36).slice(2);function fd(y){if(!y[Dg]){y[Dg]=!0,r.forEach(function(j){j!=="selectionchange"&&(q_.has(j)||Og(j,!1,y),Og(j,!0,y))});var E=y.nodeType===9?y:y.ownerDocument;E===null||E[Dg]||(E[Dg]=!0,Og("selectionchange",!1,E))}}function wl(y,E,j,q){switch(jy(E)){case 1:var Q=U_;break;case 4:Q=Lo;break;default:Q=hp}j=Q.bind(null,E,j,y),Q=void 0,!xe||E!=="touchstart"&&E!=="touchmove"&&E!=="wheel"||(Q=!0),q?Q!==void 0?y.addEventListener(E,j,{capture:!0,passive:Q}):y.addEventListener(E,j,!0):Q!==void 0?y.addEventListener(E,j,{passive:Q}):y.addEventListener(E,j,!1)}function pd(y,E,j,q,Q){var se=q;if((E&1)===0&&(E&2)===0&&q!==null)e:for(;;){if(q===null)return;var Re=q.tag;if(Re===3||Re===4){var rt=q.stateNode.containerInfo;if(rt===Q||rt.nodeType===8&&rt.parentNode===Q)break;if(Re===4)for(Re=q.return;Re!==null;){var gt=Re.tag;if((gt===3||gt===4)&&(gt=Re.stateNode.containerInfo,gt===Q||gt.nodeType===8&>.parentNode===Q))return;Re=Re.return}for(;rt!==null;){if(Re=Ad(rt),Re===null)return;if(gt=Re.tag,gt===5||gt===6){q=se=Re;continue e}rt=rt.parentNode}}q=q.return}qt(function(){var Vt=se,Sn=Je(j),Mn=[];e:{var yn=nm.get(y);if(yn!==void 0){var Kn=pp,hr=y;switch(y){case"keypress":if(ax(j)===0)break e;case"keydown":case"keyup":Kn=Oc;break;case"focusin":hr="focus",Kn=uh;break;case"focusout":hr="blur",Kn=uh;break;case"beforeblur":case"afterblur":Kn=uh;break;case"click":if(j.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Kn=X0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Kn=Lc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Kn=sf;break;case wp:case js:case tm:Kn=Q0;break;case Pg:Kn=xa;break;case"scroll":Kn=H0;break;case"wheel":Kn=Ao;break;case"copy":case"cut":case"paste":Kn=B_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Kn=bu}var fr=(E&4)!==0,so=!fr&&y==="scroll",Rt=fr?yn!==null?yn+"Capture":null:yn;fr=[];for(var wt=Vt,Dt;wt!==null;){Dt=wt;var Ln=Dt.stateNode;if(Dt.tag===5&&Ln!==null&&(Dt=Ln,Rt!==null&&(Ln=Fn(wt,Rt),Ln!=null&&fr.push(ph(wt,Ln,Dt)))),so)break;wt=wt.return}0<fr.length&&(yn=new Kn(yn,hr,null,j,Sn),Mn.push({event:yn,listeners:fr}))}}if((E&7)===0){e:{if(yn=y==="mouseover"||y==="pointerover",Kn=y==="mouseout"||y==="pointerout",yn&&j!==Nt&&(hr=j.relatedTarget||j.fromElement)&&(Ad(hr)||hr[_u]))break e;if((Kn||yn)&&(yn=Sn.window===Sn?Sn:(yn=Sn.ownerDocument)?yn.defaultView||yn.parentWindow:window,Kn?(hr=j.relatedTarget||j.toElement,Kn=Vt,hr=hr?Ad(hr):null,hr!==null&&(so=Pt(hr),hr!==so||hr.tag!==5&&hr.tag!==6)&&(hr=null)):(Kn=null,hr=Vt),Kn!==hr)){if(fr=X0,Ln="onMouseLeave",Rt="onMouseEnter",wt="mouse",(y==="pointerout"||y==="pointerover")&&(fr=bu,Ln="onPointerLeave",Rt="onPointerEnter",wt="pointer"),so=Kn==null?yn:me(Kn),Dt=hr==null?yn:me(hr),yn=new fr(Ln,wt+"leave",Kn,j,Sn),yn.target=so,yn.relatedTarget=Dt,Ln=null,Ad(Sn)===Vt&&(fr=new fr(Rt,wt+"enter",hr,j,Sn),fr.target=Dt,fr.relatedTarget=so,Ln=fr),so=Ln,Kn&&hr)t:{for(fr=Kn,Rt=hr,wt=0,Dt=fr;Dt;Dt=hf(Dt))wt++;for(Dt=0,Ln=Rt;Ln;Ln=hf(Ln))Dt++;for(;0<wt-Dt;)fr=hf(fr),wt--;for(;0<Dt-wt;)Rt=hf(Rt),Dt--;for(;wt--;){if(fr===Rt||Rt!==null&&fr===Rt.alternate)break t;fr=hf(fr),Rt=hf(Rt)}fr=null}else fr=null;Kn!==null&&_p(Mn,yn,Kn,fr,!1),hr!==null&&so!==null&&_p(Mn,so,hr,fr,!0)}}e:{if(yn=Vt?me(Vt):window,Kn=yn.nodeName&&yn.nodeName.toLowerCase(),Kn==="select"||Kn==="input"&&yn.type==="file")var br=bl;else if(Ap(yn))if(vp)br=Yl;else{br=ux;var Or=cx}else(Kn=yn.nodeName)&&Kn.toLowerCase()==="input"&&(yn.type==="checkbox"||yn.type==="radio")&&(br=QT);if(br&&(br=br(y,Vt))){xp(Mn,br,j,Sn);break e}Or&&Or(y,yn,Vt),y==="focusout"&&(Or=yn._wrapperState)&&Or.controlled&&yn.type==="number"&&Ye(yn,"number",yn.value)}switch(Or=Vt?me(Vt):window,y){case"focusin":(Ap(Or)||Or.contentEditable==="true")&&(bp=Or,hd=Vt,Uc=null);break;case"focusout":Uc=hd=bp=null;break;case"mousedown":kg=!0;break;case"contextmenu":case"mouseup":case"dragend":kg=!1,J0(Mn,j,Sn);break;case"selectionchange":if(JT)break;case"keydown":case"keyup":J0(Mn,j,Sn)}var Dr;if(ud)e:{switch(y){case"compositionstart":var Xr="onCompositionStart";break e;case"compositionend":Xr="onCompositionEnd";break e;case"compositionupdate":Xr="onCompositionUpdate";break e}Xr=void 0}else ta?ea(y,j)&&(Xr="onCompositionEnd"):y==="keydown"&&j.keyCode===229&&(Xr="onCompositionStart");Xr&&(jc&&j.locale!=="ko"&&(ta||Xr!=="onCompositionStart"?Xr==="onCompositionEnd"&&ta&&(Dr=q0()):(ad=Sn,z0="value"in ad?ad.value:ad.textContent,ta=!0)),Or=im(Vt,Xr),0<Or.length&&(Xr=new K0(Xr,y,null,j,Sn),Mn.push({event:Xr,listeners:Or}),Dr?Xr.data=Dr:(Dr=Xl(j),Dr!==null&&(Xr.data=Dr)))),(Dr=Ni?of(y,j):YT(y,j))&&(Vt=im(Vt,"onBeforeInput"),0<Vt.length&&(Sn=new K0("onBeforeInput","beforeinput",null,j,Sn),Mn.push({event:Sn,listeners:Vt}),Sn.data=Dr))}Vy(Mn,E)})}function ph(y,E,j){return{instance:y,listener:E,currentTarget:j}}function im(y,E){for(var j=E+"Capture",q=[];y!==null;){var Q=y,se=Q.stateNode;Q.tag===5&&se!==null&&(Q=se,se=Fn(y,j),se!=null&&q.unshift(ph(y,se,Q)),se=Fn(y,E),se!=null&&q.push(ph(y,se,Q))),y=y.return}return q}function hf(y){if(y===null)return null;do y=y.return;while(y&&y.tag!==5);return y||null}function _p(y,E,j,q,Q){for(var se=E._reactName,Re=[];j!==null&&j!==q;){var rt=j,gt=rt.alternate,Vt=rt.stateNode;if(gt!==null&>===q)break;rt.tag===5&&Vt!==null&&(rt=Vt,Q?(gt=Fn(j,se),gt!=null&&Re.unshift(ph(j,gt,rt))):Q||(gt=Fn(j,se),gt!=null&&Re.push(ph(j,gt,rt)))),j=j.return}Re.length!==0&&y.push({event:E,listeners:Re})}var px=/\r\n?/g,jg=/\u0000|\uFFFD/g;function sm(y){return(typeof y=="string"?y:""+y).replace(px,` 38`).replace(jg,"")}function ff(y,E,j){if(E=sm(E),sm(y)!==E&&j)throw Error(t(425))}function am(){}var md=null,Ig=null;function Ql(y,E){return y==="textarea"||y==="noscript"||typeof E.children=="string"||typeof E.children=="number"||typeof E.dangerouslySetInnerHTML=="object"&&E.dangerouslySetInnerHTML!==null&&E.dangerouslySetInnerHTML.__html!=null}var hs=typeof setTimeout=="function"?setTimeout:void 0,Nn=typeof clearTimeout=="function"?clearTimeout:void 0,xo=typeof Promise=="function"?Promise:void 0,$_=typeof queueMicrotask=="function"?queueMicrotask:typeof xo<"u"?function(y){return xo.resolve(null).then(y).catch(H_)}:hs;function H_(y){setTimeout(function(){throw y})}function pf(y,E){var j=E,q=0;do{var Q=j.nextSibling;if(y.removeChild(j),Q&&Q.nodeType===8)if(j=Q.data,j==="/$"){if(q===0){y.removeChild(Q),sd(E);return}q--}else j!=="$"&&j!=="$?"&&j!=="$!"||q++;j=Q}while(j);sd(E)}function An(y){for(;y!=null;y=y.nextSibling){var E=y.nodeType;if(E===1||E===3)break;if(E===8){if(E=y.data,E==="$"||E==="$!"||E==="$?")break;if(E==="/$")return null}}return y}function va(y){y=y.previousSibling;for(var E=0;y;){if(y.nodeType===8){var j=y.data;if(j==="$"||j==="$!"||j==="$?"){if(E===0)return y;E--}else j==="/$"&&E++}y=y.previousSibling}return null}var mh=Math.random().toString(36).slice(2),Jo="__reactFiber$"+mh,Kl="__reactProps$"+mh,_u="__reactContainer$"+mh,as="__reactEvents$"+mh,gd="__reactListeners$"+mh,Su="__reactHandles$"+mh;function Ad(y){var E=y[Jo];if(E)return E;for(var j=y.parentNode;j;){if(E=j[_u]||j[Jo]){if(j=E.alternate,E.child!==null||j!==null&&j.child!==null)for(y=va(y);y!==null;){if(j=y[Jo])return j;y=va(y)}return E}y=j,j=y.parentNode}return null}function de(y){return y=y[Jo]||y[_u],!y||y.tag!==5&&y.tag!==6&&y.tag!==13&&y.tag!==3?null:y}function me(y){if(y.tag===5||y.tag===6)return y.stateNode;throw Error(t(33))}function Be(y){return y[Kl]||null}var xt=[],Ct=-1;function zt(y){return{current:y}}function Wt(y){0>Ct||(y.current=xt[Ct],xt[Ct]=null,Ct--)}function hn(y,E){Ct++,xt[Ct]=y.current,y.current=E}var qn={},Yn=zt(qn),xn=zt(!1),Wr=qn;function jt(y,E){var j=y.type.contextTypes;if(!j)return qn;var q=y.stateNode;if(q&&q.__reactInternalMemoizedUnmaskedChildContext===E)return q.__reactInternalMemoizedMaskedChildContext;var Q={},se;for(se in j)Q[se]=E[se];return q&&(y=y.stateNode,y.__reactInternalMemoizedUnmaskedChildContext=E,y.__reactInternalMemoizedMaskedChildContext=Q),Q}function En(y){return y=y.childContextTypes,y!=null}function v(){Wt(xn),Wt(Yn)}function w(y,E,j){if(Yn.current!==qn)throw Error(t(168));hn(Yn,E),hn(xn,j)}function S(y,E,j){var q=y.stateNode;if(E=E.childContextTypes,typeof q.getChildContext!="function")return j;q=q.getChildContext();for(var Q in q)if(!(Q in E))throw Error(t(108,ve(y)||"Unknown",Q));return Z({},j,q)}function N(y){return y=(y=y.stateNode)&&y.__reactInternalMemoizedMergedChildContext||qn,Wr=Yn.current,hn(Yn,y),hn(xn,xn.current),!0}function C(y,E,j){var q=y.stateNode;if(!q)throw Error(t(169));j?(y=S(y,E,Wr),q.__reactInternalMemoizedMergedChildContext=y,Wt(xn),Wt(Yn),hn(Yn,y)):Wt(xn),hn(xn,j)}var k=null,R=!1,I=!1;function V(y){k===null?k=[y]:k.push(y)}function $(y){R=!0,V(y)}function K(){if(!I&&k!==null){I=!0;var y=0,E=ai;try{var j=k;for(ai=1;y<j.length;y++){var q=j[y];do q=q(!0);while(q!==null)}k=null,R=!1}
vendor: 4,402 bytes, line 38
38catch(Q){throw k!==null&&(k=k.slice(y+1)),xr(Vi,K),Q}finally{ai=E,I=!1}}return null}var ie=[],he=0,fe=null,ye=0,je=[],We=0,De=null,Me=1,ot="";function Ke(y,E){ie[he++]=ye,ie[he++]=fe,fe=y,ye=E}function Ot(y,E,j){je[We++]=Me,je[We++]=ot,je[We++]=De,De=y;var q=Me;y=ot;var Q=32-ln(q)-1;q&=~(1<<Q),j+=1;var se=32-ln(E)+Q;if(30<se){var Re=Q-Q%5;se=(q&(1<<Re)-1).toString(32),q>>=Re,Q-=Re,Me=1<<32-ln(E)+Q|j<<Q|q,ot=se+y}else Me=1<<se|j<<Q|q,ot=y}function $t(y){y.return!==null&&(Ke(y,1),Ot(y,1,0))}function Tt(y){for(;y===fe;)fe=ie[--he],ie[he]=null,ye=ie[--he],ie[he]=null;for(;y===De;)De=je[--We],je[We]=null,ot=je[--We],je[We]=null,Me=je[--We],je[We]=null}var ht=null,Xt=null,Et=!1,Zt=null;function nn(y,E){var j=vh(5,null,null,0);j.elementType="DELETED",j.stateNode=E,j.return=y,E=y.deletions,E===null?(y.deletions=[j],y.flags|=16):E.push(j)}function rn(y,E){switch(y.tag){case 5:var j=y.type;return E=E.nodeType!==1||j.toLowerCase()!==E.nodeName.toLowerCase()?null:E,E!==null?(y.stateNode=E,ht=y,Xt=An(E.firstChild),!0):!1;case 6:return E=y.pendingProps===""||E.nodeType!==3?null:E,E!==null?(y.stateNode=E,ht=y,Xt=null,!0):!1;case 13:return E=E.nodeType!==8?null:E,E!==null?(j=De!==null?{id:Me,overflow:ot}:null,y.memoizedState={dehydrated:E,treeContext:j,retryLane:1073741824},j=vh(18,null,null,0),j.stateNode=E,j.return=y,y.child=j,ht=y,Xt=null,!0):!1;default:return!1}}function oi(y){return(y.mode&1)!==0&&(y.flags&128)===0}function li(y){if(Et){var E=Xt;if(E){var j=E;if(!rn(y,E)){if(oi(y))throw Error(t(418));E=An(j.nextSibling);var q=ht;E&&rn(y,E)?nn(q,j):(y.flags=y.flags&-4097|2,Et=!1,ht=y)}}else{if(oi(y))throw Error(t(418));y.flags=y.flags&-4097|2,Et=!1,ht=y}}}function Ga(y){for(y=y.return;y!==null&&y.tag!==5&&y.tag!==3&&y.tag!==13;)y=y.return;ht=y}function Lr(y){if(y!==ht)return!1;if(!Et)return Ga(y),Et=!0,!1;var E;if((E=y.tag!==3)&&!(E=y.tag!==5)&&(E=y.type,E=E!=="head"&&E!=="body"&&!Ql(y.type,y.memoizedProps)),E&&(E=Xt)){if(oi(y))throw Br(),Error(t(418));for(;E;)nn(y,E),E=An(E.nextSibling)}if(Ga(y),y.tag===13){if(y=y.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(t(317));e:{for(y=y.nextSibling,E=0;y;){if(y.nodeType===8){var j=y.data;if(j==="/$"){if(E===0){Xt=An(y.nextSibling);break e}E--}else j!=="$"&&j!=="$!"&&j!=="$?"||E++}y=y.nextSibling}Xt=null}}else Xt=ht?An(y.stateNode.nextSibling):null;return!0}function Br(){for(var y=Xt;y;)y=An(y.nextSibling)}function Vr(){Xt=ht=null,Et=!1}function ji(y){Zt===null?Zt=[y]:Zt.push(y)}var Is=T.ReactCurrentBatchConfig;function Ss(y,E,j){if(y=j.ref,y!==null&&typeof y!="function"&&typeof y!="object"){if(j._owner){if(j=j._owner,j){if(j.tag!==1)throw Error(t(309));var q=j.stateNode}if(!q)throw Error(t(147,y));var Q=q,se=""+y;return E!==null&&E.ref!==null&&typeof E.ref=="function"&&E.ref._stringRef===se?E.ref:(E=function(Re){var rt=Q.refs;Re===null?delete rt[se]:rt[se]=Re},E._stringRef=se,E)}if(typeof y!="string")throw Error(t(284));if(!j._owner)throw Error(t(290,y))}return y}function na(y,E){throw y=Object.prototype.toString.call(E),Error(t(31,y==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":y))}function _l(y){var E=y._init;return E(y._payload)}function io(y){function E(Rt,wt){if(y){var Dt=Rt.deletions;Dt===null?(Rt.deletions=[wt],Rt.flags|=16):Dt.push(wt)}}function j(Rt,wt){if(!y)return null;for(;wt!==null;)E(Rt,wt),wt=wt.sibling;return null}function q(Rt,wt){for(Rt=new Map;wt!==null;)wt.key!==null?Rt.set(wt.key,wt):Rt.set(wt.index,wt),wt=wt.sibling;return Rt}function Q(Rt,wt){return Rt=$g(Rt,wt),Rt.index=0,Rt.sibling=null,Rt}function se(Rt,wt,Dt){return Rt.index=Dt,y?(Dt=Rt.alternate,Dt!==null?(Dt=Dt.index,Dt<wt?(Rt.flags|=2,wt):Dt):(Rt.flags|=2,wt)):(Rt.flags|=1048576,wt)}function Re(Rt){return y&&Rt.alternate===null&&(Rt.flags|=2),Rt}function rt(Rt,wt,Dt,Ln){return wt===null||wt.tag!==6?(wt=m7(Dt,Rt.mode,Ln),wt.return=Rt,wt):(wt=Q(wt,Dt),wt.return=Rt,wt)}function gt(Rt,wt,Dt,Ln){var br=Dt.type;return br===P?Sn(Rt,wt,Dt.props.children,Ln,Dt.key):wt!==null&&(wt.elementType===br||typeof br=="object"&&br!==null&&br.$$typeof===J&&_l(br)===wt.type)?(Ln=Q(wt,Dt.props),Ln.ref=Ss(Rt,wt,Dt),Ln.return=Rt,Ln):(Ln=bE(Dt.type,Dt.key,Dt.props,null,Rt.mode,Ln),Ln.ref=Ss(Rt,wt,Dt),Ln.return=Rt,Ln)}function Vt(Rt,wt,Dt,Ln){return wt===null||wt.tag!==4||wt.stateNode.containerInfo!==Dt.containerInfo||wt.stateNode.implementation!==Dt.implementation?(wt=g7(Dt,Rt.mode,Ln),wt.return=Rt,
vendor: 11,717 bytes, line 38
38wt):(wt=Q(wt,Dt.children||[]),wt.return=Rt,wt)}function Sn(Rt,wt,Dt,Ln,br){return wt===null||wt.tag!==7?(wt=wx(Dt,Rt.mode,Ln,br),wt.return=Rt,wt):(wt=Q(wt,Dt),wt.return=Rt,wt)}function Mn(Rt,wt,Dt){if(typeof wt=="string"&&wt!==""||typeof wt=="number")return wt=m7(""+wt,Rt.mode,Dt),wt.return=Rt,wt;if(typeof wt=="object"&&wt!==null){switch(wt.$$typeof){case L:return Dt=bE(wt.type,wt.key,wt.props,null,Rt.mode,Dt),Dt.ref=Ss(Rt,null,wt),Dt.return=Rt,Dt;case D:return wt=g7(wt,Rt.mode,Dt),wt.return=Rt,wt;case J:var Ln=wt._init;return Mn(Rt,Ln(wt._payload),Dt)}if(ft(wt)||le(wt))return wt=wx(wt,Rt.mode,Dt,null),wt.return=Rt,wt;na(Rt,wt)}return null}function yn(Rt,wt,Dt,Ln){var br=wt!==null?wt.key:null;if(typeof Dt=="string"&&Dt!==""||typeof Dt=="number")return br!==null?null:rt(Rt,wt,""+Dt,Ln);if(typeof Dt=="object"&&Dt!==null){switch(Dt.$$typeof){case L:return Dt.key===br?gt(Rt,wt,Dt,Ln):null;case D:return Dt.key===br?Vt(Rt,wt,Dt,Ln):null;case J:return br=Dt._init,yn(Rt,wt,br(Dt._payload),Ln)}if(ft(Dt)||le(Dt))return br!==null?null:Sn(Rt,wt,Dt,Ln,null);na(Rt,Dt)}return null}function Kn(Rt,wt,Dt,Ln,br){if(typeof Ln=="string"&&Ln!==""||typeof Ln=="number")return Rt=Rt.get(Dt)||null,rt(wt,Rt,""+Ln,br);if(typeof Ln=="object"&&Ln!==null){switch(Ln.$$typeof){case L:return Rt=Rt.get(Ln.key===null?Dt:Ln.key)||null,gt(wt,Rt,Ln,br);case D:return Rt=Rt.get(Ln.key===null?Dt:Ln.key)||null,Vt(wt,Rt,Ln,br);case J:var Or=Ln._init;return Kn(Rt,wt,Dt,Or(Ln._payload),br)}if(ft(Ln)||le(Ln))return Rt=Rt.get(Dt)||null,Sn(wt,Rt,Ln,br,null);na(wt,Ln)}return null}function hr(Rt,wt,Dt,Ln){for(var br=null,Or=null,Dr=wt,Xr=wt=0,nl=null;Dr!==null&&Xr<Dt.length;Xr++){Dr.index>Xr?(nl=Dr,Dr=null):nl=Dr.sibling;var os=yn(Rt,Dr,Dt[Xr],Ln);if(os===null){Dr===null&&(Dr=nl);break}y&&Dr&&os.alternate===null&&E(Rt,Dr),wt=se(os,wt,Xr),Or===null?br=os:Or.sibling=os,Or=os,Dr=nl}if(Xr===Dt.length)return j(Rt,Dr),Et&&Ke(Rt,Xr),br;if(Dr===null){for(;Xr<Dt.length;Xr++)Dr=Mn(Rt,Dt[Xr],Ln),Dr!==null&&(wt=se(Dr,wt,Xr),Or===null?br=Dr:Or.sibling=Dr,Or=Dr);return Et&&Ke(Rt,Xr),br}for(Dr=q(Rt,Dr);Xr<Dt.length;Xr++)nl=Kn(Dr,Rt,Xr,Dt[Xr],Ln),nl!==null&&(y&&nl.alternate!==null&&Dr.delete(nl.key===null?Xr:nl.key),wt=se(nl,wt,Xr),Or===null?br=nl:Or.sibling=nl,Or=nl);return y&&Dr.forEach(function(Hg){return E(Rt,Hg)}),Et&&Ke(Rt,Xr),br}function fr(Rt,wt,Dt,Ln){var br=le(Dt);if(typeof br!="function")throw Error(t(150));if(Dt=br.call(Dt),Dt==null)throw Error(t(151));for(var Or=br=null,Dr=wt,Xr=wt=0,nl=null,os=Dt.next();Dr!==null&&!os.done;Xr++,os=Dt.next()){Dr.index>Xr?(nl=Dr,Dr=null):nl=Dr.sibling;var Hg=yn(Rt,Dr,os.value,Ln);if(Hg===null){Dr===null&&(Dr=nl);break}y&&Dr&&Hg.alternate===null&&E(Rt,Dr),wt=se(Hg,wt,Xr),Or===null?br=Hg:Or.sibling=Hg,Or=Hg,Dr=nl}if(os.done)return j(Rt,Dr),Et&&Ke(Rt,Xr),br;if(Dr===null){for(;!os.done;Xr++,os=Dt.next())os=Mn(Rt,os.value,Ln),os!==null&&(wt=se(os,wt,Xr),Or===null?br=os:Or.sibling=os,Or=os);return Et&&Ke(Rt,Xr),br}for(Dr=q(Rt,Dr);!os.done;Xr++,os=Dt.next())os=Kn(Dr,Rt,Xr,os.value,Ln),os!==null&&(y&&os.alternate!==null&&Dr.delete(os.key===null?Xr:os.key),wt=se(os,wt,Xr),Or===null?br=os:Or.sibling=os,Or=os);return y&&Dr.forEach(function(rve){return E(Rt,rve)}),Et&&Ke(Rt,Xr),br}function so(Rt,wt,Dt,Ln){if(typeof Dt=="object"&&Dt!==null&&Dt.type===P&&Dt.key===null&&(Dt=Dt.props.children),typeof Dt=="object"&&Dt!==null){switch(Dt.$$typeof){case L:e:{for(var br=Dt.key,Or=wt;Or!==null;){if(Or.key===br){if(br=Dt.type,br===P){if(Or.tag===7){j(Rt,Or.sibling),wt=Q(Or,Dt.props.children),wt.return=Rt,Rt=wt;break e}}else if(Or.elementType===br||typeof br=="object"&&br!==null&&br.$$typeof===J&&_l(br)===Or.type){j(Rt,Or.sibling),wt=Q(Or,Dt.props),wt.ref=Ss(Rt,Or,Dt),wt.return=Rt,Rt=wt;break e}j(Rt,Or);break}else E(Rt,Or);Or=Or.sibling}Dt.type===P?(wt=wx(Dt.props.children,Rt.mode,Ln,Dt.key),wt.return=Rt,Rt=wt):(Ln=bE(Dt.type,Dt.key,Dt.props,null,Rt.mode,Ln),Ln.ref=Ss(Rt,wt,Dt),Ln.return=Rt,Rt=Ln)}return Re(Rt);case D:e:{for(Or=Dt.key;wt!==null;){if(wt.key===Or)if(wt.tag===4&&wt.stateNode.containerInfo===Dt.containerInfo&&wt.stateNode.implementation===Dt.implementation){j(Rt,wt.sibling),wt=Q(wt,Dt.children||[]),wt.return=Rt,Rt=wt;break e}else{j(Rt,wt);break}else E(Rt,wt);wt=wt.sibling}wt=g7(Dt,Rt.mode,Ln),wt.return=Rt,Rt=wt}return Re(Rt);case J:return Or=Dt._init,so(Rt,wt,Or(Dt._payload),Ln)}if(ft(Dt))return hr(Rt,wt,Dt,Ln);if(le(Dt))return fr(Rt,wt,Dt,Ln);na(Rt,Dt)}return typeof Dt=="string"&&Dt!==""||typeof Dt=="number"?(Dt=""+Dt,wt!==null&&wt.tag===6?(j(Rt,wt.sibling),wt=Q(wt,Dt),wt.return=Rt,Rt=wt):(j(Rt,wt),wt=m7(Dt,Rt.mode,Ln),wt.return=Rt,Rt=wt),Re(Rt)):j(Rt,wt)}return so}var la=io(!0),Vc=io(!1),qa=zt(null),Ii=null,Tu=null,TP=null;function EP(){TP=Tu=Ii=null}function CP(y){var E=qa.current;Wt(qa),y._currentValue=E}function NP(y,E,j){for(;y!==null;){var q=y.alternate;if((y.childLanes&E)!==E?(y.childLanes|=E,q!==null&&(q.childLanes|=E)):q!==null&&(q.childLanes&E)!==E&&(q.childLanes|=E),y===j)break;y=y.return}}function zy(y,E){Ii=y,TP=Tu=null,y=y.dependencies,y!==null&&y.firstContext!==null&&((y.lanes&E)!==0&&(Eu=!0),y.firstContext=null)}function gh(y){var E=y._currentValue;if(TP!==y)if(y={context:y,memoizedValue:E,next:null},Tu===null){if(Ii===null)throw Error(t(308));Tu=y,Ii.dependencies={lanes:0,firstContext:y}}else Tu=Tu.next=y;return E}var mx=null;function MP(y){mx===null?mx=[y]:mx.push(y)}function b$(y,E,j,q){var Q=E.interleaved;return Q===null?(j.next=j,MP(E)):(j.next=Q.next,Q.next=j),E.interleaved=j,om(y,q)}function om(y,E){y.lanes|=E;var j=y.alternate;for(j!==null&&(j.lanes|=E),j=y,y=y.return;y!==null;)y.childLanes|=E,j=y.alternate,j!==null&&(j.childLanes|=E),j=y,y=y.return;return j.tag===3?j.stateNode:null}var Fg=!1;function kP(y){y.updateQueue={baseState:y.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function w$(y,E){y=y.updateQueue,E.updateQueue===y&&(E.updateQueue={baseState:y.baseState,firstBaseUpdate:y.firstBaseUpdate,lastBaseUpdate:y.lastBaseUpdate,shared:y.shared,effects:y.effects})}function lm(y,E){return{eventTime:y,lane:E,tag:0,payload:null,callback:null,next:null}}function Ug(y,E,j){var q=y.updateQueue;if(q===null)return null;if(q=q.shared,(Ki&2)!==0){var Q=q.pending;return Q===null?E.next=E:(E.next=Q.next,Q.next=E),q.pending=E,om(y,j)}return Q=q.interleaved,Q===null?(E.next=E,MP(q)):(E.next=Q.next,Q.next=E),q.interleaved=E,om(y,j)}function eE(y,E,j){if(E=E.updateQueue,E!==null&&(E=E.shared,(j&4194240)!==0)){var q=E.lanes;q&=y.pendingLanes,j|=q,E.lanes=j,Yo(y,j)}}function _$(y,E){var j=y.updateQueue,q=y.alternate;if(q!==null&&(q=q.updateQueue,j===q)){var Q=null,se=null;if(j=j.firstBaseUpdate,j!==null){do{var Re={eventTime:j.eventTime,lane:j.lane,tag:j.tag,payload:j.payload,callback:j.callback,next:null};se===null?Q=se=Re:se=se.next=Re,j=j.next}while(j!==null);se===null?Q=se=E:se=se.next=E}else Q=se=E;j={baseState:q.baseState,firstBaseUpdate:Q,lastBaseUpdate:se,shared:q.shared,effects:q.effects},y.updateQueue=j;return}y=j.lastBaseUpdate,y===null?j.firstBaseUpdate=E:y.next=E,j.lastBaseUpdate=E}function tE(y,E,j,q){var Q=y.updateQueue;Fg=!1;var se=Q.firstBaseUpdate,Re=Q.lastBaseUpdate,rt=Q.shared.pending;if(rt!==null){Q.shared.pending=null;var gt=rt,Vt=gt.next;gt.next=null,Re===null?se=Vt:Re.next=Vt,Re=gt;var Sn=y.alternate;Sn!==null&&(Sn=Sn.updateQueue,rt=Sn.lastBaseUpdate,rt!==Re&&(rt===null?Sn.firstBaseUpdate=Vt:rt.next=Vt,Sn.lastBaseUpdate=gt))}if(se!==null){var Mn=Q.baseState;Re=0,Sn=Vt=gt=null,rt=se;do{var yn=rt.lane,Kn=rt.eventTime;if((q&yn)===yn){Sn!==null&&(Sn=Sn.next={eventTime:Kn,lane:0,tag:rt.tag,payload:rt.payload,callback:rt.callback,next:null});e:{var hr=y,fr=rt;switch(yn=E,Kn=j,fr.tag){case 1:if(hr=fr.payload,typeof hr=="function"){Mn=hr.call(Kn,Mn,yn);break e}Mn=hr;break e;case 3:hr.flags=hr.flags&-65537|128;case 0:if(hr=fr.payload,yn=typeof hr=="function"?hr.call(Kn,Mn,yn):hr,yn==null)break e;Mn=Z({},Mn,yn);break e;case 2:Fg=!0}}rt.callback!==null&&rt.lane!==0&&(y.flags|=64,yn=Q.effects,yn===null?Q.effects=[rt]:yn.push(rt))}else Kn={eventTime:Kn,lane:yn,tag:rt.tag,payload:rt.payload,callback:rt.callback,next:null},Sn===null?(Vt=Sn=Kn,gt=Mn):Sn=Sn.next=Kn,Re|=yn;if(rt=rt.next,rt===null){if(rt=Q.shared.pending,rt===null)break;yn=rt,rt=yn.next,yn.next=null,Q.lastBaseUpdate=yn,Q.shared.pending=null}}while(!0);if(Sn===null&&(gt=Mn),Q.baseState=gt,Q.firstBaseUpdate=Vt,Q.lastBaseUpdate=Sn,E=Q.shared.interleaved,E!==null){Q=E;do Re|=Q.lane,Q=Q.next;while(Q!==E)}else se===null&&(Q.shared.lanes=0);xx|=Re,y.lanes=Re,y.memoizedState=Mn}}function S$(y,E,j){if(y=E.effects,E.effects=null,y!==null)for(E=0;E<y.length;E++){var q=y[E],Q=q.callback;if(Q!==null){if(q.callback=null,q=j,typeof Q!="function")throw Error(t(191,Q));Q.call(q)}}}var W_={},Sp=zt(W_),X_=zt(W_),Y_=zt(W_);function gx(y){if(y===W_)throw Error(t(174));return y}function RP(y,E){switch(hn(Y_,E),hn(X_,y),hn(Sp,W_),y=E.nodeType,y){case 9:case 11:E=(E=E.documentElement)?E.namespaceURI:oe(null,"");break;default:y=y===8?E.parentNode:E,E=y.namespaceURI||null,y=y.tagName,E=oe(E,y)}Wt(Sp),hn(Sp,E)}function Gy(){Wt(Sp),Wt(X_),Wt(Y_)}function T$(y){gx(Y_.current);var E=gx(Sp.current),j=oe(E,y.type);E!==j&&(hn(X_,y),hn(Sp,j))}function PP(y){X_.current===y&&(Wt(Sp),Wt(X_))}var ka=zt(0);function nE(y){for(var E=y;E!==null;){if(E.tag===13){var j=E.memoizedState;if(j!==null&&(j=j.dehydrated,j===null||j.data==="$?"||j.data==="$!"))return E}else if(E.tag===19&&E.memoizedProps.revealOrder!==void 0){if((E.flags&128)!==0)return E}else if(E.child!==null){E.child.return=E,E=E.child;continue}if(E===y)break;for(;E.sibling===null;){if(E.return===null||E.return===y)return null;E=E.return}E.sibling.return=E.return,E=E.sibling}return null}var LP=[];function OP(){for(var y=0;y<LP.length;y++)LP[y]._workInProgressVersionPrimary=null;LP.length=0}var rE=T.ReactCurrentDispatcher,DP=T.ReactCurrentBatchConfig,Ax=0,Ra=null,jo=null,el=null,iE=!1,Q_=!1,K_=0,Txe=0;function Zl(){throw Error(t(321))}function jP(y,E){if(E===null)return!1;for(var j=0;j<E.length&&j<y.length;j++)if(!Fc(y[j],E[j]))return!1;return!0}function IP(y,E,j,q,Q,se){if(Ax=se,Ra=E,E.memoizedState=null,E.updateQueue=null,E.lanes=0,rE.current=y===null||y.memoizedState===null?Mxe:kxe,y=j(q,Q),Q_){se=0;do{if(Q_=!1,K_=0,25<=se)throw Error(t(301));se+=1,el=jo=null,E.updateQueue=null,rE.current=Rxe,y=j(q,Q)}while(Q_)}if(rE.current=oE,E=jo!==null&&jo.next!==null,Ax=0,el=jo=Ra=null,iE=!1,E)throw Error(t(300));return y}function FP(){var y=K_!==0;return K_=0,y}function Tp(){var y={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return el===null?Ra.memoizedState=el=y:el=el.next=y,el}function Ah(){if(jo===null){var y=Ra.alternate;y=y!==null?y.memoizedState:null}else y=jo.next;var E=el===null?Ra.memoizedState:el.next;if(E!==null)el=E,jo=y;else{if(y===null)throw Error(t(310));jo=y,y={memoizedState:jo.memoizedState,baseState:jo.baseState,baseQueue:jo.baseQueue,queue:jo.queue,next:null},el===null?Ra.memoizedState=el=y:el=el.next=y}return el}function Z_(y,E){return typeof E=="function"?E(y):E}function UP(y){var E=Ah(),j=E.queue;if(j===null)throw Error(t(311));j.lastRenderedReducer=y;var q=jo,Q=q.baseQueue,se=j.pending;if(se!==null){if(Q!==null){var Re=Q.next;Q.next=se.next,se.next=Re}q.baseQueue=Q=se,j.pending=null}if(Q!==null){se=Q.next,q=q.baseState;var rt=Re=null,gt=null,Vt=se;do{var Sn=Vt.lane;if((Ax&Sn)===Sn)gt!==null&&(gt=gt.next={lane:0,action:Vt.action,hasEagerState:Vt.hasEagerState,eagerState:Vt.eagerState,next:null}),q=Vt.hasEagerState?Vt.eagerState:y(q,Vt.action);else{var Mn={lane:Sn,action:Vt.action,hasEagerState:Vt.hasEagerState,eagerState:Vt.eagerState,next:null};gt===null?(rt=gt=Mn,Re=q):gt=gt.next=Mn,Ra.lanes|=Sn,xx|=Sn}Vt=Vt.next}
vendor: 4,739 bytes, line 38
38while(Vt!==null&&Vt!==se);gt===null?Re=q:gt.next=rt,Fc(q,E.memoizedState)||(Eu=!0),E.memoizedState=q,E.baseState=Re,E.baseQueue=gt,j.lastRenderedState=q}if(y=j.interleaved,y!==null){Q=y;do se=Q.lane,Ra.lanes|=se,xx|=se,Q=Q.next;while(Q!==y)}else Q===null&&(j.lanes=0);return[E.memoizedState,j.dispatch]}function BP(y){var E=Ah(),j=E.queue;if(j===null)throw Error(t(311));j.lastRenderedReducer=y;var q=j.dispatch,Q=j.pending,se=E.memoizedState;if(Q!==null){j.pending=null;var Re=Q=Q.next;do se=y(se,Re.action),Re=Re.next;while(Re!==Q);Fc(se,E.memoizedState)||(Eu=!0),E.memoizedState=se,E.baseQueue===null&&(E.baseState=se),j.lastRenderedState=se}return[se,q]}function E$(){}function C$(y,E){var j=Ra,q=Ah(),Q=E(),se=!Fc(q.memoizedState,Q);if(se&&(q.memoizedState=Q,Eu=!0),q=q.queue,VP(k$.bind(null,j,q,y),[y]),q.getSnapshot!==E||se||el!==null&&el.memoizedState.tag&1){if(j.flags|=2048,J_(9,M$.bind(null,j,q,Q,E),void 0,null),tl===null)throw Error(t(349));(Ax&30)!==0||N$(j,E,Q)}return Q}function N$(y,E,j){y.flags|=16384,y={getSnapshot:E,value:j},E=Ra.updateQueue,E===null?(E={lastEffect:null,stores:null},Ra.updateQueue=E,E.stores=[y]):(j=E.stores,j===null?E.stores=[y]:j.push(y))}function M$(y,E,j,q){E.value=j,E.getSnapshot=q,R$(E)&&P$(y)}function k$(y,E,j){return j(function(){R$(E)&&P$(y)})}function R$(y){var E=y.getSnapshot;y=y.value;try{var j=E();return!Fc(y,j)}catch{return!0}}function P$(y){var E=om(y,1);E!==null&&xf(E,y,1,-1)}function L$(y){var E=Tp();return typeof y=="function"&&(y=y()),E.memoizedState=E.baseState=y,y={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Z_,lastRenderedState:y},E.queue=y,y=y.dispatch=Nxe.bind(null,Ra,y),[E.memoizedState,y]}function J_(y,E,j,q){return y={tag:y,create:E,destroy:j,deps:q,next:null},E=Ra.updateQueue,E===null?(E={lastEffect:null,stores:null},Ra.updateQueue=E,E.lastEffect=y.next=y):(j=E.lastEffect,j===null?E.lastEffect=y.next=y:(q=j.next,j.next=y,y.next=q,E.lastEffect=y)),y}function O$(){return Ah().memoizedState}function sE(y,E,j,q){var Q=Tp();Ra.flags|=y,Q.memoizedState=J_(1|E,j,void 0,q===void 0?null:q)}function aE(y,E,j,q){var Q=Ah();q=q===void 0?null:q;var se=void 0;if(jo!==null){var Re=jo.memoizedState;if(se=Re.destroy,q!==null&&jP(q,Re.deps)){Q.memoizedState=J_(E,j,se,q);return}}Ra.flags|=y,Q.memoizedState=J_(1|E,j,se,q)}function D$(y,E){return sE(8390656,8,y,E)}function VP(y,E){return aE(2048,8,y,E)}function j$(y,E){return aE(4,2,y,E)}function I$(y,E){return aE(4,4,y,E)}function F$(y,E){if(typeof E=="function")return y=y(),E(y),function(){E(null)};if(E!=null)return y=y(),E.current=y,function(){E.current=null}}function U$(y,E,j){return j=j!=null?j.concat([y]):null,aE(4,4,F$.bind(null,E,y),j)}function zP(){}function B$(y,E){var j=Ah();E=E===void 0?null:E;var q=j.memoizedState;return q!==null&&E!==null&&jP(E,q[1])?q[0]:(j.memoizedState=[y,E],y)}function V$(y,E){var j=Ah();E=E===void 0?null:E;var q=j.memoizedState;return q!==null&&E!==null&&jP(E,q[1])?q[0]:(y=y(),j.memoizedState=[y,E],y)}function z$(y,E,j){return(Ax&21)===0?(y.baseState&&(y.baseState=!1,Eu=!0),y.memoizedState=j):(Fc(j,E)||(j=Gn(),Ra.lanes|=j,xx|=j,y.baseState=!0),E)}function Exe(y,E){var j=ai;ai=j!==0&&4>j?j:4,y(!0);var q=DP.transition;DP.transition={};try{y(!1),E()}finally{ai=j,DP.transition=q}}function G$(){return Ah().memoizedState}function Cxe(y,E,j){var q=Gg(y);if(j={lane:q,action:j,hasEagerState:!1,eagerState:null,next:null},q$(y))$$(E,j);else if(j=b$(y,E,j,q),j!==null){var Q=Gc();xf(j,y,q,Q),H$(j,E,q)}}function Nxe(y,E,j){var q=Gg(y),Q={lane:q,action:j,hasEagerState:!1,eagerState:null,next:null};if(q$(y))$$(E,Q);else{var se=y.alternate;if(y.lanes===0&&(se===null||se.lanes===0)&&(se=E.lastRenderedReducer,se!==null))try{var Re=E.lastRenderedState,rt=se(Re,j);if(Q.hasEagerState=!0,Q.eagerState=rt,Fc(rt,Re)){var gt=E.interleaved;gt===null?(Q.next=Q,MP(E)):(Q.next=gt.next,gt.next=Q),E.interleaved=Q;return}}catch{}finally{}j=b$(y,E,Q,q),j!==null&&(Q=Gc(),xf(j,y,q,Q),H$(j,E,q))}}function q$(y){var E=y.alternate;return y===Ra||E!==null&&E===Ra}function $$(y,E){Q_=iE=!0;var j=y.pending;j===null?E.next=E:(E.next=j.next,j.next=E),y.pending=E}function H$(y,E,j){if((j&4194240)!==0){var q=E.lanes;q&=y.pendingLanes,j|=q,E.lanes=j,Yo(y,j)}}var oE={readContext:gh,useCallback:Zl,useContext:Zl,useEffect:Zl,useImperativeHandle:Zl,useInsertionEffect:Zl,useLayoutEffect:Zl,useMemo:Zl,useReducer:Zl,useRef:Zl,useState:Zl,useDebugValue:Zl,useDeferredValue:Zl,useTransition:Zl,useMutableSource:Zl,useSyncExternalStore:Zl,useId:Zl,unstable_isNewReconciler:!1},Mxe={readContext:gh,useCallback:function(y,E){return Tp().memoizedState=[y,E===void 0?null:E],y},useContext:gh,useEffect:D$,useImperativeHandle:function(y,E,j){return j=j!=null?j.concat([y]):null,
vendor: 5,631 bytes, lines 38-40
38sE(4194308,4,F$.bind(null,E,y),j)},useLayoutEffect:function(y,E){return sE(4194308,4,y,E)},useInsertionEffect:function(y,E){return sE(4,2,y,E)},useMemo:function(y,E){var j=Tp();return E=E===void 0?null:E,y=y(),j.memoizedState=[y,E],y},useReducer:function(y,E,j){var q=Tp();return E=j!==void 0?j(E):E,q.memoizedState=q.baseState=E,y={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:y,lastRenderedState:E},q.queue=y,y=y.dispatch=Cxe.bind(null,Ra,y),[q.memoizedState,y]},useRef:function(y){var E=Tp();return y={current:y},E.memoizedState=y},useState:L$,useDebugValue:zP,useDeferredValue:function(y){return Tp().memoizedState=y},useTransition:function(){var y=L$(!1),E=y[0];return y=Exe.bind(null,y[1]),Tp().memoizedState=y,[E,y]},useMutableSource:function(){},useSyncExternalStore:function(y,E,j){var q=Ra,Q=Tp();if(Et){if(j===void 0)throw Error(t(407));j=j()}else{if(j=E(),tl===null)throw Error(t(349));(Ax&30)!==0||N$(q,E,j)}Q.memoizedState=j;var se={value:j,getSnapshot:E};return Q.queue=se,D$(k$.bind(null,q,se,y),[y]),q.flags|=2048,J_(9,M$.bind(null,q,se,j,E),void 0,null),j},useId:function(){var y=Tp(),E=tl.identifierPrefix;if(Et){var j=ot,q=Me;j=(q&~(1<<32-ln(q)-1)).toString(32)+j,E=":"+E+"R"+j,j=K_++,0<j&&(E+="H"+j.toString(32)),E+=":"}else j=Txe++,E=":"+E+"r"+j.toString(32)+":";return y.memoizedState=E},unstable_isNewReconciler:!1},kxe={readContext:gh,useCallback:B$,useContext:gh,useEffect:VP,useImperativeHandle:U$,useInsertionEffect:j$,useLayoutEffect:I$,useMemo:V$,useReducer:UP,useRef:O$,useState:function(){return UP(Z_)},useDebugValue:zP,useDeferredValue:function(y){var E=Ah();return z$(E,jo.memoizedState,y)},useTransition:function(){var y=UP(Z_)[0],E=Ah().memoizedState;return[y,E]},useMutableSource:E$,useSyncExternalStore:C$,useId:G$,unstable_isNewReconciler:!1},Rxe={readContext:gh,useCallback:B$,useContext:gh,useEffect:VP,useImperativeHandle:U$,useInsertionEffect:j$,useLayoutEffect:I$,useMemo:V$,useReducer:BP,useRef:O$,useState:function(){return BP(Z_)},useDebugValue:zP,useDeferredValue:function(y){var E=Ah();return jo===null?E.memoizedState=y:z$(E,jo.memoizedState,y)},useTransition:function(){var y=BP(Z_)[0],E=Ah().memoizedState;return[y,E]},useMutableSource:E$,useSyncExternalStore:C$,useId:G$,unstable_isNewReconciler:!1};function mf(y,E){if(y&&y.defaultProps){E=Z({},E),y=y.defaultProps;for(var j in y)E[j]===void 0&&(E[j]=y[j]);return E}return E}function GP(y,E,j,q){E=y.memoizedState,j=j(q,E),j=j==null?E:Z({},E,j),y.memoizedState=j,y.lanes===0&&(y.updateQueue.baseState=j)}var lE={isMounted:function(y){return(y=y._reactInternals)?Pt(y)===y:!1},enqueueSetState:function(y,E,j){y=y._reactInternals;var q=Gc(),Q=Gg(y),se=lm(q,Q);se.payload=E,j!=null&&(se.callback=j),E=Ug(y,se,Q),E!==null&&(xf(E,y,Q,q),eE(E,y,Q))},enqueueReplaceState:function(y,E,j){y=y._reactInternals;var q=Gc(),Q=Gg(y),se=lm(q,Q);se.tag=1,se.payload=E,j!=null&&(se.callback=j),E=Ug(y,se,Q),E!==null&&(xf(E,y,Q,q),eE(E,y,Q))},enqueueForceUpdate:function(y,E){y=y._reactInternals;var j=Gc(),q=Gg(y),Q=lm(j,q);Q.tag=2,E!=null&&(Q.callback=E),E=Ug(y,Q,q),E!==null&&(xf(E,y,q,j),eE(E,y,q))}};function W$(y,E,j,q,Q,se,Re){return y=y.stateNode,typeof y.shouldComponentUpdate=="function"?y.shouldComponentUpdate(q,se,Re):E.prototype&&E.prototype.isPureReactComponent?!cf(j,q)||!cf(Q,se):!0}function X$(y,E,j){var q=!1,Q=qn,se=E.contextType;return typeof se=="object"&&se!==null?se=gh(se):(Q=En(E)?Wr:Yn.current,q=E.contextTypes,se=(q=q!=null)?jt(y,Q):qn),E=new E(j,se),y.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=lE,y.stateNode=E,E._reactInternals=y,q&&(y=y.stateNode,y.__reactInternalMemoizedUnmaskedChildContext=Q,y.__reactInternalMemoizedMaskedChildContext=se),E}function Y$(y,E,j,q){y=E.state,typeof E.componentWillReceiveProps=="function"&&E.componentWillReceiveProps(j,q),typeof E.UNSAFE_componentWillReceiveProps=="function"&&E.UNSAFE_componentWillReceiveProps(j,q),E.state!==y&&lE.enqueueReplaceState(E,E.state,null)}function qP(y,E,j,q){var Q=y.stateNode;Q.props=j,Q.state=y.memoizedState,Q.refs={},kP(y);var se=E.contextType;typeof se=="object"&&se!==null?Q.context=gh(se):(se=En(E)?Wr:Yn.current,Q.context=jt(y,se)),Q.state=y.memoizedState,se=E.getDerivedStateFromProps,typeof se=="function"&&(GP(y,E,se,j),Q.state=y.memoizedState),typeof E.getDerivedStateFromProps=="function"||typeof Q.getSnapshotBeforeUpdate=="function"||typeof Q.UNSAFE_componentWillMount!="function"&&typeof Q.componentWillMount!="function"||(E=Q.state,typeof Q.componentWillMount=="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount=="function"&&Q.UNSAFE_componentWillMount(),E!==Q.state&&lE.enqueueReplaceState(Q,Q.state,null),tE(y,j,Q,q),Q.state=y.memoizedState),typeof Q.componentDidMount=="function"&&(y.flags|=4194308)}function qy(y,E){try{var j="",q=E;do j+=Ae(q),q=q.return;while(q);var Q=j}catch(se){Q=` 39Error generating stack: `+se.message+` 40`+se.stack}return{value:y,source:E,stack:Q,digest:null}}function $P(y,E,j){return{value:y,source:null,stack:j??null,digest:E??null}}function HP(y,E){try{console.error(E.value)}catch(j){setTimeout(function(){throw j})}}var Pxe=typeof WeakMap=="function"?WeakMap:Map;function Q$(y,E,j){j=lm(-1,j),j.tag=3,j.payload={element:null};var q=E.value;return j.callback=function(){mE||(mE=!0,o7=q),HP(y,E)},j}function K$(y,E,j){j=lm(-1,j),j.tag=3;var q=y.type.getDerivedStateFromError;if(typeof q=="function"){var Q=E.value;j.payload=function(){return q(Q)},j.callback=function(){HP(y,E)}}var se=y.stateNode;return se!==null&&typeof se.componentDidCatch=="function"&&(j.callback=function(){HP(y,E),typeof q!="function"&&(Vg===null?Vg=ne
vendor: 16,467 bytes, line 40
40w Set([this]):Vg.add(this));var Re=E.stack;this.componentDidCatch(E.value,{componentStack:Re!==null?Re:""})}),j}function Z$(y,E,j){var q=y.pingCache;if(q===null){q=y.pingCache=new Pxe;var Q=new Set;q.set(E,Q)}else Q=q.get(E),Q===void 0&&(Q=new Set,q.set(E,Q));Q.has(j)||(Q.add(j),y=Hxe.bind(null,y,E,j),E.then(y,y))}function J$(y){do{var E;if((E=y.tag===13)&&(E=y.memoizedState,E=E!==null?E.dehydrated!==null:!0),E)return y;y=y.return}while(y!==null);return null}function eH(y,E,j,q,Q){return(y.mode&1)===0?(y===E?y.flags|=65536:(y.flags|=128,j.flags|=131072,j.flags&=-52805,j.tag===1&&(j.alternate===null?j.tag=17:(E=lm(-1,1),E.tag=2,Ug(j,E,1))),j.lanes|=1),y):(y.flags|=65536,y.lanes=Q,y)}var Lxe=T.ReactCurrentOwner,Eu=!1;function zc(y,E,j,q){E.child=y===null?Vc(E,null,j,q):la(E,y.child,j,q)}function tH(y,E,j,q,Q){j=j.render;var se=E.ref;return zy(E,Q),q=IP(y,E,j,q,se,Q),j=FP(),y!==null&&!Eu?(E.updateQueue=y.updateQueue,E.flags&=-2053,y.lanes&=~Q,cm(y,E,Q)):(Et&&j&&$t(E),E.flags|=1,zc(y,E,q,Q),E.child)}function nH(y,E,j,q,Q){if(y===null){var se=j.type;return typeof se=="function"&&!p7(se)&&se.defaultProps===void 0&&j.compare===null&&j.defaultProps===void 0?(E.tag=15,E.type=se,rH(y,E,se,q,Q)):(y=bE(j.type,null,q,E,E.mode,Q),y.ref=E.ref,y.return=E,E.child=y)}if(se=y.child,(y.lanes&Q)===0){var Re=se.memoizedProps;if(j=j.compare,j=j!==null?j:cf,j(Re,q)&&y.ref===E.ref)return cm(y,E,Q)}return E.flags|=1,y=$g(se,q),y.ref=E.ref,y.return=E,E.child=y}function rH(y,E,j,q,Q){if(y!==null){var se=y.memoizedProps;if(cf(se,q)&&y.ref===E.ref)if(Eu=!1,E.pendingProps=q=se,(y.lanes&Q)!==0)(y.flags&131072)!==0&&(Eu=!0);else return E.lanes=y.lanes,cm(y,E,Q)}return WP(y,E,j,q,Q)}function iH(y,E,j){var q=E.pendingProps,Q=q.children,se=y!==null?y.memoizedState:null;if(q.mode==="hidden")if((E.mode&1)===0)E.memoizedState={baseLanes:0,cachePool:null,transitions:null},hn(Hy,xd),xd|=j;else{if((j&1073741824)===0)return y=se!==null?se.baseLanes|j:j,E.lanes=E.childLanes=1073741824,E.memoizedState={baseLanes:y,cachePool:null,transitions:null},E.updateQueue=null,hn(Hy,xd),xd|=y,null;E.memoizedState={baseLanes:0,cachePool:null,transitions:null},q=se!==null?se.baseLanes:j,hn(Hy,xd),xd|=q}else se!==null?(q=se.baseLanes|j,E.memoizedState=null):q=j,hn(Hy,xd),xd|=q;return zc(y,E,Q,j),E.child}function sH(y,E){var j=E.ref;(y===null&&j!==null||y!==null&&y.ref!==j)&&(E.flags|=512,E.flags|=2097152)}function WP(y,E,j,q,Q){var se=En(j)?Wr:Yn.current;return se=jt(E,se),zy(E,Q),j=IP(y,E,j,q,se,Q),q=FP(),y!==null&&!Eu?(E.updateQueue=y.updateQueue,E.flags&=-2053,y.lanes&=~Q,cm(y,E,Q)):(Et&&q&&$t(E),E.flags|=1,zc(y,E,j,Q),E.child)}function aH(y,E,j,q,Q){if(En(j)){var se=!0;N(E)}else se=!1;if(zy(E,Q),E.stateNode===null)uE(y,E),X$(E,j,q),qP(E,j,q,Q),q=!0;else if(y===null){var Re=E.stateNode,rt=E.memoizedProps;Re.props=rt;var gt=Re.context,Vt=j.contextType;typeof Vt=="object"&&Vt!==null?Vt=gh(Vt):(Vt=En(j)?Wr:Yn.current,Vt=jt(E,Vt));var Sn=j.getDerivedStateFromProps,Mn=typeof Sn=="function"||typeof Re.getSnapshotBeforeUpdate=="function";Mn||typeof Re.UNSAFE_componentWillReceiveProps!="function"&&typeof Re.componentWillReceiveProps!="function"||(rt!==q||gt!==Vt)&&Y$(E,Re,q,Vt),Fg=!1;var yn=E.memoizedState;Re.state=yn,tE(E,q,Re,Q),gt=E.memoizedState,rt!==q||yn!==gt||xn.current||Fg?(typeof Sn=="function"&&(GP(E,j,Sn,q),gt=E.memoizedState),(rt=Fg||W$(E,j,rt,q,yn,gt,Vt))?(Mn||typeof Re.UNSAFE_componentWillMount!="function"&&typeof Re.componentWillMount!="function"||(typeof Re.componentWillMount=="function"&&Re.componentWillMount(),typeof Re.UNSAFE_componentWillMount=="function"&&Re.UNSAFE_componentWillMount()),typeof Re.componentDidMount=="function"&&(E.flags|=4194308)):(typeof Re.componentDidMount=="function"&&(E.flags|=4194308),E.memoizedProps=q,E.memoizedState=gt),Re.props=q,Re.state=gt,Re.context=Vt,q=rt):(typeof Re.componentDidMount=="function"&&(E.flags|=4194308),q=!1)}else{Re=E.stateNode,w$(y,E),rt=E.memoizedProps,Vt=E.type===E.elementType?rt:mf(E.type,rt),Re.props=Vt,Mn=E.pendingProps,yn=Re.context,gt=j.contextType,typeof gt=="object"&>!==null?gt=gh(gt):(gt=En(j)?Wr:Yn.current,gt=jt(E,gt));var Kn=j.getDerivedStateFromProps;(Sn=typeof Kn=="function"||typeof Re.getSnapshotBeforeUpdate=="function")||typeof Re.UNSAFE_componentWillReceiveProps!="function"&&typeof Re.componentWillReceiveProps!="function"||(rt!==Mn||yn!==gt)&&Y$(E,Re,q,gt),Fg=!1,yn=E.memoizedState,Re.state=yn,tE(E,q,Re,Q);var hr=E.memoizedState;rt!==Mn||yn!==hr||xn.current||Fg?(typeof Kn=="function"&&(GP(E,j,Kn,q),hr=E.memoizedState),(Vt=Fg||W$(E,j,Vt,q,yn,hr,gt)||!1)?(Sn||typeof Re.UNSAFE_componentWillUpdate!="function"&&typeof Re.componentWillUpdate!="function"||(typeof Re.componentWillUpdate=="function"&&Re.componentWillUpdate(q,hr,gt),typeof Re.UNSAFE_componentWillUpdate=="function"&&Re.UNSAFE_componentWillUpdate(q,hr,gt)),typeof Re.componentDidUpdate=="function"&&(E.flags|=4),typeof Re.getSnapshotBeforeUpdate=="function"&&(E.flags|=1024)):(typeof Re.componentDidUpdate!="function"||rt===y.memoizedProps&&yn===y.memoizedState||(E.flags|=4),typeof Re.getSnapshotBeforeUpdate!="function"||rt===y.memoizedProps&&yn===y.memoizedState||(E.flags|=1024),E.memoizedProps=q,E.memoizedState=hr),Re.props=q,Re.state=hr,Re.context=gt,q=Vt):(typeof Re.componentDidUpdate!="function"||rt===y.memoizedProps&&yn===y.memoizedState||(E.flags|=4),typeof Re.getSnapshotBeforeUpdate!="function"||rt===y.memoizedProps&&yn===y.memoizedState||(E.flags|=1024),q=!1)}return XP(y,E,j,q,se,Q)}function XP(y,E,j,q,Q,se){sH(y,E);var Re=(E.flags&128)!==0;if(!q&&!Re)return Q&&C(E,j,!1),cm(y,E,se);q=E.stateNode,Lxe.current=E;var rt=Re&&typeof j.getDerivedStateFromError!="function"?null:q.render();return E.flags|=1,y!==null&&Re?(E.child=la(E,y.child,null,se),E.child=la(E,null,rt,se)):zc(y,E,rt,se),E.memoizedState=q.state,Q&&C(E,j,!0),E.child}function oH(y){var E=y.stateNode;E.pendingContext?w(y,E.pendingContext,E.pendingContext!==E.context):E.context&&w(y,E.context,!1),RP(y,E.containerInfo)}function lH(y,E,j,q,Q){return Vr(),ji(Q),E.flags|=256,zc(y,E,j,q),E.child}var YP={dehydrated:null,treeContext:null,retryLane:0};function QP(y){return{baseLanes:y,cachePool:null,transitions:null}}function cH(y,E,j){var q=E.pendingProps,Q=ka.current,se=!1,Re=(E.flags&128)!==0,rt;if((rt=Re)||(rt=y!==null&&y.memoizedState===null?!1:(Q&2)!==0),rt?(se=!0,E.flags&=-129):(y===null||y.memoizedState!==null)&&(Q|=1),hn(ka,Q&1),y===null)return li(E),y=E.memoizedState,y!==null&&(y=y.dehydrated,y!==null)?((E.mode&1)===0?E.lanes=1:y.data==="$!"?E.lanes=8:E.lanes=1073741824,null):(Re=q.children,y=q.fallback,se?(q=E.mode,se=E.child,Re={mode:"hidden",children:Re},(q&1)===0&&se!==null?(se.childLanes=0,se.pendingProps=Re):se=wE(Re,q,0,null),y=wx(y,q,j,null),se.return=E,y.return=E,se.sibling=y,E.child=se,E.child.memoizedState=QP(j),E.memoizedState=YP,y):KP(E,Re));if(Q=y.memoizedState,Q!==null&&(rt=Q.dehydrated,rt!==null))return Oxe(y,E,Re,q,rt,Q,j);if(se){se=q.fallback,Re=E.mode,Q=y.child,rt=Q.sibling;var gt={mode:"hidden",children:q.children};return(Re&1)===0&&E.child!==Q?(q=E.child,q.childLanes=0,q.pendingProps=gt,E.deletions=null):(q=$g(Q,gt),q.subtreeFlags=Q.subtreeFlags&14680064),rt!==null?se=$g(rt,se):(se=wx(se,Re,j,null),se.flags|=2),se.return=E,q.return=E,q.sibling=se,E.child=q,q=se,se=E.child,Re=y.child.memoizedState,Re=Re===null?QP(j):{baseLanes:Re.baseLanes|j,cachePool:null,transitions:Re.transitions},se.memoizedState=Re,se.childLanes=y.childLanes&~j,E.memoizedState=YP,q}return se=y.child,y=se.sibling,q=$g(se,{mode:"visible",children:q.children}),(E.mode&1)===0&&(q.lanes=j),q.return=E,q.sibling=null,y!==null&&(j=E.deletions,j===null?(E.deletions=[y],E.flags|=16):j.push(y)),E.child=q,E.memoizedState=null,q}function KP(y,E){return E=wE({mode:"visible",children:E},y.mode,0,null),E.return=y,y.child=E}function cE(y,E,j,q){return q!==null&&ji(q),la(E,y.child,null,j),y=KP(E,E.pendingProps.children),y.flags|=2,E.memoizedState=null,y}function Oxe(y,E,j,q,Q,se,Re){if(j)return E.flags&256?(E.flags&=-257,q=$P(Error(t(422))),cE(y,E,Re,q)):E.memoizedState!==null?(E.child=y.child,E.flags|=128,null):(se=q.fallback,Q=E.mode,q=wE({mode:"visible",children:q.children},Q,0,null),se=wx(se,Q,Re,null),se.flags|=2,q.return=E,se.return=E,q.sibling=se,E.child=q,(E.mode&1)!==0&&la(E,y.child,null,Re),E.child.memoizedState=QP(Re),E.memoizedState=YP,se);if((E.mode&1)===0)return cE(y,E,Re,null);if(Q.data==="$!"){if(q=Q.nextSibling&&Q.nextSibling.dataset,q)var rt=q.dgst;return q=rt,se=Error(t(419)),q=$P(se,q,void 0),cE(y,E,Re,q)}if(rt=(Re&y.childLanes)!==0,Eu||rt){if(q=tl,q!==null){switch(Re&-Re){case 4:Q=2;break;case 16:Q=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:Q=32;break;case 536870912:Q=268435456;break;default:Q=0}Q=(Q&(q.suspendedLanes|Re))!==0?0:Q,Q!==0&&Q!==se.retryLane&&(se.retryLane=Q,om(y,Q),xf(q,y,Q,-1))}return f7(),q=$P(Error(t(421))),cE(y,E,Re,q)}return Q.data==="$?"?(E.flags|=128,E.child=y.child,E=Wxe.bind(null,y),Q._reactRetry=E,null):(y=se.treeContext,Xt=An(Q.nextSibling),ht=E,Et=!0,Zt=null,y!==null&&(je[We++]=Me,je[We++]=ot,je[We++]=De,Me=y.id,ot=y.overflow,De=E),E=KP(E,q.children),E.flags|=4096,E)}function uH(y,E,j){y.lanes|=E;var q=y.alternate;q!==null&&(q.lanes|=E),NP(y.return,E,j)}function ZP(y,E,j,q,Q){var se=y.memoizedState;se===null?y.memoizedState={isBackwards:E,rendering:null,renderingStartTime:0,last:q,tail:j,tailMode:Q}:(se.isBackwards=E,se.rendering=null,se.renderingStartTime=0,se.last=q,se.tail=j,se.tailMode=Q)}function dH(y,E,j){var q=E.pendingProps,Q=q.revealOrder,se=q.tail;if(zc(y,E,q.children,j),q=ka.current,(q&2)!==0)q=q&1|2,E.flags|=128;else{if(y!==null&&(y.flags&128)!==0)e:for(y=E.child;y!==null;){if(y.tag===13)y.memoizedState!==null&&uH(y,j,E);else if(y.tag===19)uH(y,j,E);else if(y.child!==null){y.child.return=y,y=y.child;continue}if(y===E)break e;for(;y.sibling===null;){if(y.return===null||y.return===E)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}q&=1}if(hn(ka,q),(E.mode&1)===0)E.memoizedState=null;else switch(Q){case"forwards":for(j=E.child,Q=null;j!==null;)y=j.alternate,y!==null&&nE(y)===null&&(Q=j),j=j.sibling;j=Q,j===null?(Q=E.child,E.child=null):(Q=j.sibling,j.sibling=null),ZP(E,!1,Q,j,se);break;case"backwards":for(j=null,Q=E.child,E.child=null;Q!==null;){if(y=Q.alternate,y!==null&&nE(y)===null){E.child=Q;break}y=Q.sibling,Q.sibling=j,j=Q,Q=y}ZP(E,!0,j,null,se);break;case"together":ZP(E,!1,null,null,void 0);break;default:E.memoizedState=null}return E.child}function uE(y,E){(E.mode&1)===0&&y!==null&&(y.alternate=null,E.alternate=null,E.flags|=2)}function cm(y,E,j){if(y!==null&&(E.dependencies=y.dependencies),xx|=E.lanes,(j&E.childLanes)===0)return null;if(y!==null&&E.child!==y.child)throw Error(t(153));if(E.child!==null){for(y=E.child,j=$g(y,y.pendingProps),E.child=j,j.return=E;y.sibling!==null;)y=y.sibling,j=j.sibling=$g(y,y.pendingProps),j.return=E;j.sibling=null}return E.child}function Dxe(y,E,j){switch(E.tag){case 3:oH(E),Vr();break;case 5:T$(E);break;case 1:En(E.type)&&N(E);break;case 4:RP(E,E.stateNode.containerInfo);break;case 10:var q=E.type._context,Q=E.memoizedProps.value;hn(qa,q._currentValue),q._currentValue=Q;break;case 13:if(q=E.memoizedState,q!==null)return q.dehydrated!==null?(hn(ka,ka.current&1),E.flags|=128,null):(j&E.child.childLanes)!==0?cH(y,E,j):(hn(ka,ka.current&1),y=cm(y,E,j),y!==null?y.sibling:null);hn(ka,ka.current&1);break;case 19:if(q=(j&E.childLanes)!==0,(y.flags&128)!==0){if(q)return dH(y,E,j);E.flags|=128}if(Q=E.memoizedState,Q!==null&&(Q.rendering=null,Q.tail=null,Q.lastEffect=null),hn(ka,ka.current),q)break;return null;case 22:case 23:return E.lanes=0,iH(y,E,j)}return cm(y,E,j)}var hH,JP,fH,pH;hH=function(y,E){for(var j=E.child;j!==null;){if(j.tag===5||j.tag===6)y.appendChild(j.stateNode);else if(j.tag!==4&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===E)break;for(;j.sibling===null;){if(j.return===null||j.return===E)return;j=j.return}j.sibling.return=j.return,j=j.sibling}},JP=function(){},fH=function(y,E,j,q){var Q=y.memoizedProps;if(Q!==q){y=E.stateNode,gx(Sp.current);var se=null;switch(j){case"input":Q=dt(y,Q),q=dt(y,q),se=[];break;case"select":Q=Z({},Q,{value:void 0}),q=Z({},q,{value:void 0}),se=[];break;case"textarea":Q=Ce(y,Q),q=Ce(y,q),se=[];break;default:typeof Q.onClick!="function"&&typeof q.onClick=="function"&&(y.onclick=am)}Ft(j,q);var Re;j=null;for(Vt in Q)if(!q.hasOwnProperty(Vt)&&Q.hasOwnProperty(Vt)&&Q[Vt]!=null)if(Vt==="style"){var rt=Q[Vt];for(Re in rt)rt.hasOwnProperty(Re)&&(j||(j={}),j[Re]="")}else Vt!=="dangerouslySetInnerHTML"&&Vt!=="children"&&Vt!=="suppressContentEditableWarning"&&Vt!=="suppressHydrationWarning"&&Vt!=="autoFocus"&&(i.hasOwnProperty(Vt)?se||(se=[]):(se=se||[]).push(Vt,null));for(Vt in q){var gt=q[Vt];if(rt=Q!=null?Q[Vt]:void 0,q.hasOwnProperty(Vt)&>!==rt&&(gt!=null||rt!=null))if(Vt==="style")if(rt){for(Re in rt)!rt.hasOwnProperty(Re)||gt&>.hasOwnProperty(Re)||(j||(j={}),j[Re]="");for(Re in gt)gt.hasOwnProperty(Re)&&rt[Re]!==gt[Re]&&(j||(j={}),j[Re]=gt[Re])}else j||(se||(se=[]),se.push(Vt,j)),j=gt;else Vt==="dangerouslySetInnerHTML"?(gt=gt?gt.__html:void 0,rt=rt?rt.__html:void 0,gt!=null&&rt!==gt&&(se=se||[]).push(Vt,gt)):Vt==="children"?typeof gt!="string"&&typeof gt!="number"||(se=se||[]).push(Vt,""+gt):Vt!=="suppressContentEditableWarning"&&Vt!=="suppressHydrationWarning"&&(i.hasOwnProperty(Vt)?(gt!=null&&Vt==="onScroll"&&_s("scroll",y),se||rt===gt||(se=[])):(se=se||[]).push(Vt,gt))}j&&(se=se||[]).push("style",j);var Vt=se;(E.updateQueue=Vt)&&(E.flags|=4)}},pH=function(y,E,j,q){j!==q&&(E.flags|=4)};function e3(y,E){if(!Et)switch(y.tailMode){case"hidden":E=y.tail;for(var j=null;E!==null;)E.alternate!==null&&(j=E),E=E.sibling;j===null?y.tail=null:j.sibling=null;break;case"collapsed":j=y.tail;for(var q=null;j!==null;)j.alternate!==null&&(q=j),j=j.sibling;q===null?E||y.tail===null?y.tail=null:y.tail.sibling=null:q.sibling=null}}function Jl(y){var E=y.alternate!==null&&y.alternate.child===y.child,j=0,q=0;if(E)for(var Q=y.child;Q!==null;)j|=Q.lanes|Q.childLanes,q|=Q.subtreeFlags&14680064,q|=Q.flags&14680064,Q.return=y,Q=Q.sibling;else for(Q=y.child;Q!==null;)j|=Q.lanes|Q.childLanes,q|=Q.subtreeFlags,q|=Q.flags,Q.return=y,Q=Q.sibling;return y.subtreeFlags|=q,y.childLanes=j,E}function jxe(y,E,j){var q=E.pendingProps;switch(Tt(E),E.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jl(E),null;case 1:return En(E.type)&&v(),Jl(E),null;case 3:return q=E.stateNode,Gy(),Wt(xn),Wt(Yn),OP(),q.pendingContext&&(q.context=q.pendingContext,q.pendingContext=null),(y===null||y.child===null)&&(Lr(E)?E.flags|=4:y===null||y.memoizedState.isDehydrated&&(E.flags&256)===0||(E.flags|=1024,Zt!==null&&(u7(Zt),Zt=null))),JP(y,E),Jl(E),null;case 5:PP(E);var Q=gx(Y_.current);if(j=E.type,y!==null&&E.stateNode!=null)fH(y,E,j,q,Q),y.ref!==E.ref&&(E.flags|=512,E.flags|=2097152);else{if(!q){if(E.stateNode===null)throw Error(t(166));return Jl(E),null}if(y=gx(Sp.current),Lr(E)){q=E.stateNode,j=E.type;var se=E.memoizedProps;switch(q[Jo]=E,q[Kl]=se,y=(E.mode&1)!==0,j){case"dialog":_s("cancel",q),_s("close",q);break;case"iframe":case"object":case"embed":_s("load",q);break;case"video":case"audio":for(Q=0;Q<Bc.length;Q++)_s(Bc[Q],q);break;case"source":_s("error",q);break;case"img":case"image":case"link":_s("error",q),_s("load",q);break;case"details":_s("toggle",q);break;case"input":St(q,se),_s("invalid",q);break;case"select":q._wrapperState={wasMultiple:!!se.multiple},_s("invalid",q);break;case"textarea":Se(q,se),_s("invalid",q)}Ft(j,se),Q=null;for(var Re in se)if(se.hasOwnProperty(Re)){var rt=se[Re];Re==="children"?typeof rt=="string"?q.textContent!==rt&&(se.suppressHydrationWarning!==!0&&ff(q.textContent,rt,y),Q=["children",rt]):typeof rt=="number"&&q.textContent!==""+rt&&(se.suppressHydrationWarning!==!0&&ff(q.textContent,rt,y),Q=["children",""+rt]):i.hasOwnProperty(Re)&&rt!=null&&Re==="onScroll"&&_s("scroll",q)}switch(j){case"input":yt(q),Ze(q,se,!0);break;case"textarea":yt(q),pt(q);break;case"select":case"option":break;default:typeof se.onClick=="function"&&(q.onclick=am)}q=Q,E.updateQueue=q,q!==null&&(E.flags|=4)}else{Re=Q.nodeType===9?Q:Q.ownerDocument,y==="http://www.w3.org/1999/xhtml"&&(y=Te(j)),y==="http://www.w3.org/1999/xhtml"?j==="script"?(y=Re.createElement("div"),y.innerHTML="<script><\/script>
40",y=y.removeChild(y.firstChild)):typeof q.is=="string"?y=Re.createElement(j,{is:q.is}):(y=Re.createElement(j),j==="select"&&(Re=y,q.multiple?Re.multiple=!0:q.size&&(Re.size=q.size))):y=Re.createElementNS(y,j),y[Jo]=E,y[Kl]=q,hH(y,E,!1,!1),E.stateNode=y;e:{switch(Re=Mt(j,q),j){case"dialog":_s("cancel",y),_s("close",y),Q=q;break;case"iframe":case"object":case"embed":_s("load",y),Q=q;break;case"video":case"audio":for(Q=0;Q<Bc.length;Q++)_s(Bc[Q],y);Q=q;break;case"source":_s("error",y),Q=q;break;case"img":case"image":case"link":_s("error",y),_s("load",y),Q=q;break;case"details":_s("toggle",y),Q=q;break;case"input":St(y,q),Q=dt(y,q),_s("invalid",y);break;case"option":Q=q;break;case"select":y._wrapperState={wasMultiple:!!q.multiple},Q=Z({},q,{value:void 0}),_s("invalid",y);break;case"textarea":Se(y,q),Q=Ce(y,q),_s("invalid",y);break;default:Q=q}Ft(j,Q),rt=Q;for(se in rt)if(rt.hasOwnProperty(se)){var gt=rt[se];se==="style"?lt(y,gt):se==="dangerouslySetInnerHTML"?(gt=gt?gt.__html:void 0,gt!=null&&Ne(y,gt)):se==="children"?typeof gt=="string"?(j!=="textarea"||gt!=="")&&ke(y,gt):typeof gt=="number"&&ke(y,""+gt):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(i.hasOwnProperty(se)?gt!=null&&se==="onScroll"&&_s("scroll",y):gt!=null&&M(y,se,gt,Re))}switch(j){case"input":yt(y),Ze(y,q,!1);break;case"textarea":yt(y),pt(y);break;case"option":q.value!=null&&y.setAttribute("value",""+we(q.value));break;case"select":y.multiple=!!q.multiple,se=q.value,se!=null?At(y,!!q.multiple,se,!1):q.defaultValue!=null&&At(y,!!q.multiple,q.defaultValue,!0);break;default:typeof Q.onClick=="function"&&(y.onclick=am)}switch(j){case"button":case"input":case"select":case"textarea":q=!!q.autoFocus;break e;case"img":q=!0;break e;default:q=!1}}q&&(E.flags|=4)}E.ref!==null&&(E.flags|=512,E.flags|=2097152)}return Jl(E),null;case 6:if(y&&E.stateNode!=null)pH(y,E,y.memoizedProps,q);else{if(typeof q!="string"&&E.stateNode===null)throw Error(t(166));
vendor: 24,966 bytes, line 40
40if(j=gx(Y_.current),gx(Sp.current),Lr(E)){if(q=E.stateNode,j=E.memoizedProps,q[Jo]=E,(se=q.nodeValue!==j)&&(y=ht,y!==null))switch(y.tag){case 3:ff(q.nodeValue,j,(y.mode&1)!==0);break;case 5:y.memoizedProps.suppressHydrationWarning!==!0&&ff(q.nodeValue,j,(y.mode&1)!==0)}se&&(E.flags|=4)}else q=(j.nodeType===9?j:j.ownerDocument).createTextNode(q),q[Jo]=E,E.stateNode=q}return Jl(E),null;case 13:if(Wt(ka),q=E.memoizedState,y===null||y.memoizedState!==null&&y.memoizedState.dehydrated!==null){if(Et&&Xt!==null&&(E.mode&1)!==0&&(E.flags&128)===0)Br(),Vr(),E.flags|=98560,se=!1;else if(se=Lr(E),q!==null&&q.dehydrated!==null){if(y===null){if(!se)throw Error(t(318));if(se=E.memoizedState,se=se!==null?se.dehydrated:null,!se)throw Error(t(317));se[Jo]=E}else Vr(),(E.flags&128)===0&&(E.memoizedState=null),E.flags|=4;Jl(E),se=!1}else Zt!==null&&(u7(Zt),Zt=null),se=!0;if(!se)return E.flags&65536?E:null}return(E.flags&128)!==0?(E.lanes=j,E):(q=q!==null,q!==(y!==null&&y.memoizedState!==null)&&q&&(E.child.flags|=8192,(E.mode&1)!==0&&(y===null||(ka.current&1)!==0?Io===0&&(Io=3):f7())),E.updateQueue!==null&&(E.flags|=4),Jl(E),null);case 4:return Gy(),JP(y,E),y===null&&fd(E.stateNode.containerInfo),Jl(E),null;case 10:return CP(E.type._context),Jl(E),null;case 17:return En(E.type)&&v(),Jl(E),null;case 19:if(Wt(ka),se=E.memoizedState,se===null)return Jl(E),null;if(q=(E.flags&128)!==0,Re=se.rendering,Re===null)if(q)e3(se,!1);else{if(Io!==0||y!==null&&(y.flags&128)!==0)for(y=E.child;y!==null;){if(Re=nE(y),Re!==null){for(E.flags|=128,e3(se,!1),q=Re.updateQueue,q!==null&&(E.updateQueue=q,E.flags|=4),E.subtreeFlags=0,q=j,j=E.child;j!==null;)se=j,y=q,se.flags&=14680066,Re=se.alternate,Re===null?(se.childLanes=0,se.lanes=y,se.child=null,se.subtreeFlags=0,se.memoizedProps=null,se.memoizedState=null,se.updateQueue=null,se.dependencies=null,se.stateNode=null):(se.childLanes=Re.childLanes,se.lanes=Re.lanes,se.child=Re.child,se.subtreeFlags=0,se.deletions=null,se.memoizedProps=Re.memoizedProps,se.memoizedState=Re.memoizedState,se.updateQueue=Re.updateQueue,se.type=Re.type,y=Re.dependencies,se.dependencies=y===null?null:{lanes:y.lanes,firstContext:y.firstContext}),j=j.sibling;return hn(ka,ka.current&1|2),E.child}y=y.sibling}se.tail!==null&&vr()>Wy&&(E.flags|=128,q=!0,e3(se,!1),E.lanes=4194304)}else{if(!q)if(y=nE(Re),y!==null){if(E.flags|=128,q=!0,j=y.updateQueue,j!==null&&(E.updateQueue=j,E.flags|=4),e3(se,!0),se.tail===null&&se.tailMode==="hidden"&&!Re.alternate&&!Et)return Jl(E),null}else 2*vr()-se.renderingStartTime>Wy&&j!==1073741824&&(E.flags|=128,q=!0,e3(se,!1),E.lanes=4194304);se.isBackwards?(Re.sibling=E.child,E.child=Re):(j=se.last,j!==null?j.sibling=Re:E.child=Re,se.last=Re)}return se.tail!==null?(E=se.tail,se.rendering=E,se.tail=E.sibling,se.renderingStartTime=vr(),E.sibling=null,j=ka.current,hn(ka,q?j&1|2:j&1),E):(Jl(E),null);case 22:case 23:return h7(),q=E.memoizedState!==null,y!==null&&y.memoizedState!==null!==q&&(E.flags|=8192),q&&(E.mode&1)!==0?(xd&1073741824)!==0&&(Jl(E),E.subtreeFlags&6&&(E.flags|=8192)):Jl(E),null;case 24:return null;case 25:return null}throw Error(t(156,E.tag))}function Ixe(y,E){switch(Tt(E),E.tag){case 1:return En(E.type)&&v(),y=E.flags,y&65536?(E.flags=y&-65537|128,E):null;case 3:return Gy(),Wt(xn),Wt(Yn),OP(),y=E.flags,(y&65536)!==0&&(y&128)===0?(E.flags=y&-65537|128,E):null;case 5:return PP(E),null;case 13:if(Wt(ka),y=E.memoizedState,y!==null&&y.dehydrated!==null){if(E.alternate===null)throw Error(t(340));Vr()}return y=E.flags,y&65536?(E.flags=y&-65537|128,E):null;case 19:return Wt(ka),null;case 4:return Gy(),null;case 10:return CP(E.type._context),null;case 22:case 23:return h7(),null;case 24:return null;default:return null}}var dE=!1,ec=!1,Fxe=typeof WeakSet=="function"?WeakSet:Set,ar=null;function $y(y,E){var j=y.ref;if(j!==null)if(typeof j=="function")try{j(null)}catch(q){$a(y,E,q)}else j.current=null}function e7(y,E,j){try{j()}catch(q){$a(y,E,q)}}var mH=!1;function Uxe(y,E){if(md=sx,y=Ng(),Mg(y)){if("selectionStart"in y)var j={start:y.selectionStart,end:y.selectionEnd};else e:{j=(j=y.ownerDocument)&&j.defaultView||window;var q=j.getSelection&&j.getSelection();if(q&&q.rangeCount!==0){j=q.anchorNode;var Q=q.anchorOffset,se=q.focusNode;q=q.focusOffset;try{j.nodeType,se.nodeType}catch{j=null;break e}var Re=0,rt=-1,gt=-1,Vt=0,Sn=0,Mn=y,yn=null;t:for(;;){for(var Kn;Mn!==j||Q!==0&&Mn.nodeType!==3||(rt=Re+Q),Mn!==se||q!==0&&Mn.nodeType!==3||(gt=Re+q),Mn.nodeType===3&&(Re+=Mn.nodeValue.length),(Kn=Mn.firstChild)!==null;)yn=Mn,Mn=Kn;for(;;){if(Mn===y)break t;if(yn===j&&++Vt===Q&&(rt=Re),yn===se&&++Sn===q&&(gt=Re),(Kn=Mn.nextSibling)!==null)break;Mn=yn,yn=Mn.parentNode}Mn=Kn}j=rt===-1||gt===-1?null:{start:rt,end:gt}}else j=null}j=j||{start:0,end:0}}else j=null;for(Ig={focusedElem:y,selectionRange:j},sx=!1,ar=E;ar!==null;)if(E=ar,y=E.child,(E.subtreeFlags&1028)!==0&&y!==null)y.return=E,ar=y;else for(;ar!==null;){E=ar;try{var hr=E.alternate;if((E.flags&1024)!==0)switch(E.tag){case 0:case 11:case 15:break;case 1:if(hr!==null){var fr=hr.memoizedProps,so=hr.memoizedState,Rt=E.stateNode,wt=Rt.getSnapshotBeforeUpdate(E.elementType===E.type?fr:mf(E.type,fr),so);Rt.__reactInternalSnapshotBeforeUpdate=wt}break;case 3:var Dt=E.stateNode.containerInfo;Dt.nodeType===1?Dt.textContent="":Dt.nodeType===9&&Dt.documentElement&&Dt.removeChild(Dt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Ln){$a(E,E.return,Ln)}if(y=E.sibling,y!==null){y.return=E.return,ar=y;break}ar=E.return}return hr=mH,mH=!1,hr}function t3(y,E,j){var q=E.updateQueue;if(q=q!==null?q.lastEffect:null,q!==null){var Q=q=q.next;do{if((Q.tag&y)===y){var se=Q.destroy;Q.destroy=void 0,se!==void 0&&e7(E,j,se)}Q=Q.next}while(Q!==q)}}function hE(y,E){if(E=E.updateQueue,E=E!==null?E.lastEffect:null,E!==null){var j=E=E.next;do{if((j.tag&y)===y){var q=j.create;j.destroy=q()}j=j.next}while(j!==E)}}function t7(y){var E=y.ref;if(E!==null){var j=y.stateNode;switch(y.tag){case 5:y=j;break;default:y=j}typeof E=="function"?E(y):E.current=y}}function gH(y){var E=y.alternate;E!==null&&(y.alternate=null,gH(E)),y.child=null,y.deletions=null,y.sibling=null,y.tag===5&&(E=y.stateNode,E!==null&&(delete E[Jo],delete E[Kl],delete E[as],delete E[gd],delete E[Su])),y.stateNode=null,y.return=null,y.dependencies=null,y.memoizedProps=null,y.memoizedState=null,y.pendingProps=null,y.stateNode=null,y.updateQueue=null}function AH(y){return y.tag===5||y.tag===3||y.tag===4}function xH(y){e:for(;;){for(;y.sibling===null;){if(y.return===null||AH(y.return))return null;y=y.return}for(y.sibling.return=y.return,y=y.sibling;y.tag!==5&&y.tag!==6&&y.tag!==18;){if(y.flags&2||y.child===null||y.tag===4)continue e;y.child.return=y,y=y.child}if(!(y.flags&2))return y.stateNode}}function n7(y,E,j){var q=y.tag;if(q===5||q===6)y=y.stateNode,E?j.nodeType===8?j.parentNode.insertBefore(y,E):j.insertBefore(y,E):(j.nodeType===8?(E=j.parentNode,E.insertBefore(y,j)):(E=j,E.appendChild(y)),j=j._reactRootContainer,j!=null||E.onclick!==null||(E.onclick=am));else if(q!==4&&(y=y.child,y!==null))for(n7(y,E,j),y=y.sibling;y!==null;)n7(y,E,j),y=y.sibling}function r7(y,E,j){var q=y.tag;if(q===5||q===6)y=y.stateNode,E?j.insertBefore(y,E):j.appendChild(y);else if(q!==4&&(y=y.child,y!==null))for(r7(y,E,j),y=y.sibling;y!==null;)r7(y,E,j),y=y.sibling}var Sl=null,gf=!1;function Bg(y,E,j){for(j=j.child;j!==null;)vH(y,E,j),j=j.sibling}function vH(y,E,j){if(vn&&typeof vn.onCommitFiberUnmount=="function")try{vn.onCommitFiberUnmount(vt,j)}catch{}switch(j.tag){case 5:ec||$y(j,E);case 6:var q=Sl,Q=gf;Sl=null,Bg(y,E,j),Sl=q,gf=Q,Sl!==null&&(gf?(y=Sl,j=j.stateNode,y.nodeType===8?y.parentNode.removeChild(j):y.removeChild(j)):Sl.removeChild(j.stateNode));break;case 18:Sl!==null&&(gf?(y=Sl,j=j.stateNode,y.nodeType===8?pf(y.parentNode,j):y.nodeType===1&&pf(y,j),sd(y)):pf(Sl,j.stateNode));break;case 4:q=Sl,Q=gf,Sl=j.stateNode.containerInfo,gf=!0,Bg(y,E,j),Sl=q,gf=Q;break;case 0:case 11:case 14:case 15:if(!ec&&(q=j.updateQueue,q!==null&&(q=q.lastEffect,q!==null))){Q=q=q.next;do{var se=Q,Re=se.destroy;se=se.tag,Re!==void 0&&((se&2)!==0||(se&4)!==0)&&e7(j,E,Re),Q=Q.next}while(Q!==q)}Bg(y,E,j);break;case 1:if(!ec&&($y(j,E),q=j.stateNode,typeof q.componentWillUnmount=="function"))try{q.props=j.memoizedProps,q.state=j.memoizedState,q.componentWillUnmount()}catch(rt){$a(j,E,rt)}Bg(y,E,j);break;case 21:Bg(y,E,j);break;case 22:j.mode&1?(ec=(q=ec)||j.memoizedState!==null,Bg(y,E,j),ec=q):Bg(y,E,j);break;default:Bg(y,E,j)}}function yH(y){var E=y.updateQueue;if(E!==null){y.updateQueue=null;var j=y.stateNode;j===null&&(j=y.stateNode=new Fxe),E.forEach(function(q){var Q=Xxe.bind(null,y,q);j.has(q)||(j.add(q),q.then(Q,Q))})}}function Af(y,E){var j=E.deletions;if(j!==null)for(var q=0;q<j.length;q++){var Q=j[q];try{var se=y,Re=E,rt=Re;e:for(;rt!==null;){switch(rt.tag){case 5:Sl=rt.stateNode,gf=!1;break e;case 3:Sl=rt.stateNode.containerInfo,gf=!0;break e;case 4:Sl=rt.stateNode.containerInfo,gf=!0;break e}rt=rt.return}if(Sl===null)throw Error(t(160));vH(se,Re,Q),Sl=null,gf=!1;var gt=Q.alternate;gt!==null&&(gt.return=null),Q.return=null}catch(Vt){$a(Q,E,Vt)}}if(E.subtreeFlags&12854)for(E=E.child;E!==null;)bH(E,y),E=E.sibling}function bH(y,E){var j=y.alternate,q=y.flags;switch(y.tag){case 0:case 11:case 14:case 15:if(Af(E,y),Ep(y),q&4){try{t3(3,y,y.return),hE(3,y)}catch(fr){$a(y,y.return,fr)}try{t3(5,y,y.return)}catch(fr){$a(y,y.return,fr)}}break;case 1:Af(E,y),Ep(y),q&512&&j!==null&&$y(j,j.return);break;case 5:if(Af(E,y),Ep(y),q&512&&j!==null&&$y(j,j.return),y.flags&32){var Q=y.stateNode;try{ke(Q,"")}catch(fr){$a(y,y.return,fr)}}if(q&4&&(Q=y.stateNode,Q!=null)){var se=y.memoizedProps,Re=j!==null?j.memoizedProps:se,rt=y.type,gt=y.updateQueue;if(y.updateQueue=null,gt!==null)try{rt==="input"&&se.type==="radio"&&se.name!=null&&kt(Q,se),Mt(rt,Re);var Vt=Mt(rt,se);for(Re=0;Re<gt.length;Re+=2){var Sn=gt[Re],Mn=gt[Re+1];Sn==="style"?lt(Q,Mn):Sn==="dangerouslySetInnerHTML"?Ne(Q,Mn):Sn==="children"?ke(Q,Mn):M(Q,Sn,Mn,Vt)}switch(rt){case"input":Fe(Q,se);break;case"textarea":qe(Q,se);break;case"select":var yn=Q._wrapperState.wasMultiple;Q._wrapperState.wasMultiple=!!se.multiple;var Kn=se.value;Kn!=null?At(Q,!!se.multiple,Kn,!1):yn!==!!se.multiple&&(se.defaultValue!=null?At(Q,!!se.multiple,se.defaultValue,!0):At(Q,!!se.multiple,se.multiple?[]:"",!1))}Q[Kl]=se}catch(fr){$a(y,y.return,fr)}}break;case 6:if(Af(E,y),Ep(y),q&4){if(y.stateNode===null)throw Error(t(162));Q=y.stateNode,se=y.memoizedProps;try{Q.nodeValue=se}catch(fr){$a(y,y.return,fr)}}break;case 3:if(Af(E,y),Ep(y),q&4&&j!==null&&j.memoizedState.isDehydrated)try{sd(E.containerInfo)}catch(fr){$a(y,y.return,fr)}break;case 4:Af(E,y),Ep(y);break;case 13:Af(E,y),Ep(y),Q=y.child,Q.flags&8192&&(se=Q.memoizedState!==null,Q.stateNode.isHidden=se,!se||Q.alternate!==null&&Q.alternate.memoizedState!==null||(a7=vr())),q&4&&yH(y);break;case 22:if(Sn=j!==null&&j.memoizedState!==null,y.mode&1?(ec=(Vt=ec)||Sn,Af(E,y),ec=Vt):Af(E,y),Ep(y),q&8192){if(Vt=y.memoizedState!==null,(y.stateNode.isHidden=Vt)&&!Sn&&(y.mode&1)!==0)for(ar=y,Sn=y.child;Sn!==null;){for(Mn=ar=Sn;ar!==null;){switch(yn=ar,Kn=yn.child,yn.tag){case 0:case 11:case 14:case 15:t3(4,yn,yn.return);break;case 1:$y(yn,yn.return);var hr=yn.stateNode;if(typeof hr.componentWillUnmount=="function"){q=yn,j=yn.return;try{E=q,hr.props=E.memoizedProps,hr.state=E.memoizedState,hr.componentWillUnmount()}catch(fr){$a(q,j,fr)}}break;case 5:$y(yn,yn.return);break;case 22:if(yn.memoizedState!==null){SH(Mn);continue}}Kn!==null?(Kn.return=yn,ar=Kn):SH(Mn)}Sn=Sn.sibling}e:for(Sn=null,Mn=y;;){if(Mn.tag===5){if(Sn===null){Sn=Mn;try{Q=Mn.stateNode,Vt?(se=Q.style,typeof se.setProperty=="function"?se.setProperty("display","none","important"):se.display="none"):(rt=Mn.stateNode,gt=Mn.memoizedProps.style,Re=gt!=null&>.hasOwnProperty("display")?gt.display:null,rt.style.display=Qe("display",Re))}catch(fr){$a(y,y.return,fr)}}}else if(Mn.tag===6){if(Sn===null)try{Mn.stateNode.nodeValue=Vt?"":Mn.memoizedProps}catch(fr){$a(y,y.return,fr)}}else if((Mn.tag!==22&&Mn.tag!==23||Mn.memoizedState===null||Mn===y)&&Mn.child!==null){Mn.child.return=Mn,Mn=Mn.child;continue}if(Mn===y)break e;for(;Mn.sibling===null;){if(Mn.return===null||Mn.return===y)break e;Sn===Mn&&(Sn=null),Mn=Mn.return}Sn===Mn&&(Sn=null),Mn.sibling.return=Mn.return,Mn=Mn.sibling}}break;case 19:Af(E,y),Ep(y),q&4&&yH(y);break;case 21:break;default:Af(E,y),Ep(y)}}function Ep(y){var E=y.flags;if(E&2){try{e:{for(var j=y.return;j!==null;){if(AH(j)){var q=j;break e}j=j.return}throw Error(t(160))}switch(q.tag){case 5:var Q=q.stateNode;q.flags&32&&(ke(Q,""),q.flags&=-33);var se=xH(y);r7(y,se,Q);break;case 3:case 4:var Re=q.stateNode.containerInfo,rt=xH(y);n7(y,rt,Re);break;default:throw Error(t(161))}}catch(gt){$a(y,y.return,gt)}y.flags&=-3}E&4096&&(y.flags&=-4097)}function Bxe(y,E,j){ar=y,wH(y)}function wH(y,E,j){for(var q=(y.mode&1)!==0;ar!==null;){var Q=ar,se=Q.child;if(Q.tag===22&&q){var Re=Q.memoizedState!==null||dE;if(!Re){var rt=Q.alternate,gt=rt!==null&&rt.memoizedState!==null||ec;rt=dE;var Vt=ec;if(dE=Re,(ec=gt)&&!Vt)for(ar=Q;ar!==null;)Re=ar,gt=Re.child,Re.tag===22&&Re.memoizedState!==null?TH(Q):gt!==null?(gt.return=Re,ar=gt):TH(Q);for(;se!==null;)ar=se,wH(se),se=se.sibling;ar=Q,dE=rt,ec=Vt}_H(y)}else(Q.subtreeFlags&8772)!==0&&se!==null?(se.return=Q,ar=se):_H(y)}}function _H(y){for(;ar!==null;){var E=ar;if((E.flags&8772)!==0){var j=E.alternate;try{if((E.flags&8772)!==0)switch(E.tag){case 0:case 11:case 15:ec||hE(5,E);break;case 1:var q=E.stateNode;if(E.flags&4&&!ec)if(j===null)q.componentDidMount();else{var Q=E.elementType===E.type?j.memoizedProps:mf(E.type,j.memoizedProps);q.componentDidUpdate(Q,j.memoizedState,q.__reactInternalSnapshotBeforeUpdate)}var se=E.updateQueue;se!==null&&S$(E,se,q);break;case 3:var Re=E.updateQueue;if(Re!==null){if(j=null,E.child!==null)switch(E.child.tag){case 5:j=E.child.stateNode;break;case 1:j=E.child.stateNode}S$(E,Re,j)}break;case 5:var rt=E.stateNode;if(j===null&&E.flags&4){j=rt;var gt=E.memoizedProps;switch(E.type){case"button":case"input":case"select":case"textarea":gt.autoFocus&&j.focus();break;case"img":gt.src&&(j.src=gt.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(E.memoizedState===null){var Vt=E.alternate;if(Vt!==null){var Sn=Vt.memoizedState;if(Sn!==null){var Mn=Sn.dehydrated;Mn!==null&&sd(Mn)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}ec||E.flags&512&&t7(E)}catch(yn){$a(E,E.return,yn)}}if(E===y){ar=null;break}if(j=E.sibling,j!==null){j.return=E.return,ar=j;break}ar=E.return}}function SH(y){for(;ar!==null;){var E=ar;if(E===y){ar=null;break}var j=E.sibling;if(j!==null){j.return=E.return,ar=j;break}ar=E.return}}function TH(y){for(;ar!==null;){var E=ar;try{switch(E.tag){case 0:case 11:case 15:var j=E.return;try{hE(4,E)}catch(gt){$a(E,j,gt)}break;case 1:var q=E.stateNode;if(typeof q.componentDidMount=="function"){var Q=E.return;try{q.componentDidMount()}catch(gt){$a(E,Q,gt)}}var se=E.return;try{t7(E)}catch(gt){$a(E,se,gt)}break;case 5:var Re=E.return;try{t7(E)}catch(gt){$a(E,Re,gt)}}}catch(gt){$a(E,E.return,gt)}if(E===y){ar=null;break}var rt=E.sibling;if(rt!==null){rt.return=E.return,ar=rt;break}ar=E.return}}var Vxe=Math.ceil,fE=T.ReactCurrentDispatcher,i7=T.ReactCurrentOwner,xh=T.ReactCurrentBatchConfig,Ki=0,tl=null,vo=null,Tl=0,xd=0,Hy=zt(0),Io=0,n3=null,xx=0,pE=0,s7=0,r3=null,Cu=null,a7=0,Wy=1/0,um=null,mE=!1,o7=null,Vg=null,gE=!1,zg=null,AE=0,i3=0,l7=null,xE=-1,vE=0;function Gc(){return(Ki&6)!==0?vr():xE!==-1?xE:xE=vr()}function Gg(y){return(y.mode&1)===0?1:(Ki&2)!==0&&Tl!==0?Tl&-Tl:Is.transition!==null?(vE===0&&(vE=Gn()),vE):(y=ai,y!==0||(y=window.event,y=y===void 0?16:jy(y.type)),y)}function xf(y,E,j,q){if(50<i3)throw i3=0,l7=null,Error(t(185));yr(y,j,q),((Ki&2)===0||y!==tl)&&(y===tl&&((Ki&2)===0&&(pE|=j),Io===4&&qg(y,Tl)),Nu(y,q),j===1&&Ki===0&&(E.mode&1)===0&&(Wy=vr()+500,R&&K()))}function Nu(y,E){var j=y.callbackNode;qi(y,E);var q=Oi(y,y===tl?Tl:0);if(q===0)j!==null&&Ir(j),y.callbackNode=null,y.callbackPriority=0;else if(E=q&-q,y.callbackPriority!==E){if(j!=null&&Ir(j),E===1)y.tag===0?$(CH.bind(null,y)):V(CH.bind(null,y)),$_(function(){(Ki&6)===0&&K()}),j=null;else{switch(Rc(q)){case 1:j=Vi;break;case 4:j=Pe;break;case 16:j=He;break;case 536870912:j=at;break;default:j=He}j=DH(j,EH.bind(null,y))}y.callbackPriority=E,y.callbackNode=j}}function EH(y,E){if(xE=-1,vE=0,(Ki&6)!==0)throw Error(t(327));var j=y.callbackNode;if(Xy()&&y.callbackNode!==j)return null;var q=Oi(y,y===tl?Tl:0);if(q===0)return null;if((q&30)!==0||(q&y.expiredLanes)!==0||E)E=yE(y,q);else{E=q;var Q=Ki;Ki|=2;var se=MH();(tl!==y||Tl!==E)&&(um=null,Wy=vr()+500,yx(y,E));do try{qxe();break}catch(rt){NH(y,rt)}while(!0);EP(),fE.current=se,Ki=Q,vo!==null?E=0:(tl=null,Tl=0,E=Io)}if(E!==0){if(E===2&&(Q=aa(y),Q!==0&&(q=Q,E=c7(y,Q))),E===1)throw j=n3,yx(y,0),qg(y,q),Nu(y,vr()),j;if(E===6)qg(y,q);else{if(Q=y.current.alternate,(q&30)===0&&!zxe(Q)&&(E=yE(y,q),E===2&&(se=aa(y),se!==0&&(q=se,E=c7(y,se))),E===1))throw j=n3,yx(y,0),qg(y,q),Nu(y,vr()),j;switch(y.finishedWork=Q,y.finishedLanes=q,E){case 0:case 1:throw Error(t(345));case 2:bx(y,Cu,um);break;case 3:if(qg(y,q),(q&130023424)===q&&(E=a7+500-vr(),10<E)){if(Oi(y,0)!==0)break;if(Q=y.suspendedLanes,(Q&q)!==q){Gc(),y.pingedLanes|=y.suspendedLanes&Q;break}y.timeoutHandle=hs(bx.bind(null,y,Cu,um),E);break}bx(y,Cu,um);break;case 4:if(qg(y,q),(q&4194240)===q)break;for(E=y.eventTimes,Q=-1;0<q;){var Re=31-ln(q);se=1<<Re,Re=E[Re],Re>Q&&(Q=Re),q&=~se}if(q=Q,q=vr()-q,q=(120>q?120:480>q?480:1080>q?1080:1920>q?1920:3e3>q?3e3:4320>q?4320:1960*Vxe(q/1960))-q,10<q){y.timeoutHandle=hs(bx.bind(null,y,Cu,um),q);break}bx(y,Cu,um);break;case 5:bx(y,Cu,um);break;default:throw Error(t(329))}}}return Nu(y,vr()),y.callbackNode===j?EH.bind(null,y):null}function c7(y,E){var j=r3;return y.current.memoizedState.isDehydrated&&(yx(y,E).flags|=256),y=yE(y,E),y!==2&&(E=Cu,Cu=j,E!==null&&u7(E)),y}function u7(y){Cu===null?Cu=y:Cu.push.apply(Cu,y)}function zxe(y){for(var E=y;;){if(E.flags&16384){var j=E.updateQueue;if(j!==null&&(j=j.stores,j!==null))for(var q=0;q<j.length;q++){var Q=j[q],se=Q.getSnapshot;Q=Q.value;try{if(!Fc(se(),Q))return!1}catch{return!1}}}if(j=E.child,E.subtreeFlags&16384&&j!==null)j.return=E,E=j;else{if(E===y)break;for(;E.sibling===null;){if(E.return===null||E.return===y)return!0;E=E.return}E.sibling.return=E.return,E=E.sibling}}return!0}function qg(y,E){for(E&=~s7,E&=~pE,y.suspendedLanes|=E,y.pingedLanes&=~E,y=y.expirationTimes;0<E;){var j=31-ln(E),q=1<<j;y[j]=-1,E&=~q}}function CH(y){if((Ki&6)!==0)throw Error(t(327));Xy();var E=Oi(y,0);if((E&1)===0)return Nu(y,vr()),null;var j=yE(y,E);if(y.tag!==0&&j===2){var q=aa(y);q!==0&&(E=q,j=c7(y,q))}if(j===1)throw j=n3,yx(y,0),qg(y,E),Nu(y,vr()),j;if(j===6)throw Error(t(345));return y.finishedWork=y.current.alternate,y.finishedLanes=E,bx(y,Cu,um),Nu(y,vr()),null}function d7(y,E){var j=Ki;Ki|=1;try{return y(E)}finally{Ki=j,Ki===0&&(Wy=vr()+500,R&&K())}}function vx(y){zg!==null&&zg.tag===0&&(Ki&6)===0&&Xy();var E=Ki;Ki|=1;var j=xh.transition,q=ai;try{if(xh.transition=null,ai=1,y)return y()}finally{ai=q,xh.transition=j,Ki=E,(Ki&6)===0&&K()}}function h7(){xd=Hy.current,Wt(Hy)}function yx(y,E){y.finishedWork=null,y.finishedLanes=0;var j=y.timeoutHandle;if(j!==-1&&(y.timeoutHandle=-1,Nn(j)),vo!==null)for(j=vo.return;j!==null;){var q=j;switch(Tt(q),q.tag){case 1:q=q.type.childContextTypes,q!=null&&v();break;case 3:Gy(),Wt(xn),Wt(Yn),OP();break;case 5:PP(q);break;case 4:Gy();break;case 13:Wt(ka);break;case 19:Wt(ka);break;case 10:CP(q.type._context);break;case 22:case 23:h7()}j=j.return}if(tl=y,vo=y=$g(y.current,null),Tl=xd=E,Io=0,n3=null,s7=pE=xx=0,Cu=r3=null,mx!==null){for(E=0;E<mx.length;E++)if(j=mx[E],q=j.interleaved,q!==null){j.interleaved=null;var Q=q.next,se=j.pending;if(se!==null){var Re=se.next;se.next=Q,q.next=Re}j.pending=q}mx=null}return y}function NH(y,E){do{var j=vo;try{if(EP(),rE.current=oE,iE){for(var q=Ra.memoizedState;q!==null;){var Q=q.queue;Q!==null&&(Q.pending=null),q=q.next}iE=!1}if(Ax=0,el=jo=Ra=null,Q_=!1,K_=0,i7.current=null,j===null||j.return===null){Io=1,n3=E,vo=null;break}e:{var se=y,Re=j.return,rt=j,gt=E;if(E=Tl,rt.flags|=32768,gt!==null&&typeof gt=="object"&&typeof gt.then=="function"){var Vt=gt,Sn=rt,Mn=Sn.tag;if((Sn.mode&1)===0&&(Mn===0||Mn===11||Mn===15)){var yn=Sn.alternate;yn?(Sn.updateQueue=yn.updateQueue,Sn.memoizedState=yn.memoizedState,Sn.lanes=yn.lanes):(Sn.updateQueue=null,Sn.memoizedState=null)}var Kn=J$(Re);if(Kn!==null){Kn.flags&=-257,eH(Kn,Re,rt,se,E),Kn.mode&1&&Z$(se,Vt,E),E=Kn,gt=Vt;var hr=E.updateQueue;if(hr===null){var fr=new Set;fr.add(gt),E.updateQueue=fr}else hr.add(gt);break e}else{if((E&1)===0){Z$(se,Vt,E),f7();break e}gt=Error(t(426))}}else if(Et&&rt.mode&1){var so=J$(Re);if(so!==null){(so.flags&65536)===0&&(so.flags|=256),eH(so,Re,rt,se,E),ji(qy(gt,rt));break e}}se=gt=qy(gt,rt),Io!==4&&(Io=2),r3===null?r3=[se]:r3.push(se),se=Re;do{switch(se.tag){case 3:se.flags|=65536,E&=-E,se.lanes|=E;var Rt=Q$(se,gt,E);_$(se,Rt);break e;case 1:rt=gt;var wt=se.type,Dt=se.stateNode;if((se.flags&128)===0&&(typeof wt.getDerivedStateFromError=="function"||Dt!==null&&typeof Dt.componentDidCatch=="function"&&(Vg===null||!Vg.has(Dt)))){se.flags|=65536,E&=-E,se.lanes|=E;var Ln=K$(se,rt,E);_$(se,Ln);break e}}se=se.return}while(se!==null)}RH(j)}catch(br){E=br,vo===j&&j!==null&&(vo=j=j.return);continue}break}while(!0)}function MH(){var y=fE.current;return fE.current=oE,y===null?oE:y}function f7(){(Io===0||Io===3||Io===2)&&(Io=4),tl===null||(xx&268435455)===0&&(pE&268435455)===0||qg(tl,Tl)}function yE(y,E){var j=Ki;Ki|=2;var q=MH();(tl!==y||Tl!==E)&&(um=null,yx(y,E));do try{Gxe();break}catch(Q){NH(y,Q)}while(!0);if(EP(),Ki=j,fE.current=q,vo!==null)throw Error(t(261));return tl=null,Tl=0,Io}function Gxe(){for(;vo!==null;)kH(vo)}function qxe(){for(;vo!==null&&!is();)kH(vo)}function kH(y){var E=OH(y.alternate,y,xd);y.memoizedProps=y.pendingProps,E===null?RH(y):vo=E,i7.current=null}function RH(y){var E=y;do{var j=E.alternate;if(y=E.return,(E.flags&32768)===0){if(j=jxe(j,E,xd),j!==null){vo=j;return}}else{if(j=Ixe(j,E),j!==null){j.flags&=32767,vo=j;return}if(y!==null)y.flags|=32768,y.subtreeFlags=0,y.deletions=null;else{Io=6,vo=null;return}}if(E=E.sibling,E!==null){vo=E;return}vo=E=y}while(E!==null);Io===0&&(Io=5)}function bx(y,E,j){var q=ai,Q=xh.transition;try{xh.transition=null,ai=1,$xe(y,E,j,q)}finally{xh.transition=Q,ai=q}return null}function $xe(y,E,j,q){do Xy();while(zg!==null);if((Ki&6)!==0)throw Error(t(327));j=y.finishedWork;var Q=y.finishedLanes;if(j===null)return null;if(y.finishedWork=null,y.finishedLanes=0,j===y.current)throw Error(t(177));y.callbackNode=null,y.callbackPriority=0;var se=j.lanes|j.childLanes;if(vl(y,se),y===tl&&(vo=tl=null,Tl=0),(j.subtreeFlags&2064)===0&&(j.flags&2064)===0||gE||(gE=!0,DH(He,function(){return Xy(),null})),se=(j.flags&15990)!==0,(j.subtreeFlags&15990)!==0||se){se=xh.transition,xh.transition=null;var Re=ai;ai=1;var rt=Ki;Ki|=4,i7.current=null,Uxe(y,j),bH(j,y),ZT(Ig),sx=!!md,Ig=md=null,y.current=j,Bxe(j),si(),Ki=rt,ai=Re,xh.transition=se}else y.current=j;if(gE&&(gE=!1,zg=y,AE=Q),se=y.pendingLanes,se===0&&(Vg=null),Rn(j.stateNode),Nu(y,vr()),E!==null)for(q=y.onRecoverableError,j=0;j<E.length;j++)Q=E[j],q(Q.value,{componentStack:Q.stack,digest:Q.digest});if(mE)throw mE=!1,y=o7,o7=null,y;return(AE&1)!==0&&y.tag!==0&&Xy(),se=y.pendingLanes,(se&1)!==0?y===l7?i3++:(i3=0,l7=y):i3=0,K(),null}function Xy(){if(zg!==null){var y=Rc(AE),E=xh.transition,j=ai;try{if(xh.transition=null,ai=16>y?16:y,zg===null)var q=!1;else{if(y=zg,zg=null,AE=0,(Ki&6)!==0)throw Error(t(331));var Q=Ki;for(Ki|=4,ar=y.current;ar!==null;){var se=ar,Re=se.child;if((ar.flags&16)!==0){var rt=se.deletions;if(rt!==null){for(var gt=0;gt<rt.length;gt++){var Vt=rt[gt];for(ar=Vt;ar!==null;){var Sn=ar;switch(Sn.tag){case 0:case 11:case 15:t3(8,Sn,se)}var Mn=Sn.child;if(Mn!==null)Mn.return=Sn,ar=Mn;else for(;ar!==null;){Sn=ar;var yn=Sn.sibling,Kn=Sn.return;if(gH(Sn),Sn===Vt){ar=null;break}if(yn!==null){yn.return=Kn,ar=yn;break}ar=Kn}}}var hr=se.alternate;if(hr!==null){var fr=hr.child;if(fr!==null){hr.child=null;do{var so=fr.sibling;fr.sibling=null,fr=so}while(fr!==null)}}ar=se}}if((se.subtreeFlags&2064)!==0&&Re!==null)Re.return=se,ar=Re;else e:for(;ar!==null;){if(se=ar,(se.flags&2048)!==0)switch(se.tag){case 0:case 11:case 15:t3(9,se,se.return)}var Rt=se.sibling;if(Rt!==null){Rt.return=se.return,ar=Rt;break e}ar=se.return}}var wt=y.current;for(ar=wt;ar!==null;){Re=ar;var Dt=Re.child;if((Re.subtreeFlags&2064)!==0&&Dt!==null)Dt.return=Re,ar=Dt;else e:for(Re=wt;ar!==null;){if(rt=ar,(rt.flags&2048)!==0)try{switch(rt.tag){case 0:case 11:case 15:hE(9,rt)}}catch(br){$a(rt,rt.return,br)}if(rt===Re){ar=null;break e}var Ln=rt.sibling;if(Ln!==null){Ln.return=rt.return,ar=Ln;break e}ar=rt.return}}if(Ki=Q,K(),vn&&typeof vn.onPostCommitFiberRoot=="function")try{vn.onPostCommitFiberRoot(vt,y)}catch{}q=!0}return q}finally{ai=j,xh.transition=E}}return!1}
vendor: 4,615 bytes, line 40
40function PH(y,E,j){E=qy(j,E),E=Q$(y,E,1),y=Ug(y,E,1),E=Gc(),y!==null&&(yr(y,1,E),Nu(y,E))}function $a(y,E,j){if(y.tag===3)PH(y,y,j);else for(;E!==null;){if(E.tag===3){PH(E,y,j);break}else if(E.tag===1){var q=E.stateNode;if(typeof E.type.getDerivedStateFromError=="function"||typeof q.componentDidCatch=="function"&&(Vg===null||!Vg.has(q))){y=qy(j,y),y=K$(E,y,1),E=Ug(E,y,1),y=Gc(),E!==null&&(yr(E,1,y),Nu(E,y));break}}E=E.return}}function Hxe(y,E,j){var q=y.pingCache;q!==null&&q.delete(E),E=Gc(),y.pingedLanes|=y.suspendedLanes&j,tl===y&&(Tl&j)===j&&(Io===4||Io===3&&(Tl&130023424)===Tl&&500>vr()-a7?yx(y,0):s7|=j),Nu(y,E)}function LH(y,E){E===0&&((y.mode&1)===0?E=1:(E=sr,sr<<=1,(sr&130023424)===0&&(sr=4194304)));var j=Gc();y=om(y,E),y!==null&&(yr(y,E,j),Nu(y,j))}function Wxe(y){var E=y.memoizedState,j=0;E!==null&&(j=E.retryLane),LH(y,j)}function Xxe(y,E){var j=0;switch(y.tag){case 13:var q=y.stateNode,Q=y.memoizedState;Q!==null&&(j=Q.retryLane);break;case 19:q=y.stateNode;break;default:throw Error(t(314))}q!==null&&q.delete(E),LH(y,j)}var OH;OH=function(y,E,j){if(y!==null)if(y.memoizedProps!==E.pendingProps||xn.current)Eu=!0;else{if((y.lanes&j)===0&&(E.flags&128)===0)return Eu=!1,Dxe(y,E,j);Eu=(y.flags&131072)!==0}else Eu=!1,Et&&(E.flags&1048576)!==0&&Ot(E,ye,E.index);switch(E.lanes=0,E.tag){case 2:var q=E.type;uE(y,E),y=E.pendingProps;var Q=jt(E,Yn.current);zy(E,j),Q=IP(null,E,q,y,Q,j);var se=FP();return E.flags|=1,typeof Q=="object"&&Q!==null&&typeof Q.render=="function"&&Q.$$typeof===void 0?(E.tag=1,E.memoizedState=null,E.updateQueue=null,En(q)?(se=!0,N(E)):se=!1,E.memoizedState=Q.state!==null&&Q.state!==void 0?Q.state:null,kP(E),Q.updater=lE,E.stateNode=Q,Q._reactInternals=E,qP(E,q,y,j),E=XP(null,E,q,!0,se,j)):(E.tag=0,Et&&se&&$t(E),zc(null,E,Q,j),E=E.child),E;case 16:q=E.elementType;e:{switch(uE(y,E),y=E.pendingProps,Q=q._init,q=Q(q._payload),E.type=q,Q=E.tag=Qxe(q),y=mf(q,y),Q){case 0:E=WP(null,E,q,y,j);break e;case 1:E=aH(null,E,q,y,j);break e;case 11:E=tH(null,E,q,y,j);break e;case 14:E=nH(null,E,q,mf(q.type,y),j);break e}throw Error(t(306,q,""))}return E;case 0:return q=E.type,Q=E.pendingProps,Q=E.elementType===q?Q:mf(q,Q),WP(y,E,q,Q,j);case 1:return q=E.type,Q=E.pendingProps,Q=E.elementType===q?Q:mf(q,Q),aH(y,E,q,Q,j);case 3:e:{if(oH(E),y===null)throw Error(t(387));q=E.pendingProps,se=E.memoizedState,Q=se.element,w$(y,E),tE(E,q,null,j);var Re=E.memoizedState;if(q=Re.element,se.isDehydrated)if(se={element:q,isDehydrated:!1,cache:Re.cache,pendingSuspenseBoundaries:Re.pendingSuspenseBoundaries,transitions:Re.transitions},E.updateQueue.baseState=se,E.memoizedState=se,E.flags&256){Q=qy(Error(t(423)),E),E=lH(y,E,q,j,Q);break e}else if(q!==Q){Q=qy(Error(t(424)),E),E=lH(y,E,q,j,Q);break e}else for(Xt=An(E.stateNode.containerInfo.firstChild),ht=E,Et=!0,Zt=null,j=Vc(E,null,q,j),E.child=j;j;)j.flags=j.flags&-3|4096,j=j.sibling;else{if(Vr(),q===Q){E=cm(y,E,j);break e}zc(y,E,q,j)}E=E.child}return E;case 5:return T$(E),y===null&&li(E),q=E.type,Q=E.pendingProps,se=y!==null?y.memoizedProps:null,Re=Q.children,Ql(q,Q)?Re=null:se!==null&&Ql(q,se)&&(E.flags|=32),sH(y,E),zc(y,E,Re,j),E.child;case 6:return y===null&&li(E),null;case 13:return cH(y,E,j);case 4:return RP(E,E.stateNode.containerInfo),q=E.pendingProps,y===null?E.child=la(E,null,q,j):zc(y,E,q,j),E.child;case 11:return q=E.type,Q=E.pendingProps,Q=E.elementType===q?Q:mf(q,Q),tH(y,E,q,Q,j);case 7:return zc(y,E,E.pendingProps,j),E.child;case 8:return zc(y,E,E.pendingProps.children,j),E.child;case 12:return zc(y,E,E.pendingProps.children,j),E.child;case 10:e:{if(q=E.type._context,Q=E.pendingProps,se=E.memoizedProps,Re=Q.value,hn(qa,q._currentValue),q._currentValue=Re,se!==null)if(Fc(se.value,Re)){if(se.children===Q.children&&!xn.current){E=cm(y,E,j);break e}}else for(se=E.child,se!==null&&(se.return=E);se!==null;){var rt=se.dependencies;if(rt!==null){Re=se.child;for(var gt=rt.firstContext;gt!==null;){if(gt.context===q){if(se.tag===1){gt=lm(-1,j&-j),gt.tag=2;var Vt=se.updateQueue;if(Vt!==null){Vt=Vt.shared;var Sn=Vt.pending;Sn===null?gt.next=gt:(gt.next=Sn.next,Sn.next=gt),Vt.pending=gt}}se.lanes|=j,gt=se.alternate,gt!==null&&(gt.lanes|=j),NP(se.return,j,E),rt.lanes|=j;break}gt=gt.next}}else if(se.tag===10)Re=se.type===E.type?null:se.child;else if(se.tag===18){if(Re=se.return,Re===null)throw Error(t(341));Re.lanes|=j,rt=Re.alternate,rt!==null&&(rt.lanes|=j),NP(Re,j,E),Re=se.sibling}else Re=se.child;if(Re!==null)Re.return=se;else for(Re=se;Re!==null;){if(Re===E){Re=null;break}if(se=Re.sibling,se!==null){se.return=Re.return,Re=se;break}Re=Re.return}se=Re}zc(y,E,Q.children,j),E=E.child}return E;
vendor: 8,393 bytes, line 40
40case 9:return Q=E.type,q=E.pendingProps.children,zy(E,j),Q=gh(Q),q=q(Q),E.flags|=1,zc(y,E,q,j),E.child;case 14:return q=E.type,Q=mf(q,E.pendingProps),Q=mf(q.type,Q),nH(y,E,q,Q,j);case 15:return rH(y,E,E.type,E.pendingProps,j);case 17:return q=E.type,Q=E.pendingProps,Q=E.elementType===q?Q:mf(q,Q),uE(y,E),E.tag=1,En(q)?(y=!0,N(E)):y=!1,zy(E,j),X$(E,q,Q),qP(E,q,Q,j),XP(null,E,q,!0,y,j);case 19:return dH(y,E,j);case 22:return iH(y,E,j)}throw Error(t(156,E.tag))};function DH(y,E){return xr(y,E)}function Yxe(y,E,j,q){this.tag=y,this.key=j,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=q,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vh(y,E,j,q){return new Yxe(y,E,j,q)}function p7(y){return y=y.prototype,!(!y||!y.isReactComponent)}function Qxe(y){if(typeof y=="function")return p7(y)?1:0;if(y!=null){if(y=y.$$typeof,y===z)return 11;if(y===W)return 14}return 2}function $g(y,E){var j=y.alternate;return j===null?(j=vh(y.tag,E,y.key,y.mode),j.elementType=y.elementType,j.type=y.type,j.stateNode=y.stateNode,j.alternate=y,y.alternate=j):(j.pendingProps=E,j.type=y.type,j.flags=0,j.subtreeFlags=0,j.deletions=null),j.flags=y.flags&14680064,j.childLanes=y.childLanes,j.lanes=y.lanes,j.child=y.child,j.memoizedProps=y.memoizedProps,j.memoizedState=y.memoizedState,j.updateQueue=y.updateQueue,E=y.dependencies,j.dependencies=E===null?null:{lanes:E.lanes,firstContext:E.firstContext},j.sibling=y.sibling,j.index=y.index,j.ref=y.ref,j}function bE(y,E,j,q,Q,se){var Re=2;if(q=y,typeof y=="function")p7(y)&&(Re=1);else if(typeof y=="string")Re=5;else e:switch(y){case P:return wx(j.children,Q,se,E);case O:Re=8,Q|=8;break;case F:return y=vh(12,j,E,Q|2),y.elementType=F,y.lanes=se,y;case H:return y=vh(13,j,E,Q),y.elementType=H,y.lanes=se,y;case X:return y=vh(19,j,E,Q),y.elementType=X,y.lanes=se,y;case ee:return wE(j,Q,se,E);default:if(typeof y=="object"&&y!==null)switch(y.$$typeof){case U:Re=10;break e;case B:Re=9;break e;case z:Re=11;break e;case W:Re=14;break e;case J:Re=16,q=null;break e}throw Error(t(130,y==null?y:typeof y,""))}return E=vh(Re,j,E,Q),E.elementType=y,E.type=q,E.lanes=se,E}function wx(y,E,j,q){return y=vh(7,y,q,E),y.lanes=j,y}function wE(y,E,j,q){return y=vh(22,y,q,E),y.elementType=ee,y.lanes=j,y.stateNode={isHidden:!1},y}function m7(y,E,j){return y=vh(6,y,null,E),y.lanes=j,y}function g7(y,E,j){return E=vh(4,y.children!==null?y.children:[],y.key,E),E.lanes=j,E.stateNode={containerInfo:y.containerInfo,pendingChildren:null,implementation:y.implementation},E}function Kxe(y,E,j,q,Q){this.tag=E,this.containerInfo=y,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ks(0),this.expirationTimes=ks(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ks(0),this.identifierPrefix=q,this.onRecoverableError=Q,this.mutableSourceEagerHydrationData=null}function A7(y,E,j,q,Q,se,Re,rt,gt){return y=new Kxe(y,E,j,rt,gt),E===1?(E=1,se===!0&&(E|=8)):E=0,se=vh(3,null,null,E),y.current=se,se.stateNode=y,se.memoizedState={element:q,isDehydrated:j,cache:null,transitions:null,pendingSuspenseBoundaries:null},kP(se),y}function Zxe(y,E,j){var q=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:q==null?null:""+q,children:y,containerInfo:E,implementation:j}}function jH(y){if(!y)return qn;y=y._reactInternals;e:{if(Pt(y)!==y||y.tag!==1)throw Error(t(170));var E=y;do{switch(E.tag){case 3:E=E.stateNode.context;break e;case 1:if(En(E.type)){E=E.stateNode.__reactInternalMemoizedMergedChildContext;break e}}E=E.return}while(E!==null);throw Error(t(171))}if(y.tag===1){var j=y.type;if(En(j))return S(y,j,E)}return E}function IH(y,E,j,q,Q,se,Re,rt,gt){return y=A7(j,q,!0,y,Q,se,Re,rt,gt),y.context=jH(null),j=y.current,q=Gc(),Q=Gg(j),se=lm(q,Q),se.callback=E??null,Ug(j,se,Q),y.current.lanes=Q,yr(y,Q,q),Nu(y,q),y}function _E(y,E,j,q){var Q=E.current,se=Gc(),Re=Gg(Q);return j=jH(j),E.context===null?E.context=j:E.pendingContext=j,E=lm(se,Re),E.payload={element:y},q=q===void 0?null:q,q!==null&&(E.callback=q),y=Ug(Q,E,Re),y!==null&&(xf(y,Q,Re,se),eE(y,Q,Re)),Re}function SE(y){if(y=y.current,!y.child)return null;switch(y.child.tag){case 5:return y.child.stateNode;default:return y.child.stateNode}}function FH(y,E){if(y=y.memoizedState,y!==null&&y.dehydrated!==null){var j=y.retryLane;y.retryLane=j!==0&&j<E?j:E}}function x7(y,E){FH(y,E),(y=y.alternate)&&FH(y,E)}function Jxe(){return null}var UH=typeof reportError=="function"?reportError:function(y){console.error(y)};function v7(y){this._internalRoot=y}TE.prototype.render=v7.prototype.render=function(y){var E=this._internalRoot;if(E===null)throw Error(t(409));_E(y,E,null,null)},TE.prototype.unmount=v7.prototype.unmount=function(){var y=this._internalRoot;if(y!==null){this._internalRoot=null;var E=y.containerInfo;vx(function(){_E(null,y,null,null)}),E[_u]=null}};function TE(y){this._internalRoot=y}TE.prototype.unstable_scheduleHydration=function(y){if(y){var E=Xn();y={blockedOn:null,target:y,priority:E};for(var j=0;j<Qo.length&&E!==0&&E<Qo[j].priority;j++);Qo.splice(j,0,y),j===0&&ix(y)}};function y7(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function EE(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11&&(y.nodeType!==8||y.nodeValue!==" react-mount-point-unstable "))}function BH(){}function eve(y,E,j,q,Q){if(Q){if(typeof q=="function"){var se=q;q=function(){var Vt=SE(Re);se.call(Vt)}}var Re=IH(E,q,y,0,null,!1,!1,"",BH);return y._reactRootContainer=Re,y[_u]=Re.current,fd(y.nodeType===8?y.parentNode:y),vx(),Re}for(;Q=y.lastChild;)y.removeChild(Q);if(typeof q=="function"){var rt=q;q=function(){var Vt=SE(gt);rt.call(Vt)}}var gt=A7(y,0,!1,null,null,!1,!1,"",BH);return y._reactRootContainer=gt,y[_u]=gt.current,fd(y.nodeType===8?y.parentNode:y),vx(function(){_E(E,gt,j,q)}),gt}function CE(y,E,j,q,Q){var se=j._reactRootContainer;if(se){var Re=se;if(typeof Q=="function"){var rt=Q;Q=function(){var gt=SE(Re);rt.call(gt)}}_E(E,Re,y,Q)}else Re=eve(j,E,y,Q,q);return SE(Re)}Qi=function(y){switch(y.tag){case 3:var E=y.stateNode;if(E.current.memoizedState.isDehydrated){var j=Ai(E.pendingLanes);j!==0&&(Yo(E,j|1),Nu(E,vr()),(Ki&6)===0&&(Wy=vr()+500,K()))}break;case 13:vx(function(){var q=om(y,1);if(q!==null){var Q=Gc();xf(q,y,1,Q)}}),x7(y,1)}},Rs=function(y){if(y.tag===13){var E=om(y,134217728);if(E!==null){var j=Gc();xf(E,y,134217728,j)}x7(y,134217728)}},vu=function(y){if(y.tag===13){var E=Gg(y),j=om(y,E);if(j!==null){var q=Gc();xf(j,y,E,q)}x7(y,E)}},Xn=function(){return ai},$i=function(y,E){var j=ai;try{return ai=y,E()}finally{ai=j}},fn=function(y,E,j){switch(E){case"input":if(Fe(y,j),E=j.name,j.type==="radio"&&E!=null){for(j=y;j.parentNode;)j=j.parentNode;for(j=j.querySelectorAll("input[name="+JSON.stringify(""+E)+'][type="radio"]'),E=0;E<j.length;E++){var q=j[E];if(q!==y&&q.form===y.form){var Q=Be(q);if(!Q)throw Error(t(90));mt(q),Fe(q,Q)}}}break;case"textarea":qe(y,j);break;case"select":E=j.value,E!=null&&At(y,!!j.multiple,E,!1)}},dn=d7,Bt=vx;var tve={usingClientEntryPoint:!1,Events:[de,me,Be,Lt,cn,d7]},s3={findFiberByHostInstance:Ad,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nve={bundleType:s3.bundleType,version:s3.version,rendererPackageName:s3.rendererPackageName,rendererConfig:s3.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(y){return y=Un(y),y===null?null:y.stateNode},findFiberByHostInstance:s3.findFiberByHostInstance||Jxe,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 NE=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!NE.isDisabled&&NE.supportsFiber)try{vt=NE.inject(nve),vn=NE}catch{}}
40return Mu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tve,Mu.createPortal=function(y,E){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y7(E))throw Error(t(200));return Zxe(y,E,null,j)},Mu.createRoot=function(y,E){if(!y7(y))throw Error(t(299));var j=!1,q="",Q=UH;return E!=null&&(E.unstable_strictMode===!0&&(j=!0),E.identifierPrefix!==void 0&&(q=E.identifierPrefix),E.onRecoverableError!==void 0&&(Q=E.onRecoverableError)),E=A7(y,1,!1,null,null,j,!1,q,Q),y[_u]=E.current,fd(y.nodeType===8?y.parentNode:y),new v7(E)},Mu.findDOMNode=function(y){if(y==null)return null;if(y.nodeType===1)return y;var E=y._reactInternals;if(E===void 0)throw typeof y.render=="function"?Error(t(188)):(y=Object.keys(y).join(","),Error(t(268,y)));return y=Un(E),y=y===null?null:y.stateNode,y},Mu.flushSync=function(y){return vx(y)},Mu.hydrate=function(y,E,j){if(!EE(E))throw Error(t(200));return CE(null,y,E,!0,j)},Mu.hydrateRoot=function(y,E,j){if(!y7(y))throw Error(t(405));var q=j!=null&&j.hydratedSources||null,Q=!1,se="",Re=UH;if(j!=null&&(j.unstable_strictMode===!0&&(Q=!0),j.identifierPrefix!==void 0&&(se=j.identifierPrefix),j.onRecoverableError!==void 0&&(Re=j.onRecoverableError)),E=IH(E,null,y,1,j??null,Q,!1,se,Re),y[_u]=E.current,fd(y),q)for(y=0;y<q.length;y++)j=q[y],Q=j._getVersion,Q=Q(j._source),E.mutableSourceEagerHydrationData==null?E.mutableSourceEagerHydrationData=[j,Q]:E.mutableSourceEagerHydrationData.push(j,Q);return new TE(E)},Mu.render=function(y,E,j){if(!EE(E))throw Error(t(200));return CE(null,y,E,!1,j)},Mu.unmountComponentAtNode=function(y){if(!EE(y))throw Error(t(40));return y._reactRootContainer?(vx(function(){CE(null,null,y,!1,function(){y._reactRootContainer=null,y[_u]=null})}),!0):!1},Mu.unstable_batchedUpdates=d7,Mu.unstable_renderSubtreeIntoContainer=function(y,E,j,q){if(!EE(j))throw Error(t(200));if(y==null||y._reactInternals===void 0)throw Error(t(38));return CE(y,E,j,!1,q)},Mu.version="18.3.1-next-f1338f8080-20240426",Mu}var XH;function YU(){if(XH)return _7.exports;XH=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),_7.exports=dve(),_7.exports}var YH;function hve(){if(YH)return ME;YH=1;var n=YU();return ME.createRoot=n.createRoot,ME.hydrateRoot=n.hydrateRoot,ME}var fve=hve();const pve=F1(fve);class p_{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const t={listener:e};return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const j4=typeof window>"u"||"Deno"in window;function Ch(){}function mve(n,e){return typeof n=="function"?n(e):n}function Sj(n){return typeof n=="number"&&n>=0&&n!==1/0}function kie(n,e){return Math.max(n+(e||0)-Date.now(),0)}function hS(n,e,t){return nT(n)?typeof e=="function"?{...t,queryKey:n,queryFn:e}:{...e,queryKey:n}:n}function gve(n,e,t){return nT(n)?typeof e=="function"?{...t,mutationKey:n,mutationFn:e}:{...e,mutationKey:n}:typeof n=="function"?{...e,mutationFn:n}:{...n}}function yA(n,e,t){return nT(n)?[{...e,queryKey:n},t]:[n||{},e]}function QH(n,e){const{type:t="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=n;if(nT(a)){if(r){if(e.queryHash!==QU(a,e.options))return!1}else if(!Y6(e.queryKey,a))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||typeof i<"u"&&i!==e.state.fetchStatus||s&&!s(e))}function KH(n,e){const{exact:t,fetching:r,predicate:i,mutationKey:s}=n;if(nT(s)){if(!e.options.mutationKey)return!1;if(t){if(IA(e.options.mutationKey)!==IA(s))return!1}else if(!Y6(e.options.mutationKey,s))return!1}return!(typeof r=="boolean"&&e.state.status==="loading"!==r||i&&!i(e))}function QU(n,e){return((e==null?void 0:e.queryKeyHashFn)||IA)(n)}function IA(n){return JSON.stringify(n,(e,t)=>Tj(t)?Object.keys(t).sort().reduce((r,i)=>(r[i]=t[i],r),{}):t)}function Y6(n,e){return Rie(n,e)}function Rie(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?!Object.keys(e).some(t=>!Rie(n[t],e[t])):!1}function Pie(n,e){if(n===e)return n;const t=ZH(n)&&ZH(e);if(t||Tj(n)&&Tj(e)){const r=t?n.length:Object.keys(n).length,i=t?e:Object.keys(e),s=i.length,a=t?[]:{};let o=0;for(let l=0;l<s;l++){const u=t?l:i[l];a[u]=Pie(n[u],e[u]),a[u]===n[u]&&o++}return r===s&&o===r?n:a}return e}function Q6(n,e){if(n&&!e||e&&!n)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}function ZH(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Tj(n){if(!JH(n))return!1;const e=n.constructor;if(typeof e>"u")return!0;const t=e.prototype;return!(!JH(t)||!t.hasOwnProperty("isPrototypeOf"))}function JH(n){return Object.prototype.toString.call(n)==="[object Object]"}function nT(n){return Array.isArray(n)}function Lie(n){return new Promise(e=>{setTimeout(e,n)})}function eW(n){Lie(0).then(n)}function Ave(){if(typeof AbortController=="function")return new AbortController}function Ej(n,e,t){return t.isDataEqual!=null&&t.isDataEqual(n,e)?n:typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?Pie(n,e):e}class xve extends p_{constructor(){super(),this.setup=e=>{if(!j4&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,(t=this.cleanup)==null||t.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}
40onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const K6=new xve,tW=["online","offline"];class vve extends p_{constructor(){super(),this.setup=e=>{if(!j4&&window.addEventListener){const t=()=>e();return tW.forEach(r=>{window.addEventListener(r,t,!1)}),()=>{tW.forEach(r=>{window.removeEventListener(r,t)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,(t=this.cleanup)==null||t.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Z6=new vve;function yve(n){return Math.min(1e3*2**n,3e4)}function v8(n){return(n??"online")==="online"?Z6.isOnline():!0}class Oie{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function YN(n){return n instanceof Oie}function Die(n){let e=!1,t=0,r=!1,i,s,a;const o=new Promise((x,b)=>{s=x,a=b}),l=x=>{r||(p(new Oie(x)),n.abort==null||n.abort())},u=()=>{e=!0},d=()=>{e=!1},h=()=>!K6.isFocused()||n.networkMode!=="always"&&!Z6.isOnline(),f=x=>{r||(r=!0,n.onSuccess==null||n.onSuccess(x),i==null||i(),s(x))},p=x=>{r||(r=!0,n.onError==null||n.onError(x),i==null||i(),a(x))},g=()=>new Promise(x=>{i=b=>{const _=r||!h();return _&&x(b),_},n.onPause==null||n.onPause()}).then(()=>{i=void 0,r||n.onContinue==null||n.onContinue()}),A=()=>{if(r)return;let x;try{x=n.fn()}catch(b){x=Promise.reject(b)}Promise.resolve(x).then(f).catch(b=>{var _,M;if(r)return;const T=(_=n.retry)!=null?_:3,L=(M=n.retryDelay)!=null?M:yve,D=typeof L=="function"?L(t,b):L,P=T===!0||typeof T=="number"&&t<T||typeof T=="function"&&T(t,b);if(e||!P){p(b);return}t++,n.onFail==null||n.onFail(t,b),Lie(D).then(()=>{if(h())return g()}).then(()=>{e?p(b):A()})})};return v8(n.networkMode)?A():g().then(A),{promise:o,cancel:l,continue:()=>(i==null?void 0:i())?o:Promise.resolve(),cancelRetry:u,continueRetry:d}}const KU=console;function bve(){let n=[],e=0,t=d=>{d()},r=d=>{d()};const i=d=>{let h;e++;try{h=d()}finally{e--,e||o()}return h},s=d=>{e?n.push(d):eW(()=>{t(d)})},a=d=>(...h)=>{s(()=>{d(...h)})},o=()=>{const d=n;n=[],d.length&&eW(()=>{r(()=>{d.forEach(h=>{t(h)})})})};return{batch:i,batchCalls:a,schedule:s,setNotifyFunction:d=>{t=d},setBatchNotifyFunction:d=>{r=d}}}const Za=bve();
40class jie{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sj(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e??(j4?1/0:300*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class wve extends jie{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||KU,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||_ve(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,t){const r=Ej(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;const r=this.promise;return(t=this.retryer)==null||t.cancel(e),r?r.then(Ch).catch(Ch):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!kie(this.state.dataUpdatedAt,e)}onFocus(){var e;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t&&t.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t&&t.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&t!=null&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}const a=Ave(),o={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(o);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(o)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),d={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(l(d),(r=this.options.behavior)==null||r.onFetch(d),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=d.fetchOptions)==null?void 0:i.meta)){var h;this.dispatch({type:"fetch",meta:(h=d.fetchOptions)==null?void 0:h.meta})}const f=p=>{if(YN(p)&&p.silent||this.dispatch({type:"error",error:p}),!YN(p)){var g,A,x,b;(g=(A=this.cache.config).onError)==null||g.call(A,p,this),(x=(b=this.cache.config).onSettled)==null||x.call(b,this.state.data,p,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Die({fn:d.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:p=>{var g,A,x,b;if(typeof p>"u"){f(new Error(this.queryHash+" data is undefined"));return}this.setData(p),(g=(A=this.cache.config).onSuccess)==null||g.call(A,p,this),(x=(b=this.cache.config).onSettled)==null||x.call(b,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:f,onFail:(p,g)=>{this.dispatch({type:"failed",failureCount:p,error:g})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const t=r=>{var i,s;switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:v8(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=e.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=e.error;return YN(a)&&a.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}
40:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Za.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function _ve(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=typeof e<"u",r=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"loading",fetchStatus:"idle"}}class Sve extends p_{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,r){var i;const s=t.queryKey,a=(i=t.queryHash)!=null?i:QU(s,t);let o=this.get(a);return o||(o=new wve({cache:this,logger:e.getLogger(),queryKey:s,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter(r=>r!==e),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){Za.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){const[r]=yA(e,t);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>QH(r,i))}findAll(e,t){const[r]=yA(e,t);return Object.keys(r).length>0?this.queries.filter(i=>QH(r,i)):this.queries}notify(e){Za.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}onFocus(){Za.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){Za.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class Tve extends jie{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||KU,this.observers=[],this.state=e.state||Iie(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return(e=(t=this.retryer)==null?void 0:t.continue())!=null?e:this.execute()}async execute(){const e=()=>{var P;return this.retryer=Die({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(O,F)=>{this.dispatch({type:"failed",failureCount:O,error:F})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(P=this.options.retry)!=null?P:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},t=this.state.status==="loading";try{var r,i,s,a,o,l,u,d;if(!t){var h,f,p,g;this.dispatch({type:"loading",variables:this.options.variables}),await((h=(f=this.mutationCache.config).onMutate)==null?void 0:h.call(f,this.state.variables,this));const O=await((p=(g=this.options).onMutate)==null?void 0:p.call(g,this.state.variables));O!==this.state.context&&this.dispatch({type:"loading",context:O,variables:this.state.variables})}const P=await e();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,P,this.state.variables,this.state.context,this)),await((s=(a=this.options).onSuccess)==null?void 0:s.call(a,P,this.state.variables,this.state.context)),await((o=(l=this.mutationCache.config).onSettled)==null?void 0:o.call(l,P,null,this.state.variables,this.state.context,this)),await((u=(d=this.options).onSettled)==null?void 0:u.call(d,P,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:P}),P}catch(P){try{var A,x,b,_,M,T,L,D;throw await((A=(x=this.mutationCache.config).onError)==null?void 0:A.call(x,P,this.state.variables,this.state.context,this)),await((b=(_=this.options).onError)==null?void 0:b.call(_,P,this.state.variables,this.state.context)),await((M=(T=this.mutationCache.config).onSettled)==null?void 0:M.call(T,void 0,P,this.state.variables,this.state.context,this)),await((L=(D=this.options).onSettled)==null?void 0:L.call(D,void 0,P,this.state.variables,this.state.context)),P}finally{this.dispatch({type:"error",error:P})}}}dispatch(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!v8(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPau
40sed:!1,status:"error"};case"setState":return{...r,...e.state}}};this.state=t(this.state),Za.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function Iie(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Eve extends p_{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,r){const i=new Tve({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(t=>t!==e),this.notify({type:"removed",mutation:e})}clear(){Za.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact>"u"&&(e.exact=!0),this.mutations.find(t=>KH(e,t))}findAll(e){return this.mutations.filter(t=>KH(e,t))}notify(e){Za.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const t=this.mutations.filter(r=>
40r.state.isPaused);return Za.batch(()=>t.reduce((r,i)=>r.then(()=>i.continue().catch(Ch)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function Cve(){return{onFetch:n=>{n.fetchFn=()=>{var e,t,r,i,s,a;const o=(e=n.fetchOptions)==null||(t=e.meta)==null?void 0:t.refetchPage,l=(r=n.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,u=l==null?void 0:l.pageParam,d=(l==null?void 0:l.direction)==="forward",h=(l==null?void 0:l.direction)==="backward",f=((s=n.state.data)==null?void 0:s.pages)||[],p=((a=n.state.data)==null?void 0:a.pageParams)||[];let g=p,A=!1;const x=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>{var P;if((P=n.signal)!=null&&P.aborted)A=!0;else{var O;(O=n.signal)==null||O.addEventListener("abort",()=>{A=!0})}return n.signal}})},b=n.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+n.options.queryHash+"'")),_=(D,P,O,F)=>(g=F?[P,...g]:[...g,P],F?[O,...D]:[...D,O]),M=(D,P,O,F)=>{if(A)return Promise.reject("Cancelled");if(typeof O>"u"&&!P&&D.length)return Promise.resolve(D);const U={queryKey:n.queryKey,pageParam:O,meta:n.options.meta};x(U);const B=b(U);return Promise.resolve(B).then(H=>_(D,O,H,F))};let T;if(!f.length)T=M([]);else if(d){const D=typeof u<"u",P=D?u:nW(n.options,f);T=M(f,D,P)}else if(h){const D=typeof u<"u",P=D?u:Nve(n.options,f);T=M(f,D,P,!0)}else{g=[];const D=typeof n.options.getNextPageParam>"u";T=(o&&f[0]?o(f[0],0,f):!0)?M([],D,p[0]):Promise.resolve(_([],p[0],f[0]));for(let O=1;O<f.length;O++)T=T.then(F=>{if(o&&f[O]?o(f[O],O,f):!0){const B=D?p[O]:nW(n.options,F);return M(F,D,B)}return Promise.resolve(_(F,p[O],f[O]))})}return T.then(D=>({pages:D,pageParams:g}))}}}}function nW(n,e){return n.getNextPageParam==null?void 0:n.getNextPageParam(e[e.length-1],e)}function Nve(n,e){return n.getPreviousPageParam==null?void 0:n.getPreviousPageParam(e[0],e)}class Mve{constructor(e={}){this.queryCache=e.queryCache||new Sve,this.mutationCache=e.mutationCache||new Eve,this.logger=e.logger||KU,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=K6.subscribe(()=>{K6.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Z6.subscribe(()=>{Z6.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,t;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(t=this.unsubscribeOnline)==null||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){const[r]=yA(e,t);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var r;return(r=this.queryCache.find(e,t))==null?void 0:r.state.data}ensureQueryData(e,t,r){const i=hS(e,t,r),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:r})=>{const i=r.data;return[t,i]})}setQueryData(e,t,r){const i=this.queryCache.find(e),s=i==null?void 0:i.state.data,a=mve(t,s);if(typeof a>"u")return;const o=hS(e),l=this.defaultQueryOptions(o);return this.queryCache.build(this,l).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return Za.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,r)]))}getQueryState(e,t){var r;return(r=this.queryCache.find(e,t))==null?void 0:r.state}removeQueries(e,t){const[r]=yA(e,t),i=this.queryCache;Za.batch(()=>{i.findAll(r).forEach(s=>{i.remove(s)})})}resetQueries(e,t,r){const[i,s]=yA(e,t,r),a=this.queryCache,o={type:"active",...i};return Za.batch(()=>(a.findAll(i).forEach(l=>{l.reset()}),this.refetchQueries(o,s)))}cancelQueries(e,t,r){const[i,s={}]=yA(e,t,r);typeof s.revert>"u"&&(s.revert=!0);const a=Za.batch(()=>this.queryCache.findAll(i).map(o=>o.cancel(s)));return Promise.all(a).then(Ch).catch(Ch)}invalidateQueries(e,t,r){const[i,s]=yA(e,t,r);return Za.batch(()=>{var a,o;if(this.queryCache.findAll(i).forEach(u=>
40{u.invalidate()}),i.refetchType==="none")return Promise.resolve();const l={...i,type:(a=(o=i.refetchType)!=null?o:i.type)!=null?a:"active"};return this.refetchQueries(l,s)})}refetchQueries(e,t,r){const[i,s]=yA(e,t,r),a=Za.batch(()=>this.queryCache.findAll(i).filter(l=>!l.isDisabled()).map(l=>{var u;return l.fetch(void 0,{...s,cancelRefetch:(u=s==null?void 0:s.cancelRefetch)!=null?u:!0,meta:{refetchPage:i.refetchPage}})}));let o=Promise.all(a).then(Ch);return s!=null&&s.throwOnError||(o=o.catch(Ch)),o}fetchQuery(e,t,r){const i=hS(e,t,r),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const a=this.queryCache.build(this,s);return a.isStaleByTime(s.staleTime)?a.fetch(s):Promise.resolve(a.state.data)}prefetchQuery(e,t,r){return this.fetchQuery(e,t,r).then(Ch).catch(Ch)}fetchInfiniteQuery(e,t,r){const i=hS(e,t,r);return i.behavior=Cve(),this.fetchQuery(i)}prefetchInfiniteQuery(e,t,r){return this.fetchInfiniteQuery(e,t,r).then(Ch).catch(Ch)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){const r=this.queryDefaults.find(i=>IA(e)===IA(i.queryKey));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;const t=this.queryDefaults.find(r=>Y6(e,r.queryKey));return t==null?void 0:t.defaultOptions}setMutationDefaults(e,t){const r=this.mutationDefaults.find(i=>IA(e)===IA(i.mutationKey));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;const t=this.mutationDefaults.find(r=>Y6(e,r.mutationKey));return t==null?void 0:t.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...this.defaultOptions.queries,...this.getQueryDefaults(e==null?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=QU(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.useErrorBoundary>"u"&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(e==null?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class kve extends p_{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),rW(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Cj(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Cj(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),Q6(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const s=this.hasListeners();s&&iW(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(t),s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const a=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||a!==this.currentRefetchInterval)&&this.updateRefetchInterval(a)}getOptimisticResult(e){const t=this.client.getQueryCache().build(this.client,e),r=this.createResult(t,e);return Pve(this,r,e)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(e){const t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){const t=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:(t=e.cancelRefetch)!=null?t:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(Ch)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),j4||this.currentResult.isStale||!Sj(this.options.staleTime))return;const t=kie(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(j4||this.options.enabled===!1||!Sj(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>
40{(this.options.refetchIntervalInBackground||K6.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){const r=this.currentQuery,i=this.options,s=this.currentResult,a=this.currentResultState,o=this.currentResultOptions,l=e!==r,u=l?e.state:this.currentQueryInitialState,d=l?this.currentResult:this.previousQueryResult,{state:h}=e;let{dataUpdatedAt:f,error:p,errorUpdatedAt:g,fetchStatus:A,status:x}=h,b=!1,_=!1,M;if(t._optimisticResults){const O=this.hasListeners(),F=!O&&rW(e,t),U=O&&iW(e,r,t,i);(F||U)&&(A=v8(e.options.networkMode)?"fetching":"paused",f||(x="loading")),t._optimisticResults==="isRestoring"&&(A="idle")}if(t.keepPreviousData&&!h.dataUpdatedAt&&d!=null&&d.isSuccess&&x!=="error")M=d.data,f=d.dataUpdatedAt,x=d.status,b=!0;else if(t.select&&typeof h.data<"u")if(s&&h.data===(a==null?void 0:a.data)&&t.select===this.selectFn)M=this.selectResult;else try{this.selectFn=t.select,M=t.select(h.data),M=Ej(s==null?void 0:s.data,M,t),this.selectResult=M,this.selectError=null}catch(O){this.selectError=O}else M=h.data;if(typeof t.placeholderData<"u"&&typeof M>"u"&&x==="loading"){let O;if(s!=null&&s.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData))O=s.data;else if(O=typeof t.placeholderData=="function"?t.placeholderData():t.placeholderData,t.select&&typeof O<"u")try{O=t.select(O),this.selectError=null}catch(F){this.selectError=F}typeof O<"u"&&(x="success",M=Ej(s==null?void 0:s.data,O,t),_=!0)}this.selectError&&(p=this.selectError,M=this.selectResult,g=Date.now(),x="error");const T=A==="fetching",L=x==="loading",D=x==="error";return{status:x,fetchStatus:A,isLoading:L,isSuccess:x==="success",isError:D,isInitialLoading:L&&T,data:M,dataUpdatedAt:f,error:p,errorUpdatedAt:g,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:T,isRefetching:T&&!L,isLoadingError:D&&h.dataUpdatedAt===0,isPaused:A==="paused",isPlaceholderData:_,isPreviousData:b,isRefetchError:D&&h.dataUpdatedAt!==0,isStale:ZU(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){const t=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,Q6(r,t))return;this.currentResult=r;const i={cache:!0},s=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.trackedProps.size)return!0;const l=new Set(o??this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(u=>{const d=u;return this.currentResult[d]!==t[d]&&l.has(d)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const t={};e.type==="success"?t.onSuccess=!e.manual:e.type==="error"&&!YN(e.error)&&(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){Za.batch(()=>{if(e.onSuccess){var t,r,i,s;(t=(r=this.options).onSuccess)==null||t.call(r,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(e.onError){var a,o,l,u;(a=(o=this.options).onError)==null||a.call(o,this.currentResult.error),(l=(u=this.options).onSettled)==null||l.call(u,void 0,this.currentResult.error)}
40e.listeners&&this.listeners.forEach(({listener:d})=>{d(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function Rve(n,e){return e.enabled!==!1&&!n.state.dataUpdatedAt&&!(n.state.status==="error"&&e.retryOnMount===!1)}function rW(n,e){return Rve(n,e)||n.state.dataUpdatedAt>0&&Cj(n,e,e.refetchOnMount)}function Cj(n,e,t){if(e.enabled!==!1){const r=typeof t=="function"?t(n):t;return r==="always"||r!==!1&&ZU(n,e)}return!1}function iW(n,e,t,r){return t.enabled!==!1&&(n!==e||r.enabled===!1)&&(!t.suspense||n.state.status!=="error")&&ZU(n,t)}function ZU(n,e){return n.isStaleByTime(e.staleTime)}function Pve(n,e,t){return t.keepPreviousData?!1:t.placeholderData!==void 0?e.isPlaceholderData:!Q6(n.getCurrentResult(),e)}let Lve=class extends p_{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;const r=this.options;this.options=this.client.defaultMutationOptions(e),Q6(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(t=this.currentMutation)==null||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const t={listeners:!0};e.type==="success"?t.onSuccess=!0:e.type==="error"&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:Iie(),t={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){Za.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(e.onSuccess){var t,r,i,s;(t=(r=this.mutateOptions).onSuccess)==null||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var a,o,l,u;(a=(o=this.mutateOptions).onError)==null||a.call(o,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(l=(u=this.mutateOptions).onSettled)==null||l.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}e.listeners&&this.listeners.forEach(({listener:d})=>{d(this.currentResult)})})}};var Vl=YU();const fS=F1(Vl),Ove=Mie({__proto__:null,default:fS},[Vl]);var E7={exports:{}},C7={};/** 41 * @license React 42 * use-sync-external-store-shim.production.js 43 * 44 * Copyright (c) Meta Platforms, Inc. and affiliates. 45 * 46 * This source code is licensed under the MIT license found in the 47 * LICENSE file in the root directory of this source tree. 48 */var sW;function Dve(){if(sW)return C7;sW=1;var n=f_();function e(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,i=n.useEffect,s=n.useLayoutEffect,a=n.useDebugValue;function o(h,f){var p=f(),g=r({inst:{value:p,getSnapshot:f}}),A=g[0].inst,x=g[1];return s(function(){A.value=p,A.getSnapshot=f,l(A)&&x({inst:A})},[h,p,f]),i(function(){return l(A)&&x({inst:A}),h(function(){l(A)&&x({inst:A})})},[h]),a(p),p}function l(h){var f=h.getSnapshot;h=h.value;try{var p=f();return!t(h,p)}catch{return!0}}function u(h,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return C7.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:d,C7}var aW;function jve(){return aW||(aW=1,E7.exports=Dve()),E7.exports}var Ive=jve();const Fie=Ive.useSyncExternalStore,oW=G.createContext(void 0),Uie=G.createContext(!1);function Bie(n,e){return n||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=oW),window.ReactQueryClientContext):oW)}const JU=({context:n}={})=>{const e=G.useContext(Bie(n,G.useContext(Uie)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Fve=({client:n,children:e,context:t,contextSharing:r=!1})=>{G.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]);const i=Bie(t,r);return G.createElement(Uie.Provider,{value:!t&&r},G.createElement(i.Provider,{value:n},e))},Vie=G.createContext(!1),Uve=()=>G.useContext(Vie);Vie.Provider;function Bve(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}const Vve=G.createContext(Bve()),zve=()=>G.useContext(Vve);function zie(n,e){return typeof n=="function"?n(...e):!!n}const Gve=(n,e)=>{(n.suspense||n.useErrorBoundary)&&(e.isReset()||(n.retryOnMount=!1))},qve=n=>{G.useEffect(()=>{n.clearReset()},[n])},$ve=({result:n,errorResetBoundary:e,useErrorBoundary:t,query:r})=>n.isError&&!e.isReset()&&!n.isFetching&&zie(t,[n.error,r]),Hve=n=>{n.suspense&&typeof n.staleTime!="number"&&(n.staleTime=1e3)},Wve=(n,e)=>n.isLoading&&n.isFetching&&!e,Xve=(n,e,t)=>(n==null?void 0:n.suspense)&&Wve(e,t),Yve=(n,e,t)=>e.fetchOptimistic(n).then(({data:r})=>{n.onSuccess==null||n.onSuccess(r),n.onSettled==null||n.onSettled(r,null)}
48).catch(r=>{t.clearReset(),n.onError==null||n.onError(r),n.onSettled==null||n.onSettled(void 0,r)});function Qve(n,e){const t=JU({context:n.context}),r=Uve(),i=zve(),s=t.defaultQueryOptions(n);s._optimisticResults=r?"isRestoring":"optimistic",s.onError&&(s.onError=Za.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=Za.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=Za.batchCalls(s.onSettled)),Hve(s),Gve(s,i),qve(i);const[a]=G.useState(()=>new e(t,s)),o=a.getOptimisticResult(s);if(Fie(G.useCallback(l=>{const u=r?()=>{}:a.subscribe(Za.batchCalls(l));return a.updateResult(),u},[a,r]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),G.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),Xve(s,o,r))throw Yve(s,a,i);if($ve({result:o,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:a.getCurrentQuery()}))throw o.error;return s.notifyOnChangeProps?o:a.trackResult(o)}function Nj(n,e,t){const r=hS(n,e,t);return Qve(r,kve)}function Kve(n,e,t){const r=gve(n,e,t),i=JU({context:r.context}),[s]=G.useState(()=>new Lve(i,r));G.useEffect(()=>{s.setOptions(r)},[s,r]);const a=Fie(G.useCallback(l=>s.subscribe(Za.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=G.useCallback((l,u)=>{s.mutate(l,u).catch(Zve)},[s]);if(a.error&&zie(s.options.useErrorBoundary,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function Zve(){}/** 49 * @remix-run/router v1.23.2 50 * 51 * Copyright (c) Remix Software Inc. 52 * 53 * This source code is licensed under the MIT license found in the 54 * LICENSE.md file in the root directory of this source tree. 55 * 56 * @license MIT 57 */function ba(){return ba=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ba.apply(this,arguments)}var wo;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(wo||(wo={}));const lW="popstate";function Jve(n){n===void 0&&(n={});function e(r,i){let{pathname:s,search:a,hash:o}=r.location;return I4("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function t(r,i){return typeof i=="string"?i:Wv(i)}return tye(e,t,null,n)}function gi(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function Hv(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function eye(){return Math.random().toString(36).substr(2,8)}function cW(n,e){return{usr:n.state,key:n.key,idx:e}}function I4(n,e,t,r){return t===void 0&&(t=null),ba({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?U1(e):e,{state:t,key:e&&e.key||r||eye()})}function Wv(n){let{pathname:e="/",search:t="",hash:r=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function U1(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let r=n.indexOf("?");r>=0&&(e.search=n.substr(r),n=n.substr(0,r)),n&&(e.pathname=n)}return e}function tye(n,e,t,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=wo.Pop,l=null,u=d();u==null&&(u=0,a.replaceState(ba({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function h(){o=wo.Pop;let x=d(),b=x==null?null:x-u;u=x,l&&l({action:o,location:A.location,delta:b})}function f(x,b){o=wo.Push;let _=I4(A.location,x,b);u=d()+1;let M=cW(_,u),T=A.createHref(_);try{a.pushState(M,"",T)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;i.location.assign(T)}s&&l&&l({action:o,location:A.location,delta:1})}function p(x,b){o=wo.Replace;let _=I4(A.location,x,b);u=d();let M=cW(_,u),T=A.createHref(_);a.replaceState(M,"",T),s&&l&&l({action:o,location:A.location,delta:0})}function g(x){let b=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof x=="string"?x:Wv(x);return _=_.replace(/ $/,"%20"),gi(b,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,b)}let A={get action(){return o},get location(){return n(i,a)}
vendor: 61,173 bytes, lines 57-76
57,listen(x){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(lW,h),l=x,()=>{i.removeEventListener(lW,h),l=null}},createHref(x){return e(i,x)},createURL:g,encodeLocation(x){let b=g(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(x){return a.go(x)}};return A}var Ls;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Ls||(Ls={}));const nye=new Set(["lazy","caseSensitive","path","id","index","children"]);function rye(n){return n.index===!0}function J6(n,e,t,r){return t===void 0&&(t=[]),r===void 0&&(r={}),n.map((i,s)=>{let a=[...t,String(s)],o=typeof i.id=="string"?i.id:a.join("-");if(gi(i.index!==!0||!i.children,"Cannot specify children on an index route"),gi(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),rye(i)){let l=ba({},i,e(i),{id:o});return r[o]=l,l}else{let l=ba({},i,e(i),{id:o,children:void 0});return r[o]=l,i.children&&(l.children=J6(i.children,e,a,r)),l}})}function Yx(n,e,t){return t===void 0&&(t="/"),QN(n,e,t,!1)}function QN(n,e,t,r){let i=typeof e=="string"?U1(e):e,s=Qm(i.pathname||"/",t);if(s==null)return null;let a=Gie(n);sye(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let u=gye(s);o=pye(a[l],u,r)}return o}function iye(n,e){let{route:t,pathname:r,params:i}=n;return{id:t.id,pathname:r,params:i,data:e[t.id],handle:t.handle}}function Gie(n,e,t,r){e===void 0&&(e=[]),t===void 0&&(t=[]),r===void 0&&(r="");let i=(s,a,o)=>{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};l.relativePath.startsWith("/")&&(gi(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Vm([r,l.relativePath]),d=t.concat(l);s.children&&s.children.length>0&&(gi(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Gie(s.children,e,d,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:hye(u,s.index),routesMeta:d})};return n.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let l of qie(s.path))i(s,a,l)}),e}function qie(n){let e=n.split("/");if(e.length===0)return[];let[t,...r]=e,i=t.endsWith("?"),s=t.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=qie(r.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),i&&o.push(...a),o.map(l=>n.startsWith("/")&&l===""?"/":l)}function sye(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:fye(e.routesMeta.map(r=>r.childrenIndex),t.routesMeta.map(r=>r.childrenIndex)))}const aye=/^:[\w-]+$/,oye=3,lye=2,cye=1,uye=10,dye=-2,uW=n=>n==="*";function hye(n,e){let t=n.split("/"),r=t.length;return t.some(uW)&&(r+=dye),e&&(r+=lye),t.filter(i=>!uW(i)).reduce((i,s)=>i+(aye.test(s)?oye:s===""?cye:uye),r)}function fye(n,e){return n.length===e.length&&n.slice(0,-1).every((r,i)=>r===e[i])?n[n.length-1]-e[e.length-1]:0}function pye(n,e,t){t===void 0&&(t=!1);let{routesMeta:r}=n,i={},s="/",a=[];for(let o=0;o<r.length;++o){let l=r[o],u=o===r.length-1,d=s==="/"?e:e.slice(s.length)||"/",h=eM({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),f=l.route;if(!h&&u&&t&&!r[r.length-1].route.index&&(h=eM({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(i,h.params),a.push({params:i,pathname:Vm([s,h.pathname]),pathnameBase:yye(Vm([s,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(s=Vm([s,h.pathnameBase]))}return a}function eM(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,r]=mye(n.path,n.caseSensitive,n.end),i=e.match(t);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:f,isOptional:p}=d;if(f==="*"){let A=o[h]||"";a=s.slice(0,s.length-A.length).replace(/(.)\/+$/,"$1")}const g=o[h];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:n}}function mye(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Hv(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let r=[],i="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(r.push({paramName:"*"}),i+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?i+="\\/*$":n!==""&&n!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function gye(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Hv(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function Qm(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,r=n.charAt(t);return r&&r!=="/"?null:n.slice(t)||"/"}const Aye=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xye=n=>Aye.test(n);function vye(n,e){e===void 0&&(e="/");let{pathname:t,search:r="",hash:i=""}=typeof n=="string"?U1(n):n,s;if(t)if(xye(t))s=t;else{if(t.includes("//")){let a=t;t=t.replace(/\/\/+/g,"/"),Hv(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+t))}t.startsWith("/")?s=dW(t.substring(1),"/"):s=dW(t,e)}else s=e;return{pathname:s,search:bye(r),hash:wye(i)}}function dW(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function N7(n,e,t,r){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function $ie(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function y8(n,e){let t=$ie(n);return e?t.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):t.map(r=>r.pathnameBase)}function b8(n,e,t,r){r===void 0&&(r=!1);let i;typeof n=="string"?i=U1(n):(i=ba({},n),gi(!i.pathname||!i.pathname.includes("?"),N7("?","pathname","search",i)),gi(!i.pathname||!i.pathname.includes("#"),N7("#","pathname","hash",i)),gi(!i.search||!i.search.includes("#"),N7("#","search","hash",i)));let s=n===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=t;else{let h=e.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}o=h>=0?e[h]:"/"}let l=vye(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Vm=n=>n.join("/").replace(/\/\/+/g,"/"),yye=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),bye=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,wye=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;class tM{constructor(e,t,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=t||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function F4(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const Hie=["post","put","patch","delete"],_ye=new Set(Hie),Sye=["get",...Hie],Tye=new Set(Sye),Eye=new Set([301,302,303,307,308]),Cye=new Set([307,308]),M7={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Nye={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},o3={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},eB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mye=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),Wie="remix-router-transitions";function kye(n){const e=n.window?n.window:typeof window<"u"?window:void 0,t=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!t;gi(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(n.mapRouteProperties)i=n.mapRouteProperties;else if(n.detectErrorBoundary){let xe=n.detectErrorBoundary;i=Oe=>({hasErrorBoundary:xe(Oe)})}else i=Mye;let s={},a=J6(n.routes,i,void 0,s),o,l=n.basename||"/",u=n.dataStrategy||Oye,d=n.patchRoutesOnNavigation,h=ba({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},n.future),f=null,p=new Set,g=null,A=null,x=null,b=n.hydrationData!=null,_=Yx(a,n.history.location,l),M=!1,T=null;if(_==null&&!d){let xe=Ru(404,{pathname:n.history.location.pathname}),{matches:Oe,route:Ge}=wW(a);_=Oe,T={[Ge.id]:xe}}_&&!n.hydrationData&&Bt(_,a,n.history.location.pathname).active&&(_=null);let L;if(_)if(_.some(xe=>xe.route.lazy))L=!1;else if(!_.some(xe=>xe.route.loader))L=!0;else if(h.v7_partialHydration){let xe=n.hydrationData?n.hydrationData.loaderData:null,Oe=n.hydrationData?n.hydrationData.errors:null;if(Oe){let Ge=_.findIndex($e=>Oe[$e.route.id]!==void 0);L=_.slice(0,Ge+1).every($e=>!kj($e.route,xe,Oe))}else L=_.every(Ge=>!kj(Ge.route,xe,Oe))}else L=n.hydrationData!=null;else if(L=!1,_=[],h.v7_partialHydration){let xe=Bt(null,a,n.history.location.pathname);xe.active&&xe.matches&&(M=!0,_=xe.matches)}let D,P={historyAction:n.history.action,location:n.history.location,matches:_,initialized:L,navigation:M7,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||T,fetchers:new Map,blockers:new Map},O=wo.Pop,F=!1,U,B=!1,z=new Map,H=null,X=!1,W=!1,J=[],ee=new Set,ae=new Map,le=0,Z=-1,Y=new Map,re=new Set,_e=new Map,Ee=new Map,Ae=new Set,te=new Map,ve=new Map,we;function Ue(){if(f=n.history.listen(xe=>{let{action:Oe,location:Ge,delta:$e}=xe;if(we){we(),we=void 0;return}Hv(ve.size===0||$e!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let m=fn({currentLocation:P.location,nextLocation:Ge,historyAction:Oe});if(m&&$e!=null){let be=new Promise(en=>{we=en});n.history.go($e*-1),Je(m,{state:"blocked",location:Ge,proceed(){Je(m,{state:"proceeding",proceed:void 0,reset:void 0,location:Ge}),be.then(()=>n.history.go($e))},reset(){let en=new Map(P.blockers);en.set(m,o3),mt({blockers:en})}});return}return kt(Oe,Ge)}),t){Xye(e,z);let xe=()=>Yye(e,z);e.addEventListener("pagehide",xe),H=()=>e.removeEventListener("pagehide",xe)}return P.initialized||kt(wo.Pop,P.location,{initialHydration:!0}),D}function ze(){f&&f(),H&&H(),p.clear(),U&&U.abort(),P.fetchers.forEach((xe,Oe)=>Xe(Oe)),P.blockers.forEach((xe,Oe)=>Nt(Oe))}function yt(xe){return p.add(xe),()=>p.delete(xe)}function mt(xe,Oe){Oe===void 0&&(Oe={}),P=ba({},P,xe);let Ge=[],$e=[];h.v7_fetcherPersist&&P.fetchers.forEach((m,be)=>{m.state==="idle"&&(Ae.has(be)?$e.push(be):Ge.push(be))}),Ae.forEach(m=>{!P.fetchers.has(m)&&!ae.has(m)&&$e.push(m)}),[...p].forEach(m=>m(P,{deletedFetchers:$e,viewTransitionOpts:Oe.viewTransitionOpts,flushSync:Oe.flushSync===!0})),h.v7_fetcherPersist?(Ge.forEach(m=>P.fetchers.delete(m)),$e.forEach(m=>Xe(m))):$e.forEach(m=>Ae.delete(m))}function bt(xe,Oe,Ge){var $e,m;let{flushSync:be}=Ge===void 0?{}:Ge,en=P.actionData!=null&&P.navigation.formMethod!=null&&Of(P.navigation.formMethod)&&P.navigation.state==="loading"&&(($e=xe.state)==null?void 0:$e._isRedirect)!==!0,on;Oe.actionData?Object.keys(Oe.actionData).length>0?on=Oe.actionData:on=null:en?on=P.actionData:on=null;let tn=Oe.loaderData?yW(P.loaderData,Oe.loaderData,Oe.matches||[],Oe.errors):P.loaderData,Qt=P.blockers;Qt.size>0&&(Qt=new Map(Qt),Qt.forEach((wn,zn)=>Qt.set(zn,o3)));let Pt=F===!0||P.navigation.formMethod!=null&&Of(P.navigation.formMethod)&&((m=xe.state)==null?void 0:m._isRedirect)!==!0;o&&(a=o,o=void 0),X||O===wo.Pop||(O===wo.Push?n.history.push(xe,xe.state):O===wo.Replace&&n.history.replace(xe,xe.state));let bn;if(O===wo.Pop){let wn=z.get(P.location.pathname);wn&&wn.has(xe.pathname)?bn={currentLocation:P.location,nextLocation:xe}:z.has(xe.pathname)&&(bn={currentLocation:xe,nextLocation:P.location})}else if(B){let wn=z.get(P.location.pathname);wn?wn.add(xe.pathname):(wn=new Set([xe.pathname]),z.set(P.location.pathname,wn)),bn={currentLocation:P.location,nextLocation:xe}}mt(ba({},Oe,{actionData:on,loaderData:tn,historyAction:O,location:xe,initialized:!0,navigation:M7,revalidation:"idle",restoreScrollPosition:dn(xe,Oe.matches||P.matches),preventScrollReset:Pt,blockers:Qt}),{viewTransitionOpts:bn,flushSync:be===!0}),O=wo.Pop,F=!1,B=!1,X=!1,W=!1,J=[]}async function dt(xe,Oe){if(typeof xe=="number"){n.history.go(xe);return}let Ge=Mj(P.location,P.matches,l,h.v7_prependBasename,xe,h.v7_relativeSplatPath,Oe==null?void 0:Oe.fromRouteId,Oe==null?void 0:Oe.relative),{path:$e,submission:m,error:be}=hW(h.v7_normalizeFormMethod,!1,Ge,Oe),en=P.location,on=I4(P.location,$e,Oe&&Oe.state);on=ba({},on,n.history.encodeLocation(on));let tn=Oe&&Oe.replace!=null?Oe.replace:void 0,Qt=wo.Push;tn===!0?Qt=wo.Replace:tn===!1||m!=null&&Of(m.formMethod)&&m.formAction===P.location.pathname+P.location.search&&(Qt=wo.Replace);let Pt=Oe&&"preventScrollReset"in Oe?Oe.preventScrollReset===!0:void 0,bn=(Oe&&Oe.flushSync)===!0,wn=fn({currentLocation:en,nextLocation:on,historyAction:Qt});if(wn){Je(wn,{state:"blocked",location:on,proceed(){Je(wn,{state:"proceeding",proceed:void 0,reset:void 0,location:on}),dt(xe,Oe)},reset(){let zn=new Map(P.blockers);zn.set(wn,o3),mt({blockers:zn})}});return}return await kt(Qt,on,{submission:m,pendingError:be,preventScrollReset:Pt,replace:Oe&&Oe.replace,enableViewTransition:Oe&&Oe.viewTransition,flushSync:bn})}function St(){if(oe(),mt({revalidation:"loading"}),P.navigation.state!=="submitting"){if(P.navigation.state==="idle"){kt(P.historyAction,P.location,{startUninterruptedRevalidation:!0});return}kt(O||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:B===!0})}}async function kt(xe,Oe,Ge){U&&U.abort(),U=null,O=xe,X=(Ge&&Ge.startUninterruptedRevalidation)===!0,cn(P.location,P.matches),F=(Ge&&Ge.preventScrollReset)===!0,B=(Ge&&Ge.enableViewTransition)===!0;let $e=o||a,m=Ge&&Ge.overrideNavigation,be=Ge!=null&&Ge.initialHydration&&P.matches&&P.matches.length>0&&!M?P.matches:Yx($e,Oe,l),en=(Ge&&Ge.flushSync)===!0;if(be&&P.initialized&&!W&&Bye(P.location,Oe)&&!(Ge&&Ge.submission&&Of(Ge.submission.formMethod))){bt(Oe,{matches:be},{flushSync:en});return}let on=Bt(be,$e,Oe.pathname);if(on.active&&on.matches&&(be=on.matches),!be){let{error:Un,notFoundMatches:_n,route:xr}=Tn(Oe.pathname);bt(Oe,{matches:_n,loaderData:{},errors:{[xr.id]:Un}},{flushSync:en});return}U=new AbortController;let tn=Yy(n.history,Oe,U.signal,Ge&&Ge.submission),Qt;if(Ge&&Ge.pendingError)Qt=[Qx(be).route.id,{type:Ls.error,error:Ge.pendingError}];else if(Ge&&Ge.submission&&Of(Ge.submission.formMethod)){let Un=await Fe(tn,Oe,Ge.submission,be,on.active,{replace:Ge.replace,flushSync:en});if(Un.shortCircuited)return;if(Un.pendingActionResult){let[_n,xr]=Un.pendingActionResult;if(Dd(xr)&&F4(xr.error)&&xr.error.status===404){U=null,bt(Oe,{matches:Un.matches,loaderData:{},errors:{[_n]:xr.error}});return}}be=Un.matches||be,Qt=Un.pendingActionResult,m=k7(Oe,Ge.submission),en=!1,on.active=!1,tn=Yy(n.history,tn.url,tn.signal)}let{shortCircuited:Pt,matches:bn,loaderData:wn,errors:zn}=await Ze(tn,Oe,be,on.active,m,Ge&&Ge.submission,Ge&&Ge.fetcherSubmission,Ge&&Ge.replace,Ge&&Ge.initialHydration===!0,en,Qt);Pt||(U=null,bt(Oe,ba({matches:bn||be},bW(Qt),{loaderData:wn,errors:zn})))}async function Fe(xe,Oe,Ge,$e,m,be){be===void 0&&(be={}),oe();let en=Hye(Oe,Ge);if(mt({navigation:en},{flushSync:be.flushSync===!0}),m){let Qt=await Ht($e,Oe.pathname,xe.signal);if(Qt.type==="aborted")return{shortCircuited:!0};if(Qt.type==="error"){let Pt=Qx(Qt.partialMatches).route.id;return{matches:Qt.partialMatches,pendingActionResult:[Pt,{type:Ls.error,error:Qt.error}]}}else if(Qt.matches)$e=Qt.matches;else{let{notFoundMatches:Pt,error:bn,route:wn}=Tn(Oe.pathname);return{matches:Pt,pendingActionResult:[wn.id,{type:Ls.error,error:bn}]}}}let on,tn=pS($e,Oe);if(!tn.route.action&&!tn.route.lazy)on={type:Ls.error,error:Ru(405,{method:xe.method,pathname:Oe.pathname,routeId:tn.route.id})};else if(on=(await pt("action",P,xe,[tn],$e,null))[tn.route.id],xe.signal.aborted)return{shortCircuited:!0};if(av(on)){let Qt;return be&&be.replace!=null?Qt=be.replace:Qt=AW(on.response.headers.get("Location"),new URL(xe.url),l,n.history)===P.location.pathname+P.location.search,await qe(xe,on,!0,{submission:Ge,replace:Qt}),{shortCircuited:!0}}if(FA(on))throw Ru(400,{type:"defer-action"});if(Dd(on)){let Qt=Qx($e,tn.route.id);return(be&&be.replace)!==!0&&(O=wo.Push),{matches:$e,pendingActionResult:[Qt.route.id,on]}}return{matches:$e,pendingActionResult:[tn.route.id,on]}}async function Ze(xe,Oe,Ge,$e,m,be,en,on,tn,Qt,Pt){let bn=m||k7(Oe,be),wn=be||en||SW(bn),zn=!X&&(!h.v7_partialHydration||!tn);if($e){if(zn){let vt=Ye(Pt);mt(ba({navigation:bn},vt!==void 0?{actionData:vt}:{}),{flushSync:Qt})}let at=await Ht(Ge,Oe.pathname,xe.signal);if(at.type==="aborted")return{shortCircuited:!0};if(at.type==="error"){let vt=Qx(at.partialMatches).route.id;return{matches:at.partialMatches,loaderData:{},errors:{[vt]:at.error}}}else if(at.matches)Ge=at.matches;else{let{error:vt,notFoundMatches:vn,route:Rn}=Tn(Oe.pathname);return{matches:vn,loaderData:{},errors:{[Rn.id]:vt}}}}let Un=o||a,[_n,xr]=pW(n.history,P,Ge,wn,Oe,h.v7_partialHydration&&tn===!0,h.v7_skipActionErrorRevalidation,W,J,ee,Ae,_e,re,Un,l,Pt);if(nt(at=>!(Ge&&Ge.some(vt=>vt.route.id===at))||_n&&_n.some(vt=>vt.route.id===at)),Z=++le,_n.length===0&&xr.length===0){let at=tt();return bt(Oe,ba({matches:Ge,loaderData:{},errors:Pt&&Dd(Pt[1])?{[Pt[0]]:Pt[1].error}:null},bW(Pt),at?{fetchers:new Map(P.fetchers)}:{}),{flushSync:Qt}),{shortCircuited:!0}}if(zn){let at={};if(!$e){at.navigation=bn;let vt=Ye(Pt);vt!==void 0&&(at.actionData=vt)}xr.length>0&&(at.fetchers=ft(xr)),mt(at,{flushSync:Qt})}xr.forEach(at=>{Qe(at.key),at.controller&&ae.set(at.key,at.controller)});let Ir=()=>xr.forEach(at=>Qe(at.key));U&&U.signal.addEventListener("abort",Ir);let{loaderResults:is,fetcherResults:si}=await Te(P,Ge,_n,xr,xe);if(xe.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",Ir),xr.forEach(at=>ae.delete(at.key));let vr=kE(is);if(vr)return await qe(xe,vr.result,!0,{replace:on}),{shortCircuited:!0};if(vr=kE(si),vr)return re.add(vr.key),await qe(xe,vr.result,!0,{replace:on}),{shortCircuited:!0};let{loaderData:Yi,errors:Vi}=vW(P,Ge,is,Pt,xr,si,te);te.forEach((at,vt)=>{at.subscribe(vn=>{(vn||at.done)&&te.delete(vt)})}),h.v7_partialHydration&&tn&&P.errors&&(Vi=ba({},P.errors,Vi));let Pe=tt(),He=Ft(Z),ce=Pe||He||xr.length>0;return ba({matches:Ge,loaderData:Yi,errors:Vi},ce?{fetchers:new Map(P.fetchers)}:{})}function Ye(xe){if(xe&&!Dd(xe[1]))return{[xe[0]]:xe[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function ft(xe){return xe.forEach(Oe=>{let Ge=P.fetchers.get(Oe.key),$e=l3(void 0,Ge?Ge.data:void 0);P.fetchers.set(Oe.key,$e)}),new Map(P.fetchers)}function At(xe,Oe,Ge,$e){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Qe(xe);let m=($e&&$e.flushSync)===!0,be=o||a,en=Mj(P.location,P.matches,l,h.v7_prependBasename,Ge,h.v7_relativeSplatPath,Oe,$e==null?void 0:$e.relative),on=Yx(be,en,l),tn=Bt(on,be,en);if(tn.active&&tn.matches&&(on=tn.matches),!on){Ne(xe,Oe,Ru(404,{pathname:en}),{flushSync:m});return}let{path:Qt,submission:Pt,error:bn}=hW(h.v7_normalizeFormMethod,!0,en,$e);if(bn){Ne(xe,Oe,bn,{flushSync:m});return}let wn=pS(on,Qt),zn=($e&&$e.preventScrollReset)===!0;if(Pt&&Of(Pt.formMethod)){Ce(xe,Oe,Qt,wn,on,tn.active,m,zn,Pt);return}_e.set(xe,{routeId:Oe,path:Qt}),Se(xe,Oe,Qt,wn,on,tn.active,m,zn,Pt)}async function Ce(xe,Oe,Ge,$e,m,be,en,on,tn){oe(),_e.delete(xe);function Qt(ln){if(!ln.route.action&&!ln.route.lazy){let kn=Ru(405,{method:tn.formMethod,pathname:Ge,routeId:Oe});return Ne(xe,Oe,kn,{flushSync:en}),!0}return!1}if(!be&&Qt($e))return;let Pt=P.fetchers.get(xe);ge(xe,Wye(tn,Pt),{flushSync:en});let bn=new AbortController,wn=Yy(n.history,Ge,bn.signal,tn);if(be){let ln=await Ht(m,new URL(wn.url).pathname,wn.signal,xe);if(ln.type==="aborted")return;if(ln.type==="error"){Ne(xe,Oe,ln.error,{flushSync:en});return}else if(ln.matches){if(m=ln.matches,$e=pS(m,Ge),Qt($e))return}else{Ne(xe,Oe,Ru(404,{pathname:Ge}),{flushSync:en});return}}ae.set(xe,bn);let zn=le,_n=(await pt("action",P,wn,[$e],m,xe))[$e.route.id];if(wn.signal.aborted){ae.get(xe)===bn&&ae.delete(xe);return}if(h.v7_fetcherPersist&&Ae.has(xe)){if(av(_n)||Dd(_n)){ge(xe,AA(void 0));return}}else{if(av(_n))if(ae.delete(xe),Z>zn){ge(xe,AA(void 0));return}else return re.add(xe),ge(xe,l3(tn)),qe(wn,_n,!1,{fetcherSubmission:tn,preventScrollReset:on});if(Dd(_n)){Ne(xe,Oe,_n.error);return}}if(FA(_n))throw Ru(400,{type:"defer-action"});let xr=P.navigation.location||P.location,Ir=Yy(n.history,xr,bn.signal),is=o||a,si=P.navigation.state!=="idle"?Yx(is,P.navigation.location,l):P.matches;gi(si,"Didn't find any matches after fetcher action");let vr=++le;Y.set(xe,vr);let Yi=l3(tn,_n.data);P.fetchers.set(xe,Yi);let[Vi,Pe]=pW(n.history,P,si,tn,xr,!1,h.v7_skipActionErrorRevalidation,W,J,ee,Ae,_e,re,is,l,[$e.route.id,_n]);Pe.filter(ln=>ln.key!==xe).forEach(ln=>{let kn=ln.key,pe=P.fetchers.get(kn),Nr=l3(void 0,pe?pe.data:void 0);P.fetchers.set(kn,Nr),Qe(kn),ln.controller&&ae.set(kn,ln.controller)}),mt({fetchers:new Map(P.fetchers)});let He=()=>Pe.forEach(ln=>Qe(ln.key));bn.signal.addEventListener("abort",He);let{loaderResults:ce,fetcherResults:at}=await Te(P,si,Vi,Pe,Ir);if(bn.signal.aborted)return;bn.signal.removeEventListener("abort",He),Y.delete(xe),ae.delete(xe),Pe.forEach(ln=>ae.delete(ln.key));let vt=kE(ce);if(vt)return qe(Ir,vt.result,!1,{preventScrollReset:on});if(vt=kE(at),vt)return re.add(vt.key),qe(Ir,vt.result,!1,{preventScrollReset:on});let{loaderData:vn,errors:Rn}=vW(P,si,ce,void 0,Pe,at,te);if(P.fetchers.has(xe)){let ln=AA(_n.data);P.fetchers.set(xe,ln)}Ft(vr),P.navigation.state==="loading"&&vr>Z?(gi(O,"Expected pending action"),U&&U.abort(),bt(P.navigation.location,{matches:si,loaderData:vn,errors:Rn,fetchers:new Map(P.fetchers)})):(mt({errors:Rn,loaderData:yW(P.loaderData,vn,si,Rn),fetchers:new Map(P.fetchers)}),W=!1)}async function Se(xe,Oe,Ge,$e,m,be,en,on,tn){let Qt=P.fetchers.get(xe);ge(xe,l3(tn,Qt?Qt.data:void 0),{flushSync:en});let Pt=new AbortController,bn=Yy(n.history,Ge,Pt.signal);if(be){let _n=await Ht(m,new URL(bn.url).pathname,bn.signal,xe);if(_n.type==="aborted")return;if(_n.type==="error"){Ne(xe,Oe,_n.error,{flushSync:en});return}else if(_n.matches)m=_n.matches,$e=pS(m,Ge);else{Ne(xe,Oe,Ru(404,{pathname:Ge}),{flushSync:en});return}}ae.set(xe,Pt);let wn=le,Un=(await pt("loader",P,bn,[$e],m,xe))[$e.route.id];if(FA(Un)&&(Un=await tB(Un,bn.signal,!0)||Un),ae.get(xe)===Pt&&ae.delete(xe),!bn.signal.aborted){if(Ae.has(xe)){ge(xe,AA(void 0));return}if(av(Un))if(Z>wn){ge(xe,AA(void 0));return}else{re.add(xe),await qe(bn,Un,!1,{preventScrollReset:on});return}if(Dd(Un)){Ne(xe,Oe,Un.error);return}gi(!FA(Un),"Unhandled fetcher deferred data"),ge(xe,AA(Un.data))}}async function qe(xe,Oe,Ge,$e){let{submission:m,fetcherSubmission:be,preventScrollReset:en,replace:on}=$e===void 0?{}:$e;Oe.response.headers.has("X-Remix-Revalidate")&&(W=!0);let tn=Oe.response.headers.get("Location");gi(tn,"Expected a Location header on the redirect Response"),tn=AW(tn,new URL(xe.url),l,n.history);let Qt=I4(P.location,tn,{_isRedirect:!0});if(t){let _n=!1;if(Oe.response.headers.has("X-Remix-Reload-Document"))_n=!0;else if(eB.test(tn)){const xr=n.history.createURL(tn);_n=xr.origin!==e.location.origin||Qm(xr.pathname,l)==null}if(_n){on?e.location.replace(tn):e.location.assign(tn);return}}U=null;let Pt=on===!0||Oe.response.headers.has("X-Remix-Replace")?wo.Replace:wo.Push,{formMethod:bn,formAction:wn,formEncType:zn}=P.navigation;!m&&!be&&bn&&wn&&zn&&(m=SW(P.navigation));let Un=m||be;if(Cye.has(Oe.response.status)&&Un&&Of(Un.formMethod))await kt(Pt,Qt,{submission:ba({},Un,{formAction:tn}),preventScrollReset:en||F,enableViewTransition:Ge?B:void 0});else{let _n=k7(Qt,m);await kt(Pt,Qt,{overrideNavigation:_n,fetcherSubmission:be,preventScrollReset:en||F,enableViewTransition:Ge?B:void 0})}}async function pt(xe,Oe,Ge,$e,m,be){let en,on={};try{en=await Dye(u,xe,Oe,Ge,$e,m,be,s,i)}catch(tn){return $e.forEach(Qt=>{on[Qt.route.id]={type:Ls.error,error:tn}}),on}for(let[tn,Qt]of Object.entries(en))if(Vye(Qt)){let Pt=Qt.result;on[tn]={type:Ls.redirect,response:Fye(Pt,Ge,tn,m,l,h.v7_relativeSplatPath)}}else on[tn]=await Iye(Qt);return on}async function Te(xe,Oe,Ge,$e,m){let be=xe.matches,en=pt("loader",xe,m,Ge,Oe,null),on=Promise.all($e.map(async Pt=>{if(Pt.matches&&Pt.match&&Pt.controller){let wn=(await pt("loader",xe,Yy(n.history,Pt.path,Pt.controller.signal),[Pt.match],Pt.matches,Pt.key))[Pt.match.route.id];return{[Pt.key]:wn}}else return Promise.resolve({[Pt.key]:{type:Ls.error,error:Ru(404,{pathname:Pt.path})}})})),tn=await en,Qt=(await on).reduce((Pt,bn)=>Object.assign(Pt,bn),{});return await Promise.all([qye(Oe,tn,m.signal,be,xe.loaderData),$ye(Oe,Qt,$e)]),{loaderResults:tn,fetcherResults:Qt}}function oe(){W=!0,J.push(...nt()),_e.forEach((xe,Oe)=>{ae.has(Oe)&&ee.add(Oe),Qe(Oe)})}function ge(xe,Oe,Ge){Ge===void 0&&(Ge={}),P.fetchers.set(xe,Oe),mt({fetchers:new Map(P.fetchers)},{flushSync:(Ge&&Ge.flushSync)===!0})}function Ne(xe,Oe,Ge,$e){$e===void 0&&($e={});let m=Qx(P.matches,Oe);Xe(xe),mt({errors:{[m.route.id]:Ge},fetchers:new Map(P.fetchers)},{flushSync:($e&&$e.flushSync)===!0})}function ke(xe){return Ee.set(xe,(Ee.get(xe)||0)+1),Ae.has(xe)&&Ae.delete(xe),P.fetchers.get(xe)||Nye}function Xe(xe){let Oe=P.fetchers.get(xe);ae.has(xe)&&!(Oe&&Oe.state==="loading"&&Y.has(xe))&&Qe(xe),_e.delete(xe),Y.delete(xe),re.delete(xe),h.v7_fetcherPersist&&Ae.delete(xe),ee.delete(xe),P.fetchers.delete(xe)}function et(xe){let Oe=(Ee.get(xe)||0)-1;Oe<=0?(Ee.delete(xe),Ae.add(xe),h.v7_fetcherPersist||Xe(xe)):Ee.set(xe,Oe),mt({fetchers:new Map(P.fetchers)})}function Qe(xe){let Oe=ae.get(xe);Oe&&(Oe.abort(),ae.delete(xe))}function lt(xe){for(let Oe of xe){let Ge=ke(Oe),$e=AA(Ge.data);P.fetchers.set(Oe,$e)}}function tt(){let xe=[],Oe=!1;for(let Ge of re){let $e=P.fetchers.get(Ge);gi($e,"Expected fetcher: "+Ge),$e.state==="loading"&&(re.delete(Ge),xe.push(Ge),Oe=!0)}return lt(xe),Oe}function Ft(xe){let Oe=[];for(let[Ge,$e]of Y)if($e<xe){let m=P.fetchers.get(Ge);gi(m,"Expected fetcher: "+Ge),m.state==="loading"&&(Qe(Ge),Y.delete(Ge),Oe.push(Ge))}return lt(Oe),Oe.length>0}function Mt(xe,Oe){let Ge=P.blockers.get(xe)||o3;return ve.get(xe)!==Oe&&ve.set(xe,Oe),Ge}function Nt(xe){P.blockers.delete(xe),ve.delete(xe)}function Je(xe,Oe){let Ge=P.blockers.get(xe)||o3;gi(Ge.state==="unblocked"&&Oe.state==="blocked"||Ge.state==="blocked"&&Oe.state==="blocked"||Ge.state==="blocked"&&Oe.state==="proceeding"||Ge.state==="blocked"&&Oe.state==="unblocked"||Ge.state==="proceeding"&&Oe.state==="unblocked","Invalid blocker state transition: "+Ge.state+" -> "+Oe.state);let $e=new Map(P.blockers);$e.set(xe,Oe),mt({blockers:$e})}function fn(xe){let{currentLocation:Oe,nextLocation:Ge,historyAction:$e}=xe;if(ve.size===0)return;ve.size>1&&Hv(!1,"A router only supports one blocker at a time");let m=Array.from(ve.entries()),[be,en]=m[m.length-1],on=P.blockers.get(be);if(!(on&&on.state==="proceeding")&&en({currentLocation:Oe,nextLocation:Ge,historyAction:$e}))return be}function Tn(xe){let Oe=Ru(404,{pathname:xe}),Ge=o||a,{matches:$e,route:m}=wW(Ge);return nt(),{notFoundMatches:$e,route:m,error:Oe}}function nt(xe){let Oe=[];return te.forEach((Ge,$e)=>{(!xe||xe($e))&&(Ge.cancel(),Oe.push($e),te.delete($e))}),Oe}function Kt(xe,Oe,Ge){if(g=xe,x=Oe,A=Ge||null,!b&&P.navigation===M7){b=!0;let $e=dn(P.location,P.matches);$e!=null&&mt({restoreScrollPosition:$e})}return()=>{g=null,x=null,A=null}}function Lt(xe,Oe){return A&&A(xe,Oe.map($e=>iye($e,P.loaderData)))||xe.key}function cn(xe,Oe){if(g&&x){let Ge=Lt(xe,Oe);g[Ge]=x()}}function dn(xe,Oe){if(g){let Ge=Lt(xe,Oe),$e=g[Ge];if(typeof $e=="number")return $e}return null}function Bt(xe,Oe,Ge){if(d)if(xe){if(Object.keys(xe[0].params).length>0)return{active:!0,matches:QN(Oe,Ge,l,!0)}}else return{active:!0,matches:QN(Oe,Ge,l,!0)||[]};return{active:!1,matches:null}}async function Ht(xe,Oe,Ge,$e){if(!d)return{type:"success",matches:xe};let m=xe;for(;;){let be=o==null,en=o||a,on=s;try{await d({signal:Ge,path:Oe,matches:m,fetcherKey:$e,patch:(Pt,bn)=>{Ge.aborted||gW(Pt,bn,en,on,i)}})}catch(Pt){return{type:"error",error:Pt,partialMatches:m}}finally{be&&!Ge.aborted&&(a=[...a])}if(Ge.aborted)return{type:"aborted"};let tn=Yx(en,Oe,l);if(tn)return{type:"success",matches:tn};let Qt=QN(en,Oe,l,!0);if(!Qt||m.length===Qt.length&&m.every((Pt,bn)=>Pt.route.id===Qt[bn].route.id))return{type:"success",matches:null};m=Qt}}function qt(xe){s={},o=J6(xe,i,void 0,s)}function Fn(xe,Oe){let Ge=o==null;gW(xe,Oe,o||a,s,i),Ge&&(a=[...a],mt({}))}return D={get basename(){return l},get future(){return h},get state(){return P},get routes(){return a},get window(){return e},initialize:Ue,subscribe:yt,enableScrollRestoration:Kt,navigate:dt,fetch:At,revalidate:St,createHref:xe=>n.history.createHref(xe),encodeLocation:xe=>n.history.encodeLocation(xe),getFetcher:ke,deleteFetcher:et,dispose:ze,getBlocker:Mt,deleteBlocker:Nt,patchRoutes:Fn,_internalFetchControllers:ae,_internalActiveDeferreds:te,_internalSetRoutes:qt},D}function Rye(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function Mj(n,e,t,r,i,s,a,o){let l,u;if(a){l=[];for(let h of e)if(l.push(h),h.route.id===a){u=h;break}}else l=e,u=e[e.length-1];let d=b8(i||".",y8(l,s),Qm(n.pathname,t)||n.pathname,o==="path");if(i==null&&(d.search=n.search,d.hash=n.hash),(i==null||i===""||i===".")&&u){let h=nB(d.search);if(u.route.index&&!h)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let f=new URLSearchParams(d.search),p=f.getAll("index");f.delete("index"),p.filter(A=>A).forEach(A=>f.append("index",A));let g=f.toString();d.search=g?"?"+g:""}}return r&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Vm([t,d.pathname])),Wv(d)}function hW(n,e,t,r){if(!r||!Rye(r))return{path:t};if(r.formMethod&&!Gye(r.formMethod))return{path:t,error:Ru(405,{method:r.formMethod})};let i=()=>({path:t,error:Ru(400,{type:"invalid-body"})}),s=r.formMethod||"get",a=n?s.toUpperCase():s.toLowerCase(),o=Qie(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Of(a))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,g)=>{let[A,x]=g;return""+p+A+"="+x+` 58`},""):String(r.body);return{path:t,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!Of(a))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}gi(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=Rj(r.formData),u=r.formData;else if(r.body instanceof FormData)l=Rj(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=xW(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=xW(l)}catch{return i()}let d={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Of(d.formMethod))return{path:t,submission:d};let h=U1(t);return e&&h.search&&nB(h.search)&&l.append("index",""),h.search="?"+l,{path:Wv(h),submission:d}}function fW(n,e,t){t===void 0&&(t=!1);let r=n.findIndex(i=>i.route.id===e);return r>=0?n.slice(0,t?r+1:r):n}function pW(n,e,t,r,i,s,a,o,l,u,d,h,f,p,g,A){let x=A?Dd(A[1])?A[1].error:A[1].data:void 0,b=n.createURL(e.location),_=n.createURL(i),M=t;s&&e.errors?M=fW(t,Object.keys(e.errors)[0],!0):A&&Dd(A[1])&&(M=fW(t,A[0]));let T=A?A[1].statusCode:void 0,L=a&&T&&T>=400,D=M.filter((O,F)=>{let{route:U}=O;if(U.lazy)return!0;if(U.loader==null)return!1;if(s)return kj(U,e.loaderData,e.errors);if(Pye(e.loaderData,e.matches[F],O)||l.some(H=>H===O.route.id))return!0;let B=e.matches[F],z=O;return mW(O,ba({currentUrl:b,currentParams:B.params,nextUrl:_,nextParams:z.params},r,{actionResult:x,actionStatus:T,defaultShouldRevalidate:L?!1:o||b.pathname+b.search===_.pathname+_.search||b.search!==_.search||Xie(B,z)}))}),P=[];return h.forEach((O,F)=>{if(s||!t.some(X=>X.route.id===O.routeId)||d.has(F))return;let U=Yx(p,O.path,g);if(!U){P.push({key:F,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let B=e.fetchers.get(F),z=pS(U,O.path),H=!1;f.has(F)?H=!1:u.has(F)?(u.delete(F),H=!0):B&&B.state!=="idle"&&B.data===void 0?H=o:H=mW(z,ba({currentUrl:b,currentParams:e.matches[e.matches.length-1].params,nextUrl:_,nextParams:t[t.length-1].params},r,{actionResult:x,actionStatus:T,defaultShouldRevalidate:L?!1:o})),H&&P.push({key:F,routeId:O.routeId,path:O.path,matches:U,match:z,controller:new AbortController})}),[D,P]}function kj(n,e,t){if(n.lazy)return!0;if(!n.loader)return!1;let r=e!=null&&e[n.id]!==void 0,i=t!=null&&t[n.id]!==void 0;return!r&&i?!1:typeof n.loader=="function"&&n.loader.hydrate===!0?!0:!r&&!i}function Pye(n,e,t){let r=!e||t.route.id!==e.route.id,i=n[t.route.id]===void 0;return r||i}function Xie(n,e){let t=n.route.path;return n.pathname!==e.pathname||t!=null&&t.endsWith("*")&&n.params["*"]!==e.params["*"]}function mW(n,e){if(n.route.shouldRevalidate){let t=n.route.shouldRevalidate(e);if(typeof t=="boolean")return t}return e.defaultShouldRevalidate}function gW(n,e,t,r,i){var s;let a;if(n){let u=r[n];gi(u,"No route found to patch children into: routeId = "+n),u.children||(u.children=[]),a=u.children}else a=t;let o=e.filter(u=>!a.some(d=>Yie(u,d))),l=J6(o,i,[n||"_","patch",String(((s=a)==null?void 0:s.length)||"0")],r);a.push(...l)}function Yie(n,e){return"id"in n&&"id"in e&&n.id===e.id?!0:n.index===e.index&&n.path===e.path&&n.caseSensitive===e.caseSensitive?(!n.children||n.children.length===0)&&(!e.children||e.children.length===0)?!0:n.children.every((t,r)=>{var i;return(i=e.children)==null?void 0:i.some(s=>Yie(t,s))}):!1}async function Lye(n,e,t){if(!n.lazy)return;let r=await n.lazy();if(!n.lazy)return;let i=t[n.id];gi(i,"No route found in manifest");let s={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Hv(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!nye.has(a)&&(s[a]=r[a])}Object.assign(i,s),Object.assign(i,ba({},e(i),{lazy:void 0}))}async function Oye(n){let{matches:e}=n,t=e.filter(i=>i.shouldLoad);return(await Promise.all(t.map(i=>i.resolve()))).reduce((i,s,a)=>Object.assign(i,{[t[a].route.id]:s}),{})}async function Dye(n,e,t,r,i,s,a,o,l,u){let d=s.map(p=>p.route.lazy?Lye(p.route,l,o):void 0),h=s.map((p,g)=>{let A=d[g],x=i.some(_=>_.route.id===p.route.id);return ba({},p,{shouldLoad:x,resolve:async _=>(_&&r.method==="GET"&&(p.route.lazy||p.route.loader)&&(x=!0),x?jye(e,r,p,A,_,u):Promise.resolve({type:Ls.data,result:void 0}))})}),f=await n({matches:h,request:r,params:s[0].params,fetcherKey:a,context:u});try{await Promise.all(d)}catch{}return f}async function jye(n,e,t,r,i,s){let a,o,l=u=>{let d,h=new Promise((g,A)=>d=A);o=()=>d(),e.signal.addEventListener("abort",o);let f=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+n+'" [routeId: '+t.route.id+"]"))):u({request:e,params:t.params,context:s},...g!==void 0?[g]:[]),p=(async()=>{try{return{type:"data",result:await(i?i(A=>f(A)):f())}}catch(g){return{type:"error",result:g}}})();return Promise.race([p,h])};try{let u=t.route[n];if(r)if(u){let d,[h]=await Promise.all([l(u).catch(f=>{d=f}),r]);if(d!==void 0)throw d;a=h}else if(await r,u=t.route[n],u)a=await l(u);else if(n==="action"){let d=new URL(e.url),h=d.pathname+d.search;throw Ru(405,{method:e.method,pathname:h,routeId:t.route.id})}else return{type:Ls.data,result:void 0};else if(u)a=await l(u);else{let d=new URL(e.url),h=d.pathname+d.search;throw Ru(404,{pathname:h})}gi(a.result!==void 0,"You defined "+(n==="action"?"an action":"a loader")+" for route "+('"'+t.route.id+"\" but didn't return anything from your `"+n+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Ls.error,result:u}}finally{o&&e.signal.removeEventListener("abort",o)}return a}async function Iye(n){let{result:e,type:t}=n;if(Kie(e)){let h;try{let f=e.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?e.body==null?h=null:h=await e.json():h=await e.text()}catch(f){return{type:Ls.error,error:f}}return t===Ls.error?{type:Ls.error,error:new tM(e.status,e.statusText,h),statusCode:e.status,headers:e.headers}:{type:Ls.data,data:h,statusCode:e.status,headers:e.headers}}if(t===Ls.error){if(_W(e)){var r,i;if(e.data instanceof Error){var s,a;return{type:Ls.error,error:e.data,statusCode:(s=e.init)==null?void 0:s.status,headers:(a=e.init)!=null&&a.headers?new Headers(e.init.headers):void 0}}return{type:Ls.error,error:new tM(((r=e.init)==null?void 0:r.status)||500,void 0,e.data),statusCode:F4(e)?e.status:void 0,headers:(i=e.init)!=null&&i.headers?new Headers(e.init.headers):void 0}}return{type:Ls.error,error:e,statusCode:F4(e)?e.status:void 0}}if(zye(e)){var o,l;return{type:Ls.deferred,deferredData:e,statusCode:(o=e.init)==null?void 0:o.status,headers:((l=e.init)==null?void 0:l.headers)&&new Headers(e.init.headers)}}if(_W(e)){var u,d;return{type:Ls.data,data:e.data,statusCode:(u=e.init)==null?void 0:u.status,headers:(d=e.init)!=null&&d.headers?new Headers(e.init.headers):void 0}}return{type:Ls.data,data:e}}function Fye(n,e,t,r,i,s){let a=n.headers.get("Location");if(gi(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!eB.test(a)){let o=r.slice(0,r.findIndex(l=>l.route.id===t)+1);a=Mj(new URL(e.url),o,i,!0,a,s),n.headers.set("Location",a)}return n}function AW(n,e,t,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(eB.test(n)){let s=n,a=s.startsWith("//")?new URL(e.protocol+s):new URL(s);if(i.includes(a.protocol))throw new Error("Invalid redirect location");let o=Qm(a.pathname,t)!=null;if(a.origin===e.origin&&o)return a.pathname+a.search+a.hash}try{let s=r.createURL(n);if(i.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return n}function Yy(n,e,t,r){let i=n.createURL(Qie(e)).toString(),s={signal:t};if(r&&Of(r.formMethod)){let{formMethod:a,formEncType:o}=r;s.method=a.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(r.json)):o==="text/plain"?s.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?s.body=Rj(r.formData):s.body=r.formData}return new Request(i,s)}function Rj(n){let e=new URLSearchParams;for(let[t,r]of n.entries())e.append(t,typeof r=="string"?r:r.name);return e}function xW(n){let e=new FormData;for(let[t,r]of n.entries())e.append(t,r);return e}function Uye(n,e,t,r,i){let s={},a=null,o,l=!1,u={},d=t&&Dd(t[1])?t[1].error:void 0;return n.forEach(h=>{if(!(h.route.id in e))return;let f=h.route.id,p=e[f];if(gi(!av(p),"Cannot handle redirect results in processLoaderData"),Dd(p)){let g=p.error;d!==void 0&&(g=d,d=void 0),a=a||{};{let A=Qx(n,f);a[A.route.id]==null&&(a[A.route.id]=g)}s[f]=void 0,l||(l=!0,o=F4(p.error)?p.error.status:500),p.headers&&(u[f]=p.headers)}else FA(p)?(r.set(f,p.deferredData),s[f]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!l&&(o=p.statusCode),p.headers&&(u[f]=p.headers)):(s[f]=p.data,p.statusCode&&p.statusCode!==200&&!l&&(o=p.statusCode),p.headers&&(u[f]=p.headers))}),d!==void 0&&t&&(a={[t[0]]:d},s[t[0]]=void 0),{loaderData:s,errors:a,statusCode:o||200,loaderHeaders:u}}function vW(n,e,t,r,i,s,a){let{loaderData:o,errors:l}=Uye(e,t,r,a);return i.forEach(u=>{let{key:d,match:h,controller:f}=u,p=s[d];if(gi(p,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Dd(p)){let g=Qx(n.matches,h==null?void 0:h.route.id);l&&l[g.route.id]||(l=ba({},l,{[g.route.id]:p.error})),n.fetchers.delete(d)}else if(av(p))gi(!1,"Unhandled fetcher revalidation redirect");else if(FA(p))gi(!1,"Unhandled fetcher deferred data");else{let g=AA(p.data);n.fetchers.set(d,g)}}),{loaderData:o,errors:l}}function yW(n,e,t,r){let i=ba({},e);for(let s of t){let a=s.route.id;if(e.hasOwnProperty(a)?e[a]!==void 0&&(i[a]=e[a]):n[a]!==void 0&&s.route.loader&&(i[a]=n[a]),r&&r.hasOwnProperty(a))break}return i}function bW(n){return n?Dd(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function Qx(n,e){return(e?n.slice(0,n.findIndex(r=>r.route.id===e)+1):[...n]).reverse().find(r=>r.route.hasErrorBoundary===!0)||n[0]}function wW(n){let e=n.length===1?n[0]:n.find(t=>t.index||!t.path||t.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Ru(n,e){let{pathname:t,routeId:r,method:i,type:s,message:a}=e===void 0?{}:e,o="Unknown Server Error",l="Unknown @remix-run/router error";return n===400?(o="Bad Request",i&&t&&r?l="You made a "+i+' request to "'+t+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?l="defer() is not supported in actions":s==="invalid-body"&&(l="Unable to encode submission body")):n===403?(o="Forbidden",l='Route "'+r+'" does not match URL "'+t+'"'):n===404?(o="Not Found",l='No route matches URL "'+t+'"'):n===405&&(o="Method Not Allowed",i&&t&&r?l="You made a "+i.toUpperCase()+' request to "'+t+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new tM(n||500,o,new Error(l),!0)}function kE(n){let e=Object.entries(n);for(let t=e.length-1;t>=0;t--){let[r,i]=e[t];if(av(i))return{key:r,result:i}}}function Qie(n){let e=typeof n=="string"?U1(n):n;return Wv(ba({},e,{hash:""}))}function Bye(n,e){return n.pathname!==e.pathname||n.search!==e.search?!1:n.hash===""?e.hash!=="":n.hash===e.hash?!0:e.hash!==""}function Vye(n){return Kie(n.result)&&Eye.has(n.result.status)}function FA(n){return n.type===Ls.deferred}function Dd(n){return n.type===Ls.error}function av(n){return(n&&n.type)===Ls.redirect}function _W(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function zye(n){let e=n;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function Kie(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function Gye(n){return Tye.has(n.toLowerCase())}function Of(n){return _ye.has(n.toLowerCase())}async function qye(n,e,t,r,i){let s=Object.entries(e);for(let a=0;a<s.length;a++){let[o,l]=s[a],u=n.find(f=>(f==null?void 0:f.route.id)===o);if(!u)continue;let d=r.find(f=>f.route.id===u.route.id),h=d!=null&&!Xie(d,u)&&(i&&i[u.route.id])!==void 0;FA(l)&&h&&await tB(l,t,!1).then(f=>{f&&(e[o]=f)})}}async function $ye(n,e,t){for(let r=0;r<t.length;r++){let{key:i,routeId:s,controller:a}=t[r],o=e[i];n.find(u=>(u==null?void 0:u.route.id)===s)&&FA(o)&&(gi(a,"Expected an AbortController for revalidating fetcher deferred result"),await tB(o,a.signal,!0).then(u=>{u&&(e[i]=u)}))}}async function tB(n,e,t){if(t===void 0&&(t=!1),!await n.deferredData.resolveData(e)){if(t)try{return{type:Ls.data,data:n.deferredData.unwrappedData}}catch(i){return{type:Ls.error,error:i}}return{type:Ls.data,data:n.deferredData.data}}}function nB(n){return new URLSearchParams(n).getAll("index").some(e=>e==="")}function pS(n,e){let t=typeof e=="string"?U1(e).search:e.search;if(n[n.length-1].route.index&&nB(t||""))return n[n.length-1];let r=$ie(n);return r[r.length-1]}function SW(n){let{formMethod:e,formAction:t,formEncType:r,text:i,formData:s,json:a}=n;if(!(!e||!t||!r)){if(i!=null)return{formMethod:e,formAction:t,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:t,formEncType:r,formData:s,json:void 0,text:void 0};if(a!==void 0)return{formMethod:e,formAction:t,formEncType:r,formData:void 0,json:a,text:void 0}}}function k7(n,e){return e?{state:"loading",location:n,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Hye(n,e){return{state:"submitting",location:n,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function l3(n,e){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Wye(n,e){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:e?e.data:void 0}}function AA(n){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function Xye(n,e){try{let t=n.sessionStorage.getItem(Wie);if(t){let r=JSON.parse(t);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function Yye(n,e){if(e.size>0){let t={};for(let[r,i]of e)t[r]=[...i];try{n.sessionStorage.setItem(Wie,JSON.stringify(t))}catch(r){Hv(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** 59 * React Router v6.30.3 60 * 61 * Copyright (c) Remix Software Inc. 62 * 63 * This source code is licensed under the MIT license found in the 64 * LICENSE.md file in the root directory of this source tree. 65 * 66 * @license MIT 67 */function nM(){return nM=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},nM.apply(this,arguments)}const rT=G.createContext(null),rB=G.createContext(null),ug=G.createContext(null),iB=G.createContext(null),I0=G.createContext({outlet:null,matches:[],isDataRoute:!1}),Zie=G.createContext(null);function Qye(n,e){let{relative:t}=e===void 0?{}:e;m_()||gi(!1);let{basename:r,navigator:i}=G.useContext(ug),{hash:s,pathname:a,search:o}=w8(n,{relative:t}),l=a;return r!=="/"&&(l=a==="/"?r:Vm([r,a])),i.createHref({pathname:l,search:o,hash:s})}function m_(){return G.useContext(iB)!=null}function po(){return m_()||gi(!1),G.useContext(iB).location}function Jie(n){G.useContext(ug).static||G.useLayoutEffect(n)}function ro(){let{isDataRoute:n}=G.useContext(I0);return n?c2e():Kye()}function Kye(){m_()||gi(!1);let n=G.useContext(rT),{basename:e,future:t,navigator:r}=G.useContext(ug),{matches:i}=G.useContext(I0),{pathname:s}=po(),a=JSON.stringify(y8(i,t.v7_relativeSplatPath)),o=G.useRef(!1);return Jie(()=>{o.current=!0}),G.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let h=b8(u,JSON.parse(a),s,d.relative==="path");n==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Vm([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,a,s,n])}const Zye=G.createContext(null);function Jye(n){let e=G.useContext(I0).outlet;return e&&G.createElement(Zye.Provider,{value:n},e)}function ese(){let{matches:n}=G.useContext(I0),e=n[n.length-1];return e?e.params:{}}function w8(n,e){let{relative:t}=e===void 0?{}:e,{future:r}=G.useContext(ug),{matches:i}=G.useContext(I0),{pathname:s}=po(),a=JSON.stringify(y8(i,r.v7_relativeSplatPath));return G.useMemo(()=>b8(n,JSON.parse(a),s,t==="path"),[n,a,s,t])}function e2e(n,e,t,r){m_()||gi(!1);let{navigator:i}=G.useContext(ug),{matches:s}=G.useContext(I0),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=po(),d;d=u;let h=d.pathname||"/",f=h;if(l!=="/"){let A=l.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(A.length).join("/")}let p=Yx(n,{pathname:f});return s2e(p&&p.map(A=>Object.assign({},A,{params:Object.assign({},o,A.params),pathname:Vm([l,i.encodeLocation?i.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?l:Vm([l,i.encodeLocation?i.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),s,t,r)}function t2e(){let n=ise(),e=F4(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return G.createElement(G.Fragment,null,G.createElement("h2",null,"Unexpected Application Error!"),G.createElement("h3",{style:{fontStyle:"italic"}},e),t?G.createElement("pre",{style:i},t):null,null)}const n2e=G.createElement(t2e,null);class r2e extends G.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?G.createElement(I0.Provider,{value:this.props.routeContext},G.createElement(Zie.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function i2e(n){let{routeContext:e,match:t,children:r}=n,i=G.useContext(rT);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),G.createElement(I0.Provider,{value:e},r)}function s2e(n,e,t,r){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),r===void 0&&(r=null),n==null){var s;if(!t)return null;if(t.errors)n=t.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let a=n,o=(i=t)==null?void 0:i.errors;if(o!=null){let d=a.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||gi(!1),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,u=-1;if(t&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let h=a[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:p}=t,g=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||g){l=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,h,f)=>{let p,g=!1,A=null,x=null;t&&(p=o&&h.route.id?o[h.route.id]:void 0,A=h.route.errorElement||n2e,l&&(u<0&&f===0?(u2e("route-fallback"),g=!0,x=null):u===f&&(g=!0,x=h.route.hydrateFallbackElement||null)));let b=e.concat(a.slice(0,f+1)),_=()=>{let M;return p?M=A:g?M=x:h.route.Component?M=G.createElement(h.route.Component,null):h.route.element?M=h.route.element:M=d,G.createElement(i2e,{match:h,routeContext:{outlet:d,matches:b,isDataRoute:t!=null},children:M})};return t&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?G.createElement(r2e,{location:t.location,revalidation:t.revalidation,component:A,error:p,children:_(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):_()},null)}var tse=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})(tse||{}),nse=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(nse||{});function a2e(n){let e=G.useContext(rT);return e||gi(!1),e}function o2e(n){let e=G.useContext(rB);return e||gi(!1),e}function l2e(n){let e=G.useContext(I0);return e||gi(!1),e}function rse(n){let e=l2e(),t=e.matches[e.matches.length-1];return t.route.id||gi(!1),t.route.id}function ise(){var n;let e=G.useContext(Zie),t=o2e(),r=rse();return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function c2e(){let{router:n}=a2e(tse.UseNavigateStable),e=rse(nse.UseNavigateStable),t=G.useRef(!1);return Jie(()=>{t.current=!0}),G.useCallback(function(i,s){s===void 0&&(s={}),t.current&&(typeof i=="number"?n.navigate(i):n.navigate(i,nM({fromRouteId:e},s)))},[n,e])}const TW={};function u2e(n,e,t){TW[n]||(TW[n]=!0)}function d2e(n,e){n==null||n.v7_startTransition,(n==null?void 0:n.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function sse(n){let{to:e,replace:t,state:r,relative:i}=n;m_()||gi(!1);let{future:s,static:a}=G.useContext(ug),{matches:o}=G.useContext(I0),{pathname:l}=po(),u=ro(),d=b8(e,y8(o,s.v7_relativeSplatPath),l,i==="path"),h=JSON.stringify(d);return G.useEffect(()=>u(JSON.parse(h),{replace:t,state:r,relative:i}),[u,h,i,t,r]),null}function EW(n){return Jye(n.context)}function h2e(n){let{basename:e="/",children:t=null,location:r,navigationType:i=wo.Pop,navigator:s,static:a=!1,future:o}=n;m_()&&gi(!1);let l=e.replace(/^\/*/,"/"),u=G.useMemo(()=>({basename:l,navigator:s,static:a,future:nM({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof r=="string"&&(r=U1(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:g="default"}=r,A=G.useMemo(()=>{let x=Qm(d,l);return x==null?null:{location:{pathname:x,search:h,hash:f,state:p,key:g},navigationType:i}},[l,d,h,f,p,g,i]);return A==null?null:G.createElement(ug.Provider,{value:u},G.createElement(iB.Provider,{children:t,value:A}))}new Promise(()=>{});function f2e(n){let e={hasErrorBoundary:n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&Object.assign(e,{element:G.createElement(n.Component),Component:void 0}),n.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:G.createElement(n.HydrateFallback),HydrateFallback:void 0}),n.ErrorBoundary&&Object.assign(e,{errorElement:G.createElement(n.ErrorBoundary),ErrorBoundary:void 0}),e}/** 68 * React Router DOM v6.30.3 69 * 70 * Copyright (c) Remix Software Inc. 71 * 72 * This source code is licensed under the MIT license found in the 73 * LICENSE.md file in the root directory of this source tree. 74 * 75 * @license MIT 76 */function Hb(){return Hb=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Hb.apply(this,arguments)}function ase(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function p2e(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function m2e(n,e){return n.button===0&&(!e||e==="_self")&&!p2e(n)}function Pj(n){return n===void 0&&(n=""),new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let r=n[t];return e.concat(Array.isArray(r)?r.map(i=>[t,i]):[[t,r]])},[]))}function g2e(n,e){let t=Pj(n);return e&&e.forEach((r,i)=>{t.has(i)||e.getAll(i).forEach(s=>{t.append(i,s)})}),t}const A2e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],x2e=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],v2e="6";try{window.__reactRouterVersion=v2e}catch{}function y2e(n,e){return kye({basename:void 0,future:Hb({},void 0,{v7_prependBasename:!0}),history:Jve({window:void 0}),hydrationData:b2e(),routes:n,mapRouteProperties:f2e,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function b2e(){var n;let e=(n=window)==null?void 0:n.__staticRouterHydrationData;return e&&e.errors&&(e=Hb({},e,{errors:w2e(e.errors)})),e}function w2e(n){if(!n)return null;let e=Object.entries(n),t={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")t[r]=new tM(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let a=new s(i.message);a.stack="",t[r]=a}catch{}}if(t[r]==null){let s=new Error(i.message);s.stack="",t[r]=s}}else t[r]=i;return t}const ose=G.createContext({isTransitioning:!1}),_2e=G.createContext(new Map),S2e="startTransition",CW=$b[S2e],T2e="flushSync",NW=Ove[T2e];function E2e(n){CW?CW(n):n()}function c3(n){NW?NW(n):n()}class C2e{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}}function N2e(n){let{fallbackElement:e,router:t,future:r}=n,[i,s]=G.useState(t.state),[a,o]=G.useState(),[l,u]=G.useState({isTransitioning:!1}),[d,h]=G.useState(),[f,p]=G.useState(),[g,A]=G.useState(),x=G.useRef(new Map),{v7_startTransition:b}=r||{},_=G.useCallback(O=>{b?E2e(O):O()},[b]),M=G.useCallback((O,F)=>{let{deletedFetchers:U,flushSync:B,viewTransitionOpts:z}=F;O.fetchers.forEach((X,W)=>{X.data!==void 0&&x.current.set(W,X.data)}),U.forEach(X=>x.current.delete(X));let H=t.window==null||t.window.document==null||typeof t.window.document.startViewTransition!="function";if(!z||H){B?c3(()=>s(O)):_(()=>s(O));return}if(B){c3(()=>{f&&(d&&d.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:z.currentLocation,nextLocation:z.nextLocation})});let X=t.window.document.startViewTransition(()=>{c3(()=>s(O))});X.finished.finally(()=>{c3(()=>{h(void 0),p(void 0),o(void 0),u({isTransitioning:!1})})}),c3(()=>p(X));return}f?(d&&d.resolve(),f.skipTransition(),A({state:O,currentLocation:z.currentLocation,nextLocation:z.nextLocation})):(o(O),u({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}))},[t.window,f,d,x,_]);G.useLayoutEffect(()=>t.subscribe(M),[t,M]),G.useEffect(()=>{l.isTransitioning&&!l.flushSync&&h(new C2e)},[l]),G.useEffect(()=>{if(d&&a&&t.window){let O=a,F=d.promise,U=t.window.document.startViewTransition(async()=>{_(()=>s(O)),await F});U.finished.finally(()=>{h(void 0),p(void 0),o(void 0),u({isTransitioning:!1})}),p(U)}},[_,a,d,t.window]),G.useEffect(()=>{d&&a&&i.location.key===a.location.key&&d.resolve()},[d,f,i.location,a]),G.useEffect(()=>{!l.isTransitioning&&g&&(o(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),A(void 0))},[l.isTransitioning,g]),G.useEffect(()=>{},[]);let T=G.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:O=>t.navigate(O),push:(O,F,U)=>t.navigate(O,{state:F,preventScrollReset:U==null?void 0:U.preventScrollReset}),replace:(O,F,U)=>t.navigate(O,{replace:!0,state:F,preventScrollReset:U==null?void 0:U.preventScrollReset})}),[t]),L=t.basename||"/",D=G.useMemo(()=>({router:t,navigator:T,static:!1,basename:L}),[t,T,L]),P=G.useMemo(()=>({v7_relativeSplatPath:t.future.v7_relativeSplatPath}),[t.future.v7_relativeSplatPath]);return G.useEffect(()=>d2e(r,t.future),[r,t.future]),G.createElement(G.Fragment,null,G.createElement(rT.Provider,{value:D},G.createElement(rB.Provider,{value:i},G.createElement(_2e.Provider,{value:x.current},G.createElement(ose.Provider,{value:l},G.createElement(h2e,{basename:L,location:i.location,navigationType:i.historyAction,navigator:T,future:P},i.initialized||t.future.v7_partialHydration?G.createElement(M2e,{routes:t.routes,future:t.future,state:i}):e))))),null)}const M2e=G.memo(k2e);function k2e(n){let{routes:e,future:t,state:r}=n;return e2e(e,void 0,r,t)}const R2e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P2e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ks=G.forwardRef(function(e,t){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:l,to:u,preventScrollReset:d,viewTransition:h}
76=e,f=ase(e,A2e),{basename:p}=G.useContext(ug),g,A=!1;if(typeof u=="string"&&P2e.test(u)&&(g=u,R2e))try{let M=new URL(window.location.href),T=u.startsWith("//")?new URL(M.protocol+u):new URL(u),L=Qm(T.pathname,p);T.origin===M.origin&&L!=null?u=L+T.search+T.hash:A=!0}catch{}let x=Qye(u,{relative:i}),b=O2e(u,{replace:a,state:o,target:l,preventScrollReset:d,relative:i,viewTransition:h});function _(M){r&&r(M),M.defaultPrevented||b(M)}return G.createElement("a",Hb({},f,{href:g||x,onClick:A||s?r:_,ref:t,target:l}))}),lse=G.forwardRef(function(e,t){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:a=!1,style:o,to:l,viewTransition:u,children:d}=e,h=ase(e,x2e),f=w8(l,{relative:h.relative}),p=po(),g=G.useContext(rB),{navigator:A,basename:x}=G.useContext(ug),b=g!=null&&j2e(f)&&u===!0,_=A.encodeLocation?A.encodeLocation(f).pathname:f.pathname,M=p.pathname,T=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(M=M.toLowerCase(),T=T?T.toLowerCase():null,_=_.toLowerCase()),T&&x&&(T=Qm(T,x)||T);const L=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let D=M===_||!a&&M.startsWith(_)&&M.charAt(L)==="/",P=T!=null&&(T===_||!a&&T.startsWith(_)&&T.charAt(_.length)==="/"),O={isActive:D,isPending:P,isTransitioning:b},F=D?r:void 0,U;typeof s=="function"?U=s(O):U=[s,D?"active":null,P?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(O):o;return G.createElement(Ks,Hb({},h,{"aria-current":F,className:U,ref:t,style:B,to:l,viewTransition:u}),typeof d=="function"?d(O):d)});var Lj;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(Lj||(Lj={}));var MW;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(MW||(MW={}));function L2e(n){let e=G.useContext(rT);return e||gi(!1),e}function O2e(n,e){let{target:t,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:o}=e===void 0?{}:e,l=ro(),u=po(),d=w8(n,{relative:a});return G.useCallback(h=>{if(m2e(h,t)){h.preventDefault();let f=r!==void 0?r:Wv(u)===Wv(d);l(n,{replace:f,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[u,l,d,r,i,t,n,s,a,o])}function D2e(n){let e=G.useRef(Pj(n)),t=G.useRef(!1),r=po(),i=G.useMemo(()=>g2e(r.search,t.current?null:e.current),[r.search]),s=ro(),a=G.useCallback((o,l)=>{const u=Pj(typeof o=="function"?o(i):o);t.current=!0,s("?"+u,l)},[s,i]);return[i,a]}function j2e(n,e){e===void 0&&(e={});let t=G.useContext(ose);t==null&&gi(!1);let{basename:r}=L2e(Lj.useViewTransitionState),i=w8(n,{relative:e.relative});if(!t.isTransitioning)return!1;let s=Qm(t.currentLocation.pathname,r)||t.currentLocation.pathname,a=Qm(t.nextLocation.pathname,r)||t.nextLocation.pathname;return eM(i.pathname,a)!=null||eM(i.pathname,s)!=null}var Fs="colors",qc="sizes",ur="space",I2e={gap:ur,gridGap:ur,columnGap:ur,gridColumnGap:ur,rowGap:ur,gridRowGap:ur,inset:ur,insetBlock:ur,insetBlockEnd:ur,insetBlockStart:ur,insetInline:ur,insetInlineEnd:ur,insetInlineStart:ur,margin:ur,marginTop:ur,marginRight:ur,marginBottom:ur,marginLeft:ur,marginBlock:ur,marginBlockEnd:ur,marginBlockStart:ur,marginInline:ur,marginInlineEnd:ur,marginInlineStart:ur,padding:ur,paddingTop:ur,paddingRight:ur,paddingBottom:ur,paddingLeft:ur,paddingBlock:ur,paddingBlockEnd:ur,paddingBlockStart:ur,paddingInline:ur,paddingInlineEnd:ur,paddingInlineStart:ur,top:ur,right:ur,bottom:ur,left:ur,scrollMargin:ur,scrollMarginTop:ur,scrollMarginRight:ur,scrollMarginBottom:ur,scrollMarginLeft:ur,scrollMarginX:ur,scrollMarginY:ur,scrollMarginBlock:ur,scrollMarginBlockEnd:ur,scrollMarginBlockStart:ur,scrollMarginInline:ur,scrollMarginInlineEnd:ur,scrollMarginInlineStart:ur,scrollPadding:ur,scrollPaddingTop:ur,scrollPaddingRight:ur,scrollPaddingBottom:ur,scrollPaddingLeft:ur,scrollPaddingX:ur,scrollPaddingY:ur,scrollPaddingBlock:ur,scrollPaddingBlockEnd:ur,scrollPaddingBlockStart:ur,scrollPaddingInline:ur,scrollPaddingInlineEnd:ur,scrollPaddingInlineStart:ur,fontSize:"fontSizes",background:Fs,backgroundColor:Fs,backgroundImage:Fs,borderImage:Fs,border:Fs,borderBlock:Fs,borderBlockEnd:Fs,borderBlockStart:Fs,borderBottom:Fs,borderBottomColor:Fs,borderColor:Fs,borderInline:Fs,borderInlineEnd:Fs,borderInlineStart:Fs,borderLeft:Fs,borderLeftColor:Fs,borderRight:Fs,borderRightColor:Fs,borderTop:Fs,borderTopColor:Fs,caretColor:Fs,color:Fs,columnRuleColor:Fs,fill:Fs,outline:Fs,outlineColor:Fs,stroke:Fs,textDecorationColor:Fs,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:qc,minBlockSize:qc,maxBlockSize:qc,inlineSize:qc,minInlineSize:qc,maxInlineSize:qc,width:qc,minWidth:qc,maxWidth:qc,height:qc,minHeight:qc,maxHeight:qc,flexBasis:qc,gridTemplateColumns:qc,gridTemplateRows:qc,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},F2e=(n,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,g_=()=>{const n=Object.create(null);return(e,t,...r)=>{const i=(s=>
vendor: 11,627 bytes, line 76
76JSON.stringify(s,F2e))(e);return i in n?n[i]:n[i]=t(e,...r)}},wv=Symbol.for("sxs.internal"),sB=(n,e)=>Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),kW=n=>{for(const e in n)return!0;return!1},{hasOwnProperty:U2e}=Object.prototype,Oj=n=>n.includes("-")?n:n.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),B2e=/\s+(?![^()]*\))/,Qy=n=>e=>n(...typeof e=="string"?String(e).split(B2e):[e]),RW={appearance:n=>({WebkitAppearance:n,appearance:n}),backfaceVisibility:n=>({WebkitBackfaceVisibility:n,backfaceVisibility:n}),backdropFilter:n=>({WebkitBackdropFilter:n,backdropFilter:n}),backgroundClip:n=>({WebkitBackgroundClip:n,backgroundClip:n}),boxDecorationBreak:n=>({WebkitBoxDecorationBreak:n,boxDecorationBreak:n}),clipPath:n=>({WebkitClipPath:n,clipPath:n}),content:n=>({content:n.includes('"')||n.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(n)?n:`"${n}"`}),hyphens:n=>({WebkitHyphens:n,hyphens:n}),maskImage:n=>({WebkitMaskImage:n,maskImage:n}),maskSize:n=>({WebkitMaskSize:n,maskSize:n}),tabSize:n=>({MozTabSize:n,tabSize:n}),textSizeAdjust:n=>({WebkitTextSizeAdjust:n,textSizeAdjust:n}),userSelect:n=>({WebkitUserSelect:n,userSelect:n}),marginBlock:Qy(((n,e)=>({marginBlockStart:n,marginBlockEnd:e||n}))),marginInline:Qy(((n,e)=>({marginInlineStart:n,marginInlineEnd:e||n}))),maxSize:Qy(((n,e)=>({maxBlockSize:n,maxInlineSize:e||n}))),minSize:Qy(((n,e)=>({minBlockSize:n,minInlineSize:e||n}))),paddingBlock:Qy(((n,e)=>({paddingBlockStart:n,paddingBlockEnd:e||n}))),paddingInline:Qy(((n,e)=>({paddingInlineStart:n,paddingInlineEnd:e||n})))},R7=/([\d.]+)([^]*)/,V2e=(n,e)=>n.length?n.reduce(((t,r)=>(t.push(...e.map((i=>i.includes("&")?i.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(i)?`:is(${r})`:r):r+" "+i))),t)),[]):e,z2e=(n,e)=>n in G2e&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,r,i,s)=>r+(i==="stretch"?`-moz-available${s};${Oj(n)}:${r}-webkit-fill-available`:`-moz-fit-content${s};${Oj(n)}:${r}fit-content`)+s)):String(e),G2e={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Km=n=>n?n+"-":"",cse=(n,e,t)=>n.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((r,i,s,a,o)=>a=="$"==!!s?r:(i||a=="--"?"calc(":"")+"var(--"+(a==="$"?Km(e)+(o.includes("$")?"":Km(t))+o.replace(/\$/g,"-"):o)+")"+(i||a=="--"?"*"+(i||"")+(s||"1")+")":""))),q2e=/\s*,\s*(?![^()]*\))/,$2e=Object.prototype.toString,ob=(n,e,t,r,i)=>{let s,a,o;const l=(u,d,h)=>{let f,p;const g=A=>{for(f in A){const _=f.charCodeAt(0)===64,M=_&&Array.isArray(A[f])?A[f]:[A[f]];for(p of M){const T=/[A-Z]/.test(b=f)?b:b.replace(/-[^]/g,(D=>D[1].toUpperCase())),L=typeof p=="object"&&p&&p.toString===$2e&&(!r.utils[T]||!d.length);if(T in r.utils&&!L){const D=r.utils[T];if(D!==a){a=D,g(D(p)),a=null;continue}}else if(T in RW){const D=RW[T];if(D!==o){o=D,g(D(p)),o=null;continue}}if(_&&(x=f.slice(1)in r.media?"@media "+r.media[f.slice(1)]:f,f=x.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((D,P,O,F,U,B)=>{const z=R7.test(P),H=.0625*(z?-1:1),[X,W]=z?[F,P]:[P,F];return"("+(O[0]==="="?"":O[0]===">"===z?"max-":"min-")+X+":"+(O[0]!=="="&&O.length===1?W.replace(R7,((J,ee,ae)=>Number(ee)+H*(O===">"?1:-1)+ae)):W)+(U?") and ("+(U[0]===">"?"min-":"max-")+X+":"+(U.length===1?B.replace(R7,((J,ee,ae)=>Number(ee)+H*(U===">"?-1:1)+ae)):B):"")+")"}))),L){const D=_?h.concat(f):[...h],P=_?[...d]:V2e(d,f.split(q2e));s!==void 0&&i(PW(...s)),s=void 0,l(p,P,D)}else s===void 0&&(s=[[],d,h]),f=_||f.charCodeAt(0)!==36?f:`--${Km(r.prefix)}${f.slice(1).replace(/\$/g,"-")}`,p=L?p:typeof p=="number"?p&&T in H2e?String(p)+"px":String(p):cse(z2e(T,p??""),r.prefix,r.themeMap[T]),s[0].push(`${_?`${f} `:`${Oj(f)}:`}${p}`)}}var x,b};g(u),s!==void 0&&i(PW(...s)),s=void 0};l(n,e,t)},PW=(n,e,t)=>`${t.map((r=>`${r}{`)).join("")}${e.length?`${e.join(",")}{`:""}${n.join(";")}${e.length?"}":""}${Array(t.length?t.length+1:0).join("}")}`,H2e={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},LW=n=>String.fromCharCode(n+(n>25?39:97)),_v=n=>(e=>{let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=LW(t%52)+r;return LW(t%52)+r})(((e,t)=>{let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e})(5381,JSON.stringify(n))>>>0),mS=["themed","global","styled","onevar","resonevar","allvar","inline"],W2e=n=>{if(n.href&&!n.href.startsWith(location.origin))return!1;try{return!!n.cssRules}catch{return!1}},X2e=n=>{let e;const t=()=>{const{cssRules:i}=e.sheet;return[].map.call(i,((s,a)=>{const{cssText:o}=s;let l="";if(o.startsWith("--sxs"))return"";if(i[a-1]&&(l=i[a-1].cssText).startsWith("--sxs")){if(!s.cssRules.length)return"";for(const u in e.rules)if(e.rules[u].group===s)return`--sxs{--sxs:${[...e.rules[u].cache].join(" ")}}${o}`;return s.cssRules.length?`${l}${o}`:""}return o})).join("")},r=()=>{if(e){const{rules:o,sheet:l}=e;if(!l.deleteRule){for(;Object(Object(l.cssRules)[0]).type===3;)l.cssRules.splice(0,1);l.cssRules=[]}for(const u in o)delete o[u]}const i=Object(n).styleSheets||[];for(const o of i)if(W2e(o)){for(let l=0,u=o.cssRules;u[l];++l){const d=Object(u[l]);if(d.type!==1)continue;const h=Object(u[l+1]);if(h.type!==4)continue;++l;const{cssText:f}=d;if(!f.startsWith("--sxs"))continue;const p=f.slice(14,-3).trim().split(/\s+/),g=mS[p[0]];g&&(e||(e={sheet:o,reset:r,rules:{},toString:t}),e.rules[g]={group:h,index:l,cache:new Set(p)})}if(e)break}if(!e){const o=(l,u)=>({type:u,cssRules:[],insertRule(d,h){this.cssRules.splice(h,0,o(d,{import:3,undefined:1}[(d.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,(d=>d.cssText)).join("")}}`:l}});e={sheet:n?(n.head||n).appendChild(document.createElement("style")).sheet:o("","text/css"),rules:{},reset:r,toString:t}}const{sheet:s,rules:a}=e;for(let o=mS.length-1;o>=0;--o){const l=mS[o];if(!a[l]){const u=mS[o+1],d=a[u]?a[u].index:s.cssRules.length;s.insertRule("@media{}",d),s.insertRule(`--sxs{--sxs:${o}}`,d),a[l]={group:s.cssRules[d+1],index:d,cache:new Set([o])}}Y2e(a[l])}};return r(),e},Y2e=n=>{const e=n.group;let t=e.cssRules.length;n.apply=r=>{try{e.insertRule(r,t),++t}catch{}}},u3=Symbol(),Q2e=g_(),OW=(n,e)=>Q2e(n,(()=>(...t)=>{let r={type:null,composers:new Set};for(const i of t)if(i!=null)if(i[wv]){r.type==null&&(r.type=i[wv].type);for(const s of i[wv].composers)r.composers.add(s)}else i.constructor!==Object||i.$$typeof?r.type==null&&(r.type=i):r.composers.add(K2e(i,n));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),Z2e(n,r,e)})),K2e=({variants:n,compoundVariants:e,defaultVariants:t,...r},i)=>{const s=`${Km(i.prefix)}c-${_v(r)}`,a=[],o=[],l=Object.create(null),u=[];for(const f in t)l[f]=String(t[f]);if(typeof n=="object"&&n)for(const f in n){d=l,h=f,U2e.call(d,h)||(l[f]="undefined");const p=n[f];for(const g in p){const A={[f]:String(g)};String(g)==="undefined"&&u.push(f);const x=p[g],b=[A,x,!kW(x)];a.push(b)}}var d,h;if(typeof e=="object"&&e)for(const f of e){let{css:p,...g}=f;p=typeof p=="object"&&p||{};for(const x in g)g[x]=String(g[x]);const A=[g,p,!kW(p)];o.push(A)}return[s,r,a,o,l,u]},Z2e=(n,e,t)=>{const[r,i,s,a]=J2e(e.composers),o=typeof e.type=="function"||e.type.$$typeof?(h=>{function f(){for(let p=0;p<f[u3].length;p++){const[g,A]=f[u3][p];h.rules[g].apply(A)}return f[u3]=[],null}return f[u3]=[],f.rules={},mS.forEach((p=>f.rules[p]={apply:g=>f[u3].push([p,g])})),f})(t):null,l=(o||t).rules,u=`.${r}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,d=h=>{h=typeof h=="object"&&h||ebe;const{css:f,...p}=h,g={};for(const b in s)if(delete p[b],b in h){let _=h[b];typeof _=="object"&&_?g[b]={"@initial":s[b],..._}:(_=String(_),g[b]=_!=="undefined"||a.has(b)?_:s[b])}else g[b]=s[b];const A=new Set([...i]);for(const[b,_,M,T]of e.composers){t.rules.styled.cache.has(b)||(t.rules.styled.cache.add(b),ob(_,[`.${b}`],[],n,(P=>{l.styled.apply(P)})));const L=DW(M,g,n.media),D=DW(T,g,n.media,!0);for(const P of L)if(P!==void 0)for(const[O,F,U]of P){const B=`${b}-${_v(F)}-${O}`;A.add(B);const z=(U?t.rules.resonevar:t.rules.onevar).cache,H=U?l.resonevar:l.onevar;z.has(B)||(z.add(B),ob(F,[`.${B}`],[],n,(X=>{H.apply(X)})))}for(const P of D)if(P!==void 0)for(const[O,F]of P){const U=`${b}-${_v(F)}-${O}`;A.add(U),t.rules.allvar.cache.has(U)||(t.rules.allvar.cache.add(U),ob(F,[`.${U}`],[],n,(B=>{l.allvar.apply(B)})))}}if(typeof f=="object"&&f){const b=`${r}-i${_v(f)}-css`;A.add(b),t.rules.inline.cache.has(b)||(t.rules.inline.cache.add(b),ob(f,[`.${b}`],[],n,(_=>{l.inline.apply(_)})))}for(const b of String(h.className||"").trim().split(/\s+/))b&&A.add(b);const x=p.className=[...A].join(" ");return{type:e.type,className:x,selector:u,props:p,toString:()=>x,deferredInjector:o}};return sB(d,{className:r,selector:u,[wv]:e,toString:()=>(t.rules.styled.cache.has(r)||d(),r)})},J2e=n=>{let e="";const t=[],r={},i=[];for(const[s,,,,a,o]of n){e===""&&(e=s),t.push(s),i.push(...o);for(const l in a){const u=a[l];(r[l]===void 0||u!=="undefined"||o.includes(u))&&(r[l]=u)}}return[e,t,r,new Set(i)]},DW=(n,e,t,r)=>{const i=[];e:for(let[s,a,o]of n){if(o)continue;let l,u=0,d=!1;for(l in s){const h=s[l];let f=e[l];if(f!==h){if(typeof f!="object"||!f)continue e;{let p,g,A=0;for(const x in f){if(h===String(f[x])){if(x!=="@initial"){const b=x.slice(1);(g=g||[]).push(b in t?t[b]:x.replace(/^@media ?/,"")),d=!0}u+=A,p=!0}++A}
76if(g&&g.length&&(a={["@media "+g.join(", ")]:a}),!p)continue e}}}(i[u]=i[u]||[]).push([r?"cv":`${l}-${s[l]}`,a,d])}return i},ebe={},tbe=g_(),nbe=(n,e)=>tbe(n,(()=>(...t)=>{const r=()=>{for(let i of t){i=typeof i=="object"&&i||{};let s=_v(i);if(!e.rules.global.cache.has(s)){if(e.rules.global.cache.add(s),"@import"in i){let a=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let o of[].concat(i["@import"]))o=o.includes('"')||o.includes("'")?o:`"${o}"`,e.sheet.insertRule(`@import ${o};`,a++);delete i["@import"]}ob(i,[],[],n,(a=>{e.rules.global.apply(a)}))}}return""};return sB(r,{toString:r})})),rbe=g_(),ibe=(n,e)=>rbe(n,(()=>t=>{const r=`${Km(n.prefix)}k-${_v(t)}`,i=()=>{if(!e.rules.global.cache.has(r)){e.rules.global.cache.add(r);const s=[];ob(t,[],[],n,(o=>s.push(o)));const a=`@keyframes ${r}{${s.join("")}}`;e.rules.global.apply(a)}return r};return sB(i,{get name(){return i()},toString:i})})),sbe=class{constructor(e,t,r,i){this.token=e==null?"":String(e),this.value=t==null?"":String(t),this.scale=r==null?"":String(r),this.prefix=i==null?"":String(i)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Km(this.prefix)+Km(this.scale)+this.token}toString(){return this.computedValue}},abe=g_(),obe=(n,e)=>abe(n,(()=>(t,r)=>{r=typeof t=="object"&&t||Object(r);const i=`.${t=(t=typeof t=="string"?t:"")||`${Km(n.prefix)}t-${_v(r)}`}`,s={},a=[];for(const l in r){s[l]={};for(const u in r[l]){const d=`--${Km(n.prefix)}${l}-${u}`,h=cse(String(r[l][u]),n.prefix,l);s[l][u]=new sbe(u,h,l,n.prefix),a.push(`${d}:${h}`)}}const o=()=>{if(a.length&&!e.rules.themed.cache.has(t)){e.rules.themed.cache.add(t);const l=`${r===n.theme?":root,":""}.${t}{${a.join(";")}}`;e.rules.themed.apply(l)}return t};return{...s,get className(){return o()},selector:i,toString:o}})),lbe=g_(),jW,cbe=g_(),use=n=>{const e=(t=>{let r=!1;const i=lbe(t,(s=>{r=!0;const a="prefix"in(s=typeof s=="object"&&s||{})?String(s.prefix):"",o=typeof s.media=="object"&&s.media||{},l=typeof s.root=="object"?s.root||null:globalThis.document||null,u=typeof s.theme=="object"&&s.theme||{},d={prefix:a,media:o,theme:u,themeMap:typeof s.themeMap=="object"&&s.themeMap||{...I2e},utils:typeof s.utils=="object"&&s.utils||{}},h=X2e(l),f={css:OW(d,h),globalCss:nbe(d,h),keyframes:ibe(d,h),createTheme:obe(d,h),reset(){h.reset(),f.theme.toString()},theme:{},sheet:h,config:d,prefix:a,getCssText:h.toString,toString:h.toString};return String(f.theme=f.createTheme(u)),f}));return r||i.reset(),i})(n);return e.styled=(({config:t,sheet:r})=>cbe(t,(()=>{const i=OW(t,r);return(...s)=>{const a=i(...s),o=a[wv].type,l=jn.forwardRef(((u,d)=>{const h=u&&u.as||o,{props:f,deferredInjector:p}=a(u);return delete f.as,f.ref=d,p?jn.createElement(jn.Fragment,null,jn.createElement(h,f),jn.createElement(p,null)):jn.createElement(h,f)}));return l.className=a.className,l.displayName=`Styled.${o.displayName||o.name||o}`,l.selector=a.selector,l.toString=()=>a.selector,l[wv]=a[wv],l}})))(e),e},dse=()=>jW||(jW=use()),ube=(...n)=>dse().createTheme(...n),dbe=(...n)=>dse().css(...n);const{styled:mo,css:Vgt,keyframes:zgt}=use({theme:{colors:{waspYellow:"#ffcc00",gray900:"#1a202c",gray700:"#a1a5ab",gray600:"#d1d5db",gray500:"gainsboro",gray400:"#f0f0f0",red:"#FED7D7",darkRed:"#fa3838",green:"#C6F6D5",brand:"$waspYellow",brandAccent:"#ffdb46",errorBackground:"$red",errorText:"#2D3748",successBackground:"$green",successText:"#2D3748",submitButtonText:"black",formErrorText:"$darkRed"},fontSizes:{sm:"0.875rem"}}});var iT=n=>n.type==="checkbox",ov=n=>n instanceof Date,Lu=n=>n==null;const hse=n=>typeof n=="object";var lo=n=>!Lu(n)&&!Array.isArray(n)&&hse(n)&&!ov(n),hbe=n=>lo(n)&&n.target?iT(n.target)?n.target.checked:n.target.value:n,fse=n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n,fbe=(n,e)=>n.has(fse(e)),pbe=n=>{const e=n.constructor&&n.constructor.prototype;return lo(e)&&e.hasOwnProperty("isPrototypeOf")},aB=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Uo(n){if(n instanceof Date)return new Date(n);const e=typeof FileList<"u"&&n instanceof FileList;if(aB&&(n instanceof Blob||e))return n;const t=Array.isArray(n);if(!t&&!(lo(n)&&pbe(n)))return n;const r=t?[]:Object.create(Object.getPrototypeOf(n));for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=Uo(n[i]));return r}var _8=n=>/^\w*$/.test(n),La=n=>n===void 0,oB=n=>
76Array.isArray(n)?n.filter(Boolean):[],lB=n=>oB(n.replace(/["|']|\]/g,"").split(/\.|\[/)),pr=(n,e,t)=>{if(!e||!lo(n))return t;const r=(_8(e)?[e]:lB(e)).reduce((i,s)=>Lu(i)?i:i[s],n);return La(r)||r===n?La(n[e])?t:n[e]:r},qp=n=>typeof n=="boolean",Ff=n=>typeof n=="function",ha=(n,e,t)=>{let r=-1;const i=_8(e)?[e]:lB(e),s=i.length,a=s-1;for(;++r<s;){const o=i[r];let l=t;if(r!==a){const u=n[o];l=lo(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;n[o]=l,n=n[o]}};const Ky={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Uf={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Lf={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},P7="form",pse="root",mbe=jn.createContext(null);mbe.displayName="HookFormControlContext";var gbe=(n,e,t,r=!0)=>{const i={defaultValues:e._defaultValues};for(const s in n)Object.defineProperty(i,s,{get:()=>{const a=s;return e._proxyFormState[a]!==Uf.all&&(e._proxyFormState[a]=!r||Uf.all),n[a]}});return i};const Abe=typeof window<"u"?jn.useLayoutEffect:jn.useEffect;var lu=n=>typeof n=="string",xbe=(n,e,t,r,i)=>lu(n)?(r&&e.watch.add(n),pr(t,n,i)):Array.isArray(n)?n.map(s=>(r&&e.watch.add(s),pr(t,s))):(r&&(e.watchAll=!0),t),Dj=n=>Lu(n)||!hse(n);function TA(n,e,t=new WeakSet){if(Dj(n)||Dj(e))return Object.is(n,e);if(ov(n)&&ov(e))return Object.is(n.getTime(),e.getTime());const r=Object.keys(n),i=Object.keys(e);if(r.length!==i.length)return!1;if(t.has(n)||t.has(e))return!0;t.add(n),t.add(e);for(const s of r){const a=n[s];if(!i.includes(s))return!1;if(s!=="ref"){const o=e[s];if(ov(a)&&ov(o)||lo(a)&&lo(o)||Array.isArray(a)&&Array.isArray(o)?!TA(a,o,t):!Object.is(a,o))return!1}}return!0}const vbe=jn.createContext(null);vbe.displayName="HookFormContext";var ybe=(n,e,t,r,i)=>e?{...t[n],types:{...t[n]&&t[n].types?t[n].types:{},[r]:i||!0}}:{},XS=n=>Array.isArray(n)?n:[n],IW=()=>{let n=[];return{get observers(){return n},next:i=>{for(const s of n)s.next&&s.next(i)},subscribe:i=>(n.push(i),{unsubscribe:()=>{n=n.filter(s=>s!==i)}}),unsubscribe:()=>{n=[]}}};function mse(n,e){const t={};for(const r in n)if(n.hasOwnProperty(r)){const i=n[r],s=e[r];if(i&&lo(i)&&s){const a=mse(i,s);lo(a)&&(t[r]=a)}else n[r]&&(t[r]=s)}return t}var Jc=n=>lo(n)&&!Object.keys(n).length,cB=n=>n.type==="file",rM=n=>
vendor: 6,154 bytes, line 76
76{if(!aB)return!1;const e=n?n.ownerDocument:0;return n instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},gse=n=>n.type==="select-multiple",uB=n=>n.type==="radio",bbe=n=>uB(n)||iT(n),L7=n=>rM(n)&&n.isConnected;function wbe(n,e){const t=e.slice(0,-1).length;let r=0;for(;r<t;)n=La(n)?r++:n[e[r++]];return n}function _be(n){for(const e in n)if(n.hasOwnProperty(e)&&!La(n[e]))return!1;return!0}function bo(n,e){const t=Array.isArray(e)?e:_8(e)?[e]:lB(e),r=t.length===1?n:wbe(n,t),i=t.length-1,s=t[i];return r&&delete r[s],i!==0&&(lo(r)&&Jc(r)||Array.isArray(r)&&_be(r))&&bo(n,t.slice(0,-1)),n}var Sbe=n=>{for(const e in n)if(Ff(n[e]))return!0;return!1};function Ase(n){return Array.isArray(n)||lo(n)&&!Sbe(n)}function jj(n,e={}){for(const t in n){const r=n[t];Ase(r)?(e[t]=Array.isArray(r)?[]:{},jj(r,e[t])):La(r)||(e[t]=!0)}return e}function Z2(n,e,t){t||(t=jj(e));for(const r in n){const i=n[r];if(Ase(i))La(e)||Dj(t[r])?t[r]=jj(i,Array.isArray(i)?[]:{}):Z2(i,Lu(e)?{}:e[r],t[r]);else{const s=e[r];t[r]=!TA(i,s)}}return t}const FW={value:!1,isValid:!1},UW={value:!0,isValid:!0};var xse=n=>{if(Array.isArray(n)){if(n.length>1){const e=n.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:e,isValid:!!e.length}}return n[0].checked&&!n[0].disabled?n[0].attributes&&!La(n[0].attributes.value)?La(n[0].value)||n[0].value===""?UW:{value:n[0].value,isValid:!0}:UW:FW}return FW},vse=(n,{valueAsNumber:e,valueAsDate:t,setValueAs:r})=>La(n)?n:e?n===""?NaN:n&&+n:t&&lu(n)?new Date(n):r?r(n):n;const BW={isValid:!1,value:null};var yse=n=>Array.isArray(n)?n.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,BW):BW;function VW(n){const e=n.ref;return cB(e)?e.files:uB(e)?yse(n.refs).value:gse(e)?[...e.selectedOptions].map(({value:t})=>t):iT(e)?xse(n.refs).value:vse(La(e.value)?n.ref.value:e.value,n)}var Tbe=(n,e,t,r)=>{const i={};for(const s of n){const a=pr(e,s);a&&ha(i,s,a._f)}return{criteriaMode:t,names:[...n],fields:i,shouldUseNativeValidation:r}},iM=n=>n instanceof RegExp,d3=n=>La(n)?n:iM(n)?n.source:lo(n)?iM(n.value)?n.value.source:n.value:n,zW=n=>({isOnSubmit:!n||n===Uf.onSubmit,isOnBlur:n===Uf.onBlur,isOnChange:n===Uf.onChange,isOnAll:n===Uf.all,isOnTouch:n===Uf.onTouched});const GW="AsyncFunction";var Ebe=n=>!!n&&!!n.validate&&!!(Ff(n.validate)&&n.validate.constructor.name===GW||lo(n.validate)&&Object.values(n.validate).find(e=>e.constructor.name===GW)),Cbe=n=>n.mount&&(n.required||n.min||n.max||n.maxLength||n.minLength||n.pattern||n.validate),qW=(n,e,t)=>!t&&(e.watchAll||e.watch.has(n)||[...e.watch].some(r=>n.startsWith(r)&&/^\.\w+/.test(n.slice(r.length))));const YS=(n,e,t,r)=>{for(const i of t||Object.keys(n)){const s=pr(n,i);if(s){const{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],i)&&!r)return!0;if(a.ref&&e(a.ref,a.name)&&!r)return!0;if(YS(o,e))break}else if(lo(o)&&YS(o,e))break}}};function $W(n,e,t){const r=pr(n,t);if(r||_8(t))return{error:r,name:t};const i=t.split(".");for(;i.length;){const s=i.join("."),a=pr(e,s),o=pr(n,s);if(a&&!Array.isArray(a)&&t!==s)return{name:t};if(o&&o.type)return{name:s,error:o};if(o&&o.root&&o.root.type)return{name:`${s}.root`,error:o.root};i.pop()}return{name:t}}var Nbe=(n,e,t,r)=>{t(n);const{name:i,...s}=n;return Jc(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(a=>e[a]===(!r||Uf.all))},Mbe=(n,e,t)=>!n||!e||n===e||XS(n).some(r=>r&&(t?r===e:r.startsWith(e)||e.startsWith(r))),kbe=(n,e,t,r,i)=>i.isOnAll?!1:!t&&i.isOnTouch?!(e||n):(t?r.isOnBlur:i.isOnBlur)?!n:(t?r.isOnChange:i.isOnChange)?n:!0,Rbe=(n,e)=>!oB(pr(n,e)).length&&bo(n,e),Pbe=(n,e,t)=>{const r=XS(pr(n,t));return ha(r,pse,e[t]),ha(n,t,r),n};function HW(n,e,t="validate"){if(lu(n)||Array.isArray(n)&&n.every(lu)||qp(n)&&!n)return{type:t,message:lu(n)?n:"",ref:e}}var Zy=n=>lo(n)&&!iM(n)?n:{value:n,message:""},WW=async(n,e,t,r,i,s)=>{const{ref:a,refs:o,required:l,maxLength:u,minLength:d,min:h,max:f,pattern:p,validate:g,name:A,valueAsNumber:x,mount:b}=n._f,_=pr(t,A);if(!b||e.has(A))return{};const M=o?o[0]:a,T=z=>{i&&M.reportValidity&&(M.setCustomValidity(qp(z)?"":z||""),M.reportValidity())},L={},D=uB(a),P=iT(a),O=D||P,F=(x||cB(a))&&La(a.value)&&La(_)||rM(a)&&a.value===""||_===""||Array.isArray(_)&&!_.length,U=ybe.bind(null,A,r,L),B=(z,H,X,W=Lf.maxLength,J=Lf.minLength)=>{const ee=z?H:X;L[A]={type:z?W:J,message:ee,ref:a,...U(z?W:J,ee)}};if(s?!Array.isArray(_)||!_.length:l&&(!O&&(F||Lu(_))||qp(_)&&!_||P&&!xse(o).isValid||D&&!yse(o).isValid)){const{value:z,message:H}=lu(l)?{value:!!l,message:l}:Zy(l);if(z&&(L[A]={type:Lf.required,message:H,ref:M,...U(Lf.required,H)},!r))return T(H),L}if(!F&&(!Lu(h)||!Lu(f))){let z,H;const X=Zy(f),W=Zy(h);if(!Lu(_)&&!isNaN(_)){const J=a.valueAsNumber||_&&+_;Lu(X.value)||(z=J>X.value),Lu(W.value)||(H=J<W.value)}else{const J=a.valueAsDate||new Date(_),ee=Z=>new Date(new Date().toDateString()+" "+Z),ae=a.type=="time",le=a.type=="week";lu(X.value)&&_&&(z=ae?ee(_)>ee(X.value):le?_>X.value:J>new Date(X.value)),lu(W.value)&&_&&(H=ae?ee(_)<ee(W.value):le?_<W.value:J<new Date(W.value))}if((z||H)&&(B(!!z,X.message,W.message,Lf.max,Lf.min),!r))return T(L[A].message),L}if((u||d)&&!F&&(lu(_)||s&&Array.isArray(_))){const z=Zy(u),H=Zy(d),X=!Lu(z.value)&&_.length>+z.value,W=!Lu(H.value)&&_.length<+H.value;if((X||W)&&(B(X,z.message,H.message),!r))return T(L[A].message),L}if(p&&!F&&lu(_)){const{value:z,message:H}=Zy(p);if(iM(z)&&!_.match(z)&&(L[A]={type:Lf.pattern,message:H,ref:a,...U(Lf.pattern,H)},!r))return T(H),L}if(g){if(Ff(g)){const z=await g(_,t),H=HW(z,M);if(H&&(L[A]={...H,...U(Lf.validate,H.message)},!r))return T(H.message),L}else if(lo(g)){let z={};for(const H in g){if(!Jc(z)&&!r)break;const X=HW(await g[H](_,t),M,H);X&&(z={...X,...U(H,X.message)},T(X.message),r&&(L[A]=z))}if(!Jc(z)&&(L[A]={ref:M,...z},!r))return L}}return T(!0),L};const Lbe={mode:Uf.onSubmit,reValidateMode:Uf.onChange,shouldFocusError:!0};function Obe(n={}){let e={...Lbe,...n},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ff(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1}
vendor: 15,081 bytes, line 76
76,r={},i=lo(e.defaultValues)||lo(e.values)?Uo(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:Uo(i),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...d};let f={...h};const p={array:IW(),state:IW()},g=e.criteriaMode===Uf.all,A=Ce=>Se=>{clearTimeout(u),u=setTimeout(Ce,Se)},x=async Ce=>{if(!a.keepIsValid&&!e.disabled&&(h.isValid||f.isValid||Ce)){let Se;e.resolver?(Se=Jc((await O()).errors),b()):Se=await B({fields:r,onlyCheckValid:!0,eventType:Ky.VALID}),Se!==t.isValid&&p.state.next({isValid:Se})}},b=(Ce,Se)=>{!e.disabled&&(h.isValidating||h.validatingFields||f.isValidating||f.validatingFields)&&((Ce||Array.from(o.mount)).forEach(qe=>{qe&&(Se?ha(t.validatingFields,qe,Se):bo(t.validatingFields,qe))}),p.state.next({validatingFields:t.validatingFields,isValidating:!Jc(t.validatingFields)}))},_=(Ce,Se=[],qe,pt,Te=!0,oe=!0)=>{if(pt&&qe&&!e.disabled){if(a.action=!0,oe&&Array.isArray(pr(r,Ce))){const ge=qe(pr(r,Ce),pt.argA,pt.argB);Te&&ha(r,Ce,ge)}if(oe&&Array.isArray(pr(t.errors,Ce))){const ge=qe(pr(t.errors,Ce),pt.argA,pt.argB);Te&&ha(t.errors,Ce,ge),Rbe(t.errors,Ce)}if((h.touchedFields||f.touchedFields)&&oe&&Array.isArray(pr(t.touchedFields,Ce))){const ge=qe(pr(t.touchedFields,Ce),pt.argA,pt.argB);Te&&ha(t.touchedFields,Ce,ge)}if(h.dirtyFields||f.dirtyFields){const ge=Z2(i,s),Ne=fse(Ce);ha(t.dirtyFields,Ne,pr(ge,Ne))}p.state.next({name:Ce,isDirty:H(Ce,Se),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else ha(s,Ce,Se)},M=(Ce,Se)=>{ha(t.errors,Ce,Se),p.state.next({errors:t.errors})},T=Ce=>{t.errors=Ce,p.state.next({errors:t.errors,isValid:!1})},L=(Ce,Se,qe,pt)=>{const Te=pr(r,Ce);if(Te){const oe=pr(s,Ce,La(qe)?pr(i,Ce):qe);La(oe)||pt&&pt.defaultChecked||Se?ha(s,Ce,Se?oe:VW(Te._f)):J(Ce,oe),a.mount&&!a.action&&x()}},D=(Ce,Se,qe,pt,Te)=>{let oe=!1,ge=!1;const Ne={name:Ce};if(!e.disabled){if(!qe||pt){(h.isDirty||f.isDirty)&&(ge=t.isDirty,t.isDirty=Ne.isDirty=H(),oe=ge!==Ne.isDirty);const ke=TA(pr(i,Ce),Se);ge=!!pr(t.dirtyFields,Ce),ke?bo(t.dirtyFields,Ce):ha(t.dirtyFields,Ce,!0),Ne.dirtyFields=t.dirtyFields,oe=oe||(h.dirtyFields||f.dirtyFields)&&ge!==!ke}if(qe){const ke=pr(t.touchedFields,Ce);ke||(ha(t.touchedFields,Ce,qe),Ne.touchedFields=t.touchedFields,oe=oe||(h.touchedFields||f.touchedFields)&&ke!==qe)}oe&&Te&&p.state.next(Ne)}return oe?Ne:{}},P=(Ce,Se,qe,pt)=>{const Te=pr(t.errors,Ce),oe=(h.isValid||f.isValid)&&qp(Se)&&t.isValid!==Se;if(e.delayError&&qe?(l=A(()=>M(Ce,qe)),l(e.delayError)):(clearTimeout(u),l=null,qe?ha(t.errors,Ce,qe):bo(t.errors,Ce)),(qe?!TA(Te,qe):Te)||!Jc(pt)||oe){const ge={...pt,...oe&&qp(Se)?{isValid:Se}:{},errors:t.errors,name:Ce};t={...t,...ge},p.state.next(ge)}},O=async Ce=>(b(Ce,!0),await e.resolver(s,e.context,Tbe(Ce||o.mount,r,e.criteriaMode,e.shouldUseNativeValidation))),F=async Ce=>{const{errors:Se}=await O(Ce);if(b(Ce),Ce)for(const qe of Ce){const pt=pr(Se,qe);pt?ha(t.errors,qe,pt):bo(t.errors,qe)}else t.errors=Se;return Se},U=async({name:Ce,eventType:Se})=>{if(n.validate){const qe=await n.validate({formValues:s,formState:t,name:Ce,eventType:Se});if(lo(qe))for(const pt in qe)qe[pt]&&Ae(`${P7}.${pt}`,{message:lu(qe.message)?qe.message:"",type:Lf.validate});else lu(qe)||!qe?Ae(P7,{message:qe||"",type:Lf.validate}):Ee(P7);return qe}return!0},B=async({fields:Ce,onlyCheckValid:Se,name:qe,eventType:pt,context:Te={valid:!0,runRootValidation:!1}})=>{if(n.validate&&(Te.runRootValidation=!0,!await U({name:qe,eventType:pt})&&(Te.valid=!1,Se)))return Te.valid;for(const oe in Ce){const ge=Ce[oe];if(ge){const{_f:Ne,...ke}=ge;if(Ne){const Xe=o.array.has(Ne.name),et=ge._f&&Ebe(ge._f);et&&h.validatingFields&&b([Ne.name],!0);const Qe=await WW(ge,o.disabled,s,g,e.shouldUseNativeValidation&&!Se,Xe);if(et&&h.validatingFields&&b([Ne.name]),Qe[Ne.name]&&(Te.valid=!1,Se)||(!Se&&(pr(Qe,Ne.name)?Xe?Pbe(t.errors,Qe,Ne.name):ha(t.errors,Ne.name,Qe[Ne.name]):bo(t.errors,Ne.name)),n.shouldUseNativeValidation&&Qe[Ne.name]))break}!Jc(ke)&&await B({context:Te,onlyCheckValid:Se,fields:ke,name:oe,eventType:pt})}}return Te.valid},z=()=>{for(const Ce of o.unMount){const Se=pr(r,Ce);Se&&(Se._f.refs?Se._f.refs.every(qe=>!L7(qe)):!L7(Se._f.ref))&&Ue(Ce)}o.unMount=new Set},H=(Ce,Se)=>!e.disabled&&(Ce&&Se&&ha(s,Ce,Se),!TA(re(),i)),X=(Ce,Se,qe)=>xbe(Ce,o,{...a.mount?s:La(Se)?i:lu(Ce)?{[Ce]:Se}:Se},qe,Se),W=Ce=>oB(pr(a.mount?s:i,Ce,e.shouldUnregister?pr(i,Ce,[]):[])),J=(Ce,Se,qe={})=>{const pt=pr(r,Ce);let Te=Se;if(pt){const oe=pt._f;oe&&(!oe.disabled&&ha(s,Ce,vse(Se,oe)),Te=rM(oe.ref)&&Lu(Se)?"":Se,gse(oe.ref)?[...oe.ref.options].forEach(ge=>ge.selected=Te.includes(ge.value)):oe.refs?iT(oe.ref)?oe.refs.forEach(ge=>{(!ge.defaultChecked||!ge.disabled)&&(Array.isArray(Te)?ge.checked=!!Te.find(Ne=>Ne===ge.value):ge.checked=Te===ge.value||!!Te)}):oe.refs.forEach(ge=>ge.checked=ge.value===Te):cB(oe.ref)?oe.ref.value="":(oe.ref.value=Te,oe.ref.type||p.state.next({name:Ce,values:Uo(s)})))}(qe.shouldDirty||qe.shouldTouch)&&D(Ce,Te,qe.shouldTouch,qe.shouldDirty,!0),qe.shouldValidate&&Y(Ce)},ee=(Ce,Se,qe)=>{for(const pt in Se){if(!Se.hasOwnProperty(pt))return;const Te=Se[pt],oe=Ce+"."+pt,ge=pr(r,oe);(o.array.has(Ce)||lo(Te)||ge&&!ge._f)&&!ov(Te)?ee(oe,Te,qe):J(oe,Te,qe)}},ae=(Ce,Se,qe={})=>{const pt=pr(r,Ce),Te=o.array.has(Ce),oe=Uo(Se);ha(s,Ce,oe),Te?(p.array.next({name:Ce,values:Uo(s)}),(h.isDirty||h.dirtyFields||f.isDirty||f.dirtyFields)&&qe.shouldDirty&&p.state.next({name:Ce,dirtyFields:Z2(i,s),isDirty:H(Ce,oe)})):pt&&!pt._f&&!Lu(oe)?ee(Ce,oe,qe):J(Ce,oe,qe),qW(Ce,o)?p.state.next({...t,name:Ce,values:Uo(s)}):p.state.next({name:a.mount?Ce:void 0,values:Uo(s)})},le=async Ce=>{a.mount=!0;const Se=Ce.target;let qe=Se.name,pt=!0;const Te=pr(r,qe),oe=ke=>{pt=Number.isNaN(ke)||ov(ke)&&isNaN(ke.getTime())||TA(ke,pr(s,qe,ke))},ge=zW(e.mode),Ne=zW(e.reValidateMode);if(Te){let ke,Xe;const et=Se.type?VW(Te._f):hbe(Ce),Qe=Ce.type===Ky.BLUR||Ce.type===Ky.FOCUS_OUT,lt=!Cbe(Te._f)&&!n.validate&&!e.resolver&&!pr(t.errors,qe)&&!Te._f.deps||kbe(Qe,pr(t.touchedFields,qe),t.isSubmitted,Ne,ge),tt=qW(qe,o,Qe);ha(s,qe,et),Qe?(!Se||!Se.readOnly)&&(Te._f.onBlur&&Te._f.onBlur(Ce),l&&l(0)):Te._f.onChange&&Te._f.onChange(Ce);const Ft=D(qe,et,Qe),Mt=!Jc(Ft)||tt;if(!Qe&&p.state.next({name:qe,type:Ce.type,values:Uo(s)}),lt)return(h.isValid||f.isValid)&&(e.mode==="onBlur"?Qe&&x():Qe||x()),Mt&&p.state.next({name:qe,...tt?{}:Ft});if(!e.resolver&&n.validate&&await U({name:qe,eventType:Ce.type}),!Qe&&tt&&p.state.next({...t}),e.resolver){const{errors:Nt}=await O([qe]);if(b([qe]),oe(et),pt){const Je=$W(t.errors,r,qe),fn=$W(Nt,r,Je.name||qe);ke=fn.error,qe=fn.name,Xe=Jc(Nt)}}else b([qe],!0),ke=(await WW(Te,o.disabled,s,g,e.shouldUseNativeValidation))[qe],b([qe]),oe(et),pt&&(ke?Xe=!1:(h.isValid||f.isValid)&&(Xe=await B({fields:r,onlyCheckValid:!0,name:qe,eventType:Ce.type})));pt&&(Te._f.deps&&(!Array.isArray(Te._f.deps)||Te._f.deps.length>0)&&Y(Te._f.deps),P(qe,Xe,ke,Ft))}},Z=(Ce,Se)=>{if(pr(t.errors,Se)&&Ce.focus)return Ce.focus(),1},Y=async(Ce,Se={})=>{let qe,pt;const Te=XS(Ce);if(e.resolver){const oe=await F(La(Ce)?Ce:Te);qe=Jc(oe),pt=Ce?!Te.some(ge=>pr(oe,ge)):qe}else Ce?(pt=(await Promise.all(Te.map(async oe=>{const ge=pr(r,oe);return await B({fields:ge&&ge._f?{[oe]:ge}:ge,eventType:Ky.TRIGGER})}))).every(Boolean),!(!pt&&!t.isValid)&&x()):pt=qe=await B({fields:r,name:Ce,eventType:Ky.TRIGGER});return p.state.next({...!lu(Ce)||(h.isValid||f.isValid)&&qe!==t.isValid?{}:{name:Ce},...e.resolver||!Ce?{isValid:qe}:{},errors:t.errors}),Se.shouldFocus&&!pt&&YS(r,Z,Ce?Te:o.mount),pt},re=(Ce,Se)=>{let qe={...a.mount?s:i};return Se&&(qe=mse(Se.dirtyFields?t.dirtyFields:t.touchedFields,qe)),La(Ce)?qe:lu(Ce)?pr(qe,Ce):Ce.map(pt=>pr(qe,pt))},_e=(Ce,Se)=>({invalid:!!pr((Se||t).errors,Ce),isDirty:!!pr((Se||t).dirtyFields,Ce),error:pr((Se||t).errors,Ce),isValidating:!!pr(t.validatingFields,Ce),isTouched:!!pr((Se||t).touchedFields,Ce)}),Ee=Ce=>{const Se=Ce?XS(Ce):void 0;Se==null||Se.forEach(qe=>bo(t.errors,qe)),Se?Se.forEach(qe=>{p.state.next({name:qe,errors:t.errors})}):p.state.next({errors:{}})},Ae=(Ce,Se,qe)=>{const pt=(pr(r,Ce,{_f:{}})._f||{}).ref,Te=pr(t.errors,Ce)||{},{ref:oe,message:ge,type:Ne,...ke}=Te;ha(t.errors,Ce,{...ke,...Se,ref:pt}),p.state.next({name:Ce,errors:t.errors,isValid:!1}),qe&&qe.shouldFocus&&pt&&pt.focus&&pt.focus()},te=(Ce,Se)=>Ff(Ce)?p.state.subscribe({next:qe=>"values"in qe&&Ce(X(void 0,Se),qe)}):X(Ce,Se,!0),ve=Ce=>p.state.subscribe({next:Se=>{Mbe(Ce.name,Se.name,Ce.exact)&&Nbe(Se,Ce.formState||h,Ye,Ce.reRenderRoot)&&Ce.callback({values:{...s},...t,...Se,defaultValues:i})}}).unsubscribe,we=Ce=>(a.mount=!0,f={...f,...Ce.formState},ve({...Ce,formState:{...d,...Ce.formState}})),Ue=(Ce,Se={})=>{for(const qe of Ce?XS(Ce):o.mount)o.mount.delete(qe),o.array.delete(qe),Se.keepValue||(bo(r,qe),bo(s,qe)),!Se.keepError&&bo(t.errors,qe),!Se.keepDirty&&bo(t.dirtyFields,qe),!Se.keepTouched&&bo(t.touchedFields,qe),!Se.keepIsValidating&&bo(t.validatingFields,qe),!e.shouldUnregister&&!Se.keepDefaultValue&&bo(i,qe);p.state.next({values:Uo(s)}),p.state.next({...t,...Se.keepDirty?{isDirty:H()}:{}}),!Se.keepIsValid&&x()},ze=({disabled:Ce,name:Se})=>{if(qp(Ce)&&a.mount||Ce||o.disabled.has(Se)){const Te=o.disabled.has(Se)!==!!Ce;Ce?o.disabled.add(Se):o.disabled.delete(Se),Te&&a.mount&&!a.action&&x()}},yt=(Ce,Se={})=>{let qe=pr(r,Ce);const pt=qp(Se.disabled)||qp(e.disabled);return ha(r,Ce,{...qe||{},_f:{...qe&&qe._f?qe._f:{ref:{name:Ce}},name:Ce,mount:!0,...Se}}),o.mount.add(Ce),qe?ze({disabled:qp(Se.disabled)?Se.disabled:e.disabled,name:Ce}):L(Ce,!0,Se.value),{...pt?{disabled:Se.disabled||e.disabled}:{},...e.progressive?{required:!!Se.required,min:d3(Se.min),max:d3(Se.max),minLength:d3(Se.minLength),maxLength:d3(Se.maxLength),pattern:d3(Se.pattern)}:{},name:Ce,onChange:le,onBlur:le,ref:Te=>{if(Te){yt(Ce,Se),qe=pr(r,Ce);const oe=La(Te.value)&&Te.querySelectorAll&&Te.querySelectorAll("input,select,textarea")[0]||Te,ge=bbe(oe),Ne=qe._f.refs||[];if(ge?Ne.find(ke=>ke===oe):oe===qe._f.ref)return;ha(r,Ce,{_f:{...qe._f,...ge?{refs:[...Ne.filter(L7),oe,...Array.isArray(pr(i,Ce))?[{}]:[]],ref:{type:oe.type,name:Ce}}:{ref:oe}}}),L(Ce,!1,void 0,oe)}else qe=pr(r,Ce,{}),qe._f&&(qe._f.mount=!1),(e.shouldUnregister||Se.shouldUnregister)&&!(fbe(o.array,Ce)&&a.action)&&o.unMount.add(Ce)}}},mt=()=>e.shouldFocusError&&YS(r,Z,o.mount),bt=Ce=>{qp(Ce)&&(p.state.next({disabled:Ce}),YS(r,(Se,qe)=>{const pt=pr(r,qe);pt&&(Se.disabled=pt._f.disabled||Ce,Array.isArray(pt._f.refs)&&pt._f.refs.forEach(Te=>{Te.disabled=pt._f.disabled||Ce}))},0,!1))},dt=(Ce,Se)=>async qe=>{let pt;qe&&(qe.preventDefault&&qe.preventDefault(),qe.persist&&qe.persist());let Te=Uo(s);if(p.state.next({isSubmitting:!0}),e.resolver){const{errors:oe,values:ge}=await O();b(),t.errors=oe,Te=Uo(ge)}else await B({fields:r,eventType:Ky.SUBMIT});if(o.disabled.size)for(const oe of o.disabled)bo(Te,oe);if(bo(t.errors,pse),Jc(t.errors)){p.state.next({errors:{}});try{await Ce(Te,qe)}catch(oe){pt=oe}}else Se&&await Se({...t.errors},qe),mt(),setTimeout(mt);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Jc(t.errors)&&!pt,submitCount:t.submitCount+1,errors:t.errors}),pt)throw pt},St=(Ce,Se={})=>{pr(r,Ce)&&(La(Se.defaultValue)?ae(Ce,Uo(pr(i,Ce))):(ae(Ce,Se.defaultValue),ha(i,Ce,Uo(Se.defaultValue))),Se.keepTouched||bo(t.touchedFields,Ce),Se.keepDirty||(bo(t.dirtyFields,Ce),t.isDirty=Se.defaultValue?H(Ce,Uo(pr(i,Ce))):H()),Se.keepError||(bo(t.errors,Ce),h.isValid&&x()),p.state.next({...t}))},kt=(Ce,Se={})=>{const qe=Ce?Uo(Ce):i,pt=Uo(qe),Te=Jc(Ce),oe=Te?i:pt;if(Se.keepDefaultValues||(i=qe),!Se.keepValues){if(Se.keepDirtyValues){const ge=new Set([...o.mount,...Object.keys(Z2(i,s))]);for(const Ne of Array.from(ge)){const ke=pr(t.dirtyFields,Ne),Xe=pr(s,Ne),et=pr(oe,Ne);ke&&!La(Xe)?ha(oe,Ne,Xe):!ke&&!La(et)&&ae(Ne,et)}}else{if(aB&&La(Ce))for(const ge of o.mount){const Ne=pr(r,ge);if(Ne&&Ne._f){const ke=Array.isArray(Ne._f.refs)?Ne._f.refs[0]:Ne._f.ref;if(rM(ke)){const Xe=ke.closest("form");if(Xe){Xe.reset();break}}}}if(Se.keepFieldsRef)for(const ge of o.mount)ae(ge,pr(oe,ge));else r={}}s=e.shouldUnregister?Se.keepDefaultValues?Uo(i):{}:Uo(oe),p.array.next({values:{...oe}}),p.state.next({values:{...oe}})}o={mount:Se.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!h.isValid||!!Se.keepIsValid||!!Se.keepDirtyValues||!e.shouldUnregister&&!Jc(oe),a.watch=!!e.shouldUnregister,a.keepIsValid=!!Se.keepIsValid,a.action=!1,Se.keepErrors||(t.errors={}),p.state.next({submitCount:Se.keepSubmitCount?t.submitCount:0,isDirty:Te?!1:Se.keepDirty?t.isDirty:!!(Se.keepDefaultValues&&!TA(Ce,i)),isSubmitted:Se.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:Te?{}:Se.keepDirtyValues?Se.keepDefaultValues&&s?Z2(i,s):t.dirtyFields:Se.keepDefaultValues&&Ce?Z2(i,Ce):Se.keepDirty?t.dirtyFields:{},touchedFields:Se.keepTouched?t.touchedFields:{},errors:Se.keepErrors?t.errors:{},isSubmitSuccessful:Se.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Fe=(Ce,Se)=>kt(Ff(Ce)?Ce(s):Ce,{...e.resetOptions,...Se}),Ze=(Ce,Se={})=>{const qe=pr(r,Ce),pt=qe&&qe._f;if(pt){const Te=pt.refs?pt.refs[0]:pt.ref;Te.focus&&setTimeout(()=>{Te.focus(),Se.shouldSelect&&Ff(Te.select)&&Te.select()})}},Ye=Ce=>{t={...t,...Ce}},At={control:{register:yt,unregister:Ue,getFieldState:_e,handleSubmit:dt,setError:Ae,_subscribe:ve,_runSchema:O,_updateIsValidating:b,_focusError:mt,_getWatch:X,_getDirty:H,_setValid:x,_setFieldArray:_,_setDisabledField:ze,_setErrors:T,_getFieldArray:W,_reset:kt,_resetDefaultValues:()=>Ff(e.defaultValues)&&e.defaultValues().then(Ce=>{Fe(Ce,e.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:z,_disableForm:bt,_subjects:p,_proxyFormState:h,get _fields(){return r},get _formValues(){return s},get _state(){return a},set _state(Ce){a=Ce},get _defaultValues(){return i},get _names(){return o},set _names(Ce){o=Ce},get _formState(){return t},get _options(){return e},set _options(Ce){e={...e,...Ce}}},subscribe:we,trigger:Y,register:yt,handleSubmit:dt,watch:te,setValue:ae,getValues:re,reset:Fe,resetField:St,clearErrors:Ee,unregister:Ue,setError:Ae,setFocus:Ze,getFieldState:_e};return{...At,formControl:At}}function dB(n={}){const e=jn.useRef(void 0),t=jn.useRef(void 0),[r,i]=jn.useState({isDirty:!1,isValidating:!1,isLoading:Ff(n.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1,isReady:!1,defaultValues:Ff(n.defaultValues)?void 0:n.defaultValues});if(!e.current)if(n.formControl)e.current={...n.formControl,formState:r},n.defaultValues&&!Ff(n.defaultValues)&&n.formControl.reset(n.defaultValues,n.resetOptions);else{const{formControl:a,...o}=Obe(n);e.current={...o,formState:r}}const s=e.current.control;return s._options=n,Abe(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}
76),reRenderRoot:!0});return i(o=>({...o,isReady:!0})),s._formState.isReady=!0,a},[s]),jn.useEffect(()=>s._disableForm(n.disabled),[s,n.disabled]),jn.useEffect(()=>{n.mode&&(s._options.mode=n.mode),n.reValidateMode&&(s._options.reValidateMode=n.reValidateMode)},[s,n.mode,n.reValidateMode]),jn.useEffect(()=>{n.errors&&(s._setErrors(n.errors),s._focusError())},[s,n.errors]),jn.useEffect(()=>{n.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,n.shouldUnregister]),jn.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==r.isDirty&&s._subjects.state.next({isDirty:a})}},[s,r.isDirty]),jn.useEffect(()=>{var a;n.values&&!TA(n.values,t.current)?(s._reset(n.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((a=s._options.resetOptions)===null||a===void 0)&&a.keepIsValid||s._setValid(),t.current=n.values,i(o=>({...o}))):s._resetDefaultValues()},[s,n.values]),jn.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),e.current.formState=jn.useMemo(()=>gbe(r,s),[s,r]),e.current}function Dbe(n){return n==null?void 0:n.replace(/\/$/,"")}var ls;(function(n){n.assertEqual=i=>{};function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return n.objectValues(a)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},n.find=(i,s)=>{for(const a of i)if(s(a))return a},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ls||(ls={}));var XW;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(XW||(XW={}));const mr=ls.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bA=n=>{switch(typeof n){case"undefined":return mr.undefined;case"string":return mr.string;case"number":return Number.isNaN(n)?mr.nan:mr.number;case"boolean":return mr.boolean;case"function":return mr.function;case"bigint":return mr.bigint;case"symbol":return mr.symbol;case"object":return Array.isArray(n)?mr.array:n===null?mr.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?mr.promise:typeof Map<"u"&&n instanceof Map?mr.map:typeof Set<"u"&&n instanceof Set?mr.set:typeof Date<"u"&&n instanceof Date?mr.date:mr.object;default:return mr.unknown}}
vendor: 4,707 bytes, line 76
76,On=ls.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class M0 extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(t(a));else{let o=r,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(a))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof M0))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ls.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];t[s]=t[s]||[],t[s].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}M0.create=n=>new M0(n);const Ij=(n,e)=>{let t;switch(n.code){case On.invalid_type:n.received===mr.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case On.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ls.jsonStringifyReplacer)}`;break;case On.unrecognized_keys:t=`Unrecognized key(s) in object: ${ls.joinValues(n.keys,", ")}`;break;case On.invalid_union:t="Invalid input";break;case On.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ls.joinValues(n.options)}`;break;case On.invalid_enum_value:t=`Invalid enum value. Expected ${ls.joinValues(n.options)}, received '${n.received}'`;break;case On.invalid_arguments:t="Invalid function arguments";break;case On.invalid_return_type:t="Invalid function return type";break;case On.invalid_date:t="Invalid date";break;case On.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:ls.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case On.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case On.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case On.custom:t="Invalid input";break;case On.invalid_intersection_types:t="Intersection results could not be merged";break;case On.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case On.not_finite:t="Number must be finite";break;default:t=e.defaultError,ls.assertNever(n)}return{message:t}};let jbe=Ij;function Ibe(){return jbe}const Fbe=n=>
vendor: 1,629 bytes, line 76
76{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:e,defaultError:o}).message;return{...i,path:s,message:o}};function Jn(n,e){const t=Ibe(),r=Fbe({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Ij?void 0:Ij].filter(i=>!!i)});n.common.issues.push(r)}class Qd{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return ei;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return Qd.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return ei;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}}const ei=Object.freeze({status:"aborted"}),gS=n=>({status:"dirty",value:n}),Zh=n=>({status:"valid",value:n}),YW=n=>n.status==="aborted",QW=n=>n.status==="dirty",Wb=n=>n.status==="valid",sM=n=>typeof Promise<"u"&&n instanceof Promise;var wr;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(wr||(wr={}));
vendor: 27,676 bytes, line 76
76class g1{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const KW=(n,e)=>{if(Wb(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new M0(n.common.issues);return this._error=t,this._error}}};function Ci(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{const{message:l}=n;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:i}}class rs{get description(){return this._def.description}_getType(e){return bA(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:bA(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Qd,ctx:{common:e.parent.common,data:e.data,parsedType:bA(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(sM(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bA(e)},i=this._parseSync({data:e,path:r.path,parent:r});return KW(r,i)}"~validate"(e){var r,i;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bA(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return Wb(s)?{value:s.value}:{issues:t.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>Wb(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bA(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(sM(i)?i:Promise.resolve(i));return KW(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:On.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new Yb({schema:this,typeName:ni.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return e1.create(this,this._def)}nullable(){return Qb.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return h0.create(this)}promise(){return cM.create(this,this._def)}or(e){return oM.create([this,e],this._def)}and(e){return lM.create(this,e,this._def)}transform(e){return new Yb({...Ci(this._def),schema:this,typeName:ni.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Uj({...Ci(this._def),innerType:this,defaultValue:t,typeName:ni.ZodDefault})}brand(){return new owe({typeName:ni.ZodBranded,type:this,...Ci(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Bj({...Ci(this._def),innerType:this,catchValue:t,typeName:ni.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return hB.create(this,e)}readonly(){return Vj.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ube=/^c[^\s-]{8,}$/i,Bbe=/^[0-9a-z]+$/,Vbe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zbe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Gbe=/^[a-z0-9_-]{21}$/i,qbe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$be=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Hbe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Wbe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let O7;const Xbe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ybe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Qbe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Kbe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zbe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Jbe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bse="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ewe=new RegExp(`^${bse}$`);function wse(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function twe(n){return new RegExp(`^${wse(n)}$`)}function nwe(n){let e=`${bse}T${wse(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function rwe(n,e){return!!((e==="v4"||!e)&&Xbe.test(n)||(e==="v6"||!e)&&Qbe.test(n))}function iwe(n,e){if(!qbe.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function swe(n,e){return!!((e==="v4"||!e)&&Ybe.test(n)||(e==="v6"||!e)&&Kbe.test(n))}class UA extends rs{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==mr.string){const s=this._getOrReturnCtx(e);return Jn(s,{code:On.invalid_type,expected:mr.string,received:s.parsedType}),ei}const r=new Qd;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?Jn(i,{code:On.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&Jn(i,{code:On.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Hbe.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"email",code:On.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")O7||(O7=new RegExp(Wbe,"u")),O7.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"emoji",code:On.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")zbe.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"uuid",code:On.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Gbe.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"nanoid",code:On.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Ube.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"cuid",code:On.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Bbe.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"cuid2",code:On.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Vbe.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"ulid",code:On.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Jn(i,{validation:"url",code:On.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"regex",code:On.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?nwe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?ewe.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?twe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?$be.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"duration",code:On.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?rwe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"ip",code:On.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?iwe(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"jwt",code:On.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?swe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"cidr",code:On.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Zbe.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"base64",code:On.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?Jbe.test(e.data)||(i=this._getOrReturnCtx(e,i),Jn(i,{validation:"base64url",code:On.invalid_string,message:s.message}),r.dirty()):ls.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(i=>e.test(i),{validation:t,code:On.invalid_string,...wr.errToObj(r)})}_addCheck(e){return new UA({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...wr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...wr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...wr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...wr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...wr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...wr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...wr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...wr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...wr.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...wr.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...wr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...wr.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...wr.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...wr.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...wr.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...wr.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...wr.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...wr.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...wr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...wr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...wr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...wr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...wr.errToObj(t)})}nonempty(e){return this.min(1,wr.errToObj(e))}trim(){return new UA({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new UA({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new UA({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}UA.create=n=>new UA({checks:[],typeName:ni.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...Ci(n)});function awe(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=Number.parseInt(n.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}class U4 extends rs{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==mr.number){const s=this._getOrReturnCtx(e);return Jn(s,{code:On.invalid_type,expected:mr.number,received:s.parsedType}),ei}let r;const i=new Qd;for(const s of this._def.checks)s.kind==="int"?ls.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Jn(r,{code:On.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Jn(r,{code:On.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Jn(r,{code:On.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?awe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),Jn(r,{code:On.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Jn(r,{code:On.not_finite,message:s.message}),i.dirty()):ls.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,wr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,wr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,wr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,wr.toString(t))}setLimit(e,t,r,i){return new U4({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:wr.toString(i)}]})}_addCheck(e){return new U4({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:wr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:wr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:wr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:wr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:wr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:wr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:wr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:wr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:wr.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ls.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}U4.create=n=>new U4({checks:[],typeName:ni.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Ci(n)});class B4 extends rs{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==mr.bigint)return this._getInvalidInput(e);let r;const i=new Qd;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Jn(r,{code:On.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Jn(r,{code:On.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Jn(r,{code:On.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ls.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return Jn(t,{code:On.invalid_type,expected:mr.bigint,received:t.parsedType}),ei}gte(e,t){return this.setLimit("min",e,!0,wr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,wr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,wr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,wr.toString(t))}setLimit(e,t,r,i){return new B4({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:wr.toString(i)}]})}_addCheck(e){return new B4({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:wr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:wr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:wr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:wr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:wr.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}B4.create=n=>new B4({checks:[],typeName:ni.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...Ci(n)});class ZW extends rs{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==mr.boolean){const r=this._getOrReturnCtx(e);return Jn(r,{code:On.invalid_type,expected:mr.boolean,received:r.parsedType}),ei}return Zh(e.data)}}ZW.create=n=>new ZW({typeName:ni.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Ci(n)});class aM extends rs{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==mr.date){const s=this._getOrReturnCtx(e);return Jn(s,{code:On.invalid_type,expected:mr.date,received:s.parsedType}),ei}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Jn(s,{code:On.invalid_date}),ei}const r=new Qd;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),Jn(i,{code:On.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ls.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new aM({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:wr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:wr.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}aM.create=n=>new aM({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:ni.ZodDate,...Ci(n)});class JW extends rs{_parse(e){if(this._getType(e)!==mr.symbol){const r=this._getOrReturnCtx(e);return Jn(r,{code:On.invalid_type,expected:mr.symbol,received:r.parsedType}),ei}return Zh(e.data)}}JW.create=n=>new JW({typeName:ni.ZodSymbol,...Ci(n)});class eX extends rs{_parse(e){if(this._getType(e)!==mr.undefined){const r=this._getOrReturnCtx(e);return Jn(r,{code:On.invalid_type,expected:mr.undefined,received:r.parsedType}),ei}return Zh(e.data)}}eX.create=n=>new eX({typeName:ni.ZodUndefined,...Ci(n)});class tX extends rs{_parse(e){if(this._getType(e)!==mr.null){const r=this._getOrReturnCtx(e);return Jn(r,{code:On.invalid_type,expected:mr.null,received:r.parsedType}),ei}return Zh(e.data)}}tX.create=n=>new tX({typeName:ni.ZodNull,...Ci(n)});class nX extends rs{constructor(){super(...arguments),this._any=!0}_parse(e){return Zh(e.data)}}nX.create=n=>new nX({typeName:ni.ZodAny,...Ci(n)});class rX extends rs{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Zh(e.data)}}rX.create=n=>new rX({typeName:ni.ZodUnknown,...Ci(n)});class A1 extends rs{_parse(e){const t=this._getOrReturnCtx(e);return Jn(t,{code:On.invalid_type,expected:mr.never,received:t.parsedType}),ei}}A1.create=n=>new A1({typeName:ni.ZodNever,...Ci(n)});class iX extends rs{_parse(e){if(this._getType(e)!==mr.undefined){const r=this._getOrReturnCtx(e);return Jn(r,{code:On.invalid_type,expected:mr.void,received:r.parsedType}),ei}return Zh(e.data)}}iX.create=n=>new iX({typeName:ni.ZodVoid,...Ci(n)});class h0 extends rs{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==mr.array)return Jn(t,{code:On.invalid_type,expected:mr.array,received:t.parsedType}),ei;if(i.exactLength!==null){const a=t.data.length>i.exactLength.value,o=t.data.length<i.exactLength.value;(a||o)&&(Jn(t,{code:a?On.too_big:On.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(Jn(t,{code:On.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(Jn(t,{code:On.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((a,o)=>i.type._parseAsync(new g1(t,a,t.path,o)))).then(a=>Qd.mergeArray(r,a));const s=[...t.data].map((a,o)=>i.type._parseSync(new g1(t,a,t.path,o)));return Qd.mergeArray(r,s)}
vendor: 5,089 bytes, line 76
76get element(){return this._def.type}min(e,t){return new h0({...this._def,minLength:{value:e,message:wr.toString(t)}})}max(e,t){return new h0({...this._def,maxLength:{value:e,message:wr.toString(t)}})}length(e,t){return new h0({...this._def,exactLength:{value:e,message:wr.toString(t)}})}nonempty(e){return this.min(1,e)}}h0.create=(n,e)=>new h0({type:n,minLength:null,maxLength:null,exactLength:null,typeName:ni.ZodArray,...Ci(e)});function J2(n){if(n instanceof So){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=e1.create(J2(r))}return new So({...n._def,shape:()=>e})}else return n instanceof h0?new h0({...n._def,type:J2(n.element)}):n instanceof e1?e1.create(J2(n.unwrap())):n instanceof Qb?Qb.create(J2(n.unwrap())):n instanceof Xv?Xv.create(n.items.map(e=>J2(e))):n}class So extends rs{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=ls.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==mr.object){const u=this._getOrReturnCtx(e);return Jn(u,{code:On.invalid_type,expected:mr.object,received:u.parsedType}),ei}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof A1&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const d=s[u],h=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new g1(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof A1){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(Jn(i,{code:On.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const h=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new g1(i,h,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const h=await d.key,f=await d.value;u.push({key:h,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>Qd.mergeObjectSync(r,u)):Qd.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return wr.errToObj,new So({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var s,a;const i=((a=(s=this._def).errorMap)==null?void 0:a.call(s,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:wr.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new So({...this._def,unknownKeys:"strip"})}passthrough(){return new So({...this._def,unknownKeys:"passthrough"})}extend(e){return new So({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new So({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ni.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new So({...this._def,catchall:e})}pick(e){const t={};for(const r of ls.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new So({...this._def,shape:()=>t})}omit(e){const t={};for(const r of ls.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new So({...this._def,shape:()=>t})}deepPartial(){return J2(this)}partial(e){const t={};for(const r of ls.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}return new So({...this._def,shape:()=>t})}required(e){const t={};for(const r of ls.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof e1;)s=s._def.innerType;t[r]=s}return new So({...this._def,shape:()=>t})}keyof(){return _se(ls.objectKeys(this.shape))}}So.create=(n,e)=>new So({shape:()=>n,unknownKeys:"strip",catchall:A1.create(),typeName:ni.ZodObject,...Ci(e)});So.strictCreate=(n,e)=>new So({shape:()=>n,unknownKeys:"strict",catchall:A1.create(),typeName:ni.ZodObject,...Ci(e)});So.lazycreate=(n,e)=>new So({shape:n,unknownKeys:"strip",catchall:A1.create(),typeName:ni.ZodObject,...Ci(e)});class oM extends rs{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new M0(o.ctx.common.issues));return Jn(t,{code:On.invalid_union,unionErrors:a}),ei}if(t.common.async)return Promise.all(r.map(async s=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const u={...t,common:{...t.common,issues:[]},parent:null},d=l._parseSync({data:t.data,path:t.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;
vendor: 5,044 bytes, line 76
76const o=a.map(l=>new M0(l));return Jn(t,{code:On.invalid_union,unionErrors:o}),ei}}get options(){return this._def.options}}oM.create=(n,e)=>new oM({options:n,typeName:ni.ZodUnion,...Ci(e)});function Fj(n,e){const t=bA(n),r=bA(e);if(n===e)return{valid:!0,data:n};if(t===mr.object&&r===mr.object){const i=ls.objectKeys(e),s=ls.objectKeys(n).filter(o=>i.indexOf(o)!==-1),a={...n,...e};for(const o of s){const l=Fj(n[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(t===mr.array&&r===mr.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<n.length;s++){const a=n[s],o=e[s],l=Fj(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return t===mr.date&&r===mr.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class lM extends rs{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(YW(s)||YW(a))return ei;const o=Fj(s.value,a.value);return o.valid?((QW(s)||QW(a))&&t.dirty(),{status:t.value,value:o.data}):(Jn(r,{code:On.invalid_intersection_types}),ei)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}lM.create=(n,e,t)=>new lM({left:n,right:e,typeName:ni.ZodIntersection,...Ci(t)});class Xv extends rs{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==mr.array)return Jn(r,{code:On.invalid_type,expected:mr.array,received:r.parsedType}),ei;if(r.data.length<this._def.items.length)return Jn(r,{code:On.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ei;!this._def.rest&&r.data.length>this._def.items.length&&(Jn(r,{code:On.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new g1(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>Qd.mergeArray(t,a)):Qd.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Xv({...this._def,rest:e})}}Xv.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xv({items:n,typeName:ni.ZodTuple,rest:null,...Ci(e)})};class sX extends rs{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==mr.map)return Jn(r,{code:On.invalid_type,expected:mr.map,received:r.parsedType}),ei;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],u)=>({key:i._parse(new g1(r,o,r.path,[u,"key"])),value:s._parse(new g1(r,l,r.path,[u,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return ei;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return ei;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}}}}sX.create=(n,e,t)=>new sX({valueType:e,keyType:n,typeName:ni.ZodMap,...Ci(t)});class V4 extends rs{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==mr.set)return Jn(r,{code:On.invalid_type,expected:mr.set,received:r.parsedType}),ei;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Jn(r,{code:On.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Jn(r,{code:On.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function a(l){const u=new Set;for(const d of l){if(d.status==="aborted")return ei;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const o=[...r.data.values()].map((l,u)=>s._parse(new g1(r,l,r.path,u)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,t){return new V4({...this._def,minSize:{value:e,message:wr.toString(t)}})}max(e,t){return new V4({...this._def,maxSize:{value:e,message:wr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}V4.create=(n,e)=>new V4({valueType:n,minSize:null,maxSize:null,typeName:ni.ZodSet,...Ci(e)});class aX extends rs{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}aX.create=(n,e)=>new aX({getter:n,typeName:ni.ZodLazy,...Ci(e)});class oX extends rs{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Jn(t,{received:t.data,code:On.invalid_literal,expected:this._def.value}),ei}
vendor: 5,387 bytes, line 76
76return{status:"valid",value:e.data}}get value(){return this._def.value}}oX.create=(n,e)=>new oX({value:n,typeName:ni.ZodLiteral,...Ci(e)});function _se(n,e){return new Xb({values:n,typeName:ni.ZodEnum,...Ci(e)})}class Xb extends rs{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return Jn(t,{expected:ls.joinValues(r),received:t.parsedType,code:On.invalid_type}),ei}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return Jn(t,{received:t.data,code:On.invalid_enum_value,options:r}),ei}return Zh(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Xb.create(e,{...this._def,...t})}exclude(e,t=this._def){return Xb.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}Xb.create=_se;class lX extends rs{_parse(e){const t=ls.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==mr.string&&r.parsedType!==mr.number){const i=ls.objectValues(t);return Jn(r,{expected:ls.joinValues(i),received:r.parsedType,code:On.invalid_type}),ei}if(this._cache||(this._cache=new Set(ls.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=ls.objectValues(t);return Jn(r,{received:r.data,code:On.invalid_enum_value,options:i}),ei}return Zh(e.data)}get enum(){return this._def.values}}lX.create=(n,e)=>new lX({values:n,typeName:ni.ZodNativeEnum,...Ci(e)});class cM extends rs{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==mr.promise&&t.common.async===!1)return Jn(t,{code:On.invalid_type,expected:mr.promise,received:t.parsedType}),ei;const r=t.parsedType===mr.promise?t.data:Promise.resolve(t.data);return Zh(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}cM.create=(n,e)=>new cM({type:n,typeName:ni.ZodPromise,...Ci(e)});class Yb extends rs{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ni.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{Jn(r,a),a.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);if(r.common.async)return Promise.resolve(a).then(async o=>{if(t.value==="aborted")return ei;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?ei:l.status==="dirty"||t.value==="dirty"?gS(l.value):l});{if(t.value==="aborted")return ei;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?ei:o.status==="dirty"||t.value==="dirty"?gS(o.value):o}}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ei:(o.status==="dirty"&&t.dirty(),a(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?ei:(o.status==="dirty"&&t.dirty(),a(o.value).then(()=>({status:t.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Wb(a))return ei;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Wb(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:t.value,value:o})):ei);ls.assertNever(i)}}Yb.create=(n,e,t)=>new Yb({schema:n,typeName:ni.ZodEffects,effect:e,...Ci(t)});Yb.createWithPreprocess=(n,e,t)=>new Yb({schema:e,effect:{type:"preprocess",transform:n},typeName:ni.ZodEffects,...Ci(t)});class e1 extends rs{_parse(e){return this._getType(e)===mr.undefined?Zh(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}e1.create=(n,e)=>new e1({innerType:n,typeName:ni.ZodOptional,...Ci(e)});class Qb extends rs{_parse(e){return this._getType(e)===mr.null?Zh(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qb.create=(n,e)=>new Qb({innerType:n,typeName:ni.ZodNullable,...Ci(e)});class Uj extends rs{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===mr.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Uj.create=(n,e)=>new Uj({innerType:n,typeName:ni.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ci(e)});class Bj extends rs{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sM(i)?i.then(s=>
vendor: 2,136 bytes, line 76
76({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new M0(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new M0(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Bj.create=(n,e)=>new Bj({innerType:n,typeName:ni.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ci(e)});class cX extends rs{_parse(e){if(this._getType(e)!==mr.nan){const r=this._getOrReturnCtx(e);return Jn(r,{code:On.invalid_type,expected:mr.nan,received:r.parsedType}),ei}return{status:"valid",value:e.data}}}cX.create=n=>new cX({typeName:ni.ZodNaN,...Ci(n)});class owe extends rs{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class hB extends rs{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ei:s.status==="dirty"?(t.dirty(),gS(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ei:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new hB({in:e,out:t,typeName:ni.ZodPipeline})}}class Vj extends rs{_parse(e){const t=this._def.innerType._parse(e),r=i=>(Wb(i)&&(i.value=Object.freeze(i.value)),i);return sM(t)?t.then(i=>r(i)):r(t)}unwrap(){return this._def.innerType}}Vj.create=(n,e)=>new Vj({innerType:n,typeName:ni.ZodReadonly,...Ci(e)});var ni;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",
76n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(ni||(ni={}));const lwe=UA.create;A1.create;h0.create;const Sse=So.create;oM.create;lM.create;Xv.create;Xb.create;cM.create;e1.create;Qb.create;const cwe="\x1B[31m";function uwe(n,e){try{return e.parse(n)}catch(t){if(t instanceof M0){const r=["","ââ Env vars validation failed ââ",""];for(const i of t.errors)r.push(` - ${i.message}`);throw r.push(""),r.push("ââââââââââââââââââââââââââââââââ"),console.error(cwe,r.join(` 77`)),new Error("Error parsing environment variables")}else throw t}}const dwe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,REACT_APP_API_URL:"https://spread-out-server.fly.dev",SSR:!1},hwe=Sse({}),fwe=Sse({REACT_APP_API_URL:lwe({required_error:"REACT_APP_API_URL is required"}).default("http://localhost:3001")}),pwe=hwe.merge(fwe),mwe=uwe(dwe,pwe),gwe=Dbe(mwe.REACT_APP_API_URL),Zi={apiUrl:gwe};var uM;(function(n){n.Get="GET",n.Post="POST",n.Put="PUT",n.Delete="DELETE"})(uM||(uM={}));const fB=mo("form",{marginTop:"1.5rem"}),zm=mo("div",{"& + div":{marginTop:"1.5rem"}}),Kb=mo("label",{display:"block !important",fontSize:"$sm !important",fontWeight:"500 !important",marginBottom:"0.5rem !important"}),Tse={display:"block !important",lineHeight:"1.5rem !important",fontSize:"$sm !important",borderWidth:"1px !important",borderColor:"$gray600 !important",backgroundColor:"#f8f4ff !important",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05) !important","&:focus":{borderWidth:"1px !important",borderColor:"$gray700 !important",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05) !important"},"&:disabled":{opacity:"0.5 !important",cursor:"not-allowed !important",backgroundColor:"$gray400 !important",borderColor:"$gray400 !important",color:"$gray500 !important"},borderRadius:"0.375rem !important",width:"100% !important",paddingTop:"0.375rem !important",paddingBottom:"0.375rem !important",paddingLeft:"0.75rem !important",paddingRight:"0.75rem !important",margin:"0 !important"},Zb=mo("input",Tse),Awe=mo("textarea",Tse),Jb=mo("div",{display:"block",fontSize:"$sm",fontWeight:"500",color:"$formErrorText",marginTop:"0.5rem"}),pB=mo("button",{display:"flex !important",justifyContent:"center !important",width:"100% !important",borderWidth:"1px !important",borderColor:"$brand !important",backgroundColor:"$brand !important",color:"$submitButtonText !important",padding:"0.5rem 0.75rem !important",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05) !important",fontWeight:"600 !important",fontSize:"$sm !important",lineHeight:"1.25rem !important",borderRadius:"0.375rem !important","&:hover":{backgroundColor:"$brandAccent !important",borderColor:"$brandAccent !important"},"&:disabled":{opacity:"0.5 !important",cursor:"not-allowed !important",backgroundColor:"$gray400 !important",borderColor:"$gray400 !important",color:"$gray500 !important"},transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1) !important",transitionDuration:"100ms !important"}),xwe=dbe({width:"1.25rem",height:"1.25rem"}),vwe=()=>c.jsx("svg",{className:xwe(),"aria-hidden":"true",fill:"currentColor",viewBox:"0 0 24 24",children:c.jsx("g",{id:"brand",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:c.jsx("g",{id:"google",fill:"#000000",fillRule:"nonzero",children:c.jsx("path",{d:"M11.99,13.9 L11.99,10.18 L21.35,10.18 C21.49,10.81 21.6,11.4 21.6,12.23 C21.6,17.94 17.77,22 12,22 C6.48,22 2,17.52 2,12 C2,6.48 6.48,2 12,2 C14.7,2 16.96,2.99 18.69,4.61 L15.85,7.37 C15.13,6.69 13.87,5.89 12,5.89 C8.69,5.89 5.99,8.64 5.99,12.01 C5.99,15.38 8.69,18.13 12,18.13 C15.83,18.13 17.24,15.48 17.5,13.91 L11.99,13.91 L11.99,13.9 Z",id:"Shape"})})})}),ywe=mo("a",{display:"flex !important",justifyContent:"center !important",cursor:"pointer !important",color:"inherit !important",backgroundColor:"#f0f0f0 !important",borderRadius:"0.375rem !important",borderWidth:"1px !important",borderColor:"$gray600 !important",fontSize:"13px !important",padding:"0.5rem 0.75rem !important",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05) !important","&:visited":{color:"inherit !important"},"&:hover":{backgroundColor:"$gray500 !important",color:"inherit !important"},transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1) !important",transitionDuration:"100ms !important"});function Ese(n,e){return function(){return n.apply(e,arguments)}}const{toString:bwe}=Object.prototype,{getPrototypeOf:mB}=Object,{iterator:S8,toStringTag:Cse}=Symbol,T8=(n=>e=>{const t=bwe.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),ap=n=>(n=n.toLowerCase(),e=>T8(e)===n),E8=n=>e=>typeof e===n,{isArray:A_}=Array,ew=E8("undefined");function sT(n){return n!==null&&!ew(n)&&n.constructor!==null&&!ew(n.constructor)&&$u(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Nse=ap("ArrayBuffer");function wwe(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&Nse(n.buffer),e}const _we=E8("string"),$u=E8("function"),Mse=E8("number"),aT=n=>n!==null&&typeof n=="object",Swe=n=>n===!0||n===!1,KN=n=>{if(T8(n)!=="object")return!1;const e=mB(n);
vendor: 14,150 bytes, lines 77-78
77return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Cse in n)&&!(S8 in n)},Twe=n=>{if(!aT(n)||sT(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},Ewe=ap("Date"),Cwe=ap("File"),Nwe=n=>!!(n&&typeof n.uri<"u"),Mwe=n=>n&&typeof n.getParts<"u",kwe=ap("Blob"),Rwe=ap("FileList"),Pwe=n=>aT(n)&&$u(n.pipe);function Lwe(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const uX=Lwe(),dX=typeof uX.FormData<"u"?uX.FormData:void 0,Owe=n=>{let e;return n&&(dX&&n instanceof dX||$u(n.append)&&((e=T8(n))==="formdata"||e==="object"&&$u(n.toString)&&n.toString()==="[object FormData]"))},Dwe=ap("URLSearchParams"),[jwe,Iwe,Fwe,Uwe]=["ReadableStream","Request","Response","Headers"].map(ap),Bwe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function oT(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let r,i;if(typeof n!="object"&&(n=[n]),A_(n))for(r=0,i=n.length;r<i;r++)e.call(null,n[r],r,n);else{if(sT(n))return;const s=t?Object.getOwnPropertyNames(n):Object.keys(n),a=s.length;let o;for(r=0;r<a;r++)o=s[r],e.call(null,n[o],o,n)}}function kse(n,e){if(sT(n))return null;e=e.toLowerCase();const t=Object.keys(n);let r=t.length,i;for(;r-- >0;)if(i=t[r],e===i.toLowerCase())return i;return null}const lv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Rse=n=>!ew(n)&&n!==lv;function zj(){const{caseless:n,skipUndefined:e}=Rse(this)&&this||{},t={},r=(i,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const a=n&&kse(t,s)||s;KN(t[a])&&KN(i)?t[a]=zj(t[a],i):KN(i)?t[a]=zj({},i):A_(i)?t[a]=i.slice():(!e||!ew(i))&&(t[a]=i)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&oT(arguments[i],r);return t}const Vwe=(n,e,t,{allOwnKeys:r}={})=>(oT(e,(i,s)=>{t&&$u(i)?Object.defineProperty(n,s,{value:Ese(i,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),n),zwe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Gwe=(n,e,t,r)=>{n.prototype=Object.create(e.prototype,r),Object.defineProperty(n.prototype,"constructor",{value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},qwe=(n,e,t,r)=>{let i,s,a;const o={};if(e=e||{},n==null)return e;do{for(i=Object.getOwnPropertyNames(n),s=i.length;s-- >0;)a=i[s],(!r||r(a,n,e))&&!o[a]&&(e[a]=n[a],o[a]=!0);n=t!==!1&&mB(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},$we=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const r=n.indexOf(e,t);return r!==-1&&r===t},Hwe=n=>{if(!n)return null;if(A_(n))return n;let e=n.length;if(!Mse(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},Wwe=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&mB(Uint8Array)),Xwe=(n,e)=>{const r=(n&&n[S8]).call(n);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(n,s[0],s[1])}},Ywe=(n,e)=>{let t;const r=[];for(;(t=n.exec(e))!==null;)r.push(t);return r},Qwe=ap("HTMLFormElement"),Kwe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,i){return r.toUpperCase()+i}),hX=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),Zwe=ap("RegExp"),Pse=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),r={};oT(t,(i,s)=>{let a;(a=e(i,s,n))!==!1&&(r[s]=a||i)}),Object.defineProperties(n,r)},Jwe=n=>{Pse(n,(e,t)=>{if($u(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=n[t];if($u(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},e_e=(n,e)=>{const t={},r=i=>{i.forEach(s=>{t[s]=!0})};return A_(n)?r(n):r(String(n).split(e)),t},t_e=()=>{},n_e=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function r_e(n){return!!(n&&$u(n.append)&&n[Cse]==="FormData"&&n[S8])}const i_e=n=>{const e=new Array(10),t=(r,i)=>{if(aT(r)){if(e.indexOf(r)>=0)return;if(sT(r))return r;if(!("toJSON"in r)){e[i]=r;const s=A_(r)?[]:{};return oT(r,(a,o)=>{const l=t(a,i+1);!ew(l)&&(s[o]=l)}),e[i]=void 0,s}}return r};return t(n,0)},s_e=ap("AsyncFunction"),a_e=n=>n&&(aT(n)||$u(n))&&$u(n.then)&&$u(n.catch),Lse=((n,e)=>n?setImmediate:e?((t,r)=>(lv.addEventListener("message",({source:i,data:s})=>{i===lv&&s===t&&r.length&&r.shift()()},!1),i=>{r.push(i),lv.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",$u(lv.postMessage)),o_e=typeof queueMicrotask<"u"?queueMicrotask.bind(lv):typeof process<"u"&&process.nextTick||Lse,l_e=n=>n!=null&&$u(n[S8]),Gt={isArray:A_,isArrayBuffer:Nse,isBuffer:sT,isFormData:Owe,isArrayBufferView:wwe,isString:_we,isNumber:Mse,isBoolean:Swe,isObject:aT,isPlainObject:KN,isEmptyObject:Twe,isReadableStream:jwe,isRequest:Iwe,isResponse:Fwe,isHeaders:Uwe,isUndefined:ew,isDate:Ewe,isFile:Cwe,isReactNativeBlob:Nwe,isReactNative:Mwe,isBlob:kwe,isRegExp:Zwe,isFunction:$u,isStream:Pwe,isURLSearchParams:Dwe,isTypedArray:Wwe,isFileList:Rwe,forEach:oT,merge:zj,extend:Vwe,trim:Bwe,stripBOM:zwe,inherits:Gwe,toFlatObject:qwe,kindOf:T8,kindOfTest:ap,endsWith:$we,toArray:Hwe,forEachEntry:Xwe,matchAll:Ywe,isHTMLForm:Qwe,hasOwnProperty:hX,hasOwnProp:hX,reduceDescriptors:Pse,freezeMethods:Jwe,toObjectSet:e_e,toCamelCase:Kwe,noop:t_e,toFiniteNumber:n_e,findKey:kse,global:lv,isContextDefined:Rse,isSpecCompliantForm:r_e,toJSONObject:i_e,isAsyncFn:s_e,isThenable:a_e,setImmediate:Lse,asap:o_e,isIterable:l_e};let qr=class Ose extends Error{static from(e,t,r,i,s,a){const o=new Ose(e.message,t||e.code,r,i,s);return o.cause=e,o.name=e.name,e.status!=null&&o.status==null&&(o.status=e.status),a&&Object.assign(o,a),o}constructor(e,t,r,i,s){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Gt.toJSONObject(this.config),code:this.code,status:this.status}}};qr.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";qr.ERR_BAD_OPTION="ERR_BAD_OPTION";qr.ECONNABORTED="ECONNABORTED";qr.ETIMEDOUT="ETIMEDOUT";qr.ERR_NETWORK="ERR_NETWORK";qr.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";qr.ERR_DEPRECATED="ERR_DEPRECATED";qr.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";qr.ERR_BAD_REQUEST="ERR_BAD_REQUEST";qr.ERR_CANCELED="ERR_CANCELED";qr.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";qr.ERR_INVALID_URL="ERR_INVALID_URL";const c_e=null;function Gj(n){return Gt.isPlainObject(n)||Gt.isArray(n)}function Dse(n){return Gt.endsWith(n,"[]")?n.slice(0,-2):n}function D7(n,e,t){return n?n.concat(e).map(function(i,s){return i=Dse(i),!t&&s?"["+i+"]":i}).join(t?".":""):e}function u_e(n){return Gt.isArray(n)&&!n.some(Gj)}const d_e=Gt.toFlatObject(Gt,{},null,function(e){return/^is[A-Z]/.test(e)});function C8(n,e,t){if(!Gt.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=Gt.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(A,x){return!Gt.isUndefined(x[A])});const r=t.metaTokens,i=t.visitor||d,s=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&Gt.isSpecCompliantForm(e);if(!Gt.isFunction(i))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(Gt.isDate(g))return g.toISOString();if(Gt.isBoolean(g))return g.toString();if(!l&&Gt.isBlob(g))throw new qr("Blob is not supported. Use a Buffer instead.");return Gt.isArrayBuffer(g)||Gt.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,A,x){let b=g;if(Gt.isReactNative(e)&&Gt.isReactNativeBlob(g))return e.append(D7(x,A,s),u(g)),!1;if(g&&!x&&typeof g=="object"){if(Gt.endsWith(A,"{}"))A=r?A:A.slice(0,-2),g=JSON.stringify(g);else if(Gt.isArray(g)&&u_e(g)||(Gt.isFileList(g)||Gt.endsWith(A,"[]"))&&(b=Gt.toArray(g)))return A=Dse(A),b.forEach(function(M,T){!(Gt.isUndefined(M)||M===null)&&e.append(a===!0?D7([A],T,s):a===null?A:A+"[]",u(M))}),!1}return Gj(g)?!0:(e.append(D7(x,A,s),u(g)),!1)}const h=[],f=Object.assign(d_e,{defaultVisitor:d,convertValue:u,isVisitable:Gj});function p(g,A){if(!Gt.isUndefined(g)){if(h.indexOf(g)!==-1)throw Error("Circular reference detected in "+A.join("."));h.push(g),Gt.forEach(g,function(b,_){(!(Gt.isUndefined(b)||b===null)&&i.call(e,b,Gt.isString(_)?_.trim():_,A,f))===!0&&p(b,A?A.concat(_):[_])}),h.pop()}}if(!Gt.isObject(n))throw new TypeError("data must be an object");return p(n),e}function fX(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function gB(n,e){this._pairs=[],n&&C8(n,this,e)}const jse=gB.prototype;jse.append=function(e,t){this._pairs.push([e,t])};jse.toString=function(e){const t=e?function(r){return e.call(this,r,fX)}:fX;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function h_e(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ise(n,e,t){if(!e)return n;const r=t&&t.encode||h_e,i=Gt.isFunction(t)?{serialize:t}:t,s=i&&i.serialize;let a;if(s?a=s(e,i):a=Gt.isURLSearchParams(e)?e.toString():new gB(e,i).toString(r),a){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+a}return n}class pX{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Gt.forEach(this.handlers,function(r){r!==null&&e(r)})}}const AB={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},f_e=typeof URLSearchParams<"u"?URLSearchParams:gB,p_e=typeof FormData<"u"?FormData:null,m_e=typeof Blob<"u"?Blob:null,g_e={isBrowser:!0,classes:{URLSearchParams:f_e,FormData:p_e,Blob:m_e},protocols:["http","https","file","blob","url","data"]},xB=typeof window<"u"&&typeof document<"u",qj=typeof navigator=="object"&&navigator||void 0,A_e=xB&&(!qj||["ReactNative","NativeScript","NS"].indexOf(qj.product)<0),x_e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",v_e=xB&&window.location.href||"http://localhost",y_e=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xB,hasStandardBrowserEnv:A_e,hasStandardBrowserWebWorkerEnv:x_e,navigator:qj,origin:v_e},Symbol.toStringTag,{value:"Module"})),mc={...y_e,...g_e};function b_e(n,e){return C8(n,new mc.classes.URLSearchParams,{visitor:function(t,r,i,s){return mc.isNode&&Gt.isBuffer(t)?(this.append(r,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function w_e(n){return Gt.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function __e(n){const e={},t=Object.keys(n);let r;const i=t.length;let s;for(r=0;r<i;r++)s=t[r],e[s]=n[s];return e}function Fse(n){function e(t,r,i,s){let a=t[s++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),l=s>=t.length;return a=!a&&Gt.isArray(i)?i.length:a,l?(Gt.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!o):((!i[a]||!Gt.isObject(i[a]))&&(i[a]=[]),e(t,r,i[a],s)&&Gt.isArray(i[a])&&(i[a]=__e(i[a])),!o)}if(Gt.isFormData(n)&&Gt.isFunction(n.entries)){const t={};return Gt.forEachEntry(n,(r,i)=>{e(w_e(r),i,t,0)}),t}return null}function S_e(n,e,t){if(Gt.isString(n))try{return(e||JSON.parse)(n),Gt.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}const lT={transitional:AB,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",i=r.indexOf("application/json")>-1,s=Gt.isObject(e);if(s&&Gt.isHTMLForm(e)&&(e=new FormData(e)),Gt.isFormData(e))return i?JSON.stringify(Fse(e)):e;if(Gt.isArrayBuffer(e)||Gt.isBuffer(e)||Gt.isStream(e)||Gt.isFile(e)||Gt.isBlob(e)||Gt.isReadableStream(e))return e;if(Gt.isArrayBufferView(e))return e.buffer;if(Gt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return b_e(e,this.formSerializer).toString();if((o=Gt.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return C8(o?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),S_e(e)):e}],transformResponse:[function(e){const t=this.transitional||lT.transitional,r=t&&t.forcedJSONParsing,i=this.responseType==="json";if(Gt.isResponse(e)||Gt.isReadableStream(e))return e;if(e&&Gt.isString(e)&&(r&&!this.responseType||i)){const a=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(o){if(a)throw o.name==="SyntaxError"?qr.from(o,qr.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mc.classes.FormData,Blob:mc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Gt.forEach(["delete","get","head","post","put","patch"],n=>{lT.headers[n]={}});const T_e=Gt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),E_e=n=>{const e={};let t,r,i;return n&&n.split(` 78`).forEach(function(a){i=a.indexOf(":"),t=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!t||e[t]&&T_e[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},mX=Symbol("internals");function h3(n){return n&&String(n).trim().toLowerCase()}function ZN(n){return n===!1||n==null?n:Gt.isArray(n)?n.map(ZN):String(n)}function C_e(n){const e=Object.create(null),t=/([^\s,;
78=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}const N_e=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function j7(n,e,t,r,i){if(Gt.isFunction(r))return r.call(this,e,t);if(i&&(e=t),!!Gt.isString(e)){if(Gt.isString(r))return e.indexOf(r)!==-1;if(Gt.isRegExp(r))return r.test(e)}}function M_e(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function k_e(n,e){const t=Gt.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+t,{value:function(i,s,a){return this[r].call(this,e,i,s,a)},configurable:!0})})}let Hu=class{constructor(e){e&&this.set(e)}set(e,t,r){const i=this;function s(o,l,u){const d=h3(l);if(!d)throw new Error("header name must be a non-empty string");const h=Gt.findKey(i,d);(!h||i[h]===void 0||u===!0||u===void 0&&i[h]!==!1)&&(i[h||l]=ZN(o))}const a=(o,l)=>Gt.forEach(o,(u,d)=>s(u,d,l));if(Gt.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Gt.isString(e)&&(e=e.trim())&&!N_e(e))a(E_e(e),t);else if(Gt.isObject(e)&&Gt.isIterable(e)){let o={},l,u;for(const d of e){if(!Gt.isArray(d))throw TypeError("Object iterator must return a key-value pair");o[u=d[0]]=(l=o[u])?Gt.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}a(o,t)}else e!=null&&s(t,e,r);return this}get(e,t){if(e=h3(e),e){const r=Gt.findKey(this,e);if(r){const i=this[r];if(!t)return i;if(t===!0)return C_e(i);if(Gt.isFunction(t))return t.call(this,i,r);if(Gt.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=h3(e),e){const r=Gt.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||j7(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let i=!1;function s(a){if(a=h3(a),a){const o=Gt.findKey(r,a);o&&(!t||j7(r,r[o],o,t))&&(delete r[o],i=!0)}}return Gt.isArray(e)?e.forEach(s):s(e),i}clear(e){const t=Object.keys(this);let r=t.length,i=!1;for(;r--;){const s=t[r];(!e||j7(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const t=this,r={};return Gt.forEach(this,(i,s)=>{const a=Gt.findKey(r,s);if(a){t[a]=ZN(i),delete t[s];return}const o=e?M_e(s):String(s).trim();o!==s&&delete t[s],t[o]=ZN(i),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Gt.forEach(this,(r,i)=>{r!=null&&r!==!1&&(t[i]=e&&Gt.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` 79`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[mX]=this[mX]={accessors:{}}).accessors,i=this.prototype;function s(a){const o=h3(a);r[o]||(k_e(i,a),r[o]=!0)}return Gt.isArray(e)?e.forEach(s):s(e),this}};Hu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Gt.reduceDescriptors(Hu.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(r){this[t]=r}}});Gt.freezeMethods(Hu);function I7(n,e){const t=this||lT,r=e||t,i=Hu.from(r.headers);let s=r.data;return Gt.forEach(n,function(o){s=o.call(t,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Use(n){return!!(n&&n.__CANCEL__)}let cT=class extends qr{constructor(e,t,r){super(e??"canceled",qr.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function Bse(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new qr("Request failed with status code "+t.status,[qr.ERR_BAD_REQUEST,qr.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function R_e(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function P_e(n,e){n=n||10;const t=new Array(n),r=new Array(n);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),d=r[s];a||(a=u),t[i]=l,r[i]=u;let h=s,f=0;for(;h!==i;)f+=t[h++],h=h%n;if(i=(i+1)%n,i===s&&(s=(s+1)%n),u-a<e)return;const p=d&&u-d;return p?Math.round(f*1e3/p):void 0}}function L_e(n,e){let t=0,r=1e3/e,i,s;const a=(u,d=Date.now())=>
vendor: 7,154 bytes, line 79
79{t=d,i=null,s&&(clearTimeout(s),s=null),n(...u)};return[(...u)=>{const d=Date.now(),h=d-t;h>=r?a(u,d):(i=u,s||(s=setTimeout(()=>{s=null,a(i)},r-h)))},()=>i&&a(i)]}const dM=(n,e,t=3)=>{let r=0;const i=P_e(50,250);return L_e(s=>{const a=s.loaded,o=s.lengthComputable?s.total:void 0,l=a-r,u=i(l),d=a<=o;r=a;const h={loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:u||void 0,estimated:u&&o&&d?(o-a)/u:void 0,event:s,lengthComputable:o!=null,[e?"download":"upload"]:!0};n(h)},t)},gX=(n,e)=>{const t=n!=null;return[r=>e[0]({lengthComputable:t,total:n,loaded:r}),e[1]]},AX=n=>(...e)=>Gt.asap(()=>n(...e)),O_e=mc.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,mc.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(mc.origin),mc.navigator&&/(msie|trident)/i.test(mc.navigator.userAgent)):()=>!0,D_e=mc.hasStandardBrowserEnv?{write(n,e,t,r,i,s,a){if(typeof document>"u")return;const o=[`${n}=${encodeURIComponent(e)}`];Gt.isNumber(t)&&o.push(`expires=${new Date(t).toUTCString()}`),Gt.isString(r)&&o.push(`path=${r}`),Gt.isString(i)&&o.push(`domain=${i}`),s===!0&&o.push("secure"),Gt.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.join("; ")},read(n){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function j_e(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function I_e(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Vse(n,e,t){let r=!j_e(e);return n&&(r||t==!1)?I_e(n,e):e}const xX=n=>n instanceof Hu?{...n}:n;function Yv(n,e){e=e||{};const t={};function r(u,d,h,f){return Gt.isPlainObject(u)&&Gt.isPlainObject(d)?Gt.merge.call({caseless:f},u,d):Gt.isPlainObject(d)?Gt.merge({},d):Gt.isArray(d)?d.slice():d}function i(u,d,h,f){if(Gt.isUndefined(d)){if(!Gt.isUndefined(u))return r(void 0,u,h,f)}else return r(u,d,h,f)}function s(u,d){if(!Gt.isUndefined(d))return r(void 0,d)}function a(u,d){if(Gt.isUndefined(d)){if(!Gt.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function o(u,d,h){if(h in e)return r(u,d);if(h in n)return r(void 0,u)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(u,d,h)=>i(xX(u),xX(d),h,!0)};return Gt.forEach(Object.keys({...n,...e}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=Gt.hasOwnProp(l,d)?l[d]:i,f=h(n[d],e[d],d);Gt.isUndefined(f)&&h!==o||(t[d]=f)}),t}const zse=n=>{const e=Yv({},n);let{data:t,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:o}=e;if(e.headers=a=Hu.from(a),e.url=Ise(Vse(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),Gt.isFormData(t)){if(mc.hasStandardBrowserEnv||mc.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Gt.isFunction(t.getHeaders)){const l=t.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([d,h])=>{u.includes(d.toLowerCase())&&a.set(d,h)})}}if(mc.hasStandardBrowserEnv&&(r&&Gt.isFunction(r)&&(r=r(e)),r||r!==!1&&O_e(e.url))){const l=i&&s&&D_e.read(s);l&&a.set(i,l)}return e},F_e=typeof XMLHttpRequest<"u",U_e=F_e&&function(n){return new Promise(function(t,r){const i=zse(n);let s=i.data;const a=Hu.from(i.headers).normalize();let{responseType:o,onUploadProgress:l,onDownloadProgress:u}=i,d,h,f,p,g;function A(){p&&p(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let x=new XMLHttpRequest;x.open(i.method.toUpperCase(),i.url,!0),x.timeout=i.timeout;function b(){if(!x)return;const M=Hu.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),L={data:!o||o==="text"||o==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:M,config:n,request:x};Bse(function(P){t(P),A()},function(P){r(P),A()},L),x=null}"onloadend"in x?x.onloadend=b:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(b)},x.onabort=function(){x&&(r(new qr("Request aborted",qr.ECONNABORTED,n,x)),x=null)},x.onerror=function(T){const L=T&&T.message?T.message:"Network Error",D=new qr(L,qr.ERR_NETWORK,n,x);D.event=T||null,r(D),x=null},x.ontimeout=function(){let T=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const L=i.transitional||AB;i.timeoutErrorMessage&&(T=i.timeoutErrorMessage),r(new qr(T,L.clarifyTimeoutError?qr.ETIMEDOUT:qr.ECONNABORTED,n,x)),x=null},s===void 0&&a.setContentType(null),"setRequestHeader"in x&&Gt.forEach(a.toJSON(),function(T,L){x.setRequestHeader(L,T)}),Gt.isUndefined(i.withCredentials)||(x.withCredentials=!!i.withCredentials),o&&o!=="json"&&(x.responseType=i.responseType),u&&([f,g]=dM(u,!0),x.addEventListener("progress",f)),l&&x.upload&&([h,p]=dM(l),x.upload.addEventListener("progress",h),x.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(d=M=>{x&&(r(!M||M.type?new cT(null,n,x):M),x.abort(),x=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const _=R_e(i.url);if(_&&mc.protocols.indexOf(_)===-1){r(new qr("Unsupported protocol "+_+":",qr.ERR_BAD_REQUEST,n));return}x.send(s||null)})},B_e=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let r=new AbortController,i;const s=function(u){if(!i){i=!0,o();const d=u instanceof Error?u:this.reason;r.abort(d instanceof qr?d:new cT(d instanceof Error?d.message:d))}};let a=e&&setTimeout(()=>{a=null,s(new qr(`timeout of ${e}ms exceeded`,qr.ETIMEDOUT))},e);const o=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),n=null)};n.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>Gt.asap(o),l}},V_e=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let r=0,i;for(;r<t;)i=r+e,yield n.slice(r,i),r=i},z_e=async function*(n,e){for await(const t of G_e(n))yield*V_e(t,e)},G_e=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},vX=(n,e,t,r)=>{const i=z_e(n,e);let s=0,a,o=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await i.next();if(u){o(),l.close();return}let h=d.byteLength;if(t){let f=s+=h;t(f)}l.enqueue(new Uint8Array(d))}catch(u){throw o(u),u}},cancel(l){return o(l),i.return()}},{highWaterMark:2})},yX=64*1024,{isFunction:RE}=Gt,q_e=(({Request:n,Response:e})=>({Request:n,Response:e}))(Gt.global),{ReadableStream:bX,TextEncoder:wX}=Gt.global,_X=(n,...e)=>{try{return!!n(...e)}
vendor: 9,347 bytes, lines 79-82
79catch{return!1}},$_e=n=>{n=Gt.merge.call({skipUndefined:!0},q_e,n);const{fetch:e,Request:t,Response:r}=n,i=e?RE(e):typeof fetch=="function",s=RE(t),a=RE(r);if(!i)return!1;const o=i&&RE(bX),l=i&&(typeof wX=="function"?(g=>A=>g.encode(A))(new wX):async g=>new Uint8Array(await new t(g).arrayBuffer())),u=s&&o&&_X(()=>{let g=!1;const A=new t(mc.origin,{body:new bX,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!A}),d=a&&o&&_X(()=>Gt.isReadableStream(new r("").body)),h={stream:d&&(g=>g.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!h[g]&&(h[g]=(A,x)=>{let b=A&&A[g];if(b)return b.call(A);throw new qr(`Response type '${g}' is not supported`,qr.ERR_NOT_SUPPORT,x)})});const f=async g=>{if(g==null)return 0;if(Gt.isBlob(g))return g.size;if(Gt.isSpecCompliantForm(g))return(await new t(mc.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if(Gt.isArrayBufferView(g)||Gt.isArrayBuffer(g))return g.byteLength;if(Gt.isURLSearchParams(g)&&(g=g+""),Gt.isString(g))return(await l(g)).byteLength},p=async(g,A)=>{const x=Gt.toFiniteNumber(g.getContentLength());return x??f(A)};return async g=>{let{url:A,method:x,data:b,signal:_,cancelToken:M,timeout:T,onDownloadProgress:L,onUploadProgress:D,responseType:P,headers:O,withCredentials:F="same-origin",fetchOptions:U}=zse(g),B=e||fetch;P=P?(P+"").toLowerCase():"text";let z=B_e([_,M&&M.toAbortSignal()],T),H=null;const X=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let W;try{if(D&&u&&x!=="get"&&x!=="head"&&(W=await p(O,b))!==0){let Y=new t(A,{method:"POST",body:b,duplex:"half"}),re;if(Gt.isFormData(b)&&(re=Y.headers.get("content-type"))&&O.setContentType(re),Y.body){const[_e,Ee]=gX(W,dM(AX(D)));b=vX(Y.body,yX,_e,Ee)}}Gt.isString(F)||(F=F?"include":"omit");const J=s&&"credentials"in t.prototype,ee={...U,signal:z,method:x.toUpperCase(),headers:O.normalize().toJSON(),body:b,duplex:"half",credentials:J?F:void 0};H=s&&new t(A,ee);let ae=await(s?B(H,U):B(A,ee));const le=d&&(P==="stream"||P==="response");if(d&&(L||le&&X)){const Y={};["status","statusText","headers"].forEach(Ae=>{Y[Ae]=ae[Ae]});const re=Gt.toFiniteNumber(ae.headers.get("content-length")),[_e,Ee]=L&&gX(re,dM(AX(L),!0))||[];ae=new r(vX(ae.body,yX,_e,()=>{Ee&&Ee(),X&&X()}),Y)}P=P||"text";let Z=await h[Gt.findKey(h,P)||"text"](ae,g);return!le&&X&&X(),await new Promise((Y,re)=>{Bse(Y,re,{data:Z,headers:Hu.from(ae.headers),status:ae.status,statusText:ae.statusText,config:g,request:H})})}catch(J){throw X&&X(),J&&J.name==="TypeError"&&/Load failed|fetch/i.test(J.message)?Object.assign(new qr("Network Error",qr.ERR_NETWORK,g,H,J&&J.response),{cause:J.cause||J}):qr.from(J,J&&J.code,g,H,J&&J.response)}}},H_e=new Map,Gse=n=>{let e=n&&n.env||{};const{fetch:t,Request:r,Response:i}=e,s=[r,i,t];let a=s.length,o=a,l,u,d=H_e;for(;o--;)l=s[o],u=d.get(l),u===void 0&&d.set(l,u=o?new Map:$_e(e)),d=u;return u};Gse();const vB={http:c_e,xhr:U_e,fetch:{get:Gse}};Gt.forEach(vB,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const SX=n=>`- ${n}`,W_e=n=>Gt.isFunction(n)||n===null||n===!1;function X_e(n,e){n=Gt.isArray(n)?n:[n];const{length:t}=n;let r,i;const s={};for(let a=0;a<t;a++){r=n[a];let o;if(i=r,!W_e(r)&&(i=vB[(o=String(r)).toLowerCase()],i===void 0))throw new qr(`Unknown adapter '${o}'`);if(i&&(Gt.isFunction(i)||(i=i.get(e))))break;s[o||"#"+a]=i}if(!i){const a=Object.entries(s).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since : 80`+a.map(SX).join(` 81`):" "+SX(a[0]):"as no adapter specified";throw new qr("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i}const qse={getAdapter:X_e,adapters:vB};function F7(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new cT(null,n)}function TX(n){return F7(n),n.headers=Hu.from(n.headers),n.data=I7.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),qse.getAdapter(n.adapter||lT.adapter,n)(n).then(function(r){return F7(n),r.data=I7.call(n,n.transformResponse,r),r.headers=Hu.from(r.headers),r},function(r){return Use(r)||(F7(n),r&&r.response&&(r.response.data=I7.call(n,n.transformResponse,r.response),r.response.headers=Hu.from(r.response.headers))),Promise.reject(r)})}const $se="1.13.6",N8={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{N8[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});const EX={};N8.transitional=function(e,t,r){function i(s,a){return"[Axios v"+$se+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,o)=>{if(e===!1)throw new qr(i(a," has been removed"+(t?" in "+t:"")),qr.ERR_DEPRECATED);return t&&!EX[a]&&(EX[a]=!0,console.warn(i(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,a,o):!0}};N8.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Y_e(n,e,t){if(typeof n!="object")throw new qr("options must be an object",qr.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let i=r.length;for(;i-- >0;){const s=r[i],a=e[s];if(a){const o=n[s],l=o===void 0||a(o,s,n);if(l!==!0)throw new qr("option "+s+" must be "+l,qr.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new qr("Unknown option "+s,qr.ERR_BAD_OPTION)}}const JN={assertOptions:Y_e,validators:N8},yh=JN.validators;let Sv=class{constructor(e){this.defaults=e||{},this.interceptors={request:new pX,response:new pX}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` 82`+s):r.stack=s}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Yv(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:s}=t;r!==void 0&&JN.assertOptions(r,{silentJSONParsing:yh.transitional(yh.boolean),forcedJSONParsing:yh.transitional(yh.boolean),clarifyTimeoutError:yh.transitional(yh.boolean),legacyInterceptorReqResOrdering:yh.transitional(yh.boolean)},!1),i!=null&&(Gt.isFunction(i)?t.paramsSerializer={serialize:i}:JN.assertOptions(i,{encode:yh.function,serialize:yh.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),JN.assertOptions(t,{baseUrl:yh.spelling("baseURL"),withXsrfToken:yh.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&Gt.merge(s.common,s[t.method]);s&&Gt.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),t.headers=Hu.concat(a,s);const o=[];let l=!0;this.interceptors.request.forEach(function(A){if(typeof A.runWhen=="function"&&A.runWhen(t)===!1)return;l=l&&A.synchronous;const x=t.transitional||AB;x&&x.legacyInterceptorReqResOrdering?o.unshift(A.fulfilled,A.rejected):o.push(A.fulfilled,A.rejected)});const u=[];this.interceptors.response.forEach(function(A){u.push(A.fulfilled,A.rejected)});let d,h=0,f;if(!l){const g=[TX.bind(this),void 0];for(g.unshift(...o),g.push(...u),f=g.length,d=Promise.resolve(t);h<f;)d=d.then(g[h++],g[h++]);return d}f=o.length;let p=t;for(;h<f;){const g=o[h++],A=o[h++];try{p=g(p)}catch(x){A.call(this,x);break}}try{d=TX.call(this,p)}catch(g){return Promise.reject(g)}for(h=0,f=u.length;h<f;)d=d.then(u[h++],u[h++]);return d}getUri(e){e=Yv(this.defaults,e);const t=Vse(e.baseURL,e.url,e.allowAbsoluteUrls);return Ise(t,e.params,e.paramsSerializer)}};Gt.forEach(["delete","get","head","options"],function(e){Sv.prototype[e]=function(t,r){return this.request(Yv(r||{},{method:e,url:t,data:(r||{}).data}))}});Gt.forEach(["post","put","patch"],function(e){function t(r){return function(s,a,o){return this.request(Yv(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Sv.prototype[e]=t(),Sv.prototype[e+"Form"]=t(!0)});let Q_e=class Hse{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(o=>{r.subscribe(o),s=o}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,o){r.reason||(r.reason=new cT(s,a,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Hse(function(i){e=i}),cancel:e}}};function K_e(n){return function(t){return n.apply(null,t)}}function Z_e(n){return Gt.isObject(n)&&n.isAxiosError===!0}const $j={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,Re
82setContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($j).forEach(([n,e])=>{$j[e]=n});function Wse(n){const e=new Sv(n),t=Ese(Sv.prototype.request,e);return Gt.extend(t,Sv.prototype,e,{allOwnKeys:!0}),Gt.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Wse(Yv(n,i))},t}const Ns=Wse(lT);Ns.Axios=Sv;Ns.CanceledError=cT;Ns.CancelToken=Q_e;Ns.isCancel=Use;Ns.VERSION=$se;Ns.toFormData=C8;Ns.AxiosError=qr;Ns.Cancel=Ns.CanceledError;Ns.all=function(e){return Promise.all(e)};Ns.spread=K_e;Ns.isAxiosError=Z_e;Ns.mergeConfig=Yv;Ns.AxiosHeaders=Hu;Ns.formToJSON=n=>Fse(Gt.isHTMLForm(n)?new FormData(n):n);Ns.getAdapter=qse.getAdapter;Ns.HttpStatusCode=$j;Ns.default=Ns;const{Axios:Hgt,AxiosError:Wgt,CanceledError:Xgt,isCancel:Ygt,CancelToken:Qgt,VERSION:Kgt,all:Zgt,Cancel:Jgt,isAxiosError:eAt,spread:tAt,toFormData:nAt,AxiosHeaders:rAt,HttpStatusCode:iAt,formToJSON:sAt,getAdapter:aAt,mergeConfig:oAt}=Ns;function J_e(n){function e(t){return`${n}:${t}`}return{getPrefixedKey:e,set(t,r){PE(),localStorage.setItem(e(t),JSON.stringify(r))},get(t){PE();const r=localStorage.getItem(e(t));try{return r?JSON.parse(r):void 0}catch{return}},remove(t){PE(),localStorage.removeItem(e(t))},clear(){PE(),Object.keys(localStorage).forEach(t=>{t.startsWith(n)&&localStorage.removeItem(t)})}}}const uT=J_e("wasp");function PE(){if(!window.localStorage)throw new Error("Local storage is not available.")}function e3e(n){return{all:n=n||new Map,on:function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},off:function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})}}}const z4=e3e(),op=Ns.create({baseURL:Zi.apiUrl}),M8="sessionId";function t3e(n){uT.set(M8,n),z4.emit("sessionId.set")}function Xse(){return uT.get(M8)}function n3e(){uT.remove(M8),z4.emit("sessionId.clear")}function r3e(){uT.clear(),z4.emit("sessionId.clear")}op.interceptors.request.use(n=>{const e=Xse();return e&&(n.headers.Authorization=`Bearer ${e}`),n});op.interceptors.response.use(void 0,n=>{var e;return((e=n.response)===null||e===void 0?void 0:e.status)===401&&n3e(),Promise.reject(n)});window.addEventListener("storage",n=>{n.key===uT.getPrefixedKey(M8)&&(n.newValue?z4.emit("sessionId.set"):z4.emit("sessionId.clear"))});function gy(n){var e,t;if(n!=null&&n.response){const r=(e=n.response)===null||e===void 0?void 0:e.data,i=n.response.status;return new i3e(i,(t=r==null?void 0:r.message)!==null&&t!==void 0?t:n.message,r)}else return n}class i3e extends Error{constructor(e,t,r){super(t),this.statusCode=e,this.data=r}}async function s3e(n){try{return(await op.post("/auth/email/signup",n)).data}catch(e){throw gy(e)}}const a3e={};let Yse;const yB=new Promise(n=>{Yse=n});function o3e(){const n=new Mve(a3e);Yse(n)}function l3e(n){const e=new Map;function t(a){return e.get(a)||[]}function r(a,o){const l=n(a),u=t(l);e.set(l,[...u,{queryKey:a,updateQuery:o}])}function i(a){const o=n(a);return t(o).map(({updateQuery:l})=>l)}function s(a){const o=n(a),l=t(o).filter(({queryKey:u})=>u!==a);l.length>0?e.set(o,l):e.delete(o)}return{add:r,remove:s,getUpdateHandlers:i}}const Hj=new Map,bB=l3e(IA);function c3e(n,e){for(const t of e){let r=Hj.get(t);r||(r=new Set,Hj.set(t,r)),r.add(n)}}
82function u3e(n){n.forEach(({queryKey:e,updateQuery:t})=>bB.add(e,t))}async function d3e(n,e){e.forEach(({queryKey:t})=>bB.remove(t)),await f3e(n)}function h3e(n){return bB.getUpdateHandlers(n)}async function Qse(){const n=await yB;n.resetQueries(),n.removeQueries()}async function f3e(n){const e=await yB;m3e(n).forEach(r=>e.invalidateQueries(r))}function p3e(n){return Array.from(Hj.get(n)||[])}function m3e(n){return Array.from(new Set(n.flatMap(p3e)))}async function Kse(n){t3e(n),await Qse()}async function g3e(n){try{const e=await op.post("/auth/email/login",n);await Kse(e.data.sessionId)}catch(e){throw gy(e)}}function A3e({onError:n,showEmailVerificationPending:e,onLoginSuccess:t,isLogin:r}){async function i(s){try{r?(await g3e(s),t()):(await s3e(s),e())}catch(a){n(a)}}return{handleSubmit:i}}const x3e=mo("div",{position:"relative",marginTop:"1.5rem"}),v3e=mo("div",{position:"absolute",inset:"0px",display:"flex",alignItems:"center"}),y3e=mo("div",{width:"100%",borderTopWidth:"1px",borderColor:"$gray500"}),b3e=mo("div",{position:"relative",display:"flex",justifyContent:"center",fontSize:"$sm"}),w3e=mo("span",{backgroundColor:"white",paddingLeft:"0.5rem",paddingRight:"0.5rem"}),_3e=mo("div",{marginTop:"1.5rem"}),S3e=mo("div",{fontWeight:"500",fontSize:"$sm"}),T3e=mo("div",{marginTop:"0.5rem",display:"flex",variants:{direction:{horizontal:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(48px, 1fr))"},vertical:{flexDirection:"column",margin:"8px 0"}},gap:{small:{gap:"4px"},medium:{gap:"8px"},large:{gap:"16px"}}}}),E3e=`${Zi.apiUrl}/auth/google/login`,C3e=({state:n,socialButtonsDirection:e="horizontal",additionalSignupFields:t})=>{const{isLoading:r,setErrorMessage:i,setSuccessMessage:s,setIsLoading:a}=G.useContext(dT),o=n==="login",l=o?"Log in":"Sign up",u=ro(),d=b=>{var _,M;i({title:b.message,description:(M=(_=b.data)===null||_===void 0?void 0:_.data)===null||M===void 0?void 0:M.message})},h=dB(),{register:f,formState:{errors:p},handleSubmit:g}=h,{handleSubmit:A}=A3e({isLogin:o,onError:d,showEmailVerificationPending(){h.reset(),s("You've signed up successfully! Check your email for the confirmation link.")},onLoginSuccess(){u("/ai-automator")}});async function x(b){a(!0),i(null),s(null);try{await A(b)}finally{a(!1)}}return c.jsxs(c.Fragment,{children:[c.jsxs(_3e,{children:[c.jsxs(S3e,{children:[l," with"]}),c.jsx(T3e,{gap:"large",direction:e,children:c.jsx(ywe,{href:E3e,children:c.jsx(vwe,{})})})]}),c.jsxs(x3e,{children:[c.jsx(v3e,{children:c.jsx(y3e,{})}),c.jsx(b3e,{children:c.jsx(w3e,{children:"Or continue with"})})]}),c.jsxs(fB,{onSubmit:g(x),children:[c.jsxs(zm,{children:[c.jsx(Kb,{children:"E-mail"}),c.jsx(Zb,{...f("email",{required:"Email is required"}),type:"email",disabled:r}),p.email&&c.jsx(Jb,{children:p.email.message})]}),c.jsxs(zm,{children:[c.jsx(Kb,{children:"Password"}),c.jsx(Zb,{...f("password",{required:"Password is required"}),type:"password",disabled:r}),p.password&&c.jsx(Jb,{children:p.password.message})]}),c.jsx(N3e,{hookForm:h,formState:{isLoading:r},additionalSignupFields:t}),c.jsx(zm,{children:c.jsx(pB,{type:"submit",disabled:r,children:l})})]})]})};function N3e({hookForm:n,formState:{isLoading:e},additionalSignupFields:t}){const{register:r,formState:{errors:i}}=n;function s(a,o,l){var u;const d=(u=i[a.name])===null||u===void 0?void 0:u.message;return c.jsxs(zm,{children:[c.jsx(Kb,{children:a.label}),c.jsx(o,{...r(a.name,a.validations),...l,disabled:e}),d&&c.jsx(Jb,{children:d})]},a.name)}return k3e(t)?t(n,{isLoading:e}):t&&t.map(a=>{if(M3e(a))return a(n,{isLoading:e});switch(a.type){case"input":return s(a,Zb,{type:"text"});case"textarea":return s(a,Awe);default:throw new Error(`Unsupported additional signup field type: ${a.type}`)}})}function M3e(n){return typeof n=="function"}function k3e(n){return typeof n=="function"}const wB=mo("div",{padding:"0.5rem 0.75rem",borderRadius:"0.375rem",marginTop:"1rem",background:"$gray400"}),R3e=mo(wB,{background:"$errorBackground",color:"$errorText"}),P3e=mo(wB,{background:"$successBackground",color:"$successText"});async function Zse(n){try{return(await op.post("/auth/email/request-password-reset",n)).data}catch(e){throw gy(e)}}async function L3e(n){try{return(await op.post("/auth/email/reset-password",n)).data}catch(e){throw gy(e)}}const O3e=()=>{const{register:n,handleSubmit:e,reset:t,formState:{errors:r}}=dB(),{isLoading:i,setErrorMessage:s,setSuccessMessage:a,setIsLoading:o}=G.useContext(dT),l=async u=>{var d,h;o(!0),s(null),a(null);try{await Zse(u),t(),a("Check your email for a password reset link.")}catch(f){s({title:f.message,description:(h=(d=f.data)===null||d===void 0?void 0:d.data)===null||h===void 0?void 0:h.message})}finally{o(!1)}};return c.jsx(c.Fragment,{children:c.jsxs(fB,{onSubmit:e(l),children:[c.jsxs(zm,{children:[c.jsx(Kb,{children:"E-mail"}),c.jsx(Zb,{...n("email",{required:"Email is required"}),type:"email",disabled:i}),r.email&&c.jsx(Jb,{children:r.email.message})]}),c.jsx(zm,{children:c.jsx(pB,{type:"submit",disabled:i,children:"Send password reset email"})})]})})},D3e=()=>{const{register:n,handleSubmit:e,reset:t,formState:{errors:r}}=dB(),{isLoading:i,setErrorMessage:s,setSuccessMessage:a,setIsLoading:o}=G.useContext(dT),l=po(),u=new URLSearchParams(l.search).get("token"),d=async h=>{var f,p;if(!u){s({title:"The token is missing from the URL. Please check the link you received in your email."});return}if(!h.password||h.password!==h.passwordConfirmation){s({title:"Passwords don't match!"});return}o(!0),s(null),a(null);try{await L3e({password:h.password,token:u}),t(),a("Your password has been reset.")}catch(g){s({title:g.message,description:(p=(f=g.data)===null||f===void 0?void 0:f.data)===null||p===void 0?void 0:p.message})}finally{o(!1)}};return c.jsx(c.Fragment,{children:c.jsxs(fB,{onSubmit:e(d),children:[c.jsxs(zm,{children:[c.jsx(Kb,{children:"New password"}),c.jsx(Zb,{...n("password",{required:"Password is required"}),type:"password",disabled:i}),r.passwordConfirmation&&c.jsx(Jb,{children:r.passwordConfirmation.message})]}),c.jsxs(zm,{children:[c.jsx(Kb,{children:"Confirm new password"}),c.jsx(Zb,{...n("passwordConfirmation",{required:"Password confirmation is required"}),type:"password",disabled:i}),r.passwordConfirmation&&c.jsx(Jb,{children:r.passwordConfirmation.message})]}),c.jsx(zm,{children:c.jsx(pB,{type:"submit",disabled:i,children:"Reset password"})})]})})};async function j3e(n){try{return(await op.post("/auth/email/verify-email",n)).data}catch(e){throw gy(e)}}const I3e=()=>{const{isLoading:n,setErrorMessage:e,setSuccessMessage:t,setIsLoading:r}=G.useContext(dT),i=po(),s=new URLSearchParams(i.search).get("token");async function a(){var o,l;if(!s){e({title:"The token is missing from the URL. Please check the link you received in your email."});return}r(!0),e(null),t(null);try{await j3e({token:s}),t("Your email has been verified. You can now log in.")}catch(u){e({title:u.message,description:(l=(o=u.data)===null||o===void 0?void 0:o.data)===null||l===void 0?void 0:l.message})}finally{r(!1)}}return G.useEffect(()=>{a()},[i]),c.jsx(c.Fragment,{children:n&&c.jsx(wB,{children:"Verifying email..."})})},F3e={height:"3rem"},U3e=mo("div",{display:"flex",flexDirection:"column"}),B3e=mo("h2",{fontSize:"1.875rem !important",fontWeight:"700 !important",marginTop:"1.5rem !important"}),dT=G.createContext({isLoading:!1,setIsLoading:n=>{},setErrorMessage:n=>{},setSuccessMessage:n=>{}});function k8({state:n,appearance:e,logo:t,socialLayout:r="horizontal",additionalSignupFields:i}){const[s,a]=G.useState(null),[o,l]=G.useState(null),[u,d]=G.useState(!1),h=ube(e??{}),p={login:"Log in to your account",signup:"Create a new account","forgot-password":"Forgot your password?","reset-password":"Reset your password","verify-email":"Email verification"}[n],g=r==="vertical"?"vertical":"horizontal";return c.jsxs(U3e,{className:h,children:[c.jsxs("div",{children:[t&&c.jsx("img",{style:F3e,src:t,alt:"Your Company"}),c.jsx(B3e,{children:p})]}),s&&c.jsxs(R3e,{children:[s.title,s.description&&": ",s.description]}),o&&c.jsx(P3e,{children:o}),c.jsxs(dT.Provider,{value:{isLoading:u,setIsLoading:d,setErrorMessage:a,setSuccessMessage:l},children:[(n==="login"||n==="signup")&&c.jsx(C3e,{state:n,socialButtonsDirection:g,additionalSignupFields:i}),n==="forgot-password"&&c.jsx(O3e,{}),n==="reset-password"&&c.jsx(D3e,{}),n==="verify-email"&&c.jsx(I3e,{})]})]})}var tw;(function(n){n.Login="login",n.Signup="signup",n.ForgotPassword="forgot-password",n.ResetPassword="reset-password",n.VerifyEmail="verify-email"})(tw||(tw={}));function V3e({appearance:n,logo:e,socialLayout:t}){return c.jsx(k8,{appearance:n,logo:e,socialLayout:t,state:tw.Login})}function z3e({appearance:n,logo:e,socialLayout:t,additionalFields:r}){return c.jsx(k8,{appearance:n,logo:e,socialLayout:t,state:tw.Signup,additionalSignupFields:r})}function G3e({appearance:n,logo:e,socialLayout:t}){return c.jsx(k8,{appearance:n,logo:e,socialLayout:t,state:tw.VerifyEmail})}function q3e({appearance:n,logo:e,socialLayout:t}){return c.jsx(k8,{appearance:n,logo:e,socialLayout:t,state:tw.ResetPassword})}class $3e{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Jse{constructor(e){this.generateIdentifier=e,this.kv=new $3e}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class H3e extends Jse{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function W3e(n){if("values"in Object)return Object.values(n);const e=[];for(const t in n)n.hasOwnProperty(t)&&e.push(n[t]);return e}function X3e(n,e){const t=W3e(n);if("find"in t)return t.find(e);const r=t;for(let i=0;i<r.length;i++){const s=r[i];if(e(s))return s}}
82function nw(n,e){Object.entries(n).forEach(([t,r])=>e(r,t))}function e6(n,e){return n.indexOf(e)!==-1}function CX(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(e(r))return r}}class Y3e{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return X3e(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}}const Q3e=n=>Object.prototype.toString.call(n).slice(8,-1),eae=n=>typeof n>"u",K3e=n=>n===null,G4=n=>typeof n!="object"||n===null||n===Object.prototype?!1:Object.getPrototypeOf(n)===null?!0:Object.getPrototypeOf(n)===Object.prototype,Wj=n=>G4(n)&&Object.keys(n).length===0,x1=n=>Array.isArray(n),Z3e=n=>typeof n=="string",J3e=n=>typeof n=="number"&&!isNaN(n),eSe=n=>typeof n=="boolean",tSe=n=>n instanceof RegExp,q4=n=>n instanceof Map,$4=n=>n instanceof Set,tae=n=>Q3e(n)==="Symbol",nSe=n=>n instanceof Date&&!isNaN(n.valueOf()),nae=n=>n instanceof Error,NX=n=>typeof n=="number"&&isNaN(n),rSe=n=>eSe(n)||K3e(n)||eae(n)||J3e(n)||Z3e(n)||tae(n),iSe=n=>typeof n=="bigint",sSe=n=>n===1/0||n===-1/0,aSe=n=>ArrayBuffer.isView(n)&&!(n instanceof DataView),oSe=n=>n instanceof URL,Xj=n=>n.replace(/\\/g,"\\\\").replace(/\./g,"\\."),U7=n=>n.map(String).map(Xj).join("."),QS=(n,e)=>{const t=[];let r="";for(let s=0;s<n.length;s++){let a=n.charAt(s);if(!e&&a==="\\"){const u=n.charAt(s+1);if(u==="\\"){r+="\\",s++;continue}else if(u!==".")throw Error("invalid path")}if(a==="\\"&&n.charAt(s+1)==="."){r+=".",s++;continue}if(a==="."){t.push(r),r="";
82continue}r+=a}const i=r;return t.push(i),t};function Cp(n,e,t,r){return{isApplicable:n,annotation:e,transform:t,untransform:r}}const rae=[Cp(eae,"undefined",()=>null,()=>{}),Cp(iSe,"bigint",n=>n.toString(),n=>typeof BigInt<"u"?BigInt(n):(console.error("Please add a BigInt polyfill."),n)),Cp(nSe,"Date",n=>n.toISOString(),n=>new Date(n)),Cp(nae,"Error",(n,e)=>{const t={name:n.name,message:n.message};return"cause"in n&&(t.cause=n.cause),e.allowedErrorProps.forEach(r=>{t[r]=n[r]}),t},(n,e)=>{const t=new Error(n.message,{cause:n.cause});return t.name=n.name,t.stack=n.stack,e.allowedErrorProps.forEach(r=>{t[r]=n[r]}),t}),Cp(tSe,"regexp",n=>""+n,n=>{const e=n.slice(1,n.lastIndexOf("/")),t=n.slice(n.lastIndexOf("/")+1);return new RegExp(e,t)}),Cp($4,"set",n=>[...n.values()],n=>new Set(n)),Cp(q4,"map",n=>[...n.entries()],n=>new Map(n)),Cp(n=>NX(n)||sSe(n),"number",n=>NX(n)?"NaN":n>0?"Infinity":"-Infinity",Number),Cp(n=>n===0&&1/n===-1/0,"number",()=>"-0",Number),Cp(oSe,"URL",n=>n.toString(),n=>new URL(n))];function R8(n,e,t,r){return{isApplicable:n,annotation:e,transform:t,untransform:r}}const iae=R8((n,e)=>tae(n)?!!e.symbolRegistry.getIdentifier(n):!1,(n,e)=>["symbol",e.symbolRegistry.getIdentifier(n)],n=>n.description,(n,e,t)=>{const r=t.symbolRegistry.getValue(e[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),lSe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((n,e)=>(n[e.name]=e,n),{}),sae=R8(aSe,n=>["typed-array",n.constructor.name],n=>[...n],(n,e)=>{const t=lSe[e[1]];if(!t)throw new Error("Trying to deserialize unknown typed array");return new t(n)});function aae(n,e){return n!=null&&n.constructor?!!e.classRegistry.getIdentifier(n.constructor):!1}const oae=R8(aae,(n,e)=>["class",e.classRegistry.getIdentifier(n.constructor)],(n,e)=>{const t=e.classRegistry.getAllowedProps(n.constructor);if(!t)return{...n};const r={};return t.forEach(i=>{r[i]=n[i]}),r},(n,e,t)=>{const r=t.classRegistry.getValue(e[1]);if(!r)throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),n)}),lae=R8((n,e)=>!!e.customTransformerRegistry.findApplicable(n),(n,e)=>["custom",e.customTransformerRegistry.findApplicable(n).name],(n,e)=>e.customTransformerRegistry.findApplicable(n).serialize(n),(n,e,t)=>{const r=t.customTransformerRegistry.findByName(e[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(n)}),cSe=[oae,iae,lae,sae],MX=(n,e)=>{const t=CX(cSe,i=>i.isApplicable(n,e));if(t)return{value:t.transform(n,e),type:t.annotation(n,e)};const r=CX(rae,i=>i.isApplicable(n,e));if(r)return{value:r.transform(n,e),type:r.annotation}},cae={};rae.forEach(n=>{cae[n.annotation]=n});const uSe=(n,e,t)=>{if(x1(e))switch(e[0]){case"symbol":return iae.untransform(n,e,t);case"class":return oae.untransform(n,e,t);case"custom":return lae.untransform(n,e,t);case"typed-array":return sae.untransform(n,e,t);default:throw new Error("Unknown transformation: "+e)}else{const r=cae[e];if(!r)throw new Error("Unknown transformation: "+e);return r.untransform(n,t)}},lb=(n,e)=>{if(e>n.size)throw new Error("index out of bounds");const t=n.keys();for(;e>0;)t.next(),e--;return t.next().value};function uae(n){if(e6(n,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(e6(n,"prototype"))throw new Error("prototype is not allowed as a property");if(e6(n,"constructor"))throw new Error("constructor is not allowed as a property")}const dSe=(n,e)=>{uae(e);for(let t=0;t<e.length;t++){const r=e[t];if($4(n))n=lb(n,+r);else if(q4(n)){const i=+r,s=+e[++t]==0?"key":"value",a=lb(n,i);switch(s){case"key":n=a;break;case"value":n=n.get(a);break}}else n=n[r]}return n},Yj=(n,e,t)=>{if(uae(e),e.length===0)return t(n);let r=n;for(let s=0;s<e.length-1;s++){const a=e[s];if(x1(r)){const o=+a;r=r[o]}else if(G4(r))r=r[a];else if($4(r)){const o=+a;r=lb(r,o)}else if(q4(r)){if(s===e.length-2)break;const l=+a,u=+e[++s]==0?"key":"value",d=lb(r,l);switch(u){case"key":r=d;break;case"value":r=r.get(d);break}}}const i=e[e.length-1];if(x1(r)?r[+i]=t(r[+i]):G4(r)&&(r[i]=t(r[i])),$4(r)){const s=lb(r,+i),a=t(s);s!==a&&(r.delete(s),r.add(a))}if(q4(r)){const s=+e[e.length-2],a=lb(r,s);switch(+i==0?"key":"value"){case"key":{const l=t(a);r.set(l,r.get(a)),l!==a&&r.delete(a);break}case"value":{r.set(a,t(r.get(a)));break}}}return n},dae=n=>n<1;function Qj(n,e,t,r=[]){if(!n)return;const i=dae(t);if(!x1(n)){nw(n,(o,l)=>Qj(o,e,t,[...r,...QS(l,i)]));return}const[s,a]=n;a&&nw(a,(o,l)=>{Qj(o,e,t,[...r,...QS(l,i)])}),e(s,r)}function hSe(n,e,t,r){return Qj(e,(i,s)=>{n=Yj(n,s,a=>uSe(a,i,r))},t),n}function fSe(n,e,t){const r=dae(t);function i(s,a){const o=dSe(n,QS(a,r));s.map(l=>
82QS(l,r)).forEach(l=>{n=Yj(n,l,()=>o)})}if(x1(e)){const[s,a]=e;s.forEach(o=>{n=Yj(n,QS(o,r),()=>n)}),a&&nw(a,i)}else nw(e,i);return n}const pSe=(n,e)=>G4(n)||x1(n)||q4(n)||$4(n)||nae(n)||aae(n,e);function mSe(n,e,t){const r=t.get(n);r?r.push(e):t.set(n,[e])}function gSe(n,e){const t={};let r;return n.forEach(i=>{if(i.length<=1)return;e||(i=i.map(o=>o.map(String)).sort((o,l)=>o.length-l.length));const[s,...a]=i;s.length===0?r=a.map(U7):t[U7(s)]=a.map(U7)}),r?Wj(t)?[r]:[r,t]:Wj(t)?void 0:t}const hae=(n,e,t,r,i=[],s=[],a=new Map)=>{const o=rSe(n);if(!o){mSe(n,i,e);const p=a.get(n);if(p)return r?{transformedValue:null}:p}if(!pSe(n,t)){const p=MX(n,t),g=p?{transformedValue:p.value,annotations:[p.type]}:{transformedValue:n};return o||a.set(n,g),g}if(e6(s,n))return{transformedValue:null};const l=MX(n,t),u=(l==null?void 0:l.value)??n,d=x1(u)?[]:{},h={};nw(u,(p,g)=>{if(g==="__proto__"||g==="constructor"||g==="prototype")throw new Error(`Detected property ${g}. This is a prototype pollution risk, please remove it from your object.`);const A=hae(p,e,t,r,[...i,g],[...s,n],a);d[g]=A.transformedValue,x1(A.annotations)?h[Xj(g)]=A.annotations:G4(A.annotations)&&nw(A.annotations,(x,b)=>{h[Xj(g)+"."+b]=x})});const f=Wj(h)?{transformedValue:d,annotations:l?[l.type]:void 0}:{transformedValue:d,annotations:l?[l.type,h]:h};return o||a.set(n,f),f};function fae(n){return Object.prototype.toString.call(n).slice(8,-1)}function kX(n){return fae(n)==="Array"}function ASe(n){if(fae(n)!=="Object")return!1;const e=Object.getPrototypeOf(n);return!!e&&e.constructor===Object&&e===Object.prototype}function xSe(n,e,t,r,i){const s={}.propertyIsEnumerable.call(r,e)?"enumerable":"nonenumerable";s==="enumerable"&&(n[e]=t),i&&s==="nonenumerable"&&Object.defineProperty(n,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}function Kj(n,e={}){if(kX(n))return n.map(i=>Kj(i,e));if(!ASe(n))return n;const t=Object.getOwnPropertyNames(n),r=Object.getOwnPropertySymbols(n);return[...t,...r].reduce((i,s)=>{if(s==="__proto__"||kX(e.props)&&!e.props.includes(s))return i;const a=n[s],o=Kj(a,e);return xSe(i,s,o,n,e.nonenumerable),i},{})}class qs{constructor({dedupe:e=!1}={}){this.classRegistry=new H3e,this.symbolRegistry=new Jse(t=>t.description??""),this.customTransformerRegistry=new Y3e,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,r=hae(e,t,this,this.dedupe),i={json:r.transformedValue};r.annotations&&(i.meta={...i.meta,values:r.annotations});const s=gSe(t,this.dedupe);return s&&(i.meta={...i.meta,referentialEqualities:s}),i.meta&&(i.meta.v=1),i}deserialize(e,t){const{json:r,meta:i}=e;let s=t!=null&&t.inPlace?r:Kj(r);return i!=null&&i.values&&(s=hSe(s,i.values,i.v??0,this)),i!=null&&i.referentialEqualities&&(s=fSe(s,i.referentialEqualities,i.v??0)),s}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}qs.defaultInstance=new qs;qs.serialize=qs.defaultInstance.serialize.bind(qs.defaultInstance);qs.deserialize=qs.defaultInstance.deserialize.bind(qs.defaultInstance);qs.stringify=qs.defaultInstance.stringify.bind(qs.defaultInstance);qs.parse=qs.defaultInstance.parse.bind(qs.defaultInstance);qs.registerClass=qs.defaultInstance.registerClass.bind(qs.defaultInstance);qs.registerSymbol=qs.defaultInstance.registerSymbol.bind(qs.defaultInstance);qs.registerCustom=qs.defaultInstance.registerCustom.bind(qs.defaultInstance);qs.allowErrorProps=qs.defaultInstance.allowErrorProps.bind(qs.defaultInstance);const vSe=qs.serialize,pae=qs.deserialize;async function mae(n,e){try{const t=vSe(e),r=await op.post(n.path,t);return pae(r.data)}catch(t){throw gy(t)}}function gae(n){return{method:uM.Post,path:`/${n}`}}function Dn(n,e){const t=gae(n);async function r(s,a){u3e(a);try{return await mae(t,s)}finally{await d3e(e,a)}}const i=s=>r(s,[]);return i.internal=r,i}const ySe=Dn("operations/update-current-user",["User"]),Aae=Dn("operations/update-user-by-id",["User"]),b
82Se=Dn("operations/delete-user-by-id",["User","Workflow","Execution","Post","SocialMediaConnection","Task","Subtask","File","GptResponse","ContactFormMessage","Feedback","CancelForm","Referral"]),xae=Dn("operations/close-account",["User"]);Dn("operations/create-social-media-connection",["User","SocialMediaConnection"]);const wSe=Dn("operations/exchange-instagram-token",["User","SocialMediaConnection"]),_Se=Dn("operations/delete-social-media-connection",["User","SocialMediaConnection"]),vae=Dn("operations/get-post-peer-auth-url",["User","SocialMediaConnection"]);Dn("operations/join-waiting-list",["User"]);Dn("operations/create-referral",["User","Referral"]);const SSe=Dn("operations/process-referral",["User","Referral"]);Dn("operations/update-referral-subscription",["User","Referral"]);const TSe=Dn("operations/record-share-and-add-credits",["User"]);Dn("operations/activate-pending-referral",["User","Referral"]);const ESe=Dn("operations/decide-mcp-authorization",["User"]),CSe=Dn("operations/create-mcp-token",["User"]),NSe=Dn("operations/revoke-mcp-connection",["User"]),MSe=Dn("operations/save-reply-rule",["User","SocialMediaConnection","CommentReplyRule"]),kSe=Dn("operations/list-automation-posts",["User","SocialMediaConnection"]),RSe=Dn("operations/save-comment-automation",["User","SocialMediaConnection","CommentAutomationLink"]),PSe=Dn("operations/set-comment-automation-status",["User","SocialMediaConnection","CommentAutomationLink"]),LSe=Dn("operations/delete-comment-automation",["User","SocialMediaConnection","CommentAutomationLink","CommentActivity"]),OSe=Dn("operations/get-automation-logs",["User","SocialMediaConnection","CommentActivity"]),DSe=Dn("operations/suggest-trigger-keywords",["User","SocialMediaConnection"]),jSe=Dn("operations/generate-search-terms",["User","Task","GptResponse"]),ISe=Dn("operations/generate-category-search-terms",["User","Task","GptResponse"]),FSe=Dn("operations/perform-linkedin-search",["User"]),USe=Dn("operations/get-recommended-social-media-by-country",["User","Task","GptResponse"]),RX=Dn("operations/generate-gpt-response",["User","Task","GptResponse"]),BSe=Dn("operations/generate-gpt-description",["User","Task","GptResponse"]),AS=Dn("operations/create-workflow",["Workflow"]),VSe=Dn("operations/deduct-credits",["User"]),zSe=Dn("operations/unlock-post-analytics",["User","SocialMediaConnection"]);Dn("operations/add-credits",["User"]);const Cm=Dn("operations/update-workflow",["Workflow"]),GSe=Dn("operations/update-auto-pilot-channels",["User","Workflow","SocialMediaConnection","RssFeedSubscription"]),qSe=Dn("operations/delete-workflow",["Workflow","Post","Execution"]),$Se=Dn("operations/delete-executions-by-workflow",["Execution","Workflow"]),HSe=Dn("operations/delete-executions",["Execution","Workflow","Post"]),WSe=Dn("operations/stop-execution",["Execution"]),yae=Dn("operations/delete-execution",["Execution","Post"]);Dn("operations/schedule-post",["Execution","SocialMediaConnection"]);const bae=Dn("operations/update-post",["Post","Execution"]),XSe=Dn("operations/generate-posting-strategy",["User"]),PX=Dn("operations/detect-rss-feed",["User"]),YSe=Dn("operations/generate-podcast-scene",["User"]),QSe=Dn("operations/generate-rss-item-strategy",["User"]),KSe=Dn("operations/subscribe-to-rss-feed",["User","RssFeedSubscription"]);Dn("operations/unsubscribe-rss-feed",["User","RssFeedSubscription"]);Dn("operations/rotate-auto-pilot-slot",["Workflow","Execution","Post","User"]);const ZSe=Dn("operations/refresh-auto-pilot-weekly-strategy",["Workflow","Execution","Post","User"]),wae=Dn("operations/manual-post",["Execution","Post","SocialMediaConnection"]),JSe=Dn("operations/generate-script-preview",["Workflow","User"]);Dn("operations/generate-social-post-text",["Workflow","User"]);Dn("operations/execute-workflow",["Workflow","Post","Execution","SocialMediaConnection","User"]);const e4e=Dn("operations/start-workflow-background",["Workflow","Post","Execution","SocialMediaConnection","User"]),t4e=Dn("operations/complete-ugcwith-avatar-only",["Workflow","Post","Execution","User"]),n4e=Dn("operations/complete-full-ugcworkflow",["Workflow","Post","Execution","User"]),r4e=Dn("operations/generate-avatar-preview",[]),i4e=Dn("operations/generate-tailored-ad-video",["User","Execution"]);Dn("operations/post-to-social-media-action",["Post","SocialMediaConnection","Execution"]);const LX=Dn("operations/send-cancel-form",["User","CancelForm"]),s4e=Dn("operations/send-feedback",["User","Feedback"]),a4e=Dn("operations/create-task",["Task"]),xS=Dn("operations/delete-task",["Task"]),o4e=Dn("operations/update-task",["Task"]),l4e=Dn("operations/create-subtask",["Subtask","Task"]);Dn("operations/update-subtask",["Subtask"]);Dn("operations/delete-subtask",["Subtask"]);const c4e=Dn("operations/get-subscribed-newsletter",["Newsletter"]),u4e=Dn("operations/subscribe-newsletter",["Newsletter"]),OX=Dn("operations/mark-admin-message-read",["ContactFormMessage"]),d4e=Dn("operations/send-admin-template-email",["User"]),h4e=Dn("operations/generate-checkout-session",["User"]),dm=Dn("operations/create-file",["User","File"]),f4e=Dn("operations/delete-subtasks-by-task",["Subtask","Task"]),p4e=Dn("operations/send-admin-test-email",["User","EmailLog"]),m4e=Dn("operations/generate-post-description",["User"]),g4e=Dn("operations/track-event",["Event","User"]);Dn("operations/update-app-config",["RemoteConfig","User"]);const A4e=Dn("operations/save-provider-key",["User","ProviderCredential"]),x4e=Dn("operations/delete-provider-key",["User","ProviderCredential"]),v4e=Dn("operations/set-byok-models",["User","ProviderCredential"]),y4e=Dn("operations/set-byok-enabled",["User","ProviderCredential"]),b4e=Dn("operations/set-byok-voice",["User","ProviderCredential"]),w4e=Dn("operations/set-byok-voice-enabled",["User","ProviderCredential"]);function _ae(n,e){return e!==void 0?[...n.queryCacheKey,e]:n.queryCacheKey}function Li(n,e){const t=gae(n),r=[n],i=(async s=>{const a=await mae(t,s),o=_ae(i,s);return h3e(o).reduce((l,u)=>u(l),a)});return Sae(i,{queryCacheKey:r,queryRoute:t,entitiesUsed:e})}function Sae(n,{queryCacheKey:e,queryRoute:t,entitiesUsed:r}){const i=n;return i.queryCacheKey=e,i.route=t,c3e(i.queryCacheKey,r),i}const _4e=Li("operations/get-paginated-users",["User"]),P8=Li("operations/get-social-media-connections-for-user",["User","SocialMediaConnection"]);Li("operations/is-user-whitelisted",["User"]);const S4e=Li("operations/get-user-referrals",["User","Referral"]),T4e=Li("operations/get-personal-referral-code",["User","Referral"]),E4e=Li("operations/get-leaderboard",["User"]),C4e=Li("operations/get-mcp-authorize-request",["User"]),N4e=Li("operations/list-mcp-connections",["User"]),M4e=Li("operations/get-comments-center",["User","SocialMediaConnection","CommentReplyRule","CommentActivity","CommentAutomationLink"]),Tae=Li("operations/get-ai-workflows-for-user",["User","Workflow"]),k4e=Li("operations/get-executions-from-workflow",["Execution","Workflow"]),hM=Li("operations/get-all-executions-for-user",["Execution","Workflow"]),_B=Li("operations/get-all-posts-for-user",["Post","Workflow","Execution"]),DX=Li("operations/get-post-analytics",["Post","Workflow","SocialMediaConnection","User"]);Li("operations/get-user-rss-subscriptions",["User","RssFeedSubscription"]);const jX=Li("operations/discover-viral-hooks",[]),R4e=Li("operations/get-posts-for-workflow",["Post","Workflow"]);Li("operations/get-gpt-responses",["User","GptResponse"]);Li("operations/get-all-tasks-by-user",["Task"]);const P4e=Li("operations/get-all-tasks-for-user",["Task","Subtask"]),Eae=Li("operations/get-paginated-tasks",["Task"]),L4e=Li("operations/get-paginated-admin-tasks",["Task","User"]),O4e=Li("operations/get-paginated-admin-workflows",["Workflow","User","Execution","Post"]),Cae=Li("operations/get-admin-inbox",["Feedback","CancelForm","ContactFormMessage","User"]),D4e=Li("operations/get-admin-user-detail",["User","Workflow","Execution","Post","Task"]),j4e=Li("operations/get-admin-email-recipients",["User","Execution","Workflow"]),Nae=Li("operations/get-customer-portal-url",["User"]),Mae=Li("operations/get-all-subtasks-by-user",["Subtask"]),I4e=Li("operations/get-subtasks-for-task",["Subtask"]);Li("operations/get-all-files-by-user",["User","File"]);Li("operations/get-download-file-signed-url",["User","File"]);const F4e=Li("operations/get-daily-stats",["User","DailyStats"]),kae=Li("operations/get-funnel-analytics",["Event","User","EmailLog","RemoteConfig","Workflow","Execution","AdRewardTransaction","Post"]),SB=Li("operations/get-app-config",["RemoteConfig"]),Rae=Li("operations/get-byok-settings",["User","ProviderCredential"]),U4e=Li("operations/list-provider-models",["User","ProviderCredential"]),B4e=Li("operations/list-voice-models",["User","ProviderCredential"]);function Qr(n,e,t){if(typeof n!="function")throw new TypeError("useQuery requires queryFn to be a function.");
82if(!n.queryCacheKey)throw new TypeError("queryFn needs to have queryCacheKey property defined.");return Nj(Object.assign({queryKey:_ae(n,e),queryFn:()=>n(e)},t))}function cl(n,e){JU();const i=Kve(n,{});return(s=>i.mutateAsync(s))}function V4e(n){return n!==null}function z4e(n){return n?G4e(n):null}function G4e(n){return Object.assign(Object.assign({},n),{getFirstProviderUserId:()=>{const e=Object.values(n.identities).filter(V4e);return e.length>0?e[0].id:null}})}const q4e=$4e();function Ma(){return Qr(q4e)}function $4e(){const n="auth/me",e={method:uM.Get,path:`/${n}`};return Sae(async()=>{var r;try{const i=await op.get(e.path),s=pae(i.data);return z4e(s)}catch(i){if(((r=i.response)===null||r===void 0?void 0:r.status)===401)return null;throw gy(i)}},{queryCacheKey:[n],queryRoute:e,entitiesUsed:["User"]})}async function fM(){try{await op.post("/auth/logout")}finally{r3e(),await Qse()}}function ki(n,e,t,r){const i=e?H4e(n,e):n,s=t?`?${new URLSearchParams(t).toString()}`:"",a=r?`#${r}`:"";return i+s+a}function H4e(n,e){function t(i){if(i==="*")return e["*"];if(i.startsWith(":")){const s=X4e(i);return e[s]}return i}const r=n.split("/").map(t).filter(W4e).join("/");return n.startsWith("/")?`/${r}`:r}function W4e(n){return!!n}function X4e(n){return n.endsWith("?")?n.slice(1,-1):n.slice(1)}var Y4e=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function ru(n){var{to:e,params:t,search:r,hash:i}=n,s=Y4e(n,["to","params","search","hash"]);const a=G.useMemo(()=>ki(e,t,r,i),[e,t]);return c.jsx(Ks,{to:a,...s})}const H4={LandingPageRoute:{to:"/",build:n=>ki("/",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},LoginRoute:{to:"/login",build:n=>ki("/login",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},SignupRoute:{to:"/signup",build:n=>ki("/signup",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},RequestPasswordResetRoute:{to:"/request-password-reset",build:n=>ki("/request-password-reset",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},PasswordResetRoute:{to:"/password-reset",build:n=>ki("/password-reset",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},EmailVerificationRoute:{to:"/email-verification",build:n=>ki("/email-verification",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},AccountRoute:{to:"/account",build:n=>ki("/account",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},LeaderboardRoute:{to:"/leaderboard",build:n=>ki("/leaderboard",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},ReferralsRoute:{to:"/referrals",build:n=>ki("/referrals",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},AiAutomatorRoute:{to:"/ai-automator",build:n=>ki("/ai-automator",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},TestTailoredAdVideoRoute:{to:"/test-tailored-ad-video",build:n=>ki("/test-tailored-ad-video",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},WorkflowsRoute:{to:"/workflows",build:n=>ki("/workflows",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},GroupSearchRoute:{to:"/group-search",build:n=>ki("/group-search",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},HistoryRoute:{to:"/history",build:n=>ki("/history",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},PostsRoute:{to:"/posts",build:n=>ki("/posts",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},ExecutionsRoute:{to:"/executions",build:n=>ki("/executions",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},McpAuthorizeRoute:{to:"/mcp/authorize",build:n=>ki("/mcp/authorize",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},CommentsDirectsRoute:{to:"/comments",build:n=>ki("/comments",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},PostAnalyticsRoute:{to:"/post-analytics",build:n=>ki("/post-analytics",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},PricingPageRoute:{to:"/pricing",build:n=>ki("/pricing",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},DocsPageRoute:{to:"/docs",build:n=>ki("/docs",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},DocsMcpPageRoute:{to:"/docs/mcp",build:n=>ki("/docs/mcp",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},TosPageRoute:{to:"/tos",build:n=>ki("/tos",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},PrivacyPolicyPageRoute:{to:"/privacy-policy",build:n=>ki("/privacy-policy",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},TermsOfUsePageRoute:{to:"/terms-of-use",build:n=>ki("/terms-of-use",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},CheckoutRoute:{to:"/checkout",build:n=>ki("/checkout",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},AdminRoute:{to:"/admin",build:n=>ki("/admin",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},AdminUsersRoute:{to:"/admin/users",build:n=>ki("/admin/users",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},AdminAllTasksRoute:{to:"/admin/tasks",build:n=>ki("/admin/tasks",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},AdminWorkflowsRoute:{to:"/admin/workflows",build:n=>ki("/admin/workflows",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},UserTasksRoute:{to:"/admin/users/:userId/tasks",build:n=>ki("/admin/users/:userId/tasks",n.params,n==null?void 0:n.search,n==null?void 0:n.hash)},UserTaskSubtasksRoute:{to:"/admin/users/:userId/tasks/:taskId/subtasks",build:n=>ki("/admin/users/:userId/tasks/:taskId/subtasks",n.params,n==null?void 0:n.search,n==null?void 0:n.hash)},AdminFunnelRoute:{to:"/admin/funnel",build:n=>ki("/admin/funnel",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},NotFoundRoute:{to:"*",build:n=>ki("*",n.params,n==null?void 0:n.search,n==null?void 0:n.hash)}
82,AdminMessagesRoute:{to:"/admin/messages",build:n=>ki("/admin/messages",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)},AdminEmailTemplatesRoute:{to:"/admin/email-templates",build:n=>ki("/admin/email-templates",void 0,n==null?void 0:n.search,n==null?void 0:n.hash)}};var Q4e=Object.defineProperty,K4e=(n,e,t)=>e in n?Q4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,B7=(n,e,t)=>(K4e(n,typeof e!="symbol"?e+"":e,t),t);let Z4e=class{constructor(){B7(this,"current",this.detect()),B7(this,"handoffState","pending"),B7(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Gm=new Z4e,tp=(n,e)=>{Gm.isServer?G.useEffect(n,e):G.useLayoutEffect(n,e)};function L8(n){let e=G.useRef(n);return tp(()=>{e.current=n},[n]),e}function hT(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(e=>setTimeout(()=>{throw e}))}function TB(){let n=[],e={addEventListener(t,r,i,s){return t.addEventListener(r,i,s),e.add(()=>t.removeEventListener(r,i,s))},requestAnimationFrame(...t){let r=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(r))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let r=setTimeout(...t);return e.add(()=>clearTimeout(r))},microTask(...t){let r={current:!0};return hT(()=>{r.current&&t[0]()}),e.add(()=>{r.current=!1})},style(t,r,i){let s=t.style.getPropertyValue(r);return Object.assign(t.style,{[r]:i}),this.add(()=>{Object.assign(t.style,{[r]:s})})},group(t){let r=TB();return t(r),this.add(()=>r.dispose())},add(t){return n.push(t),()=>{let r=n.indexOf(t);if(r>=0)for(let i of n.splice(r,1))i()}},dispose(){for(let t of n.splice(0))t()}};return e}function Pae(){let[n]=G.useState(TB);return G.useEffect(()=>()=>n.dispose(),[n]),n}let hl=function(n){let e=L8(n);return jn.useCallback((...t)=>e.current(...t),[e])};function O8(){let[n,e]=G.useState(Gm.isHandoffComplete);return n&&Gm.isHandoffComplete===!1&&e(!1),G.useEffect(()=>{n!==!0&&e(!0)},[n]),G.useEffect(()=>Gm.handoff(),[]),n}var IX;let B1=(IX=jn.useId)!=null?IX:function(){let n=O8(),[e,t]=jn.useState(n?()=>Gm.nextId():null);return tp(()=>{e===null&&t(Gm.nextId())},[e]),e!=null?""+e:void 0};function v1(n,e,...t){if(n in e){let i=e[n];return typeof i=="function"?i(...t):i}let r=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,v1),r}function Lae(n){return Gm.isServer?null:n instanceof Node?n.ownerDocument:n!=null&&n.hasOwnProperty("current")&&n.current instanceof Node?n.current.ownerDocument:document}let Zj=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var Kx=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n))(Kx||{}),Oae=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(Oae||{}),J4e=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(J4e||{});function e5e(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(Zj)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var Dae=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(Dae||{});function t5e(n,e=0){var t;return n===((t=Lae(n))==null?void 0:t.body)?!1:v1(e,{0(){return n.matches(Zj)},1(){let r=n;for(;r!==null;){if(r.matches(Zj))return!0;r=r.parentElement}return!1}})}function Tv(n){n==null||n.focus({preventScroll:!0})}let n5e=["textarea","input"].join(",");function r5e(n){var e,t;return(t=(e=n==null?void 0:n.matches)==null?void 0:e.call(n,n5e))!=null?t:!1}function i5e(n,e=t=>t){return n.slice().sort((t,r)=>{let i=e(t),s=e(r);if(i===null||s===null)return 0;let a=i.compareDocumentPosition(s);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function t6(n,e,{sorted:t=!0,relativeTo:r=null,skipElements:i=[]}={}){let s=Array.isArray(n)?n.length>0?n[0].ownerDocument:document:n.ownerDocument,a=Array.isArray(n)?t?i5e(n):n:e5e(n);i.length>0&&a.length>1&&(a=a.filter(p=>!i.includes(p))),r=r??s.activeElement;let o=(()=>
82{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,a.indexOf(r))-1;if(e&4)return Math.max(0,a.indexOf(r))+1;if(e&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=e&32?{preventScroll:!0}:{},d=0,h=a.length,f;do{if(d>=h||d+h<=0)return 0;let p=l+d;if(e&16)p=(p+h)%h;else{if(p<0)return 3;if(p>=h)return 1}f=a[p],f==null||f.focus(u),d+=o}while(f!==s.activeElement);return e&6&&r5e(f)&&f.select(),f.hasAttribute("tabindex")||f.setAttribute("tabindex","0"),2}function V7(n,e,t){let r=L8(e);G.useEffect(()=>{function i(s){r.current(s)}return document.addEventListener(n,i,t),()=>document.removeEventListener(n,i,t)},[n,t])}function s5e(n,e,t=!0){let r=G.useRef(!1);G.useEffect(()=>{requestAnimationFrame(()=>{r.current=t})},[t]);function i(a,o){if(!r.current||a.defaultPrevented)return;let l=(function d(h){return typeof h=="function"?d(h()):Array.isArray(h)||h instanceof Set?h:[h]})(n),u=o(a);if(u!==null&&u.getRootNode().contains(u)){for(let d of l){if(d===null)continue;let h=d instanceof HTMLElement?d:d.current;if(h!=null&&h.contains(u)||a.composed&&a.composedPath().includes(h))return}return!t5e(u,Dae.Loose)&&u.tabIndex!==-1&&a.preventDefault(),e(a,u)}}let s=G.useRef(null);V7("mousedown",a=>{var o,l;r.current&&(s.current=((l=(o=a.composedPath)==null?void 0:o.call(a))==null?void 0:l[0])||a.target)},!0),V7("click",a=>{s.current&&(i(a,()=>s.current),s.current=null)},!0),V7("blur",a=>i(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function FX(n){var e;if(n.type)return n.type;let t=(e=n.as)!=null?e:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function a5e(n,e){let[t,r]=G.useState(()=>FX(n));return tp(()=>{r(FX(n))},[n.type,n.as]),tp(()=>{t||e.current&&e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&r("button")},[t,e]),t}let jae=Symbol();function o5e(n,e=!0){return Object.assign(n,{[jae]:e})}function lp(...n){let e=G.useRef(n);G.useEffect(()=>{e.current=n},[n]);let t=hl(r=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return n.every(r=>r==null||(r==null?void 0:r[jae]))?void 0:t}function l5e(...n){return n.filter(Boolean).join(" ")}var Jj=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(Jj||{}),c5e=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(c5e||{});function ih({ourProps:n,theirProps:e,slot:t,defaultTag:r,features:i,visible:s=!0,name:a}){let o=Iae(e,n);if(s)return LE(o,t,r,a);let l=i??0;if(l&2){let{static:u=!1,...d}=o;if(u)return LE(d,t,r,a)}if(l&1){let{unmount:u=!0,...d}=o;return v1(u?0:1,{0(){return null},1(){return LE({...d,hidden:!0,style:{display:"none"}},t,r,a)}})}return LE(o,t,r,a)}function LE(n,e={},t,r){var i;let{as:s=t,children:a,refName:o="ref",...l}=z7(n,["unmount","static"]),u=n.ref!==void 0?{[o]:n.ref}:{},d=typeof a=="function"?a(e):a;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e));let h={};if(e){let f=!1,p=[];for(let[g,A]of Object.entries(e))typeof A=="boolean"&&(f=!0),A===!0&&p.push(g);f&&(h["data-headlessui-state"]=p.join(" "))}if(s===G.Fragment&&Object.keys(eI(l)).length>0){if(!G.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(g=>` - ${g}`).join(` 83`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(g=>` - ${g}`).join(` 84`)].join(` 85`));let f=l5e((i=d.props)==null?void 0:i.className,l.className),p=f?{className:f}:{};return G.cloneElement(d,Object.assign({},Iae(d.props,eI(z7(l,["ref"]))),h,u,u5e(d.ref,u.ref),p))}return G.createElement(s,Object.assign({},z7(l,["ref"]),s!==G.Fragment&&u,s!==G.Fragment&&h),d)}function u5e(...n){return{ref:n.every(e=>e==null)?void 0:e=>{for(let t of n)t!=null&&(typeof t=="function"?t(e):t.current=e)}}}function Iae(...n){if(n.length===0)return{};if(n.length===1)return n[0];let e={},t={};for(let r of n)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(t[i]!=null||(t[i]=[]),t[i].push(r[i])):e[i]=r[i];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(t).map(r=>[r,void 0])));for(let r in t)Object.assign(e,{[r](i,...s){let a=t[r];for(let o of a){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;o(i,...s)}}});return e}function Jh(n){var e;return Object.assign(G.forwardRef(n),{displayName:(e=n.displayName)!=null?e:n.name})}function eI(n){let e=Object.assign({},n);for(let t in e)e[t]===void 0&&delete e[t];return e}function z7(n,e=[]){let t=Object.assign({},n);for(let r of e)r in t&&delete t[r];return t}function Fae(n){let e=n.parentElement,t=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(t=e),e=e.parentElement;let r=(e==null?void 0:e.getAttribute("disabled"))==="";return r&&d5e(t)?!1:r}function d5e(n){if(!n)return!1;let e=n.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}function h5e(n){var e;let t=(e=n==null?void 0:n.form)!=null?e:n.closest("form");if(t){for(let r of t.elements)if(r.tagName==="INPUT"&&r.type==="submit"||r.tagName==="BUTTON"&&r.type==="submit"||r.nodeName==="INPUT"&&r.type==="image"){r.click();return}}}let f5e="div";var W4=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(W4||{});function p5e(n,e){let{features:t=1,...r}=n,i={ref:e,"aria-hidden":(t&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(t&4)===4&&(t&2)!==2&&{display:"none"}}};return ih({ourProps:i,theirProps:r,slot:{},defaultTag:f5e,name:"Hidden"})}let pM=Jh(p5e),Uae=G.createContext(null);Uae.displayName="OpenClosedContext";var vS=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(vS||{});function m5e(){return G.useContext(Uae)}var mM=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(mM||{});function g5e(n,e,t){let[r,i]=G.useState(t),s=n!==void 0,a=G.useRef(s),o=G.useRef(!1),l=G.useRef(!1);return s&&!a.current&&!o.current?(o.current=!0,a.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&a.current&&!l.current&&(l.current=!0,a.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?n:r,hl(u=>(s||i(u),e==null?void 0:e(u)))]}function EB(n,e){let t=G.useRef([]),r=hl(n);G.useEffect(()=>{let i=[...t.current];
85for(let[s,a]of e.entries())if(t.current[s]!==a){let o=r(e,i);return t.current=e,o}},[r,...e])}function A5e(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function x5e(n,e,t){let r=L8(e);G.useEffect(()=>{function i(s){r.current(s)}return window.addEventListener(n,i,t),()=>window.removeEventListener(n,i,t)},[n,t])}var yS=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(yS||{});function v5e(){let n=G.useRef(0);return x5e("keydown",e=>{e.key==="Tab"&&(n.current=e.shiftKey?1:0)},!0),n}function Bae(){let n=G.useRef(!1);return tp(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function D8(...n){return G.useMemo(()=>Lae(...n),[...n])}function Vae(n,e,t,r){let i=L8(t);G.useEffect(()=>{n=n??window;function s(a){i.current(a)}return n.addEventListener(e,s,r),()=>n.removeEventListener(e,s,r)},[n,e,r])}function zae(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let e=new Set;for(let t of n.current)t.current instanceof HTMLElement&&e.add(t.current);return e}let y5e="div";var Gae=(n=>(n[n.None=1]="None",n[n.InitialFocus=2]="InitialFocus",n[n.TabLock=4]="TabLock",n[n.FocusLock=8]="FocusLock",n[n.RestoreFocus=16]="RestoreFocus",n[n.All=30]="All",n))(Gae||{});function b5e(n,e){let t=G.useRef(null),r=lp(t,e),{initialFocus:i,containers:s,features:a=30,...o}=n;O8()||(a=1);let l=D8(t);S5e({ownerDocument:l},!!(a&16));let u=T5e({ownerDocument:l,container:t,initialFocus:i},!!(a&2));E5e({ownerDocument:l,container:t,containers:s,previousActiveElement:u},!!(a&8));let d=v5e(),h=hl(A=>{let x=t.current;x&&(b=>b())(()=>{v1(d.current,{[yS.Forwards]:()=>{t6(x,Kx.First,{skipElements:[A.relatedTarget]})},[yS.Backwards]:()=>{t6(x,Kx.Last,{skipElements:[A.relatedTarget]})}})})}),f=Pae(),p=G.useRef(!1),g={ref:r,onKeyDown(A){A.key=="Tab"&&(p.current=!0,f.requestAnimationFrame(()=>{p.current=!1}))},onBlur(A){let x=zae(s);t.current instanceof HTMLElement&&x.add(t.current);let b=A.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(qae(x,b)||(p.current?t6(t.current,v1(d.current,{[yS.Forwards]:()=>Kx.Next,[yS.Backwards]:()=>Kx.Previous})|Kx.WrapAround,{relativeTo:A.target}):A.target instanceof HTMLElement&&Tv(A.target)))}};return jn.createElement(jn.Fragment,null,!!(a&4)&&jn.createElement(pM,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:W4.Focusable}),ih({ourProps:g,theirProps:o,defaultTag:y5e,name:"FocusTrap"}),!!(a&4)&&jn.createElement(pM,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:W4.Focusable}))}let w5e=Jh(b5e),f3=Object.assign(w5e,{features:Gae}),EA=[];if(typeof window<"u"&&typeof document<"u"){let n=function(e){e.target instanceof HTMLElement&&e.target!==document.body&&EA[0]!==e.target&&(EA.unshift(e.target),EA=EA.filter(t=>t!=null&&t.isConnected),EA.splice(10))};window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})}function _5e(n=!0){let e=G.useRef(EA.slice());return EB(([t],[r])=>{r===!0&&t===!1&&hT(()=>{e.current.splice(0)}),r===!1&&t===!0&&(e.current=EA.slice())},[n,EA,e]),hl(()=>{var t;return(t=e.current.find(r=>r!=null&&r.isConnected))!=null?t:null})}function S5e({ownerDocument:n},e){let t=_5e(e);EB(()=>{e||(n==null?void 0:n.activeElement)===(n==null?void 0:n.body)&&Tv(t())},[e]);let r=G.useRef(!1);G.useEffect(()=>(r.current=!1,()=>{r.current=!0,hT(()=>{r.current&&Tv(t())})}),[])}function T5e({ownerDocument:n,container:e,initialFocus:t},r){let i=G.useRef(null),s=Bae();return EB(()=>{if(!r)return;let a=e.current;a&&hT(()=>{if(!s.current)return;let o=n==null?void 0:n.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===o){i.current=o;return}}else if(a.contains(o)){i.current=o;return}t!=null&&t.current?Tv(t.current):t6(a,Kx.First)===Oae.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=n==null?void 0:n.activeElement})},[r]),i}function E5e({ownerDocument:n,container:e,containers:t,previousActiveElement:r},i){let s=Bae();Vae(n==null?void 0:n.defaultView,"focus",a=>{if(!i||!s.current)return;let o=zae(t);e.current instanceof HTMLElement&&o.add(e.current);let l=r.current;if(!l)return;let u=a.target;u&&u instanceof HTMLElement?qae(o,u)?(r.current=u,Tv(u)):(a.preventDefault(),a.stopPropagation(),Tv(l)):Tv(r.current)},!0)}function qae(n,e){for(let t of n)if(t.contains(e))return!0;return!1}let $ae=G.createContext(!1);function C5e(){return G.useContext($ae)}function tI(n){return jn.createElement($ae.Provider,{value:n.force},n.children)}function N5e(n){let e=C5e(),t=G.useContext(Hae),r=D8(n),[i,s]=G.useState(()=>{if(!e&&t!==null||Gm.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");
85if(a)return a;if(r===null)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return G.useEffect(()=>{i!==null&&(r!=null&&r.body.contains(i)||r==null||r.body.appendChild(i))},[i,r]),G.useEffect(()=>{e||t!==null&&s(t.current)},[t,s,e]),i}let M5e=G.Fragment;function k5e(n,e){let t=n,r=G.useRef(null),i=lp(o5e(d=>{r.current=d}),e),s=D8(r),a=N5e(r),[o]=G.useState(()=>{var d;return Gm.isServer?null:(d=s==null?void 0:s.createElement("div"))!=null?d:null}),l=O8(),u=G.useRef(!1);return tp(()=>{if(u.current=!1,!(!a||!o))return a.contains(o)||(o.setAttribute("data-headlessui-portal",""),a.appendChild(o)),()=>{u.current=!0,hT(()=>{var d;u.current&&(!a||!o||(o instanceof Node&&a.contains(o)&&a.removeChild(o),a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a))))})}},[a,o]),l?!a||!o?null:Vl.createPortal(ih({ourProps:{ref:i},theirProps:t,defaultTag:M5e,name:"Portal"}),o):null}let R5e=G.Fragment,Hae=G.createContext(null);function P5e(n,e){let{target:t,...r}=n,i={ref:lp(e)};return jn.createElement(Hae.Provider,{value:t},ih({ourProps:i,theirProps:r,defaultTag:R5e,name:"Popover.Group"}))}let L5e=Jh(k5e),O5e=Jh(P5e),nI=Object.assign(L5e,{Group:O5e}),Wae=G.createContext(null);function Xae(){let n=G.useContext(Wae);if(n===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Xae),e}return n}function Yae(){let[n,e]=G.useState([]);return[n.length>0?n.join(" "):void 0,G.useMemo(()=>function(t){let r=hl(s=>(e(a=>[...a,s]),()=>e(a=>{let o=a.slice(),l=o.indexOf(s);return l!==-1&&o.splice(l,1),o}))),i=G.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props}),[r,t.slot,t.name,t.props]);return jn.createElement(Wae.Provider,{value:i},t.children)},[e])]}let D5e="p";function j5e(n,e){let t=B1(),{id:r=`headlessui-description-${t}`,...i}=n,s=Xae(),a=lp(e);tp(()=>s.register(r),[r,s.register]);let o={ref:a,...s.props,id:r};return ih({ourProps:o,theirProps:i,slot:s.slot||{},defaultTag:D5e,name:s.name||"Description"})}let I5e=Jh(j5e),Qae=Object.assign(I5e,{}),CB=G.createContext(()=>{});CB.displayName="StackContext";var rI=(n=>(n[n.Add=0]="Add",n[n.Remove=1]="Remove",n))(rI||{});function F5e(){return G.useContext(CB)}function U5e({children:n,onUpdate:e,type:t,element:r,enabled:i}){let s=F5e(),a=hl((...o)=>{e==null||e(...o),s(...o)});return tp(()=>{let o=i===void 0||i===!0;return o&&a(0,t,r),()=>{o&&a(1,t,r)}},[a,t,r,i]),jn.createElement(CB.Provider,{value:a},n)}function B5e(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const V5e=typeof Object.is=="function"?Object.is:B5e,{useState:z5e,useEffect:G5e,useLayoutEffect:q5e,useDebugValue:$5e}=$b;function H5e(n,e,t){const r=e(),[{inst:i},s]=z5e({inst:{value:r,getSnapshot:e}});return q5e(()=>{i.value=r,i.getSnapshot=e,G7(i)&&s({inst:i})},[n,r,e]),G5e(()=>(G7(i)&&s({inst:i}),n(()=>{G7(i)&&s({inst:i})})),[n]),$5e(r),r}function G7(n){const e=n.getSnapshot,t=n.value;try{const r=e();return!V5e(t,r)}catch{return!0}}function W5e(n,e,t){return e()}const X5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Y5e=!X5e,Q5e=Y5e?W5e:H5e,K5e="useSyncExternalStore"in $b?(n=>n.useSyncExternalStore)($b):Q5e;function Z5e(n){return K5e(n.subscribe,n.getSnapshot,n.getSnapshot)}function J5e(n,e){let t=n(),r=new Set;return{getSnapshot(){return t},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...s){let a=e[i].call(t,...s);a&&(t=a,r.forEach(o=>o()))}}}function eTe(){let n;return{before({doc:e}){var t;let r=e.documentElement;n=((t=e.defaultView)!=null?t:window).innerWidth-r.clientWidth},after({doc:e,d:t}){let r=e.documentElement,i=r.clientWidth-r.offsetWidth,s=n-i;t.style(r,"paddingRight",`${s}px`)}}}function tTe(){if(!A5e())return{};let n;return{before(){n=window.pageYOffset},after({doc:e,d:t,meta:r}){function i(a){return r.containers.flatMap(o=>o()).some(o=>o.contains(a))}t.style(e.body,"marginTop",`-${n}px`),window.scrollTo(0,0);let s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let o=a.target.closest("a");if(!o)return;let{hash:l}=new URL(o.href),u=e.querySelector(l);u&&!i(u)&&(s=u)}catch{}},!0),t.addEventListener(e,"touchmove",a=>{a.target instanceof HTMLElement&&!i(a.target)&&a.preventDefault()},{passive:!1}),t.add(()=>{window.scrollTo(0,window.pageYOffset+n),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})}}}function nTe(){return{before({doc:n,d:e}){e.style(n.documentElement,"overflow","hidden")}}}function rTe(n){let e={};for(let t of n)Object.assign(e,t(e));return e}let cv=J5e(()=>new Map,{PUSH(n,e){var t;let r=(t=this.get(n))!=null?t:{doc:n,count:0,d:TB(),meta:new Set};return r.count++,r.meta.add(e),this.set(n,r),this},POP(n,e){let t=this.get(n);return t&&(t.count--,t.meta.delete(e)),this},SCROLL_PREVENT({doc:n,d:e,meta:t}){let r={doc:n,d:e,meta:rTe(t)},i=[tTe(),eTe(),nTe()];
85i.forEach(({before:s})=>s==null?void 0:s(r)),i.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});cv.subscribe(()=>{let n=cv.getSnapshot(),e=new Map;for(let[t]of n)e.set(t,t.documentElement.style.overflow);for(let t of n.values()){let r=e.get(t.doc)==="hidden",i=t.count!==0;(i&&!r||!i&&r)&&cv.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&cv.dispatch("TEARDOWN",t)}});function iTe(n,e,t){let r=Z5e(cv),i=n?r.get(n):void 0,s=i?i.count>0:!1;return tp(()=>{if(!(!n||!e))return cv.dispatch("PUSH",n,t),()=>cv.dispatch("POP",n,t)},[e,n]),s}let q7=new Map,p3=new Map;function UX(n,e=!0){tp(()=>{var t;if(!e)return;let r=typeof n=="function"?n():n.current;if(!r)return;function i(){var a;if(!r)return;let o=(a=p3.get(r))!=null?a:1;if(o===1?p3.delete(r):p3.set(r,o-1),o!==1)return;let l=q7.get(r);l&&(l["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",l["aria-hidden"]),r.inert=l.inert,q7.delete(r))}let s=(t=p3.get(r))!=null?t:0;return p3.set(r,s+1),s!==0||(q7.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),i},[n,e])}var sTe=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(sTe||{}),aTe=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(aTe||{});let oTe={0(n,e){return n.titleId===e.id?n:{...n,titleId:e.id}}},gM=G.createContext(null);gM.displayName="DialogContext";function fT(n){let e=G.useContext(gM);if(e===null){let t=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,fT),t}return e}function lTe(n,e,t=()=>[document.body]){iTe(n,e,r=>{var i;return{containers:[...(i=r.containers)!=null?i:[],t]}})}function cTe(n,e){return v1(e.type,oTe,n,e)}let uTe="div",dTe=Jj.RenderStrategy|Jj.Static;function hTe(n,e){let t=B1(),{id:r=`headlessui-dialog-${t}`,open:i,onClose:s,initialFocus:a,__demoMode:o=!1,...l}=n,[u,d]=G.useState(0),h=m5e();i===void 0&&h!==null&&(i=(h&vS.Open)===vS.Open);let f=G.useRef(null),p=lp(f,e),g=G.useRef(null),A=D8(f),x=n.hasOwnProperty("open")||h!==null,b=n.hasOwnProperty("onClose");if(!x&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!x)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof s!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${s}`);let _=i?0:1,[M,T]=G.useReducer(cTe,{titleId:null,descriptionId:null,panelRef:G.createRef()}),L=hl(()=>s(!1)),D=hl(Ae=>T({type:0,id:Ae})),P=O8()?o?!1:_===0:!1,O=u>1,F=G.useContext(gM)!==null,U=O?"parent":"leaf",B=h!==null?(h&vS.Closing)===vS.Closing:!1,z=F||B?!1:P,H=G.useCallback(()=>{var Ae,te;return(te=Array.from((Ae=A==null?void 0:A.querySelectorAll("body > *"))!=null?Ae:[]).find(ve=>ve.id==="headlessui-portal-root"?!1:ve.contains(g.current)&&ve instanceof HTMLElement))!=null?te:null},[g]);UX(H,z);let X=O?!0:P,W=G.useCallback(()=>{var Ae,te;return(te=Array.from((Ae=A==null?void 0:A.querySelectorAll("[data-headlessui-portal]"))!=null?Ae:[]).find(ve=>ve.contains(g.current)&&ve instanceof HTMLElement))!=null?te:null},[g]);UX(W,X);let J=hl(()=>{var Ae,te;return[...Array.from((Ae=A==null?void 0:A.querySelectorAll("html > *, body > *, [data-headlessui-portal]"))!=null?Ae:[]).filter(ve=>!(ve===document.body||ve===document.head||!(ve instanceof HTMLElement)||ve.contains(g.current)||M.panelRef.current&&ve.contains(M.panelRef.current))),(te=M.panelRef.current)!=null?te:f.current]});s5e(()=>J(),L,!(!P||O));let ae=!(O||_!==0);Vae(A==null?void 0:A.defaultView,"keydown",Ae=>{ae&&(Ae.defaultPrevented||Ae.key===mM.Escape&&(Ae.preventDefault(),Ae.stopPropagation(),L()))}),lTe(A,!(B||_!==0||F),J),G.useEffect(()=>{if(_!==0||!f.current)return;let Ae=new ResizeObserver(te=>{for(let ve of te){let we=ve.target.getBoundingClientRect();we.x===0&&we.y===0&&we.width===0&&we.height===0&&L()}});return Ae.observe(f.current),()=>Ae.disconnect()},[_,f,L]);let[Z,Y]=Yae(),re=G.useMemo(()=>[{dialogState:_,close:L,setTitleId:D},M],[_,M,L,D]),_e=G.useMemo(()=>({open:_===0}),[_]),Ee={ref:p,id:r,role:"dialog","aria-modal":_===0?!0:void 0,"aria-labelledby":M.titleId,"aria-describedby":Z};return jn.createElement(U5e,{type:"Dialog",enabled:_===0,element:f,onUpdate:hl((Ae,te)=>{te==="Dialog"&&v1(Ae,{[rI.Add]:()=>d(ve=>ve+1),[rI.Remove]:()=>d(ve=>ve-1)})})},jn.createElement(tI,{force:!0},jn.createElement(nI,null,jn.createElement(gM.Provider,{value:re},jn.createElement(nI.Group,{target:f},jn.createElement(tI,{force:!1},jn.createElement(Y,{slot:_e,name:"Dialog.Description"},jn.createElement(f3,{initialFocus:a,containers:J,features:P?v1(U,{parent:f3.features.RestoreFocus,leaf:f3.features.All&~f3.features.FocusLock}):f3.features.None},ih({ourProps:Ee,theirProps:l,slot:_e,defaultTag:uTe,features:dTe,visible:_===0,name:"Dialog"})))))))),jn.createElement(pM,{features:W4.Hidden,ref:g}))}let fTe="div";function pTe(n,e){let t=B1(),{id:r=`headlessui-dialog-overlay-${t}`,...i}=n,[{dialogState:s,close:a}]=fT("Dialog.Overlay"),o=lp(e),l=hl(d=>{if(d.target===d.currentTarget){if(Fae(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),a()}}),u=G.useMemo(()=>({open:s===0}),[s]);return ih({ourProps:{ref:o,id:r,"aria-hidden":!0,onClick:l},theirProps:i,slot:u,defaultTag:fTe,name:"Dialog.Overlay"})}let mTe="div";function gTe(n,e){let t=B1(),{id:r=`headlessui-dialog-backdrop-${t}`,...i}=n,[{dialogState:s},a]=fT("Dialog.Backdrop"),o=lp(e);G.useEffect(()=>{if(a.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let l=G.useMemo(()=>({open:s===0}),[s]);return jn.createElement(tI,{force:!0},jn.createElement(nI,null,ih({ourProps:{ref:o,id:r,"aria-hidden":!0},theirProps:i,slot:l,defaultTag:mTe,name:"Dialog.Backdrop"})))}let ATe="div";function xTe(n,e){let t=B1(),{id:r=`headlessui-dialog-panel-${t}`,...i}=n,[{dialogState:s},a]=fT("Dialog.Panel"),o=lp(e,a.panelRef),l=G.useMemo(()=>({open:s===0}),[s]),u=hl(d=>{d.stopPropagation()});return ih({ourProps:{ref:o,id:r,onClick:u},theirProps:i,slot:l,defaultTag:ATe,name:"Dialog.Panel"})}let vTe="h2";function yTe(n,e){let t=B1(),{id:r=`headlessui-dialog-title-${t}`,...i}=n,[{dialogState:s,setTitleId:a}]=fT("Dialog.Title"),o=lp(e);G.useEffect(()=>(a(r),()=>a(null)),[r,a]);let l=G.useMemo(()=>({open:s===0}),[s]);return ih({ourProps:{ref:o,id:r},theirProps:i,slot:l,defaultTag:vTe,name:"Dialog.Title"})}let bTe=Jh(hTe),wTe=Jh(gTe),_Te=Jh(xTe),STe=Jh(pTe),TTe=Jh(yTe),AM=Object.assign(bTe,{Backdrop:wTe,Panel:_Te,Overlay:STe,Title:TTe,Description:Qae}),Kae=G.createContext(null);function Zae(){let n=G.useContext(Kae);if(n===null){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Zae),e}return n}
85function ETe(){let[n,e]=G.useState([]);return[n.length>0?n.join(" "):void 0,G.useMemo(()=>function(t){let r=hl(s=>(e(a=>[...a,s]),()=>e(a=>{let o=a.slice(),l=o.indexOf(s);return l!==-1&&o.splice(l,1),o}))),i=G.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props}),[r,t.slot,t.name,t.props]);return jn.createElement(Kae.Provider,{value:i},t.children)},[e])]}let CTe="label";function NTe(n,e){let t=B1(),{id:r=`headlessui-label-${t}`,passive:i=!1,...s}=n,a=Zae(),o=lp(e);tp(()=>a.register(r),[r,a.register]);let l={ref:o,...a.props,id:r};return i&&("onClick"in l&&(delete l.htmlFor,delete l.onClick),"onClick"in s&&delete s.onClick),ih({ourProps:l,theirProps:s,slot:a.slot||{},defaultTag:CTe,name:a.name||"Label"})}let MTe=Jh(NTe),kTe=Object.assign(MTe,{}),NB=G.createContext(null);NB.displayName="GroupContext";let RTe=G.Fragment;function PTe(n){var e;let[t,r]=G.useState(null),[i,s]=ETe(),[a,o]=Yae(),l=G.useMemo(()=>({switch:t,setSwitch:r,labelledby:i,describedby:a}),[t,r,i,a]),u={},d=n;return jn.createElement(o,{name:"Switch.Description"},jn.createElement(s,{name:"Switch.Label",props:{htmlFor:(e=l.switch)==null?void 0:e.id,onClick(h){t&&(h.currentTarget.tagName==="LABEL"&&h.preventDefault(),t.click(),t.focus({preventScroll:!0}))}}},jn.createElement(NB.Provider,{value:l},ih({ourProps:u,theirProps:d,defaultTag:RTe,name:"Switch.Group"}))))}let LTe="button";function OTe(n,e){let t=B1(),{id:r=`headlessui-switch-${t}`,checked:i,defaultChecked:s=!1,onChange:a,name:o,value:l,...u}=n,d=G.useContext(NB),h=G.useRef(null),f=lp(h,e,d===null?null:d.setSwitch),[p,g]=g5e(i,a,s),A=hl(()=>g==null?void 0:g(!p)),x=hl(D=>{if(Fae(D.currentTarget))return D.preventDefault();D.preventDefault(),A()}),b=hl(D=>{D.key===mM.Space?(D.preventDefault(),A()):D.key===mM.Enter&&h5e(D.currentTarget)}),_=hl(D=>D.preventDefault()),M=G.useMemo(()=>({checked:p}),[p]),T={id:r,ref:f,role:"switch",type:a5e(n,h),tabIndex:0,"aria-checked":p,"aria-labelledby":d==null?void 0:d.labelledby,"aria-describedby":d==null?void 0:d.describedby,onClick:x,onKeyUp:b,onKeyPress:_},L=Pae();return G.useEffect(()=>{var D;let P=(D=h.current)==null?void 0:D.closest("form");P&&s!==void 0&&L.addEventListener(P,"reset",()=>{g(s)})},[h,g]),jn.createElement(jn.Fragment,null,o!=null&&p&&jn.createElement(pM,{features:W4.Hidden,...eI({as:"input",type:"checkbox",hidden:!0,readOnly:!0,checked:p,name:o,value:l})}),ih({ourProps:T,theirProps:u,slot:M,defaultTag:LTe,name:"Switch"}))}let DTe=Jh(OTe),jTe=PTe,ITe=Object.assign(DTe,{Group:jTe,Label:kTe,Description:Qae});var Jae={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},BX=jn.createContext&&jn.createContext(Jae),t1=function(){return t1=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},t1.apply(this,arguments)},FTe=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function eoe(n){return n&&n.map(function(e,t){return jn.createElement(e.tag,t1({key:t},e.attr),eoe(e.child))})}function It(n){return function(e){return jn.createElement(UTe,t1({attr:t1({},n.attr)},e),eoe(n.child))}}function UTe(n){var e=function(t){var r=n.attr,i=n.size,s=n.title,a=FTe(n,["attr","size","title"]),o=i||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),jn.createElement("svg",t1({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,a,{className:l,style:t1(t1({color:n.color||t.color},t.style),n.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&jn.createElement("title",null,s),n.children)};return BX!==void 0?jn.createElement(BX.Consumer,null,function(t){return e(t)}):e(Jae)}function VX(n){return It({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m13 16 5-4-5-4v3H4v2h9z"}},{tag:"path",attr:{d:"M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z"}}]})(n)}
85function BTe(n){return It({attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64Zm127.978 274.82-.034.006c-.023.007-.042.018-.083.059L512 466.745l-127.86-127.86c-.042-.041-.06-.052-.084-.059a.118.118 0 0 0-.07 0c-.022.007-.041.018-.082.059l-45.02 45.019c-.04.04-.05.06-.058.083a.118.118 0 0 0 0 .07l.01.022a.268.268 0 0 0 .049.06L466.745 512l-127.86 127.862c-.041.04-.052.06-.059.083a.118.118 0 0 0 0 .07c.007.022.018.041.059.082l45.019 45.02c.04.04.06.05.083.058a.118.118 0 0 0 .07 0c.022-.007.041-.018.082-.059L512 557.254l127.862 127.861c.04.041.06.052.083.059a.118.118 0 0 0 .07 0c.022-.007.041-.018.082-.059l45.02-45.019c.04-.04.05-.06.058-.083a.118.118 0 0 0 0-.07l-.01-.022a.268.268 0 0 0-.049-.06L557.254 512l127.861-127.86c.041-.042.052-.06.059-.084a.118.118 0 0 0 0-.07c-.007-.022-.018-.041-.059-.082l-45.019-45.02c-.04-.04-.06-.05-.083-.058a.118.118 0 0 0-.07 0Z"}}]})(n)}function toe(n){return It({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 6.75A.75.75 0 013.75 6h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 6.75zM3 12a.75.75 0 01.75-.75h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 12zm0 5.25a.75.75 0 01.75-.75h16.5a.75.75 0 010 1.5H3.75a.75.75 0 01-.75-.75z",clipRule:"evenodd"}}]})(n)}function VTe(n){return It({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z",clipRule:"evenodd"}}]})(n)}function zTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"}}]})(n)}function GTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}}]})(n)}function noe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3"}}]})(n)}function qTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"}}]})(n)}function roe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z"}}]})(n)}function $Te(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z"}}]})(n)}function X4(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"}}]})(n)}function HTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"}}]})(n)}function ioe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"}}]})(n)}function soe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"}}]})(n)}function iI(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"}}]})(n)}function WTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}}]})(n)}function XTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"}}]})(n)}function aoe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"}}]})(n)}function ooe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"}}]})(n)}function rw(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}}]})(n)}function YTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"}}]})(n)}function QTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"}}]})(n)}function j8(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09
85L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"}}]})(n)}function I8(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"}}]})(n)}function KTe(n){return It({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}}]})(n)}const V1="/assets/logo-CCollTJG.png";function ZTe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M16 9C16 11.2091 14.2091 13 12 13C9.79086 13 8 11.2091 8 9C8 6.79086 9.79086 5 12 5C14.2091 5 16 6.79086 16 9ZM14 9C14 10.1046 13.1046 11 12 11C10.8954 11 10 10.1046 10 9C10 7.89543 10.8954 7 12 7C13.1046 7 14 7.89543 14 9Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM3 12C3 14.0902 3.71255 16.014 4.90798 17.5417C6.55245 15.3889 9.14627 14 12.0645 14C14.9448 14 17.5092 15.3531 19.1565 17.4583C20.313 15.9443 21 14.0524 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12ZM12 21C9.84977 21 7.87565 20.2459 6.32767 18.9878C7.59352 17.1812 9.69106 16 12.0645 16C14.4084 16 16.4833 17.1521 17.7538 18.9209C16.1939 20.2191 14.1881 21 12 21Z",fill:"currentColor"}}]})(n)}function loe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"}},{tag:"path",attr:{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"}}]})(n)}function zX(n){return It({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 19V5h6v14H5zm14 0h-6v-7h6v7zm0-9h-6V5h6v5z"}}]})(n)}function JTe(n){return It({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 11.5v0.5h-6.168v-1h5.152c-0.112-1.692-0.789-3.231-1.842-4.434l-0.806 0.806-0.707-0.707 0.802-0.802c-1.202-1.053-2.74-1.726-4.431-1.839v2.976h-1v-2.976c-1.691 0.113-3.229 0.786-4.43 1.839l0.796 0.796-0.707 0.707-0.8-0.8c-1.053 1.203-1.731 2.742-1.842 4.434h5.171v1h-6.188v-0.5c0-4.687 3.813-8.5 8.5-8.5s8.5 3.813 8.5 8.5zM10.5 11.5c0 1.103-0.897 2-2 2s-2-0.897-2-2c0-0.644 0.311-1.21 0.784-1.577l-2.082-3.63 0.867-0.497 2.141 3.733c0.095-0.014 0.19-0.029 0.29-0.029 1.103 0 2 0.897 2 2zM9.5 11.5c0-0.551-0.449-1-1-1s-1 0.449-1 1 0.449 1 1 1 1-0.449 1-1z"}}]})(n)}function eEe(n){return It({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109
85-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(n)}function y1(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"}}]})(n)}function x_(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"}}]})(n)}function Ay(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"}}]})(n)}function coe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M201.5 305.5c-13.8 0-24.9-11.1-24.9-24.6 0-13.8 11.1-24.9 24.9-24.9 13.6 0 24.6 11.1 24.6 24.9 0 13.6-11.1 24.6-24.6 24.6zM504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-132.3-41.2c-9.4 0-17.7 3.9-23.8 10-22.4-15.5-52.6-25.5-86.1-26.6l17.4-78.3 55.4 12.5c0 13.6 11.1 24.6 24.6 24.6 13.8 0 24.9-11.3 24.9-24.9s-11.1-24.9-24.9-24.9c-9.7 0-18 5.8-22.1 13.8l-61.2-13.6c-3-.8-6.1 1.4-6.9 4.4l-19.1 86.4c-33.2 1.4-63.1 11.3-85.5 26.8-6.1-6.4-14.7-10.2-24.1-10.2-34.9 0-46.3 46.9-14.4 62.8-1.1 5-1.7 10.2-1.7 15.5 0 52.6 59.2 95.2 132 95.2 73.1 0 132.3-42.6 132.3-95.2 0-5.3-.6-10.8-1.9-15.8 31.3-16 19.8-62.5-14.9-62.5zM302.8 331c-18.2 18.2-76.1 17.9-93.6 0-2.2-2.2-6.1-2.2-8.3 0-2.5 2.5-2.5 6.4 0 8.6 22.8 22.8 87.3 22.8 110.2 0 2.5-2.2 2.5-6.1 0-8.6-2.2-2.2-6.1-2.2-8.3 0zm7.7-75c-13.6 0-24.6 11.1-24.6 24.9 0 13.6 11.1 24.6 24.6 24.6 13.8 0 24.9-11.1 24.9-24.6 0-13.8-11-24.9-24.9-24.9z"}}]})(n)}function tEe(n){return It({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm121.8 169.9l-40.7 191.8c-3 13.6-11.1 16.9-22.4 10.5l-62-45.7-29.9 28.8c-3.3 3.3-6.1 6.1-12.5 6.1l4.4-63.1 114.9-103.8c5-4.4-1.1-6.9-7.7-2.5l-142 89.4-61.2-19.1c-13.3-4.2-13.6-13.3 2.8-19.7l239.1-92.2c11.1-4 20.8 2.7 17.2 19.5z"}}]})(n)}function pT(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"}}]})(n)}function MB(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"}}]})(n)}function nEe(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"}}]})(n)}function mT(n){return It({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"}}]})(n)}function rEe(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(n)}function iEe(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(n)}function sEe(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 512c35.32 0 63.97-28.65 63.97-64H160.03c0 35.35 28.65 64 63.97 64zm215.39-149.71c-19.32-20.76-55.47-51.99-55.47-154.29 0-77.7-54.48-139.9-127.94-155.16V32c0-17.67-14.32-32-31.98-32s-31.98 14.33-31.98 32v20.84C118.56 68.1 64.08 130.3 64.08 208c0 102.3-36.15 133.53-55.47 154.29-6 6.45-8.66 14.16-8.61 21.71.11 16.4 12.98 32 32.1 32h383.8c19.12 0 32-15.6 32.1-32 .05-7.55-2.61-15.27-8.61-21.71z"}}]})(n)}function sI(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm320-196c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM192 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM64 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z"}}]})(n)}function aEe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M332.8 320h38.4c6.4 0 12.8-6.4 12.8-12.8V172.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h38.4c6.4 0 12.8-6.4 12.8-12.8V76.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-288 0h38.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h38.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zM496 384H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z"}}]})(n)}function kB(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"}}]})(n)}function n6(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(n)}function oEe(n){return It({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"}}]})(n)}function uoe(n){return It({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522
85-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"}}]})(n)}function lEe(n){return It({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(n)}function $7(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(n)}function doe(n){return It({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M528 448H112c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h416c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm64-320c-26.5 0-48 21.5-48 48 0 7.1 1.6 13.7 4.4 19.8L476 239.2c-15.4 9.2-35.3 4-44.2-11.6L350.3 85C361 76.2 368 63 368 48c0-26.5-21.5-48-48-48s-48 21.5-48 48c0 15 7 28.2 17.7 37l-81.5 142.6c-8.9 15.6-28.9 20.8-44.2 11.6l-72.3-43.4c2.7-6 4.4-12.7 4.4-19.8 0-26.5-21.5-48-48-48S0 149.5 0 176s21.5 48 48 48c2.6 0 5.2-.4 7.7-.8L128 416h384l72.3-192.8c2.5.4 5.1.8 7.7.8 26.5 0 48-21.5 48-48s-21.5-48-48-48z"}}]})(n)}function GX(n){return It({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M592 192H473.26c12.69 29.59 7.12 65.2-17 89.32L320 417.58V464c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48V240c0-26.51-21.49-48-48-48zM480 376c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm-46.37-186.7L258.7 14.37c-19.16-19.16-50.23-19.16-69.39 0L14.37 189.3c-19.16 19.16-19.16 50.23 0 69.39L189.3 433.63c19.16 19.16 50.23 19.16 69.39 0L433.63 258.7c19.16-19.17 19.16-50.24 0-69.4zM96 248c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm128 128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm0-128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm0-128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm128 128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(n)}function cEe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(n)}function hoe(n){return It({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}}]})(n)}function xM(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H4
8500a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"}}]})(n)}function uEe(n){return It({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"}}]})(n)}function dEe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 448c0 17.7 14.3 32 32 32h160V320H32v128zm256 32h160c17.7 0 32-14.3 32-32V320H288v160zm192-320h-42.1c6.2-12.1 10.1-25.5 10.1-40 0-48.5-39.5-88-88-88-41.6 0-68.5 21.3-103 68.3-34.5-47-61.4-68.3-103-68.3-48.5 0-88 39.5-88 88 0 14.5 3.8 27.9 10.1 40H32c-17.7 0-32 14.3-32 32v80c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-80c0-17.7-14.3-32-32-32zm-326.1 0c-22.1 0-40-17.9-40-40s17.9-40 40-40c19.9 0 34.6 3.3 86.1 80h-86.1zm206.1 0h-86.1c51.4-76.5 65.7-80 86.1-80 22.1 0 40 17.9 40 40s-17.9 40-40 40z"}}]})(n)}function hEe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 255.531c.253 136.64-111.18 248.372-247.82 248.468-59.015.042-113.223-20.53-155.822-54.911-11.077-8.94-11.905-25.541-1.839-35.607l11.267-11.267c8.609-8.609 22.353-9.551 31.891-1.984C173.062 425.135 212.781 440 256 440c101.705 0 184-82.311 184-184 0-101.705-82.311-184-184-184-48.814 0-93.149 18.969-126.068 49.932l50.754 50.754c10.08 10.08 2.941 27.314-11.313 27.314H24c-8.837 0-16-7.163-16-16V38.627c0-14.254 17.234-21.393 27.314-11.314l49.372 49.372C129.209 34.136 189.552 8 256 8c136.81 0 247.747 110.78 248 247.531zm-180.912 78.784l9.823-12.63c8.138-10.463 6.253-25.542-4.21-33.679L288 256.349V152c0-13.255-10.745-24-24-24h-16c-13.255 0-24 10.745-24 24v135.651l65.409 50.874c10.463 8.137 25.541 6.253 33.679-4.21z"}}]})(n)}function RB(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(n)}function F8(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"}}]})(n)}function fEe(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"}}]})(n)}function pEe(n){return It({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M176 352c53.02 0 96-42.98 96-96V96c0-53.02-42.98-96-96-96S80 42.98 80 96v160c0 53.02 42.98 96 96 96zm160-160h-16c-8.84 0-16 7.16-16 16v48c0 74.8-64.49 134.82-140.79 127.38C96.71 376.89 48 317.11 48 250.3V208c0-8.84-7.16-16-16-16H16c-8.84 0-16 7.16-16 16v40.16c0 89.64 63.97 169.55 152 181.69V464H96c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-56v-33.77C285.71 418.47 352 344.9 352 256v-48c0-8.84-7.16-16-16-16z"}}]})(n)}function mEe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"}}]})(n)}function gEe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"}}]})(n)}function qX(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(n)}function bS(n){return It({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M629.657 343.598L528.971 444.284c-9.373 9.372-24.568 9.372-33.941 0L394.343 343.598c-9.373-9.373-9.373-24.569 0-33.941l10.823-10.823c9.562-9.562 25.133-9.34 34.419.492L480 342.118V160H292.451a24.005 24.005 0 0 1-16.971-7.029l-16-16C244.361 121.851 255.069 96 276.451 96H520c13.255 0 24 10.745 24 24v222.118l40.416-42.792c9.285-9.831 24.856-10.054 34.419-.492l10.823 10.823c9.372 9.372 9.372 24.569-.001 33.941zm-265.138 15.431A23.999 23.999 0 0 0 347.548 352H160V169.881l40.416 42.792c9.286 9.831 24.856 10.054 34.419.491l10.822-10.822c9.373-9.373 9.373-24.569 0-33.941L144.971 67.716c-9.373-9.373-24.569-9.373-33.941 0L10.343 168.402c-9.373 9.373-9.373 24.569 0 33.941l10.822 10.822c9.562 9.562 25.133 9.34 34.419-.491L96 169.881V392c0 13.255 10.745 24 24 24h243.549c21.382 0 32.09-25.851 16.971-40.971l-16.001-16z"}}]})(n)}function foe(n){return It({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M32,224H64V416H32A31.96166,31.96166,0,0,1,0,384V256A31.96166,31.96166,0,0,1,32,224Zm512-48V448a64.06328,64.06328,0,0,1-64,64H160a64.06328,64.06328,0,0,1-64-64V176a79.974,79.974,0,0,1,80-80H288V32a32,32,0,0,1,64,0V96H464A79.974,79.974,0,0,1,544,176ZM264,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,264,256Zm-8,128H192v32h64Zm96,0H288v32h64ZM456,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,456,256Zm-8,128H384v32h64ZM640,256V384a31.96166,31.96166,0,0,1-32,32H576V224h32A31.96166,31.96166,0,0,1,640,256Z"}}]})(n)}function poe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(n)}function moe(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(n)}function AEe(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.
856-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"}}]})(n)}function vM(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"}}]})(n)}function iw(n){return It({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(n)}function Ev(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(n)}function goe(n){return It({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M552 64H448V24c0-13.3-10.7-24-24-24H152c-13.3 0-24 10.7-24 24v40H24C10.7 64 0 74.7 0 88v56c0 35.7 22.5 72.4 61.9 100.7 31.5 22.7 69.8 37.1 110 41.7C203.3 338.5 240 360 240 360v72h-48c-35.3 0-64 20.7-64 56v12c0 6.6 5.4 12 12 12h296c6.6 0 12-5.4 12-12v-12c0-35.3-28.7-56-64-56h-48v-72s36.7-21.5 68.1-73.6c40.3-4.6 78.6-19 110-41.7 39.3-28.3 61.9-65 61.9-100.7V88c0-13.3-10.7-24-24-24zM99.3 192.8C74.9 175.2 64 155.6 64 144v-16h64.2c1 32.6 5.8 61.2 12.8 86.2-15.1-5.2-29.2-12.4-41.7-21.4zM512 144c0 16.1-17.7 36.1-35.3 48.8-12.5 9-26.7 16.2-41.8 21.4 7-25 11.8-53.6 12.8-86.2H512v16z"}}]})(n)}function xEe(n){return It({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M610.5 373.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 400.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm201.2 226.5c-2.3-1.2-4.6-2.6-6.8-3.9l-7.9 4.6c-6 3.4-12.8 5.3-19.6 5.3-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-5.5-17.7 1.9-36.4 17.9-45.7l7.9-4.6c-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-16-9.2-23.4-28-17.9-45.7.9-2.9 2.2-5.8 3.2-8.7-3.8-.3-7.5-1.2-11.4-1.2h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c10.1 0 19.5-3.2 27.2-8.5-1.2-3.8-2-7.7-2-11.8v-9.2z"}}]})(n)}function Aoe(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(n)}function PB(n){return It({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M336.2 64H47.8C21.4 64 0 85.4 0 111.8v288.4C0 426.6 21.4 448 47.8 448h288.4c26.4 0 47.8-21.4 47.8-47.8V111.8c0-26.4-21.4-47.8-47.8-47.8zm189.4 37.7L416 177.3v157.4l109.6 75.5c21.2 14.6 50.4-.3 50.4-25.8V127.5c0-25.4-29.1-40.4-50.4-25.8z"}}]})(n)}function vEe(n){return It({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13 14H11C7.54202 14 4.53953 15.9502 3.03239 18.8107C3.01093 18.5433 3 18.2729 3 18C3 12.4772 7.47715 8 13 8V3L23 11L13 19V14Z"}}]})(n)}function xoe(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=xoe(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function yEe(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=xoe(n))&&(r&&(r+=" "),r+=e);return r}const LB="-",bEe=n=>{const e=_Ee(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:a=>{const o=a.split(LB);return o[0]===""&&o.length!==1&&o.shift(),voe(o,e)||wEe(a)},getConflictingClassGroupIds:(a,o)=>{const l=t[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},voe=(n,e)=>{var a;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),i=r?voe(n.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=n.join(LB);return(a=e.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},$X=/^\[(.+)\]$/,wEe=n=>{if($X.test(n)){const e=$X.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},_Ee=n=>{const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return TEe(Object.entries(n.classGroups),t).forEach(([s,a])=>{aI(a,r,s,e)}),r},aI=(n,e,t,r)=>
vendor: 5,102 bytes, line 85
85{n.forEach(i=>{if(typeof i=="string"){const s=i===""?e:HX(e,i);s.classGroupId=t;return}if(typeof i=="function"){if(SEe(i)){aI(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([s,a])=>{aI(a,HX(e,s),t,r)})})},HX=(n,e)=>{let t=n;return e.split(LB).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},SEe=n=>n.isThemeGetter,TEe=(n,e)=>e?n.map(([t,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[e+a,o])):s);return[t,i]}):n,EEe=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const i=(s,a)=>{t.set(s,a),e++,e>n&&(e=0,r=t,t=new Map)};return{get(s){let a=t.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){t.has(s)?t.set(s,a):i(s,a)}}},yoe="!",CEe=n=>{const{separator:e,experimentalParseClassName:t}=n,r=e.length===1,i=e[0],s=e.length,a=o=>{const l=[];let u=0,d=0,h;for(let x=0;x<o.length;x++){let b=o[x];if(u===0){if(b===i&&(r||o.slice(x,x+s)===e)){l.push(o.slice(d,x)),d=x+s;continue}if(b==="/"){h=x;continue}}b==="["?u++:b==="]"&&u--}const f=l.length===0?o:o.substring(d),p=f.startsWith(yoe),g=p?f.substring(1):f,A=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:A}};return t?o=>t({className:o,parseClassName:a}):a},NEe=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e},MEe=n=>({cache:EEe(n.cacheSize),parseClassName:CEe(n),...bEe(n)}),kEe=/\s+/,REe=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],a=n.trim().split(kEe);let o="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=t(u);let g=!!p,A=r(g?f.substring(0,p):f);if(!A){if(!g){o=u+(o.length>0?" "+o:o);continue}if(A=r(f),!A){o=u+(o.length>0?" "+o:o);continue}g=!1}const x=NEe(d).join(":"),b=h?x+yoe:x,_=b+A;if(s.includes(_))continue;s.push(_);const M=i(A,g);for(let T=0;T<M.length;++T){const L=M[T];s.push(b+L)}o=u+(o.length>0?" "+o:o)}return o};function PEe(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=boe(e))&&(r&&(r+=" "),r+=t);return r}const boe=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=boe(n[r]))&&(t&&(t+=" "),t+=e);return t};function LEe(n,...e){let t,r,i,s=a;function a(l){const u=e.reduce((d,h)=>h(d),n());return t=MEe(u),r=t.cache.get,i=t.cache.set,s=o,o(l)}function o(l){const u=r(l);if(u)return u;const d=REe(l,t);return i(l,d),d}return function(){return s(PEe.apply(null,arguments))}}const ca=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},woe=/^\[(?:([a-z-]+):)?(.+)\]$/i,OEe=/^\d+\/\d+$/,DEe=new Set(["px","full","screen"]),jEe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IEe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,FEe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UEe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BEe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hm=n=>vb(n)||DEe.has(n)||OEe.test(n),Wg=n=>v_(n,"length",XEe),vb=n=>!!n&&!Number.isNaN(Number(n)),H7=n=>v_(n,"number",vb),m3=n=>!!n&&Number.isInteger(Number(n)),VEe=n=>n.endsWith("%")&&vb(n.slice(0,-1)),ci=n=>woe.test(n),Xg=n=>jEe.test(n),zEe=new Set(["length","size","percentage"]),GEe=n=>v_(n,zEe,_oe),qEe=n=>v_(n,"position",_oe),$Ee=new Set(["image","url"]),HEe=n=>v_(n,$Ee,QEe),WEe=n=>v_(n,"",YEe),g3=()=>!0,v_=(n,e,t)=>{const r=woe.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1},XEe=n=>IEe.test(n)&&!FEe.test(n),_oe=()=>!1,YEe=n=>UEe.test(n),QEe=n=>BEe.test(n),KEe=()=>{const n=ca("colors"),e=ca("spacing"),t=ca("blur"),r=ca("brightness"),i=ca("borderColor"),s=ca("borderRadius"),a=ca("borderSpacing"),o=ca("borderWidth"),l=ca("contrast"),u=ca("grayscale"),d=ca("hueRotate"),h=ca("invert"),f=ca("gap"),p=ca("gradientColorStops"),g=ca("gradientColorStopPositions"),A=ca("inset"),x=ca("margin"),b=ca("opacity"),_=ca("padding"),M=ca("saturate"),T=ca("scale"),L=ca("sepia"),D=ca("skew"),P=ca("space"),O=ca("translate"),F=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",ci,e],z=()=>[ci,e],H=()=>["",hm,Wg],X=()=>["auto",vb,ci],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],le=()=>["","0",ci],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[vb,ci];return{cacheSize:500,separator:":",theme:{colors:[g3],spacing:[hm,Wg],blur:["none","",Xg,ci],brightness:Y(),borderColor:[n],borderRadius:["n
vendor: 1,898 bytes, line 85
85one","","full",Xg,ci],borderSpacing:z(),borderWidth:H(),contrast:Y(),grayscale:le(),hueRotate:Y(),invert:le(),gap:z(),gradientColorStops:[n],gradientColorStopPositions:[VEe,Wg],inset:B(),margin:B(),opacity:Y(),padding:z(),saturate:Y(),scale:Y(),sepia:le(),skew:Y(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",ci]}],container:["container"],columns:[{columns:[Xg]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),ci]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[A]}],"inset-x":[{"inset-x":[A]}],"inset-y":[{"inset-y":[A]}],start:[{start:[A]}],end:[{end:[A]}],top:[{top:[A]}],right:[{right:[A]}],bottom:[{bottom:[A]}],left:[{left:[A]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",m3,ci]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ci]}
vendor: 9,640 bytes, line 85
85],grow:[{grow:le()}],shrink:[{shrink:le()}],order:[{order:["first","last","none",m3,ci]}],"grid-cols":[{"grid-cols":[g3]}],"col-start-end":[{col:["auto",{span:["full",m3,ci]},ci]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[g3]}],"row-start-end":[{row:["auto",{span:[m3,ci]},ci]}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ci]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ci]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ci,e]}],"min-w":[{"min-w":[ci,e,"min","max","fit"]}],"max-w":[{"max-w":[ci,e,"none","full","min","max","fit","prose",{screen:[Xg]},Xg]}],h:[{h:[ci,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ci,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ci,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ci,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Xg,Wg]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",H7]}],"font-family":[{font:[g3]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ci]}],"line-clamp":[{"line-clamp":["none",vb,H7]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hm,ci]}],"list-image":[{"list-image":["none",ci]}],"list-style-type":[{list:["none","disc","decimal",ci]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hm,Wg]}],"underline-offset":[{"underline-offset":["auto",hm,ci]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ci]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ci]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),qEe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",GEe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},HEe]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...J(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:J()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[hm,ci]}],"outline-w":[{outline:[hm,Wg]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[hm,Wg]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Xg,WEe]}],"shadow-color":[{shadow:[g3]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Xg,ci]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[M]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ci]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",ci]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",ci]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[m3,ci]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ci]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ci]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
85],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ci]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[hm,Wg,H7]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ZEe=LEe(KEe);function f0(...n){return ZEe(yEe(n))}const JEe=(function(){const e=typeof document<"u"&&document.createElement("link").relList;return e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"})(),eCe=function(n){return"/"+n},WX={},A3=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){let a=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=a(t.map(u=>{if(u=eCe(u),u in WX)return;WX[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":JEe,d||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((p,g)=>{f.addEventListener("load",p),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})},wS=[{code:"en",label:"English",short:"EN"},{code:"pt",label:"Português (Brasil)",short:"PT"},{code:"es",label:"Español",short:"ES"},{code:"fr",label:"Français",short:"FR"},{code:"de",label:"Deutsch",short:"DE"},{code:"it",label:"Italiano",short:"IT"}
85],Soe="spreadout:uiLang",tCe={pt:()=>A3(()=>import("./pt-DdlTKwJ7.js"),[]),es:()=>A3(()=>import("./es-CNjWkLLF.js"),[]),fr:()=>A3(()=>import("./fr-BsgLUkl8.js"),[]),de:()=>A3(()=>import("./de-LOMqUdrH.js"),[]),it:()=>A3(()=>import("./it-BBJQ6b1g.js"),[])},XX=n=>wS.some(e=>e.code===n);function nCe(){try{const e=localStorage.getItem(Soe);if(XX(e))return e}catch{}const n=typeof navigator<"u"?navigator.languages||[navigator.language]:[];for(const e of n){const t=(e||"").slice(0,2).toLowerCase();if(XX(t))return t}return"en"}function OB(n,e){return e?n.replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):t):n}const Le=n=>n;let oI={},lI="en";function Us(n,e){return OB(oI[n]??n,e)}function Toe(){return Eoe[lI]}const Eoe={en:"en-US",pt:"pt-BR",es:"es-ES",fr:"fr-FR",de:"de-DE",it:"it-IT"},DB=G.createContext({lang:"en",setLang:()=>{},t:(n,e)=>OB(n,e),locale:"en-US"});function rCe({children:n}){const[e,t]=G.useState(nCe),[r,i]=G.useState({}),[s,a]=G.useState(e==="en");G.useEffect(()=>{let u=!1;if(document.documentElement.lang=e,e==="en"){oI={},lI="en",i({}),a(!0);return}const d=window.setTimeout(()=>a(!0),1500);return tCe[e]().then(h=>{u||(oI=h.default,lI=e,i(h.default))}).catch(()=>{}).finally(()=>{window.clearTimeout(d),u||a(!0)}),()=>{u=!0,window.clearTimeout(d)}},[e]);const o=G.useCallback(u=>{try{localStorage.setItem(Soe,u)}catch{}t(u)},[]),l=G.useMemo(()=>({lang:e,setLang:o,t:(u,d)=>OB(r[u]??u,d),locale:Eoe[e]}),[e,o,r]);return c.jsx(DB.Provider,{value:l,children:s?n:null})}const Kr=()=>G.useContext(DB),hi=()=>G.useContext(DB).t,Coe=({user:n,setMobileMenuOpen:e})=>{const t=window.location.pathname,r=hi(),i=()=>{e&&e(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:f0("flex flex-col gap-5 border-b border-stroke py-4 dark:border-strokedark",{"sm:px-6":t!=="/admin","px-6":t==="/admin"}),children:[c.jsx("li",{children:c.jsxs(ru,{to:"/ai-automator",className:"flex items-center gap-3.5 text-sm font-medium duration-300 ease-in-out hover:text-yellow-500",children:[c.jsx(zX,{size:"1.1rem"}),r("Social Automator")]})}),c.jsx("li",{children:c.jsxs(ru,{to:"/group-search",className:"flex items-center gap-3.5 text-sm font-medium duration-300 ease-in-out hover:text-yellow-500",children:[c.jsx(zX,{size:"1.1rem"}),r("Group Search")]})}),c.jsx("li",{children:c.jsxs(ru,{to:"/account",onClick:i,className:"flex items-center gap-3.5 text-sm font-medium duration-300 ease-in-out hover:text-yellow-500",children:[c.jsxs("svg",{className:"fill-current",width:"18",height:"18",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M20.8656 8.86874C20.5219 8.49062 20.0406 8.28437 19.525 8.28437H19.4219C19.25 8.28437 19.1125 8.18124 19.0781 8.04374C19.0437 7.90624 18.975 7.80312 18.9406 7.66562C18.8719 7.52812 18.9406 7.39062 19.0437 7.28749L19.1125 7.21874C19.4906 6.87499 19.6969 6.39374 19.6969 5.87812C19.6969 5.36249 19.525 4.88124 19.1469 4.50312L17.8062 3.12812C17.0844 2.37187 15.8469 2.33749 15.0906 3.09374L14.9875 3.16249C14.8844 3.26562 14.7125 3.29999 14.5406 3.23124C14.4031 3.16249 14.2656 3.09374 14.0937 3.05937C13.9219 2.99062 13.8187 2.85312 13.8187 2.71562V2.54374C13.8187 1.47812 12.9594 0.618744 11.8937 0.618744H9.96875C9.45312 0.618744 8.97187 0.824994 8.62812 1.16874C8.25 1.54687 8.07812 2.02812 8.07812 2.50937V2.64687C8.07812 2.78437 7.975 2.92187 7.8375 2.99062C7.76875 3.02499 7.73437 3.02499 7.66562 3.05937C7.52812 3.12812 7.35625 3.09374 7.25312 2.99062L7.18437 2.88749C6.84062 2.50937 6.35937 2.30312 5.84375 2.30312C5.32812 2.30312 4.84687 2.47499 4.46875 2.85312L3.09375 4.19374C2.3375 4.91562 2.30312 6.15312 3.05937 6.90937L3.12812 7.01249C3.23125 7.11562 3.26562 7.28749 3.19687 7.39062C3.12812 7.52812 3.09375 7.63124 3.025 7.76874C2.95625 7.90624 2.85312 7.97499 2.68125 7.97499H2.57812C2.0625 7.97499 1.58125 8.14687 1.20312 8.52499C0.824996 8.86874 0.618746 9.34999 0.618746 9.86562L0.584371 11.7906C0.549996 12.8562 1.40937 13.7156 2.475 13.75H2.57812C2.75 13.75 2.8875 13.8531 2.92187 13.9906C2.99062 14.0937 3.05937 14.1969 3.09375 14.3344C3.12812 14.4719 3.09375 14.6094 2.99062 14.7125L2.92187 14.7812C2.54375 15.125 2.3375 15.6062 2.3375 16.1219C2.3375 16.6375 2.50937 17.1187 2.8875 17.4969L4.22812 18.8719C4.95 19.6281 6.1875 19.6625 6.94375 18.9062L7.04687 18.8375C7.15 18.7344 7.32187 18.7 7.49375 18.7687C7.63125 18.8375 7.76875 18.9062 7.94062 18.9406C8.1125 19.0094 8.21562 19.1469 8.21562 19.2844V19.4219C8.21562 20.4875 9.075 21.3469 10.1406 21.3469H12.0656C13.1312 21.3469 13.9906 20.4875 13.9906 19.4219V19.2844C13.9906 19.1469 14.0937 19.0094 14.2312 18.9406C14.3 18.9062 14.3344 18.9062 14.4031 18.8719C14.575 18.8031 14.7125 18.8375 14.8
85156 18.9406L14.8844 19.0437C15.2281 19.4219 15.7094 19.6281 16.225 19.6281C16.7406 19.6281 17.2219 19.4562 17.6 19.0781L18.975 17.7375C19.7312 17.0156 19.7656 15.7781 19.0094 15.0219L18.9406 14.9187C18.8375 14.8156 18.8031 14.6437 18.8719 14.5406C18.9406 14.4031 18.975 14.3 19.0437 14.1625C19.1125 14.025 19.25 13.9562 19.3875 13.9562H19.4906H19.525C20.5562 13.9562 21.4156 13.1312 21.45 12.0656L21.4844 10.1406C21.4156 9.72812 21.2094 9.21249 20.8656 8.86874ZM19.8344 12.1C19.8344 12.3062 19.6625 12.4781 19.4562 12.4781H19.3531H19.3187C18.5281 12.4781 17.8062 12.9594 17.5312 13.6469C17.4969 13.75 17.4281 13.8531 17.3937 13.9562C17.0844 14.6437 17.2219 15.5031 17.7719 16.0531L17.8406 16.1562C17.9781 16.2937 17.9781 16.5344 17.8406 16.6719L16.4656 18.0125C16.3625 18.1156 16.2594 18.1156 16.1906 18.1156C16.1219 18.1156 16.0187 18.1156 15.9156 18.0125L15.8469 17.9094C15.2969 17.325 14.4719 17.1531 13.7156 17.4969L13.5781 17.5656C12.8219 17.875 12.3406 18.5625 12.3406 19.3531V19.4906C12.3406 19.6969 12.1687 19.8687 11.9625 19.8687H10.0375C9.83125 19.8687 9.65937 19.6969 9.65937 19.4906V19.3531C9.65937 18.5625 9.17812 17.8406 8.42187 17.5656C8.31875 17.5312 8.18125 17.4625 8.07812 17.4281C7.80312 17.2906 7.52812 17.2562 7.25312 17.2562C6.77187 17.2562 6.29062 17.4281 5.9125 17.8062L5.84375 17.8406C5.70625 17.9781 5.46562 17.9781 5.32812 17.8406L3.9875 16.4656C3.88437 16.3625 3.88437 16.2594 3.88437 16.1906C3.88437 16.1219 3.88437 16.0187 3.9875 15.9156L4.05625 15.8469C4.64062 15.2969 4.8125 14.4375 4.50312 13.75C4.46875 13.6469 4.43437 13.5437 4.36562 13.4406C4.09062 12.7187 3.40312 12.2031 2.6125 12.2031H2.50937C2.30312 12.2031 2.13125 12.0312 2.13125 11.825L2.16562 9.89999C2.16562 9.76249 2.23437 9.69374 2.26875 9.62499C2.30312 9.59062 2.40625 9.52187 2.54375 9.52187H2.64687C3.4375 9.55624 4.15937 9.07499 4.46875 8.35312C4.50312 8.24999 4.57187 8.14687 4.60625 8.04374C4.91562 7.35624 4.77812 6.49687 4.22812 5.94687L4.15937 5.84374C4.02187 5.70624 4.02187 5.46562 4.15937 5.32812L5.53437 3.98749C5.6375 3.88437 5.74062 3.88437 5.80937 3.88437C5.87812 3.88437 5.98125 3.88437 6.08437 3.98749L6.15312 4.09062C6.70312 4.67499 7.52812 4.84687 8.28437 4.53749L8.42187 4.46874C9.17812 4.15937 9.65937 3.47187 9.65937 2.68124V2.54374C9.65937 2.40624 9.72812 2.33749 9.7625 2.26874C9.79687 2.19999 9.9 2.16562 10.0375 2.16562H11.9625C12.1687 2.16562 12.3406 2.33749 12.3406 2.54374V2.68124C12.3406 3.47187 12.8219 4.19374 13.5781 4.46874C13.6812 4.50312 13.8187 4.57187 13.9219 4.60624C14.6437 4.94999 15.5031 4.81249 16.0875 4.26249L16.1906 4.19374C16.3281 4.05624 16.5687 4.05624 16.7062 4.19374L18.0469 5.56874C18.15 5.67187 18.15 5.77499 18.15 5.84374C18.15 5.91249 18.1156 6.01562 18.0469 6.11874L17.9781 6.18749C17.3594 6.70312 17.1875 7.56249 17.4625 8.24999C17.4969 8.35312 17.5312 8.45624 17.6 8.55937C17.875 9.28124 18.5625 9.79687 19.3531 9.79687H19.4562C19.5937 9.79687 19.6625 9.86562 19.7312 9.89999C19.8 9.93437 19.8344 10.0375 19.8344 10.175V12.1Z",fill:""}),c.jsx("path",{d:"M11 6.32498C8.42189 6.32498 6.32501 8.42186 6.32501 11C6.32501 13.5781 8.42189 15.675 11 15.675C13.5781 15.675 15.675 13.5781 15.675 11C15.675 8.42186 13.5781 6.32498 11 6.32498ZM11 14.1281C9.28126 14.1281 7.87189 12.7187 7.87189 11C7.87189 9.28123 9.28126 7.87186 11 7.87186C12.7188 7.87186 14.1281 9.28123 14.1281 11C14.1281 12.7187 12.7188 14.1281 11 14.1281Z",fill:""})]}),r("Account Settings")]})}),c.jsx("li",{children:c.jsxs(ru,{to:"/leaderboard",onClick:i,className:"flex items-center gap-3.5 text-sm font-medium duration-300 ease-in-out hover:text-yellow-500",children:[c.jsx(goe,{size:"1.1rem",className:"text-current"}),r("Leaderboard")]})}),c.jsx("li",{children:c.jsxs(ru,{to:"/referrals",onClick:i,className:"flex items-center gap-3.5 text-sm font-medium duration-300 ease-in-out hover:text-yellow-500",children:[c.jsx(vEe,{size:"1.1rem",className:"text-current"}),r("Refer Friends")]})})]}),!!n&&n.isAdmin&&c.jsx("ul",{className:f0("flex flex-col gap-5 border-b border-stroke py-4 dark:border-strokedark",{"sm:px-6":t!=="/admin","px-6":t==="/admin"}),children:c.jsx("li",{className:"flex items-center gap-3.5 text-sm font-medium duration-300 ease-in-out hover:text-yellow-500",children:c.jsxs(ru,{to:"/admin",onClick:i,className:"flex items-center gap-3.5 text-sm font-medium duration-300 ease-in-out hover:text-yellow-500",children:[c.jsx(JTe,{size:"1.1rem"}),r("Admin Dashboard")]})})}),c.jsxs("button",{onClick:()=>fM(),className:f0("flex items-center gap-3.5 py-4 text-sm font-medium duration-300 ease-in-out hover:text-yellow-500",{"sm:px-6":t!=="/admin","px-6":t==="/admin"}),children:[c.jsxs("svg",{className:"fill-current",width:"18",height:"18",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M15.5375 0.618744H11.6531C10.7594 0.618744 10.0031 1.37499 10.0031 2.26874V4.64062C10.0031 5.05312 10.3469 5.39687 10.7594 5.39687C11.1719 5.39687 11.55 5.05312 11.55 4.64062V2.23437C11.55 2.16562 11.5844 2.13124 11.6531 2.13124H15.5375C16.3625 2.13124 17.0156 2.78437 17.0156 3.60937V18.3562C17.0156 19.1812 16.3625 19.8344 15.5375 19.8344H11.6531C11.5844 19.8344 11.55 19.8 11.55 19.7312V17.3594C11.55 16.9469 11.2062 16.6031 10.7594 16.6031C10.3125 16.6031 10.0031 16.9469 10.0031 17.3594V19.7312C10.0031 20.625 10.7594 21.3812 11.6531 21.3812H15.5375C17.2219 21.3812 18.5625 20.0062 18.5625 18.3562V3.64374C18.5625 1.95937 17.1875 0.618744 15.5375 0.618744Z",fill:""}),c.jsx("path",{d:"M6.05001 11.7563H12.2031C12.6156 11.7563 12.9594 11.4125 12.9594 11C12.9594 10.5875 12.6156 10.2438 12.2031 10.2438H6.08439L8.21564 8.07813C8.52501 7.76875 8.52501 7.2875 8.21564 6.97812C7.90626 6.66875 7.42501 6.66875 7.11564 6.97812L3.67814 10.4844C3.36876 10.7938 3.36876 11.275 3.67814 11.5844L7.11564 15.0906C7.25314 15.2281 7.45939 15.3312 7.66564 15.3312C7.87189 15.3312 8.04376 15.2625 8.21564 15.125C8.52501 14.8156 8.52501 14.3344 8.21564 14.025L6.05001 11.7563Z",fill:""})]}),r("Log Out")]})]})},Noe=({user:n,variant:e="app"})=>{const t=e==="landing",[r,i]=G.useState(!1),s=G.useRef(null),a=G.useRef(null),o=()=>i(l=>!l);return G.useEffect(()=>{const l=({target:u})=>{a.current&&(!r||a.current.contains(u)||s.current.contains(u)||i(!1))};return document.addEventListener("click",l),()=>document.removeEventListener("click",l)}),G.useEffect(()=>{const l=({keyCode:u})=>{!r||u!==27||i(!1)};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)}),c.jsxs("div",{className:"relative",children:[c.jsxs("button",{ref:s,onClick:o,className:f0("flex items-center gap-4 duration-300 ease-in-out hover:text-yellow-500",t?"rounded-full px-3 py-1.5 text-white hover:bg-white/5":"text-gray-900"),children:[c.jsx("span",{className:"hidden text-right lg:block",children:c.jsx("span",{className:"block text-sm font-medium dark:text-white",children:n.username})}),c.jsx(ZTe,{size:"1.1rem",className:"ml-1 mt-[0.1rem] dark:text-white"}),c.jsx("svg",{className:f0("hidden fill-current dark:fill-white sm:block",{"rotate-180":r}),width:"12",height:"8",viewBox:"0 0 12 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.410765 0.910734C0.736202 0.585297 1.26384 0.585297 1.58928 0.910734L6.00002 5.32148L10.4108 0.910734C10.7362 0.585297 11.2638 0.585297 11.5893 0.910734C11.9147 1.23617 11.9147 1.76381 11.5893 2.08924L6.58928 7.08924C6.26384 7.41468 5.7362 7.41468 5.41077 7.08924L0.410765 2.08924C0.0853277 1.76381 0.0853277 1.23617 0.410765 0.910734Z",fill:""})})]}),c.jsx("div",{ref:a,className:f0("absolute right-0 mt-4 flex w-62.5 flex-col",t?"dark z-50 overflow-hidden rounded-2xl border border-white/10 bg-[#0b0d12]/95 text-white shadow-[0_30px_80px_-20px_rgba(0,0,0,.9)] backdrop-blur-xl":"rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark dark:text-white",{hidden:!r}),children:c.jsx(Coe,{user:n,setMobileMenuOpen:o})})]})};function iCe(n,e){const[t,r]=G.useState(()=>{try{const i=window.localStorage.getItem(n);return i?JSON.parse(i):e}catch(i){return console.log(i),e}});return G.useEffect(()=>{try{const i=typeof t=="function"?t(t):t;window.localStorage.setItem(n,JSON.stringify(i))}catch(i){console.log(i)}},[n,t]),[t,r]}function sCe(){const[n,e]=iCe("color-theme","light");return G.useEffect(()=>{const t="dark",r=window.document.body.classList;n==="dark"?r.add(t):r.remove(t)},[n]),[n,e]}const YX=()=>{const[n,e]=sCe(),t=n==="light";return c.jsx("div",{children:c.jsxs("label",{className:f0("relative m-0 block h-7.5 w-14 roun
85ded-full",{"bg-green-400/60":n==="dark","bg-stroke":n==="light"}),children:[c.jsx("input",{type:"checkbox",onChange:()=>{typeof e=="function"&&e(t?"dark":"light")},className:"absolute top-0 z-50 m-0 h-full w-full cursor-pointer opacity-0"}),c.jsx("span",{className:f0("absolute top-1/2 left-[3px] flex h-6 w-6 -translate-y-1/2 translate-x-0 items-center justify-center rounded-full bg-white shadow-switcher duration-200 ease-linear",{"!right-[3px] !translate-x-full":!t}),children:c.jsx(aCe,{isInLightMode:t})})]})})};function aCe({isInLightMode:n}){const e="absolute inset-0 flex items-center justify-center transition-opacity ease-in-out duration-400";return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:f0(e,n?"opacity-100":"opacity-0"),children:c.jsx(oCe,{})}),c.jsx("span",{className:f0(e,n?"opacity-0":"opacity-100"),children:c.jsx(lCe,{})})]})}function oCe(){return c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M7.99992 12.6666C10.5772 12.6666 12.6666 10.5772 12.6666 7.99992C12.6666 5.42259 10.5772 3.33325 7.99992 3.33325C5.42259 3.33325 3.33325 5.42259 3.33325 7.99992C3.33325 10.5772 5.42259 12.6666 7.99992 12.6666Z",fill:"#969AA1"}),c.jsx("path",{d:"M8.00008 15.3067C7.63341 15.3067 7.33342 15.0334 7.33342 14.6667V14.6134C7.33342 14.2467 7.63341 13.9467 8.00008 13.9467C8.36675 13.9467 8.66675 14.2467 8.66675 14.6134C8.66675 14.9801 8.36675 15.3067 8.00008 15.3067ZM12.7601 13.4267C12.5867 13.4267 12.4201 13.3601 12.2867 13.2334L12.2001 13.1467C11.9401 12.8867 11.9401 12.4667 12.2001 12.2067C12.4601 11.9467 12.8801 11.9467 13.1401 12.2067L13.2267 12.2934C13.4867 12.5534 13.4867 12.9734 13.2267 13.2334C13.1001 13.3601 12.9334 13.4267 12.7601 13.4267ZM3.24008 13.4267C3.06675 13.4267 2.90008 13.3601 2.76675 13.2334C2.50675 12.9734 2.50675 12.5534 2.76675 12.2934L2.85342 12.2067C3.11342 11.9467 3.53341 11.9467 3.79341 12.2067C4.05341 12.4667 4.05341 12.8867 3.79341 13.1467L3.70675 13.2334C3.58008 13.3601 3.40675 13.4267 3.24008 13.4267ZM14.6667 8.66675H14.6134C14.2467 8.66675 13.9467 8.36675 13.9467 8.00008C13.9467 7.63341 14.2467 7.33342 14.6134 7.33342C14.9801 7.33342 15.3067 7.63341 15.3067 8.00008C15.3067 8.36675 15.0334 8.66675 14.6667 8.66675ZM1.38675 8.66675H1.33341C0.966748 8.66675 0.666748 8.36675 0.666748 8.00008C0.666748 7.63341 0.966748 7.33342 1.33341 7.33342C1.70008 7.33342 2.02675 7.63341 2.02675 8.00008C2.02675 8.36675 1.75341 8.66675 1.38675 8.66675ZM12.6734 3.99341C12.5001 3.99341 12.3334 3.92675 12.2001 3.80008C11.9401 3.54008 11.9401 3.12008 12.2001 2.86008L12.2867 2.77341C12.5467 2.51341 12.9667 2.51341 13.2267 2.77341C13.4867 3.03341 13.4867 3.45341 13.2267 3.71341L13.1401 3.80008C13.0134 3.92675 12.8467 3.99341 12.6734 3.99341ZM3.32675 3.99341C3.15341 3.99341 2.98675 3.92675 2.85342 3.80008L2.76675 3.70675C2.50675 3.44675 2.50675 3.02675 2.76675 2.76675C3.02675 2.50675 3.44675 2.50675 3.70675 2.76675L3.79341 2.85342C4.05341 3.11342 4.05341 3.53341 3.79341 3.79341C3.66675 3.92675 3.49341 3.99341 3.32675 3.99341ZM8.00008 2.02675C7.63341 2.02675 7.33342 1.75341 7.33342 1.38675V1.33341C7.33342 0.966748 7.63341 0.666748 8.00008 0.666748C8.36675 0.666748 8.66675 0.966748 8.66675 1.33341C8.66675 1.70008 8.36675 2.02675 8.00008 2.02675Z",fill:"#969AA1"})]})}function lCe(){return c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M14.3533 10.62C14.2466 10.44 13.9466 10.16 13.1999 10.2933C12.7866 10.3667 12.3666 10.4 11.9466 10.38C10.3933 10.3133 8.98659 9.6 8.00659 8.5C7.13993 7.53333 6.60659 6.27333 6.59993 4.91333C6.59993 4.15333 6.74659 3.42 7.04659 2.72666C7.33993 2.05333 7.13326 1.7 6.98659 1.55333C6.83326 1.4 6.47326 1.18666 5.76659 1.48C3.03993 2.62666 1.35326 5.36 1.55326 8.28666C1.75326 11.04 3.68659 13.3933 6.24659 14.28C6.85993 14.4933 7.50659 14.62 8.17326 14.6467C8.27993 14.6533 8.38659 14.66 8.49326 14.66C10.7266 14.66 12.8199 13.6067 14.1399 11.8133C14.5866 11.1933 14.4666 10.8 14.3533 10.62Z",fill:"#969AA1"})})}
85const cCe=["/ai-automator","/workflows","/executions","/post-analytics","/comments","/group-search","/history","/posts","/account","/referrals","/leaderboard"],uCe=n=>cCe.some(e=>n.startsWith(e));function jB(){G.useEffect(()=>{const n=document.body.classList;return n.add("dark"),()=>{let e="light";try{e=JSON.parse(localStorage.getItem("color-theme")||'"light"')}catch{}e!=="dark"&&n.remove("dark")}},[])}const dCe=({className:n=""})=>c.jsxs("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("circle",{cx:"12",cy:"12",r:"9"}),c.jsx("path",{d:"M3 12h18M12 3c2.6 2.6 3.9 5.6 3.9 9s-1.3 6.4-3.9 9c-2.6-2.6-3.9-5.6-3.9-9S9.4 5.6 12 3z"})]});function Y4({variant:n="dark",align:e="right",direction:t="down"}){const{lang:r,setLang:i,t:s}=Kr(),[a,o]=G.useState(!1),l=G.useRef(null),u=wS.find(f=>f.code===r)??wS[0];G.useEffect(()=>{if(!a)return;const f=g=>{var A;(A=l.current)!=null&&A.contains(g.target)||o(!1)},p=g=>{g.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",f),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",p)}},[a]);const d=f=>{i(f),o(!1)};if(n==="list")return c.jsx("div",{role:"radiogroup","aria-label":s("Language"),className:"flex flex-wrap gap-2",children:wS.map(f=>c.jsx("button",{role:"radio","aria-checked":f.code===r,onClick:()=>d(f.code),className:`rounded-full px-3.5 py-2 text-sm font-semibold transition-colors ${f.code===r?"bg-[#cfff05] text-[#05060a]":"bg-white/5 text-white/75 hover:bg-white/10 hover:text-white"}`,children:f.label},f.code))});const h=n==="dark";return c.jsxs("div",{ref:l,className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>o(f=>!f),"aria-haspopup":"listbox","aria-expanded":a,"aria-label":`${s("Language")}: ${u.label}`,className:h?"flex h-10 items-center gap-1.5 rounded-full border border-white/10 bg-white/[0.04] px-3 text-[13px] font-semibold text-white/80 transition-colors hover:border-white/20 hover:bg-white/[0.08] hover:text-white":"flex h-9 items-center gap-1.5 rounded-full border border-gray-200 px-3 text-[13px] font-semibold text-gray-700 transition-colors hover:bg-gray-50 dark:border-white/10 dark:text-white/80 dark:hover:bg-white/5",children:[c.jsx(dCe,{className:"h-4 w-4"}),c.jsx("span",{style:{fontFamily:"'JetBrains Mono', ui-monospace, monospace"},children:u.short}),c.jsx("svg",{className:`h-3 w-3 transition-transform duration-300 ${a?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":!0,children:c.jsx("path",{d:"M3 4.5l3 3 3-3"})})]}),c.jsx("ul",{role:"listbox","aria-label":s("Language"),className:`absolute z-[80] min-w-[176px] origin-top overflow-hidden rounded-2xl p-1.5 transition-all duration-200 ease-out ${e==="right"?"right-0":"left-0"} ${t==="up"?"bottom-full mb-2":"top-full mt-2"} ${a?"pointer-events-auto translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"} ${h?"border border-white/10 bg-[#0b0d12]/95 shadow-[0_30px_80px_-20px_rgba(0,0,0,.9)] backdrop-blur-xl":"border border-gray-200 bg-white shadow-xl dark:border-white/10 dark:bg-boxdark"}`,children:wS.map(f=>{const p=f.code===r;return c.jsx("li",{children:c.jsxs("button",{type:"button",role:"option","aria-selected":p,tabIndex:a?0:-1,onClick:()=>d(f.code),className:`flex w-full items-center gap-3 rounded-xl px-3 py-2 text-left text-sm transition-colors ${h?p?"bg-[rgba(207,255,5,.1)] text-white":"text-white/70 hover:bg-white/5 hover:text-white":p?"bg-gray-100 text-gray-900 dark:bg-white/10 dark:text-white":"text-gray-600 hover:bg-gray-50 dark:text-white/70 dark:hover:bg-white/5"}`,children:[c.jsx("span",{className:`w-6 text-[11px] font-bold ${h?"text-white/40":"text-gray-400"}`,style:{fontFamily:"'JetBrains Mono', ui-monospace, monospace"},children:f.short}),c.jsx("span",{className:"flex-1 font-medium",children:f.label}),p&&c.jsx("span",{className:h?"text-[#cfff05]":"text-yellow-500",children:"â"})]})},f.code)})})]})}const QX=[{name:Le("About"),href:"/#features"},{name:Le("Features"),href:"/#features"},{name:Le("Docs"),href:"/docs"},{name:Le("Pricing"),href:"/pricing"},{name:Le("Reviews"),href:"/#reviews"},{name:Le("FAQ"),href:"/#faq"}],KX=[{name:Le("Social Automator"),href:H4.AiAutomatorRoute.build()},{name:Le("Group Search"),href:H4.GroupSearchRoute.build()},{name:Le("Docs"),href:"/docs"},{name:Le("Plans"),href:"/pricing"}],hCe=()=>c.jsx("img",{className:"h-8 w-8",src:V1,alt:"Your SaaS App"});function fCe(){const[n,e]=G.useState(!1),t=hi(),{data:r,isLoading:i}=Ma(),s=uCe(po().pathname);return c.jsxs("header",{className:s?"dark sticky inset-x-0 top-0 z-[60] border-b border-white/[0.07] bg-[#05060a]/80 text-white backdrop-blur-xl":"absolute inset-x-0 top-0 z-[60] shadow sticky bg-white bg-opacity-50 backdrop-blur-lg backdrop-filter dark:border dark:border-gray-100/10 dark:bg-boxdark-2",children:[c.jsxs("nav",{className:`flex items-center justify-between lg:px-8 ${s?"px-6 py-4":"p-6"}`,"aria-label":"Global",children:[c.jsxs("div",{className:"flex items-center lg:flex-1",children:[c.jsx("a",{href:"/",className:"-m-1.5 p-1.5 ml-4",children:c.jsx("img",{className:"h-8 w-8",src:V1,alt:"My SaaS App"})}),s?c.jsx("span",{className:"ml-2 text-[17px] font-bold tracking-tight text-white",style:{fontFamily:"'Space Grotesk', 'Plus Jakarta Sans', sans-serif"},children:"SpreadOut"}):c.jsxs("h2",{className:"text-xl font-bold tracking-tight text-gray-900 sm:text-xl dark:text-white transition-colors duration-300 ml-2",children:["Spread Out ",c.jsx("span",{className:"text-yellow-500",children:"AI"})]})]}),c.jsx("div",{className:"flex lg:hidden",children:c.jsxs("button",{type:"button",className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 dark:text-white",onClick:()=>e(!0),children:[c.jsx("span",{className:"sr-only",children:t("Open main menu")}),c.jsx(toe,{className:"h-6 w-6","aria-hidden":"true"})]})}),c.jsx("div",{className:`hidden lg:flex ${s?"lg:gap-x-1":"lg:gap-x-12"}`,children:(r?KX:QX).map(a=>c.jsx("a",{href:a.href,className:s?"rounded-full px-4 py-2 text-sm font-medium text-white/60 transition-colors hover:bg-white/5 hover:text-white":"text-sm font-semibold leading-6 text-gray-900 duration-300 ease-in-out hover:text-yellow-500 dark:text-white",children:t(a.name)},a.name))}),c.jsxs("div",{className:"hidden lg:flex lg:flex-1 gap-3 justify-end items-center",children:[c.jsx(Y4,{variant:s?"dark":"app"}),!s&&c.jsx("ul",{className:"flex justify-center items-center gap-2 sm:gap-4",children:c.jsx(YX,{})}),i?null:r?c.jsx("div",{className:"ml-4",children:c.jsx(Noe,{user:r,variant:s?"landing":"app"})}):c.jsx("a",{href:r?H4.AccountRoute.build():H4.LoginRoute.build(),className:"text-sm font-semibold leading-6 ml-4",children:c.jsxs("div",{className:"flex items-center duration-300 ease-in-out text-gray-900 hover:text-yellow-500 dark:text-white",children:[t("Log in")," ",c.jsx(VX,{size:"1.1rem",className:"ml-1 mt-[0.1rem]"})]})})]})]}),c.jsxs(AM,{as:"div",className:"lg:hidden",open:n,onClose:e,children:[c.jsx("div",{className:"fixed inset-0 z-[60]"}),c.jsxs(AM.Panel,{className:"fixed inset-y-0 right-0 z-[60] w-full overflow-y-auto bg-white dark:text-white dark:bg-boxdark px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("a",{href:"/",className:"-m-1.5 p-1.5",children:[c.jsx("span",{className:"sr-only",children:"Your SaaS"}),c.jsx(hCe,{})]}),c.jsxs("button",{type:"button",className:"-m-2.5 rounded-md p-2.5 text-gray-700 dark:text-gray-50",onClick:()=>e(!1),children:[c.jsx("span",{className:"sr-only",children:t("Close menu")}),c.jsx(BTe,{className:"h-6 w-6","aria-hidden":"true"})]})]}),c.jsx("div",{className:"mt-6 flow-root",children:c.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10",children:[c.jsx("div",{className:"space-y-2 py-6",children:(r?KX:QX).map(a=>c.jsx("a",{href:a.href,onClick:()=>e(!1),className:"-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50 dark:text-white hover:
85dark:bg-boxdark-2",children:t(a.name)},a.name))}),c.jsx("div",{className:"py-6",children:i?null:r?c.jsx(Coe,{user:r,setMobileMenuOpen:e}):c.jsx(ru,{to:"/login",children:c.jsxs("div",{className:"flex justify-end items-center duration-300 ease-in-out text-gray-900 hover:text-yellow-500 dark:text-white",children:[t("Log in")," ",c.jsx(VX,{size:"1.1rem",className:"ml-1"})]})})}),c.jsxs("div",{className:"py-6",children:[c.jsx("div",{className:"mb-3 text-xs font-semibold uppercase tracking-widest text-gray-500 dark:text-white/40",children:t("Language")}),c.jsx(Y4,{variant:s?"list":"app",align:"left"})]}),!s&&c.jsx("div",{className:"py-6",children:c.jsx(YX,{})})]})})]})]})]})}/*! 86* CookieConsent 3.1.0 87* https://github.com/orestbida/cookieconsent 88* Author Orest Bida 89* Released under the MIT License 90*/const Moe="opt-in",_S="opt-out",koe="show--consent",Roe="show--preferences",ZX="disable--interaction",yM="data-category",Ji="div",Bf="button",Vf="aria-hidden",KS="btn-group",pc="click",yb="data-role",IB="consentModal",FB="preferencesModal";let pCe=class{constructor(){this.t={mode:Moe,revision:0,autoShow:!0,lazyHtmlGeneration:!0,autoClearCookies:!0,manageScriptTags:!0,hideFromBots:!0,cookie:{name:"cc_cookie",expiresAfterDays:182,domain:"",path:"/",secure:!0,sameSite:"Lax"}},this.o={i:{},l:"",_:{},u:{},p:{},m:[],v:!1,h:null,C:null,S:null,M:"",D:!0,T:!1,k:!1,A:!1,N:!1,H:[],V:!1,I:!0,L:[],j:!1,F:"",P:!1,O:[],R:[],B:[],$:[],G:!1,J:!1,U:!1,q:[],K:[],W:[],X:{},Y:{},Z:{},ee:{},te:{},oe:[]},this.ne={ae:{},se:{}},this.ce={},this.re={ie:"cc:onFirstConsent",le:"cc:onConsent",de:"cc:onChange",fe:"cc:onModalShow",_e:"cc:onModalHide",ue:"cc:onModalReady"}}};const gn=new pCe,Poe=(n,e)=>n.indexOf(e),Bs=(n,e)=>Poe(n,e)!==-1,U8=n=>Array.isArray(n),y_=n=>typeof n=="string",cI=n=>!!n&&typeof n=="object"&&!U8(n),Wp=n=>typeof n=="function",Cv=n=>Object.keys(n),Loe=n=>Array.from(new Set(n)),bM=()=>document.activeElement,cb=n=>n.preventDefault(),UB=(n,e)=>n.querySelectorAll(e),or=n=>{const e=document.createElement(n);return n===Bf&&(e.type=n),e},Jr=(n,e,t)=>n.setAttribute(e,t),W7=(n,e,t)=>{n.removeAttribute(t?"data-"+e:e)},r6=(n,e,t)=>n.getAttribute(t?"data-"+e:e),ir=(n,e)=>n.appendChild(e),Qs=(n,e)=>n.classList.add(e),$c=(n,e)=>Qs(n,"cm__"+e),Hi=(n,e)=>Qs(n,"pm__"+e),n1=(n,e)=>n.classList.remove(e),BA=n=>{if(typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());let e=Array.isArray(n)?[]:{};for(let t in n){let r=n[t];e[t]=BA(r)}return e},JX=(n,e)=>dispatchEvent(new CustomEvent(n,{detail:e})),ja=(n,e,t,r)=>{n.addEventListener(e,t),r&&gn.o.m.push({pe:n,ge:e,me:t})},mCe=()=>{const n=gn.t.cookie.expiresAfterDays;return Wp(n)?n(gn.o.F):n},X7=(n,e)=>{const t=n||[],r=e||[];return t.filter((i=>!Bs(r,i))).concat(r.filter((i=>!Bs(t,i))))},Ooe=n=>{gn.o.R=Loe(n),gn.o.F=(()=>{let e="custom";const{R:t,O:r,B:i}=gn.o,s=t.length;return s===r.length?e="all":s===i.length&&(e="necessary"),e})()},Doe=(n,e,t,r)=>{const i="accept-",{show:s,showPreferences:a,hide:o,hidePreferences:l,acceptCategory:u}=e,d=n||document,h=M=>UB(d,`[data-cc="${M}"]`),f=(M,T)=>{cb(M),u(T),l(),o()},p=h("show-preferencesModal"),g=h("show-consentModal"),A=h(i+"all"),x=h(i+"necessary"),b=h(i+"custom"),_=gn.t.lazyHtmlGeneration;for(const M of p)Jr(M,"aria-haspopup","dialog"),ja(M,pc,(T=>{cb(T),a()})),_&&(ja(M,"mouseenter",(T=>{cb(T),gn.o.N||t(e,r)}),!0),ja(M,"focus",(()=>{gn.o.N||t(e,r)})));for(let M of g)Jr(M,"aria-haspopup","dialog"),ja(M,pc,(T=>{cb(T),s(!0)}),!0);for(let M of A)ja(M,pc,(T=>{f(T,"all")}),!0);for(let M of b)ja(M,pc,(T=>{f(T)}),!0);for(let M of x)ja(M,pc,(T=>{f(T,[])}),!0)},p0=(n,e)=>{n&&(e&&(n.tabIndex=-1),n.focus(),e&&n.removeAttribute("tabindex"))},joe=(n,e)=>{const t=r=>{r.target.removeEventListener("transitionend",t),r.propertyName==="opacity"&&getComputedStyle(n).opacity==="1"&&p0((i=>i===1?gn.ne.be:gn.ne.ve)(e))};ja(n,"transitionend",t)};let eY;const Ioe=n=>{clearTimeout(eY),n?Qs(gn.ne.ye,ZX):eY=setTimeout((()=>{n1(gn.ne.ye,ZX)}),500)},gCe=["M 19.5 4.5 L 4.5 19.5 M 4.5 4.501 L 19.5 19.5","M 3.572 13.406 L 8.281 18.115 L 20.428 5.885","M 21.999 6.94 L 11.639 17.18 L 2.001 6.82 "],Q4=(n=0,e=1.5)=>`<svg viewBox="0 0 24 24" stroke-width="${e}"><path d="${gCe[n]}"/></svg>`,Foe=n=>{const e=gn.ne,t=gn.o;(r=>{const i=r===e.he,s=t.i.disablePageInteraction?e.ye:i?e.Ce:e.ye;ja(s,"keydown",(a=>{if(a.key!=="Tab"||!(i?t.k&&!t.A:t.A))return;const o=bM(),l=i?t.q:t.K;
vendor: 4,120 bytes, line 90
90l.length!==0&&(a.shiftKey?o!==l[0]&&r.contains(o)||(cb(a),p0(l[1])):o!==l[1]&&r.contains(o)||(cb(a),p0(l[0])))}),!0)})(n)},ACe=["[href]",Bf,"input","details","[tabindex]"].map((n=>n+':not([tabindex="-1"])')).join(","),Uoe=n=>{const{o:e,ne:t}=gn,r=(i,s)=>{const a=UB(i,ACe);s[0]=a[0],s[1]=a[a.length-1]};n===1&&e.T&&r(t.he,e.q),n===2&&e.N&&r(t.we,e.K)},m0=(n,e,t)=>{const{de:r,le:i,ie:s,_e:a,ue:o,fe:l}=gn.ce,u=gn.re;if(e){const h={modalName:e};return n===u.fe?Wp(l)&&l(h):n===u._e?Wp(a)&&a(h):(h.modal=t,Wp(o)&&o(h)),JX(n,h)}const d={cookie:gn.o.p};n===u.ie?Wp(s)&&s(BA(d)):n===u.le?Wp(i)&&i(BA(d)):(d.changedCategories=gn.o.L,d.changedServices=gn.o.ee,Wp(r)&&r(BA(d))),JX(n,BA(d))},wM=(n,e)=>{try{return n()}catch(t){return!e&&console.warn("CookieConsent:",t),!1}},uI=n=>{const{Y:e,ee:t,O:r,X:i,oe:s,p:a,L:o}=gn.o;for(const h of r){const f=t[h]||e[h]||[];for(const p of f){const g=i[h][p];if(!g)continue;const{onAccept:A,onReject:x}=g;!g.Se&&Bs(e[h],p)?(g.Se=!0,Wp(A)&&A()):g.Se&&!Bs(e[h],p)&&(g.Se=!1,Wp(x)&&x())}}if(!gn.t.manageScriptTags)return;const l=s,u=n||a.categories||[],d=(h,f)=>{if(f>=h.length)return;const p=s[f];if(p.xe)return d(h,f+1);const g=p.Me,A=p.De,x=p.Te,b=Bs(u,A),_=!!x&&Bs(e[A],x);if(!x&&!p.ke&&b||!x&&p.ke&&!b&&Bs(o,A)||x&&!p.ke&&_||x&&p.ke&&!_&&Bs(t[A]||[],x)){p.xe=!0;const M=r6(g,"type",!0);W7(g,"type",!!M),W7(g,yM);let T=r6(g,"src",!0);T&&W7(g,"src",!0);const L=or("script");L.textContent=g.innerHTML;for(const{nodeName:P}of g.attributes)Jr(L,P,g[P]||r6(g,P));M&&(L.type=M),T?L.src=T:T=g.src;const D=!!T&&(!M||["text/javascript","module"].includes(M));if(D&&(L.onload=L.onerror=()=>{d(h,++f)}),g.replaceWith(L),D)return}d(h,++f)};d(l,0)},i6="bottom",dI="left",Boe="center",BB="right",Y7="inline",Voe="wide",zoe="pm--",Q7=["middle","top",i6],tY=[dI,Boe,BB],xCe={box:{Ee:[Voe,Y7],Ae:Q7,Ne:tY,He:i6,Ve:BB},cloud:{Ee:[Y7],Ae:Q7,Ne:tY,He:i6,Ve:Boe},bar:{Ee:[Y7],Ae:Q7.slice(1),Ne:[],He:i6,Ve:""}},vCe={box:{Ee:[],Ae:[],Ne:[],He:"",Ve:""},bar:{Ee:[Voe],Ae:[],Ne:[dI,BB],He:"",Ve:dI}},Goe=n=>{const e=gn.o.i.guiOptions,t=e&&e.consentModal,r=e&&e.preferencesModal;n===0&&nY(gn.ne.he,xCe,t,"cm--","box","cm"),n===1&&nY(gn.ne.we,vCe,r,zoe,"box","pm")},nY=(n,e,t,r,i,s)=>{n.className=s;const a=t&&t.layout,o=t&&t.position,l=t&&t.flipButtons,u=!t||t.equalWeightButtons!==!1,d=a&&a.split(" ")||[],h=d[0],f=d[1],p=h in e?h:i,g=e[p],A=Bs(g.Ee,f)&&f,x=o&&o.split(" ")||[],b=x[0],_=r===zoe?x[0]:x[1],M=Bs(g.Ae,b)?b:g.He,T=Bs(g.Ne,_)?_:g.Ve,L=P=>{P&&Qs(n,r+P)};L(p),L(A),L(M),L(T),l&&L("flip");const D=s+"__btn--secondary";if(s==="cm"){const{Ie:P,Le:O}=gn.ne;P&&(u?n1(P,D):Qs(P,D)),O&&(u?n1(O,D):Qs(O,D))}else{const{je:P}=gn.ne;P&&(u?n1(P,D):Qs(P,D))}},K4=(n,e)=>{const t=gn.o,r=gn.ne,{hide:i,hidePreferences:s,acceptCategory:a}=n,o=T=>{a(T),s(),i()},l=t.u&&t.u.preferencesModal;if(!l)return;const u=l.title,d=l.closeIconLabel,h=l.acceptAllBtn,f=l.acceptNecessaryBtn,p=l.savePreferencesBtn,g=l.sections||[],A=h||f||p;if(r.Fe)r.Pe=or(Ji),Hi(r.Pe,"body");else{r.Fe=or(Ji),Qs(r.Fe,"pm-wrapper");const T=or("div");Qs(T,"pm-overlay"),ir(r.Fe,T),ja(T,pc,s),r.we=or(Ji),Qs(r.we,"pm"),Jr(r.we,"role","dialog"),Jr(r.we,Vf,!0),Jr(r.we,"aria-modal",!0),Jr(r.we,"aria-labelledby","pm__title"),ja(r.ye,"keydown",(L=>{L.keyCode===27&&s()}),!0),r.Oe=or(Ji),Hi(r.Oe,"header"),r.Re=or("h2"),Hi(r.Re,"title"),r.Re.id="pm__title",r.Be=or(Bf),Hi(r.Be,"close-btn"),Jr(r.Be,"aria-label",l.closeIconLabel||""),ja(r.Be,pc,s),r.$e=or("span"),r.$e.innerHTML=Q4(),ir(r.Be,r.$e),r.Ge=or(Ji),Hi(r.Ge,"body"),r.Je=or(Ji),Hi(r.Je,"footer");var x=or(Ji);Qs(x,"btns");var b=or(Ji),_=or(Ji);Hi(b,KS),Hi(_,KS),ir(r.Je,b),ir(r.Je,_),ir(r.Oe,r.Re),ir(r.Oe,r.Be),r.ve=or(Ji),Jr(r.ve,"tabIndex",-1),ir(r.we,r.ve),ir(r.we,r.Oe),ir(r.we,r.Ge),A&&ir(r.we,r.Je),ir(r.Fe,r.we)}let M;u&&(r.Re.innerHTML=u,d&&Jr(r.Be,"aria-label",d)),g.forEach(((T,L)=>{const D=T.title,P=T.description,O=T.linkedCategory,F=O&&t.P[O],U=T.cookieTable,B=U&&U.body,z=U&&U.caption,H=B&&B.length>0,X=!!F,W=X&&t.X[O],J=cI(W)&&Cv(W)||[],ee=X&&(!!P||!!H||Cv(W).length>0);var ae=or(Ji);if(Hi(ae,"section"),ee||P){var le=or(Ji);Hi(le,"section-desc-wrapper")}let Z=J.length;if(ee&&Z>
vendor: 10,306 bytes, line 90
900){const te=or(Ji);Hi(te,"section-services");for(const ve of J){const we=W[ve],Ue=we&&we.label||ve,ze=or(Ji),yt=or(Ji),mt=or(Ji),bt=or(Ji);Hi(ze,"service"),Hi(bt,"service-title"),Hi(yt,"service-header"),Hi(mt,"service-icon");const dt=rY(Ue,ve,F,!0,O);bt.innerHTML=Ue,ir(yt,mt),ir(yt,bt),ir(ze,yt),ir(ze,dt),ir(te,ze)}ir(le,te)}if(D){var Y=or(Ji),re=or(X?Bf:Ji);if(Hi(Y,"section-title-wrapper"),Hi(re,"section-title"),re.innerHTML=D,ir(Y,re),X){const te=or("span");te.innerHTML=Q4(2,3.5),Hi(te,"section-arrow"),ir(Y,te),ae.className+="--toggle";const ve=rY(D,O,F);let we=l.serviceCounterLabel;if(Z>0&&y_(we)){let Ue=or("span");Hi(Ue,"badge"),Hi(Ue,"service-counter"),Jr(Ue,Vf,!0),Jr(Ue,"data-servicecounter",Z),we&&(we=we.split("|"),we=we.length>1&&Z>1?we[1]:we[0],Jr(Ue,"data-counterlabel",we)),Ue.innerHTML=Z+(we?" "+we:""),ir(re,Ue)}if(ee){Hi(ae,"section--expandable");var _e=O+"-desc";Jr(re,"aria-expanded",!1),Jr(re,"aria-controls",_e)}ir(Y,ve)}else Jr(re,"role","heading"),Jr(re,"aria-level","3");ir(ae,Y)}if(P){var Ee=or("p");Hi(Ee,"section-desc"),Ee.innerHTML=P,ir(le,Ee)}if(ee&&(Jr(le,Vf,"true"),le.id=_e,((te,ve,we)=>{ja(re,pc,(()=>{ve.classList.contains("is-expanded")?(n1(ve,"is-expanded"),Jr(we,"aria-expanded","false"),Jr(te,Vf,"true")):(Qs(ve,"is-expanded"),Jr(we,"aria-expanded","true"),Jr(te,Vf,"false"))}))})(le,ae,re),H)){const te=or("table"),ve=or("thead"),we=or("tbody");if(z){const dt=or("caption");Hi(dt,"table-caption"),dt.innerHTML=z,te.appendChild(dt)}Hi(te,"section-table"),Hi(ve,"table-head"),Hi(we,"table-body");const Ue=U.headers,ze=Cv(Ue),yt=r.Ue.createDocumentFragment(),mt=or("tr");for(const dt of ze){const St=Ue[dt],kt=or("th");kt.id="cc__row-"+St+L,Jr(kt,"scope","col"),Hi(kt,"table-th"),kt.innerHTML=St,ir(yt,kt)}ir(mt,yt),ir(ve,mt);const bt=r.Ue.createDocumentFragment();for(const dt of B){const St=or("tr");Hi(St,"table-tr");for(const kt of ze){const Fe=Ue[kt],Ze=dt[kt],Ye=or("td"),ft=or(Ji);Hi(Ye,"table-td"),Jr(Ye,"data-column",Fe),Jr(Ye,"headers","cc__row-"+Fe+L),ft.insertAdjacentHTML("beforeend",Ze),ir(Ye,ft),ir(St,Ye)}ir(bt,St)}ir(we,bt),ir(te,ve),ir(te,we),ir(le,te)}(ee||P)&&ir(ae,le);const Ae=r.Pe||r.Ge;X?(M||(M=or(Ji),Hi(M,"section-toggles")),M.appendChild(ae)):M=null,ir(Ae,M||ae)})),h&&(r.ze||(r.ze=or(Bf),Hi(r.ze,"btn"),Jr(r.ze,yb,"all"),ir(b,r.ze),ja(r.ze,pc,(()=>o("all")))),r.ze.innerHTML=h),f&&(r.je||(r.je=or(Bf),Hi(r.je,"btn"),Jr(r.je,yb,"necessary"),ir(b,r.je),ja(r.je,pc,(()=>o([])))),r.je.innerHTML=f),p&&(r.qe||(r.qe=or(Bf),Hi(r.qe,"btn"),Hi(r.qe,"btn--secondary"),Jr(r.qe,yb,"save"),ir(_,r.qe),ja(r.qe,pc,(()=>o()))),r.qe.innerHTML=p),r.Pe&&(r.we.replaceChild(r.Pe,r.Ge),r.Ge=r.Pe),Goe(1),t.N||(t.N=!0,m0(gn.re.ue,FB,r.we),e(n),ir(r.Ce,r.Fe),Foe(r.we),setTimeout((()=>Qs(r.Fe,"cc--anim")),100)),Uoe(2)};function rY(n,e,t,r,i){const s=gn.o,a=gn.ne,o=or("label"),l=or("input"),u=or("span"),d=or("span"),h=or("span"),f=or("span"),p=or("span");if(f.innerHTML=Q4(1,3),p.innerHTML=Q4(0,3),l.type="checkbox",Qs(o,"section__toggle-wrapper"),Qs(l,"section__toggle"),Qs(f,"toggle__icon-on"),Qs(p,"toggle__icon-off"),Qs(u,"toggle__icon"),Qs(d,"toggle__icon-circle"),Qs(h,"toggle__label"),Jr(u,Vf,"true"),r?(Qs(o,"toggle-service"),Jr(l,yM,i),a.se[i][e]=l):a.ae[e]=l,r?(g=>{ja(l,"change",(()=>{const A=a.se[g],x=a.ae[g];s.Z[g]=[];for(let b in A){const _=A[b];_.checked&&s.Z[g].push(_.value)}x.checked=s.Z[g].length>0}))})(i):(g=>{ja(l,pc,(()=>{const A=a.se[g],x=l.checked;s.Z[g]=[];for(let b in A)A[b].checked=x,x&&s.Z[g].push(b)}))})(e),l.value=e,h.textContent=n.replace(/<.*>.*<\/.*>/gm,""),ir(d,p),ir(d,f),ir(u,d),s.D)(t.readOnly||t.enabled)&&(l.checked=!0);else if(r){const g=s.Y[i];l.checked=t.readOnly||Bs(g,e)}else Bs(s.R,e)&&(l.checked=!0);return t.readOnly&&(l.disabled=!0),ir(o,l),ir(o,u),ir(o,h),o}const K7=()=>{const n=or("span");return gn.ne.Ke||(gn.ne.Ke=n),n},qoe=(n,e)=>{const t=gn.o,r=gn.ne,{hide:i,showPreferences:s,acceptCategory:a}=n,o=t.u&&t.u.consentModal;if(!o)return;const l=o.acceptAllBtn,u=o.acceptNecessaryBtn,d=o.showPreferencesBtn,h=o.closeIconLabel,f=o.footer,p=o.label,g=o.title,A=b=>{i(),a(b)};if(!r.Qe){r.Qe=or(Ji),r.he=or(Ji),r.We=or(Ji),r.Xe=or(Ji),r.Ye=or(Ji),Qs(r.Qe,"cm-wrapper"),Qs(r.he,"cm"),$c(r.We,"body"),$c(r.Xe,"texts"),$c(r.Ye,"btns"),Jr(r.he,"role","dialog"),Jr(r.he,"aria-modal","true"),Jr(r.he,Vf,"false"),Jr(r.he,"aria-describedby","cm__desc"),p?Jr(r.he,"aria-label",p):g&&Jr(r.he,"aria-labelledby","cm__title");const b="box",_=t.i.guiOptions,M=_&&_.consentModal,T=(M&&M.layout||b).split(" ")[0]===b;g&&h&&T&&(r.Le||(r.Le=or(Bf),r.Le.innerHTML=Q4(),$c(r.Le,"btn"),$c(r.Le,"btn--close"),ja(r.Le,pc,(()=>{A([])})),ir(r.We,r.Le)),Jr(r.Le,"aria-label",h)),ir(r.We,r.Xe),(l||u||d)&&ir(r.We,r.Ye),r.be=or(Ji),Jr(r.be,"tabIndex",-1),ir(r.he,r.be),ir(r.he,r.We),ir(r.Qe,r.he)}g&&(r.Ze||(r.Ze=or("h2"),r.Ze.className=r.Ze.id="cm__title",ir(r.Xe,r.Ze)),r.Ze.innerHTML=g);let x=o.description;if(x&&(t.V&&(x=x.replace("{{revisionMessage}}",t.I?"":o.revisionMessage||"")),r.et||(r.et=or("p"),r.et.className=r.et.id="cm__desc",ir(r.Xe,r.et)),r.et.innerHTML=x),l&&(r.tt||(r.tt=or(Bf),ir(r.tt,K7()),$c(r.tt,"btn"),Jr(r.tt,yb,"all"),ja(r.tt,pc,(()=>{A("all")}))),r.tt.firstElementChild.innerHTML=l),u&&(r.Ie||(r.Ie=or(Bf),ir(r.Ie,K7()),$c(r.Ie,"btn"),Jr(r.Ie,yb,"necessary"),ja(r.Ie,pc,(()=>{A([])}))),r.Ie.firstElementChild.innerHTML=u),d&&(r.ot||(r.ot=or(Bf),ir(r.ot,K7()),$c(r.ot,"btn"),$c(r.ot,"btn--secondary"),Jr(r.ot,yb,"show"),ja(r.ot,"mouseenter",(()=>{t.N||K4(n,e)})),ja(r.ot,pc,s)),r.ot.firstElementChild.innerHTML=d),r.nt||(r.nt=or(Ji),$c(r.nt,KS),l&&ir(r.nt,r.tt),u&&ir(r.nt,r.Ie),(l||u)&&ir(r.We,r.nt),ir(r.Ye,r.nt)),r.ot&&!r.st&&(r.st=or(Ji),r.Ie&&r.tt?($c(r.st,KS),ir(r.st,r.ot),ir(r.Ye,r.st)):(ir(r.nt,r.ot),$c(r.nt,KS+"--uneven"))),f){if(!r.ct){let b=or(Ji),_=or(Ji);r.ct=or(Ji),$c(b,"footer"),$c(_,"links"),$c(r.ct,"link-group"),ir(_,r.ct),ir(b,_),ir(r.he,b)}r.ct.innerHTML=f}Goe(0),t.T||(t.T=!0,m0(gn.re.ue,IB,r.he),e(n),ir(r.Ce,r.Qe),Foe(r.he),setTimeout((()=>Qs(r.Qe,"cc--anim")),100)),Uoe(1),Doe(r.We,n,K4,e)},$oe=n=>{if(!y_(n))return null;if(n in gn.o._)return n;let e=n.slice(0,2);return e in gn.o._?e:null},Hoe=()=>gn.o.l||gn.o.i.language.default,Woe=n=>{n&&(gn.o.l=n)},yCe=async n=>{const e=gn.o;let t=$oe(n)?n:Hoe(),r=e._[t];if(y_(r)?r=await(async i=>{try{return await(await fetch(i)).json()}catch(s){return console.error(s),!1}})(r):Wp(r)&&(r=await r()),!r)throw`Could not load translation for the '${t}' language`;return e.u=r,Woe(t),!0},bCe=()=>{let n=gn.o.i.language.rtl,e=gn.ne.Ce;n&&e&&(U8(n)||(n=[n]),Bs(n,gn.o.l)?Qs(e,"cc--rtl"):n1(e,"cc--rtl"))},ZS=()=>{const n=gn.ne;if(n.Ce)return;n.Ce=or(Ji),n.Ce.id="cc-main",n.Ce.setAttribute("data-nosnippet",""),bCe();let e=gn.o.i.root;e&&y_(e)&&(e=document.querySelector(e)),(e||n.Ue.body).appendChild(n.Ce)},wCe=n=>wM((()=>localStorage.removeItem(n))),iY=(n,e)=>{if(e instanceof RegExp)return n.filter((t=>e.test(t)));{const t=Poe(n,e);return t>-1?[n[t]]:[]}},_Ce=n=>{const{hostname:e,protocol:t}=location,{name:r,path:i,domain:s,sameSite:a,useLocalStorage:o,secure:l}=gn.t.cookie,u=864e5*mCe(),d=new Date;d.setTime(d.getTime()+u),gn.o.p.expirationTime=d.getTime();const h=JSON.stringify(gn.o.p);let f=r+"="+encodeURIComponent(h)+(u!==0?"; expires="+d.toUTCString():"")+"; Path="+i+"; SameSite="+a;Bs(e,".")&&(f+="; Domain="+s),l&&t==="https:"&&(f+="; Secure"),o?((p,g)=>{wM((()=>localStorage.setItem(p,g)))})(r,h):document.cookie=f,gn.o.p},sY=(n,e,t)=>{if(n.length===0)return;const r=t||gn.t.cookie.domain,i=e||gn.t.cookie.path,s=r.slice(0,4)==="www.",a=s&&r.substring(4),o=(l,u)=>{u&&u.slice(0,1)!=="."&&(u="."+u),document.cookie=l+"=; path="+i+(u?"; domain="+u:"")+"; expires=Thu, 01 Jan 1970 00:00:01 GMT;"};for(const l of n)o(l,t),t||o(l,r),s&&o(l,a)},SCe=n=>{const e=gn.t.cookie.name,t=gn.t.cookie.useLocalStorage;return((i,s)=>{let a;return a=wM((()=>JSON.parse(s?i:decodeURIComponent(i))),!0)||{},a})(t?(r=e,wM((()=>localStorage.getItem(r)))||""):TCe(e),t);var r},TCe=(n,e)=>{const t=document.cookie.match("(^|;)\\s*"+n+"\\s*=\\s*([^;]+)");return t?t.pop():""},ECe=n=>{const e=document.cookie.split(/;\s*/),t=[];for(const r of e){let i=r.split("=")[0];t.push(i)}return t},CCe=(n,e=[])=>{((t,r)=>{const{O:i,R:s,B:a,N:o,Z:l,$:u,X:d}=gn.o;let h=[];if(t){U8(t)?h.push(...t):y_(t)&&(h=t==="all"?i:[t]);for(const f of i)l[f]=Bs(h,f)?Cv(d[f]):[]}else h=[...s,...u],o&&(h=(()=>{const f=gn.ne.ae;if(!f)return[];let p=[];for(let g in f)f[g].checked&&p.push(g);return p})());h=h.filter((f=>!Bs(i,f)||!Bs(r,f))),h.push(...a),Ooe(h)})(n,e),(()=>{const t=gn.o,{Z:r,B:i,Y:s,X:a,O:o}=t,l=o;t.te=BA(s);for(const u of l){const d=a[u],h=Cv(d),f=r[u]&&r[u].length>0,p=Bs(i,u);if(h.length!==0){if(s[u]=[],p)s[u].push(...h);else if(f){const g=r[u];s[u].push(...g)}else s[u]=t.Z[u];s[u]=Loe(s[u])}}})(),(()=>{const t=gn.o;t.L=gn.t.mode===_S&&t.D?X7(t.$,t.R):X7(t.R,t.p.categories);let r=t.L.length>0,i=!1;for(const l of t.O)t.ee[l]=X7(t.Y[l],t.te[l]),t.ee[l].length>0&&(i=!0);const s=gn.ne.ae;for(const l in s)s[l].checked=Bs(t.R,l);for(const l of t.O){const u=gn.ne.se[l],d=t.Y[l];for(const h in u)u[h].checked=Bs(d,h)}t.C||(t.C=new Date),t.M||(t.M=("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,(l=>(l^crypto.getRandomValues(new Uint8Array(1))[0]&15>>l/4).toString(16)))),t.p={categories:BA(t.R),revision:gn.t.revision,data:t.h,consentTimestamp:t.C.toISOString(),consentId:t.M,services:BA(t.Y),languageCode:gn.o.l},t.S&&(t.p.lastConsentTimestamp=t.S.toISOString());let a=!1;const o=r||i;(t.D||o)&&(t.D&&(t.D=!1,a=!0),t.S=t.S?new Date:t.C,t.p.lastConsentTimestamp=t.S.toISOString(),_Ce(),gn.t.autoClearCookies&&(a||o)&&(l=>{const u=gn.o,d=ECe(),h=(f=>{const p=gn.o;return(f?p.O:p.L).filter((g=>{const A=p.P[g];return!!A&&!A.readOnly&&!!A.autoClear}))})(l);for(const f in u.ee)for(const p of u.ee[f]){const g=u.X[f][p].cookies;if(!Bs(u.Y[f],p)&&g)for(const A of g){const x=iY(d,A.name);sY(x,A.path,A.domain)}}for(const f of h){const p=u.P[f].autoClear,g=p&&p.cookies||[],A=Bs(u.L,f),x=!Bs(u.R,f),b=A&&x;if(l?x:b){p.reloadPage&&b&&(u.j=!0);for(const _ of g){const M=iY(d,_.name);sY(M,_.path,_.domain)}}}})(a),uI()),a&&(m0(gn.re.ie),m0(gn.re.le),gn.t.mode===Moe)||(o&&m0(gn.re.de),t.j&&(t.j=!1,location.reload()))})()},NCe=n=>{const e=gn.o.D?[]:gn.o.R;return Bs(e,n)},MCe=(n,e)=>{const t=gn.o.D?[]:gn.o.Y[e]||[];return Bs(t,n)},Xoe=n=>{const{ne:e,o:t}=gn;
90if(!t.k){if(!t.T){if(!n)return;qoe(VB,ZS)}t.k=!0,t.J=bM(),t.v&&Ioe(!0),joe(e.he,1),Qs(e.ye,koe),Jr(e.he,Vf,"false"),setTimeout((()=>{p0(gn.ne.be)}),100),m0(gn.re.fe,IB)}},kCe=()=>{const{ne:n,o:e,re:t}=gn;e.k&&(e.k=!1,e.v&&Ioe(),p0(n.Ke,!0),n1(n.ye,koe),Jr(n.he,Vf,"true"),p0(e.J),e.J=null,m0(t._e,IB))},RCe=()=>{const n=gn.o;n.A||(n.N||K4(VB,ZS),n.A=!0,n.k?n.U=bM():n.J=bM(),joe(gn.ne.we,2),Qs(gn.ne.ye,Roe),Jr(gn.ne.we,Vf,"false"),setTimeout((()=>{p0(gn.ne.ve)}),100),m0(gn.re.fe,FB))},PCe=()=>{const n=gn.o;n.A&&(n.A=!1,(()=>{const e=Yoe(),t=gn.o.P,r=gn.ne.ae,i=gn.ne.se,s=a=>Bs(gn.o.$,a);for(const a in r){const o=!!t[a].readOnly;r[a].checked=o||(e?NCe(a):s(a));for(const l in i[a])i[a][l].checked=o||(e?MCe(l,a):s(a))}})(),p0(gn.ne.$e,!0),n1(gn.ne.ye,Roe),Jr(gn.ne.we,Vf,"true"),n.k?(p0(n.U),n.U=null):(p0(n.J),n.J=null),m0(gn.re._e,FB))};var VB={show:Xoe,hide:kCe,showPreferences:RCe,hidePreferences:PCe,acceptCategory:CCe};const Yoe=()=>!gn.o.D,LCe=async n=>{const{o:e,t,re:r}=gn,i=window;if(!i._ccRun){if(i._ccRun=!0,(o=>{const{ne:l,t:u,o:d}=gn,h=u,f=d,{cookie:p}=h,g=gn.ce,A=o.cookie,x=o.categories,b=Cv(x)||[],_=navigator,M=document;l.Ue=M,l.ye=M.documentElement,p.domain=location.hostname,f.i=o,f.P=x,f.O=b,f._=o.language.translations,f.v=!!o.disablePageInteraction,g.ie=o.onFirstConsent,g.le=o.onConsent,g.de=o.onChange,g._e=o.onModalHide,g.fe=o.onModalShow,g.ue=o.onModalReady;const{mode:T,autoShow:L,lazyHtmlGeneration:D,autoClearCookies:P,revision:O,manageScriptTags:F,hideFromBots:U}=o;T===_S&&(h.mode=T),typeof P=="boolean"&&(h.autoClearCookies=P),typeof F=="boolean"&&(h.manageScriptTags=F),typeof O=="number"&&O>=0&&(h.revision=O,f.V=!0),typeof L=="boolean"&&(h.autoShow=L),typeof D=="boolean"&&(h.lazyHtmlGeneration=D),U===!1&&(h.hideFromBots=!1),h.hideFromBots===!0&&_&&(f.G=_.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(_.userAgent)||_.webdriver),cI(A)&&(h.cookie={...p,...A}),h.autoClearCookies,f.V,h.manageScriptTags,(B=>{const{P:z,X:H,Y:X,Z:W,B:J}=gn.o;for(let ee of B){const ae=z[ee],le=ae.services||{},Z=cI(le)&&Cv(le)||[];H[ee]={},X[ee]=[],W[ee]=[],ae.readOnly&&(J.push(ee),X[ee]=Z),gn.ne.se[ee]={};for(let Y of Z){const re=le[Y];re.Se=!1,H[ee][Y]=re}}})(b),(()=>{if(!gn.t.manageScriptTags)return;const B=gn.o,z=UB(document,"script["+yM+"]");for(const H of z){let X=r6(H,yM),W=H.dataset.service||"",J=!1;if(X&&X.charAt(0)==="!"&&(X=X.slice(1),J=!0),W.charAt(0)==="!"&&(W=W.slice(1),J=!0),Bs(B.O,X)&&(B.oe.push({Me:H,xe:!1,ke:J,De:X,Te:W}),W)){const ee=B.X[X];ee[W]||(ee[W]={Se:!1})}}})(),Woe((()=>{const B=gn.o.i.language.autoDetect;if(B){const z={browser:navigator.language,document:document.documentElement.lang},H=$oe(z[B]);if(H)return H}return Hoe()})())})(n),e.G)return;(()=>{const o=gn.o,l=gn.t,u=SCe(),{categories:d,services:h,consentId:f,consentTimestamp:p,lastConsentTimestamp:g,data:A,revision:x}=u,b=U8(d);o.p=u,o.M=f;const _=!!f&&y_(f);o.C=p,o.C&&(o.C=new Date(p)),o.S=g,o.S&&(o.S=new Date(g)),o.h=A!==void 0?A:null,o.V&&_&&x!==l.revision&&(o.I=!1),o.D=!(_&&o.I&&o.C&&o.S&&b),l.cookie.useLocalStorage&&!o.D&&(o.D=new Date().getTime()>(u.expirationTime||0),o.D&&wCe(l.cookie.name)),o.D,(()=>{const M=gn.o;for(const T of M.O){const L=M.P[T];if(L.readOnly||L.enabled){M.$.push(T);const D=M.X[T]||{};for(let P in D)M.Z[T].push(P),M.i.mode===_S&&M.Y[T].push(P)}}})(),o.D?l.mode===_S&&(o.R=[...o.$]):(o.Y={...o.Y,...h},o.Z={...o.Y},Ooe([...o.B,...d]))})();const a=Yoe();if(!await yCe())return!1;if(Doe(null,s=VB,K4,ZS),gn.o.D&&qoe(s,ZS),gn.t.lazyHtmlGeneration||K4(s,ZS),t.autoShow&&!a&&Xoe(!0),a)return uI(),m0(r.le);t.mode===_S&&uI(e.$)}var s},OCe=()=>({root:"body",autoShow:!0,disablePageInteraction:!1,hideFromBots:!0,mode:"opt-in",revision:0,cookie:{name:"cc_cookie",domain:location.hostname,path:"/",sameSite:"Lax",expiresAfterDays:365},guiOptions:{consentModal:{layout:"box",position:"bottom right",equalWeightButtons:!0,flipButtons:!1}},categories:{necessary:{enabled:!0,readOnly:!0},analytics:{autoClear:{cookies:[{name:/^_ga/},{name:"_gid"}]},services:{ga:{label:"Google Analytics",onAccept:()=>{try{let e=function(...i){window.dataLayer.push(arguments)};throw new Error("Google Analytics ID is missing")}catch(e){console.error(e)}},onReject:()=>{}}}}},language:{default:"en",translations:{en:{consentModal:{title:"We use cookies",description:"We use cookies primarily for analytics to enhance your experience. By accepting, you agree to our use of these cookies. You can manage your preferences or learn more about our cookie policy.",acceptAllBtn:"Accept all",acceptNecessaryBtn:"Reject all",footer:` 91 <a href="<your-url-here>" target="_blank">Privacy Policy</a> 92 <a href="<your-url-here>" target="_blank">Terms and Conditions</a> 93 `},preferencesModal:{sections:[]}}}}}),DCe=()=>(G.useEffect(()=>{LCe(OCe())},[]),c.jsx("div",{id:"cookieconsent"}));function jCe(){const n=po(),{data:e}=Ma(),t=G.useMemo(()=>n.pathname!=="/"&&n.pathname!=="/login"&&n.pathname!=="/signup"&&n.pathname!=="/pricing"&&n.pathname!=="/mcp/authorize"&&!n.pathname.startsWith("/docs"),[n]),r=G.useMemo(()=>n.pathname.startsWith("/admin"),[n]);G.useEffect(()=>{if(e){const a=new Date(e.lastActiveTimestamp),o=new Date;o.getTime()-a.getTime()>300*1e3&&ySe({lastActiveTimestamp:o})}},[e]),G.useEffect(()=>{if(n.hash){const a=n.hash.replace("#",""),o=document.getElementById(a);o&&o.scrollIntoView()}},[n]);const i=ro();G.useEffect(()=>{if(!e||n.pathname==="/mcp/authorize")return;let a=null;
93try{a=sessionStorage.getItem("spreadout:mcpAuthorize"),sessionStorage.removeItem("spreadout:mcpAuthorize")}catch{}a&&i(`/mcp/authorize${a}`,{replace:!0})},[e,n.pathname,i]);const s=G.useRef(null);return G.useEffect(()=>{if(!e||e.id===s.current)return;s.current=e.id;let a=null;try{a=JSON.parse(localStorage.getItem("spreadout:referralCode")||"null")}catch{a=null}if(a!=null&&a.code){try{localStorage.removeItem("spreadout:referralCode")}catch{}Date.now()-(a.at||0)>168*36e5||SSe({referralCode:a.code}).catch(()=>{})}},[e]),c.jsxs(rCe,{children:[c.jsx("div",{className:"min-h-screen dark:text-white dark:bg-boxdark-2",children:r?c.jsx(EW,{}):c.jsxs(c.Fragment,{children:[t&&c.jsx(fCe,{}),c.jsx("div",{children:c.jsx(EW,{})})]})}),c.jsx(DCe,{})]})}const ICe="_loader_uc0fn_1",FCe="_loaderCircle_uc0fn_5",UCe="_loaderAccessibilityText_uc0fn_18",Z7={loader:ICe,loaderCircle:FCe,loaderAccessibilityText:UCe};function BCe(){const n=["wasp-loader",Z7.loader].join(" ");return c.jsxs("div",{className:n,children:[c.jsx("div",{className:Z7.loaderCircle}),c.jsx("div",{className:Z7.loaderAccessibilityText,children:"Loading..."})]})}const Qoe={borderRadius:".5rem",padding:"1rem"},VCe={...Qoe,borderColor:"rgb(240 82 82)",backgroundColor:"rgb(253 232 232)",color:"rgb(200 30 30)"},zCe={...Qoe,borderColor:"rgb(107 114 128)",backgroundColor:"rgb(243 244 246)",color:"rgb(55 65 81)"},Koe={display:"flex",alignItems:"center",gap:".5rem"},Zoe={marginLeft:"1.75rem"};function Joe({children:n,subtitle:e}){return c.jsx("div",{style:VCe,children:c.jsxs("div",{children:[c.jsxs("div",{style:Koe,children:[c.jsx(ele,{})," ",n]}),e&&c.jsx("div",{style:Zoe,children:e})]})})}function GCe({children:n,subtitle:e}){return c.jsx("div",{style:zCe,children:c.jsxs("div",{children:[c.jsxs("div",{style:Koe,children:[c.jsx(ele,{})," ",n]}),e&&c.jsx("div",{style:Zoe,children:e})]})})}const ele=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.25rem",height:"1.25rem",fill:"currentColor",stroke:"currentColor",strokeWidth:0,"aria-hidden":"true",viewBox:"0 0 20 20",children:c.jsx("path",{fillRule:"evenodd",stroke:"none",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM9 9a1 1 0 0 0 0 2v3a1 1 0 0 0 1 1h1a1 1 0 1 0 0-2v-3a1 1 0 0 0-1-1H9z",clipRule:"evenodd"})}),qCe={display:"flex",minHeight:"80vh",justifyContent:"center",alignItems:"center"};function Z4({children:n,className:e}){const t=["wasp-full-page-wrapper",e].filter(Boolean).join(" ");return c.jsx("div",{className:t,style:qCe,children:n})}const Ha=n=>e=>{const{data:t,status:r,error:i}=Ma();switch(r){case"success":return t?c.jsx(n,{...e,user:t}):c.jsx(sse,{to:"/login",replace:!0});case"loading":return c.jsx(Z4,{className:"wasp-auth-required-loader-wrapper",children:c.jsx(BCe,{})});case"error":return c.jsx(Z4,{className:"wasp-auth-required-error-wrapper",children:c.jsx(Joe,{subtitle:c.jsxs("small",{children:["Details: ",i.message]}),children:"Failed to load user data. Try refreshing the page."})})}},$Ce=[{name:"Sarah Jenkins",role:Le("E-commerce Founder"),avatarSrc:"https://i.pravatar.cc/150?img=5",socialUrl:"#",quote:Le("I was spending hours every week trying to figure out where to post our new product launches. SpreadOut found the exact niche communities we needed in minutes. Our conversion rate has noticeably improved since we started targeting better.")},{name:"Marcus Chen",role:Le("Growth Marketing Lead"),avatarSrc:"https://i.pravatar.cc/150?img=11",socialUrl:"#",quote:Le("Finding where our target audience actually hangs out was always a guessing game. The AI community discovery feature completely changed our outreach strategy. We are finally getting our software in front of people who actually want to use it.")},{name:"Elena Rodriguez",role:Le("YouTube Creator"),avatarSrc:"https://i.pravatar.cc/150?img=20",socialUrl:"#",quote:Le("Promoting my videos used to be exhausting. Now I just drop my content in, and the platform schedules everything across the right platforms automatically. I have so much more time to actually focus on making videos now.")},{name:"David Miller",role:Le("Digital Agency Owner"),avatarSrc:"https://i.pravatar.cc/150?img=33",s
93ocialUrl:"#",quote:Le("Managing social distribution for multiple clients was becoming a nightmare. This tool centralized everything for us. The automated text enhancement ensures each post feels native to the platform it is being published on.")},{name:"Sophie Taylor",role:Le("Indie Developer"),avatarSrc:"https://i.pravatar.cc/150?img=47",socialUrl:"#",quote:Le("When you are a solo developer, you really do not have time to do marketing properly. Being able to generate short promotional videos and automatically distribute them has been a lifesaver for my app downloads.")},{name:"James Wilson",role:Le("Restaurant Owner"),avatarSrc:"https://i.pravatar.cc/150?img=59",socialUrl:"#",quote:Le("The location based search is exactly what we needed. We found several local food groups that we had no idea existed. Our weekend specials are now reaching thousands of people right in our neighborhood.")},{name:"Anita Patel",role:Le("Community Manager"),avatarSrc:"https://i.pravatar.cc/150?img=44",socialUrl:"#",quote:Le("I use the platform daily to find relevant discussions for our brand to join. It is incredibly accurate at surfacing active, high quality groups instead of spam filled ones. Highly recommended for anyone doing organic growth.")},{name:"Thomas Wright",role:Le("Tech Founder"),avatarSrc:"https://i.pravatar.cc/150?img=15",socialUrl:"#",quote:Le("We had zero marketing budget when we launched. The AI video generation combined with automated posting helped us get our first hundred customers entirely through organic social reach. It works exactly as advertised.")}],xy={app:[{name:Le("Docs (MCP & API)"),href:"/docs"},{name:Le("Pricing"),href:"/pricing"},{name:Le("Features"),href:"/#features"},{name:Le("Reviews"),href:"/#reviews"},{name:Le("FAQ"),href:"/#faq"},{name:Le("Support"),href:"mailto:[email protected]"}],company:[{name:Le("About"),href:"/#features"},{name:Le("Terms of Service"),href:"/tos"},{name:Le("Terms of Use"),href:"/terms-of-use"},{name:Le("Privacy Policy"),href:"/privacy-policy"}]},HCe=[{name:Le("How it works"),href:"/#how"},{name:Le("Features"),href:"/#features"},{name:Le("Showcase"),href:"/#showcase"},{name:Le("Pricing"),href:"/pricing"},{name:Le("FAQ"),href:"/#faq"},{name:Le("Docs"),href:"/docs"}],aY=[Le("viral videos"),Le("carousels"),Le("explainers"),Le("app demos"),Le("podcasts")],WCe=[{kicker:Le("01 â Drop a link"),title:Le("Paste your website, product page or blog feed."),body:Le("SpreadOut reads the page like a strategist: what you sell, who it is for, your tone, and your brand colors straight from your site.")},{kicker:Le("02 â Your AI Creative Director plans the week"),title:Le("Seven posts. Seven different angles. Zero repeats."),body:Le('Each day gets its own content pillar and viral format: POV, myth vs fact, "I tested it", tier lists, speedruns. Next week remembers this week, so it never gets stale.')},{kicker:Le("03 â Autopilot creates and publishes"),title:Le("Videos and carousels, rendered in your brand, posted on schedule."),body:Le("AI avatars, Vox-style explainers, app demos, podcasts and branded carousels are generated, captioned and published to every connected platform at peak hours.")}],J7=[Le("POV"),Le("Myth vs Fact"),Le("I Tested It"),Le("Tier List"),Le("Speedrun"),Le("Story Time"),Le("Stop Doing This"),Le("ELI5"),Le("Before / After"),Le("Hot Take"),Le("Save-This Checklist"),Le("Red Flags"),Le("How It Works"),Le("Framework")],e9=[{id:"shorts",label:Le("Shorts"),items:[{id:"ugc",label:Le("AI Avatar UGC"),desc:Le("A presenter talks about your product, with captions and b-roll."),media:{kind:"video",src:"/landing-videos/1.webm",aspect:"9/16"}},{id:"product-ad",label:Le("Product Ad"),desc:Le("Creator-style product ad with real-world demo moments."),media:{kind:"video",src:"/landing-videos/5.webm",aspect:"9/16"}},{id:"vox",label:Le("Vox Explainer"),desc:Le("Editorial paper-collage storytelling with kinetic type."),media:{kind:"video",src:"/landing-videos/8.webm",aspect:"9/16"}},{id:"app-demo",label:Le("App Demo"),desc:Le("Your real screens in device frames with cinematic motion."),media:{kind:"video",src:"/landing-videos/4.webm",aspect:"9/16"}},{id:"mini-explainer",label:Le("Mini Explainer"),desc:Le("A clear 30-second breakdown with karaoke captions."),media:{kind:"video",src:"/landing-videos/studio/short-mini-explainer.webm",aspect:"9/16"}},{id:"hook-tease",label:Le("Hook & Tease"),desc:Le("Pattern-interrupt opening, curiosity gap, payoff."),media:{kind:"video",src:"/landing-videos/studio/short-hook-tease.webm",aspect:"9/16"}},{id:"cinematic",label:Le("Cinematic AI"),desc:Le("Fully AI-generated scenes with a narrated story."),media:{kind:"video",src:"/landing-videos/3.webm",aspect:"9/16"}}]},{id:"long",label:Le("Long videos"),items:[{id:"vox-long",label:Le("Vox Explainer (16:9)"),desc:Le("A 60-second editorial deep dive for YouTube and LinkedIn."),media:{kind:"video",src:"/landing-videos/studio/long-vox-explainer.webm",aspect:"16/9"}},{id:"article-recap",label:Le("Article Recap"),desc:Le("Your latest blog post turned into numbered takeaways, narrated."),media:{kind:"video",src:"/landing-videos/studio/long-article-recap.webm",aspect:"16/9"}},{id:"step-tutorial",label:Le("Step-by-Step Tutorial"),desc:Le("A chaptered how-to with step markers and word-by-word captions."),media:{kind:"video",src:"/landing-videos/studio/long-step-tutorial.webm",aspect:"16/9"}}]},{id:"carousels",label:Le("Carousels"),items:[{id:"carousel-facts",label:Le("Fast Facts Carousel"),desc:Le("Data-led slides with a bold hook and swipe cues."),media:{kind:"carousel",slides:[0,1,2].map(n=>`/landing-videos/studio/carousel-facts-${n}.jpg`)}},{id:"carousel-ai101",label:Le("Quick Tip Carousel"),desc:Le("A 5-slide roadmap designed in your brand colors."),media:{kind:"carousel",slides:[0,1,2,3,4].map(n=>`/landing-videos/studio/carousel-ai101-${n}.jpg`)}},{id:"carousel-tip",label:Le("Brand Tip Carousel"),desc:Le("A branded tip series with your logo on every slide."),media:{kind:"carousel",slides:[0,1,2,3].map(n=>`/landing-videos/studio/carousel-tip-${n}.jpg`)}}]}],XCe=[{value:1,suffix:"",label:Le("link to start")},{value:7,suffix:"",label:Le("platforms on autopilot")},{value:5,suffix:"",label:Le("AI video engines")},{value:20,suffix:"",label:Le("viral formats")}],YCe=[{q:Le("What does SpreadOut actually do?"),a:Le("You give it a link (your website, a product page or a blog RSS feed). It plans a weekly content strategy, generates the posts (short videos, long videos, podcasts and carousels) in your brand colors, and publishes them to your connected social accounts on a schedule. Autopilot keeps planning fresh weeks after that.")},{q:Le("Do I need to film, record or design anything?"),a:Le('No. Visuals come from AI video and image generation, stock footage and screenshots of your own site. If you prefer, you can switch to "original content only" and SpreadOut builds posts around the photos and videos you upload.')},{q:Le("Which platforms can it publish to?"),a:Le("Instagram, TikTok, YouTube, LinkedIn, Facebook, X and Threads. Connect the accounts you use and each post is published at the time the strategy picked.")},{q:Le("Will the content look like my brand?"),a:Le("Yes. SpreadOut reads the color scheme from your website and applies it to video motion graphics, captions and carousel designs, so every post looks like it came from your team.")},{q:Le("Won't AI content get repetitive?"),a:Le("That is exactly what the AI Creative Director prevents. Every post gets its own content pillar and viral format (POV, myth vs fact, tier list, story time and more), and each week remembers the angles already used so new weeks stay fresh.")},{q:Le("Can it turn my blog into social posts?"),a:Le("Yes. Paste your RSS feed and every new article becomes posts and videos that open on the article's own cover image with a sharp take on its headline.")},{q:Le("How do credits work?"),a:""},{q:Le("Can I use it from AI agents like Claude or Cursor?"),a:Le("Yes. SpreadOut exposes an MCP server with OAuth, so AI agents can generate videos, plan strategies and schedule posts directly. See the Docs for setup.")},{q:Le("Can I change plans later?"),a:Le("Yes, you can upgrade at any time to get more credits and features.")},{q:Le("Who is responsible for what gets posted?"),a:Le("You are. Review your schedule anytime, edit or pause posts, and make sure content follows each platform's and community's rules.")}];function Sm(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function tle(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*! 94 * GSAP 3.15.0 95 * https://gsap.com 96 * 97 * @license Copyright 2008-2026, GreenSock. All rights reserved. 98 * Subject to the terms at https://gsap.com/standard-license 99 * @author: Jack Doyle, [email protected] 100*/var Hd={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},J4={duration:.5,overwrite:!1,delay:0},zB,Ul,Sa,Oh=1e8,Xs=1/Oh,hI=Math.PI*2,QCe=hI/4,KCe=0,nle=Math.sqrt,ZCe=Math.cos,JCe=Math.sin,Al=function(e){return typeof e=="string"},eo=function(e){return typeof e=="function"},Zm=function(e){return typeof e=="number"},GB=function(e){return typeof e>"u"},k0=function(e){return typeof e=="object"},Wu=function(e){return e!==!1},qB=function(){return typeof window<"u"},OE=function(e){return eo(e)||Al(e)},rle=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},bc=Array.isArray,eNe=/random\([^)]+\)/g,tNe=/,\s*/g,oY=/(?:-?\.?\d|\.)+/gi,ile=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ub=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,t9=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,sle=/[+-]=-?[.\d]+/,nNe=/[^,'"\[\]\s]+/gi,rNe=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Da,$p,fI,$B,Kd={},_M={},ale,ole=function(e){return(_M=sw(e,Kd))&&Ju},HB=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},e5=function(e,t){return!t&&console.warn(e)},lle=function(e,t){return e&&(Kd[e]=t)&&_M&&(_M[e]=t)||Kd},t5=function(){return 0},iNe={suppressEvents:!0,isStart:!0,kill:!1},s6={suppressEvents:!0,kill:!1},sNe={suppressEvents:!0},WB={},r1=[],pI={},cle,jd={},n9={},lY=30,a6=[],XB="",YB=function(e){var t=e[0],r,i;if(k0(t)||eo(t)||(e=[e]),!(r=(t._gsap||{}).harness)){for(i=a6.length;i--&&!a6[i].targetTest(t););r=a6[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new Rle(e[i],r)))||e.splice(i,1);return e},Nv=function(e){return e._gsap||YB(Dh(e))[0]._gsap},ule=function(e,t,r){return(r=e[t])&&eo(r)?e[t]():GB(r)&&e.getAttribute&&e.getAttribute(t)||r}
vendor: 4,152 bytes, line 100
100,Xu=function(e,t){return(e=e.split(",")).forEach(t)||e},ao=function(e){return Math.round(e*1e5)/1e5||0},Oa=function(e){return Math.round(e*1e7)/1e7||0},bb=function(e,t){var r=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),r==="+"?e+i:r==="-"?e-i:r==="*"?e*i:e/i},aNe=function(e,t){for(var r=t.length,i=0;e.indexOf(t[i])<0&&++i<r;);return i<r},SM=function(){var e=r1.length,t=r1.slice(0),r,i;for(pI={},r1.length=0,r=0;r<e;r++)i=t[r],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},QB=function(e){return!!(e._initted||e._startAt||e.add)},dle=function(e,t,r,i){r1.length&&!Ul&&SM(),e.render(t,r,!!(Ul&&t<0&&QB(e))),r1.length&&!Ul&&SM()},hle=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(nNe).length<2?t:Al(e)?e.trim():e},fle=function(e){return e},Zd=function(e,t){for(var r in t)r in e||(e[r]=t[r]);return e},oNe=function(e){return function(t,r){for(var i in r)i in t||i==="duration"&&e||i==="ease"||(t[i]=r[i])}},sw=function(e,t){for(var r in t)e[r]=t[r];return e},cY=function n(e,t){for(var r in t)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=k0(t[r])?n(e[r]||(e[r]={}),t[r]):t[r]);return e},TM=function(e,t){var r={},i;for(i in e)i in t||(r[i]=e[i]);return r},JS=function(e){var t=e.parent||Da,r=e.keyframes?oNe(bc(e.keyframes)):Zd;if(Wu(e.inherit))for(;t;)r(e,t.vars.defaults),t=t.parent||t._dp;return e},lNe=function(e,t){for(var r=e.length,i=r===t.length;i&&r--&&e[r]===t[r];);return r<0},ple=function(e,t,r,i,s){var a=e[i],o;if(s)for(o=t[s];a&&a[s]>o;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[r],e[r]=t),t._next?t._next._prev=t:e[i]=t,t._prev=a,t.parent=t._dp=e,t},B8=function(e,t,r,i){r===void 0&&(r="_first"),i===void 0&&(i="_last");var s=t._prev,a=t._next;s?s._next=a:e[r]===t&&(e[r]=a),a?a._prev=s:e[i]===t&&(e[i]=s),t._next=t._prev=t.parent=null},b1=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Mv=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},cNe=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},mI=function(e,t,r,i){return e._startAt&&(Ul?e._startAt.revert(s6):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},uNe=function n(e){return!e||e._ts&&n(e.parent)},uY=function(e){return e._repeat?aw(e._tTime,e=e.duration()+e._rDelay)*e:0},aw=function(e,t){var r=Math.floor(e=Oa(e/t));return e&&r===e?r-1:r},EM=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},V8=function(e){return e._end=Oa(e._start+(e._tDur/Math.abs(e._ts||e._rts||Xs)||0))},z8=function(e,t){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Oa(r._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),V8(e),r._dirty||Mv(r,e)),e},mle=function(e,t){var r;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(r=EM(e.rawTime(),t),(!t._dur||gT(0,t.totalDuration(),r)-t._tTime>Xs)&&t.render(r,!0)),Mv(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-Xs}},Jp=function(e,t,r,i){return t.parent&&b1(t),t._start=Oa((Zm(r)?r:r||e!==Da?Sh(e,r,t):e._time)+t._delay),t._end=Oa(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),ple(e,t,"_first","_last",e._sort?"_start":0),gI(t)||(e._recent=t),i||mle(e,t),e._ts<0&&z8(e,e._tTime),e},gle=function(e,t){return(Kd.ScrollTrigger||HB("scrollTrigger",t))&&Kd.ScrollTrigger.create(t,e)},Ale=function(e,t,r,i,s){if(ZB(e,t,s),!e._initted)return 1;if(!r&&e._pt&&!Ul&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&cle!==Bd.frame)return r1.push(e),e._lazy=[s,i],1},dNe=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},gI=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},hNe=function(e,t,r,i){var s=e.ratio,a=t<0||!t&&(!e._start&&dNe(e)&&!(!e._initted&&gI(e))||(e._ts<0||e._dp._ts<0)&&!gI(e))?0:1,o=e._rDelay,l=0,u,d,h;if(o&&e._repeat&&(l=gT(0,e._tDur,t),d=aw(l,o),e._yoyo&&d&1&&(a=1-a),d!==aw(e._tTime,o)&&(s=1-a,e.vars.repeatRefresh&&e._initted&&e.invali
vendor: 4,952 bytes, line 100
100date())),a!==s||Ul||i||e._zTime===Xs||!t&&e._zTime){if(!e._initted&&Ale(e,t,i,r,l))return;for(h=e._zTime,e._zTime=t||(r?Xs:0),r||(r=t&&!h),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=l,u=e._pt;u;)u.r(a,u.d),u=u._next;t<0&&mI(e,t,r,!0),e._onUpdate&&!r&&Gd(e,"onUpdate"),l&&e._repeat&&!r&&e.parent&&Gd(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&b1(e,1),!r&&!Ul&&(Gd(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},fNe=function(e,t,r){var i;if(r>t)for(i=e._first;i&&i._start<=r;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=r;){if(i.data==="isPause"&&i._start<t)return i;i=i._prev}},ow=function(e,t,r,i){var s=e._repeat,a=Oa(t)||0,o=e._tTime/e._tDur;return o&&!i&&(e._time*=a/e._dur),e._dur=a,e._tDur=s?s<0?1e10:Oa(a*(s+1)+e._rDelay*s):a,o>0&&!i&&z8(e,e._tTime=e._tDur*o),e.parent&&V8(e),r||Mv(e.parent,e),e},dY=function(e){return e instanceof ju?Mv(e):ow(e,e._dur)},pNe={_start:0,endTime:t5,totalDuration:t5},Sh=function n(e,t,r){var i=e.labels,s=e._recent||pNe,a=e.duration()>=Oh?s.endTime(!1):e._dur,o,l,u;return Al(t)&&(isNaN(t)||t in i)?(l=t.charAt(0),u=t.substr(-1)==="%",o=t.indexOf("="),l==="<"||l===">"?(o>=0&&(t=t.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(o<0?s:r).totalDuration()/100:1)):o<0?(t in i||(i[t]=a),i[t]):(l=parseFloat(t.charAt(o-1)+t.substr(o+1)),u&&r&&(l=l/100*(bc(r)?r[0]:r).totalDuration()),o>1?n(e,t.substr(0,o-1),r)+l:a+l)):t==null?a:+t},e4=function(e,t,r){var i=Zm(t[1]),s=(i?2:1)+(e<2?0:1),a=t[s],o,l;if(i&&(a.duration=t[1]),a.parent=r,e){for(o=a,l=r;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Wu(l.vars.inherit)&&l.parent;a.immediateRender=Wu(o.immediateRender),e<2?a.runBackwards=1:a.startAt=t[s-1]}return new To(t[0],a,t[s+1])},z1=function(e,t){return e||e===0?t(e):t},gT=function(e,t,r){return r<e?e:r>t?t:r},gc=function(e,t){return!Al(e)||!(t=rNe.exec(e))?"":t[1]},mNe=function(e,t,r){return z1(r,function(i){return gT(e,t,i)})},AI=[].slice,xle=function(e,t){return e&&k0(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&k0(e[0]))&&!e.nodeType&&e!==$p},gNe=function(e,t,r){return r===void 0&&(r=[]),e.forEach(function(i){var s;return Al(i)&&!t||xle(i,1)?(s=r).push.apply(s,Dh(i)):r.push(i)})||r},Dh=function(e,t,r){return Sa&&!t&&Sa.selector?Sa.selector(e):Al(e)&&!r&&(fI||!lw())?AI.call((t||$B).querySelectorAll(e),0):bc(e)?gNe(e,r):xle(e)?AI.call(e,0):e?[e]:[]},xI=function(e){return e=Dh(e)[0]||e5("Invalid scope")||{},function(t){var r=e.current||e.nativeElement||e;return Dh(t,r.querySelectorAll?r:r===e?e5("Invalid scope")||$B.createElement("div"):e)}},vle=function(e){return e.sort(function(){return .5-Math.random()})},yle=function(e){if(eo(e))return e;var t=k0(e)?e:{each:e},r=kv(t.ease),i=t.from||0,s=parseFloat(t.base)||0,a={},o=i>0&&i<1,l=isNaN(i)||o,u=t.axis,d=i,h=i;return Al(i)?d=h={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(d=i[0],h=i[1]),function(f,p,g){var A=(g||t).length,x=a[A],b,_,M,T,L,D,P,O,F;if(!x){if(F=t.grid==="auto"?0:(t.grid||[1,Oh])[1],!F){for(P=-Oh;P<(P=g[F++].getBoundingClientRect().left)&&F<A;);F<A&&F--}for(x=a[A]=[],b=l?Math.min(F,A)*d-.5:i%F,_=F===Oh?0:l?A*h/F-.5:i/F|0,P=0,O=Oh,D=0;D<A;D++)M=D%F-b,T=_-(D/F|0),x[D]=L=u?Math.abs(u==="y"?T:M):nle(M*M+T*T),L>P&&(P=L),L<O&&(O=L);i==="random"&&vle(x),x.max=P-O,x.min=O,x.v=A=(parseFloat(t.amount)||parseFloat(t.each)*(F>A?A-1:u?u==="y"?A/F:F:Math.max(F,A/F))||0)*(i==="edges"?-1:1),x.b=A<0?s-A:s,x.u=gc(t.amount||t.each)||0,r=r&&A<0?MNe(r):r}return A=(x[f]-x.min)/x.max||0,Oa(x.b+(r?r(A):A)*x.v)+x.u}},vI=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var i=Oa(Math.round(parseFloat(r)/e)*e*t);return(i-i%1)/t+(Zm(r)?0:gc(r))}},ble=function(e,t){var r=bc(e),i,s;return!r&&k0(e)&&(i=r=e.radius||Oh,e.values?(e=Dh(e.values),(s=!Zm(e[0]))&&(i*=i)):e=vI(e.increment)),z1(t,r?eo(e)?function(a){return s=e(a),Math.abs(s-a)<=i?s:a}:function(a){for(var o=parseFloat(s?a.x:a),l=parseFloat(s?a.y:0),u=Oh,d=0,h=e.length,f,p;h--;)s?(f=e[h].x-o,p=e[h].y-l,f=f*f+p*p):f=Math.abs(e[h]-o),f<u&&(u=f,d=h);return d=!i||u<=i?e[d]:a,s||d===a||Zm(a)?d:d+gc(a)}:vI(e))},wle=function(e,t,r,i){return z1(bc(e)?!t:r===!0?!!(r=0):!i,function(){return bc(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(t-e+r*.99))/r)*r*i)/i})},ANe=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(i){return t.reduce(function(s,a){return a(s)},i)}},xNe=function(e,t){return function(r){return e(parseFloat(r))+(t||gc(r))}},vNe=function(e,t,r){return Sle(e,t,0,1,r)},_le=function(e,t,r){return z1(r,function(i){return e[~~t(i)]})},yNe=function n(e,t,r){var i=t-e;return bc(e)?_le(e,n(0,e.length),t):z1(r,function(s){return(i+(s-e)%i)%i+e})},bNe=function n(e,t,r){var i=t-e,s=i*2;return bc(e)?_le(e,n(0,e.length-1),t):z1(r,function(a){return a=(s+(a-e)%s)%s||
vendor: 4,489 bytes, line 100
1000,e+(a>i?s-a:a)})},n5=function(e){return e.replace(eNe,function(t){var r=t.indexOf("[")+1,i=t.substring(r||7,r?t.indexOf("]"):t.length-1).split(tNe);return wle(r?i:+i[0],r?0:+i[1],+i[2]||1e-5)})},Sle=function(e,t,r,i,s){var a=t-e,o=i-r;return z1(s,function(l){return r+((l-e)/a*o||0)})},wNe=function n(e,t,r,i){var s=isNaN(e+t)?0:function(p){return(1-p)*e+p*t};if(!s){var a=Al(e),o={},l,u,d,h,f;if(r===!0&&(i=1)&&(r=null),a)e={p:e},t={p:t};else if(bc(e)&&!bc(t)){for(d=[],h=e.length,f=h-2,u=1;u<h;u++)d.push(n(e[u-1],e[u]));h--,s=function(g){g*=h;var A=Math.min(f,~~g);return d[A](g-A)},r=t}else i||(e=sw(bc(e)?[]:{},e));if(!d){for(l in t)KB.call(o,e,l,"get",t[l]);s=function(g){return tV(g,o)||(a?e.p:e)}}}return z1(r,s)},hY=function(e,t,r){var i=e.labels,s=Oh,a,o,l;for(a in i)o=i[a]-t,o<0==!!r&&o&&s>(o=Math.abs(o))&&(l=a,s=o);return l},Gd=function(e,t,r){var i=e.vars,s=i[t],a=Sa,o=e._ctx,l,u,d;if(s)return l=i[t+"Params"],u=i.callbackScope||e,r&&r1.length&&SM(),o&&(Sa=o),d=l?s.apply(u,l):s.call(u),Sa=a,d},SS=function(e){return b1(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Ul),e.progress()<1&&Gd(e,"onInterrupt"),e},db,Tle=[],Ele=function(e){if(e)if(e=!e.name&&e.default||e,qB()||e.headless){var t=e.name,r=eo(e),i=t&&!r&&e.init?function(){this._props=[]}:e,s={init:t5,render:tV,add:KB,kill:UNe,modifier:FNe,rawVars:0},a={targetTest:0,get:0,getSetter:eV,aliases:{},register:0};if(lw(),e!==i){if(jd[t])return;Zd(i,Zd(TM(e,s),a)),sw(i.prototype,sw(s,TM(e,a))),jd[i.prop=t]=i,e.targetTest&&(a6.push(i),WB[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}lle(t,i),e.register&&e.register(Ju,i,Yu)}else Tle.push(e)},$s=255,TS={aqua:[0,$s,$s],lime:[0,$s,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,$s],navy:[0,0,128],white:[$s,$s,$s],olive:[128,128,0],yellow:[$s,$s,0],orange:[$s,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[$s,0,0],pink:[$s,192,203],cyan:[0,$s,$s],transparent:[$s,$s,$s,0]},r9=function(e,t,r){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(r-t)*e*6:e<.5?r:e*3<2?t+(r-t)*(2/3-e)*6:t)*$s+.5|0},Cle=function(e,t,r){var i=e?Zm(e)?[e>>16,e>>8&$s,e&$s]:0:TS.black,s,a,o,l,u,d,h,f,p,g;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),TS[e])i=TS[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e="#"+s+s+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&$s,i&$s,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&$s,e&$s]}else if(e.substr(0,3)==="hsl"){if(i=g=e.match(oY),!t)l=+i[0]%360/360,u=+i[1]/100,d=+i[2]/100,a=d<=.5?d*(u+1):d+u-d*u,s=d*2-a,i.length>3&&(i[3]*=1),i[0]=r9(l+1/3,s,a),i[1]=r9(l,s,a),i[2]=r9(l-1/3,s,a);else if(~e.indexOf("="))return i=e.match(ile),r&&i.length<4&&(i[3]=1),i}else i=e.match(oY)||TS.transparent;i=i.map(Number)}return t&&!g&&(s=i[0]/$s,a=i[1]/$s,o=i[2]/$s,h=Math.max(s,a,o),f=Math.min(s,a,o),d=(h+f)/2,h===f?l=u=0:(p=h-f,u=d>.5?p/(2-h-f):p/(h+f),l=h===s?(a-o)/p+(a<o?6:0):h===a?(o-s)/p+2:(s-a)/p+4,l*=60),i[0]=~~(l+.5),i[1]=~~(u*100+.5),i[2]=~~(d*100+.5)),r&&i.length<4&&(i[3]=1),i},Nle=function(e){var t=[],r=[],i=-1;return e.split(i1).forEach(function(s){var a=s.match(ub)||[];t.push.apply(t,a),r.push(i+=a.length+1)}),t.c=r,t},fY=function(e,t,r){var i="",s=(e+i).match(i1),a=t?"hsla(":"rgba(",o=0,l,u,d,h;if(!s)return e;if(s=s.map(function(f){return(f=Cle(f,t,1))&&a+(t?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),r&&(d=Nle(e),l=r.c,l.join(i)!==d.c.join(i)))for(u=e.replace(i1,"1").split(ub),h=u.length-1;o<h;o++)i+=u[o]+(~l.indexOf(o)?s.shift()||a+"0,0,0,0)":(d.length?d:s.length?s:r).shift());if(!u)for(u=e.split(i1),h=u.length-1;o<h;o++)i+=u[o]+s[o];return i+u[h]},i1=(function(){var n="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in TS)n+="|"+e+"\\b";return new RegExp(n+")","gi")})(),_Ne=/hsl[a]?\(/,Mle=function(e){var t=e.join(" "),r;if(i1.lastIndex=0,i1.test(t))return r=_Ne.test(t),e[1]=fY(e[1],r),e[0]=fY(e[0],r,Nle(e[1])),!0},r5,Bd=(function(){var n=Date.now,e=500,t=33,r=n(),i=r,s=1e3/240,a=s,o=[],l,u,d,h,f,p,g=function A(x){var b=n()-i,_=x===!0,M,T,L,D;if((b>e||b<0)&&(r+=b-t),i+=b,L=i-r,M=L-a,(M>0||_)&&(D=++h.frame,f=L-h.time*1e3,h.time=L=L/1e3,a+=M+(M>=s?4:s-M),T=1),_||(l=u(A)),T)for(p=0;p<o.length;p++)o[p](L,f,D,x)};return h={time:0,frame:0,tick:function(){g(!0)},deltaRatio:function(x){return f/(1e3/(x||60))},wake:function(){ale&&(!fI&&qB()&&($p=fI=window,$B=$p.document||{}
vendor: 7,113 bytes, line 100
100,Kd.gsap=Ju,($p.gsapVersions||($p.gsapVersions=[])).push(Ju.version),ole(_M||$p.GreenSockGlobals||!$p.gsap&&$p||{}),Tle.forEach(Ele)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&h.sleep(),u=d||function(x){return setTimeout(x,a-h.time*1e3+1|0)},r5=1,g(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(l),r5=0,u=t5},lagSmoothing:function(x,b){e=x||1/0,t=Math.min(b||33,e)},fps:function(x){s=1e3/(x||240),a=h.time*1e3+s},add:function(x,b,_){var M=b?function(T,L,D,P){x(T,L,D,P),h.remove(M)}:x;return h.remove(x),o[_?"unshift":"push"](M),lw(),M},remove:function(x,b){~(b=o.indexOf(x))&&o.splice(b,1)&&p>=b&&p--},_listeners:o},h})(),lw=function(){return!r5&&Bd.wake()},Gi={},SNe=/^[\d.\-M][\d.\-,\s]/,TNe=/["']/g,ENe=function(e){for(var t={},r=e.substr(1,e.length-3).split(":"),i=r[0],s=1,a=r.length,o,l,u;s<a;s++)l=r[s],o=s!==a-1?l.lastIndexOf(","):l.length,u=l.substr(0,o),t[i]=isNaN(u)?u.replace(TNe,"").trim():+u,i=l.substr(o+1).trim();return t},CNe=function(e){var t=e.indexOf("(")+1,r=e.indexOf(")"),i=e.indexOf("(",t);return e.substring(t,~i&&i<r?e.indexOf(")",r+1):r)},NNe=function(e){var t=(e+"").split("("),r=Gi[t[0]];return r&&t.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[ENe(t[1])]:CNe(e).split(",").map(hle)):Gi._CE&&SNe.test(e)?Gi._CE("",e):r},MNe=function(e){return function(t){return 1-e(1-t)}},kv=function(e,t){return e&&(eo(e)?e:Gi[e]||NNe(e))||t},vy=function(e,t,r,i){r===void 0&&(r=function(l){return 1-t(1-l)}),i===void 0&&(i=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var s={easeIn:t,easeOut:r,easeInOut:i},a;return Xu(e,function(o){Gi[o]=Kd[o]=s,Gi[a=o.toLowerCase()]=r;for(var l in s)Gi[a+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=Gi[o+"."+l]=s[l]}),s},kle=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},i9=function n(e,t,r){var i=t>=1?t:1,s=(r||(e?.3:.45))/(t<1?t:1),a=s/hI*(Math.asin(1/i)||0),o=function(d){return d===1?1:i*Math.pow(2,-10*d)*JCe((d-a)*s)+1},l=e==="out"?o:e==="in"?function(u){return 1-o(1-u)}:kle(o);return s=hI/s,l.config=function(u,d){return n(e,u,d)},l},s9=function n(e,t){t===void 0&&(t=1.70158);var r=function(a){return a?--a*a*((t+1)*a+t)+1:0},i=e==="out"?r:e==="in"?function(s){return 1-r(1-s)}:kle(r);return i.config=function(s){return n(e,s)},i};Xu("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;vy(n+",Power"+(t-1),e?function(r){return Math.pow(r,t)}:function(r){return r},function(r){return 1-Math.pow(1-r,t)},function(r){return r<.5?Math.pow(r*2,t)/2:1-Math.pow((1-r)*2,t)/2})});Gi.Linear.easeNone=Gi.none=Gi.Linear.easeIn;vy("Elastic",i9("in"),i9("out"),i9());(function(n,e){var t=1/e,r=2*t,i=2.5*t,s=function(o){return o<t?n*o*o:o<r?n*Math.pow(o-1.5/e,2)+.75:o<i?n*(o-=2.25/e)*o+.9375:n*Math.pow(o-2.625/e,2)+.984375};vy("Bounce",function(a){return 1-s(1-a)},s)})(7.5625,2.75);vy("Expo",function(n){return Math.pow(2,10*(n-1))*n+n*n*n*n*n*n*(1-n)});vy("Circ",function(n){return-(nle(1-n*n)-1)});vy("Sine",function(n){return n===1?1:-ZCe(n*QCe)+1});vy("Back",s9("in"),s9("out"),s9());Gi.SteppedEase=Gi.steps=Kd.SteppedEase={config:function(e,t){e===void 0&&(e=1);var r=1/e,i=e+(t?0:1),s=t?1:0,a=1-Xs;return function(o){return((i*gT(0,a,o)|0)+s)*r}}};J4.ease=Gi["quad.out"];Xu("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(n){return XB+=n+","+n+"Params,"});var Rle=function(e,t){this.id=KCe++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:ule,this.set=t?t.getSetter:eV},i5=(function(){function n(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,ow(this,+t.duration,1,1),this.data=t.data,Sa&&(this._ctx=Sa,Sa.data.push(this)),r5||Bd.wake()}var e=n.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,ow(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,i){if(lw(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(z8(this,r),!s._dp||s.parent||mle(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Jp(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===Xs||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),dle(this,r,i)),this},e.time=function(r,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+uY(this))%(this._dur+this._rDelay)||(r?this._dur:0),i):this._time},e.totalProgress=function(r,i){return arguments.length?this.totalTime(this.totalDuration()*r,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+uY(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*s,i):this._repeat?aw(this._tTime,s)+1:1},e.timeScale=function(r,i){if(!arguments.length)return this._rts===-Xs?0:this._rts;if(this._rts===r)return this;var s=this.parent&&this._ts?EM(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Xs?0:this._rts,this.totalTime(gT(-Math.abs(this._delay),this.totalDuration(),s),i!==!1),V8(this),cNe(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(lw(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Xs&&(this._tTime-=Xs)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Oa(r);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Jp(i,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Wu(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var i=this.parent||this._dp;return i?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?EM(i.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=sNe);var i=Ul;return Ul=r,QB(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Ul=i,this},e.globalTime=function(r){for(var i=this,s=arguments.length?r:i.rawTime();i;
vendor: 19,068 bytes, line 100
100)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(r):s},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,dY(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var i=this._time;return this._rDelay=r,dY(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,i){return this.totalTime(Sh(this,r),Wu(i))},e.restart=function(r,i){return this.play().totalTime(r?-this._delay:0,Wu(i)),this._dur||(this._zTime=-Xs),this},e.play=function(r,i){return r!=null&&this.seek(r,i),this.reversed(!1).paused(!1)},e.reverse=function(r,i){return r!=null&&this.seek(r||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(r,i){return r!=null&&this.seek(r,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Xs:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Xs,this},e.isActive=function(){var r=this.parent||this._dp,i=this._start,s;return!!(!r||this._ts&&this._initted&&r.isActive()&&(s=r.rawTime(!0))>=i&&s<this.endTime(!0)-Xs)},e.eventCallback=function(r,i,s){var a=this.vars;return arguments.length>1?(i?(a[r]=i,s&&(a[r+"Params"]=s),r==="onUpdate"&&(this._onUpdate=i)):delete a[r],this):a[r]},e.then=function(r){var i=this,s=i._prom;return new Promise(function(a){var o=eo(r)?r:fle,l=function(){var d=i.then;i.then=null,s&&s(),eo(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=d),a(o),i.then=d};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},e.kill=function(){SS(this)},n})();Zd(i5.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Xs,_prom:0,_ps:!1,_rts:1});var ju=(function(n){tle(e,n);function e(r,i){var s;return r===void 0&&(r={}),s=n.call(this,r)||this,s.labels={},s.smoothChildTiming=!!r.smoothChildTiming,s.autoRemoveChildren=!!r.autoRemoveChildren,s._sort=Wu(r.sortChildren),Da&&Jp(r.parent||Da,Sm(s),i),r.reversed&&s.reverse(),r.paused&&s.paused(!0),r.scrollTrigger&&gle(Sm(s),r.scrollTrigger),s}var t=e.prototype;return t.to=function(i,s,a){return e4(0,arguments,this),this},t.from=function(i,s,a){return e4(1,arguments,this),this},t.fromTo=function(i,s,a,o){return e4(2,arguments,this),this},t.set=function(i,s,a){return s.duration=0,s.parent=this,JS(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new To(i,s,Sh(this,a),1),this},t.call=function(i,s,a){return Jp(this,To.delayedCall(0,i,s),a)},t.staggerTo=function(i,s,a,o,l,u,d){return a.duration=s,a.stagger=a.stagger||o,a.onComplete=u,a.onCompleteParams=d,a.parent=this,new To(i,a,Sh(this,l)),this},t.staggerFrom=function(i,s,a,o,l,u,d){return a.runBackwards=1,JS(a).immediateRender=Wu(a.immediateRender),this.staggerTo(i,s,a,o,l,u,d)},t.staggerFromTo=function(i,s,a,o,l,u,d,h){return o.startAt=a,JS(o).immediateRender=Wu(o.immediateRender),this.staggerTo(i,s,o,l,u,d,h)},t.render=function(i,s,a){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,d=i<=0?0:Oa(i),h=this._zTime<0!=i<0&&(this._initted||!u),f,p,g,A,x,b,_,M,T,L,D,P;if(this!==Da&&d>l&&i>=0&&(d=l),d!==this._tTime||a||h){if(o!==this._time&&u&&(d+=this._time-o,i+=this._time-o),f=d,T=this._start,M=this._ts,b=!M,h&&(u||(o=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(D=this._yoyo,x=u+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(x*100+i,s,a);if(f=Oa(d%x),d===l?(A=this._repeat,f=u):(L=Oa(d/x),A=~~L,A&&A===L&&(f=u,A--),f>u&&(f=u)),L=aw(this._tTime,x),!o&&this._tTime&&L!==A&&this._tTime-L*x-this._dur<=0&&(L=A),D&&A&1&&(f=u-f,P=1),A!==L&&!this._lock){var O=D&&L&1,F=O===(D&&A&1);if(A<L&&(O=!O),o=O?0:d%u?u:d,this._lock=1,this.render(o||(P?0:Oa(A*x)),s,!u)._lock=0,this._tTime=d,!s&&this.parent&&Gd(this,"onRepeat"),this.vars.repeatRefresh&&!P&&(this.invalidate()._lock=1,L=A),o&&o!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,l=this._tDur,F&&(this._lock=2,o=O?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!P&&this.invalidate()),this._lock=0,!this._ts&&!b)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=fNe(this,Oa(o),Oa(f)),_&&(d-=f-(f=_._start))),this._tTime=d,this._time=f,this._act=!!M,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,o=0),!o&&d&&u&&!s&&!L&&(Gd(this,"onStart"),this._tTime!==d))return this;if(f>=o&&i>=0)for(p=this._first;p;){if(g=p._next,(p._act||f>=p._start)&&p._ts&&_!==p){if(p.parent!==this)return this.render(i,s,a);if(p.render(p._ts>0?(f-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(f-p._start)*p._ts,s,a),f!==this._time||!this._ts&&!b){_=0,g&&(d+=this._zTime=-Xs);break}}p=g}else{p=this._last;for(var U=i<0?i:f;p;){if(g=p._prev,(p._act||U<=p._end)&&p._ts&&_!==p){if(p.parent!==this)return this.render(i,s,a);if(p.render(p._ts>0?(U-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(U-p._start)*p._ts,s,a||Ul&&QB(p)),f!==this._time||!this._ts&&!b){_=0,g&&(d+=this._zTime=U?-Xs:Xs);break}}p=g}}if(_&&!s&&(this.pause(),_.render(f>=o?0:-Xs)._zTime=f>=o?1:-1,this._ts))return this._start=T,V8(this),this.render(i,s,a);this._onUpdate&&!s&&Gd(this,"onUpdate",!0),(d===l&&this._tTime>=this.totalDuration()||!d&&o)&&(T===this._start||Math.abs(M)!==Math.abs(this._ts))&&(this._lock||((i||!u)&&(d===l&&this._ts>0||!d&&this._ts<0)&&b1(this,1),!s&&!(i<0&&!o)&&(d||o||!l)&&(Gd(this,d===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(d<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(i,s){var a=this;if(Zm(s)||(s=Sh(this,s,i)),!(i instanceof i5)){if(bc(i))return i.forEach(function(o){return a.add(o,s)}),this;if(Al(i))return this.addLabel(i,s);if(eo(i))i=To.delayedCall(0,i);else return this}return this!==i?Jp(this,i,s):this},t.getChildren=function(i,s,a,o){i===void 0&&(i=!0),s===void 0&&(s=!0),a===void 0&&(a=!0),o===void 0&&(o=-Oh);for(var l=[],u=this._first;u;)u._start>=o&&(u instanceof To?s&&l.push(u):(a&&l.push(u),i&&l.push.apply(l,u.getChildren(!0,s,a)))),u=u._next;return l},t.getById=function(i){for(var s=this.getChildren(1,1,1),a=s.length;a--;)if(s[a].vars.id===i)return s[a]},t.remove=function(i){return Al(i)?this.removeLabel(i):eo(i)?this.killTweensOf(i):(i.parent===this&&B8(this,i),i===this._recent&&(this._recent=this._last),Mv(this))},t.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Oa(Bd.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),n.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},t.addLabel=function(i,s){return this.labels[i]=Sh(this,s),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,s,a){var o=To.delayedCall(0,s||t5,a);return o.data="isPause",this._hasPause=1,Jp(this,o,Sh(this,i))},t.removePause=function(i){var s=this._first;for(i=Sh(this,i);s;)s._start===i&&s.data==="isPause"&&b1(s),s=s._next},t.killTweensOf=function(i,s,a){for(var o=this.getTweensOf(i,a),l=o.length;l--;)VA!==o[l]&&o[l].kill(i,s);return this},t.getTweensOf=function(i,s){for(var a=[],o=Dh(i),l=this._first,u=Zm(s),d;l;)l instanceof To?aNe(l._targets,o)&&(u?(!VA||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&a.push(l):(d=l.getTweensOf(o,s)).length&&a.push.apply(a,d),l=l._next;return a},t.tweenTo=function(i,s){s=s||{};var a=this,o=Sh(a,i),l=s,u=l.startAt,d=l.onStart,h=l.onStartParams,f=l.immediateRender,p,g=To.to(a,Zd({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:s.duration||Math.abs((o-(u&&"time"in u?u.time:a._time))/a.timeScale())||Xs,onStart:function(){if(a.pause(),!p){var x=s.duration||Math.abs((o-(u&&"time"in u?u.time:a._time))/a.timeScale());g._dur!==x&&ow(g,x,0,1).render(g._time,!0,!0),p=1}d&&d.apply(g,h||[])}},s));return f?g.render(0):g},t.tweenFromTo=function(i,s,a){return this.tweenTo(s,Zd({startAt:{time:Sh(this,i)}},a))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),hY(this,Sh(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),hY(this,Sh(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+Xs)},t.shiftChildren=function(i,s,a){a===void 0&&(a=0);var o=this._first,l=this.labels,u;for(i=Oa(i);o;)o._start>=a&&(o._start+=i,o._end+=i),o=o._next;if(s)for(u in l)l[u]>=a&&(l[u]+=i);return Mv(this)},t.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return n.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,a;s;)a=s._next,this.remove(s),s=a;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Mv(this)},t.totalDuration=function(i){var s=0,a=this,o=a._last,l=Oh,u,d,h;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-i:i));if(a._dirty){for(h=a.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),d=o._start,d>l&&a._sort&&o._ts&&!a._lock?(a._lock=1,Jp(a,o,d-o._delay,1)._lock=0):l=d,d<0&&o._ts&&(s-=d,(!h&&!a._dp||h&&h.smoothChildTiming)&&(a._start+=Oa(d/a._ts),a._time-=d,a._tTime-=d),a.shiftChildren(-d,!1,-1/0),l=0),o._end>s&&o._ts&&(s=o._end),o=u;ow(a,a===Da&&a._time>s?a._time:s,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(i){if(Da._ts&&(dle(Da,EM(i,Da)),cle=Bd.frame),Bd.frame>=lY){lY+=Hd.autoSleep||120;var s=Da._first;if((!s||!s._ts)&&Hd.autoSleep&&Bd._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Bd.sleep()}}},e})(i5);Zd(ju.prototype,{_lock:0,_hasPause:0,_forcing:0});var kNe=function(e,t,r,i,s,a,o){var l=new Yu(this._pt,e,t,0,1,Ile,null,s),u=0,d=0,h,f,p,g,A,x,b,_;for(l.b=r,l.e=i,r+="",i+="",(b=~i.indexOf("random("))&&(i=n5(i)),a&&(_=[r,i],a(_,e,t),r=_[0],i=_[1]),f=r.match(t9)||[];h=t9.exec(i);)g=h[0],A=i.substring(u,h.index),p?p=(p+1)%5:A.substr(-5)==="rgba("&&(p=1),g!==f[d++]&&(x=parseFloat(f[d-1])||0,l._pt={_next:l._pt,p:A||d===1?A:",",s:x,c:g.charAt(1)==="="?bb(x,g)-x:parseFloat(g)-x,m:p&&p<4?Math.round:0},u=t9.lastIndex);return l.c=u<i.length?i.substring(u,i.length):"",l.fp=o,(sle.test(i)||b)&&(l.e=0),this._pt=l,l},KB=function(e,t,r,i,s,a,o,l,u,d){eo(i)&&(i=i(s||0,e,a));var h=e[t],f=r!=="get"?r:eo(h)?u?e[t.indexOf("set")||!eo(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():h,p=eo(h)?u?DNe:Dle:JB,g;if(Al(i)&&(~i.indexOf("random(")&&(i=n5(i)),i.charAt(1)==="="&&(g=bb(f,i)+(gc(f)||0),(g||g===0)&&(i=g))),!d||f!==i||yI)return!isNaN(f*i)&&i!==""?(g=new Yu(this._pt,e,t,+f||0,i-(f||0),typeof h=="boolean"?INe:jle,0,p),u&&(g.fp=u),o&&g.modifier(o,this,e),this._pt=g):(!h&&!(t in e)&&HB(t,i),kNe.call(this,e,t,f,i,p,l||Hd.stringFilter,u))},RNe=function(e,t,r,i,s){if(eo(e)&&(e=t4(e,s,t,r,i)),!k0(e)||e.style&&e.nodeType||bc(e)||rle(e))return Al(e)?t4(e,s,t,r,i):e;var a={},o;for(o in e)a[o]=t4(e[o],s,t,r,i);return a},Ple=function(e,t,r,i,s,a){var o,l,u,d;if(jd[e]&&(o=new jd[e]).init(s,o.rawVars?t[e]:RNe(t[e],i,s,a,r),r,i,a)!==!1&&(r._pt=l=new Yu(r._pt,s,e,0,1,o.render,o,0,o.priority),r!==db))for(u=r._ptLookup[r._targets.indexOf(s)],d=o._props.length;d--;)u[o._props[d]]=l;return o},VA,yI,ZB=function n(e,t,r){var i=e.vars,s=i.ease,a=i.startAt,o=i.immediateRender,l=i.lazy,u=i.onUpdate,d=i.runBackwards,h=i.yoyoEase,f=i.keyframes,p=i.autoRevert,g=e._dur,A=e._startAt,x=e._targets,b=e.parent,_=b&&b.data==="nested"?b.vars.targets:x,M=e._overwrite==="auto"&&!zB,T=e.timeline,L=i.easeReverse||h,D,P,O,F,U,B,z,H,X,W,J,ee,ae;if(T&&(!f||!s)&&(s="none"),e._ease=kv(s,J4.ease),e._rEase=L&&(kv(L)||e._ease),e._from=!T&&!!i.runBackwards,e._from&&(e.ratio=1),!T||f&&!i.stagger){if(H=x[0]?Nv(x[0]).harness:0,ee=H&&i[H.prop],D=TM(i,WB),A&&(A._zTime<0&&A.progress(1),t<0&&d&&o&&!p?A.render(-1,!0):A.revert(d&&g?s6:iNe),A._lazy=0),a){if(b1(e._startAt=To.set(x,Zd({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!A&&Wu(l),startAt:null,delay:0,onUpdate:u&&function(){return Gd(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Ul||!o&&!p)&&e._startAt.revert(s6),o&&g&&t<=0&&r<=0){t&&(e._zTime=t);return}}else if(d&&g&&!A){if(t&&(o=!1),O=Zd({overwrite:!1,data:"isFromStart",lazy:o&&!A&&Wu(l),immediateRender:o,stagger:0,parent:b},D),ee&&(O[H.prop]=ee),b1(e._startAt=To.set(x,O)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Ul?e._startAt.revert(s6):e._startAt.render(-1,!0)),e._zTime=t,!o)n(e._startAt,Xs,Xs);else if(!t)return}for(e._pt=e._ptCache=0,l=g&&Wu(l)||l&&!g,P=0;P<x.length;P++){if(U=x[P],z=U._gsap||YB(x)[P]._gsap,e._ptLookup[P]=W={},pI[z.id]&&r1.length&&SM(),J=_===x?P:_.indexOf(U),H&&(X=new H).init(U,ee||D,e,J,_)!==!1&&(e._pt=F=new Yu(e._pt,U,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(le){W[le]=F}),X.priority&&(B=1)),!H||ee)for(O in D)jd[O]&&(X=Ple(O,D,e,J,U,_))?X.priority&&(B=1):W[O]=F=KB.call(e,U,O,"get",D[O],J,_,0,i.stringFilter);e._op&&e._op[P]&&e.kill(U,e._op[P]),M&&e._pt&&(VA=e,Da.killTweensOf(U,W,e.globalTime(t)),ae=!e.parent,VA=0),e._pt&&l&&(pI[z.id]=1)}B&&Fle(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!ae,f&&t<=0&&T.render(Oh,!0,!0)},PNe=function(e,t,r,i,s,a,o,l){var u=(e._pt&&e._ptCache||(e._ptCache={}))[t],d,h,f,p;if(!u)for(u=e._ptCache[t]=[],f=e._ptLookup,p=e._targets.length;p--;){if(d=f[p][t],d&&d.d&&d.d._pt)for(d=d.d._pt;d&&d.p!==t&&d.fp!==t;)d=d._next;if(!d)return yI=1,e.vars[t]="+=0",ZB(e,o),yI=0,l?e5(t+" not eligible for reset. Try splitting into individual properties"):1;u.push(d)}for(p=u.length;p--;)h=u[p],d=h._pt||h,d.s=(i||i===0)&&!s?i:d.s+(i||0)+a*d.c,d.c=r-d.s,h.e&&(h.e=ao(r)+gc(h.e)),h.b&&(h.b=d.s+gc(h.b))},LNe=function(e,t){var r=e[0]?Nv(e[0]).harness:0,i=r&&r.aliases,s,a,o,l;if(!i)return t;s=sw({},t);for(a in i)if(a in s)for(l=i[a].split(","),o=l.length;o--;)s[l[o]]=s[a];return s},ONe=function(e,t,r,i){var s=t.ease||i||"power1.inOut",a,o;if(bc(t))o=r[e]||(r[e]=[]),t.forEach(function(l,u){return o.push({t:u/(t.length-1)*100,v:l,e:s})});else for(a in t)o=r[a]||(r[a]=[]),a==="ease"||o.push({t:parseFloat(e),v:t[a],e:s})},t4=function(e,t,r,i,s){return eo(e)?e.call(t,r,i,s):Al(e)&&~e.indexOf("random(")?n5(e):e},Lle=XB+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Ole={};Xu(Lle+",id,stagger,delay,duration,paused,scrollTrigger",function(n){return Ole[n]=1});var To=(function(n){tle(e,n);function e(r,i,s,a){var o;typeof i=="number"&&(s.duration=i,i=s,s=null),o=n.call(this,a?i:JS(i))||this;var l=o.vars,u=l.duration,d=l.delay,h=l.immediateRender,f=l.stagger,p=l.overwrite,g=l.keyframes,A=l.defaults,x=l.scrollTrigger,b=i.parent||Da,_=(bc(r)||rle(r)?Zm(r[0]):"length"in i)?[r]:Dh(r),M,T,L,D,P,O,F,U;if(o._targets=_.length?YB(_):e5("GSAP target "+r+" not found. https://gsap.com",!Hd.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=p,g||f||OE(u)||OE(d)){i=o.vars;var B=i.easeReverse||i.yoyoEase;if(M=o.timeline=new ju({data:"nested",defaults:A||{},targets:b&&b.data==="nested"?b.vars.targets:_}),M.kill(),M.parent=M._dp=Sm(o),M._start=0,f||OE(u)||OE(d)){if(D=_.length,F=f&&yle(f),k0(f))for(P in f)~Lle.indexOf(P)&&(U||(U={}),U[P]=f[P]);for(T=0;T<D;T++)L=TM(i,Ole),L.stagger=0,B&&(L.easeReverse=B),U&&sw(L,U),O=_[T],L.duration=+t4(u,Sm(o),T,O,_),L.delay=(+t4(d,Sm(o),T,O,_)||0)-o._delay,!f&&D===1&&L.delay&&(o._delay=d=L.delay,o._start+=d,L.delay=0),M.to(O,L,F?F(T,O,_):0),M._ease=Gi.none;M.duration()?u=d=0:o.timeline=0}else if(g){JS(Zd(M.vars.defaults,{ease:"none"})),M._ease=kv(g.ease||i.ease||"none");var z=0,H,X,W;if(bc(g))g.forEach(function(J){return M.to(_,J,">")}),M.duration();else{L={};for(P in g)P==="ease"||P==="easeEach"||ONe(P,g[P],L,g.easeEach);for(P in L)for(H=L[P].sort(function(J,ee){return J.t-ee.t}),z=0,T=0;T<H.length;T++)X=H[T],W={ease:X.e,duration:(X.t-(T?H[T-1].t:0))/100*u},W[P]=X.v,M.to(_,W,z),z+=W.duration;M.duration()<u&&M.to({},{duration:u-M.duration()})}}u||o.duration(u=M.duration())}else o.timeline=0;return p===!0&&!zB&&(VA=Sm(o),Da.killTweensOf(_),VA=0),Jp(b,Sm(o),s),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(h||!u&&!g&&o._start===Oa(b._time)&&Wu(h)&&uNe(Sm(o))&&b.data!=="nested")&&(o._tTime=-Xs,o.render(Math.max(0,-d)||0)),x&&gle(Sm(o),x),o}var t=e.prototype;return t.render=function(i,s,a){var o=this._time,l=this._tDur,u=this._dur,d=i<0,h=i>l-Xs&&!d?l:i<Xs?0:i,f,p,g,A,x,b,_,M;if(!u)hNe(this,i,s,a);else if(h!==this._tTime||!i||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==d||this._lazy){if(f=h,M=this.timeline,this._repeat){if(A=u+this._rDelay,this._repeat<-1&&d)return this.totalTime(A*100+i,s,a);if(f=Oa(h%A),h===l?(g=this._repeat,f=u):(x=Oa(h/A),g=~~x,g&&g===x?(f=u,g--):f>u&&(f=u)),b=this._yoyo&&g&1,b&&(f=u-f),x=aw(this._tTime,A),f===o&&!a&&this._initted&&g===x)return this._tTime=h,this;g!==x&&this.vars.repeatRefresh&&!b&&!this._lock&&f!==A&&this._initted&&(this._lock=a=1,this.render(Oa(A*g),!0).invalidate()._lock=0)}if(!this._initted){if(Ale(this,d?i:f,a,s,h))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&g!==x))return this;if(u!==this._dur)return this.render(i,s,a)}if(this._rEase){var T=f<o;if(T!==this._inv){var L=T?o:u-o;this._inv=T,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=o,this._invRecip=L?(T?-1:1)/L:0,this._invScale=T?-this.ratio:1-this.ratio,this._invEase=T?this._rEase:this._ease}this.ratio=_=this._invRatio+this._invScale*this._invEase((f-this._invTime)*this._invRecip)}else this.ratio=_=this._ease(f/u);if(this._from&&(this.ratio=_=1-_),this._tTime=h,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),!o&&h&&!s&&!x&&(Gd(this,"onStart"),this._tTime!==h))return this;for(p=this._pt;p;)p.r(_,p.d),p=p._next;M&&M.render(i<0?i:M._dur*M._ease(f/this._dur),s,a)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(d&&mI(this,i,s,a),Gd(this,"onUpdate")),this._repeat&&g!==x&&this.vars.onRepeat&&!s&&this.parent&&Gd(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(d&&!this._onUpdate&&mI(this,i,!0,!0),(i||!u)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&b1(this,1),!s&&!(d&&!o)&&(h||o||b)&&(Gd(this,h===l?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),n.prototype.invalidate.call(this,i)},t.resetTo=function(i,s,a,o,l){r5||Bd.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),d;return this._initted||ZB(this,u),d=this._ease(u/this._dur),PNe(this,i,s,a,o,d,u,l)?this.resetTo(i,s,a,o,1):(z8(this,0),this.parent||ple(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?SS(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Ul),this;if(this.timeline){var a=this.timeline.totalDuration();
vendor: 9,974 bytes, line 100
100return this.timeline.killTweensOf(i,s,VA&&VA.vars.overwrite!==!0)._first||SS(this),this.parent&&a!==this.timeline.totalDuration()&&ow(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,l=i?Dh(i):o,u=this._ptLookup,d=this._pt,h,f,p,g,A,x,b;if((!s||s==="all")&&lNe(o,l))return s==="all"&&(this._pt=0),SS(this);for(h=this._op=this._op||[],s!=="all"&&(Al(s)&&(A={},Xu(s,function(_){return A[_]=1}),s=A),s=LNe(o,s)),b=o.length;b--;)if(~l.indexOf(o[b])){f=u[b],s==="all"?(h[b]=s,g=f,p={}):(p=h[b]=h[b]||{},g=s);for(A in g)x=f&&f[A],x&&((!("kill"in x.d)||x.d.kill(A)===!0)&&B8(this,x,"_pt"),delete f[A]),p!=="all"&&(p[A]=1)}return this._initted&&!this._pt&&d&&SS(this),this},e.to=function(i,s){return new e(i,s,arguments[2])},e.from=function(i,s){return e4(1,arguments)},e.delayedCall=function(i,s,a,o){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},e.fromTo=function(i,s,a){return e4(2,arguments)},e.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new e(i,s)},e.killTweensOf=function(i,s,a){return Da.killTweensOf(i,s,a)},e})(i5);Zd(To.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Xu("staggerTo,staggerFrom,staggerFromTo",function(n){To[n]=function(){var e=new ju,t=AI.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var JB=function(e,t,r){return e[t]=r},Dle=function(e,t,r){return e[t](r)},DNe=function(e,t,r,i){return e[t](i.fp,r)},jNe=function(e,t,r){return e.setAttribute(t,r)},eV=function(e,t){return eo(e[t])?Dle:GB(e[t])&&e.setAttribute?jNe:JB},jle=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},INe=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Ile=function(e,t){var r=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+i,r=r._next;i+=t.c}t.set(t.t,t.p,i,t)},tV=function(e,t){for(var r=t._pt;r;)r.r(e,r.d),r=r._next},FNe=function(e,t,r,i){for(var s=this._pt,a;s;)a=s._next,s.p===i&&s.modifier(e,t,r),s=a},UNe=function(e){for(var t=this._pt,r,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?B8(this,t,"_pt"):t.dep||(r=1),t=i;return!r},BNe=function(e,t,r,i){i.mSet(e,t,i.m.call(i.tween,r,i.mt),i)},Fle=function(e){for(var t=e._pt,r,i,s,a;t;){for(r=t._next,i=s;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:a)?t._prev._next=t:s=t,(t._next=i)?i._prev=t:a=t,t=r}e._pt=s},Yu=(function(){function n(t,r,i,s,a,o,l,u,d){this.t=r,this.s=s,this.c=a,this.p=i,this.r=o||jle,this.d=l||this,this.set=u||JB,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(r,i,s){this.mSet=this.mSet||this.set,this.set=BNe,this.m=r,this.mt=s,this.tween=i},n})();Xu(XB+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(n){return WB[n]=1});Kd.TweenMax=Kd.TweenLite=To;Kd.TimelineLite=Kd.TimelineMax=ju;Da=new ju({sortChildren:!1,defaults:J4,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Hd.stringFilter=Mle;var Rv=[],o6={},VNe=[],pY=0,zNe=0,a9=function(e){return(o6[e]||VNe).map(function(t){return t()})},bI=function(){var e=Date.now(),t=[];e-pY>2&&(a9("matchMediaInit"),Rv.forEach(function(r){var i=r.queries,s=r.conditions,a,o,l,u;for(o in i)a=$p.matchMedia(i[o]).matches,a&&(l=1),a!==s[o]&&(s[o]=a,u=1);u&&(r.revert(),l&&t.push(r))}),a9("matchMediaRevert"),t.forEach(function(r){return r.onMatch(r,function(i){return r.add(null,i)})}),pY=e,a9("matchMedia"))},Ule=(function(){function n(t,r){this.selector=r&&xI(r),this.data=[],this._r=[],this.isReverted=!1,this.id=zNe++,t&&this.add(t)}var e=n.prototype;return e.add=function(r,i,s){eo(r)&&(s=i,i=r,r=eo);var a=this,o=function(){var u=Sa,d=a.selector,h;return u&&u!==a&&u.data.push(a),s&&(a.selector=xI(s)),Sa=a,h=i.apply(a,arguments),eo(h)&&a._r.push(h),Sa=u,a.selector=d,a.isReverted=!1,h};return a.last=o,r===eo?o(a,function(l){return a.add(null,l)}):r?a[r]=o:o},e.ignore=function(r){var i=Sa;Sa=null,r(this),Sa=i},e.getTweens=function(){var r=[];return this.data.forEach(function(i){return i instanceof n?r.push.apply(r,i.getTweens()):i instanceof To&&!(i.parent&&i.parent.data==="nested")&&r.push(i)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,i){var s=this;if(r?(function(){for(var o=s.getTweens(),l=s.data.length,u;l--;)u=s.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(d){return o.splice(o.indexOf(d),1)}));for(o.map(function(d){return{g:d._dur||d._delay||d._sat&&!d._sat.vars.immediateRender?d.globalTime(0):-1/0,t:d}}).sort(function(d,h){return h.g-d.g||-1/0}).forEach(function(d){return d.t.revert(r)}),l=s.data.length;l--;)u=s.data[l],u instanceof ju?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof To)&&u.revert&&u.revert(r);s._r.forEach(function(d){return d(r,s)}),s.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var a=Rv.length;a--;)Rv[a].id===this.id&&Rv.splice(a,1)},e.revert=function(r){this.kill(r||{})},n})(),GNe=(function(){function n(t){this.contexts=[],this.scope=t,Sa&&Sa.data.push(this)}var e=n.prototype;return e.add=function(r,i,s){k0(r)||(r={matches:r});var a=new Ule(0,s||this.scope),o=a.conditions={},l,u,d;Sa&&!a.selector&&(a.selector=Sa.selector),this.contexts.push(a),i=a.add("onMatch",i),a.queries=r;for(u in r)u==="all"?d=1:(l=$p.matchMedia(r[u]),l&&(Rv.indexOf(a)<0&&Rv.push(a),(o[u]=l.matches)&&(d=1),l.addListener?l.addListener(bI):l.addEventListener("change",bI)));return d&&i(a,function(h){return a.add(null,h)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(i){return i.kill(r,!0)})},n})(),CM={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach(function(i){return Ele(i)})},timeline:function(e){return new ju(e)},getTweensOf:function(e,t){return Da.getTweensOf(e,t)},getProperty:function(e,t,r,i){Al(e)&&(e=Dh(e)[0]);var s=Nv(e||{}).get,a=r?fle:hle;return r==="native"&&(r=""),e&&(t?a((jd[t]&&jd[t].get||s)(e,t,r,i)):function(o,l,u){return a((jd[o]&&jd[o].get||s)(e,o,l,u))})},quickSetter:function(e,t,r){if(e=Dh(e),e.length>1){var i=e.map(function(d){return Ju.quickSetter(d,t,r)}),s=i.length;return function(d){for(var h=s;h--;)i[h](d)}}e=e[0]||{};var a=jd[t],o=Nv(e),l=o.harness&&(o.harness.aliases||{})[t]||t,u=a?function(d){var h=new a;db._pt=0,h.init(e,r?d+r:d,db,0,[e]),h.render(1,h),db._pt&&tV(1,db)}:o.set(e,l);return a?u:function(d){return u(e,l,r?d+r:d,o,1)}},quickTo:function(e,t,r){var i,s=Ju.to(e,Zd((i={},i[t]="+=0.1",i.paused=!0,i.stagger=0,i),r||{})),a=function(l,u,d){return s.resetTo(t,l,u,d)};return a.tween=s,a},isTweening:function(e){return Da.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=kv(e.ease,J4.ease)),cY(J4,e||{})},config:function(e){return cY(Hd,e||{})},registerEffect:function(e){var t=e.name,r=e.effect,i=e.plugins,s=e.defaults,a=e.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!jd[o]&&!Kd[o]&&e5(t+" effect requires "+o+" plugin.")}),n9[t]=function(o,l,u){return r(Dh(o),Zd(l||{},s),u)},a&&(ju.prototype[t]=function(o,l,u){return this.add(n9[t](o,k0(l)?l:(u=l)&&{},this),u)})},registerEase:function(e,t){Gi[e]=kv(t)},parseEase:function(e,t){return arguments.length?kv(e,t):Gi},getById:function(e){return Da.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var r=new ju(e),i,s;for(r.smoothChildTiming=Wu(e.smoothChildTiming),Da.remove(r),r._dp=0,r._time=r._tTime=Da._time,i=Da._first;i;)s=i._next,(t||!(!i._dur&&i instanceof To&&i.vars.onComplete===i._targets[0]))&&Jp(r,i,i._start-i._delay),i=s;return Jp(Da,r,0),r},context:function(e,t){return e?new Ule(e,t):Sa},matchMedia:function(e){return new GNe(e)},matchMediaRefresh:function(){return Rv.forEach(function(e){var t=e.conditions,r,i;for(i in t)t[i]&&(t[i]=!1,r=1);r&&e.revert()})||bI()},addEventListener:function(e,t){var r=o6[e]||(o6[e]=[]);~r.indexOf(t)||r.push(t)},removeEventListener:function(e,t){var r=o6[e],i=r&&r.indexOf(t);i>=0&&r.splice(i,1)},utils:{wrap:yNe,wrapYoyo:bNe,distribute:yle,random:wle,snap:ble,normalize:vNe,getUnit:gc,clamp:mNe,splitColor:Cle,toArray:Dh,selector:xI,mapRange:Sle,pipe:ANe,unitize:xNe,interpolate:wNe,shuffle:vle},install:ole,effects:n9,ticker:Bd,updateRoot:ju.updateRoot,plugins:jd,globalTimeline:Da,core:{PropTween:Yu,globals:lle,Tween:To,Timeline:ju,Animation:i5,getCache:Nv,_removeLinkedListItem:B8,reverting:function(){return Ul},context:function(e){return e&&Sa&&(Sa.data.push(e),e._ctx=Sa),Sa},suppressOverwrites:function(e){return zB=e}}};Xu("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return CM[n]=To[n]});Bd.add(ju.updateRoot);db=CM.to({},{duration:0});var qNe=function(e,t){for(var r=e._pt;r&&r.p!==t&&r.op!==t&&r.fp!==t;)r=r._next;return r},$Ne=function(e,t){var r=e._targets,i,s,a;for(i in t)for(s=r.length;s--;)a=e._ptLookup[s][i],a&&(a=a.d)&&(a._pt&&(a=qNe(a,i)),a&&a.modifier&&a.modifier(t[i],e,r[s],i))},o9=function(e,t){return{name:e,headless:1,rawVars:1,init:function(i,s,a){a._onInit=function(o){var l,u;if(Al(s)&&(l={},Xu(s,function(d){return l[d]=1}),s=l),t){l={};for(u in s)l[u]=t(s[u]);s=l}$Ne(o,s)}}}},Ju=CM.registerPlugin({name:"attr",init:function(e,t,r,i,s){var a,o,l;this.tween=r;for(a in t)l=e.getAttribute(a)||"",o=this.add(e,"setAttribute",(l||0)+"",t[a],i,s,0,0,a),o.op=a,o.b=l,this._props.push(a)},render:function(e,t){for(var r=t._pt;r;)Ul?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,t){for(var r=t.length;r--;)this.add(e,r,e[r]||0,t[r],0,0,0,0,0,1)}},o9("roundProps",vI),o9("modifiers"),o9("snap",ble))||CM;To.version=ju.version=Ju.version="3.15.0";ale=1;qB()&&lw();Gi.Power0;Gi.Power1;Gi.Power2;Gi.Power3;Gi.Power4;Gi.Linear;Gi.Quad;
vendor: 7,377 bytes, lines 100-107
100Gi.Cubic;Gi.Quart;Gi.Quint;Gi.Strong;Gi.Elastic;Gi.Back;Gi.SteppedEase;Gi.Bounce;Gi.Sine;Gi.Expo;Gi.Circ;/*! 101 * CSSPlugin 3.15.0 102 * https://gsap.com 103 * 104 * Copyright 2008-2026, GreenSock. All rights reserved. 105 * Subject to the terms at https://gsap.com/standard-license 106 * @author: Jack Doyle, [email protected] 107*/var mY,zA,wb,nV,uv,gY,rV,HNe=function(){return typeof window<"u"},Jm={},Bx=180/Math.PI,_b=Math.PI/180,Jy=Math.atan2,AY=1e8,iV=/([A-Z])/g,WNe=/(left|right|width|margin|padding|x)/i,XNe=/[\s,\(]\S/,r0={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},wI=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},YNe=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},QNe=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},KNe=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},ZNe=function(e,t){var r=t.s+t.c*e;t.set(t.t,t.p,~~(r+(r<0?-.5:.5))+t.u,t)},Ble=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Vle=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},JNe=function(e,t,r){return e.style[t]=r},e6e=function(e,t,r){return e.style.setProperty(t,r)},t6e=function(e,t,r){return e._gsap[t]=r},n6e=function(e,t,r){return e._gsap.scaleX=e._gsap.scaleY=r},r6e=function(e,t,r,i,s){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(s,a)},i6e=function(e,t,r,i,s){var a=e._gsap;a[t]=r,a.renderTransform(s,a)},Ia="transform",Qu=Ia+"Origin",s6e=function n(e,t){var r=this,i=this.target,s=i.style,a=i._gsap;if(e in Jm&&s){if(this.tfm=this.tfm||{},e!=="transform")e=r0[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return r.tfm[o]=Nm(i,o)}):this.tfm[e]=a.x?a[e]:Nm(i,e),e===Qu&&(this.tfm.zOrigin=a.zOrigin);else return r0.transform.split(",").forEach(function(o){return n.call(r,o,t)});if(this.props.indexOf(Ia)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Qu,t,"")),e=Ia}(s||t)&&this.props.push(e,t,s[e])},zle=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},a6e=function(){var e=this.props,t=this.target,r=t.style,i=t._gsap,s,a;for(s=0;s<e.length;s+=3)e[s+1]?e[s+1]===2?t[e[s]](e[s+2]):t[e[s]]=e[s+2]:e[s+2]?r[e[s]]=e[s+2]:r.removeProperty(e[s].substr(0,2)==="--"?e[s]:e[s].replace(iV,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)i[a]=this.tfm[a];i.svg&&(i.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),s=rV(),(!s||!s.isStart)&&!r[Ia]&&(zle(r),i.zOrigin&&r[Qu]&&(r[Qu]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},Gle=function(e,t){var r={target:e,props:[],revert:a6e,save:s6e};return e._gsap||Ju.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(i){return r.save(i)}),r},qle,_I=function(e,t){var r=zA.createElementNS?zA.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):zA.createElement(e);return r&&r.style?r:zA.createElement(e)},qd=function n(e,t,r){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(iV,"-$1").toLowerCase())||i.getPropertyValue(t)||!r&&n(e,cw(t)||t,1)||""},xY="O,Moz,ms,Ms,Webkit".split(","),cw=function(e,t,r){var i=t||uv,s=i.style,a=5;if(e in s&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(xY[a]+e in s););return a<0?null:(a===3?"ms":a>=0?xY[a]:"")+e},SI=function(){HNe()&&window.document&&(mY=window,zA=mY.document,wb=zA.documentElement,uv=_I("div")||{style:{}},_I("div"),Ia=cw(Ia),Qu=Ia+"Origin",uv.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",qle=!!cw("perspective"),rV=Ju.core.reverting,nV=1)},vY=function(e){var t=e.ownerSVGElement,r=_I("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0),s;i.style.display="block",r.appendChild(i),wb.appendChild(r);try{s=i.getBBox()}catch{}return r.removeChild(i),wb.removeChild(r),s},yY=function(e,t){for(var r=t.length;r--;)if(e.hasAttribute(t[r]))return e.getAttribute(t[r])},$le=function(e){var t,r;try{t=e.getBBox()}catch{t=vY(e),r=1}return t&&(t.width||t.height)||r||(t=vY(e)),t&&!t.width&&!t.x&&!t.y?{x:+yY(e,["x","cx","x1"])||0,y:+yY(e,["y","cy","y1"])||0,width:0,height:0}:t},Hle=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&$le(e))},w1=function(e,t){if(t){var r=e.style,i;t in Jm&&t!==Qu&&(t=Ia),r.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),r.removeProperty(i==="--"?t:t.replace(iV,"-$1").toLowerCase())):r.removeAttribute(t)}},GA=function(e,t,r,i,s,a){var o=new Yu(e._pt,t,r,0,1,a?Vle:Ble);return e._pt=o,o.b=i,o.e=s,e._props.push(r),o},bY={deg:1,rad:1,turn:1},o6e={grid:1,flex:1},_1=function n(e,t,r,i){var s=parseFloat(r)||0,a=(r+"").trim().substr((s+"").length)||"px",o=uv.style,l=WNe.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(l?"Width":"Height"),h=100,f=i==="px",p=i==="%",g,A,x,b;if(i===a||!s||bY[i]||bY[a])return s;if(a!=="px"&&!f&&(s=n(e,t,r,"px")),b=e.getCTM&&Hle(e),(p||a==="%")&&(Jm[t]||~t.indexOf("adius")))return g=b?e.getBBox()[l?"width":"height"]:e[d],ao(p?s/g*h:s/100*g);if(o[l?"width":"height"]=h+(f?a:i),A=i!=="rem"&&~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,b&&(A=(e.ownerSVGElement||{}).parentNode),(!A||A===zA||!A.appendChild)&&(A=zA.body),x=A._gsap,x&&p&&x.width&&l&&x.time===Bd.time&&!x.uncache)return ao(s/x.width*h);if(p&&(t==="height"||t==="width")){var _=e.style[t];e.style[t]=h+i,g=e[d],_?e.style[t]=_:w1(e,t)}else(p||a==="%")&&!o6e[qd(A,"display")]&&(o.position=qd(e,"position")),A===e&&(o.position="static"),A.appendChild(uv),g=uv[d],A.removeChild(uv),o.position="absolute";return l&&p&&(x=Nv(A),x.time=Bd.time,x.width=A[d]),ao(f?g*s/h:g&&s?h/g*s:0)},Nm=function(e,t,r,i){var s;return nV||SI(),t in r0&&t!=="transform"&&(t=r0[t],~t.indexOf(",")&&(t=t.split(",")[0])),Jm[t]&&t!=="transform"?(s=a5(e,i),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:MM(qd(e,Qu))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=NM[t]&&NM[t](e,t,r)||qd(e,t)||ule(e,t)||(t==="opacity"?1:0))),r&&!~(s+"").trim().indexOf(" ")?_1(e,t,s,r)+r:s},l6e=function(e,t,r,i){if(!r||r==="none"){var s=cw(t,e,1),a=s&&qd(e,s,1);a&&a!==r?(t=s,r=a):t==="borderColor"&&(r=qd(e,"borderTopColor"))}var o=new Yu(this._pt,e.style,t,0,1,Ile),l=0,u=0,d,h,f,p,g,A,x,b,_,M,T,L;if(o.b=r,o.e=i,r+="",i+="",i.substring(0,6)==="var(--"&&(i=qd(e,i.substring(4,i.indexOf(")")))),i==="auto"&&(A=e.style[t],e.style[t]=i,i=qd(e,t)||i,A?e.style[t]=A:w1(e,t)),d=[r,i],Mle(d),r=d[0],i=d[1],f=r.match(ub)||[],L=i.match(ub)||[],L.length){for(;h=ub.exec(i);)x=h[0],_=i.substring(l,h.index),g?g=(g+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(g=1),x!==(A=f[u++]||"")&&(p=parseFloat(A)||0,T=A.substr((p+"").length),x.charAt(1)==="="&&(x=bb(p,x)+T),b=parseFloat(x),M=x.substr((b+"").length),l=ub.lastIndex-M.length,M||(M=M||Hd.units[t]||T,l===i.length&&(i+=M,o.e+=M)),T!==M&&(p=_1(e,t,A,M)||0),o._pt={_next:o._pt,p:_||u===1?_:",",s:p,c:b-p,m:g&&g<4||t==="zIndex"?Math.round:0});o.c=l<i.length?i.substring(l,i.length):""}else o.r=t==="display"&&i==="none"?Vle:Ble;return sle.test(i)&&(o.e=0),this._pt=o,o},wY={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},c6e=function(e){var t=e.split(" "),r=t[0],i=t[1]||"50%";return(r==="top"||r==="bottom"||i==="left"||i==="right")&&(e=r,r=i,i=e),t[0]=wY[r]||r,t[1]=wY[i]||i,t.join(" ")}
vendor: 5,550 bytes, line 107
107,u6e=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var r=t.t,i=r.style,s=t.u,a=r._gsap,o,l,u;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),u=s.length;--u>-1;)o=s[u],Jm[o]&&(l=1,o=o==="transformOrigin"?Qu:Ia),w1(r,o);l&&(w1(r,Ia),a&&(a.svg&&r.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",a5(r,1),a.uncache=1,zle(i)))}},NM={clearProps:function(e,t,r,i,s){if(s.data!=="isFromStart"){var a=e._pt=new Yu(e._pt,t,r,0,0,u6e);return a.u=i,a.pr=-10,a.tween=s,e._props.push(r),1}}},s5=[1,0,0,1,0,0],Wle={},Xle=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},_Y=function(e){var t=qd(e,Ia);return Xle(t)?s5:t.substr(7).match(ile).map(ao)},sV=function(e,t){var r=e._gsap||Nv(e),i=e.style,s=_Y(e),a,o,l,u;return r.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?s5:s):(s===s5&&!e.offsetParent&&e!==wb&&!r.svg&&(l=i.display,i.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,o=e.nextElementSibling,wb.appendChild(e)),s=_Y(e),l?i.display=l:w1(e,"display"),u&&(o?a.insertBefore(e,o):a?a.appendChild(e):wb.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},TI=function(e,t,r,i,s,a){var o=e._gsap,l=s||sV(e,!0),u=o.xOrigin||0,d=o.yOrigin||0,h=o.xOffset||0,f=o.yOffset||0,p=l[0],g=l[1],A=l[2],x=l[3],b=l[4],_=l[5],M=t.split(" "),T=parseFloat(M[0])||0,L=parseFloat(M[1])||0,D,P,O,F;r?l!==s5&&(P=p*x-g*A)&&(O=T*(x/P)+L*(-A/P)+(A*_-x*b)/P,F=T*(-g/P)+L*(p/P)-(p*_-g*b)/P,T=O,L=F):(D=$le(e),T=D.x+(~M[0].indexOf("%")?T/100*D.width:T),L=D.y+(~(M[1]||M[0]).indexOf("%")?L/100*D.height:L)),i||i!==!1&&o.smooth?(b=T-u,_=L-d,o.xOffset=h+(b*p+_*A)-b,o.yOffset=f+(b*g+_*x)-_):o.xOffset=o.yOffset=0,o.xOrigin=T,o.yOrigin=L,o.smooth=!!i,o.origin=t,o.originIsAbsolute=!!r,e.style[Qu]="0px 0px",a&&(GA(a,o,"xOrigin",u,T),GA(a,o,"yOrigin",d,L),GA(a,o,"xOffset",h,o.xOffset),GA(a,o,"yOffset",f,o.yOffset)),e.setAttribute("data-svg-origin",T+" "+L)},a5=function(e,t){var r=e._gsap||new Rle(e);if("x"in r&&!t&&!r.uncache)return r;var i=e.style,s=r.scaleX<0,a="px",o="deg",l=getComputedStyle(e),u=qd(e,Qu)||"0",d,h,f,p,g,A,x,b,_,M,T,L,D,P,O,F,U,B,z,H,X,W,J,ee,ae,le,Z,Y,re,_e,Ee,Ae;return d=h=f=A=x=b=_=M=T=0,p=g=1,r.svg=!!(e.getCTM&&Hle(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Ia]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Ia]!=="none"?l[Ia]:"")),i.scale=i.rotate=i.translate="none"),P=sV(e,r.svg),r.svg&&(r.uncache?(ae=e.getBBox(),u=r.xOrigin-ae.x+"px "+(r.yOrigin-ae.y)+"px",ee=""):ee=!t&&e.getAttribute("data-svg-origin"),TI(e,ee||u,!!ee||r.originIsAbsolute,r.smooth!==!1,P)),L=r.xOrigin||0,D=r.yOrigin||0,P!==s5&&(B=P[0],z=P[1],H=P[2],X=P[3],d=W=P[4],h=J=P[5],P.length===6?(p=Math.sqrt(B*B+z*z),g=Math.sqrt(X*X+H*H),A=B||z?Jy(z,B)*Bx:0,_=H||X?Jy(H,X)*Bx+A:0,_&&(g*=Math.abs(Math.cos(_*_b))),r.svg&&(d-=L-(L*B+D*H),h-=D-(L*z+D*X))):(Ae=P[6],_e=P[7],Z=P[8],Y=P[9],re=P[10],Ee=P[11],d=P[12],h=P[13],f=P[14],O=Jy(Ae,re),x=O*Bx,O&&(F=Math.cos(-O),U=Math.sin(-O),ee=W*F+Z*U,ae=J*F+Y*U,le=Ae*F+re*U,Z=W*-U+Z*F,Y=J*-U+Y*F,re=Ae*-U+re*F,Ee=_e*-U+Ee*F,W=ee,J=ae,Ae=le),O=Jy(-H,re),b=O*Bx,O&&(F=Math.cos(-O),U=Math.sin(-O),ee=B*F-Z*U,ae=z*F-Y*U,le=H*F-re*U,Ee=X*U+Ee*F,B=ee,z=ae,H=le),O=Jy(z,B),A=O*Bx,O&&(F=Math.cos(O),U=Math.sin(O),ee=B*F+z*U,ae=W*F+J*U,z=z*F-B*U,J=J*F-W*U,B=ee,W=ae),x&&Math.abs(x)+Math.abs(A)>359.9&&(x=A=0,b=180-b),p=ao(Math.sqrt(B*B+z*z+H*H)),g=ao(Math.sqrt(J*J+Ae*Ae)),O=Jy(W,J),_=Math.abs(O)>2e-4?O*Bx:0,T=Ee?1/(Ee<0?-Ee:Ee):0),r.svg&&(ee=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!Xle(qd(e,Ia)),ee&&e.setAttribute("transform",ee))),Math.abs(_)>90&&Math.abs(_)<270&&(s?(p*=-1,_+=A<=0?180:-180,A+=A<=0?180:-180):(g*=-1,_+=_<=0?180:-180)),t=t||r.uncache,r.x=d-((r.xPercent=d&&(!t&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-d)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+a,r.y=h-((r.yPercent=h&&(!t&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+a,r.z=f+a,r.scaleX=ao(p),r.scaleY=ao(g),r.rotation=ao(A)+o,r.rotationX=ao(x)+o,r.rotationY=ao(b)+o,r.skewX=_+o,r.skewY=M+o,r.transformPerspective=T+a,(r.zOrigin=parseFloat(u.split(" ")[2])||!t&&r.zOrigin||0)&&(i[Qu]=MM(u)),r.xOffset=r.yOffset=0,r.force3D=Hd.force3D,r.renderTransform=r.svg?h6e:qle?Yle:d6e,r.uncache=0,r},MM=function(e){return(e=e.split(" "))[0]+" "+e[1]},l9=function(e,t,r){var i=gc(t);return ao(parseFloat(t)+parseFloat(_1(e,"x",r+"px",i)))+i},d6e=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Yle(e,t)},_x="0deg",x3="0px",Sx=") ",Yle=function(e,t){var r=t||this,i=r.xPercent,s=r.yPercent,a=r.x,o=r.y,l=r.z,u=r.rotation,d=r.rotationY,h=r.rotationX,f=r.skewX,p=r.skewY,g=r.scaleX,A=r.scaleY,x=r.transformPerspective,b=r.force3D,_=r.target,M=r.zOrigin,T="",L=b==="auto"&&e&&e!==1||b===!0;if(M&&(h!==_x||d!==_x)){var D=parseFloat(d)*_b,P=Math.sin(D),O=Math.cos(D),F;D=parseFloat(h)*_b,F=Math.cos(D),a=l9(_,a,P*F*-M),o=l9(_,o,-Math.sin(D)*-M),l=l9(_,l,O*F*-M+M)}x!==x3&&(T+="perspective("+x+Sx),(i||s)&&(T+="translate("+i+"%, "+s+"%) "),(L||a!==x3||o!==x3||l!==x3)&&(T+=l!==x3||L?"translate3d("+a+", "+o+", "+l+") ":"translate("+a+", "+o+Sx),u!==_x&&(T+="rotate("+u+Sx),d!==_x&&(T+="rotateY("+d+Sx),h!==_x&&(T+="rotateX("+h+Sx),(f!==_x||p!==_x)&&(T+="skew("+f+", "+p+Sx),(g
vendor: 7,483 bytes, lines 107-114
107!==1||A!==1)&&(T+="scale("+g+", "+A+Sx),_.style[Ia]=T||"translate(0, 0)"},h6e=function(e,t){var r=t||this,i=r.xPercent,s=r.yPercent,a=r.x,o=r.y,l=r.rotation,u=r.skewX,d=r.skewY,h=r.scaleX,f=r.scaleY,p=r.target,g=r.xOrigin,A=r.yOrigin,x=r.xOffset,b=r.yOffset,_=r.forceCSS,M=parseFloat(a),T=parseFloat(o),L,D,P,O,F;l=parseFloat(l),u=parseFloat(u),d=parseFloat(d),d&&(d=parseFloat(d),u+=d,l+=d),l||u?(l*=_b,u*=_b,L=Math.cos(l)*h,D=Math.sin(l)*h,P=Math.sin(l-u)*-f,O=Math.cos(l-u)*f,u&&(d*=_b,F=Math.tan(u-d),F=Math.sqrt(1+F*F),P*=F,O*=F,d&&(F=Math.tan(d),F=Math.sqrt(1+F*F),L*=F,D*=F)),L=ao(L),D=ao(D),P=ao(P),O=ao(O)):(L=h,O=f,D=P=0),(M&&!~(a+"").indexOf("px")||T&&!~(o+"").indexOf("px"))&&(M=_1(p,"x",a,"px"),T=_1(p,"y",o,"px")),(g||A||x||b)&&(M=ao(M+g-(g*L+A*P)+x),T=ao(T+A-(g*D+A*O)+b)),(i||s)&&(F=p.getBBox(),M=ao(M+i/100*F.width),T=ao(T+s/100*F.height)),F="matrix("+L+","+D+","+P+","+O+","+M+","+T+")",p.setAttribute("transform",F),_&&(p.style[Ia]=F)},f6e=function(e,t,r,i,s){var a=360,o=Al(s),l=parseFloat(s)*(o&&~s.indexOf("rad")?Bx:1),u=l-i,d=i+u+"deg",h,f;return o&&(h=s.split("_")[1],h==="short"&&(u%=a,u!==u%(a/2)&&(u+=u<0?a:-a)),h==="cw"&&u<0?u=(u+a*AY)%a-~~(u/a)*a:h==="ccw"&&u>0&&(u=(u-a*AY)%a-~~(u/a)*a)),e._pt=f=new Yu(e._pt,t,r,i,u,YNe),f.e=d,f.u="deg",e._props.push(r),f},SY=function(e,t){for(var r in t)e[r]=t[r];return e},p6e=function(e,t,r){var i=SY({},r._gsap),s="perspective,force3D,transformOrigin,svgOrigin",a=r.style,o,l,u,d,h,f,p,g;i.svg?(u=r.getAttribute("transform"),r.setAttribute("transform",""),a[Ia]=t,o=a5(r,1),w1(r,Ia),r.setAttribute("transform",u)):(u=getComputedStyle(r)[Ia],a[Ia]=t,o=a5(r,1),a[Ia]=u);for(l in Jm)u=i[l],d=o[l],u!==d&&s.indexOf(l)<0&&(p=gc(u),g=gc(d),h=p!==g?_1(r,l,u,g):parseFloat(u),f=parseFloat(d),e._pt=new Yu(e._pt,o,l,h,f-h,wI),e._pt.u=g||0,e._props.push(l));SY(o,i)};Xu("padding,margin,Width,Radius",function(n,e){var t="Top",r="Right",i="Bottom",s="Left",a=(e<3?[t,r,i,s]:[t+s,t+r,i+r,i+s]).map(function(o){return e<2?n+o:"border"+o+n});NM[e>1?"border"+n:n]=function(o,l,u,d,h){var f,p;if(arguments.length<4)return f=a.map(function(g){return Nm(o,g,u)}),p=f.join(" "),p.split(f[0]).length===5?f[0]:p;f=(d+"").split(" "),p={},a.forEach(function(g,A){return p[g]=f[A]=f[A]||f[(A-1)/2|0]}),o.init(l,p,h)}});var Qle={name:"css",register:SI,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,r,i,s){var a=this._props,o=e.style,l=r.vars.startAt,u,d,h,f,p,g,A,x,b,_,M,T,L,D,P,O,F;nV||SI(),this.styles=this.styles||Gle(e),O=this.styles.props,this.tween=r;for(A in t)if(A!=="autoRound"&&(d=t[A],!(jd[A]&&Ple(A,t,r,i,e,s)))){if(p=typeof d,g=NM[A],p==="function"&&(d=d.call(r,i,e,s),p=typeof d),p==="string"&&~d.indexOf("random(")&&(d=n5(d)),g)g(this,e,A,d,r)&&(P=1);else if(A.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(A)+"").trim(),d+="",i1.lastIndex=0,i1.test(u)||(x=gc(u),b=gc(d),b?x!==b&&(u=_1(e,A,u,b)+b):x&&(d+=x)),this.add(o,"setProperty",u,d,i,s,0,0,A),a.push(A),O.push(A,0,o[A]);else if(p!=="undefined"){if(l&&A in l?(u=typeof l[A]=="function"?l[A].call(r,i,e,s):l[A],Al(u)&&~u.indexOf("random(")&&(u=n5(u)),gc(u+"")||u==="auto"||(u+=Hd.units[A]||gc(Nm(e,A))||""),(u+"").charAt(1)==="="&&(u=Nm(e,A))):u=Nm(e,A),f=parseFloat(u),_=p==="string"&&d.charAt(1)==="="&&d.substr(0,2),_&&(d=d.substr(2)),h=parseFloat(d),A in r0&&(A==="autoAlpha"&&(f===1&&Nm(e,"visibility")==="hidden"&&h&&(f=0),O.push("visibility",0,o.visibility),GA(this,o,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),A!=="scale"&&A!=="transform"&&(A=r0[A],~A.indexOf(",")&&(A=A.split(",")[0]))),M=A in Jm,M){if(this.styles.save(A),F=d,p==="string"&&d.substring(0,6)==="var(--"){if(d=qd(e,d.substring(4,d.indexOf(")"))),d.substring(0,5)==="calc("){var U=e.style.perspective;e.style.perspective=d,d=qd(e,"perspective"),U?e.style.perspective=U:w1(e,"perspective")}h=parseFloat(d)}if(T||(L=e._gsap,L.renderTransform&&!t.parseTransform||a5(e,t.parseTransform),D=t.smoothOrigin!==!1&&L.smooth,T=this._pt=new Yu(this._pt,o,Ia,0,1,L.renderTransform,L,0,-1),T.dep=1),A==="scale")this._pt=new Yu(this._pt,L,"scaleY",L.scaleY,(_?bb(L.scaleY,_+h):h)-L.scaleY||0,wI),this._pt.u=0,a.push("scaleY",A),A+="X";else if(A==="transformOrigin"){O.push(Qu,0,o[Qu]),d=c6e(d),L.svg?TI(e,d,0,D,0,this):(b=parseFloat(d.split(" ")[2])||0,b!==L.zOrigin&&GA(this,L,"zOrigin",L.zOrigin,b),GA(this,o,A,MM(u),MM(d)));continue}else if(A==="svgOrigin"){TI(e,d,1,D,0,this);continue}else if(A in Wle){f6e(this,L,A,f,_?bb(f,_+d):d);continue}else if(A==="smoothOrigin"){GA(this,L,"smooth",L.smooth,d);continue}else if(A==="force3D"){L[A]=d;continue}else if(A==="transform"){p6e(this,d,e);continue}}else A in o||(A=cw(A)||A);if(M||(h||h===0)&&(f||f===0)&&!XNe.test(d)&&A in o)x=(u+"").substr((f+"").length),h||(h=0),b=gc(d)||(A in Hd.units?Hd.units[A]:x),x!==b&&(f=_1(e,A,u,b)),this._pt=new Yu(this._pt,M?L:o,A,f,(_?bb(f,_+h):h)-f,!M&&(b==="px"||A==="zIndex")&&t.autoRound!==!1?ZNe:wI),this._pt.u=b||0,M&&F!==d?(this._pt.b=u,this._pt.e=F,this._pt.r=KNe):x!==b&&b!=="%"&&(this._pt.b=u,this._pt.r=QNe);else if(A in o)l6e.call(this,e,A,u,_?_+d:d);else if(A in e)this.add(e,A,u||e[A],_?_+d:d,i,s);else if(A!=="parseTransform"){HB(A,d);continue}M||(A in o?O.push(A,0,o[A]):typeof e[A]=="function"?O.push(A,2,e[A]()):O.push(A,1,u||e[A])),a.push(A)}}P&&Fle(this)},render:function(e,t){if(t.tween._time||!rV())for(var r=t._pt;r;)r.r(e,r.d),r=r._next;else t.styles.revert()},get:Nm,aliases:r0,getSetter:function(e,t,r){var i=r0[t];return i&&i.indexOf(",")<0&&(t=i),t in Jm&&t!==Qu&&(e._gsap.x||Nm(e,"x"))?r&&gY===r?t==="scale"?n6e:t6e:(gY=r||{})&&(t==="scale"?r6e:i6e):e.style&&!GB(e.style[t])?JNe:~t.indexOf("-")?e6e:eV(e,t)},core:{_removeProperty:w1,_getMatrix:sV}};Ju.utils.checkPrefix=cw;Ju.core.getStyleSaver=Gle;(function(n,e,t,r){var i=Xu(n+","+e+","+t,function(s){Jm[s]=1});Xu(e,function(s){Hd.units[s]="deg",Wle[s]=1}),r0[i[13]]=n+","+e,Xu(r,function(s){var a=s.split(":");r0[a[1]]=i[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Xu("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){Hd.units[n]="px"});Ju.registerPlugin(Qle);var Si=Ju.registerPlugin(Qle)||Ju;Si.core.Tween;function m6e(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function g6e(n,e,t){return e&&m6e(n.prototype,e),n}/*! 108 * Observer 3.15.0 109 * https://gsap.com 110 * 111 * @license Copyright 2008-2026, GreenSock. All rights reserved. 112 * Subject to the terms at https://gsap.com/standard-license 113 * @author: Jack Doyle, [email protected] 114*/var jl,l6,Vd,qA,$A,Sb,Kle,Vx,Tb,Zle,Im,kf,Jle,ece=function(){return jl||typeof window<"u"&&(jl=window.gsap)&&jl.registerPlugin&&jl},tce=1,hb=[],wi=[],g0=[],n4=Date.now,EI=function(e,t){return t},A6e=function(){var e=Tb.core,t=e.bridge||{},r=e._scrollers,i=e._proxies;r.push.apply(r,wi),i.push.apply(i,g0),wi=r,g0=i,EI=function(a,o){return t[a](o)}},s1=function(e,t){return~g0.indexOf(e)&&g0[g0.indexOf(e)+1][t]},r4=function(e){return!!~Zle.indexOf(e)},Qc=function(e,t,r,i,s){return e.addEventListener(t,r,{passive:i!==!1,capture:!!s})},Hc=function(e,t,r,i){return e.removeEventListener(t,r,!!i)},DE="scrollLeft",jE="scrollTop",CI=function(){return Im&&Im.isPressed||wi.cache++}
vendor: 9,160 bytes, lines 114-121
114,kM=function(e,t){var r=function i(s){if(s||s===0){tce&&(Vd.history.scrollRestoration="manual");var a=Im&&Im.isPressed;s=i.v=Math.round(s)||(Im&&Im.iOS?1:0),e(s),i.cacheID=wi.cache,a&&EI("ss",s)}else(t||wi.cache!==i.cacheID||EI("ref"))&&(i.cacheID=wi.cache,i.v=e());return i.v+i.offset};return r.offset=0,e&&r},cu={s:DE,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:kM(function(n){return arguments.length?Vd.scrollTo(n,zo.sc()):Vd.pageXOffset||qA[DE]||$A[DE]||Sb[DE]||0})},zo={s:jE,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:cu,sc:kM(function(n){return arguments.length?Vd.scrollTo(cu.sc(),n):Vd.pageYOffset||qA[jE]||$A[jE]||Sb[jE]||0})},Pu=function(e,t){return(t&&t._ctx&&t._ctx.selector||jl.utils.toArray)(e)[0]||(typeof e=="string"&&jl.config().nullTargetWarn!==!1?console.warn("Element not found:",e):null)},x6e=function(e,t){for(var r=t.length;r--;)if(t[r]===e||t[r].contains(e))return!0;return!1},S1=function(e,t){var r=t.s,i=t.sc;r4(e)&&(e=qA.scrollingElement||$A);var s=wi.indexOf(e),a=i===zo.sc?1:2;!~s&&(s=wi.push(e)-1),wi[s+a]||Qc(e,"scroll",CI);var o=wi[s+a],l=o||(wi[s+a]=kM(s1(e,r),!0)||(r4(e)?i:kM(function(u){return arguments.length?e[r]=u:e[r]})));return l.target=e,o||(l.smooth=jl.getProperty(e,"scrollBehavior")==="smooth"),l},NI=function(e,t,r){var i=e,s=e,a=n4(),o=a,l=t||50,u=Math.max(500,l*3),d=function(g,A){var x=n4();A||x-a>l?(s=i,i=g,o=a,a=x):r?i+=g:i=s+(g-s)/(x-o)*(a-o)},h=function(){s=i=r?0:i,o=a=0},f=function(g){var A=o,x=s,b=n4();return(g||g===0)&&g!==i&&d(g),a===o||b-o>u?0:(i+(r?x:-x))/((r?b:a)-A)*1e3};return{update:d,reset:h,getVelocity:f}},v3=function(e,t){return t&&!e._gsapAllow&&e.cancelable!==!1&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},TY=function(e){var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(r)?t:r},nce=function(){Tb=jl.core.globals().ScrollTrigger,Tb&&Tb.core&&A6e()},rce=function(e){return jl=e||ece(),!l6&&jl&&typeof document<"u"&&document.body&&(Vd=window,qA=document,$A=qA.documentElement,Sb=qA.body,Zle=[Vd,qA,$A,Sb],jl.utils.clamp,Jle=jl.core.context||function(){},Vx="onpointerenter"in Sb?"pointer":"mouse",Kle=co.isTouch=Vd.matchMedia&&Vd.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in Vd||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,kf=co.eventTypes=("ontouchstart"in $A?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in $A?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return tce=0},500),l6=1),Tb||nce(),l6};cu.op=zo;wi.cache=0;var co=(function(){function n(t){this.init(t)}var e=n.prototype;return e.init=function(r){l6||rce(jl)||console.warn("Please gsap.registerPlugin(Observer)"),Tb||nce();var i=r.tolerance,s=r.dragMinimum,a=r.type,o=r.target,l=r.lineHeight,u=r.debounce,d=r.preventDefault,h=r.onStop,f=r.onStopDelay,p=r.ignore,g=r.wheelSpeed,A=r.event,x=r.onDragStart,b=r.onDragEnd,_=r.onDrag,M=r.onPress,T=r.onRelease,L=r.onRight,D=r.onLeft,P=r.onUp,O=r.onDown,F=r.onChangeX,U=r.onChangeY,B=r.onChange,z=r.onToggleX,H=r.onToggleY,X=r.onHover,W=r.onHoverEnd,J=r.onMove,ee=r.ignoreCheck,ae=r.isNormalizer,le=r.onGestureStart,Z=r.onGestureEnd,Y=r.onWheel,re=r.onEnable,_e=r.onDisable,Ee=r.onClick,Ae=r.scrollSpeed,te=r.capture,ve=r.allowClicks,we=r.lockAxis,Ue=r.onLockAxis;this.target=o=Pu(o)||$A,this.vars=r,p&&(p=jl.utils.toArray(p)),i=i||1e-9,s=s||0,g=g||1,Ae=Ae||1,a=a||"wheel,touch,pointer",u=u!==!1,l||(l=parseFloat(Vd.getComputedStyle(Sb).lineHeight)||22);var ze,yt,mt,bt,dt,St,kt,Fe=this,Ze=0,Ye=0,ft=r.passive||!d&&r.passive!==!1,At=S1(o,cu),Ce=S1(o,zo),Se=At(),qe=Ce(),pt=~a.indexOf("touch")&&!~a.indexOf("pointer")&&kf[0]==="pointerdown",Te=r4(o),oe=o.ownerDocument||qA,ge=[0,0,0],Ne=[0,0,0],ke=0,Xe=function(){return ke=n4()},et=function(qt,Fn){return(Fe.event=qt)&&p&&x6e(qt.target,p)||Fn&&pt&&qt.pointerType!=="touch"||ee&&ee(qt,Fn)},Qe=function(){Fe._vx.reset(),Fe._vy.reset(),yt.pause(),h&&h(Fe)},lt=function(){var qt=Fe.deltaX=TY(ge),Fn=Fe.deltaY=TY(Ne),xe=Math.abs(qt)>=i,Oe=Math.abs(Fn)>=i;B&&(xe||Oe)&&B(Fe,qt,Fn,ge,Ne),xe&&(L&&Fe.deltaX>0&&L(Fe),D&&Fe.deltaX<0&&D(Fe),F&&F(Fe),z&&Fe.deltaX<0!=Ze<0&&z(Fe),Ze=Fe.deltaX,ge[0]=ge[1]=ge[2]=0),Oe&&(O&&Fe.deltaY>0&&O(Fe),P&&Fe.deltaY<0&&P(Fe),U&&U(Fe),H&&Fe.deltaY<0!=Ye<0&&H(Fe),Ye=Fe.deltaY,Ne[0]=Ne[1]=Ne[2]=0),(bt||mt)&&(J&&J(Fe),mt&&(x&&mt===1&&x(Fe),_&&_(Fe),mt=0),bt=!1),St&&!(St=!1)&&Ue&&Ue(Fe),dt&&(Y(Fe),dt=!1),ze=0},tt=function(qt,Fn,xe){ge[xe]+=qt,Ne[xe]+=Fn,Fe._vx.update(qt),Fe._vy.update(Fn),u?ze||(ze=requestAnimationFrame(lt)):lt()},Ft=function(qt,Fn){we&&!kt&&(Fe.axis=kt=Math.abs(qt)>Math.abs(Fn)?"x":"y",St=!0),kt!=="y"&&(ge[2]+=qt,Fe._vx.update(qt,!0)),kt!=="x"&&(Ne[2]+=Fn,Fe._vy.update(Fn,!0)),u?ze||(ze=requestAnimationFrame(lt)):lt()},Mt=function(qt){if(!et(qt,1)){qt=v3(qt,d);var Fn=qt.clientX,xe=qt.clientY,Oe=Fn-Fe.x,Ge=xe-Fe.y,$e=Fe.isDragging;Fe.x=Fn,Fe.y=xe,($e||(Oe||Ge)&&(Math.abs(Fe.startX-Fn)>=s||Math.abs(Fe.startY-xe)>=s))&&(mt||(mt=$e?2:1),$e||(Fe.isDragging=!0),Ft(Oe,Ge))}},Nt=Fe.onPress=function(Ht){et(Ht,1)||Ht&&Ht.button||(Fe.axis=kt=null,yt.pause(),Fe.isPressed=!0,Ht=v3(Ht),Ze=Ye=0,Fe.startX=Fe.x=Ht.clientX,Fe.startY=Fe.y=Ht.clientY,Fe._vx.reset(),Fe._vy.reset(),Qc(ae?o:oe,kf[1],Mt,ft,!0),Fe.deltaX=Fe.deltaY=0,M&&M(Fe))},Je=Fe.onRelease=function(Ht){if(!et(Ht,1)){Hc(ae?o:oe,kf[1],Mt,!0);var qt=!isNaN(Fe.y-Fe.startY),Fn=Fe.isDragging,xe=Fn&&(Math.abs(Fe.x-Fe.startX)>3||Math.abs(Fe.y-Fe.startY)>3),Oe=v3(Ht);!xe&&qt&&(Fe._vx.reset(),Fe._vy.reset(),d&&ve&&jl.delayedCall(.08,function(){if(n4()-ke>300&&!Ht.defaultPrevented){if(Ht.target.click)Ht.target.click();else if(oe.createEvent){var Ge=oe.createEvent("MouseEvents");Ge.initMouseEvent("click",!0,!0,Vd,1,Oe.screenX,Oe.screenY,Oe.clientX,Oe.clientY,!1,!1,!1,!1,0,null),Ht.target.dispatchEvent(Ge)}}})),Fe.isDragging=Fe.isGesturing=Fe.isPressed=!1,h&&Fn&&!ae&&yt.restart(!0),mt&<(),b&&Fn&&b(Fe),T&&T(Fe,xe)}},fn=function(qt){return qt.touches&&qt.touches.length>1&&(Fe.isGesturing=!0)&&le(qt,Fe.isDragging)},Tn=function(){return(Fe.isGesturing=!1)||Z(Fe)},nt=function(qt){if(!et(qt)){var Fn=At(),xe=Ce();tt((Fn-Se)*Ae,(xe-qe)*Ae,1),Se=Fn,qe=xe,h&&yt.restart(!0)}},Kt=function(qt){if(!et(qt)){qt=v3(qt,d),Y&&(dt=!0);var Fn=(qt.deltaMode===1?l:qt.deltaMode===2?Vd.innerHeight:1)*g;tt(qt.deltaX*Fn,qt.deltaY*Fn,0),h&&!ae&&yt.restart(!0)}},Lt=function(qt){if(!et(qt)){var Fn=qt.clientX,xe=qt.clientY,Oe=Fn-Fe.x,Ge=xe-Fe.y;Fe.x=Fn,Fe.y=xe,bt=!0,h&&yt.restart(!0),(Oe||Ge)&&Ft(Oe,Ge)}},cn=function(qt){Fe.event=qt,X(Fe)},dn=function(qt){Fe.event=qt,W(Fe)},Bt=function(qt){return et(qt)||v3(qt,d)&&Ee(Fe)};yt=Fe._dc=jl.delayedCall(f||.25,Qe).pause(),Fe.deltaX=Fe.deltaY=0,Fe._vx=NI(0,50,!0),Fe._vy=NI(0,50,!0),Fe.scrollX=At,Fe.scrollY=Ce,Fe.isDragging=Fe.isGesturing=Fe.isPressed=!1,Jle(this),Fe.enable=function(Ht){return Fe.isEnabled||(Qc(Te?oe:o,"scroll",CI),a.indexOf("scroll")>=0&&Qc(Te?oe:o,"scroll",nt,ft,te),a.indexOf("wheel")>=0&&Qc(o,"wheel",Kt,ft,te),(a.indexOf("touch")>=0&&Kle||a.indexOf("pointer")>=0)&&(Qc(o,kf[0],Nt,ft,te),Qc(oe,kf[2],Je),Qc(oe,kf[3],Je),ve&&Qc(o,"click",Xe,!0,!0),Ee&&Qc(o,"click",Bt),le&&Qc(oe,"gesturestart",fn),Z&&Qc(oe,"gestureend",Tn),X&&Qc(o,Vx+"enter",cn),W&&Qc(o,Vx+"leave",dn),J&&Qc(o,Vx+"move",Lt)),Fe.isEnabled=!0,Fe.isDragging=Fe.isGesturing=Fe.isPressed=bt=mt=!1,Fe._vx.reset(),Fe._vy.reset(),Se=At(),qe=Ce(),Ht&&Ht.type&&Nt(Ht),re&&re(Fe)),Fe},Fe.disable=function(){Fe.isEnabled&&(hb.filter(function(Ht){return Ht!==Fe&&r4(Ht.target)}).length||Hc(Te?oe:o,"scroll",CI),Fe.isPressed&&(Fe._vx.reset(),Fe._vy.reset(),Hc(ae?o:oe,kf[1],Mt,!0)),Hc(Te?oe:o,"scroll",nt,te),Hc(o,"wheel",Kt,te),Hc(o,kf[0],Nt,te),Hc(oe,kf[2],Je),Hc(oe,kf[3],Je),Hc(o,"click",Xe,!0),Hc(o,"click",Bt),Hc(oe,"gesturestart",fn),Hc(oe,"gestureend",Tn),Hc(o,Vx+"enter",cn),Hc(o,Vx+"leave",dn),Hc(o,Vx+"move",Lt),Fe.isEnabled=Fe.isPressed=Fe.isDragging=!1,_e&&_e(Fe))},Fe.kill=Fe.revert=function(){Fe.disable();var Ht=hb.indexOf(Fe);Ht>=0&&hb.splice(Ht,1),Im===Fe&&(Im=0)},hb.push(Fe),ae&&r4(o)&&(Im=Fe),Fe.enable(A)},g6e(n,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),n})();co.version="3.15.0";co.create=function(n){return new co(n)};co.register=rce;co.getAll=function(){return hb.slice()};co.getById=function(n){return hb.filter(function(e){return e.vars.id===n})[0]};ece()&&jl.registerPlugin(co);/*! 115 * ScrollTrigger 3.15.0 116 * https://gsap.com 117 * 118 * @license Copyright 2008-2026, GreenSock. All rights reserved. 119 * Subject to the terms at https://gsap.com/standard-license 120 * @author: Jack Doyle, [email protected] 121*/var dr,eb,bi,Ps,Fd,Cs,aV,RM,o5,i4,ES,IE,lc,G8,MI,tu,EY,CY,tb,ice,c9,sce,eu,kI,ace,oce,xA,RI,oV,Eb,lV,s4,PI,u9,FE=1,hc=Date.now,d9=hc(),Bh=0,CS=0,NY=function(e,t,r){var i=Rd(e)&&(e.substr(0,6)==="clamp("||e.indexOf("max")>-1);return r["_"+t+"Clamp"]=i,i?e.substr(6,e.length-7):e},MY=function(e,t){return t&&(!Rd(e)||e.substr(0,6)!=="clamp(")?"clamp("+e+")":e},v6e=function n(){return CS&&requestAnimationFrame(n)},kY=function(){return G8=1},RY=function(){return G8=0}
vendor: 4,522 bytes, line 121
121,Hp=function(e){return e},NS=function(e){return Math.round(e*1e5)/1e5||0},lce=function(){return typeof window<"u"},cce=function(){return dr||lce()&&(dr=window.gsap)&&dr.registerPlugin&&dr},Qv=function(e){return!!~aV.indexOf(e)},uce=function(e){return(e==="Height"?lV:bi["inner"+e])||Fd["client"+e]||Cs["client"+e]},dce=function(e){return s1(e,"getBoundingClientRect")||(Qv(e)?function(){return f6.width=bi.innerWidth,f6.height=lV,f6}:function(){return Pm(e)})},y6e=function(e,t,r){var i=r.d,s=r.d2,a=r.a;return(a=s1(e,"getBoundingClientRect"))?function(){return a()[i]}:function(){return(t?uce(s):e["client"+s])||0}},b6e=function(e,t){return!t||~g0.indexOf(e)?dce(e):function(){return f6}},i0=function(e,t){var r=t.s,i=t.d2,s=t.d,a=t.a;return Math.max(0,(r="scroll"+i)&&(a=s1(e,r))?a()-dce(e)()[s]:Qv(e)?(Fd[r]||Cs[r])-uce(i):e[r]-e["offset"+i])},UE=function(e,t){for(var r=0;r<tb.length;r+=3)(!t||~t.indexOf(tb[r+1]))&&e(tb[r],tb[r+1],tb[r+2])},Rd=function(e){return typeof e=="string"},Ac=function(e){return typeof e=="function"},MS=function(e){return typeof e=="number"},zx=function(e){return typeof e=="object"},y3=function(e,t,r){return e&&e.progress(t?0:1)&&r&&e.pause()},e2=function(e,t,r){if(e.enabled){var i=e._ctx?e._ctx.add(function(){return t(e,r)}):t(e,r);i&&i.totalTime&&(e.callbackAnimation=i)}},t2=Math.abs,hce="left",fce="top",cV="right",uV="bottom",Pv="width",Lv="height",a4="Right",o4="Left",l4="Top",c4="Bottom",_o="padding",Rh="margin",uw="Width",dV="Height",Bo="px",Ph=function(e){return bi.getComputedStyle(e.nodeType===Node.DOCUMENT_NODE?e.scrollingElement:e)},w6e=function(e){var t=Ph(e).position;e.style.position=t==="absolute"||t==="fixed"?t:"relative"},PY=function(e,t){for(var r in t)r in e||(e[r]=t[r]);return e},Pm=function(e,t){var r=t&&Ph(e)[MI]!=="matrix(1, 0, 0, 1, 0, 0)"&&dr.to(e,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=e.getBoundingClientRect?e.getBoundingClientRect():e.scrollingElement.getBoundingClientRect();return r&&r.progress(0).kill(),i},PM=function(e,t){var r=t.d2;return e["offset"+r]||e["client"+r]||0},pce=function(e){var t=[],r=e.labels,i=e.duration(),s;for(s in r)t.push(r[s]/i);return t},_6e=function(e){return function(t){return dr.utils.snap(pce(e),t)}},hV=function(e){var t=dr.utils.snap(e),r=Array.isArray(e)&&e.slice(0).sort(function(i,s){return i-s});return r?function(i,s,a){a===void 0&&(a=.001);var o;if(!s)return t(i);if(s>0){for(i-=a,o=0;o<r.length;o++)if(r[o]>=i)return r[o];return r[o-1]}else for(o=r.length,i+=a;o--;)if(r[o]<=i)return r[o];return r[0]}:function(i,s,a){a===void 0&&(a=.001);var o=t(i);return!s||Math.abs(o-i)<a||o-i<0==s<0?o:t(s<0?i-e:i+e)}},S6e=function(e){return function(t,r){return hV(pce(e))(t,r.direction)}},BE=function(e,t,r,i){return r.split(",").forEach(function(s){return e(t,s,i)})},ol=function(e,t,r,i,s){return e.addEventListener(t,r,{passive:!i,capture:!!s})},al=function(e,t,r,i){return e.removeEventListener(t,r,!!i)},VE=function(e,t,r){r=r&&r.wheelHandler,r&&(e(t,"wheel",r),e(t,"touchmove",r))},LY={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},zE={toggleActions:"play",anticipatePin:0},LM={top:0,left:0,center:.5,bottom:1,right:1},c6=function(e,t){if(Rd(e)){var r=e.indexOf("="),i=~r?+(e.charAt(r-1)+1)*parseFloat(e.substr(r+1)):0;~r&&(e.indexOf("%")>r&&(i*=t/100),e=e.substr(0,r-1)),e=i+(e in LM?LM[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},GE=function(e,t,r,i,s,a,o,l){var u=s.startColor,d=s.endColor,h=s.fontSize,f=s.indent,p=s.fontWeight,g=Ps.createElement("div"),A=Qv(r)||s1(r,"pinType")==="fixed",x=e.indexOf("scroller")!==-1,b=A?Cs:r.tagName==="IFRAME"?r.contentDocument.body:r,_=e.indexOf("start")!==-1,M=_?u:d,T="border-color:"+M+";font-size:"+h+";color:"+M+";font-weight:"+p+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return T+="position:"+((x||l)&&A?"fixed;":"absolute;"),(x||l||!A)&&(T+=(i===zo?cV:uV)+":"+(a+parseFloat(f))+"px;"),o&&(T+="box-sizing:border-box;text-align:left;width:"+o.offsetWidth+"px;"),g._isStart=_,g.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),g.style.cssText=T,g.innerText=t||t===0?e+"-"+t:e,b.children[0]?b.insertBefore(g,b.children[0]):b.appendChild(g),g._offset=g["offset"+i.op.d2],u6(g,0,i,_),g},u6=function(e,t,r,i){var s={display:"block"},a=r[i?"os2":"p2"],o=r[i?"p2":"os2"];e._isFlipped=i,s[r.a+"Percent"]=i?-100:0,s[r.a]=i?"1px":0,s["border"+a+u
vendor: 5,448 bytes, line 121
121w]=1,s["border"+o+uw]=0,s[r.p]=t+"px",dr.set(e,s)},mi=[],LI={},l5,OY=function(){return hc()-Bh>34&&(l5||(l5=requestAnimationFrame(qm)))},n2=function(){(!eu||!eu.isPressed||eu.startX>Cs.clientWidth)&&(wi.cache++,eu?l5||(l5=requestAnimationFrame(qm)):qm(),Bh||Zv("scrollStart"),Bh=hc())},h9=function(){oce=bi.innerWidth,ace=bi.innerHeight},kS=function(e){wi.cache++,(e===!0||!lc&&!sce&&!Ps.fullscreenElement&&!Ps.webkitFullscreenElement&&(!kI||oce!==bi.innerWidth||Math.abs(bi.innerHeight-ace)>bi.innerHeight*.25))&&RM.restart(!0)},Kv={},T6e=[],mce=function n(){return al(di,"scrollEnd",n)||dv(!0)},Zv=function(e){return Kv[e]&&Kv[e].map(function(t){return t()})||T6e},kd=[],gce=function(e){for(var t=0;t<kd.length;t+=5)(!e||kd[t+4]&&kd[t+4].query===e)&&(kd[t].style.cssText=kd[t+1],kd[t].getBBox&&kd[t].setAttribute("transform",kd[t+2]||""),kd[t+3].uncache=1)},Ace=function(){return wi.forEach(function(e){return Ac(e)&&++e.cacheID&&(e.rec=e())})},fV=function(e,t){var r;for(tu=0;tu<mi.length;tu++)r=mi[tu],r&&(!t||r._ctx===t)&&(e?r.kill(1):r.revert(!0,!0));s4=!0,t&&gce(t),t||Zv("revert")},xce=function(e,t){wi.cache++,(t||!nu)&&wi.forEach(function(r){return Ac(r)&&r.cacheID++&&(r.rec=0)}),Rd(e)&&(bi.history.scrollRestoration=oV=e)},nu,Ov=0,DY,E6e=function(){if(DY!==Ov){var e=DY=Ov;requestAnimationFrame(function(){return e===Ov&&dv(!0)})}},vce=function(){Cs.appendChild(Eb),lV=!eu&&Eb.offsetHeight||bi.innerHeight,Cs.removeChild(Eb)},jY=function(e){return o5(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(t){return t.style.display=e?"none":"block"})},dv=function(e,t){if(Fd=Ps.documentElement,Cs=Ps.body,aV=[bi,Ps,Fd,Cs],Bh&&!e&&!s4){ol(di,"scrollEnd",mce);return}vce(),nu=di.isRefreshing=!0,s4||Ace();var r=Zv("refreshInit");ice&&di.sort(),t||fV(),wi.forEach(function(i){Ac(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),mi.slice(0).forEach(function(i){return i.refresh()}),s4=!1,mi.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",a=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-a),i.refresh()}}),PI=1,jY(!0),mi.forEach(function(i){var s=i0(i.scroller,i._dir),a=i.vars.end==="max"||i._endClamp&&i.end>s,o=i._startClamp&&i.start>=s;(a||o)&&i.setPositions(o?s-1:i.start,a?Math.max(o?s:i.start+1,s):i.end,!0)}),jY(!1),PI=0,r.forEach(function(i){return i&&i.render&&i.render(-1)}),wi.forEach(function(i){Ac(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),xce(oV,1),RM.pause(),Ov++,nu=2,qm(2),mi.forEach(function(i){return Ac(i.vars.onRefresh)&&i.vars.onRefresh(i)}),nu=di.isRefreshing=!1,Zv("refresh")},OI=0,d6=1,u4,qm=function(e){if(e===2||!nu&&!s4){di.isUpdating=!0,u4&&u4.update(0);var t=mi.length,r=hc(),i=r-d9>=50,s=t&&mi[0].scroll();if(d6=OI>s?-1:1,nu||(OI=s),i&&(Bh&&!G8&&r-Bh>200&&(Bh=0,Zv("scrollEnd")),ES=d9,d9=r),d6<0){for(tu=t;tu-- >0;)mi[tu]&&mi[tu].update(0,i);d6=1}else for(tu=0;tu<t;tu++)mi[tu]&&mi[tu].update(0,i);di.isUpdating=!1}l5=0},DI=[hce,fce,uV,cV,Rh+c4,Rh+a4,Rh+l4,Rh+o4,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],h6=DI.concat([Pv,Lv,"boxSizing","max"+uw,"max"+dV,"position",Rh,_o,_o+l4,_o+a4,_o+c4,_o+o4]),C6e=function(e,t,r){Cb(r);var i=e._gsap;if(i.spacerIsNative)Cb(i.spacerState);else if(e._gsap.swappedIn){var s=t.parentNode;s&&(s.insertBefore(e,t),s.removeChild(t))}e._gsap.swappedIn=!1},f9=function(e,t,r,i){if(!e._gsap.swappedIn){for(var s=DI.length,a=t.style,o=e.style,l;s--;)l=DI[s],a[l]=r[l];a.position=r.position==="absolute"?"absolute":"relative",r.display==="inline"&&(a.display="inline-block"),o[uV]=o[cV]="auto",a.flexBasis=r.flexBasis||"auto",a.overflow="visible",a.boxSizing="border-box",a[Pv]=PM(e,cu)+Bo,a[Lv]=PM(e,zo)+Bo,a[_o]=o[Rh]=o[fce]=o[hce]="0",Cb(i),o[Pv]=o["max"+uw]=r[Pv],o[Lv]=o["max"+dV]=r[Lv],o[_o]=r[_o],e.parentNode!==t&&(e.parentNode.insertBefore(t,e),t.appendChild(e)),e._gsap.swappedIn=!0}},N6e=/([A-Z])/g,Cb=function(e){if(e){var t=e.t.style,r=e.length,i=0,s,a;for((e.t._gsap||dr.core.getCache(e.t)).uncache=1;i<r;i+=2)a=e[i+1],s=e[i],a?t[s]=a:t[s]&&t.removeProperty(s.replace(N6e,"-$1").toLowerCase())}},qE=function(e){for(var t=h6.length,r=e.style,i=[],s=0;s<t;s++)i.push(h6[s],r[h6[s]]);return i.t=e,i},M6e=function(e,t,r){for(var i=[],s=e.length,a=r?8:0,o;a<s;a+=2)o=e[a],i.push(o,o in t?t[o]:e[a+1]);return i.t=e.t,i},f6={left:0,top:0},IY=function(e,t,r,i,s,a,o,l,u,d,h,f,p,g){Ac(e)&&(e=e(l)),Rd(e)&&e.substr(0,3)==="max"&&(e=f+(e.charAt(4)==="="?c6("0"+e.substr(3),r):0));var A=p?p.time():0,x,b,_;if(p&&p.seek(0),isNaN(e)||(e=+e),MS(e))p&&(e=dr.utils.mapRange(p.scrollTrigger.start,p.scrollTrigger.end,0,f,e)),o&&u6(o,r,i,!0);else{Ac(t)&&(t=t(l));var M=(e||"0").split(" "),T,L,D,P;_=Pu(t,l)||Cs,T=Pm(_)||{},(!T||!T.left&&!T.top)&&Ph(_).display==="none"&&(P=_.style.display,_.style.display="block",T=Pm(_),P?_.style.display=P:_.style.removeProperty("display")),L=c6(M[0],T[i.d]),D=c6(M[1]||"0",r),e=T[i.p]-u[i.p]-d+L+s-D,o&&u6(o,D,i,r-D<20||o._isStart&&D>20),r-=r-D}if(g&&(l[g]=e||-.001,e<0&&(e=0)),a){var O=e+r,F=a._isStart;x="scroll"+i.d2,u6(a,O,i,F&&O>20||!F&&(h?Math.max(Cs[x],Fd[x]):a.parentNode[x])<=O+1),h&&(u=Pm(o),h&&(a.style[i.op.p]=u[i.op.p]-i.op.m-a._offset+Bo))}return p&&_&&(x=Pm(_),p.seek(f),b=Pm(_),p._caScrollDist=x[i.p]-b[i.p],e=e/p._c
vendor: 8,742 bytes, line 121
121aScrollDist*f),p&&p.seek(A),p?e:Math.round(e)},k6e=/(webkit|moz|length|cssText|inset)/i,FY=function(e,t,r,i){if(e.parentNode!==t){var s=e.style,a,o;if(t===Cs){e._stOrig=s.cssText,o=Ph(e);for(a in o)!+a&&!k6e.test(a)&&o[a]&&typeof s[a]=="string"&&a!=="0"&&(s[a]=o[a]);s.top=r,s.left=i}else s.cssText=e._stOrig;dr.core.getCache(e).uncache=1,t.appendChild(e)}},yce=function(e,t,r){var i=t,s=i;return function(a){var o=Math.round(e());return o!==i&&o!==s&&Math.abs(o-i)>3&&Math.abs(o-s)>3&&(a=o,r&&r()),s=i,i=Math.round(a),i}},$E=function(e,t,r){var i={};i[t.p]="+="+r,dr.set(e,i)},UY=function(e,t){var r=S1(e,t),i="_scroll"+t.p2,s=function a(o,l,u,d,h){var f=a.tween,p=l.onComplete,g={};u=u||r();var A=yce(r,u,function(){f.kill(),a.tween=0});return h=d&&h||0,d=d||o-u,f&&f.kill(),l[i]=o,l.inherit=!1,l.modifiers=g,g[i]=function(){return A(u+d*f.ratio+h*f.ratio*f.ratio)},l.onUpdate=function(){wi.cache++,a.tween&&qm()},l.onComplete=function(){a.tween=0,p&&p.call(f)},f=a.tween=dr.to(e,l),f};return e[i]=r,r.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},ol(e,"wheel",r.wheelHandler),di.isTouch&&ol(e,"touchmove",r.wheelHandler),s},di=(function(){function n(t,r){eb||n.register(dr)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),RI(this),this.init(t,r)}var e=n.prototype;return e.init=function(r,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!CS){this.update=this.refresh=this.kill=Hp;return}r=PY(Rd(r)||MS(r)||r.nodeType?{trigger:r}:r,zE);var s=r,a=s.onUpdate,o=s.toggleClass,l=s.id,u=s.onToggle,d=s.onRefresh,h=s.scrub,f=s.trigger,p=s.pin,g=s.pinSpacing,A=s.invalidateOnRefresh,x=s.anticipatePin,b=s.onScrubComplete,_=s.onSnapComplete,M=s.once,T=s.snap,L=s.pinReparent,D=s.pinSpacer,P=s.containerAnimation,O=s.fastScrollEnd,F=s.preventOverlaps,U=r.horizontal||r.containerAnimation&&r.horizontal!==!1?cu:zo,B=!h&&h!==0,z=Pu(r.scroller||bi),H=dr.core.getCache(z),X=Qv(z),W=("pinType"in r?r.pinType:s1(z,"pinType")||X&&"fixed")==="fixed",J=[r.onEnter,r.onLeave,r.onEnterBack,r.onLeaveBack],ee=B&&r.toggleActions.split(" "),ae="markers"in r?r.markers:zE.markers,le=X?0:parseFloat(Ph(z)["border"+U.p2+uw])||0,Z=this,Y=r.onRefreshInit&&function(){return r.onRefreshInit(Z)},re=y6e(z,X,U),_e=b6e(z,X),Ee=0,Ae=0,te=0,ve=S1(z,U),we,Ue,ze,yt,mt,bt,dt,St,kt,Fe,Ze,Ye,ft,At,Ce,Se,qe,pt,Te,oe,ge,Ne,ke,Xe,et,Qe,lt,tt,Ft,Mt,Nt,Je,fn,Tn,nt,Kt,Lt,cn,dn;if(Z._startClamp=Z._endClamp=!1,Z._dir=U,x*=45,Z.scroller=z,Z.scroll=P?P.time.bind(P):ve,yt=ve(),Z.vars=r,i=i||r.animation,"refreshPriority"in r&&(ice=1,r.refreshPriority===-9999&&(u4=Z)),H.tweenScroll=H.tweenScroll||{top:UY(z,zo),left:UY(z,cu)},Z.tweenTo=we=H.tweenScroll[U.p],Z.scrubDuration=function(xe){fn=MS(xe)&&xe,fn?Je?Je.duration(xe):Je=dr.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:fn,paused:!0,onComplete:function(){return b&&b(Z)}}):(Je&&Je.progress(1).kill(),Je=0)},i&&(i.vars.lazy=!1,i._initted&&!Z.isReverted||i.vars.immediateRender!==!1&&r.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),Z.animation=i.pause(),i.scrollTrigger=Z,Z.scrubDuration(h),Mt=0,l||(l=i.vars.id)),T&&((!zx(T)||T.push)&&(T={snapTo:T}),"scrollBehavior"in Cs.style&&dr.set(X?[Cs,Fd]:z,{scrollBehavior:"auto"}),wi.forEach(function(xe){return Ac(xe)&&xe.target===(X?Ps.scrollingElement||Fd:z)&&(xe.smooth=!1)}),ze=Ac(T.snapTo)?T.snapTo:T.snapTo==="labels"?_6e(i):T.snapTo==="labelsDirectional"?S6e(i):T.directional!==!1?function(xe,Oe){return hV(T.snapTo)(xe,hc()-Ae<500?0:Oe.direction)}:dr.utils.snap(T.snapTo),Tn=T.duration||{min:.1,max:2},Tn=zx(Tn)?i4(Tn.min,Tn.max):i4(Tn,Tn),nt=dr.delayedCall(T.delay||fn/2||.1,function(){var xe=ve(),Oe=hc()-Ae<500,Ge=we.tween;if((Oe||Math.abs(Z.getVelocity())<10)&&!Ge&&!G8&&Ee!==xe){var $e=(xe-bt)/At,m=i&&!B?i.totalProgress():$e,be=Oe?0:(m-Nt)/(hc()-ES)*1e3||0,en=dr.utils.clamp(-$e,1-$e,t2(be/2)*be/.185),on=$e+(T.inertia===!1?0:en),tn,Qt,Pt=T,bn=Pt.onStart,wn=Pt.onInterrupt,zn=Pt.onComplete;if(tn=ze(on,Z),MS(tn)||(tn=on),Qt=Math.max(0,Math.round(bt+tn*At)),xe<=dt&&xe>=bt&&Qt!==xe){if(Ge&&!Ge._initted&&Ge.data<=t2(Qt-xe))return;T.inertia===!1&&(en=tn-$e),we(Qt,{duration:Tn(t2(Math.max(t2(on-m),t2(tn-m))*.185/be/.05||0)),ease:T.ease||"power3",data:t2(Qt-xe),onInterrupt:function(){return nt.restart(!0)&&wn&&e2(Z,wn)},onComplete:function(){Z.update(),Ee=ve(),i&&!B&&(Je?Je.resetTo("totalProgress",tn,i._tTime/i._tDur):i.progress(tn)),Mt=Nt=i&&!B?i.totalProgress():Z.progress,_&&_(Z),zn&&e2(Z,zn)}},xe,en*At,Qt-xe-en*At),bn&&e2(Z,bn,we.tween)}}else Z.isActive&&Ee!==xe&&nt.restart(!0)}).pause()),l&&(LI[l]=Z),f=Z.trigger=Pu(f||p!==!0&&p),dn=f&&f._gsap&&f._gsap.stRevert,dn&&(dn=dn(Z)),p=p===!0?f:Pu(p),Rd(o)&&(o={targets:f,className:o}),p&&(g===!1||g===Rh||(g=!g&&p.parentNode&&p.parentNode.style&&Ph(p.parentNode).display==="flex"?!1:_o),Z.pin=p,Ue=dr.core.getCache(p),Ue.spacer?Ce=Ue.pinState:(D&&(D=Pu(D),D&&!D.nodeType&&(D=D.current||D.nativeElement),Ue.spacerIsNative=!!D,D&&(Ue.spacerState=qE(D))),Ue.spacer=pt=D||Ps.createElement("div"),pt.classList.add("pin-spacer"),l&&pt.classList.add("pin-spacer-"+l),Ue.pinState=Ce=qE(p)),r.force3D!==!1&&dr.set(p,{force3D:!0}),Z.spacer=pt=Ue.spacer,Ft=Ph(p),Xe=Ft[g+U.os2],oe=dr.getProperty(p),ge=dr.quickSetter(p,U.a,Bo),f9(p,pt,Ft),qe=qE(p)),ae){Ye=zx(ae)?PY(ae,LY):LY,Fe=GE("scroller-start",l,z,U,Ye,0),Ze=GE("scroller-end",l,z,U,Ye,0,Fe),Te=Fe["offset"+U.op.d2];var Bt=Pu(s1(z,"content")||z);St=this.markerStart=GE("start",l,Bt,U,Ye,Te,0,P),kt=this.markerEnd=GE("end",l,Bt,U,Ye,Te,0,P),P&&(cn=dr.quickSetter([St,kt],U.a,Bo)),!W&&!(g0.length&&s1(z,"fixedMarkers")===!0)&&(w6e(X?Cs:z),dr.set([Fe,Ze],{force3D:!0}),Qe=dr.quickSetter(Fe,U.a,Bo),tt=dr.quickSetter(Ze,U.a,Bo))}if(P){var Ht=P.vars.onUpdate,qt=P.vars.onUpdateParams;P.eventCallback("onUpdate",function(){Z.update(0,0,1),Ht&&Ht.apply(P,qt||[])})}if(Z.previous=function(){return mi[mi.indexOf(Z)-1]},Z.next=function(){return mi[mi.indexOf(Z)+1]},Z.revert=function(xe,Oe){if(!Oe)return Z.kill(!0);var Ge=xe!==!1||!Z.enabled,$e=lc;Ge!==Z.isReverted&&(Ge&&(Kt=Math.max(ve(),Z.scroll.rec||0),te=Z.progress,Lt=i&&i.progress()),St&&[St,kt,Fe,Ze].forEach(function(m){return m.style.display=Ge?"none":"block"}),Ge&&(lc=Z,Z.update(Ge)),p&&(!L||!Z.isActive)&&(Ge?C6e(p,pt,Ce):f9(p,pt,Ph(p),et)),Ge||Z.update(Ge),lc=$e,Z.isReverted=Ge)},Z.refresh=function(xe,Oe,Ge,$e){if(!((lc||!Z.enabled)&&!Oe)){if(p&&xe&&Bh){ol(n,"scrollEnd",mce);return}!nu&&Y&&Y(Z),lc=Z,we.tween&&!Ge&&(we.tween.kill(),we.tween=0),Je&&Je.pause(),A&&i&&(i.revert({kill:!1}).invalidate(),i.getChildren?i.getChildren(!0,!0,!1).forEach(function(Rn){return Rn.vars.immediateRender&&Rn.render(0,!0,!0)}):i.vars.immediateRender&&i.render(0,!0,!0)),Z.isReverted||Z.revert(!0,!0),Z._subPinOffset=!1;var m=re(),be=_e(),en=P?P.duration():i0(z,U),on=At<=.01||!At,tn=0,Qt=$e||0,Pt=zx(Ge)?Ge.end:r.end,bn=r.endTrigger||f,wn=zx(Ge)?Ge.start:r.start||(r.start===0||!f?0:p?"0 0":"0 100%"),zn=Z.pinnedContainer=r.pinnedContainer&&Pu(r.pinnedContainer,Z),Un=f&&Math.max(0,mi.indexOf(Z))||0,_n=Un,xr,Ir,is,si,vr,Yi,Vi,Pe,He,ce,at,vt,vn;for(ae&&zx(Ge)&&(vt=dr.getProperty(Fe,U.p),vn=dr.getProperty(Ze,U.p));_n-- >0;)Yi=mi[_n],Yi.end||Yi.refresh(0,1)||(lc=Z),Vi=Yi.pin,Vi&&(Vi===f||Vi===p||Vi===zn)&&!Yi.isReverted&&(ce||(ce=[]),ce.unshift(Yi),Yi.revert(!0,!0)),Yi!==mi[_n]&&(Un--,_n--);for(Ac(wn)&&(wn=wn(Z)),wn=NY(wn,"start",Z),bt=IY(wn,f,m,U,ve(),St,Fe,Z,be,le,W,en,P,Z._startClamp&&"_startClamp")||(p?-.001:0),Ac(Pt)&&(Pt=Pt(Z)),Rd(Pt)&&!Pt.indexOf("+=")&&(~Pt.indexOf(" ")?Pt=(Rd(wn)?wn.split(" ")[0]:"")+Pt:(tn=c6(Pt.substr(2),m),Pt=Rd(wn)?wn:(P?dr.utils.mapRange(0,P.duration(),P.scrollTrigger.start,P.scrollTrigger.end,bt):bt)+tn,bn=f)),Pt=NY(Pt,"end",Z),dt=Math.max(bt,IY(Pt||(bn?"100% 0":en),bn,m,U,ve()+tn,kt,Ze,Z,be,le,W,en,P,Z._endClamp&&"_endClamp"))||-.001,tn=0,_n=Un;_n--;)Yi=mi[_n]||{},Vi=Yi.pin,Vi&&Yi.start-Yi._pinPush<=bt&&!P&&Yi.end>0&&(xr=Yi.end-(Z._startClamp?Math.max(0,Yi.start):Yi.start),(Vi===f&&Yi.start-Yi._pinPush<bt||Vi===zn)&&isNaN(wn)&&(tn+=xr*(1-Yi.progress)),Vi===p&&(Qt+=xr));if(bt+=tn,dt+=tn,Z._startClamp&&(Z._startClamp+=tn),Z._endClamp&&!nu&&(Z._endClamp=dt||-.001,dt=Math.min(dt,i0(z,U))),At=dt-bt||(bt-=.01)&&.001,on&&(te=dr.utils.clamp(0,1,dr.utils.normalize(bt,dt,Kt))),Z._pinPush=Qt,St&&tn&&(xr={},xr[U.a]="+="+tn,zn&&(xr[U.p]="-="+ve()),dr.set([St,kt],xr)),p&&!(PI&&Z.end>=i0(z,U)))xr=Ph(p),si=U===zo,is=ve(),Ne=parseFloat(oe(U.a))+Qt,!en&&dt>1&&(at=(X?Ps.scrollingElement||Fd:z).style,at={style:at,value:at["overflow"+U.a.toUpperCase()]},X&&Ph(Cs)["overflow"+U.a.toUpperCase()]!=="scroll"&&(at.style["overflow"+U.a.toUpperCase()]="scroll")),f9(p,pt,xr),qe=qE(p),Ir=Pm(p,!0),Pe=W&&S1(z,si?cu:zo)(),g?(et=[g+U.os2,At+Qt+Bo],et.t=pt,_n=g===_o?PM(p,U)+At+Qt:0,_n&&(et.push(U.d,_n+Bo),pt.style.flexBasis!=="auto"&&(pt.
vendor: 5,232 bytes, line 121
121style.flexBasis=_n+Bo)),Cb(et),zn&&mi.forEach(function(Rn){Rn.pin===zn&&Rn.vars.pinSpacing!==!1&&(Rn._subPinOffset=!0)}),W&&ve(Kt)):(_n=PM(p,U),_n&&pt.style.flexBasis!=="auto"&&(pt.style.flexBasis=_n+Bo)),W&&(vr={top:Ir.top+(si?is-bt:Pe)+Bo,left:Ir.left+(si?Pe:is-bt)+Bo,boxSizing:"border-box",position:"fixed"},vr[Pv]=vr["max"+uw]=Math.ceil(Ir.width)+Bo,vr[Lv]=vr["max"+dV]=Math.ceil(Ir.height)+Bo,vr[Rh]=vr[Rh+l4]=vr[Rh+a4]=vr[Rh+c4]=vr[Rh+o4]="0",vr[_o]=xr[_o],vr[_o+l4]=xr[_o+l4],vr[_o+a4]=xr[_o+a4],vr[_o+c4]=xr[_o+c4],vr[_o+o4]=xr[_o+o4],Se=M6e(Ce,vr,L),nu&&ve(0)),i?(He=i._initted,c9(1),i.render(i.duration(),!0,!0),ke=oe(U.a)-Ne+At+Qt,lt=Math.abs(At-ke)>1,W&<&&Se.splice(Se.length-2,2),i.render(0,!0,!0),He||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),c9(0)):ke=At,at&&(at.value?at.style["overflow"+U.a.toUpperCase()]=at.value:at.style.removeProperty("overflow-"+U.a));else if(f&&ve()&&!P)for(Ir=f.parentNode;Ir&&Ir!==Cs;)Ir._pinOffset&&(bt-=Ir._pinOffset,dt-=Ir._pinOffset),Ir=Ir.parentNode;ce&&ce.forEach(function(Rn){return Rn.revert(!1,!0)}),Z.start=bt,Z.end=dt,yt=mt=nu?Kt:ve(),!P&&!nu&&(yt<Kt&&ve(Kt),Z.scroll.rec=0),Z.revert(!1,!0),Ae=hc(),nt&&(Ee=-1,nt.restart(!0)),lc=0,i&&B&&(i._initted||Lt)&&i.progress()!==Lt&&i.progress(Lt||0,!0).render(i.time(),!0,!0),(on||te!==Z.progress||P||A||i&&!i._initted)&&(i&&!B&&(i._initted||te||i.vars.immediateRender!==!1)&&i.totalProgress(P&&bt<-.001&&!te?dr.utils.normalize(bt,dt,0):te,!0),Z.progress=on||(yt-bt)/At===te?0:te),p&&g&&(pt._pinOffset=Math.round(Z.progress*ke)),Je&&Je.invalidate(),isNaN(vt)||(vt-=dr.getProperty(Fe,U.p),vn-=dr.getProperty(Ze,U.p),$E(Fe,U,vt),$E(St,U,vt-($e||0)),$E(Ze,U,vn),$E(kt,U,vn-($e||0))),on&&!nu&&Z.update(),d&&!nu&&!ft&&(ft=!0,d(Z),ft=!1)}},Z.getVelocity=function(){return(ve()-mt)/(hc()-ES)*1e3||0},Z.endAnimation=function(){y3(Z.callbackAnimation),i&&(Je?Je.progress(1):i.paused()?B||y3(i,Z.direction<0,1):y3(i,i.reversed()))},Z.labelToScroll=function(xe){return i&&i.labels&&(bt||Z.refresh()||bt)+i.labels[xe]/i.duration()*At||0},Z.getTrailing=function(xe){var Oe=mi.indexOf(Z),Ge=Z.direction>0?mi.slice(0,Oe).reverse():mi.slice(Oe+1);return(Rd(xe)?Ge.filter(function($e){return $e.vars.preventOverlaps===xe}):Ge).filter(function($e){return Z.direction>0?$e.end<=bt:$e.start>=dt})},Z.update=function(xe,Oe,Ge){if(!(P&&!Ge&&!xe)){var $e=nu===!0?Kt:Z.scroll(),m=xe?0:($e-bt)/At,be=m<0?0:m>1?1:m||0,en=Z.progress,on,tn,Qt,Pt,bn,wn,zn,Un;if(Oe&&(mt=yt,yt=P?ve():$e,T&&(Nt=Mt,Mt=i&&!B?i.totalProgress():be)),x&&p&&!lc&&!FE&&Bh&&(!be&&bt<$e+($e-mt)/(hc()-ES)*x?be=1e-4:be===1&&dt>$e+($e-mt)/(hc()-ES)*x&&(be=.9999)),be!==en&&Z.enabled){if(on=Z.isActive=!!be&&be<1,tn=!!en&&en<1,wn=on!==tn,bn=wn||!!be!=!!en,Z.direction=be>en?1:-1,Z.progress=be,bn&&!lc&&(Qt=be&&!en?0:be===1?1:en===1?2:3,B&&(Pt=!wn&&ee[Qt+1]!=="none"&&ee[Qt+1]||ee[Qt],Un=i&&(Pt==="complete"||Pt==="reset"||Pt in i))),F&&(wn||Un)&&(Un||h||!i)&&(Ac(F)?F(Z):Z.getTrailing(F).forEach(function(is){return is.endAnimation()})),B||(Je&&!lc&&!FE?(Je._dp._time-Je._start!==Je._time&&Je.render(Je._dp._time-Je._start),Je.resetTo?Je.resetTo("totalProgress",be,i._tTime/i._tDur):(Je.vars.totalProgress=be,Je.invalidate().restart())):i&&i.totalProgress(be,!!(lc&&(Ae||xe)))),p){if(xe&&g&&(pt.style[g+U.os2]=Xe),!W)ge(NS(Ne+ke*be));else if(bn){if(zn=!xe&&be>en&&dt+1>$e&&$e+1>=i0(z,U),L)if(!xe&&(on||zn)){var _n=Pm(p,!0),xr=$e-bt;FY(p,Cs,_n.top+(U===zo?xr:0)+Bo,_n.left+(U===zo?0:xr)+Bo)}else FY(p,pt);Cb(on||zn?Se:qe),lt&&be<1&&on||ge(Ne+(be===1&&!zn?ke:0))}}T&&!we.tween&&!lc&&!FE&&nt.restart(!0),o&&(wn||M&&be&&(be<1||!u9))&&o5(o.targets).forEach(function(is){return is.classList[on||M?"add":"remove"](o.className)}),a&&!B&&!xe&&a(Z),bn&&!lc?(B&&(Un&&(Pt==="complete"?i.pause().totalProgress(1):Pt==="reset"?i.restart(!0).pause():Pt==="restart"?i.restart(!0):i[Pt]()),a&&a(Z)),(wn||!u9)&&(u&&wn&&e2(Z,u),J[Qt]&&e2(Z,J[Qt]),M&&(be===1?Z.kill(!1,1):J[Qt]=0),wn||(Qt=be===1?1:3,J[Qt]&&e2(Z,J[Qt]))),O&&!on&&Math.abs(Z.getVelocity())>(MS(O)?O:2500)&&(y3(Z.callbackAnimation),Je?Je.progress(1):y3(i,Pt==="reverse"?1:!be,1))):B&&a&&!lc&&a(Z)}if(tt){var Ir=P?$e/P.duration()*(P._caScrollDist||0):$e;Qe(Ir+(Fe._isFlipped?1:0)),tt(Ir)}cn&&cn(-$e/P.duration()*(P._caScrollDist||0))}},Z.enable=function(xe,Oe){Z.enabled||(Z.enabled=!0,ol(z,"resize",kS),X||ol(z,"scroll",n2),Y&&ol(n,"refreshInit",Y),xe!==!1&&(Z.progress=te=0,yt=mt=Ee=ve()),Oe!==!1&&Z.refresh())},Z.getTween=function(xe){return xe&&we?we.tween:Je},Z.setPositions=function(xe,Oe,Ge,$e){if(P){var m=P.scrollTrigger,be=P.duration(),en=m.end-m.start;xe=m.start+en*xe/be,Oe=m.start+en*Oe/be}Z.refresh(!1,!1,{start:MY(xe,Ge&&!!Z._startClamp),end:MY(Oe,Ge&&!!Z._endClamp)},$e),Z.update()},Z.adjustPinSpacing=function(xe){if(et&&xe){var Oe=et.indexOf(U.d)+1;et[Oe]=parseFloat(et[Oe])+xe+Bo,et[1]=parseFloat(et[1])+xe+Bo,Cb(et)}},Z.disable=function(xe,Oe){if(xe!==!1&&Z.revert(!0,!0),Z.enabled&&(Z.enabled=Z.isActive=!1,Oe||Je&&Je.pause(),Kt=0,Ue&&(Ue.uncache=1),Y&&al(n,"refreshInit",Y),nt&&(nt.pause(),we.tween&&we.tween.kill()&&(we.tween=0)),!X)){for(var Ge=mi.length;Ge--;)if(mi[Ge].scroller===z&&mi[Ge]!==Z)return;al(z,"resize",kS),X||al(z,"scroll",n2)}},Z.kill=function(xe,Oe){Z.disable(xe,Oe),Je&&!Oe&&Je.kill(),l&&delete L
vendor: 8,573 bytes, line 121
121I[l];var Ge=mi.indexOf(Z);Ge>=0&&mi.splice(Ge,1),Ge===tu&&d6>0&&tu--,Ge=0,mi.forEach(function($e){return $e.scroller===Z.scroller&&(Ge=1)}),Ge||nu||(Z.scroll.rec=0),i&&(i.scrollTrigger=null,xe&&i.revert({kill:!1}),Oe||i.kill()),St&&[St,kt,Fe,Ze].forEach(function($e){return $e.parentNode&&$e.parentNode.removeChild($e)}),u4===Z&&(u4=0),p&&(Ue&&(Ue.uncache=1),Ge=0,mi.forEach(function($e){return $e.pin===p&&Ge++}),Ge||(Ue.spacer=0)),r.onKill&&r.onKill(Z)},mi.push(Z),Z.enable(!1,!1),dn&&dn(Z),i&&i.add&&!At){var Fn=Z.update;Z.update=function(){Z.update=Fn,wi.cache++,bt||dt||Z.refresh()},dr.delayedCall(.01,Z.update),At=.01,bt=dt=0}else Z.refresh();p&&E6e()},n.register=function(r){return eb||(dr=r||cce(),lce()&&window.document&&n.enable(),eb=CS),eb},n.defaults=function(r){if(r)for(var i in r)zE[i]=r[i];return zE},n.disable=function(r,i){CS=0,mi.forEach(function(a){return a[i?"kill":"disable"](r)}),al(bi,"wheel",n2),al(Ps,"scroll",n2),clearInterval(IE),al(Ps,"touchcancel",Hp),al(Cs,"touchstart",Hp),BE(al,Ps,"pointerdown,touchstart,mousedown",kY),BE(al,Ps,"pointerup,touchend,mouseup",RY),RM.kill(),UE(al);for(var s=0;s<wi.length;s+=3)VE(al,wi[s],wi[s+1]),VE(al,wi[s],wi[s+2])},n.enable=function(){if(bi=window,Ps=document,Fd=Ps.documentElement,Cs=Ps.body,dr){if(o5=dr.utils.toArray,i4=dr.utils.clamp,RI=dr.core.context||Hp,c9=dr.core.suppressOverwrites||Hp,oV=bi.history.scrollRestoration||"auto",OI=bi.pageYOffset||0,dr.core.globals("ScrollTrigger",n),Cs){CS=1,Eb=document.createElement("div"),Eb.style.height="100vh",Eb.style.position="absolute",vce(),v6e(),co.register(dr),n.isTouch=co.isTouch,xA=co.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),kI=co.isTouch===1,ol(bi,"wheel",n2),aV=[bi,Ps,Fd,Cs],dr.matchMedia?(n.matchMedia=function(d){var h=dr.matchMedia(),f;for(f in d)h.add(f,d[f]);return h},dr.addEventListener("matchMediaInit",function(){Ace(),fV()}),dr.addEventListener("matchMediaRevert",function(){return gce()}),dr.addEventListener("matchMedia",function(){dv(0,1),Zv("matchMedia")}),dr.matchMedia().add("(orientation: portrait)",function(){return h9(),h9})):console.warn("Requires GSAP 3.11.0 or later"),h9(),ol(Ps,"scroll",n2);var r=Cs.hasAttribute("style"),i=Cs.style,s=i.borderTopStyle,a=dr.core.Animation.prototype,o,l;for(a.revert||Object.defineProperty(a,"revert",{value:function(){return this.time(-.01,!0)}}),i.borderTopStyle="solid",o=Pm(Cs),zo.m=Math.round(o.top+zo.sc())||0,cu.m=Math.round(o.left+cu.sc())||0,s?i.borderTopStyle=s:i.removeProperty("border-top-style"),r||(Cs.setAttribute("style",""),Cs.removeAttribute("style")),IE=setInterval(OY,250),dr.delayedCall(.5,function(){return FE=0}),ol(Ps,"touchcancel",Hp),ol(Cs,"touchstart",Hp),BE(ol,Ps,"pointerdown,touchstart,mousedown",kY),BE(ol,Ps,"pointerup,touchend,mouseup",RY),MI=dr.utils.checkPrefix("transform"),h6.push(MI),eb=hc(),RM=dr.delayedCall(.2,dv).pause(),tb=[Ps,"visibilitychange",function(){var d=bi.innerWidth,h=bi.innerHeight;Ps.hidden?(EY=d,CY=h):(EY!==d||CY!==h)&&kS()},Ps,"DOMContentLoaded",dv,bi,"load",dv,bi,"resize",kS],UE(ol),mi.forEach(function(d){return d.enable(0,1)}),l=0;l<wi.length;l+=3)VE(al,wi[l],wi[l+1]),VE(al,wi[l],wi[l+2])}else if(Ps){var u=function d(){n.enable(),Ps.removeEventListener("DOMContentLoaded",d)};Ps.addEventListener("DOMContentLoaded",u)}}},n.config=function(r){"limitCallbacks"in r&&(u9=!!r.limitCallbacks);var i=r.syncInterval;i&&clearInterval(IE)||(IE=i)&&setInterval(OY,i),"ignoreMobileResize"in r&&(kI=n.isTouch===1&&r.ignoreMobileResize),"autoRefreshEvents"in r&&(UE(al)||UE(ol,r.autoRefreshEvents||"none"),sce=(r.autoRefreshEvents+"").indexOf("resize")===-1)},n.scrollerProxy=function(r,i){var s=Pu(r),a=wi.indexOf(s),o=Qv(s);~a&&wi.splice(a,o?6:2),i&&(o?g0.unshift(bi,i,Cs,i,Fd,i):g0.unshift(s,i))},n.clearMatchMedia=function(r){mi.forEach(function(i){return i._ctx&&i._ctx.query===r&&i._ctx.kill(!0,!0)})},n.isInViewport=function(r,i,s){var a=(Rd(r)?Pu(r):r).getBoundingClientRect(),o=a[s?Pv:Lv]*i||0;return s?a.right-o>0&&a.left+o<bi.innerWidth:a.bottom-o>0&&a.top+o<bi.innerHeight},n.positionInViewport=function(r,i,s){Rd(r)&&(r=Pu(r));var a=r.getBoundingClientRect(),o=a[s?Pv:Lv],l=i==null?o/2:i in LM?LM[i]*o:~i.indexOf("%")?parseFloat(i)*o/100:parseFloat(i)||0;return s?(a.left+l)/bi.innerWidth:(a.top+l)/bi.innerHeight},n.killAll=function(r){if(mi.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),r!==!0){var i=Kv.killAll||[];Kv={},i.forEach(function(s){return s()})}},n})();di.version="3.15.0";di.saveStyles=function(n){return n?o5(n).forEach(function(e){if(e&&e.style){var t=kd.indexOf(e);t>=0&&kd.splice(t,5),kd.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),dr.core.getCache(e),RI())}}):kd};di.revert=function(n,e){return fV(!n,e)};di.create=function(n,e){return new di(n,e)};di.refresh=function(n){return n?kS(!0):(eb||di.register())&&dv(!0)};di.update=function(n){return++wi.cache&&qm(n===!0?2:0)};di.clearScrollMemory=xce;di.maxScroll=function(n,e){return i0(n,e?cu:zo)};di.getScrollFunc=function(n,e){return S1(Pu(n),e?cu:zo)};di.getById=function(n){return LI[n]};di.getAll=function(){return mi.filter(function(n){return n.vars.id!=="ScrollSmoother"})};di.isScrolling=function(){return!!Bh};di.snapDirectional=hV;di.addEventListener=function(n,e){var t=Kv[n]||(Kv[n]=[]);~t.indexOf(e)||t.push(e)};di.removeEventListener=function(n,e){var t=Kv[n],r=t&&t.indexOf(e);r>=0&&t.splice(r,1)};di.batch=function(n,e){var t=[],r={},i=e.interval||.016,s=e.batchMax||1e9,a=function(u,d){var h=[],f=[],p=dr.delayedCall(i,function(){d(h,f),h=[],f=[]}).pause();return function(g){h.length||p.restart(!0),h.push(g.trigger),f.push(g),s<=h.length&&p.progress(1)}},o;for(o in e)r[o]=o.substr(0,2)==="on"&&Ac(e[o])&&o!=="onRefreshInit"?a(o,e[o]):e[o];return Ac(s)&&(s=s(),ol(di,"refresh",function(){return s=e.batchMax()})),o5(n).forEach(function(l){var u={};for(o in r)u[o]=r[o];u.trigger=l,t.push(di.create(u))}),t};var BY=function(e,t,r,i){return t>i?e(i):t<0&&e(0),r>i?(i-t)/(r-t):r<0?t/(t-r):1},p9=function n(e,t){t===!0?e.style.removeProperty("touch-action"):e.style.touchAction=t===!0?"auto":t?"pan-"+t+(co.isTouch?" pinch-zoom":""):"none",e===Fd&&n(Cs,t)},HE={auto:1,scroll:1},R6e=function(e){var t=e.event,r=e.target,i=e.axis,s=(t.changedTouches?t.changedTouches[0]:t).target,a=s._gsap||dr.core.getCache(s),o=hc(),l;if(!a._isScrollT||o-a._isScrollT>2e3){for(;s&&s!==Cs&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(HE[(l=Ph(s)).overflowY]||HE[l.overflowX]));)s=s.parentNode;a._isScroll=s&&s!==r&&!Qv(s)&&(HE[(l=Ph(s)).overflowY]||HE[l.overflowX]),a._isScrollT=o}(a._isScroll||i==="x")&&(t.stopPropagation(),t._gsapAllow=!0)},bce=function(e,t,r,i){return co.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:i=i&&R6e,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return r&&ol(Ps,co.eventTypes[0],zY,!1,!0)},onDisable:function(){return al(Ps,co.eventTypes[0],zY,!0)}})},P6e=/(input|label|select|textarea)/i,VY,zY=function(e){var t=P6e.test(e.target.tagName);(t||VY)&&(e._gsapAllow=!0,VY=t)},L6e=function(e){zx(e)||(e={}),e.preventDefault=e.isNormalizer=e.allowClicks=!0,e.type||(e.type="wheel,touch"),e.debounce=!!e.debounce,e.id=e.id||"normalizer";var t=e,r=t.normalizeScrollX,i=t.momentum,s=t.allowNestedScroll,a=t.onRelease,o,l,u=Pu(e.target)||Fd,d=dr.core.globals().ScrollSmoother,h=d&&d.get(),f=xA&&(e.content&&Pu(e.content)||h&&e.content!==!1&&!h.smooth()&&h.content()),p=S1(u,zo),g=S1(u,cu),A=1,x=(co.isTouch&&bi.visualViewport?bi.visualViewport.scale*bi.visualViewport.width:bi.outerWidth)/bi.innerWidth,b=0,_=Ac(i)?function(){return i(o)}:function(){return i||2.8},M,T,L=bce(u,e.type,!0,s),D=function(){return T=!1},P=Hp,O=Hp,F=function(){l=i0(u,zo),O=i4(xA?1:0,l),r&&(P=i4(0,i0(u,cu))),M=Ov},U=function(){f._gsap.y=NS(parseFloat(f._gsap.y)+p.offset)+"px",f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(f._gsap.y)+", 0, 1)",p.offset=p.cacheID=0},B=function(){if(T){requestAnimationFrame(D);var ae=NS(o.deltaY/2),le=O(p.v-ae);if(f&&le!==p.v+p.offset){p.offset=le-p.v;var Z=NS((parseFloat(f&&f._gsap.y)||0)-p.offset);f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+Z+", 0, 1)",f._gsap.y=Z+"px",p.cacheID=wi.cache,qm()}return!0}p.offset&&U(),T=!0},z,H,X,W,J=function(){F(),z.isActive()&&z.vars.scrollY>l&&(p()>l?z.progress(1)&&p(l):z.resetTo("scrollY",l))};return f&&dr.set(f,{y:"+=0"}),e.ignoreCheck=function(ee){return xA&&ee.type==="touchmove"&&B()||A>1.05&&ee.type!=="touchstart"||o.isGesturing||ee.touches&&ee.touches.length>1},e.onPress=function(){T=!1;var ee=A;
121A=NS((bi.visualViewport&&bi.visualViewport.scale||1)/x),z.pause(),ee!==A&&p9(u,A>1.01?!0:r?!1:"x"),H=g(),X=p(),F(),M=Ov},e.onRelease=e.onGestureStart=function(ee,ae){if(p.offset&&U(),!ae)W.restart(!0);else{wi.cache++;var le=_(),Z,Y;r&&(Z=g(),Y=Z+le*.05*-ee.velocityX/.227,le*=BY(g,Z,Y,i0(u,cu)),z.vars.scrollX=P(Y)),Z=p(),Y=Z+le*.05*-ee.velocityY/.227,le*=BY(p,Z,Y,i0(u,zo)),z.vars.scrollY=O(Y),z.invalidate().duration(le).play(.01),(xA&&z.vars.scrollY>=l||Z>=l-1)&&dr.to({},{onUpdate:J,duration:le})}a&&a(ee)},e.onWheel=function(){z._ts&&z.pause(),hc()-b>1e3&&(M=0,b=hc())},e.onChange=function(ee,ae,le,Z,Y){if(Ov!==M&&F(),ae&&r&&g(P(Z[2]===ae?H+(ee.startX-ee.x):g()+ae-Z[1])),le){p.offset&&U();var re=Y[2]===le,_e=re?X+ee.startY-ee.y:p()+le-Y[1],Ee=O(_e);re&&_e!==Ee&&(X+=Ee-_e),p(Ee)}(le||ae)&&qm()},e.onEnable=function(){p9(u,r?!1:"x"),di.addEventListener("refresh",J),ol(bi,"resize",J),p.smooth&&(p.target.style.scrollBehavior="auto",p.smooth=g.smooth=!1),L.enable()},e.onDisable=function(){p9(u,!0),al(bi,"resize",J),di.removeEventListener("refresh",J),L.kill()},e.lockAxis=e.lockAxis!==!1,o=new co(e),o.iOS=xA,xA&&!p()&&p(1),xA&&dr.ticker.add(Hp),W=o._dc,z=dr.to(o,{ease:"power4",paused:!0,inherit:!1,scrollX:r?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:yce(p,p(),function(){return z.pause()})},onUpdate:qm,onComplete:W.vars.onComplete}),o};di.sort=function(n){if(Ac(n))return mi.sort(n);var e=bi.pageYOffset||0;return di.getAll().forEach(function(t){return t._sortY=t.trigger?e+t.trigger.getBoundingClientRect().top:t.start+bi.innerHeight}),mi.sort(n||function(t,r){return(t.vars.refreshPriority||0)*-1e6+(t.vars.containerAnimation?1e6:t._sortY)-((r.vars.containerAnimation?1e6:r._sortY)+(r.vars.refreshPriority||0)*-1e6)})};di.observe=function(n){return new co(n)};di.normalizeScroll=function(n){if(typeof n>"u")return eu;if(n===!0&&eu)return eu.enable();if(n===!1){eu&&eu.kill(),eu=n;return}var e=n instanceof co?n:L6e(n);return eu&&eu.target===e.target&&eu.kill(),Qv(e.target)&&(eu=e),e};di.core={_getVelocityProp:NI,_inputObserver:bce,_scrollers:wi,_proxies:g0,bridge:{ss:function(){Bh||Zv("scrollStart"),Bh=hc()},ref:function(){return lc}}};cce()&&dr.registerPlugin(di);var GY="1.3.26";function wce(n,e,t){return Math.max(n,Math.min(e,t))}function O6e(n,e,t){return(1-t)*n+t*e}function D6e(n,e,t,r){return O6e(n,e,1-Math.exp(-t*r))}function j6e(n,e){return(n%e+e)%e}var I6e=class{constructor(){rr(this,"isRunning",!1);rr(this,"value",0);rr(this,"from",0);rr(this,"to",0);rr(this,"currentTime",0);rr(this,"lerp");rr(this,"duration");rr(this,"easing");rr(this,"onUpdate")}advance(n){var t;if(!this.isRunning)return;let e=!1;if(this.duration&&this.easing){this.currentTime+=n;const r=wce(0,this.currentTime/this.duration,1);e=r>=1;const i=e?1:this.easing(r);this.value=this.from+(this.to-this.from)*i}else this.lerp?(this.value=D6e(this.value,this.to,this.lerp*60,n),Math.round(this.value)===Math.round(this.to)&&(this.value=this.to,e=!0)):(this.value=this.to,e=!0);e&&this.stop(),(t=this.onUpdate)==null||t.call(this,this.value,e)}stop(){this.isRunning=!1}fromTo(n,e,{lerp:t,duration:r,easing:i,onStart:s,onUpdate:a}){this.from=this.value=n,this.to=e,this.lerp=t,this.duration=r,this.easing=i,this.currentTime=0,this.isRunning=!0,s==null||s(),this.onUpdate=a}};function F6e(n,e){let t;return function(...r){clearTimeout(t),t=setTimeout(()=>{t=void 0,n.apply(this,r)},e)}}var U6e=class{constructor(n,e,{autoResize:t=!0,debounce:r=250}={}){rr(this,"width",0);rr(this,"height",0);rr(this,"scrollHeight",0);rr(this,"scrollWidth",0);rr(this,"debouncedResize");rr(this,"wrapperResizeObserver");rr(this,"contentResizeObserver");rr(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});rr(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});rr(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=n,this.content=e,t&&(this.debouncedResize=F6e(this.resize,r),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var n,e;(n=this.wrapperResizeObserver)==null||n.disconnect(),(e=this.contentResizeObserver)==null||e.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},_ce=class{constructor(){rr(this,"events",{})}emit(n,...e){var r;const t=this.events[n]||[];for(let i=0,s=t.length;i<s;i++)(r=t[i])==null||r.call(t,...e)}on(n,e){return this.events[n]?this.events[n].push(e):this.events[n]=[e],()=>{var t;this.events[n]=(t=this.events[n])==null?void 0:t.filter(r=>e!==r)}}off(n,e){var t;this.events[n]=(t=this.events[n])==null?void 0:t.filter(r=>e!==r)}destroy(){this.events={}}};const B6e=100/6,Yg={passive:!1};function qY(n,e){return n===1?B6e:n===2?e:1}var V6e=class{constructor(n,e={wheelMultiplier:1,touchMultiplier:1}){rr(this,"touchStart",{x:0,y:0});rr(this,"lastDelta",{x:0,y:0});rr(this,"window",{width:0,height:0});rr(this,"emitter",new _ce);rr(this,"onTouchStart",n=>{const{clientX:e,clientY:t}=n.targetTouches?n.targetTouches[0]:n;this.touchStart.x=e,this.touchStart.y=t,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:n})});rr(this,"onTouchMove",n=>{const{clientX:e,clientY:t}=n.targetTouches?n.targetTouches[0]:n,r=-(e-this.touchStart.x)*this.options.touchMultiplier,i=-(t-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=e,this.touchStart.y=t,this.lastDelta={x:r,y:i},this.emitter.emit("scroll",{deltaX:r,deltaY:i,event:n})});rr(this,"onTouchEnd",n=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:n})});rr(this,"onWheel",n=>{let{deltaX:e,deltaY:t,deltaMode:r}=n;const i=qY(r,this.window.width),s=qY(r,this.window.height);e*=i,t*=s,e*=this.options.wheelMultiplier,t*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:e,deltaY:t,event:n})});rr(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=n,this.options=e,window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,Yg),this.element.addEventListener("touchstart",this.onTouchStart,Yg),this.element.addEventListener("touchmove",this.onTouchMove,Yg),this.element.addEventListener("touchend",this.onTouchEnd,Yg)}on(n,e){return this.emitter.on(n,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize),this.element.removeEventListener("wheel",this.onWheel,Yg),this.element.removeEventListener("touchstart",this.onTouchStart,Yg),this.element.removeEventListener("touchmove",this.onTouchMove,Yg),this.element.removeEventListener("touchend",this.onTouchEnd,Yg)}};const $Y=n=>Math.min(1,1.001-2**(-10*n));var z6e=class{constructor({wrapper:n=window,content:e=document.documentElement,eventsTarget:t=n,smoothWheel:r=!0,syncTouch:i=!1,syncTouchLerp:s=.075,touchInertiaExponent:a=1.7,duration:o,easing:l,lerp:u=.1,infinite:d=!1,orientation:h="vertical",gestureOrientation:f=h==="horizontal"?"both":"vertical",touchMultiplier:p=1,wheelMultiplier:g=1,autoResize:A=!0,prevent:x,virtualScroll:b,overscroll:_=!0,autoRaf:M=!1,anchors:T=!1,autoToggle:L=!1,allowNestedScroll:D=!1,__experimental__naiveDimensions:P=!1,naiveDimensions:O=P,stopInertiaOnNavigate:F=!1,respectReducedMotion:U=!0}={}){rr(this,"_isScrolling",!1);rr(this,"_isStopped",!1);rr(this,"_isLocked",!1);rr(this,"_preventNextNativeScrollEvent",!1);rr(this,"_resetVelocityTimeout",null);rr(this,"_rafId",null);rr(this,"_isDraggingSelection",!1);rr(this,"reducedMotionMediaQuery",window.matchMedia("(prefers-reduced-motion: reduce)"));rr(this,"isTouching");rr(this,"isIos");rr(this,"time",0);rr(this,"userData",{});rr(this,"lastVelocity",0);rr(this,"velocity",0);rr(this,"direction",0);rr(this,"options");rr(this,"targetScroll");rr(this,"animatedScroll");rr(this,"animate",new I6e);rr(this,"emitter",new _ce);rr(this,"dimensions");rr(this,"virtualScroll");rr(this,"onScrollEnd",n=>{n instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&n.stopPropagation()});rr(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});rr(this,"onTransitionEnd",n=>{var e;(e=n.propertyName)!=null&&e.includes("overflow")&&n.target===this.rootElement&&this.checkOverflow()});rr(this,"onClick",n=>{const e=n.composedPath().filter(r=>r instanceof HTMLAnchorElement&&r.href).map(r=>new URL(r.href)),t=new URL(window.location.href);if(this.options.anchors){const r=e.find(i=>t.host===i.host&&t.pathname===i.pathname&&i.hash);if(r){const i=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,s=decodeURIComponent(r.hash);this.scrollTo(s,i);return}}if(this.options.stopInertiaOnNavigate&&e.some(r=>t.host===r.host&&t.pathname!==r.pathname)){this.reset();return}});rr(this,"onPointerDown",n=>{n.button===1&&this.reset()});rr(this,"onVirtualScroll",n=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(n)===!1)return;const{deltaX:e,deltaY:t,event:r}=n;if(this.emitter.emit("virtual-scroll",{deltaX:e,deltaY:t,event:r}),r.ctrlKey||r.lenisStopPropagation)return;const i=r.type.includes("touch"),s=r.type.includes("wheel");if(i&&this.isIos&&(r.type==="touchstart"&&(this._isDraggingSelection=this.isTouchOnSelectionHandle(r)),this._isDraggingSelection)){r.type==="touchend"&&(this._isDraggingSelection=!1);return}this.isTouching=r.type==="touchstart"||r.type==="touchmove";
121const a=e===0&&t===0;if(this.options.syncTouch&&i&&r.type==="touchstart"&&a&&!this.isStopped&&!this.isLocked){this.reset();return}const o=this.options.gestureOrientation==="vertical"&&t===0||this.options.gestureOrientation==="horizontal"&&e===0;if(a||o)return;let l=r.composedPath();l=l.slice(0,l.indexOf(this.rootElement));const u=this.options.prevent,d=Math.abs(e)>=Math.abs(t)?"horizontal":"vertical";if(l.find(g=>{var A,x,b,_,M;return g instanceof HTMLElement&&(typeof u=="function"&&(u==null?void 0:u(g))||((A=g.hasAttribute)==null?void 0:A.call(g,"data-lenis-prevent"))||d==="vertical"&&((x=g.hasAttribute)==null?void 0:x.call(g,"data-lenis-prevent-vertical"))||d==="horizontal"&&((b=g.hasAttribute)==null?void 0:b.call(g,"data-lenis-prevent-horizontal"))||i&&((_=g.hasAttribute)==null?void 0:_.call(g,"data-lenis-prevent-touch"))||s&&((M=g.hasAttribute)==null?void 0:M.call(g,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.hasNestedScroll(g,{deltaX:e,deltaY:t}))}))return;if(this.isStopped||this.isLocked){r.cancelable&&r.preventDefault();return}if(!(this.options.syncTouch&&i||this.options.smoothWheel&&s)){this.isScrolling="native",this.animate.stop(),r.lenisStopPropagation=!0;return}let h=t;this.options.gestureOrientation==="both"?h=Math.abs(t)>Math.abs(e)?t:e:this.options.gestureOrientation==="horizontal"&&(h=e),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&t>0||this.animatedScroll===this.limit&&t<0))&&(r.lenisStopPropagation=!0),r.cancelable&&r.preventDefault();const f=i&&this.options.syncTouch,p=i&&r.type==="touchend";p&&(h=Math.sign(h)*Math.abs(this.velocity)**this.options.touchInertiaExponent),this.scrollTo(this.targetScroll+h,{programmatic:!1,...f?{lerp:p?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});rr(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const n=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-n,this.direction=Math.sign(this.animatedScroll-n),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});rr(this,"raf",n=>{const e=n-(this.time||n);this.time=n,this.animate.advance(e*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=GY,window.lenis||(window.lenis={}),window.lenis.version=GY,h==="horizontal"&&(window.lenis.horizontal=!0),i===!0&&(window.lenis.touch=!0),this.isIos=/(iPad|iPhone|iPod)/g.test(navigator.userAgent),(!n||n===document.documentElement)&&(n=window),typeof o=="number"&&typeof l!="function"?l=$Y:typeof l=="function"&&typeof o!="number"&&(o=1),this.options={wrapper:n,content:e,eventsTarget:t,smoothWheel:r,syncTouch:i,syncTouchLerp:s,touchInertiaExponent:a,duration:o,easing:l,lerp:u,infinite:d,gestureOrientation:f,orientation:h,touchMultiplier:p,wheelMultiplier:g,autoResize:A,prevent:x,virtualScroll:b,overscroll:_,autoRaf:M,anchors:T,autoToggle:L,allowNestedScroll:D,naiveDimensions:O,stopInertiaOnNavigate:F,respectReducedMotion:U},this.dimensions=new U6e(n,e,{autoResize:A}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown),this.virtualScroll=new V6e(t,{touchMultiplier:p,wheelMultiplier:g}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd)),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(n,e){return this.emitter.on(n,e)}off(n,e){return this.emitter.off(n,e)}get overflow(){const n=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[n]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(n){this.isHorizontal?this.options.wrapper.scrollTo({left:n,behavior:"instant"}):this.options.wrapper.scrollTo({top:n,behavior:"instant"})}isTouchOnSelectionHandle(n){const e=window.getSelection();if(!e||e.isCollapsed||e.rangeCount===0)return!1;const t=n.targetTouches[0]??n.changedTouches[0];if(!t)return!1;const r=e.getRangeAt(0).getClientRects();if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=40,o=Math.hypot(t.clientX-i.left,t.clientY-i.top)<=a,l=Math.hypot(t.clientX-s.right,t.clientY-s.bottom)<=a;return o||l}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit
121()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(n,{offset:e=0,immediate:t=!1,lock:r=!1,programmatic:i=!0,lerp:s=i?this.options.lerp:void 0,duration:a=i?this.options.duration:void 0,easing:o=i?this.options.easing:void 0,onStart:l,onComplete:u,force:d=!1,userData:h}={}){if(this.prefersReducedMotion&&(i?t=!0:(s=1,a=void 0,o=void 0)),(this.isStopped||this.isLocked)&&!d)return;let f=n,p=e;if(typeof f=="string"&&["top","left","start","#"].includes(f))f=0;else if(typeof f=="string"&&["bottom","right","end"].includes(f))f=this.limit;else{let g=null;if(typeof f=="string"?(g=f.startsWith("#")?document.getElementById(f.slice(1)):document.querySelector(f),g||(f==="#top"?f=0:console.warn("Lenis: Target not found",f))):f instanceof HTMLElement&&(f!=null&&f.nodeType)&&(g=f),g){if(this.options.wrapper!==window){const T=this.rootElement.getBoundingClientRect();p-=this.isHorizontal?T.left:T.top}const A=g.getBoundingClientRect(),x=getComputedStyle(g),b=this.isHorizontal?Number.parseFloat(x.scrollMarginLeft):Number.parseFloat(x.scrollMarginTop),_=getComputedStyle(this.rootElement),M=this.isHorizontal?Number.parseFloat(_.scrollPaddingLeft):Number.parseFloat(_.scrollPaddingTop);f=(this.isHorizontal?A.left:A.top)+this.animatedScroll-(Number.isNaN(b)?0:b)-(Number.isNaN(M)?0:M)}}if(typeof f=="number"){if(f+=p,this.options.infinite){if(i){this.targetScroll=this.animatedScroll=this.scroll;const g=f-this.animatedScroll;g>this.limit/2?f-=this.limit:g<-this.limit/2&&(f+=this.limit)}}else f=wce(0,f,this.limit);if(f===this.targetScroll){l==null||l(this),u==null||u(this);return}if(this.userData=h??{},t){this.animatedScroll=this.targetScroll=f,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),u==null||u(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}i||(this.targetScroll=f),typeof a=="number"&&typeof o!="function"?o=$Y:typeof o=="function"&&typeof a!="number"&&(a=1),this.animate.fromTo(this.animatedScroll,f,{duration:a,easing:o,lerp:s,onStart:()=>{r&&(this.isLocked=!0),this.isScrolling="smooth",l==null||l(this)},onUpdate:(g,A)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=g-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=g,this.setScroll(this.scroll),i&&(this.targetScroll=g),A||this.emit(),A&&(this.reset(),this.emit(),u==null||u(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}hasNestedScroll(n,{deltaX:e,deltaY:t}){const r=Date.now();n._lenis||(n._lenis={});const i=n._lenis;let s,a,o,l,u,d,h,f,p,g;if(r-(i.time??0)>2e3){i.time=Date.now();const D=window.getComputedStyle(n);if(i.computedStyle=D,s=["auto","overlay","scroll"].includes(D.overflowX),a=["auto","overlay","scroll"].includes(D.overflowY),u=["auto"].includes(D.overscrollBehaviorX),d=["auto"].includes(D.overscrollBehaviorY),i.hasOverflowX=s,i.hasOverflowY=a,!(s||a))return!1;h=n.scrollWidth,f=n.scrollHeight,p=n.clientWidth,g=n.clientHeight,o=h>p,l=f>g,i.isScrollableX=o,i.isScrollableY=l,i.scrollWidth=h,i.scrollHeight=f,i.clientWidth=p,i.clientHeight=g,i.hasOverscrollBehaviorX=u,i.hasOverscrollBehaviorY=d}else o=i.isScrollableX,l=i.isScrollableY,s=i.hasOverflowX,a=i.hasOverflowY,h=i.scrollWidth,f=i.scrollHeight,p=i.clientWidth,g=i.clientHeight,u=i.hasOverscrollBehaviorX,d=i.hasOverscrollBehaviorY;if(!(s&&o||a&&l))return!1;const A=Math.abs(e)>=Math.abs(t)?"horizontal":"vertical";let x,b,_,M,T,L;if(A==="horizontal")x=Math.round(n.scrollLeft),b=h-p,_=e,M=s,T=o,L=u;else if(A==="vertical")x=Math.round(n.scrollTop),b=f-g,_=t,M=a,T=l,L=d;else return!1;return!L&&(x>=b||x<=0)?!0:(_>0?x<b:x>0)&&M&&T}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const n=this.options.wrapper;return this.isHorizontal?n.scrollX??n.scrollLeft:n.scrollY??n.scrollTop}get scroll(){return this.options.infinite?j6e(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(n){this._isScrolling!==n&&(this._isScrolling=n,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(n){this._isStopped!==n&&(this._isStopped=n,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(n){this._isLocked!==n&&(this._isLocked=n,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get prefersReducedMotion(){return this.options.respectReducedMotion&&this.reducedMotionMediaQuery.matches}get className(){let n="lenis";return this.options.autoToggle&&(n+=" lenis-autoToggle"),this.isStopped&&(n+=" lenis-stopped"),this.isLocked&&(n+=" lenis-locked"),this.isScrolling&&(n+=" lenis-scrolling"),this.isScrolling==="smooth"&&(n+=" lenis-smooth"),n}updateClassName(){this.cleanUpClassName(),this.className.split(" ").forEach(n=>{this.rootElement.classList.add(n)})}cleanUpClassName(){for(const n of Array.from(this.rootElement.classList))(n==="lenis"||n.startsWith("lenis-"))&&this.rootElement.classList.remove(n)}};Si.registerPlugin(di);const wc=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,AT=typeof window<"u"?G.useLayoutEffect:G.useEffect;function Sce(){G.useEffect(()=>{if(wc())return;const n=new z6e({duration:1.15,smoothWheel:!0,easing:r=>Math.min(1,1.001-Math.pow(2,-10*r))});window.__lenis=n,n.on("scroll",di.update);const e=r=>n.raf(r*1e3);Si.ticker.add(e),Si.ticker.lagSmoothing(0);const t=r=>{var o,l;const i=(l=(o=r.target)==null?void 0:o.closest)==null?void 0:l.call(o,'a[href^="/#"], a[href^="#"]');if(!i)return;const s=i.getAttribute("href").split("#")[1],a=s?document.getElementById(s):null;a&&(r.preventDefault(),n.scrollTo(a,{offset:-80}))};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t),Si.ticker.remove(e),window.__lenis===n&&(window.__lenis=null),n.destroy()}},[])}function Tce(n,e=[]){AT(()=>{if(!n.current||wc())return;const t=Si.context(()=>{Si.set("[data-reveal]",{y:48,opacity:0,filter:"blur(10px)"}),di.batch("[data-reveal]",{start:"top 88%",onEnter:r=>Si.to(r,{y:0,opacity:1,filter:"blur(0px)",duration:1.1,ease:"expo.out",stagger:.08,overwrite:!0})}),Si.utils.toArray("[data-speed]").forEach(r=>{const i=parseFloat(r.dataset.speed||"0");Si.to(r,{yPercent:i*-100,ease:"none",scrollTrigger:{trigger:r,start:"top bottom",end:"bottom top",scrub:!0}})}),Si.utils.toArray("[data-split]").forEach(r=>{Si.fromTo(r.querySelectorAll(".lp-wi"),{yPercent:115,rotate:4},{yPercent:0,rotate:0,duration:1.1,ease:"expo.out",stagger:.045,scrollTrigger:{trigger:r,start:"top 85%"}})})},n);return()=>t.revert()},e)}function jf({text:n,className:e=""}){return c.jsx(c.Fragment,{children:n.split(" ").map((t,r)=>c.jsxs("span",{children:[c.jsx("span",{className:`lp-w ${e}`,children:c.jsx("span",{className:"lp-wi",children:t})})," "]},r))})}function q8(n=.35){const e=G.useRef(null);return G.useEffect(()=>{const t=e.current;if(!t||wc()||window.matchMedia("(pointer: coarse)").matches)return;const r=Si.quickTo(t,"x",{duration:.6,ease:"elastic.out(1, 0.4)"}),i=Si.quickTo(t,"y",{duration:.6,ease:"elastic.out(1, 0.4)"}),s=o=>{const l=t.getBoundingClientRect();r((o.clientX-(l.left+l.width/2))*n),i((o.clientY-(l.top+l.height/2))*n)},a=()=>{r(0),i(0)};return t.addEventListener("mousemove",s),t.addEventListener("mouseleave",a),()=>{t.removeEventListener("mousemove",s),t.removeEventListener("mouseleave",a)}},[n]),e}function Ece(n=6){const e=G.useRef(null);return G.useEffect(()=>{const t=e.current;if(!t)return;const r=window.matchMedia("(pointer: coarse)").matches||wc(),i=r?null:Si.quickTo(t,"rotationX",{duration:.6,ease:"power3.out"}),s=r?null:Si.quickTo(t,"rotationY",{duration:.6,ease:"power3.out"}),a=l=>{const u=t.getBoundingClientRect(),d=(l.clientX-u.left)/u.width,h=(l.clientY-u.top)/u.height;t.style.setProperty("--mx",`${d*100}%`),t.style.setProperty("--my",`${h*100}%`),i==null||i((.5-h)*n),s==null||s((d-.5)*n)},o=()=>{i==null||i(0),s==null||s(0)};return Si.set(t,{transformPerspective:1e3}),t.addEventListener("mousemove",a),t.addEventListener("mouseleave",o),()=>{t.removeEventListener("mousemove",a),t.removeEventListener("mouseleave",o)}},[n]),e}function Cce(n="200px"){const e=G.useRef(null),[t,r]=G.useState(!1);return G.useEffect(()=>{const i=e.current;if(!i)return;const s=new IntersectionObserver(([a])=>r(a.isIntersecting),{rootMargin:n});return s.observe(i),()=>s.disconnect()},[n]),[e,t]}function G6e({to:n,suffix:e="",className:t=""}){const r=G.useRef(null);return G.useEffect(()=>{const i=r.current;if(!i)return;if(wc()){i.textContent=`${n}${e}`;return}const s={v:0},a=di.create({trigger:i,start:"top 90%",once:!0,onEnter:()=>Si.to(s,{v:n,duration:1.6,ease:"power3.out",onUpdate:()=>{i.textContent=`${Math.round(s.v)}${e}`}})});return()=>a.kill()},[n,e]),c.jsxs("span",{ref:r,className:t,children:["0",e]})}function jI({children:n,reverse:e=!1,duration:t=40,gap:r=48,className:i=""}){const s={"--dur":`${t}s`,"--gap":`${r}px`};return c.jsxs("div",{className:`lp-marquee ${e?"is-reverse":""} ${i}`,style:s,children:[c.jsx("div",{className:"lp-marquee-track",children:n}),c.jsx("div",{className:"lp-marquee-track","aria-hidden":"true",children:n})]})}const Nce=G.createContext(!1);
121function xT({children:n,title:e,subtitle:t}){G.useEffect(()=>{const i=()=>{const l=document.querySelector(".auth-card");if(!l)return;const u=document.documentElement.classList.contains("dark");l.querySelectorAll("span").forEach(h=>{var p;if(((p=h.textContent)==null?void 0:p.trim().toLowerCase())==="or continue with"){h.setAttribute("data-or-continue","true"),h.style.setProperty("background-color","transparent","important"),h.style.setProperty("background","none","important"),u?h.style.setProperty("color","#8A99AF","important"):h.style.setProperty("color","#64748B","important");const g=h.parentElement;if(g){g.setAttribute("data-or-continue-container","true");const A=g.previousElementSibling;A&&A.style.setProperty("display","none","important")}}})};i();const s=new MutationObserver(()=>i()),a=document.querySelector(".auth-card");a&&s.observe(a,{childList:!0,subtree:!0});const o=new MutationObserver(()=>i());return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{s.disconnect(),o.disconnect()}},[]);const r=G.useContext(Nce);return c.jsx("div",{className:r?"flex flex-col px-1 py-2":"flex min-h-screen flex-col justify-center py-10 px-4 sm:px-6 lg:px-8 bg-gray-50 dark:bg-boxdark-2 transition-colors",children:c.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[c.jsx("div",{className:"flex justify-center mb-6",children:c.jsxs(Ks,{to:"/",className:"flex items-center gap-3 group transition-transform duration-200 hover:scale-[1.02]",children:[c.jsx("div",{className:"w-11 h-11 rounded-xl bg-white dark:bg-[#1A222C] p-2 shadow-sm border border-stroke dark:border-strokedark flex items-center justify-center",children:c.jsx("img",{src:V1,alt:"Spread Out AI",className:"w-7 h-7 object-contain"})}),c.jsxs("span",{className:"text-xl font-extrabold tracking-tight text-gray-900 dark:text-white font-satoshi",children:["Spread Out ",c.jsx("span",{className:"text-[#556b00] dark:text-[#CFFF05]",children:"AI"})]})]})}),c.jsxs("div",{className:r?"auth-card px-3 pb-2 sm:px-6 text-white":"auth-card bg-white py-8 px-6 shadow-xl ring-1 ring-gray-900/5 rounded-2xl sm:px-10 dark:bg-boxdark dark:text-white dark:ring-1 dark:ring-strokedark dark:border dark:border-strokedark transition-colors",children:[e&&c.jsxs("div",{className:"text-center mb-6",children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight text-gray-900 dark:text-white font-satoshi",children:e}),t&&c.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-bodydark leading-relaxed",children:t})]}),c.jsx("div",{children:n})]})]})})}function Mce(){const[n,e]=G.useState(null),[t,r]=G.useState(0),i=ro(),{data:s}=Ma(),a=G.useRef(null),o=async l=>{e(l)};return G.useEffect(()=>{s&&i("/")},[s,i]),G.useEffect(()=>{const l=()=>{window.turnstile&&a.current&&window.turnstile.render(a.current,{sitekey:"0x4AAAAAAAjvf2a3XoV_saKW",callback:o})};if(window.turnstile&&t===0)r(1),l();else{const u=setInterval(()=>{window.turnstile&&(clearInterval(u),l(),r(1))},100)}},[]),c.jsx(xT,{title:"Welcome back",subtitle:"Sign in to your account to continue",children:c.jsxs(c.Fragment,{children:[c.jsx(V3e,{}),c.jsxs("div",{className:"mt-5 space-y-2.5 text-center",children:[c.jsx("div",{children:c.jsxs("span",{className:"text-xs font-semibold text-gray-500 dark:text-bodydark",children:["Forgot your password?"," ",c.jsx(Ks,{to:"/request-password-reset",className:"font-bold text-[#556b00] dark:text-[#CFFF05] hover:underline",children:"Reset it here"})]})}),c.jsx("div",{children:c.jsxs("span",{className:"text-xs font-semibold text-gray-500 dark:text-bodydark",children:["Don't have an account yet?"," ",c.jsx(Ks,{to:"/signup",className:"font-bold text-[#556b00] dark:text-[#CFFF05] hover:underline",children:"Sign up"})]})})]})]})})}const HY="spreadout:pendingStrategyUrl",kce=G.createContext(()=>{}),$8=()=>G.useContext(kce);function q6e(n){const e=(n||"").trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function pV({children:n}){const{data:e}=Ma(),t=ro(),[r,i]=G.useState(!1),s=G.useCallback(a=>{const o=q6e(a);if(o)try{localStorage.setItem(HY,o)}catch{}e?t(o?`/ai-automator?url=${encodeURIComponent(o)}`:"/ai-automator"):i(!0)},[e,t]);return G.useEffect(()=>{if(!e||!r)return;i(!1);let a="";try{a=localStorage.getItem(HY)||""}catch{}t(a?`/ai-automator?url=${encodeURIComponent(a)}`:"/ai-automator")},[e,r,t]),c.jsxs(kce.Provider,{value:s,children:[n,r&&c.jsx($6e,{onClose:()=>i(!1)})]})}function $6e({onClose:n}){const e=G.useRef(null),t=G.useRef(null),r=hi();return G.useEffect(()=>{var o,l;const i=window.__lenis;i==null||i.stop();const s=document.body.style.overflow;document.body.style.overflow="hidden";const a=u=>{u.key==="Escape"&&n()};return window.addEventListener("keydown",a),wc()||(Si.fromTo(e.current,{opacity:0}
121,{opacity:1,duration:.35,ease:"power2.out"}),Si.fromTo(t.current,{opacity:0,y:40,scale:.97},{opacity:1,y:0,scale:1,duration:.55,ease:"expo.out"})),(l=(o=t.current)==null?void 0:o.querySelector("input"))==null||l.focus({preventScroll:!0}),()=>{window.removeEventListener("keydown",a),document.body.style.overflow=s,i==null||i.start()}},[n]),Vl.createPortal(c.jsxs("div",{className:"dark fixed inset-0 z-[1000] flex items-start justify-center overflow-y-auto overscroll-contain p-4 sm:items-center sm:p-8","data-lenis-prevent":!0,role:"dialog","aria-modal":"true","aria-label":r("Sign in to SpreadOut"),children:[c.jsx("div",{ref:e,className:"fixed inset-0 bg-[#05060a]/80 backdrop-blur-md",onClick:n}),c.jsxs("div",{ref:t,className:"relative my-auto w-full max-w-[460px] rounded-[28px] border border-white/10 bg-[#0b0d12] p-2 shadow-[0_40px_120px_-20px_rgba(0,0,0,.9),0_0_0_1px_rgba(207,255,5,.08)]",children:[c.jsx("div",{className:"pointer-events-none absolute -top-24 left-1/2 h-48 w-72 -translate-x-1/2 rounded-full bg-[rgba(207,255,5,0.18)] blur-3xl","aria-hidden":!0}),c.jsx("button",{onClick:n,className:"absolute right-4 top-4 z-10 grid h-9 w-9 place-items-center rounded-full bg-white/5 text-xl leading-none text-white/70 transition-colors hover:bg-white/10 hover:text-white","aria-label":r("Close"),children:"Ã"}),c.jsx("div",{className:"relative max-h-[calc(100dvh-3rem)] overflow-y-auto overscroll-contain rounded-[22px] px-2 pb-4 pt-6 sm:px-4","data-lenis-prevent":!0,children:c.jsx(Nce.Provider,{value:!0,children:c.jsx(Mce,{})})})]})]}),document.body)}function mV({links:n=HCe}){const{data:e,isLoading:t}=Ma(),r=$8(),[i,s]=G.useState(!1),[a,o]=G.useState(!1),l=q8(.3),u=hi();return G.useEffect(()=>{const d=()=>s(window.scrollY>24);return d(),window.addEventListener("scroll",d,{passive:!0}),()=>window.removeEventListener("scroll",d)},[]),c.jsxs("header",{className:"fixed inset-x-0 top-0 z-50 flex justify-center px-4 pt-4",children:[c.jsxs("nav",{"aria-label":"Global",className:`flex w-full items-center justify-between rounded-full transition-all duration-500 ease-out ${i?"max-w-[1240px] lp-glass px-3 py-2":"max-w-7xl px-4 py-3 bg-transparent"}`,children:[c.jsxs("a",{href:"/",className:"flex shrink-0 items-center gap-2.5 pl-2",children:[c.jsx("img",{src:V1,alt:"",className:"h-8 w-8"}),c.jsx("span",{className:"lp-display text-[17px] font-bold tracking-tight text-white",children:"SpreadOut"})]}),c.jsx("div",{className:"hidden items-center gap-0.5 xl:flex",children:n.map(d=>c.jsx("a",{href:d.href,className:"whitespace-nowrap rounded-full px-3.5 py-2 text-sm font-medium text-[var(--lp-muted)] transition-colors hover:bg-white/5 hover:text-white",children:u(d.name)},d.name))}),c.jsxs("div",{className:"hidden shrink-0 items-center gap-3 xl:flex",children:[c.jsx(Y4,{}),t?null:e?c.jsx("div",{className:"dark",children:c.jsx(Noe,{user:e,variant:"landing"})}):c.jsx(ru,{to:"/login",className:"text-sm font-semibold text-white/80 hover:text-white",children:u("Log in")}),c.jsxs("button",{ref:l,onClick:()=>r(),className:"lp-btn lp-btn-primary !h-11 !px-5 text-sm",children:[c.jsx("span",{className:"lp-btn-shine"}),u(e?"Open Autopilot":"Start free"),c.jsx("span",{"aria-hidden":!0,children:"â"})]})]}),c.jsxs("button",{type:"button",className:"rounded-full p-2.5 text-white xl:hidden",onClick:()=>o(!0),children:[c.jsx("span",{className:"sr-only",children:u("Open menu")}),c.jsx(toe,{className:"h-6 w-6"})]})]}),c.jsxs(AM,{as:"div",className:"lp xl:hidden",open:a,onClose:o,children:[c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),c.jsxs(AM.Panel,{className:"fixed inset-y-0 right-0 z-50 w-full max-w-sm overflow-y-auto bg-[#07080d] px-6 py-6 text-white ring-1 ring-white/10",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"lp-display text-lg font-bold",children:"SpreadOut"}),c.jsxs("button",{type:"button",className:"rounded-full p-2",onClick:()=>o(!1),children:[c.jsx("span",{className:"sr-only",children:u("Close menu")}),c.jsx(VTe,{className:"h-6 w-6"})]})]}),c.jsx("div",{className:"mt-8 space-y-1",children:n.map(d=>c.jsx("a",{href:d.href,onClick:()=>o(!1),className:"block rounded-2xl px-4 py-3 text-lg font-semibold text-white/90 hover:bg-white/5",children:u(d.name)},d.name))}),c.jsxs("div",{className:"mt-8",children:[c.jsx("div",{className:"lp-mono mb-3 text-[11px] uppercase tracking-[0.2em] text-[var(--lp-muted)]",children:u("Language")}),c.jsx(Y4,{variant:"list"})]}),c.jsxs("div",{className:"mt-8 flex flex-col gap-3",children:[c.jsxs("button",{onClick:()=>{o(!1),r()},className:"lp-btn lp-btn-primary w-full",children:[u(e?"Open Autopilot":"Start free")," â"]}),!e&&c.jsx(ru,{to:"/login",className:"lp-btn lp-btn-ghost w-full",children:u("Log in")})]})]})]})]})}const H6e=` 122precision mediump float; 123uniform vec2 uRes; 124uniform float uTime; 125uniform vec2 uMouse; 126float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1,311.7))) * 43758.5453); } 127float noise(vec2 p){ 128 vec2 i = floor(p), f = fract(p); 129 vec2 u = f*f*(3.0-2.0*f); 130 return mix(mix(hash(i), hash(i+vec2(1,0)), u.x), mix(hash(i+vec2(0,1)), hash(i+vec2(1,1)), u.x), u.y); 131} 132float fbm(vec2 p){ float v = 0.0; float a = 0.5; for (int i = 0; i < 5; i++){ v += a*noise(p); p *= 2.02; a *= 0.5; } return v; } 133void main(){ 134 vec2 uv = gl_FragCoord.xy / uRes.xy; 135 vec2 p = (gl_FragCoord.xy - 0.5*uRes.xy) / uRes.y; 136 float t = uTime * 0.045; 137 p += (uMouse - 0.5) * 0.18; 138 float n = fbm(p*1.4 + vec2(t, -t*0.6)); 139 float band = fbm(vec2(p.x*1.1 + n*1.6, p.y*2.6 - t*1.4)); 140 float ribbon = smoothstep(0.45, 0.95, band) * smoothstep(-0.9, 0.25, p.y); 141 vec3 lime = vec3(0.81, 1.0, 0.02); 142 vec3 emerald = vec3(0.06, 0.73, 0.51); 143 vec3 cyan = vec3(0.13, 0.83, 0.93); 144 vec3 violet = vec3(0.55, 0.36, 0.96); 145 vec3 col = mix(emerald, cyan, smoothstep(0.2, 0.8, uv.x + n*0.4)); 146 col = mix(col, violet, smoothstep(0.55, 1.0, uv.x - n*0.3)); 147 col = mix(col, lime, smoothstep(0.62, 0.9, band) * 0.55); 148 vec3 base = vec3(0.02, 0.024, 0.04); 149 vec3 outc = base + col * ribbon * 0.55; 150 outc += vec3(0.81, 1.0, 0.02) * pow(max(0.0, 1.0 - length(p - vec2(0.0, -0.75))), 3.0) * 0.08;
151 gl_FragColor = vec4(outc, 1.0); 152}`,W6e="attribute vec2 a; void main(){ gl_Position = vec4(a, 0.0, 1.0); }";function Rce({className:n=""}){const e=G.useRef(null);return G.useEffect(()=>{const t=e.current;if(!t)return;const r=t.getContext("webgl",{antialias:!1,premultipliedAlpha:!1});if(!r){t.style.display="none";return}const i=(L,D)=>{const P=r.createShader(L);return r.shaderSource(P,D),r.compileShader(P),P},s=r.createProgram();if(r.attachShader(s,i(r.VERTEX_SHADER,W6e)),r.attachShader(s,i(r.FRAGMENT_SHADER,H6e)),r.linkProgram(s),!r.getProgramParameter(s,r.LINK_STATUS)){t.style.display="none";return}r.useProgram(s);const a=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,a),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),r.STATIC_DRAW);const o=r.getAttribLocation(s,"a");r.enableVertexAttribArray(o),r.vertexAttribPointer(o,2,r.FLOAT,!1,0,0);const l=r.getUniformLocation(s,"uRes"),u=r.getUniformLocation(s,"uTime"),d=r.getUniformLocation(s,"uMouse"),h=.5,f=()=>{const L=Math.max(1,Math.floor(t.clientWidth*h)),D=Math.max(1,Math.floor(t.clientHeight*h));t.width=L,t.height=D,r.viewport(0,0,L,D),r.uniform2f(l,L,D)};f(),window.addEventListener("resize",f);const p={x:.5,y:.5,tx:.5,ty:.5},g=L=>{p.tx=L.clientX/window.innerWidth,p.ty=1-L.clientY/window.innerHeight};window.addEventListener("pointermove",g,{passive:!0});let A=!0;const x=new IntersectionObserver(([L])=>{A=L.isIntersecting},{rootMargin:"100px"});x.observe(t);const b=wc();let _=0;const M=performance.now(),T=L=>{_=requestAnimationFrame(T),!(!A||document.hidden)&&(p.x+=(p.tx-p.x)*.04,p.y+=(p.ty-p.y)*.04,r.uniform1f(u,b?12:(L-M)/1e3),r.uniform2f(d,p.x,p.y),r.drawArrays(r.TRIANGLE_STRIP,0,4))};return _=requestAnimationFrame(T),()=>{cancelAnimationFrame(_),x.disconnect(),window.removeEventListener("resize",f),window.removeEventListener("pointermove",g)}},[]),c.jsx("div",{className:`absolute inset-0 ${n}`,style:{background:"radial-gradient(80% 60% at 50% 100%, rgba(16,185,129,0.25), transparent 70%), #05060a"},children:c.jsx("canvas",{ref:e,className:"absolute inset-0 h-full w-full"})})}function X6e(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Y6e(n,e,t){return e=rMe(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WY(n,e){return Z6e(n)||X6e(n,e)||Pce(n,e)||tMe()}function Q6e(n){return K6e(n)||J6e(n)||Pce(n)||eMe()}function K6e(n){if(Array.isArray(n))return II(n)}function Z6e(n){if(Array.isArray(n))return n}function J6e(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Pce(n,e){if(n){if(typeof n=="string")return II(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return II(n,e)}}function II(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function eMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 153In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tMe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 154In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nMe(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function rMe(n){var e=nMe(n,"string");return typeof e=="symbol"?e:String(e)}var iMe=function(e,t){var r=new Set(t);return Object.assign.apply(Object,[{}].concat(Q6e(Object.entries(e).filter(function(i){var s=WY(i,1),a=s[0];return!r.has(a)}).map(function(i){var s=WY(i,2),a=s[0],o=s[1];return Y6e({},a,o)}))))};function sMe(n,{wrapperElementType:e="div",nodeMapper:t=s=>s,methodNames:r=[],initPropNames:i=[]}={}){return G.forwardRef((s,a)=>{const o=G.useRef(),l=G.useMemo(()=>{const h=Object.fromEntries(i.filter(f=>s.hasOwnProperty(f)).map(f=>[f,s[f]]));return n(h)},[]);XY(()=>{l(t(o.current))},G.useLayoutEffect),XY(()=>l._destructor instanceof Function?l._destructor:void 0);const u=G.useCallback((h,...f)=>l[h]instanceof Function?l[h](...f):void 0,[l]),d=G.useRef({});return Object.keys(iMe(s,[...r,...i])).filter(h=>
154d.current[h]!==s[h]).forEach(h=>u(h,s[h])),d.current=s,G.useImperativeHandle(a,()=>Object.fromEntries(r.map(h=>[h,(...f)=>u(h,...f)])),[u]),jn.createElement(e,{ref:o})})}function XY(n,e=G.useEffect){const t=G.useRef(),r=G.useRef(!1),i=G.useRef(!1),[s,a]=G.useState(0);r.current&&(i.current=!0),e(()=>(r.current||(t.current=n(),r.current=!0),a(o=>o+1),()=>{i.current&&(t.current&&t.current(),t.current=void 0,r.current=!1,i.current=!1)}),[])}/** 155 * @license 156 * Copyright 2010-2026 Three.js Authors 157 * SPDX-License-Identifier: MIT 158 */const yy="185",Vh={ROTATE:0,DOLLY:1,PAN:2},fb={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Lce=0,FI=1,Oce=2,aMe=0,Nb=1,Dce=2,s0=3,mu=0,us=1,Fa=2,qo=0,dl=1,HA=2,WA=3,XA=4,Dv=5,gV=6,Ol=100,AV=101,xV=102,jce=103,Ice=104,Mm=200,vV=201,yV=202,bV=203,dw=204,hw=205,wV=206,_V=207,SV=208,TV=209,EV=210,oMe=211,lMe=212,cMe=213,uMe=214,c5=0,u5=1,d5=2,T1=3,h5=4,f5=5,p5=6,m5=7,vT=0,Fce=1,Uce=2,Il=0,CV=1,NV=2,MV=3,kV=4,Bce=5,RV=6,PV=7,LV=300,np=301,R0=302,Mb=303,kb=304,E1=306,Jv=1e3,Uu=1001,ey=1002,cs=1003,OV=1004,a0=1005,bs=1006,Rb=1007,hu=1008,dMe=1008,Zs=1009,a1=1010,o1=1011,jh=1012,oo=1013,ts=1014,ia=1015,Js=1016,yT=1017,bT=1018,Ku=1020,wT=35902,_T=35899,H8=1021,by=1022,to=1023,ml=1026,vc=1027,wy=1028,G1=1029,fl=1030,q1=1031,DV=1032,b_=1033,l1=33776,c1=33777,u1=33778,d1=33779,g5=35840,A5=35841,x5=35842,v5=35843,fw=36196,pw=37492,mw=37496,gw=37488,Aw=37489,C1=37490,xw=37491,vw=37808,yw=37809,bw=37810,ww=37811,_w=37812,Sw=37813,Tw=37814,Ew=37815,Cw=37816,Nw=37817,Mw=37818,kw=37819,Rw=37820,Pw=37821,Lw=36492,Ow=36494,Dw=36495,jw=36283,Iw=36284,N1=36285,Fw=36286,hMe=0,fMe=1,YY=2,pMe=3200,Qf=0,Vce=1,Iu="",Pl="srgb",Uw="srgb-linear",Bw="linear",$n="srgb",m9="",zce="rg",mMe="ga",gMe=0,Gx=7680,AMe=7681,xMe=7682,vMe=7683,yMe=34055,bMe=34056,wMe=5386,_Me=512,SMe=513,TMe=514,EMe=515,CMe=516,NMe=517,MMe=518,UI=519,jV=512,W8=513,IV=514,$1=515,y5=516,FV=517,eg=518,UV=519,Vw=35044,ST=35048,QY="300 es",fu=2e3,qh=2001,o0={COMPUTE:"compute",RENDER:"render"},_y={TEXTURE_COMPARE:"depthTextureCompare"};function kMe(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function OM(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function b5(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Gce(){const n=b5("canvas");return n.style.display="block",n}const KY={};function w5(...n){const e="THREE."+n.shift();console.log(e,...n)}function qce(n){const e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function an(...n){n=qce(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function sn(...n){n=qce(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function _i(...n){const e=n.join(" ");e in KY||(KY[e]=!0,an(...n))}function $ce(){return typeof self<"u"&&typeof self.scheduler<"u"&&typeof self.scheduler.yield<"u"?self.scheduler.yield():new Promise(n=>{requestAnimationFrame(n)})}function RMe(n,e,t){return new Promise(function(r,i){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:i();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:r()}}setTimeout(s,t)})}const BV={[c5]:u5,[d5]:p5,[h5]:m5,[T1]:f5,[u5]:c5,[p5]:d5,[m5]:h5,[f5]:T1};class ef{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const r=t[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const tc=["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
1585","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let ZY=1234567;const d4=Math.PI/180,ty=180/Math.PI;function A0(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(tc[n&255]+tc[n>>8&255]+tc[n>>16&255]+tc[n>>24&255]+"-"+tc[e&255]+tc[e>>8&255]+"-"+tc[e>>16&15|64]+tc[e>>24&255]+"-"+tc[t&63|128]+tc[t>>8&255]+"-"+tc[t>>16&255]+tc[t>>24&255]+tc[r&255]+tc[r>>8&255]+tc[r>>16&255]+tc[r>>24&255]).toLowerCase()}function $r(n,e,t){return Math.max(e,Math.min(t,n))}function VV(n,e){return(n%e+e)%e}function PMe(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function LMe(n,e,t){return n!==e?(t-n)/(e-n):0}function h4(n,e,t){return(1-t)*n+t*e}function OMe(n,e,t,r){return h4(n,e,1-Math.exp(-t*r))}function DMe(n,e=1){return e-Math.abs(VV(n,e*2)-e)}function jMe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function IMe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function FMe(n,e){return n+Math.floor(Math.random()*(e-n+1))}function UMe(n,e){return n+Math.random()*(e-n)}function BMe(n){return n*(.5-Math.random())}function VMe(n){n!==void 0&&(ZY=n);let e=ZY+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function zMe(n){return n*d4}function GMe(n){return n*ty}function qMe(n){return(n&n-1)===0&&n!==0}function $Me(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function HMe(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function WMe(n,e,t,r,i){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),u=s((e+r)/2),d=a((e+r)/2),h=s((e-r)/2),f=a((e-r)/2),p=s((r-e)/2),g=a((r-e)/2);switch(i){case"XYX":n.set(o*d,l*h,l*f,o*u);break;case"YZY":n.set(l*f,o*d,l*h,o*u);break;case"ZXZ":n.set(l*h,l*f,o*d,o*u);break;case"XZX":n.set(o*d,l*g,l*p,o*u);break;case"YXY":n.set(l*p,o*d,l*g,o*u);break;case"ZYZ":n.set(l*g,l*p,o*d,o*u);break;default:an("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function uu(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function ii(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const zw={DEG2RAD:d4,RAD2DEG:ty,generateUUID:A0,clamp:$r,euclideanModulo:VV,mapLinear:PMe,inverseLerp:LMe,lerp:h4,damp:OMe,pingpong:DMe,smoothstep:jMe,smootherstep:IMe,randInt:FMe,randFloat:UMe,randFloatSpread:BMe,seededRandom:VMe,degToRad:zMe,radToDeg:GMe,isPowerOfTwo:qMe,ceilPowerOfTwo:$Me,floorPowerOfTwo:HMe,setQuaternionFromProperEuler:WMe,normalize:ii,denormalize:uu},g$=class g${constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 9,981 bytes, line 158
158sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=$r(this.x,e.x,t.x),this.y=$r(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=$r(this.x,e,t),this.y=$r(this.y,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar($r(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos($r(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*r-a*i+e.x,this.y=s*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};g$.prototype.isVector2=!0;let Jt=g$;class $h{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,s,a,o){let l=r[i+0],u=r[i+1],d=r[i+2],h=r[i+3],f=s[a+0],p=s[a+1],g=s[a+2],A=s[a+3];if(h!==A||l!==f||u!==p||d!==g){let x=l*f+u*p+d*g+h*A;x<0&&(f=-f,p=-p,g=-g,A=-A,x=-x);let b=1-o;if(x<.9995){const _=Math.acos(x),M=Math.sin(_);b=Math.sin(b*_)/M,o=Math.sin(o*_)/M,l=l*b+f*o,u=u*b+p*o,d=d*b+g*o,h=h*b+A*o}else{l=l*b+f*o,u=u*b+p*o,d=d*b+g*o,h=h*b+A*o;const _=1/Math.sqrt(l*l+u*u+d*d+h*h);l*=_,u*=_,d*=_,h*=_}}e[t]=l,e[t+1]=u,e[t+2]=d,e[t+3]=h}static multiplyQuaternionsFlat(e,t,r,i,s,a){const o=r[i],l=r[i+1],u=r[i+2],d=r[i+3],h=s[a],f=s[a+1],p=s[a+2],g=s[a+3];return e[t]=o*g+d*h+l*p-u*f,e[t+1]=l*g+d*f+u*h-o*p,e[t+2]=u*g+d*p+o*f-l*h,e[t+3]=d*g-o*h-l*f-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const r=e._x,i=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,u=o(r/2),d=o(i/2),h=o(s/2),f=l(r/2),p=l(i/2),g=l(s/2);switch(a){case"XYZ":this._x=f*d*h+u*p*g,this._y=u*p*h-f*d*g,this._z=u*d*g+f*p*h,this._w=u*d*h-f*p*g;break;case"YXZ":this._x=f*d*h+u*p*g,this._y=u*p*h-f*d*g,this._z=u*d*g-f*p*h,this._w=u*d*h+f*p*g;break;case"ZXY":this._x=f*d*h-u*p*g,this._y=u*p*h+f*d*g,this._z=u*d*g+f*p*h,this._w=u*d*h-f*p*g;break;case"ZYX":this._x=f*d*h-u*p*g,this._y=u*p*h+f*d*g,this._z=u*d*g-f*p*h,this._w=u*d*h+f*p*g;break;case"YZX":this._x=f*d*h+u*p*g,this._y=u*p*h+f*d*g,this._z=u*d*g-f*p*h,this._w=u*d*h-f*p*g;break;case"XZY":this._x=f*d*h-u*p*g,this._y=u*p*h-f*d*g,this._z=u*d*g+f*p*h,this._w=u*d*h+f*p*g;break;default:an("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],s=t[8],a=t[1],o=t[5],l=t[9],u=t[2],d=t[6],h=t[10],f=r+o+h;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(d-l)*p,this._y=(s-u)*p,this._z=(a-i)*p}else if(r>o&&r>h){const p=2*Math.sqrt(1+r-o-h);this._w=(d-l)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(s+u)/p}else if(o>h){const p=2*Math.sqrt(1+o-r-h);this._w=(s-u)/p,this._x=(i+a)/p,this._y=.25*p,this._z=(l+d)/p}else{const p=2*Math.sqrt(1+h-r-o);this._w=(a-i)/p,this._x=(s+u)/p,this._y=(l+d)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<1e-8?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs($r(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}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,t){const r=e._x,i=e._y,s=e._z,a=e._w,o=t._x,l=t._y,u=t._z,d=t._w;return this._x=r*d+a*o+i*u-s*l,this._y=i*d+a*l+s*o-r*u,this._z=s*d+a*u+r*l-i*o,this._w=a*d-r*o-i*l-s*u,this._onChangeCallback(),this}slerp(e,t){let r=e._x,i=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(r=-r,i=-i,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const u=Math.acos(o),d=Math.sin(u);l=Math.sin(l*u)/d,t=Math.sin(t*u)/d,this._x=this._x*l+r*t,this._y=this._y*l+i*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+r*t,this._y=this._y*l+i*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),s=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const A$=class A${constructor(e=0,t=0,r=0){this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(JY.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(JY.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*a,this}
vendor: 6,035 bytes, line 158
158applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,a=e.y,o=e.z,l=e.w,u=2*(a*i-o*r),d=2*(o*t-s*i),h=2*(s*r-a*t);return this.x=t+l*u+a*h-o*d,this.y=r+l*d+o*u-s*h,this.z=i+l*h+s*d-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 t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=$r(this.x,e.x,t.x),this.y=$r(this.y,e.y,t.y),this.z=$r(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=$r(this.x,e,t),this.y=$r(this.y,e,t),this.z=$r(this.z,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar($r(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-s*o,this.y=s*a-r*l,this.z=r*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return g9.copy(this).projectOnVector(e),this.sub(g9)}reflect(e){return this.sub(g9.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos($r(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};A$.prototype.isVector3=!0;let Ve=A$;const g9=new Ve,JY=new $h,x$=class x${constructor(e,t,r,i,s,a,o,l,u){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,i,s,a,o,l,u)}set(e,t,r,i,s,a,o,l,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=o,d[3]=t,d[4]=s,d[5]=l,d[6]=r,d[7]=a,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,a=r[0],o=r[3],l=r[6],u=r[1],d=r[4],h=r[7],f=r[2],p=r[5],g=r[8],A=i[0],x=i[3],b=i[6],_=i[1],M=i[4],T=i[7],L=i[2],D=i[5],P=i[8];return s[0]=a*A+o*_+l*L,s[3]=a*x+o*M+l*D,s[6]=a*b+o*T+l*P,s[1]=u*A+d*_+h*L,s[4]=u*x+d*M+h*D,s[7]=u*b+d*T+h*P,s[2]=f*A+p*_+g*L,s[5]=f*x+p*M+g*D,s[8]=f*b+p*T+g*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],d=e[8];return t*a*d-t*o*u-r*s*d+r*o*l+i*s*u-i*a*l}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],d=e[8],h=d*a-o*u,f=o*l
vendor: 22,181 bytes, line 158
158-d*s,p=u*s-a*l,g=t*h+r*f+i*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const A=1/g;return e[0]=h*A,e[1]=(i*u-d*r)*A,e[2]=(o*r-i*a)*A,e[3]=f*A,e[4]=(d*t-i*l)*A,e[5]=(i*s-o*t)*A,e[6]=p*A,e[7]=(r*l-u*t)*A,e[8]=(a*t-r*s)*A,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,s,a,o){const l=Math.cos(s),u=Math.sin(s);return this.set(r*l,r*u,-r*(l*a+u*o)+a+e,-i*u,i*l,-i*(-u*a+l*o)+o+t,0,0,1),this}scale(e,t){return _i("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(A9.makeScale(e,t)),this}rotate(e){return _i("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(A9.makeRotation(-e)),this}translate(e,t){return _i("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(A9.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}};x$.prototype.isMatrix3=!0;let Gr=x$;const A9=new Gr,eQ=new Gr().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),tQ=new Gr().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function XMe(){const n={enabled:!0,workingColorSpace:Uw,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===$n&&(i.r=$m(i.r),i.g=$m(i.g),i.b=$m(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===$n&&(i.r=Pb(i.r),i.g=Pb(i.g),i.b=Pb(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Iu?Bw:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,s){return _i("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return _i("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],r=[.3127,.329];return n.define({[Uw]:{primaries:e,whitePoint:r,transfer:Bw,toXYZ:eQ,fromXYZ:tQ,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Pl},outputColorSpaceConfig:{drawingBufferColorSpace:Pl}},[Pl]:{primaries:e,whitePoint:r,transfer:$n,toXYZ:eQ,fromXYZ:tQ,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Pl}}}),n}const _r=XMe();function $m(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Pb(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let r2;class YMe{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{r2===void 0&&(r2=b5("canvas")),r2.width=e.width,r2.height=e.height;const i=r2.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=r2}return r.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=b5("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=$m(s[a]/255)*255;return r.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let r=0;r<t.length;r++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[r]=Math.floor($m(t[r]/255)*255):t[r]=$m(t[r]);return{data:t,width:e.width,height:e.height}}else return an("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let QMe=0;class zV{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:QMe++}),this.uuid=A0(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(x9(i[a].image)):s.push(x9(i[a]))}else s=x9(i);r.url=s}return t||(e.images[this.uuid]=r),r}}function x9(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?YMe.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(an("Texture: Unable to serialize Texture."),{})}let KMe=0;const v9=new Ve;class ko extends ef{constructor(e=ko.DEFAULT_IMAGE,t=ko.DEFAULT_MAPPING,r=Uu,i=Uu,s=bs,a=hu,o=to,l=Zs,u=ko.DEFAULT_ANISOTROPY,d=Iu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:KMe++}),this.uuid=A0(),this.name="",this.source=new zV(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Jt(0,0),this.repeat=new Jt(1,1),this.center=new Jt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Gr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,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(v9).x}get height(){return this.source.getSize(v9).y}get depth(){return this.source.getSize(v9).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,t){this.updateRanges.push({start:e,count:t})}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 t in e){const r=e[t];if(r===void 0){an(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){an(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.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&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==LV)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Jv:e.x=e.x-Math.floor(e.x);break;case Uu:e.x=e.x<0?0:1;break;case ey: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 Jv:e.y=e.y-Math.floor(e.y);break;case Uu:e.y=e.y<0?0:1;break;case ey: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++}}ko.DEFAULT_IMAGE=null;ko.DEFAULT_MAPPING=LV;ko.DEFAULT_ANISOTROPY=1;const v$=class v${constructor(e=0,t=0,r=0,i=1){this.x=e,this.y=t,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*r+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*r+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*r+a[11]*i+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 t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,s;const l=e.elements,u=l[0],d=l[4],h=l[8],f=l[1],p=l[5],g=l[9],A=l[2],x=l[6],b=l[10];if(Math.abs(d-f)<.01&&Math.abs(h-A)<.01&&Math.abs(g-x)<.01){if(Math.abs(d+f)<.1&&Math.abs(h+A)<.1&&Math.abs(g+x)<.1&&Math.abs(u+p+b-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(u+1)/2,T=(p+1)/2,L=(b+1)/2,D=(d+f)/4,P=(h+A)/4,O=(g+x)/4;return M>T&&M>L?M<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(M),i=D/r,s=P/r):T>L?T<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(T),r=D/i,s=O/i):L<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(L),r=P/s,i=O/s),this.set(r,i,s,t),this}let _=Math.sqrt((x-g)*(x-g)+(h-A)*(h-A)+(f-d)*(f-d));return Math.abs(_)<.001&&(_=1),this.x=(x-g)/_,this.y=(h-A)/_,this.z=(f-d)/_,this.w=Math.acos((u+p+b-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=$r(this.x,e.x,t.x),this.y=$r(this.y,e.y,t.y),this.z=$r(this.z,e.z,t.z),this.w=$r(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=$r(this.x,e,t),this.y=$r(this.y,e,t),this.z=$r(this.z,e,t),this.w=$r(this.w,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar($r(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};v$.prototype.isVector4=!0;let Rr=v$;class cp extends ef{constructor(e=1,t=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:bs,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},r),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=r.depth,this.scissor=new Rr(0,0,e,t),this.scissorTest=!1,this.viewport=new Rr(0,0,e,t),this.textures=[];const i={width:e,height:t,depth:r.depth},s=new ko(i),a=r.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(r),this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.resolveDepthBuffer=r.resolveDepthBuffer,this.resolveStencilBuffer=r.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=r.depthTexture,this.samples=r.samples,this.multiview=r.multiview,this.useArrayDepthTexture=r.useArrayDepthTexture}_setTextureOptions(e={}){const t={minFilter:bs,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let r=0;r<this.textures.length;r++)this.textures[r].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=r,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,r=e.textures.length;t<r;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new zV(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Kf extends cp{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class GV extends ko{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=cs,this.minFilter=cs,this.wrapR=Uu,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ZMe extends ko{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=cs,this.minFilter=cs,this.wrapR=Uu,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const x8=class x8{constructor(e,t,r,i,s,a,o,l,u,d,h,f,p,g,A,x){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,r,i,s,a,o,l,u,d,h,f,p,g,A,x)}set(e,t,r,i,s,a,o,l,u,d,h,f,p,g,A,x){const b=this.elements;return b[0]=e,b[4]=t,b[8]=r,b[12]=i,b[1]=s,b[5]=a,b[9]=o,b[13]=l,b[2]=u,b[6]=d,b[10]=h,b[14]=f,b[3]=p,b[7]=g,b[11]=A,b[15]=x,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 x8().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),r.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this)}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();const t=this.elements,r=e.elements,i=1/i2.setFromMatrixColumn(e,0).length(),s=1/i2.setFromMatrixColumn(e,1).length(),a=1/i2.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*a,t[9]=r[9]*a,t[10]=r[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,a=Math.cos(r),o=Math.sin(r),l=Math.cos(i),u=Math.sin(i),d=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const f=a*d,p=a*h,g=o*d,A=o*h;t[0]=l*d,t[4]=-l*h,t[8]=u,t[1]=p+g*u,t[5]=f-A*u,t[9]=-o*l,t[2]=A-f*u,t[6]=g+p*u,t[10]=a*l}else if(e.order==="YXZ"){const f=l*d,p=l*h,g=u*d,A=u*h;t[0]=f+A*o,t[4]=g*o-p,t[8]=a*u,t[1]=a*h,t[5]=a*d,t[9]=-o,t[2]=p*
vendor: 4,778 bytes, line 158
158o-g,t[6]=A+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*d,p=l*h,g=u*d,A=u*h;t[0]=f-A*o,t[4]=-a*h,t[8]=g+p*o,t[1]=p+g*o,t[5]=a*d,t[9]=A-f*o,t[2]=-a*u,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*d,p=a*h,g=o*d,A=o*h;t[0]=l*d,t[4]=g*u-p,t[8]=f*u+A,t[1]=l*h,t[5]=A*u+f,t[9]=p*u-g,t[2]=-u,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*u,g=o*l,A=o*u;t[0]=l*d,t[4]=A-f*h,t[8]=g*h+p,t[1]=h,t[5]=a*d,t[9]=-o*d,t[2]=-u*d,t[6]=p*h+g,t[10]=f-A*h}else if(e.order==="XZY"){const f=a*l,p=a*u,g=o*l,A=o*u;t[0]=l*d,t[4]=-h,t[8]=u*d,t[1]=f*h+A,t[5]=a*d,t[9]=p*h-g,t[2]=g*h-p,t[6]=o*d,t[10]=A*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(JMe,e,eke)}lookAt(e,t,r){const i=this.elements;return vd.subVectors(e,t),vd.lengthSq()===0&&(vd.z=1),vd.normalize(),Qg.crossVectors(r,vd),Qg.lengthSq()===0&&(Math.abs(r.z)===1?vd.x+=1e-4:vd.z+=1e-4,vd.normalize(),Qg.crossVectors(r,vd)),Qg.normalize(),WE.crossVectors(vd,Qg),i[0]=Qg.x,i[4]=WE.x,i[8]=vd.x,i[1]=Qg.y,i[5]=WE.y,i[9]=vd.y,i[2]=Qg.z,i[6]=WE.z,i[10]=vd.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,a=r[0],o=r[4],l=r[8],u=r[12],d=r[1],h=r[5],f=r[9],p=r[13],g=r[2],A=r[6],x=r[10],b=r[14],_=r[3],M=r[7],T=r[11],L=r[15],D=i[0],P=i[4],O=i[8],F=i[12],U=i[1],B=i[5],z=i[9],H=i[13],X=i[2],W=i[6],J=i[10],ee=i[14],ae=i[3],le=i[7],Z=i[11],Y=i[15];return s[0]=a*D+o*U+l*X+u*ae,s[4]=a*P+o*B+l*W+u*le,s[8]=a*O+o*z+l*J+u*Z,s[12]=a*F+o*H+l*ee+u*Y,s[1]=d*D+h*U+f*X+p*ae,s[5]=d*P+h*B+f*W+p*le,s[9]=d*O+h*z+f*J+p*Z,s[13]=d*F+h*H+f*ee+p*Y,s[2]=g*D+A*U+x*X+b*ae,s[6]=g*P+A*B+x*W+b*le,s[10]=g*O+A*z+x*J+b*Z,s[14]=g*F+A*H+x*ee+b*Y,s[3]=_*D+M*U+T*X+L*ae,s[7]=_*P+M*B+T*W+L*le,s[11]=_*O+M*z+T*J+L*Z,s[15]=_*F+M*H+T*ee+L*Y,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],i=e[8],s=e[12],a=e[1],o=e[5],l=e[9],u=e[13],d=e[2],h=e[6],f=e[10],p=e[14],g=e[3],A=e[7],x=e[11],b=e[15],_=l*p-u*f,M=o*p-u*h,T=o*f-l*h,L=a*p-u*d,D=a*f-l*d,P=a*h-o*d;return t*(A*_-x*M+b*T)-r*(g*_-x*L+b*D)+i*(g*M-A*L+b*P)-s*(g*T-A*D+x*P)}determinantAffine(){const e=this.elements,t=e[0],r=e[4],i=e[8],s=e[1],a=e[5],o=e[9],l=e[2],u=e[6],d=e[10];return t*(a*d-o*u)-r*(s*d-o*l)+i*(s*u-a*l)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],d=e[8],h=e[9],f=e[10],p=e[11],g=e[12],A=e[13],x=e[14],b=e[15],_=t*o-r*a,M=t*l-i*a,T=t*u-s*a,L=r*l-i*o,D=r*u-s*o,P=i*u-s*l,O=d*A-h*g,F=d*x-f*g,U=d*b-p*g,B=h*x-f*A,z=h*b-p*A,H=f*b-p*x,X=_*H-M*z+T*B+L*U-D*F+P*O;if(X===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const W=1/X;return e[0]=(o*H-l*z+u*B)*W,e[1]=(i*z-r*H-s*B)*W,e[2]=(A*P-x*D+b*L)*W,e[3]=(f*D-h*P-p*L)*W,e[4]=(l*U-a*H-u*F)*W,e[5]=(t*H-i*U+s*F)*W,e[6]=(x*T-g*P-b*M)*W,e[7]=(d*P-f*T+p*M)*W,e[8]=(a*z-o*U+u*O)*W,e[9]=(r*U-t*z-s*O)*W,e[10]=(g*D-A*T+b*_)*W,e[11]=(h*T-d*D-p*_)*W,e[12]=(o*F-a*B-l*O)*W,e[13]=(t*B-r*F+i*O)*W,e[14]=(A*M-g*L-x*_)*W,e[15]=(d*L-h*M+f*_)*W,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,a=e.x,o=e.y,l=e.z,u=s*a,d=s*o;return this.set(u*a+r,u*o-i*l,u*l+i*o,0,u*o+i*l,d*o+r,d*l-i*a,0,u*l-i*o,d*l+i*a,s*l*l+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,a){return this.set(1,r,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,u=s+s,d=a+a,h=o+o,f=s*u,p=s*d,g=s*h,A=a*d,x=a*h,b=
vendor: 25,875 bytes, line 158
158o*h,_=l*u,M=l*d,T=l*h,L=r.x,D=r.y,P=r.z;return i[0]=(1-(A+b))*L,i[1]=(p+T)*L,i[2]=(g-M)*L,i[3]=0,i[4]=(p-T)*D,i[5]=(1-(f+b))*D,i[6]=(x+_)*D,i[7]=0,i[8]=(g+M)*P,i[9]=(x-_)*P,i[10]=(1-(f+A))*P,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];const s=this.determinantAffine();if(s===0)return r.set(1,1,1),t.identity(),this;let a=i2.set(i[0],i[1],i[2]).length();const o=i2.set(i[4],i[5],i[6]).length(),l=i2.set(i[8],i[9],i[10]).length();s<0&&(a=-a),vf.copy(this);const u=1/a,d=1/o,h=1/l;return vf.elements[0]*=u,vf.elements[1]*=u,vf.elements[2]*=u,vf.elements[4]*=d,vf.elements[5]*=d,vf.elements[6]*=d,vf.elements[8]*=h,vf.elements[9]*=h,vf.elements[10]*=h,t.setFromRotationMatrix(vf),r.x=a,r.y=o,r.z=l,this}makePerspective(e,t,r,i,s,a,o=fu,l=!1){const u=this.elements,d=2*s/(t-e),h=2*s/(r-i),f=(t+e)/(t-e),p=(r+i)/(r-i);let g,A;if(l)g=s/(a-s),A=a*s/(a-s);else if(o===fu)g=-(a+s)/(a-s),A=-2*a*s/(a-s);else if(o===qh)g=-a/(a-s),A=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return u[0]=d,u[4]=0,u[8]=f,u[12]=0,u[1]=0,u[5]=h,u[9]=p,u[13]=0,u[2]=0,u[6]=0,u[10]=g,u[14]=A,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,r,i,s,a,o=fu,l=!1){const u=this.elements,d=2/(t-e),h=2/(r-i),f=-(t+e)/(t-e),p=-(r+i)/(r-i);let g,A;if(l)g=1/(a-s),A=a/(a-s);else if(o===fu)g=-2/(a-s),A=-(a+s)/(a-s);else if(o===qh)g=-1/(a-s),A=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return u[0]=d,u[4]=0,u[8]=0,u[12]=f,u[1]=0,u[5]=h,u[9]=0,u[13]=p,u[2]=0,u[6]=0,u[10]=g,u[14]=A,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}};x8.prototype.isMatrix4=!0;let kr=x8;const i2=new Ve,vf=new kr,JMe=new Ve(0,0,0),eke=new Ve(1,1,1),Qg=new Ve,WE=new Ve,vd=new Ve,nQ=new kr,rQ=new $h;class Jd{constructor(e=0,t=0,r=0,i=Jd.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const i=e.elements,s=i[0],a=i[4],o=i[8],l=i[1],u=i[5],d=i[9],h=i[2],f=i[6],p=i[10];switch(t){case"XYZ":this._y=Math.asin($r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-d,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-$r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin($r(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-$r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin($r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-$r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-d,p),this._y=0);break;default:an("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return nQ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nQ,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return rQ.setFromEuler(this),this.setFromQuaternion(rQ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Jd.DEFAULT_ORDER="XYZ";class qV{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 tke=0;const iQ=new Ve,s2=new $h,fm=new kr,XE=new Ve,b3=new Ve,nke=new Ve,rke=new $h,sQ=new Ve(1,0,0),aQ=new Ve(0,1,0),oQ=new Ve(0,0,1),lQ={type:"added"},ike={type:"removed"},a2={type:"childadded",child:null},y9={type:"childremoved",child:null};class ga extends ef{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tke++}),this.uuid=A0(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ga.DEFAULT_UP.clone();const e=new Ve,t=new Jd,r=new $h,i=new Ve(1,1,1);function s(){r.setFromEuler(t,!1)}function a(){t.setFromQuaternion(r,void 0,!1)}t._onChange(s),r._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new kr},normalMatrix:{value:new Gr}}),this.matrix=new kr,this.matrixWorld=new kr,this.matrixAutoUpdate=ga.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=ga.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new qV,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,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return s2.setFromAxisAngle(e,t),this.quaternion.multiply(s2),this}rotateOnWorldAxis(e,t){return s2.setFromAxisAngle(e,t),this.quaternion.premultiply(s2),this}rotateX(e){return this.rotateOnAxis(sQ,e)}rotateY(e){return this.rotateOnAxis(aQ,e)}rotateZ(e){return this.rotateOnAxis(oQ,e)}translateOnAxis(e,t){return iQ.copy(e).applyQuaternion(this.quaternion),this.position.add(iQ.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(sQ,e)}translateY(e){return this.translateOnAxis(aQ,e)}translateZ(e){return this.translateOnAxis(oQ,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(fm.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?XE.copy(e):XE.set(e,t,r);const i=this.parent;this.updateWorldMatrix(!0,!1),b3.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?fm.lookAt(b3,XE,this.up):fm.lookAt(XE,b3,this.up),this.quaternion.setFromRotationMatrix(fm),i&&(fm.extractRotation(i.matrixWorld),s2.setFromRotationMatrix(fm),this.quaternion.premultiply(s2.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(sn("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(lQ),a2.child=e,this.dispatchEvent(a2),a2.child=null):sn("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(ike),y9.child=e,this.dispatchEvent(y9),y9.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),fm.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),fm.multiply(e.parent.matrixWorld)),e.applyMatrix4(fm),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(lQ),a2.child=e,this.dispatchEvent(a2),a2.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,i=this.children.length;r<i;r++){const a=this.children[r].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,r=[]){this[e]===t&&r.push(this);const i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].getObjectsByProperty(e,t,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(b3,e,nke),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(b3,rke,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,r=e.y,i=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*r-s[8]*i,s[13]+=r-s[1]*t-s[5]*r-s[9]*i,s[14]+=i-s[2]*t-s[6]*r-s[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].updateMatrixWorld(e)}updateWorldMatrix(e,t,r=!1){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||r)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,r=!0),t===!0){const s=this.children;for(let a=0,o=s.length;a<o;a++)s[a].updateWorldMatrix(!1,!0,r)}}toJSON(e){const t=e===void 0||typeof e=="string",r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),this.static!==!1&&(i.static=this.static),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.pivot!==null&&(i.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function 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?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let u=0,d=l.length;u<d;u++){const h=l[u];s(e.shapes,h)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,u=this.material.length;l<u;l++)o.push(s(e.materials,this.material[l]));i.material=o}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),u=a(e.textures),d=a(e.images),h=a(e.shapes),f=a(e.skeletons),p=a(e.animations),g=a(e.nodes);o.length>0&&(r.geometries=o),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),d.length>0&&(r.images=d),h.length>0&&(r.shapes=h),f.length>0&&(r.skeletons=f),p.length>0&&(r.animations=p),g.length>0&&(r.nodes=g)}return r.object=i,r;function a(o){const l=[];for(const u in o){const d=o[u];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.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)),t===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}ga.DEFAULT_UP=new Ve(0,1,0);ga.DEFAULT_MATRIX_AUTO_UPDATE=!0;ga.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let Bu=class extends ga{constructor(){super(),this.isGroup=!0,this.type="Group"}};const ske={type:"move"};class p6{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Bu,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 Bu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ve,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ve),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Bu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ve,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ve,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 t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,r){let i=null,s=null,a=null;const o=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){a=!0;for(const A of e.hand.values()){const x=t.getJointPose(A,r),b=this._getHandJoint(u,A);x!==null&&(b.matrix.fromArray(x.transform.matrix),b.matrix.decompose(b.position,b.rotation,b.scale),b.matrixWorldNeedsUpdate=!0,b.jointRadius=x.radius),b.visible=x!==null}const d=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],f=d.position.distanceTo(h.position),p=.02,g=.005;u.inputState.pinching&&f>p+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=p-g&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),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&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(ske)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new Bu;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}const Hce={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},Kg={h:0,s:0,l:0},YE={h:0,s:0,l:0};function b9(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}let tr=class{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Pl){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,_r.colorSpaceToWorking(this,t),this}setRGB(e,t,r,i=_r.workingColorSpace){return this.r=e,this.g=t,this.b=r,_r.colorSpaceToWorking(this,i),this}setHSL(e,t,r,i=_r.workingColorSpace){if(e=VV(e,1),t=$r(t,0,1),r=$r(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,a=2*r-s;this.r=b9(a,s,e+1/3),this.g=b9(a,s,e),this.b=b9(a,s,e-1/3)}return _r.colorSpaceToWorking(this,i),this}setStyle(e,t=Pl){function r(s){s!==void 0&&parseFloat(s)<1&&an("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[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 r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:an("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[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,t);if(a===6)return this.setHex(parseInt(s,16),t);an("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Pl){const r=Hce[e.toLowerCase()];return r!==void 0?this.setHex(r,t):an("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=$m(e.r),this.g=$m(e.g),this.b=$m(e.b),this}copyLinearToSRGB(e){return this.r=Pb(e.r),this.g=Pb(e.g),this.b=Pb(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Pl){return _r.workingToColorSpace(nc.copy(this),e),Math.round($r(nc.r*255,0,255))*65536+Math.round($r(nc.g*255,0,255))*256+Math.round($r(nc.b*255,0,255))}getHexString(e=Pl){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=_r.workingColorSpace){_r.workingToColorSpace(nc.copy(this),t);
vendor: 4,135 bytes, line 158
158const r=nc.r,i=nc.g,s=nc.b,a=Math.max(r,i,s),o=Math.min(r,i,s);let l,u;const d=(o+a)/2;if(o===a)l=0,u=0;else{const h=a-o;switch(u=d<=.5?h/(a+o):h/(2-a-o),a){case r:l=(i-s)/h+(i<s?6:0);break;case i:l=(s-r)/h+2;break;case s:l=(r-i)/h+4;break}l/=6}return e.h=l,e.s=u,e.l=d,e}getRGB(e,t=_r.workingColorSpace){return _r.workingToColorSpace(nc.copy(this),t),e.r=nc.r,e.g=nc.g,e.b=nc.b,e}getStyle(e=Pl){_r.workingToColorSpace(nc.copy(this),e);const t=nc.r,r=nc.g,i=nc.b;return e!==Pl?`color(${e} ${t.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(r*255)},${Math.round(i*255)})`}offsetHSL(e,t,r){return this.getHSL(Kg),this.setHSL(Kg.h+e,Kg.s+t,Kg.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Kg),e.getHSL(YE);const r=h4(Kg.h,YE.h,t),i=h4(Kg.s,YE.s,t),s=h4(Kg.l,YE.l,t);return this.setHSL(r,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,r=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*r+s[6]*i,this.g=s[1]*t+s[4]*r+s[7]*i,this.b=s[2]*t+s[5]*r+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const nc=new tr;tr.NAMES=Hce;class $V extends ga{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 Jd,this.environmentIntensity=1,this.environmentRotation=new Jd,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const yf=new Ve,pm=new Ve,w9=new Ve,mm=new Ve,o2=new Ve,l2=new Ve,cQ=new Ve,_9=new Ve,S9=new Ve,T9=new Ve,E9=new Rr,C9=new Rr,N9=new Rr;class zf{constructor(e=new Ve,t=new Ve,r=new Ve){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,i){i.subVectors(r,t),yf.subVectors(e,t),i.cross(yf);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){yf.subVectors(i,t),pm.subVectors(r,t),w9.subVectors(e,t);const a=yf.dot(yf),o=yf.dot(pm),l=yf.dot(w9),u=pm.dot(pm),d=pm.dot(w9),h=a*u-o*o;if(h===0)return s.set(0,0,0),null;const f=1/h,p=(u*l-o*d)*f,g=(a*d-o*l)*f;return s.set(1-p-g,g,p)}
vendor: 12,387 bytes, line 158
158static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,mm)===null?!1:mm.x>=0&&mm.y>=0&&mm.x+mm.y<=1}static getInterpolation(e,t,r,i,s,a,o,l){return this.getBarycoord(e,t,r,i,mm)===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,mm.x),l.addScaledVector(a,mm.y),l.addScaledVector(o,mm.z),l)}static getInterpolatedAttribute(e,t,r,i,s,a){return E9.setScalar(0),C9.setScalar(0),N9.setScalar(0),E9.fromBufferAttribute(e,t),C9.fromBufferAttribute(e,r),N9.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(E9,s.x),a.addScaledVector(C9,s.y),a.addScaledVector(N9,s.z),a}static isFrontFacing(e,t,r,i){return yf.subVectors(r,t),pm.subVectors(e,t),yf.cross(pm).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return yf.subVectors(this.c,this.b),pm.subVectors(this.a,this.b),yf.cross(pm).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zf.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zf.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,i,s){return zf.getInterpolation(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return zf.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zf.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let a,o;o2.subVectors(i,r),l2.subVectors(s,r),_9.subVectors(e,r);const l=o2.dot(_9),u=l2.dot(_9);if(l<=0&&u<=0)return t.copy(r);S9.subVectors(e,i);const d=o2.dot(S9),h=l2.dot(S9);if(d>=0&&h<=d)return t.copy(i);const f=l*h-d*u;if(f<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(r).addScaledVector(o2,a);T9.subVectors(e,s);const p=o2.dot(T9),g=l2.dot(T9);if(g>=0&&p<=g)return t.copy(s);const A=p*u-l*g;if(A<=0&&u>=0&&g<=0)return o=u/(u-g),t.copy(r).addScaledVector(l2,o);const x=d*g-p*h;if(x<=0&&h-d>=0&&p-g>=0)return cQ.subVectors(s,i),o=(h-d)/(h-d+(p-g)),t.copy(i).addScaledVector(cQ,o);const b=1/(x+A+f);return a=A*b,o=f*b,t.copy(r).addScaledVector(o2,a).addScaledVector(l2,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class dg{constructor(e=new Ve(1/0,1/0,1/0),t=new Ve(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(bf.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,r=e.count;t<r;t++)this.expandByPoint(bf.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=bf.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0){const s=r.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,bf):bf.fromBufferAttribute(s,a),bf.applyMatrix4(e.matrixWorld),this.expandByPoint(bf);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),QE.copy(e.boundingBox)):(r.boundingBox===null&&r.computeBoundingBox(),QE.copy(r.boundingBox)),QE.applyMatrix4(e.matrixWorld),this.union(QE)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,bf),bf.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(w3),KE.subVectors(this.max,w3),c2.subVectors(e.a,w3),u2.subVectors(e.b,w3),d2.subVectors(e.c,w3),Zg.subVectors(u2,c2),Jg.subVectors(d2,u2),Tx.subVectors(c2,d2);let t=[0,-Zg.z,Zg.y,0,-Jg.z,Jg.y,0,-Tx.z,Tx.y,Zg.z,0,-Zg.x,Jg.z,0,-Jg.x,Tx.z,0,-Tx.x,-Zg.y,Zg.x,0,-Jg.y,Jg.x,0,-Tx.y,Tx.x,0];return!M9(t,c2,u2,d2,KE)||(t=[1,0,0,0,1,0,0,0,1],!M9(t,c2,u2,d2,KE))?!1:(ZE.crossVectors(Zg,Jg),t=[ZE.x,ZE.y,ZE.z],M9(t,c2,u2,d2,KE))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,bf).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(bf).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:(gm[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gm[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gm[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gm[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gm[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gm[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gm[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gm[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gm),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 gm=[new Ve,new Ve,new Ve,new Ve,new Ve,new Ve,new Ve,new Ve],bf=new Ve,QE=new dg,c2=new Ve,u2=new Ve,d2=new Ve,Zg=new Ve,Jg=new Ve,Tx=new Ve,w3=new Ve,KE=new Ve,ZE=new Ve,Ex=new Ve;function M9(n,e,t,r,i){for(let s=0,a=n.length-3;s<=a;s+=3){Ex.fromArray(n,s);const o=i.x*Math.abs(Ex.x)+i.y*Math.abs(Ex.y)+i.z*Math.abs(Ex.z),l=e.dot(Ex),u=t.dot(Ex),d=r.dot(Ex);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>o)return!1}return!0}const Lm=ake();function ake(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):u<-14?(r[l]=1024>>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,d=0;for(;(u&8388608)===0;)u<<=1,d-=8388608;u&=-8388609,d+=947912704,s[l]=u|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}function yd(n){Math.abs(n)>65504&&an("DataUtils.toHalfFloat(): Value out of range."),n=$r(n,-65504,65504),Lm.floatView[0]=n;const e=Lm.uint32View[0],t=e>>23&511;return Lm.baseTable[t]+((e&8388607)>>Lm.shiftTable[t])}function JE(n){const e=n>>10;return Lm.uint32View[0]=Lm.mantissaTable[Lm.offsetTable[e]+(n&1023)]+Lm.exponentTable[e],Lm.floatView[0]}const yo=new Ve,eC=new Jt;let oke=0;class Ea extends ef{constructor(e,t,r=!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:oke++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=Vw,this.updateRanges=[],this.gpuType=ia,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,r=this.count;t<r;t++)eC.fromBufferAttribute(this,t),eC.applyMatrix3(e),this.setXY(t,eC.x,eC.y);else if(this.itemSize===3)for(let t=0,r=this.count;t<r;t++)yo.fromBufferAttribute(this,t),yo.applyMatrix3(e),this.setXYZ(t,yo.x,yo.y,yo.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)yo.fromBufferAttribute(this,t),yo.applyMatrix4(e),this.setXYZ(t,yo.x,yo.y,yo.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)yo.fromBufferAttribute(this,t),yo.applyNormalMatrix(e),this.setXYZ(t,yo.x,yo.y,yo.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)yo.fromBufferAttribute(this,t),yo.transformDirection(e),this.setXYZ(t,yo.x,yo.y,yo.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let r=this.array[e*this.itemSize+t];return this.normalized&&(r=uu(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=ii(r,this.array)),this.array[e*this.itemSize+t]=r,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=uu(t,this.array)),t}setX(e,t){return this.normalized&&(t=ii(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=uu(t,this.array)),t}setY(e,t){return this.normalized&&(t=ii(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=uu(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ii(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=uu(t,this.array)),t}setW(e,t){return this.normalized&&(t=ii(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array),i=ii(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e*=this.itemSize,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array),i=ii(i,this.array),s=ii(s,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=s,this}
vendor: 5,152 bytes, line 158
158onUpload(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!==Vw&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class HV extends Ea{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class WV extends Ea{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class Wce extends Ea{constructor(e,t,r){super(new Uint16Array(e),t,r),this.isFloat16BufferAttribute=!0}getX(e){let t=JE(this.array[e*this.itemSize]);return this.normalized&&(t=uu(t,this.array)),t}setX(e,t){return this.normalized&&(t=ii(t,this.array)),this.array[e*this.itemSize]=yd(t),this}getY(e){let t=JE(this.array[e*this.itemSize+1]);return this.normalized&&(t=uu(t,this.array)),t}setY(e,t){return this.normalized&&(t=ii(t,this.array)),this.array[e*this.itemSize+1]=yd(t),this}getZ(e){let t=JE(this.array[e*this.itemSize+2]);return this.normalized&&(t=uu(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ii(t,this.array)),this.array[e*this.itemSize+2]=yd(t),this}getW(e){let t=JE(this.array[e*this.itemSize+3]);return this.normalized&&(t=uu(t,this.array)),t}setW(e,t){return this.normalized&&(t=ii(t,this.array)),this.array[e*this.itemSize+3]=yd(t),this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array)),this.array[e+0]=yd(t),this.array[e+1]=yd(r),this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array),i=ii(i,this.array)),this.array[e+0]=yd(t),this.array[e+1]=yd(r),this.array[e+2]=yd(i),this}setXYZW(e,t,r,i,s){return e*=this.itemSize,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array),i=ii(i,this.array),s=ii(s,this.array)),this.array[e+0]=yd(t),this.array[e+1]=yd(r),this.array[e+2]=yd(i),this.array[e+3]=yd(s),this}}class Bi extends Ea{constructor(e,t,r){super(new Float32Array(e),t,r)}}const lke=new dg,_3=new Ve,k9=new Ve;class H1{constructor(e=new Ve,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):lke.setFromPoints(e).getCenter(r);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,r.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}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;_3.subVectors(e,this.center);const t=_3.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(_3,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(k9.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(_3.copy(e.center).add(k9)),this.expandByPoint(_3.copy(e.center).sub(k9))),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 cke=0;const bh=new kr,R9=new ga,h2=new Ve,bd=new dg,S3=new dg,rl=new Ve;class ds extends ef{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:cke++}),this.uuid=A0(),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(kMe(e)?WV:HV)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}
vendor: 16,384 bytes, line 158
158addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const s=new Gr().getNormalMatrix(e);r.applyNormalMatrix(s),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return bh.makeRotationFromQuaternion(e),this.applyMatrix4(bh),this}rotateX(e){return bh.makeRotationX(e),this.applyMatrix4(bh),this}rotateY(e){return bh.makeRotationY(e),this.applyMatrix4(bh),this}rotateZ(e){return bh.makeRotationZ(e),this.applyMatrix4(bh),this}translate(e,t,r){return bh.makeTranslation(e,t,r),this.applyMatrix4(bh),this}scale(e,t,r){return bh.makeScale(e,t,r),this.applyMatrix4(bh),this}lookAt(e){return R9.lookAt(e),R9.updateMatrix(),this.applyMatrix4(R9.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(h2).negate(),this.translate(h2.x,h2.y,h2.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const r=[];for(let i=0,s=e.length;i<s;i++){const a=e[i];r.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Bi(r,3))}else{const r=Math.min(e.length,t.count);for(let i=0;i<r;i++){const s=e[i];t.setXYZ(i,s.x,s.y,s.z||0)}e.length>t.count&&an("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new dg);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){sn("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Ve(-1/0,-1/0,-1/0),new Ve(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let r=0,i=t.length;r<i;r++){const s=t[r];bd.setFromBufferAttribute(s),this.morphTargetsRelative?(rl.addVectors(this.boundingBox.min,bd.min),this.boundingBox.expandByPoint(rl),rl.addVectors(this.boundingBox.max,bd.max),this.boundingBox.expandByPoint(rl)):(this.boundingBox.expandByPoint(bd.min),this.boundingBox.expandByPoint(bd.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&sn('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 H1);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){sn("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Ve,1/0);return}if(e){const r=this.boundingSphere.center;if(bd.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];S3.setFromBufferAttribute(o),this.morphTargetsRelative?(rl.addVectors(bd.min,S3.min),bd.expandByPoint(rl),rl.addVectors(bd.max,S3.max),bd.expandByPoint(rl)):(bd.expandByPoint(S3.min),bd.expandByPoint(S3.max))}bd.getCenter(r);let i=0;for(let s=0,a=e.count;s<a;s++)rl.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(rl));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let u=0,d=o.count;u<d;u++)rl.fromBufferAttribute(o,u),l&&(h2.fromBufferAttribute(e,u),rl.add(h2)),i=Math.max(i,r.distanceToSquared(rl))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&sn('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){sn("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=t.position,i=t.normal,s=t.uv;let a=this.getAttribute("tangent");(a===void 0||a.count!==r.count)&&(a=new Ea(new Float32Array(4*r.count),4),this.setAttribute("tangent",a));const o=[],l=[];for(let O=0;O<r.count;O++)o[O]=new Ve,l[O]=new Ve;const u=new Ve,d=new Ve,h=new Ve,f=new Jt,p=new Jt,g=new Jt,A=new Ve,x=new Ve;function b(O,F,U){u.fromBufferAttribute(r,O),d.fromBufferAttribute(r,F),h.fromBufferAttribute(r,U),f.fromBufferAttribute(s,O),p.fromBufferAttribute(s,F),g.fromBufferAttribute(s,U),d.sub(u),h.sub(u),p.sub(f),g.sub(f);const B=1/(p.x*g.y-g.x*p.y);isFinite(B)&&(A.copy(d).multiplyScalar(g.y).addScaledVector(h,-p.y).multiplyScalar(B),x.copy(h).multiplyScalar(p.x).addScaledVector(d,-g.x).multiplyScalar(B),o[O].add(A),o[F].add(A),o[U].add(A),l[O].add(x),l[F].add(x),l[U].add(x))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let O=0,F=_.length;O<F;++O){const U=_[O],B=U.start,z=U.count;for(let H=B,X=B+z;H<X;H+=3)b(e.getX(H+0),e.getX(H+1),e.getX(H+2))}const M=new Ve,T=new Ve,L=new Ve,D=new Ve;function P(O){L.fromBufferAttribute(i,O),D.copy(L);const F=o[O];M.copy(F),M.sub(L.multiplyScalar(L.dot(F))).normalize(),T.crossVectors(D,F);const B=T.dot(l[O])<0?-1:1;a.setXYZW(O,M.x,M.y,M.z,B)}for(let O=0,F=_.length;O<F;++O){const U=_[O],B=U.start,z=U.count;for(let H=B,X=B+z;H<X;H+=3)P(e.getX(H+0)),P(e.getX(H+1)),P(e.getX(H+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let r=this.getAttribute("normal");if(r===void 0||r.count!==t.count)r=new Ea(new Float32Array(t.count*3),3),this.setAttribute("normal",r);else for(let f=0,p=r.count;f<p;f++)r.setXYZ(f,0,0,0);const i=new Ve,s=new Ve,a=new Ve,o=new Ve,l=new Ve,u=new Ve,d=new Ve,h=new Ve;if(e)for(let f=0,p=e.count;f<p;f+=3){const g=e.getX(f+0),A=e.getX(f+1),x=e.getX(f+2);i.fromBufferAttribute(t,g),s.fromBufferAttribute(t,A),a.fromBufferAttribute(t,x),d.subVectors(a,s),h.subVectors(i,s),d.cross(h),o.fromBufferAttribute(r,g),l.fromBufferAttribute(r,A),u.fromBufferAttribute(r,x),o.add(d),l.add(d),u.add(d),r.setXYZ(g,o.x,o.y,o.z),r.setXYZ(A,l.x,l.y,l.z),r.setXYZ(x,u.x,u.y,u.z)}else for(let f=0,p=t.count;f<p;f+=3)i.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),d.subVectors(a,s),h.subVectors(i,s),d.cross(h),r.setXYZ(f+0,d.x,d.y,d.z),r.setXYZ(f+1,d.x,d.y,d.z),r.setXYZ(f+2,d.x,d.y,d.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)rl.fromBufferAttribute(e,t),rl.normalize(),e.setXYZ(t,rl.x,rl.y,rl.z)}toNonIndexed(){function e(o,l){const u=o.array,d=o.itemSize,h=o.normalized,f=new u.constructor(l.length*d);let p=0,g=0;for(let A=0,x=l.length;A<x;A++){o.isInterleavedBufferAttribute?p=l[A]*o.data.stride+o.offset:p=l[A]*d;for(let b=0;b<d;b++)f[g++]=u[p++]}return new Ea(f,d,h)}if(this.index===null)return an("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ds,r=this.index.array,i=this.attributes;for(const o in i){const l=i[o],u=e(l,r);t.setAttribute(o,u)}const s=this.morphAttributes;for(const o in s){const l=[],u=s[o];for(let d=0,h=u.length;d<h;d++){const f=u[d],p=e(f,r);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const u=a[o];t.addGroup(u.start,u.count,u.materialIndex)}return t}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 t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],d=[];for(let h=0,f=u.length;h<f;h++){const p=u[h];d.push(p.toJSON(e.data))}d.length>0&&(i[l]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const 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 t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],h=s[u];for(let f=0,p=h.length;f<p;f++)d.push(h[f].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let u=0,d=a.length;u<d;u++){const h=a[u];this.addGroup(h.start,h.count,h.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"})}}class XV{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Vw,this.updateRanges=[],this.version=0,this.uuid=A0()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[r+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=A0()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=A0()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Wc=new Ve;class l0{constructor(e,t,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)Wc.fromBufferAttribute(this,t),Wc.applyMatrix4(e),this.setXYZ(t,Wc.x,Wc.y,Wc.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Wc.fromBufferAttribute(this,t),Wc.applyNormalMatrix(e),this.setXYZ(t,Wc.x,Wc.y,Wc.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Wc.fromBufferAttribute(this,t),Wc.transformDirection(e),this.setXYZ(t,Wc.x,Wc.y,Wc.z);return this}getComponent(e,t){let r=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(r=uu(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=ii(r,this.array)),this.data.array[e*this.data.stride+this.offset+t]=r,this}setX(e,t){return this.normalized&&(t=ii(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=ii(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=ii(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=ii(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=uu(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=uu(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=uu(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=uu(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array),i=ii(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=ii(t,this.array),r=ii(r,this.array),i=ii(i,this.array),s=ii(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){w5("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new Ea(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new l0(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){w5("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let uke=0;class Cc extends ef{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:uke++}),this.uuid=A0(),this.name="",this.type="Material",this.blending=dl,this.side=mu,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=dw,this.blendDst=hw,this.blendEquation=Ol,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tr(0,0,0),this.blendAlpha=0,this.depthFunc=T1,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=UI,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Gx,this.stencilZFail=Gx,this.stencilZPass=Gx,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){an(`Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){an(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector2&&r&&r.is
vendor: 11,650 bytes, line 158
158Vector2||i&&i.isEuler&&r&&r.isEuler||i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(r.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(r.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==dl&&(r.blending=this.blending),this.side!==mu&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==dw&&(r.blendSrc=this.blendSrc),this.blendDst!==hw&&(r.blendDst=this.blendDst),this.blendEquation!==Ol&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==T1&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==UI&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Gx&&(r.stencilFail=this.stencilFail),this.stencilZFail!==Gx&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==Gx&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.allowOverride===!1&&(r.allowOverride=!1),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(r.textures=s),a.length>0&&(r.images=a)}return r}fromJSON(e,t){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 tr().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
vendor: 5,257 bytes, line 158
158!==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=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),this.normalScale=new Jt().fromArray(r)}return e.displacementMap!==void 0&&(this.displacementMap=t[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=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[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=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new Jt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[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 t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 7,372 bytes, line 158
158adows,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++}}class dke extends Cc{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new tr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Am=new Ve,P9=new Ve,tC=new Ve,eA=new Ve,L9=new Ve,nC=new Ve,O9=new Ve;class TT{constructor(e=new Ve,t=new Ve(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Am)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Am.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Am.copy(this.origin).addScaledVector(this.direction,t),Am.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){P9.copy(e).add(t).multiplyScalar(.5),tC.copy(t).sub(e).normalize(),eA.copy(this.origin).sub(P9);const s=e.distanceTo(t)*.5,a=-this.direction.dot(tC),o=eA.dot(this.direction),l=-eA.dot(tC),u=eA.lengthSq(),d=Math.abs(1-a*a);let h,f,p,g;if(d>0)if(h=a*l-o,f=a*o-l,g=s*d,h>=0)if(f>=-g)if(f<=g){const A=1/d;h*=A,f*=A,p=h*(h+a*f+2*o)+f*(a*h+f+2*l)+u}else f=s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+u;else f=-s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+u;else f<=-g?(h=Math.max(0,-(-a*s+o)),f=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+u):f<=g?(h=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+u):(h=Math.max(0,-(a*s+o)),f=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+u);else f=a>0?-s:s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(P9).addScaledVector(tC,f),p}intersectSphere(e,t){Am.subVectors(e.center,this.origin);const r=Am.dot(this.direction),i=Am.dot(Am)-r*r,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-i),o=r-a,l=r+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,a,o,l;const u=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,f=this.origin;return u>=0?(r=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(r=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),d>=0?(s=(e.min.y-f.y)*d,a=(e.max.y-f.y)*d):(s=(e.max.y-f.y)*d,a=(e.min.y-f.y)*d),r>a||s>i||((s>r||isNaN(r))&&(r=s),(a<i||isNaN(i))&&(i=a),h>=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),r>l||o>i)||((o>r||r!==r)&&(r=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(r>=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,Am)!==null}intersectTriangle(e,t,r,i,s){L9.subVectors(t,e),nC.subVectors(r,e),O9.crossVectors(L9,nC);let a=this.direction.dot(O9),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;eA.subVectors(this.origin,e);const l=o*this.direction.dot(nC.crossVectors(eA,nC));if(l<0)return null;const u=o*this.direction.dot(L9.cross(eA));if(u<0||l+u>a)return null;const d=-o*eA.dot(O9);return d<0?null:this.at(d/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 Lh extends Cc{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tr(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 Jd,this.combine=vT,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 uQ=new kr,Cx=new TT,rC=new H1,dQ=new Ve,iC=new Ve,sC=new Ve,aC=new Ve,D9=new Ve,oC=new Ve,hQ=new Ve,lC=new Ve;class ns extends ga{constructor(e=new ds,t=new Lh){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const r=this.geometry,i=r.attributes.position,s=r.morphAttributes.position,a=r.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){oC.set(0,0,0);for(let l=0,u=s.length;l<u;l++){const d=o[l],h=s[l];d!==0&&(D9.fromBufferAttribute(h,e),a?oC.addScaledVector(D9,d):oC.addScaledVector(D9.sub(t),d))}t.add(oC)}return t}raycast(e,t){const r=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(r.boundingSphere===null&&r.computeBoundingSphere(),rC.copy(r.boun
vendor: 2,719 bytes, line 158
158dingSphere),rC.applyMatrix4(s),Cx.copy(e.ray).recast(e.near),!(rC.containsPoint(Cx.origin)===!1&&(Cx.intersectSphere(rC,dQ)===null||Cx.origin.distanceToSquared(dQ)>(e.far-e.near)**2))&&(uQ.copy(s).invert(),Cx.copy(e.ray).applyMatrix4(uQ),!(r.boundingBox!==null&&Cx.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,Cx)))}_computeIntersections(e,t,r){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,h=s.attributes.normal,f=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,A=f.length;g<A;g++){const x=f[g],b=a[x.materialIndex],_=Math.max(x.start,p.start),M=Math.min(o.count,Math.min(x.start+x.count,p.start+p.count));for(let T=_,L=M;T<L;T+=3){const D=o.getX(T),P=o.getX(T+1),O=o.getX(T+2);i=cC(this,b,e,r,u,d,h,D,P,O),i&&(i.faceIndex=Math.floor(T/3),i.face.materialIndex=x.materialIndex,t.push(i))}}else{const g=Math.max(0,p.start),A=Math.min(o.count,p.start+p.count);for(let x=g,b=A;x<b;x+=3){const _=o.getX(x),M=o.getX(x+1),T=o.getX(x+2);i=cC(this,a,e,r,u,d,h,_,M,T),i&&(i.faceIndex=Math.floor(x/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let g=0,A=f.length;g<A;g++){const x=f[g],b=a[x.materialIndex],_=Math.max(x.start,p.start),M=Math.min(l.count,Math.min(x.start+x.count,p.start+p.count));for(let T=_,L=M;T<L;T+=3){const D=T,P=T+1,O=T+2;i=cC(this,b,e,r,u,d,h,D,P,O),i&&(i.faceIndex=Math.floor(T/3),i.face.materialIndex=x.materialIndex,t.push(i))}}else{const g=Math.max(0,p.start),A=Math.min(l.count,p.start+p.count);for(let x=g,b=A;x<b;x+=3){const _=x,M=x+1,T=x+2;i=cC(this,a,e,r,u,d,h,_,M,T),i&&(i.faceIndex=Math.floor(x/3),t.push(i))}}}}function hke(n,e,t,r,i,s,a,o){let l;if(e.side===us?l=r.intersectTriangle(a,s,i,!0,o):l=r.intersectTriangle(i,s,a,e.side===mu,o),l===null)return null;lC.copy(o),lC.applyMatrix4(n.matrixWorld);const u=t.ray.origin.distanceTo(lC);return u<t.near||u>t.far?null:{distance:u,point:lC.clone(),object:n}}function cC(n,e,t,r,i,s,a,o,l,u){n.getVertexPosition(o,iC),n.getVertexPosition(l,sC),n.getVertexPosition(u,aC);const d=hke(n,e,t,r,iC,sC,aC,hQ);if(d){const h=new Ve;zf.getBarycoord(hQ,iC,sC,aC,h),i&&(d.uv=zf.getInterpolatedAttribute(i,o,l,u,h,new Jt)),s&&(d.uv1=zf.getInterpolatedAttribute(s,o,l,u,h,new Jt)),a&&(d.normal=zf.getInterpolatedAttribute(a,o,l,u,h,new Ve),d.normal.dot(r.direction)>0&&d.normal.multiplyScalar(-1));const f={a:o,b:l,c:u,normal:new Ve,materialIndex:0};zf.getNormal(iC,sC,aC,f.normal),d.face=f,d.barycoord=h}return d}class YV extends ko{constructor(e=null,t=1,r=1,i,s,a,o,l,u=cs,d=cs,h,f){super(null,a,o,l,u,d,i,s,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}
vendor: 10,653 bytes, line 158
158class h1 extends Ea{constructor(e,t,r,i=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const j9=new Ve,fke=new Ve,pke=new Gr;class Xp{constructor(e=new Ve(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=j9.subVectors(r,t).cross(fke.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,r=!0){const i=e.delta(j9),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return r===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||pke.getNormalMatrix(e),i=this.coplanarPoint(j9).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Nx=new H1,mke=new Jt(.5,.5),uC=new Ve;class ny{constructor(e=new Xp,t=new Xp,r=new Xp,i=new Xp,s=new Xp,a=new Xp){this.planes=[e,t,r,i,s,a]}set(e,t,r,i,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(r),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=fu,r=!1){const i=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],u=s[3],d=s[4],h=s[5],f=s[6],p=s[7],g=s[8],A=s[9],x=s[10],b=s[11],_=s[12],M=s[13],T=s[14],L=s[15];if(i[0].setComponents(u-a,p-d,b-g,L-_).normalize(),i[1].setComponents(u+a,p+d,b+g,L+_).normalize(),i[2].setComponents(u+o,p+h,b+A,L+M).normalize(),i[3].setComponents(u-o,p-h,b-A,L-M).normalize(),r)i[4].setComponents(l,f,x,T).normalize(),i[5].setComponents(u-l,p-f,b-x,L-T).normalize();else if(i[4].setComponents(u-l,p-f,b-x,L-T).normalize(),t===fu)i[5].setComponents(u+l,p+f,b+x,L+T).normalize();else if(t===qh)i[5].setComponents(l,f,x,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Nx.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Nx.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Nx)}intersectsSprite(e){Nx.center.set(0,0,0);const t=mke.distanceTo(e.center);return Nx.radius=.7071067811865476+t,Nx.applyMatrix4(e.matrixWorld),this.intersectsSphere(Nx)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const i=t[r];if(uC.x=i.normal.x>0?e.max.x:e.min.x,uC.y=i.normal.y>0?e.max.y:e.min.y,uC.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(uC)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const fQ=new kr;class QV{constructor(){this.coordinateSystem=fu,this._frustums=[],this._count=0}setFromArrayCamera(e){const t=e.cameras,r=this._frustums;for(let i=0;i<t.length;i++){const s=t[i];fQ.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),r[i]===void 0&&(r[i]=new ny),r[i].setFromProjectionMatrix(fQ,s.coordinateSystem,s.reversedDepth)}return this._count=t.length,this}intersectsObject(e){const t=this._frustums;for(let r=0;r<this._count;r++)if(t[r].intersectsObject(e))return!0;return!1}intersectsSprite(e){const t=this._frustums;for(let r=0;r<this._count;r++)if(t[r].intersectsSprite(e))return!0;return!1}intersectsSphere(e){const t=this._frustums;for(let r=0;r<this._count;r++)if(t[r].intersectsSphere(e))return!0;return!1}intersectsBox(e){const t=this._frustums;for(let r=0;r<this._count;r++)if(t[r].intersectsBox(e))return!0;return!1}containsPoint(e){const t=this._frustums;for(let r=0;r<this._count;r++)if(t[r].containsPoint(e))return!0;return!1}copy(e){this.coordinateSystem=e.coordinateSystem;const t=this._frustums,r=e._frustums;for(let i=0;i<e._count;i++)t[i]===void 0&&(t[i]=new ny),t[i].copy(r[i]);return this._count=e._count,this}clone(){return new QV().copy(this)}}class w_ extends Cc{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tr(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const DM=new Ve,jM=new Ve,pQ=new kr,T3=new TT,dC=new H1,I9=new Ve,mQ=new Ve;class X8 extends ga{constructor(e=new ds,t=new w_){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[0];for(let i=1,s=t.count;i<s;i++)DM.fromBufferAttribute(t,i-1),jM.fromBufferAttribute(t,i),r[i]=r[i-1],r[i]+=DM.distanceTo(jM);e.setAttribute("lineDistance",new Bi(r,1))}else an("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,a=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),dC.copy(r.boundingSphere),dC.applyMatrix4(i),dC.radius+=s,e.ray.intersectsSphere(dC)===!1)return;pQ.copy(i).invert(),T3.copy(e.ray).applyMatrix4(pQ);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,u=this.isLineSegments?2:1,d=r.index,f=r.attributes.position;if(d!==null){const p=Math.max(0,a.start),g=Math.min(d.count,a.start+a.count);for(let A=p,x=g-1;A<x;A+=u){const b=d.getX(A),_=d.getX(A+1),M=hC(this,e,T3,l,b,_,A);M&&t.push(M)}if(this.isLineLoop){const A=d.getX(g-1),x=d.getX(p),b=hC(this,e,T3,l,A,x,g-1);b&&t.push(b)}}else{const p=Math.max(0,a.start),g=Math.min(f.count,a.start+a.count);for(let A=p,x=g-1;A<x;A+=u){const b=hC(this,e,T3,l,A,A+1,A);b&&t.push(b)}if(this.isLineLoop){const A=hC(this,e,T3,l,g-1,p,g-1);A&&t.push(A)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function hC(n,e,t,r,i,s,a){const o=n.geometry.attributes.position;if(DM.fromBufferAttribute(o,i),jM.fromBufferAttribute(o,s),t.distanceSqToSegment(DM,jM,I9,mQ)>r)return;I9.applyMatrix4(n.matrixWorld);const u=e.ray.origin.distanceTo(I9);if(!(u<e.near||u>e.far))return{distance:u,point:mQ.clone().applyMatrix4(n.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:n}}const gQ=new Ve,AQ=new Ve;class Xce extends X8{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[];for(let i=0,s=t.count;i<s;i+=2)gQ.fromBufferAttribute(t,i),AQ.fromBufferAttribute(t,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+gQ.distanceTo(AQ);e.setAttribute("lineDistance",new Bi(r,1))}else an("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class KV extends Cc{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const xQ=new kr,BI=new TT,fC=new H1,pC=new Ve;class gke extends ga{constructor(e=new ds,t=new KV){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,a=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),fC.copy(r.boundingSphere),fC.applyMatrix4(i),fC.radius+=s,e.ray.intersectsSphere(fC)===!1)return;xQ.copy(i).invert(),BI.copy(e.ray).applyMatrix4(xQ);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,u=r.index,h=r.attributes.position;if(u!==null){const f=Math.max(0,a.start),p=Math.min(u.count,a.start+a.count);for(let g=f,A=p;g<A;g++){const x=u.getX(g);pC.fromBufferAttribute(h,x),vQ(pC,x,l,i,e,t,this)}}else{const f=Math.max(0,a.start),p=Math.min(h.count,a.start+a.count);for(let g=f,A=p;g<A;g++)pC.fromBufferAttribute(h,g),vQ(pC,g,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function vQ(n,e,t,r,i,s,a){const o=BI.distanceSqToPoint(n);if(o<t){const l=new Ve;
vendor: 4,229 bytes, line 158
158BI.closestPointToPoint(n,l),l.applyMatrix4(r);const u=i.ray.origin.distanceTo(l);if(u<i.near||u>i.far)return;s.push({distance:u,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class ZV extends ko{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=cs,this.minFilter=cs,this.generateMipmaps=!1,this.needsUpdate=!0}}class __ extends ko{constructor(e=[],t=np,r,i,s,a,o,l,u,d){super(e,t,r,i,s,a,o,l,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Bl extends ko{constructor(e,t,r=ts,i,s,a,o=cs,l=cs,u,d=ml,h=1){if(d!==ml&&d!==vc)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:t,depth:h};super(f,i,s,a,o,l,d,r,u),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new zV(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Yce extends Bl{constructor(e,t=ts,r=np,i,s,a=cs,o=cs,l,u=ml){const d={width:e,height:e,depth:1},h=[d,d,d,d,d,d];super(e,e,t,r,i,s,a,o,l,u),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Qce extends ko{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class W1 extends ds{constructor(e=1,t=1,r=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],u=[],d=[],h=[];let f=0,p=0;g("z","y","x",-1,-1,r,t,e,a,s,0),g("z","y","x",1,-1,r,t,-e,a,s,1),g("x","z","y",1,1,e,r,t,i,a,2),g("x","z","y",1,-1,e,r,-t,i,a,3),g("x","y","z",1,-1,e,t,r,i,s,4),g("x","y","z",-1,-1,e,t,-r,i,s,5),this.setIndex(l),this.setAttribute("position",new Bi(u,3)),this.setAttribute("normal",new Bi(d,3)),this.setAttribute("uv",new Bi(h,2));function g(A,x,b,_,M,T,L,D,P,O,F){const U=T/P,B=L/O,z=T/2,H=L/2,X=D/2,W=P+1,J=O+1;let ee=0,ae=0;const le=new Ve;for(let Z=0;Z<J;Z++){const Y=Z*B-H;for(let re=0;re<W;re++){const _e=re*U-z;le[A]=_e*_,le[x]=Y*M,le[b]=X,u.push(le.x,le.y,le.z),le[A]=0,le[x]=0,le[b]=D>0?1:-1,d.push(le.x,le.y,le.z),h.push(re/P),h.push(1-Z/O),ee+=1}}for(let Z=0;Z<O;Z++)for(let Y=0;Y<P;Y++){const re=f+Y+W*Z,_e=f+Y+W*(Z+1),Ee=f+(Y+1)+W*(Z+1),Ae=f+(Y+1)+W*Z;l.push(re,_e,Ae),l.push(_e,Ee,Ae),ae+=6}o.addGroup(p,ae,F),p+=ae,f+=ee}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new W1(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Y8 extends ds{constructor(e=1,t=32,r=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:i},t=Math.max(3,t);const s=[],a=[],o=[],l=[],u=new Ve,d=new Jt;a.push(0,0,0),o.push(0,0,1),l.push(.5,.5);for(let h=0,f=3;h<=t;h++,f+=3){const p=r+h/t*i;u.x=e*Math.cos(p),u.y=e*Math.sin(p),a.push(u.x,u.y,u.z),o.push(0,0,1),d.x=(a[f]/e+1)/2,d.y=(a[f+1]/e+1)/2,l.push(d.x,d.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Bi(a,3)),this.setAttribute("normal",new Bi(o,3)),this.setAttribute("uv",new Bi(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Y8(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Q8 extends ds{constructor(e=1,t=1,r=1,i=32,s=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:i,heightSegments:s,openEnded:a,thetaStart:o,thetaLength:l};const u=this;i=Math.floor(i),s=Math.floor(s);const d=[],h=[],f=[],p=[];let g=0;const A=[],x=r/2;let b=0;_(),a===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(d),this.setAttribute("position",new Bi(h,3)),this.setAttribute("normal",new Bi(f,3)),this.setAttribute("uv",new Bi(p,2));function _(){const T=new Ve,L=new Ve;let D=0;const P=(t-e)/r;
vendor: 4,141 bytes, line 158
158for(let O=0;O<=s;O++){const F=[],U=O/s,B=U*(t-e)+e;for(let z=0;z<=i;z++){const H=z/i,X=H*l+o,W=Math.sin(X),J=Math.cos(X);L.x=B*W,L.y=-U*r+x,L.z=B*J,h.push(L.x,L.y,L.z),T.set(W,P,J).normalize(),f.push(T.x,T.y,T.z),p.push(H,1-U),F.push(g++)}A.push(F)}for(let O=0;O<i;O++)for(let F=0;F<s;F++){const U=A[F][O],B=A[F+1][O],z=A[F+1][O+1],H=A[F][O+1];(e>0||F!==0)&&(d.push(U,B,H),D+=3),(t>0||F!==s-1)&&(d.push(B,z,H),D+=3)}u.addGroup(b,D,0),b+=D}function M(T){const L=g,D=new Jt,P=new Ve;let O=0;const F=T===!0?e:t,U=T===!0?1:-1;for(let z=1;z<=i;z++)h.push(0,x*U,0),f.push(0,U,0),p.push(.5,.5),g++;const B=g;for(let z=0;z<=i;z++){const X=z/i*l+o,W=Math.cos(X),J=Math.sin(X);P.x=F*J,P.y=x*U,P.z=F*W,h.push(P.x,P.y,P.z),f.push(0,U,0),D.x=W*.5+.5,D.y=J*.5*U+.5,p.push(D.x,D.y),g++}for(let z=0;z<i;z++){const H=L+z,X=B+z;T===!0?d.push(X,X+1,H):d.push(X+1,X,H),O+=3}u.addGroup(b,O,T===!0?1:2),b+=O}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Q8(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class up{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){an("Curve: .getPoint() not implemented.")}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,i=this.getPoint(0),s=0;t.push(0);for(let a=1;a<=e;a++)r=this.getPoint(a/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const r=this.getLengths();let i=0;const s=r.length;let a;t?a=t:a=e*r[s-1];let o=0,l=s-1,u;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),u=r[i]-a,u<0)o=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===a)return i/(s-1);const d=r[i],f=r[i+1]-d,p=(a-d)/f;return(i+p)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const a=this.getPoint(i),o=this.getPoint(s),l=t||(a.isVector2?new Jt:new Ve);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t=!1){const r=new Ve,i=[],s=[],a=[],o=new Ve,l=new kr;for(let p=0;p<=e;p++){const g=p/e;i[p]=this.getTangentAt(g,new Ve)}s[0]=new Ve,a[0]=new Ve;let u=Number.MAX_VALUE;const d=Math.abs(i[0].x),h=Math.abs(i[0].y),f=Math.abs(i[0].z);d<=u&&(u=d,r.set(1,0,0)),h<=u&&(u=h,r.set(0,1,0)),f<=u&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],o),a[0].crossVectors(i[0],s[0]);for(let p=1;p<=e;p++){if(s[p]=s[p-1].clone(),a[p]=a[p-1].clone(),o.crossVectors(i[p-1],i[p]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos($r(i[p-1].dot(i[p]),-1,1));s[p].applyMatrix4(l.makeRotationAxis(o,g))}a[p].crossVectors(i[p],s[p])}if(t===!0){let p=Math.acos($r(s[0].dot(s[e]),-1,1));p/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(p=-p);for(let g=1;g<=e;g++)s[g].applyMatrix4(l.makeRotationAxis(i[g],p*g)),a[g].crossVectors(i[g],s[g])}return{tangents:i,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class JV extends up{constructor(e=0,t=0,r=1,i=1,s=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new Jt){const r=t,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;
vendor: 5,588 bytes, line 158
158s<Number.EPSILON&&(a?s=0:s=i),this.aClockwise===!0&&!a&&(s===i?s=-i:s=s-i);const o=this.aStartAngle+e*s;let l=this.aX+this.xRadius*Math.cos(o),u=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const d=Math.cos(this.aRotation),h=Math.sin(this.aRotation),f=l-this.aX,p=u-this.aY;l=f*d-p*h+this.aX,u=f*h+p*d+this.aY}return r.set(l,u)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Ake extends JV{constructor(e,t,r,i,s,a){super(e,t,r,r,i,s,a),this.isArcCurve=!0,this.type="ArcCurve"}}function ez(){let n=0,e=0,t=0,r=0;function i(s,a,o,l){n=s,e=o,t=-3*s+3*a-2*o-l,r=2*s-2*a+o+l}return{initCatmullRom:function(s,a,o,l,u){i(a,o,u*(o-s),u*(l-a))},initNonuniformCatmullRom:function(s,a,o,l,u,d,h){let f=(a-s)/u-(o-s)/(u+d)+(o-a)/d,p=(o-a)/d-(l-a)/(d+h)+(l-o)/h;f*=d,p*=d,i(a,o,f,p)},calc:function(s){const a=s*s,o=a*s;return n+e*s+t*a+r*o}}}const yQ=new Ve,bQ=new Ve,F9=new ez,U9=new ez,B9=new ez;class xke extends up{constructor(e=[],t=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=i}getPoint(e,t=new Ve){const r=t,i=this.points,s=i.length,a=(s-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let u,d;this.closed||o>0?u=i[(o-1)%s]:(bQ.subVectors(i[0],i[1]).add(i[0]),u=bQ);const h=i[o%s],f=i[(o+1)%s];if(this.closed||o+2<s?d=i[(o+2)%s]:(yQ.subVectors(i[s-1],i[s-2]).add(i[s-1]),d=yQ),this.curveType==="centripetal"||this.curveType==="chordal"){const p=this.curveType==="chordal"?.5:.25;let g=Math.pow(u.distanceToSquared(h),p),A=Math.pow(h.distanceToSquared(f),p),x=Math.pow(f.distanceToSquared(d),p);A<1e-4&&(A=1),g<1e-4&&(g=A),x<1e-4&&(x=A),F9.initNonuniformCatmullRom(u.x,h.x,f.x,d.x,g,A,x),U9.initNonuniformCatmullRom(u.y,h.y,f.y,d.y,g,A,x),B9.initNonuniformCatmullRom(u.z,h.z,f.z,d.z,g,A,x)}else this.curveType==="catmullrom"&&(F9.initCatmullRom(u.x,h.x,f.x,d.x,this.tension),U9.initCatmullRom(u.y,h.y,f.y,d.y,this.tension),B9.initCatmullRom(u.z,h.z,f.z,d.z,this.tension));return r.set(F9.calc(l),U9.calc(l),B9.calc(l)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new Ve().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function wQ(n,e,t,r,i){const s=(r-e)*.5,a=(i-t)*.5,o=n*n,l=n*o;return(2*t-2*r+s+a)*l+(-3*t+3*r-2*s-a)*o+s*n+t}function vke(n,e){const t=1-n;return t*t*e}function yke(n,e){return 2*(1-n)*n*e}function bke(n,e){return n*n*e}function f4(n,e,t,r){return vke(n,e)+yke(n,t)+bke(n,r)}function wke(n,e){const t=1-n;return t*t*t*e}function _ke(n,e){const t=1-n;return 3*t*t*n*e}function Ske(n,e){return 3*(1-n)*n*n*e}function Tke(n,e){return n*n*n*e}function p4(n,e,t,r,i){return wke(n,e)+_ke(n,t)+Ske(n,r)+Tke(n,i)}class Kce extends up{constructor(e=new Jt,t=new Jt,r=new Jt,i=new Jt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new Jt){const r=t,i=this.v0,s=this.v1,a=this.v2,o=this.v3;return r.set(p4(e,i.x,s.x,a.x,o.x),p4(e,i.y,s.y,a.y,o.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Zce extends up{constructor(e=new Ve,t=new Ve,r=new Ve,i=new Ve){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new Ve){const r=t,i=this.v0,s=this.v1,a=this.v2,o=this.v3;return r.set(p4(e,i.x,s.x,a.x,o.x),p4(e,i.y,s.y,a.y,o.y),p4(e,i.z,s.z,a.z,o.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Jce extends up{constructor(e=new Jt,t=new Jt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Jt){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 8,664 bytes, line 158
158getTangent(e,t=new Jt){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Eke extends up{constructor(e=new Ve,t=new Ve){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new Ve){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Ve){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class eue extends up{constructor(e=new Jt,t=new Jt,r=new Jt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new Jt){const r=t,i=this.v0,s=this.v1,a=this.v2;return r.set(f4(e,i.x,s.x,a.x),f4(e,i.y,s.y,a.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class tue extends up{constructor(e=new Ve,t=new Ve,r=new Ve){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new Ve){const r=t,i=this.v0,s=this.v1,a=this.v2;return r.set(f4(e,i.x,s.x,a.x),f4(e,i.y,s.y,a.y),f4(e,i.z,s.z,a.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class nue extends up{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Jt){const r=t,i=this.points,s=(i.length-1)*e,a=Math.floor(s),o=s-a,l=i[a===0?a:a-1],u=i[a],d=i[a>i.length-2?i.length-1:a+1],h=i[a>i.length-3?i.length-1:a+2];return r.set(wQ(o,l.x,u.x,d.x,h.x),wQ(o,l.y,u.y,d.y,h.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new Jt().fromArray(i))}return this}}var IM=Object.freeze({__proto__:null,ArcCurve:Ake,CatmullRomCurve3:xke,CubicBezierCurve:Kce,CubicBezierCurve3:Zce,EllipseCurve:JV,LineCurve:Jce,LineCurve3:Eke,QuadraticBezierCurve:eue,QuadraticBezierCurve3:tue,SplineCurve:nue});class Cke extends up{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const r=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new IM[r](t,e))}return this}getPoint(e,t){const r=e*this.getLength(),i=this.getCurveLengths();let s=0;for(;s<i.length;){if(i[s]>=r){const a=i[s]-r,o=this.curves[s],l=o.getLength(),u=l===0?0:1-a/l;return o.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r<i;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let r;for(let i=0,s=this.curves;i<s.length;i++){const a=s[i],o=a.isEllipseCurve?e*2:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,l=a.getPoints(o);for(let u=0;u<l.length;u++){const d=l[u];r&&r.equals(d)||(t.push(d),r=d)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(new IM[i.type]().fromJSON(i))}return this}}let FM=class extends Cke{constructor(e){super(),this.type="Path",this.currentPoint=new Jt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const r=new Jce(this.currentPoint.clone(),new Jt(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,i){const s=new eue(this.currentPoint.clone(),new Jt(e,t),new Jt(r,i));return this.curves.push(s),this.currentPoint.set(r,i),this}bezierCurveTo(e,t,r,i,s,a){const o=new Kce(this.currentPoint.clone(),new Jt(e,t),new Jt(r,i),new Jt(s,a));return this.curves.push(o),this.currentPoint.set(s,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),r=new nue(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,i,s,a){const o=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+o,t+l,r,i,s,a),this}absarc(e,t,r,i,s,a){return this.absellipse(e,t,r,r,i,s,a),this}ellipse(e,t,r,i,s,a,o,l){const u=this.currentPoint.x,d=this.currentPoint.y;return this.absellipse(e+u,t+d,r,i,s,a,o,l),this}absellipse(e,t,r,i,s,a,o,l){const u=new JV(e,t,r,i,s,a,o,l);if(this.curves.length>0){const h=u.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(u);const d=u.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}};class rue extends FM{constructor(e){super(e),this.uuid=A0(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,i=this.holes.length;r<i;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(new FM().fromJSON(i))}return this}}function Nke(n,e,t=2){const r=e&&e.length,i=r?e[0]*t:n.length;let s=iue(n,0,i,t,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u;if(r&&(s=Lke(n,e,s,t)),n.length>80*t){o=n[0],l=n[1];let d=o,h=l;for(let f=t;f<i;f+=t){const p=n[f],g=n[f+1];p<o&&(o=p),g<l&&(l=g),p>d&&(d=p),g>h&&(h=g)}u=Math.max(d-o,h-l),u=u!==0?32767/u:0}return _5(s,a,t,o,l,u,0),a}function iue(n,e,t,r,i){let s;if(i===qke(n,e,t,r)>0)for(let a=e;a<t;a+=r)s=_Q(a/r|0,n[a],n[a+1],s);else for(let a=t-r;a>=e;a-=r)s=_Q(a/r|0,n[a],n[a+1],s);return s&&Gw(s,s.next)&&(T5(s),s=s.next),s}function ry(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(Gw(t,t.next)||Ua(t.prev,t,t.next)===0)){if(T5(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function _5(n,e,t,r,i,s,a){if(!n)return;!a&&s&&Fke(n,r,i,s);let o=n;for(;n.prev!==n.next;){const l=n.prev,u=n.next;if(s?kke(n,r,i,s):Mke(n)){e.push(l.i,n.i,u.i),T5(n),n=u.next,o=u.next;continue}if(n=u,n===o){a?a===1?(n=Rke(ry(n),e),_5(n,e,t,r,i,s,2)):a===2&&Pke(n,e,t,r,i,s):_5(ry(n),e,t,r,i,s,1);break}}}function Mke(n){const e=n.prev,t=n,r=n.next;if(Ua(e,t,r)>=0)return!1;
vendor: 4,230 bytes, line 158
158const i=e.x,s=t.x,a=r.x,o=e.y,l=t.y,u=r.y,d=Math.min(i,s,a),h=Math.min(o,l,u),f=Math.max(i,s,a),p=Math.max(o,l,u);let g=r.next;for(;g!==e;){if(g.x>=d&&g.x<=f&&g.y>=h&&g.y<=p&&RS(i,o,s,l,a,u,g.x,g.y)&&Ua(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function kke(n,e,t,r){const i=n.prev,s=n,a=n.next;if(Ua(i,s,a)>=0)return!1;const o=i.x,l=s.x,u=a.x,d=i.y,h=s.y,f=a.y,p=Math.min(o,l,u),g=Math.min(d,h,f),A=Math.max(o,l,u),x=Math.max(d,h,f),b=VI(p,g,e,t,r),_=VI(A,x,e,t,r);let M=n.prevZ,T=n.nextZ;for(;M&&M.z>=b&&T&&T.z<=_;){if(M.x>=p&&M.x<=A&&M.y>=g&&M.y<=x&&M!==i&&M!==a&&RS(o,d,l,h,u,f,M.x,M.y)&&Ua(M.prev,M,M.next)>=0||(M=M.prevZ,T.x>=p&&T.x<=A&&T.y>=g&&T.y<=x&&T!==i&&T!==a&&RS(o,d,l,h,u,f,T.x,T.y)&&Ua(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;M&&M.z>=b;){if(M.x>=p&&M.x<=A&&M.y>=g&&M.y<=x&&M!==i&&M!==a&&RS(o,d,l,h,u,f,M.x,M.y)&&Ua(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;T&&T.z<=_;){if(T.x>=p&&T.x<=A&&T.y>=g&&T.y<=x&&T!==i&&T!==a&&RS(o,d,l,h,u,f,T.x,T.y)&&Ua(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function Rke(n,e){let t=n;do{const r=t.prev,i=t.next.next;!Gw(r,i)&&aue(r,t,t.next,i)&&S5(r,i)&&S5(i,r)&&(e.push(r.i,t.i,i.i),T5(t),T5(t.next),t=n=i),t=t.next}while(t!==n);return ry(t)}function Pke(n,e,t,r,i,s){let a=n;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&Vke(a,o)){let l=oue(a,o);a=ry(a,a.next),l=ry(l,l.next),_5(a,e,t,r,i,s,0),_5(l,e,t,r,i,s,0);return}o=o.next}a=a.next}while(a!==n)}function Lke(n,e,t,r){const i=[];for(let s=0,a=e.length;s<a;s++){const o=e[s]*r,l=s<a-1?e[s+1]*r:n.length,u=iue(n,o,l,r,!1);u===u.next&&(u.steiner=!0),i.push(Bke(u))}i.sort(Oke);for(let s=0;s<i.length;s++)t=Dke(i[s],t);return t}function Oke(n,e){let t=n.x-e.x;if(t===0&&(t=n.y-e.y,t===0)){const r=(n.next.y-n.y)/(n.next.x-n.x),i=(e.next.y-e.y)/(e.next.x-e.x);t=r-i}return t}function Dke(n,e){const t=jke(n,e);if(!t)return e;const r=oue(t,n);return ry(r,r.next),ry(t,t.next)}function jke(n,e){let t=e;const r=n.x,i=n.y;let s=-1/0,a;if(Gw(n,t))return t;do{if(Gw(n,t.next))return t.next;if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const h=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=r&&h>s&&(s=h,a=t.x<t.next.x?t:t.next,h===r))return a}t=t.next}while(t!==e);if(!a)return null;const o=a,l=a.x,u=a.y;let d=1/0;t=a;do{if(r>=t.x&&t.x>=l&&r!==t.x&&sue(i<u?r:s,i,l,u,i<u?s:r,i,t.x,t.y)){const h=Math.abs(i-t.y)/(r-t.x);S5(t,n)&&(h<d||h===d&&(t.x>a.x||t.x===a.x&&Ike(a,t)))&&(a=t,d=h)}t=t.next}while(t!==o);return a}function Ike(n,e){return Ua(n.prev,n,e.prev)<0&&Ua(e.next,n,n.next)<0}function Fke(n,e,t,r){let i=n;do i.z===0&&(i.z=VI(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,Uke(i)}function Uke(n){let e,t=1;do{let r=n,i;n=null;let s=null;for(e=0;r;){e++;let a=r,o=0;for(let u=0;u<t&&(o++,a=a.nextZ,!!a);u++);let l=t;for(;o>0||l>0&&a;)o!==0&&(l===0||!a||r.z<=a.z)?(i=r,r=r.nextZ,o--):(i=a,a=a.nextZ,l--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;r=a}s.nextZ=null,t*=2}while(e>1);return n}function VI(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Bke(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function sue(n,e,t,r,i,s,a,o){return(i-a)*(e-o)>=(n-a)*(s-o)&&(n-a)*(r-o)>=(t-a)*(e-o)&&(t-a)*(s-o)>=(i-a)*(r-o)}function RS(n,e,t,r,i,s,a,o){return!(n===a&&e===o)&&sue(n,e,t,r,i,s,a,o)}function Vke(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!zke(n,e)&&(S5(n,e)&&S5(e,n)&&Gke(n,e)&&(Ua(n.prev,n,e.prev)||Ua(n,e.prev,e))||Gw(n,e)&&Ua(n.prev,n,n.next)>0&&Ua(e.prev,e,e.next)>0)}function Ua(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Gw(n,e){return n.x===e.x&&n.y===e.y}function aue(n,e,t,r){const i=gC(Ua(n,e,t)),s=gC(Ua(n,e,r)),a=gC(Ua(t,r,n)),o=gC(Ua(t,r,e));return!!(i!==s&&a!==o||i===0&&mC(n,t,e)||s===0&&mC(n,r,e)||a===0&&mC(t,n,r)||o===0&&mC(t,e,r))}function mC(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function gC(n){return n>0?1:n<0?-1:0}function zke(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&aue(t,t.next,n,e))return!0;t=t.next}
158while(t!==n);return!1}function S5(n,e){return Ua(n.prev,n,n.next)<0?Ua(n,e,n.next)>=0&&Ua(n,n.prev,e)>=0:Ua(n,e,n.prev)<0||Ua(n,n.next,e)<0}function Gke(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function oue(n,e){const t=zI(n.i,n.x,n.y),r=zI(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function _Q(n,e,t,r){const i=zI(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function T5(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function zI(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qke(n,e,t,r){let i=0;for(let s=e,a=t-r;s<t;s+=r)i+=(n[a]-n[s])*(n[s+1]+n[a+1]),a=s;return i}class $ke{static triangulate(e,t,r=2){return Nke(e,t,r)}}class hv{static area(e){const t=e.length;let r=0;for(let i=t-1,s=0;s<t;i=s++)r+=e[i].x*e[s].y-e[s].x*e[i].y;return r*.5}static isClockWise(e){return hv.area(e)<0}static triangulateShape(e,t){const r=[],i=[],s=[];SQ(e),TQ(r,e);let a=e.length;t.forEach(SQ);for(let l=0;l<t.length;l++)i.push(a),a+=t[l].length,TQ(r,t[l]);const o=$ke.triangulate(r,i);for(let l=0;l<o.length;l+=3)s.push(o.slice(l,l+3));return s}}function SQ(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function TQ(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class tz extends ds{constructor(e=new rue([new Jt(.5,.5),new Jt(-.5,.5),new Jt(-.5,-.5),new Jt(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const r=this,i=[],s=[];for(let o=0,l=e.length;o<l;o++){const u=e[o];a(u)}this.setAttribute("position",new Bi(i,3)),this.setAttribute("uv",new Bi(s,2)),this.computeVertexNormals();function a(o){const l=[],u=t.curveSegments!==void 0?t.curveSegments:12,d=t.steps!==void 0?t.steps:1,h=t.depth!==void 0?t.depth:1;let f=t.bevelEnabled!==void 0?t.bevelEnabled:!0,p=t.bevelThickness!==void 0?t.bevelThickness:.2,g=t.bevelSize!==void 0?t.bevelSize:p-.1,A=t.bevelOffset!==void 0?t.bevelOffset:0,x=t.bevelSegments!==void 0?t.bevelSegments:3;const b=t.extrudePath,_=t.UVGenerator!==void 0?t.UVGenerator:Hke;let M,T=!1,L,D,P,O;if(b){M=b.getSpacedPoints(d),T=!0,f=!1;const dt=b.isCatmullRomCurve3?b.closed:!1;L=b.computeFrenetFrames(d,dt),D=new Ve,P=new Ve,O=new Ve}f||(x=0,p=0,g=0,A=0);const F=o.extractPoints(u);let U=F.shape;const B=F.holes;if(!hv.isClockWise(U)){U=U.reverse();for(let dt=0,St=B.length;dt<St;dt++){const kt=B[dt];hv.isClockWise(kt)&&(B[dt]=kt.reverse())}}function H(dt){const kt=10000000000000001e-36;let Fe=dt[0];for(let Ze=1;Ze<=dt.length;Ze++){const Ye=Ze%dt.length,ft=dt[Ye],At=ft.x-Fe.x,Ce=ft.y-Fe.y,Se=At*At+Ce*Ce,qe=Math.max(Math.abs(ft.x),Math.abs(ft.y),Math.abs(Fe.x),Math.abs(Fe.y)),pt=kt*qe*qe;if(Se<=pt){dt.splice(Ye,1),Ze--;continue}Fe=ft}}H(U),B.forEach(H);const X=B.length,W=U;for(let dt=0;dt<X;dt++){const St=B[dt];U=U.concat(St)}function J(dt,St,kt){return St||sn("ExtrudeGeometry: vec does not exist"),dt.clone().addScaledVector(St,kt)}const ee=U.length;function ae(dt,St,kt){let Fe,Ze,Ye;const ft=dt.x-St.x,At=dt.y-St.y,Ce=kt.x-dt.x,Se=kt.y-dt.y,qe=ft*ft+At*At,pt=ft*Se-At*Ce;if(Math.abs(pt)>Number.EPSILON){const Te=Math.sqrt(qe),oe=Math.sqrt(Ce*Ce+Se*Se),ge=St.x-At/Te,Ne=St.y+ft/Te,ke=kt.x-Se/oe,Xe=kt.y+Ce/oe,et=((ke-ge)*Se-(Xe-Ne)*Ce)/(ft*Se-At*Ce);Fe=ge+ft*et-dt.x,Ze=Ne+At*et-dt.y;const Qe=Fe*Fe+Ze*Ze;if(Qe<=2)return new Jt(Fe,Ze);Ye=Math.sqrt(Qe/2)}else{let Te=!1;ft>Number.EPSILON?Ce>Number.EPSILON&&(Te=!0):ft<-Number.EPSILON?Ce<-Number.EPSILON&&(Te=!0):Math.sign(At)===Math.sign(Se)&&(Te=!0),Te?(Fe=-At,Ze=ft,Ye=Math.sqrt(qe)):(Fe=ft,Ze=At,Ye=Math.sqrt(qe/2))}return new Jt(Fe/Ye,Ze/Ye)}const le=[];for(let dt=0,St=W.length,kt=St-1,Fe=dt+1;dt<St;dt++,kt++,Fe++)kt===St&&(kt=0),Fe===St&&(Fe=0),le[dt]=ae(W[dt],W[kt],W[Fe]);const Z=[];let Y,re=le.concat();for(let dt=0,St=X;dt<St;dt++){const kt=B[dt];Y=[];for(let Fe=0,Ze=kt.length,Ye=Ze-1,ft=Fe+1;Fe<Ze;Fe++,Ye++,ft++)Ye===Ze&&(Ye=0),ft===Ze&&(ft=0),Y[Fe]=ae(kt[Fe],kt[Ye],kt[ft]);Z.push(Y),re=re.concat(Y)}let _e;if(x===0)_e=hv.triangulateShape(W,B);else{const dt=[],St=[];for(let kt=0;kt<x;kt++){const Fe=kt/x,Ze=p*Math.cos(Fe*Math.PI/2),Ye=g*Math.sin(Fe*Math.PI/2)+A;for(let ft=0,At=W.length;ft<At;ft++){const Ce=J(W[ft],le[ft],Ye);Ue(Ce.x,Ce.y,-Ze),Fe===0&&dt.push(Ce)}for(let ft=0,At=X;ft<At;ft++){const Ce=B[ft];Y=Z[ft];const Se=[];for(let qe=0,pt=Ce.length;qe<pt;qe++){const Te=J(Ce[qe],Y[qe],Ye);Ue(Te.x,Te.y,-Ze),Fe===0&&Se.push(Te)}Fe===0&&St.push(Se)}}_e=hv.triangulateShape(dt,St)}
vendor: 24,311 bytes, lines 158-162
158const Ee=_e.length,Ae=g+A;for(let dt=0;dt<ee;dt++){const St=f?J(U[dt],re[dt],Ae):U[dt];T?(P.copy(L.normals[0]).multiplyScalar(St.x),D.copy(L.binormals[0]).multiplyScalar(St.y),O.copy(M[0]).add(P).add(D),Ue(O.x,O.y,O.z)):Ue(St.x,St.y,0)}for(let dt=1;dt<=d;dt++)for(let St=0;St<ee;St++){const kt=f?J(U[St],re[St],Ae):U[St];T?(P.copy(L.normals[dt]).multiplyScalar(kt.x),D.copy(L.binormals[dt]).multiplyScalar(kt.y),O.copy(M[dt]).add(P).add(D),Ue(O.x,O.y,O.z)):Ue(kt.x,kt.y,h/d*dt)}for(let dt=x-1;dt>=0;dt--){const St=dt/x,kt=p*Math.cos(St*Math.PI/2),Fe=g*Math.sin(St*Math.PI/2)+A;for(let Ze=0,Ye=W.length;Ze<Ye;Ze++){const ft=J(W[Ze],le[Ze],Fe);Ue(ft.x,ft.y,h+kt)}for(let Ze=0,Ye=B.length;Ze<Ye;Ze++){const ft=B[Ze];Y=Z[Ze];for(let At=0,Ce=ft.length;At<Ce;At++){const Se=J(ft[At],Y[At],Fe);T?Ue(Se.x,Se.y+M[d-1].y,M[d-1].x+kt):Ue(Se.x,Se.y,h+kt)}}}te(),ve();function te(){const dt=i.length/3;if(f){let St=0,kt=ee*St;for(let Fe=0;Fe<Ee;Fe++){const Ze=_e[Fe];ze(Ze[2]+kt,Ze[1]+kt,Ze[0]+kt)}St=d+x*2,kt=ee*St;for(let Fe=0;Fe<Ee;Fe++){const Ze=_e[Fe];ze(Ze[0]+kt,Ze[1]+kt,Ze[2]+kt)}}else{for(let St=0;St<Ee;St++){const kt=_e[St];ze(kt[2],kt[1],kt[0])}for(let St=0;St<Ee;St++){const kt=_e[St];ze(kt[0]+ee*d,kt[1]+ee*d,kt[2]+ee*d)}}r.addGroup(dt,i.length/3-dt,0)}function ve(){const dt=i.length/3;let St=0;we(W,St),St+=W.length;for(let kt=0,Fe=B.length;kt<Fe;kt++){const Ze=B[kt];we(Ze,St),St+=Ze.length}r.addGroup(dt,i.length/3-dt,1)}function we(dt,St){let kt=dt.length;for(;--kt>=0;){const Fe=kt;let Ze=kt-1;Ze<0&&(Ze=dt.length-1);for(let Ye=0,ft=d+x*2;Ye<ft;Ye++){const At=ee*Ye,Ce=ee*(Ye+1),Se=St+Fe+At,qe=St+Ze+At,pt=St+Ze+Ce,Te=St+Fe+Ce;yt(Se,qe,pt,Te)}}}function Ue(dt,St,kt){l.push(dt),l.push(St),l.push(kt)}function ze(dt,St,kt){mt(dt),mt(St),mt(kt);const Fe=i.length/3,Ze=_.generateTopUV(r,i,Fe-3,Fe-2,Fe-1);bt(Ze[0]),bt(Ze[1]),bt(Ze[2])}function yt(dt,St,kt,Fe){mt(dt),mt(St),mt(Fe),mt(St),mt(kt),mt(Fe);const Ze=i.length/3,Ye=_.generateSideWallUV(r,i,Ze-6,Ze-3,Ze-2,Ze-1);bt(Ye[0]),bt(Ye[1]),bt(Ye[3]),bt(Ye[1]),bt(Ye[2]),bt(Ye[3])}function mt(dt){i.push(l[dt*3+0]),i.push(l[dt*3+1]),i.push(l[dt*3+2])}function bt(dt){s.push(dt.x),s.push(dt.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,r=this.parameters.options;return Wke(t,r,e)}static fromJSON(e,t){const r=[];for(let s=0,a=e.shapes.length;s<a;s++){const o=t[e.shapes[s]];r.push(o)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new IM[i.type]().fromJSON(i)),new tz(r,e.options)}}const Hke={generateTopUV:function(n,e,t,r,i){const s=e[t*3],a=e[t*3+1],o=e[r*3],l=e[r*3+1],u=e[i*3],d=e[i*3+1];return[new Jt(s,a),new Jt(o,l),new Jt(u,d)]},generateSideWallUV:function(n,e,t,r,i,s){const a=e[t*3],o=e[t*3+1],l=e[t*3+2],u=e[r*3],d=e[r*3+1],h=e[r*3+2],f=e[i*3],p=e[i*3+1],g=e[i*3+2],A=e[s*3],x=e[s*3+1],b=e[s*3+2];return Math.abs(o-d)<Math.abs(a-u)?[new Jt(a,1-l),new Jt(u,1-h),new Jt(f,1-g),new Jt(A,1-b)]:[new Jt(o,1-l),new Jt(d,1-h),new Jt(p,1-g),new Jt(x,1-b)]}};function Wke(n,e,t){if(t.shapes=[],Array.isArray(n))for(let r=0,i=n.length;r<i;r++){const s=n[r];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class ET extends ds{constructor(e=1,t=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};const s=e/2,a=t/2,o=Math.floor(r),l=Math.floor(i),u=o+1,d=l+1,h=e/o,f=t/l,p=[],g=[],A=[],x=[];for(let b=0;b<d;b++){const _=b*f-a;for(let M=0;M<u;M++){const T=M*h-s;g.push(T,-_,0),A.push(0,0,1),x.push(M/o),x.push(1-b/l)}}for(let b=0;b<l;b++)for(let _=0;_<o;_++){const M=_+u*b,T=_+u*(b+1),L=_+1+u*(b+1),D=_+1+u*b;p.push(M,T,D),p.push(T,L,D)}this.setIndex(p),this.setAttribute("position",new Bi(g,3)),this.setAttribute("normal",new Bi(A,3)),this.setAttribute("uv",new Bi(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ET(e.width,e.height,e.widthSegments,e.heightSegments)}}class F0 extends ds{constructor(e=1,t=32,r=16,i=0,s=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:i,phiLength:s,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));const l=Math.min(a+o,Math.PI);let u=0;const d=[],h=new Ve,f=new Ve,p=[],g=[],A=[],x=[];for(let b=0;b<=r;b++){const _=[],M=b/r,T=a+M*o,L=e*Math.cos(T),D=Math.sqrt(e*e-L*L);let P=0;b===0&&a===0?P=.5/t:b===r&&l===Math.PI&&(P=-.5/t);for(let O=0;O<=t;O++){const F=O/t,U=i+F*s;h.x=-D*Math.cos(U),h.y=L,h.z=D*Math.sin(U),g.push(h.x,h.y,h.z),f.copy(h).normalize(),A.push(f.x,f.y,f.z),x.push(F+P,1-M),_.push(u++)}d.push(_)}for(let b=0;b<r;b++)for(let _=0;_<t;_++){const M=d[b][_+1],T=d[b][_],L=d[b+1][_],D=d[b+1][_+1];(b!==0||a>0)&&p.push(M,T,D),(b!==r-1||l<Math.PI)&&p.push(T,L,D)}this.setIndex(p),this.setAttribute("position",new Bi(g,3)),this.setAttribute("normal",new Bi(A,3)),this.setAttribute("uv",new Bi(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new F0(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class nz extends ds{constructor(e=new tue(new Ve(-1,-1,0),new Ve(-1,1,0),new Ve(1,1,0)),t=64,r=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:i,closed:s};const a=e.computeFrenetFrames(t,s);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new Ve,l=new Ve,u=new Jt;let d=new Ve;const h=[],f=[],p=[],g=[];A(),this.setIndex(g),this.setAttribute("position",new Bi(h,3)),this.setAttribute("normal",new Bi(f,3)),this.setAttribute("uv",new Bi(p,2));function A(){for(let M=0;M<t;M++)x(M);x(s===!1?t:0),_(),b()}function x(M){d=e.getPointAt(M/t,d);const T=a.normals[M],L=a.binormals[M];for(let D=0;D<=i;D++){const P=D/i*Math.PI*2,O=Math.sin(P),F=-Math.cos(P);l.x=F*T.x+O*L.x,l.y=F*T.y+O*L.y,l.z=F*T.z+O*L.z,l.normalize(),f.push(l.x,l.y,l.z),o.x=d.x+r*l.x,o.y=d.y+r*l.y,o.z=d.z+r*l.z,h.push(o.x,o.y,o.z)}}function b(){for(let M=1;M<=t;M++)for(let T=1;T<=i;T++){const L=(i+1)*(M-1)+(T-1),D=(i+1)*M+(T-1),P=(i+1)*M+T,O=(i+1)*(M-1)+T;g.push(L,D,O),g.push(D,P,O)}}function _(){for(let M=0;M<=t;M++)for(let T=0;T<=i;T++)u.x=M/t,u.y=T/i,p.push(u.x,u.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new nz(new IM[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Xke extends ds{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],r=new Set,i=new Ve,s=new Ve;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let u=0,d=l.length;u<d;++u){const h=l[u],f=h.start,p=h.count;for(let g=f,A=f+p;g<A;g+=3)for(let x=0;x<3;x++){const b=o.getX(g+x),_=o.getX(g+(x+1)%3);i.fromBufferAttribute(a,b),s.fromBufferAttribute(a,_),EQ(i,s,r)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let u=0;u<3;u++){const d=3*o+u,h=3*o+(u+1)%3;i.fromBufferAttribute(a,d),s.fromBufferAttribute(a,h),EQ(i,s,r)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new Bi(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function EQ(n,e,t){const r=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(r)===!0||t.has(i)===!0?!1:(t.add(r),t.add(i),!0)}class Yke extends Cc{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new tr(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}function qw(n){const e={};for(const t in n){e[t]={};for(const r in n[t]){const i=n[t][r];if(CQ(i))i.isRenderTargetTexture?(an("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][r]=null):e[t][r]=i.clone();else if(Array.isArray(i))if(CQ(i[0])){const s=[];for(let a=0,o=i.length;a<o;a++)s[a]=i[a].clone();e[t][r]=s}else e[t][r]=i.slice();else e[t][r]=i}}return e}function Kc(n){const e={};for(let t=0;t<n.length;t++){const r=qw(n[t]);for(const i in r)e[i]=r[i]}return e}function CQ(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function Qke(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function lue(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:_r.workingColorSpace}const K8={clone:qw,merge:Kc};var Kke=`void main() { 159 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 160}`,Zke=`void main() { 161 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 162}`;class Nc extends Cc{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Kke,this.fragmentShader=Zke,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=qw(e.uniforms),this.uniformsGroups=Qke(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 t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(const r in e.uniforms){const i=e.uniforms[r];switch(this.uniforms[r]={},i.type){case"t":this.uniforms[r].value=t[i.value]||null;break;case"c":this.uniforms[r].value=new tr().setHex(i.value);break;case"v2":this.uniforms[r].value=new Jt().fromArray(i.value);break;case"v3":this.uniforms[r].value=new Ve().fromArray(i.value);break;case"v4":this.uniforms[r].value=new Rr().fromArray(i.value);break;case"m3":this.uniforms[r].value=new Gr().fromArray(i.value);break;case"m4":this.uniforms[r].value=new kr().fromArray(i.value);break;default:this.uniforms[r].value=i.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 r in e.extensions)this.extensions[r]=e.extensions[r];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}}class Jke extends Nc{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class cue extends Cc{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new tr(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 tr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qf,this.normalScale=new Jt(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 Jd,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 e8e extends cue{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Jt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return $r(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new tr(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new tr(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new tr(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class uue extends Cc{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new tr(16777215),this.specular=new tr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qf,this.normalScale=new Jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Jd,this.combine=vT,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class t8e extends Cc{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new tr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qf,this.normalScale=new Jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class n8e extends Cc{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qf,this.normalScale=new Jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class hg extends Cc{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new tr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qf,this.normalScale=new Jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Jd,this.combine=vT,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class r8e extends Cc{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=pMe,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 i8e extends Cc{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}}
vendor: 12,210 bytes, line 162
162class s8e extends Cc{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new tr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qf,this.normalScale=new Jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class a8e extends w_{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}const V9={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(NQ(n)||(this.files[n]=e))},get:function(n){if(this.enabled!==!1&&!NQ(n))return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};function NQ(n){try{const e=n.slice(n.indexOf(":")+1);return new URL(e).protocol==="blob:"}catch{return!1}}class o8e{constructor(e,t,r){const i=this;let s=!1,a=0,o=0,l;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this._abortController=null,this.itemStart=function(d){o++,s===!1&&i.onStart!==void 0&&i.onStart(d,a,o),s=!0},this.itemEnd=function(d){a++,i.onProgress!==void 0&&i.onProgress(d,a,o),a===o&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return d=d.normalize("NFC"),l?l(d):d},this.setURLModifier=function(d){return l=d,this},this.addHandler=function(d,h){return u.push(d,h),this},this.removeHandler=function(d){const h=u.indexOf(d);return h!==-1&&u.splice(h,2),this},this.getHandler=function(d){for(let h=0,f=u.length;h<f;h+=2){const p=u[h],g=u[h+1];if(p.global&&(p.lastIndex=0),p.test(d))return g}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const l8e=new o8e;let rz=class{constructor(e){this.manager=e!==void 0?e:l8e,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){const r=this;return new Promise(function(i,s){r.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}};rz.DEFAULT_MATERIAL_NAME="__DEFAULT";const f2=new WeakMap;class c8e extends rz{constructor(e){super(e)}load(e,t,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=V9.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)s.manager.itemStart(e),setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0);else{let h=f2.get(a);h===void 0&&(h=[],f2.set(a,h)),h.push({onLoad:t,onError:i})}return a}const o=b5("img");function l(){d(),t&&t(this);const h=f2.get(this)||[];for(let f=0;f<h.length;f++){const p=h[f];p.onLoad&&p.onLoad(this)}f2.delete(this),s.manager.itemEnd(e)}function u(h){d(),i&&i(h),V9.remove(`image:${e}`);const f=f2.get(this)||[];for(let p=0;p<f.length;p++){const g=f[p];g.onError&&g.onError(h)}f2.delete(this),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){o.removeEventListener("load",l,!1),o.removeEventListener("error",u,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),V9.add(`image:${e}`,o),s.manager.itemStart(e),o.src=e,o}}class iz extends rz{constructor(e){super(e)}load(e,t,r,i){const s=new ko,a=new c8e(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){s.image=o,s.needsUpdate=!0,t!==void 0&&t(s)},r,i),s}}class Sy extends ga{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new tr(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class u8e extends Sy{constructor(e,t,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(ga.DEFAULT_UP),this.updateMatrix(),this.groundColor=new tr(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const z9=new kr,MQ=new Ve,kQ=new Ve;class sz{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 Jt(512,512),this.mapType=Zs,this.map=null,this.mapPass=null,this.matrix=new kr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ny,this._frameExtents=new Jt(1,1),this._viewportCount=1,this._viewports=[new Rr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;MQ.setFromMatrixPosition(e.matrixWorld),t.position.copy(MQ),kQ.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(kQ),t.updateMatrixWorld(),z9.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(z9,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===qh||t.reversedDepth?r.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(z9)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.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 AC=new Ve,xC=new $h,Np=new Ve;class Z8 extends ga{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new kr,this.projectionMatrix=new kr,this.projectionMatrixInverse=new kr,this.coordinateSystem=fu,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(AC,xC,Np),Np.x===1&&Np.y===1&&Np.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(AC,xC,Np.set(1,1,1)).invert()}updateWorldMatrix(e,t,r=!1){super.updateWorldMatrix(e,t,r),this.matrixWorld.decompose(AC,xC,Np),Np.x===1&&Np.y===1&&Np.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(AC,xC,Np.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const tA=new Ve,RQ=new Jt,PQ=new Jt;class ul extends Z8{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=ty*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(d4*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return ty*2*Math.atan(Math.tan(d4*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){tA.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(tA.x,tA.y).multiplyScalar(-e/tA.z),tA.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(tA.x,tA.y).multiplyScalar(-e/tA.z)}getViewSize(e,t){return this.getViewBounds(e,RQ,PQ),t.subVectors(PQ,RQ)}setViewOffset(e,t,r,i,s,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(d4*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,u=a.fullHeight;s+=a.offsetX*i/l,t-=a.offsetY*r/u,i*=a.width/l,r*=a.height/u}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class d8e extends sz{constructor(){super(new ul(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,r=ty*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,s=e.distance||t.far;(r!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=r,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class az extends Sy{constructor(e,t,r=0,i=Math.PI/3,s=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(ga.DEFAULT_UP),this.updateMatrix(),this.target=new ga,this.distance=r,this.angle=i,this.penumbra=s,this.decay=a,this.map=null,this.shadow=new d8e}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class h8e extends sz{constructor(){super(new ul(90,1,.5,500)),this.isPointLightShadow=!0}
vendor: 10,511 bytes, line 162
162}class f8e extends Sy{constructor(e,t,r=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new h8e}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class S_ extends Z8{constructor(e=-1,t=1,r=1,i=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,i,s,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=t,this.view.offsetX=r,this.view.offsetY=i,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),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,a=r+e,o=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,a=s+u*this.view.width,o-=d*this.view.offsetY,l=o-d*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 t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class p8e extends sz{constructor(){super(new S_(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class due extends Sy{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ga.DEFAULT_UP),this.updateMatrix(),this.target=new ga,this.shadow=new p8e}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 t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class hue extends Sy{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class m8e extends Sy{constructor(e,t,r=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=r,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class g8e{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Ve)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const r=e.x,i=e.y,s=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*i),t.addScaledVector(a[2],.488603*s),t.addScaledVector(a[3],.488603*r),t.addScaledVector(a[4],1.092548*(r*i)),t.addScaledVector(a[5],1.092548*(i*s)),t.addScaledVector(a[6],.315392*(3*s*s-1)),t.addScaledVector(a[7],1.092548*(r*s)),t.addScaledVector(a[8],.546274*(r*r-i*i)),t}getIrradianceAt(e,t){const r=e.x,i=e.y,s=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],2*.511664*i),t.addScaledVector(a[2],2*.511664*s),t.addScaledVector(a[3],2*.511664*r),t.addScaledVector(a[4],2*.429043*r*i),t.addScaledVector(a[5],2*.429043*i*s),t.addScaledVector(a[6],.743125*s*s-.247708),t.addScaledVector(a[7],2*.429043*r*s),t.addScaledVector(a[8],.429043*(r*r-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const r=e.x,i=e.y,s=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*s,t[3]=.488603*r,t[4]=1.092548*r*i,t[5]=1.092548*i*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*r*s,t[8]=.546274*(r*r-i*i)}}class A8e extends Sy{constructor(e=new g8e,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class x8e extends ds{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}const p2=-90,m2=1;class fue extends ga{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ul(p2,m2,e,t);i.layers=this.layers,this.add(i);const s=new ul(p2,m2,e,t);s.layers=this.layers,this.add(s);const a=new ul(p2,m2,e,t);a.layers=this.layers,this.add(a);const o=new ul(p2,m2,e,t);o.layers=this.layers,this.add(o);const l=new ul(p2,m2,e,t);l.layers=this.layers,this.add(l);const u=new ul(p2,m2,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,i,s,a,o,l]=t;for(const u of t)this.remove(u);if(e===fu)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),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===qh)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),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 t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,u,d]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const A=r.texture.generateMipmaps;r.texture.generateMipmaps=!1;let x=!1;e.isWebGLRenderer===!0?x=e.state.buffers.depth.getReversed():x=e.reversedDepthBuffer,e.setRenderTarget(r,0,i),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(r,1,i),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(r,2,i),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(r,3,i),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(r,4,i),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,u),r.texture.generateMipmaps=A,e.setRenderTarget(r,5,i),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,d),e.setRenderTarget(h,f,p),e.xr.enabled=g,r.texture.needsPMREMUpdate=!0}}class pue extends ul{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class mue{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=v8e.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function v8e(){this._document.hidden===!1&&this.reset()}class UM extends XV{constructor(e,t,r=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}const LQ=new kr;class y8e{constructor(e,t,r=0,i=1/0){this.ray=new TT(e,t),this.near=r,this.far=i,this.camera=null,this.layers=new qV,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,t.projectionMatrix.elements[14]).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):sn("Raycaster:
162Unsupported camera type: "+t.type)}setFromXRController(e){return LQ.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(LQ),this}intersectObject(e,t=!0,r=[]){return GI(e,this,r,t),r.sort(OQ),r}intersectObjects(e,t=!0,r=[]){for(let i=0,s=e.length;i<s;i++)GI(e[i],this,r,t);return r.sort(OQ),r}}function OQ(n,e){return n.distance-e.distance}function GI(n,e,t,r){let i=!0;if(n.layers.test(e.layers)&&n.raycast(e,t)===!1&&(i=!1),i===!0&&r===!0){const s=n.children;for(let a=0,o=s.length;a<o;a++)GI(s[a],e,t,!0)}}class DQ{constructor(e=1,t=0,r=0){this.radius=e,this.phi=t,this.theta=r}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=$r(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos($r(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}
vendor: 4,975 bytes, line 162
162const y$=class y${constructor(e,t,r,i){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,r,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let r=0;r<4;r++)this.elements[r]=e[r+t];return this}set(e,t,r,i){const s=this.elements;return s[0]=e,s[2]=t,s[1]=r,s[3]=i,this}};y$.prototype.isMatrix2=!0;let BM=y$;const jQ=new Jt;class b8e{constructor(e=new Jt(1/0,1/0),t=new Jt(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=jQ.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,jQ).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const IQ=new Ve,vC=new Ve,g2=new Ve,A2=new Ve,G9=new Ve,w8e=new Ve,_8e=new Ve;class S8e{constructor(e=new Ve,t=new Ve){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){IQ.subVectors(e,this.start),vC.subVectors(this.end,this.start);const r=vC.dot(vC);if(r===0)return 0;let s=vC.dot(IQ)/r;return t&&(s=$r(s,0,1)),s}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}distanceSqToLine3(e,t=w8e,r=_8e){const i=10000000000000001e-32;let s,a;const o=this.start,l=e.start,u=this.end,d=e.end;g2.subVectors(u,o),A2.subVectors(d,l),G9.subVectors(o,l);const h=g2.dot(g2),f=A2.dot(A2),p=A2.dot(G9);if(h<=i&&f<=i)return t.copy(o),r.copy(l),t.sub(r),t.dot(t);if(h<=i)s=0,a=p/f,a=$r(a,0,1);else{const g=g2.dot(G9);if(f<=i)a=0,s=$r(-g/h,0,1);else{const A=g2.dot(A2),x=h*f-A*A;x!==0?s=$r((A*p-g*f)/x,0,1):s=0,a=(A*s+p)/f,a<0?(a=0,s=$r(-g/h,0,1)):a>1&&(a=1,s=$r((A-g)/h,0,1))}}return t.copy(o).addScaledVector(g2,s),r.copy(l).addScaledVector(A2,a),t.distanceToSquared(r)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class T8e{constructor(){this.type="ShapePath",this.color=new tr,this.subPaths=[],this.currentPath=null,this.userData={}}moveTo(e,t){return this.currentPath=new FM,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,a){return this.currentPath.bezierCurveTo(e,t,r,i,s,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(){function e(l,u){let d=!1;const h=u.length;for(let f=0,p=h-1;f<h;p=f++){const g=u[f],A=u[p];g.y>l.y!=A.y>l.y&&l.x<(A.x-g.x)*(l.y-g.y)/(A.y-g.y)+g.x&&(d=!d)}return d}function t(l,u){const d=u.getCenter(new Jt);if(e(d,l))return d;const h=d.y,f=[],p=l.length;for(let g=0;g<p;g++){const A=l[g],x=l[(g+1)%p];if(A.y>h!=x.y>h){const b=A.x+(h-A.y)*(x.x-A.x)/(x.y-A.y);f.push(b)}}return f.length>1&&(f.sort((g,A)=>g-A),d.x=(f[0]+f[1])/2),d}let r=this.userData.style&&this.userData.style.fillRule||"nonzero";r!=="nonzero"&&r!=="evenodd"&&(an('Fill-rule "'+r+'" is not supported, falling back to "nonzero".'),r="nonzero");const i=r==="nonzero"?(l=>l!==0):(l=>
162(l&1)!==0),s=[];for(const l of this.subPaths){const u=l.getPoints();if(u.length<3)continue;const d=hv.area(u);if(d===0)continue;const h=new b8e;for(let f=0;f<u.length;f++)h.expandByPoint(u[f]);s.push({subPath:l,points:u,boundingBox:h,interiorPoint:t(u,h),absArea:Math.abs(d),winding:d<0?-1:1,container:null,exclude:!1,role:null})}s.sort((l,u)=>u.absArea-l.absArea);for(let l=0;l<s.length;l++){const u=s[l];let d=0;for(let h=l-1;h>=0;h--){const f=s[h];if(f.boundingBox.containsBox(u.boundingBox)&&e(u.interiorPoint,f.points)){u.container=f.exclude?f.container:f,d=f.winding,u.winding+=d;break}}i(u.winding)===i(d)&&(u.exclude=!0)}for(const l of s)l.exclude||(l.role=l.container===null||l.container.role==="hole"?"outer":"hole");const a=[],o=new Map;for(const l of s){if(l.exclude||l.role!=="outer")continue;const u=new rue;u.curves=l.subPath.curves,a.push(u),o.set(l,u)}for(const l of s){if(l.exclude||l.role!=="hole")continue;const u=o.get(l.container);if(!u)continue;const d=new FM;d.curves=l.subPath.curves,u.holes.push(d)}return a}}class oz extends ef{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){an("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function qI(n,e,t,r){const i=E8e(r);switch(t){case H8:return n*e;case wy:return n*e/i.components*i.byteLength;case G1:return n*e/i.components*i.byteLength;case fl:return n*e*2/i.components*i.byteLength;case q1:return n*e*2/i.components*i.byteLength;case by:return n*e*3/i.components*i.byteLength;case to:return n*e*4/i.components*i.byteLength;case b_:return n*e*4/i.components*i.byteLength;case l1:case c1:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case u1:case d1:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case A5:case v5:return Math.max(n,16)*Math.max(e,8)/4;case g5:case x5:return Math.max(n,8)*Math.max(e,8)/2;case fw:case pw:case gw:case Aw:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case mw:case C1:case xw:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case vw:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case yw:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case bw:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case ww:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case _w:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case Sw:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case Tw:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case Ew:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Cw:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Nw:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Mw:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case kw:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Rw:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case Pw:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Lw:case Ow:case Dw:return Math.ceil(n/4)*Math.ceil(e/4)*16;case jw:case Iw:return Math.ceil(n/4)*Math.ceil(e/4)*8;case N1:case Fw:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function E8e(n){switch(n){case Zs:case a1:return{byteLength:1,components:1};case jh:case o1:case Js:return{byteLength:2,components:1};case yT:case bT:return{byteLength:2,components:4};case ts:case oo:case ia:return{byteLength:4,components:1};case wT:case _T:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${n}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:yy}}));typeof window<"u"&&(window.__THREE__?an("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=yy);/** 163 * @license 164 * Copyright 2010-2026 Three.js Authors 165 * SPDX-License-Identifier: MIT 166 */function gue(){let n=null,e=!1,t=null,r=null;function i(s,a){t(s,a),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&n!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n!==null&&n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function C8e(n){const e=new WeakMap;function t(o,l){const u=o.array,d=o.usage,h=u.byteLength,f=n.createBuffer();n.bindBuffer(l,f),n.bufferData(l,u,d),o.onUploadCallback();let p;if(u instanceof Float32Array)p=n.FLOAT;else if(typeof Float16Array<"u"&&u instanceof Float16Array)p=n.HALF_FLOAT;else if(u instanceof Uint16Array)o.isFloat16BufferAttribute?p=n.HALF_FLOAT:p=n.UNSIGNED_SHORT;else if(u instanceof Int16Array)p=n.SHORT;else if(u instanceof Uint32Array)p=n.UNSIGNED_INT;else if(u instanceof Int32Array)p=n.INT;else if(u instanceof Int8Array)p=n.BYTE;else if(u instanceof Uint8Array)p=n.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)p=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:f,type:p,bytesPerElement:u.BYTES_PER_ELEMENT,version:o.version,size:h}}function r(o,l,u){const d=l.array,h=l.updateRanges;if(n.bindBuffer(u,o),h.length===0)n.bufferSubData(u,0,d);else{h.sort((p,g)=>p.start-g.start);let f=0;for(let p=1;p<h.length;p++){const g=h[f],A=h[p];A.start<=g.start+g.count+1?g.count=Math.max(g.count,A.start+A.count-g.start):(++f,h[f]=A)}h.length=f+1;for(let p=0,g=h.length;p<g;p++){const A=h[p];n.bufferSubData(u,A.start*d.BYTES_PER_ELEMENT,d,A.start,A.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(n.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const d=e.get(o);(!d||d.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,t(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.");
166r(u.buffer,o,l),u.version=o.version}}return{get:i,remove:s,update:a}}var N8e=`#ifdef USE_ALPHAHASH 167 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 168#endif`,M8e=`#ifdef USE_ALPHAHASH 169 const float ALPHA_HASH_SCALE = 0.05; 170 float hash2D( vec2 value ) { 171 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 172 } 173 float hash3D( vec3 value ) { 174 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 175 } 176 float getAlphaHashThreshold( vec3 position ) { 177 float maxDeriv = max( 178 length( dFdx( position.xyz ) ), 179 length( dFdy( position.xyz ) ) 180 ); 181 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 182 vec2 pixScales = vec2( 183 exp2( floor( log2( pixScale ) ) ), 184 exp2( ceil( log2( pixScale ) ) ) 185 ); 186 vec2 alpha = vec2( 187 hash3D( floor( pixScales.x * position.xyz ) ), 188 hash3D( floor( pixScales.y * position.xyz ) ) 189 ); 190 float lerpFactor = fract( log2( pixScale ) ); 191 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 192 float a = min( lerpFactor, 1.0 - lerpFactor ); 193 vec3 cases = vec3( 194 x * x / ( 2.0 * a * ( 1.0 - a ) ), 195 ( x - 0.5 * a ) / ( 1.0 - a ), 196 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 197 ); 198 float threshold = ( x < ( 1.0 - a ) ) 199 ? ( ( x < a ) ? cases.x : cases.y ) 200 : cases.z; 201 return clamp( threshold , 1.0e-6, 1.0 ); 202 } 203#endif`,k8e=`#ifdef USE_ALPHAMAP 204 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 205#endif`,R8e=`#ifdef USE_ALPHAMAP 206 uniform sampler2D alphaMap; 207#endif`,P8e=`#ifdef USE_ALPHATEST 208 #ifdef ALPHA_TO_COVERAGE 209 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 210 if ( diffuseColor.a == 0.0 ) discard; 211 #else 212 if ( diffuseColor.a < alphaTest ) discard; 213 #endif 214#endif`,L8e=`#ifdef USE_ALPHATEST 215 uniform float alphaTest; 216#endif`,O8e=`#ifdef USE_AOMAP 217 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 218 reflectedLight.indirectDiffuse *= ambientOcclusion; 219 #if defined( USE_CLEARCOAT ) 220 clearcoatSpecularIndirect *= ambientOcclusion; 221 #endif 222 #if defined( USE_SHEEN ) 223 sheenSpecularIndirect *= ambientOcclusion; 224 #endif 225 #if defined( USE_ENVMAP ) && defined( STANDARD ) 226 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 227 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 228 #endif 229#endif`,D8e=`#ifdef USE_AOMAP 230 uniform sampler2D aoMap; 231 uniform float aoMapIntensity; 232#endif`,j8e=`#ifdef USE_BATCHING 233 #if ! defined( GL_ANGLE_multi_draw ) 234 #define gl_DrawID _gl_DrawID 235 uniform int _gl_DrawID; 236 #endif 237 uniform highp sampler2D batchingTexture; 238 uniform highp usampler2D batchingIdTexture; 239 mat4 getBatchingMatrix( const in float i ) { 240 int size = textureSize( batchingTexture, 0 ).x; 241 int j = int( i ) * 4; 242 int x = j % size; 243 int y = j / size; 244 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 245 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 246 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 247 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 248 return mat4( v1, v2, v3, v4 ); 249 } 250 float getIndirectIndex( const in int i ) { 251 int size = textureSize( batchingIdTexture, 0 ).x; 252 int x = i % size; 253 int y = i / size; 254 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 255 } 256#endif 257#ifdef USE_BATCHING_COLOR 258 uniform sampler2D batchingColorTexture; 259 vec4 getBatchingColor( const in float i ) { 260 int size = textureSize( batchingColorTexture, 0 ).x; 261 int j = int( i ); 262 int x = j % size; 263 int y = j / size; 264 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ); 265 } 266#endif`,I8e=`#ifdef USE_BATCHING 267 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 268#endif`,F8e=`vec3 transformed = vec3( position ); 269#ifdef USE_ALPHAHASH 270 vPosition = vec3( position ); 271#endif`,U8e=`vec3 objectNormal = vec3( normal ); 272#ifdef USE_TANGENT 273 vec3 objectTangent = vec3( tangent.xyz ); 274#endif`,B8e=`float G_BlinnPhong_Implicit( ) { 275 return 0.25; 276} 277float D_BlinnPhong( const in float shininess, const in float dotNH ) { 278 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 279}
280vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 281 vec3 halfDir = normalize( lightDir + viewDir ); 282 float dotNH = saturate( dot( normal, halfDir ) ); 283 float dotVH = saturate( dot( viewDir, halfDir ) ); 284 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 285 float G = G_BlinnPhong_Implicit( ); 286 float D = D_BlinnPhong( shininess, dotNH ); 287 return F * ( G * D ); 288} // validated`,V8e=`#ifdef USE_IRIDESCENCE 289 const mat3 XYZ_TO_REC709 = mat3( 290 3.2404542, -0.9692660, 0.0556434, 291 -1.5371385, 1.8760108, -0.2040259, 292 -0.4985314, 0.0415560, 1.0572252 293 ); 294 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 295 vec3 sqrtF0 = sqrt( fresnel0 ); 296 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 297 } 298 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 299 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 300 } 301 float IorToFresnel0( float transmittedIor, float incidentIor ) { 302 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 303 } 304 vec3 evalSensitivity( float OPD, vec3 shift ) { 305 float phase = 2.0 * PI * OPD * 1.0e-9; 306 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 307 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 308 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 309 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 310 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 ) ); 311 xyz /= 1.0685e-7; 312 vec3 rgb = XYZ_TO_REC709 * xyz; 313 return rgb; 314 } 315 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 316 vec3 I; 317 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 318 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 319 float cosTheta2Sq = 1.0 - sinTheta2Sq; 320 if ( cosTheta2Sq < 0.0 ) { 321 return vec3( 1.0 ); 322 } 323 float cosTheta2 = sqrt( cosTheta2Sq ); 324 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); 325 float R12 = F_Schlick( R0, 1.0, cosTheta1 );
326 float T121 = 1.0 - R12; 327 float phi12 = 0.0; 328 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 329 float phi21 = PI - phi12; 330 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 331 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 332 vec3 phi23 = vec3( 0.0 ); 333 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 334 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 335 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 336 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 337 vec3 phi = vec3( phi21 ) + phi23; 338 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 339 vec3 r123 = sqrt( R123 ); 340 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 341 vec3 C0 = R12 + Rs; 342 I = C0; 343 vec3 Cm = Rs - T121; 344 for ( int m = 1; m <= 2; ++ m ) { 345 Cm *= r123; 346 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 347 I += Cm * Sm; 348 } 349 return max( I, vec3( 0.0 ) ); 350 } 351#endif`,z8e=`#ifdef USE_BUMPMAP 352 uniform sampler2D bumpMap; 353 uniform float bumpScale; 354 vec2 dHdxy_fwd() { 355 vec2 dSTdx = dFdx( vBumpMapUv ); 356 vec2 dSTdy = dFdy( vBumpMapUv ); 357 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 358 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 359 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 360 return vec2( dBx, dBy ); 361 } 362 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 363 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 364 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 365 vec3 vN = surf_norm; 366 vec3 R1 = cross( vSigmaY, vN ); 367 vec3 R2 = cross( vN, vSigmaX ); 368 float fDet = dot( vSigmaX, R1 ) * faceDirection; 369 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 370 return normalize( abs( fDet ) * surf_norm - vGrad ); 371 } 372#endif`,G8e=`#if NUM_CLIPPING_PLANES > 0 373 vec4 plane; 374 #ifdef ALPHA_TO_COVERAGE 375 float distanceToPlane, distanceGradient; 376 float clipOpacity = 1.0; 377 #pragma unroll_loop_start 378 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 379 plane = clippingPlanes[ i ]; 380 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 381 distanceGradient = fwidth( distanceToPlane ) / 2.0; 382 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 383 if ( clipOpacity == 0.0 ) discard; 384 } 385 #pragma unroll_loop_end 386 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 387 float unionClipOpacity = 1.0; 388 #pragma unroll_loop_start 389 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 390 plane = clippingPlanes[ i ]; 391 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 392 distanceGradient = fwidth( distanceToPlane ) / 2.0; 393 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 394 } 395 #pragma unroll_loop_end 396 clipOpacity *= 1.0 - unionClipOpacity; 397 #endif 398 diffuseColor.a *= clipOpacity; 399 if ( diffuseColor.a == 0.0 ) discard; 400 #else 401 #pragma unroll_loop_start 402 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 403 plane = clippingPlanes[ i ]; 404 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 405 } 406 #pragma unroll_loop_end 407 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 408 bool clipped = true; 409 #pragma unroll_loop_start 410 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 411 plane = clippingPlanes[ i ]; 412 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 413 } 414 #pragma unroll_loop_end 415 if ( clipped ) discard; 416 #endif 417 #endif 418#endif`,q8e=`#if NUM_CLIPPING_PLANES > 0 419 varying vec3 vClipPosition; 420 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 421#endif`,$8e=`#if NUM_CLIPPING_PLANES > 0 422 varying vec3 vClipPosition; 423#endif`,H8e=`#if NUM_CLIPPING_PLANES > 0 424 vClipPosition = - mvPosition.xyz; 425#endif`,W8e=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) 426 diffuseColor *= vColor; 427#endif`,X8e=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) 428 varying vec4 vColor; 429#endif`,Y8e=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 430 varying vec4 vColor; 431#endif`,Q8e=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 432 vColor = vec4( 1.0 ); 433#endif 434#ifdef USE_COLOR_ALPHA 435 vColor *= color; 436#elif defined( USE_COLOR ) 437 vColor.rgb *= color; 438#endif 439#ifdef USE_INSTANCING_COLOR 440 vColor.rgb *= instanceColor.rgb; 441#endif 442#ifdef USE_BATCHING_COLOR 443 vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) ); 444#endif`,K8e=`#define PI 3.141592653589793 445#define PI2 6.283185307179586 446#define PI_HALF 1.5707963267948966 447#define RECIPROCAL_PI 0.3183098861837907 448#define RECIPROCAL_PI2 0.15915494309189535 449#define EPSILON 1e-6 450#ifndef saturate 451#define saturate( a ) clamp( a, 0.0, 1.0 ) 452#endif 453#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 454float pow2( const in float x ) { return x*x; } 455vec3 pow2( const in vec3 x ) { return x*x; } 456float pow3( const in float x ) { return x*x*x; } 457float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 458float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 459float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 460highp float rand( const in vec2 uv ) { 461 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 462 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 463 return fract( sin( sn ) * c ); 464} 465#ifdef HIGH_PRECISION 466 float precisionSafeLength( vec3 v ) { return length( v ); } 467#else 468 float precisionSafeLength( vec3 v ) { 469 float maxComponent = max3( abs( v ) ); 470 return length( v / maxComponent ) * maxComponent; 471 } 472#endif 473struct IncidentLight { 474 vec3 color; 475 vec3 direction; 476 bool visible; 477}; 478struct ReflectedLight { 479 vec3 directDiffuse; 480 vec3 directSpecular; 481 vec3 indirectDiffuse; 482 vec3 indirectSpecular; 483}; 484#ifdef USE_ALPHAHASH 485 varying vec3 vPosition; 486#endif 487vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 488 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 489} 490#define inverseTransformDirection transformDirectionByInverseViewMatrix 491vec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) { 492 return normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz ); 493} 494vec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) { 495 return normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz ); 496} 497bool isPerspectiveMatrix( mat4 m ) { 498 return m[ 2 ][ 3 ] == - 1.0; 499} 500vec2 equirectUv( in vec3 dir ) { 501 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 502 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 503 return vec2( u, v ); 504}
505vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 506 return RECIPROCAL_PI * diffuseColor; 507} 508vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 509 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 510 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 511} 512float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 513 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 514 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 515} // validated`,Z8e=`#ifdef ENVMAP_TYPE_CUBE_UV 516 #define cubeUV_minMipLevel 4.0 517 #define cubeUV_minTileSize 16.0 518 float getFace( vec3 direction ) { 519 vec3 absDirection = abs( direction ); 520 float face = - 1.0; 521 if ( absDirection.x > absDirection.z ) { 522 if ( absDirection.x > absDirection.y ) 523 face = direction.x > 0.0 ? 0.0 : 3.0; 524 else 525 face = direction.y > 0.0 ? 1.0 : 4.0; 526 } else { 527 if ( absDirection.z > absDirection.y ) 528 face = direction.z > 0.0 ? 2.0 : 5.0; 529 else 530 face = direction.y > 0.0 ? 1.0 : 4.0; 531 } 532 return face; 533 } 534 vec2 getUV( vec3 direction, float face ) { 535 vec2 uv; 536 if ( face == 0.0 ) { 537 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 538 } else if ( face == 1.0 ) { 539 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 540 } else if ( face == 2.0 ) { 541 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 542 } else if ( face == 3.0 ) { 543 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 544 } else if ( face == 4.0 ) { 545 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 546 } else { 547 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 548 } 549 return 0.5 * ( uv + 1.0 ); 550 } 551 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 552 float face = getFace( direction ); 553 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 554 mipInt = max( mipInt, cubeUV_minMipLevel ); 555 float faceSize = exp2( mipInt ); 556 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 557 if ( face > 2.0 ) { 558 uv.y += faceSize; 559 face -= 3.0; 560 } 561 uv.x += face * faceSize; 562 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 563 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 564 uv.x *= CUBEUV_TEXEL_WIDTH; 565 uv.y *= CUBEUV_TEXEL_HEIGHT; 566 #ifdef texture2DGradEXT 567 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 568 #else 569 return texture2D( envMap, uv ).rgb; 570 #endif 571 } 572 #define cubeUV_r0 1.0 573 #define cubeUV_m0 - 2.0 574 #define cubeUV_r1 0.8 575 #define cubeUV_m1 - 1.0 576 #define cubeUV_r4 0.4 577 #define cubeUV_m4 2.0 578 #define cubeUV_r5 0.305 579 #define cubeUV_m5 3.0 580 #define cubeUV_r6 0.21 581 #define cubeUV_m6 4.0 582 float roughnessToMip( float roughness ) { 583 float mip = 0.0; 584 if ( roughness >= cubeUV_r1 ) { 585 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 586 } else if ( roughness >= cubeUV_r4 ) { 587 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 588 } else if ( roughness >= cubeUV_r5 ) { 589 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 590 } else if ( roughness >= cubeUV_r6 ) { 591 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 592 } else { 593 mip = - 2.0 * log2( 1.16 * roughness ); } 594 return mip; 595 } 596 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 597 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 598 float mipF = fract( mip ); 599 float mipInt = floor( mip ); 600 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 601 if ( mipF == 0.0 ) { 602 return vec4( color0, 1.0 ); 603 } else { 604 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 605 return vec4( mix( color0, color1, mipF ), 1.0 ); 606 } 607 } 608#endif`,J8e=`vec3 transformedNormal = objectNormal; 609#ifdef USE_TANGENT 610 vec3 transformedTangent = objectTangent; 611#endif 612#ifdef USE_BATCHING 613 mat3 bm = mat3( batchingMatrix ); 614 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 615 transformedNormal = bm * transformedNormal; 616 #ifdef USE_TANGENT 617 transformedTangent = bm * transformedTangent; 618 #endif 619#endif 620#ifdef USE_INSTANCING 621 mat3 im = mat3( instanceMatrix ); 622 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 623 transformedNormal = im * transformedNormal; 624 #ifdef USE_TANGENT 625 transformedTangent = im * transformedTangent; 626 #endif 627#endif 628transformedNormal = normalMatrix * transformedNormal; 629#ifdef FLIP_SIDED 630 transformedNormal = - transformedNormal; 631#endif 632#ifdef USE_TANGENT 633 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 634#endif`,eRe=`#ifdef USE_DISPLACEMENTMAP 635 uniform sampler2D displacementMap; 636 uniform float displacementScale; 637 uniform float displacementBias; 638#endif`,tRe=`#ifdef USE_DISPLACEMENTMAP 639 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
639placementBias ); 640#endif`,nRe=`#ifdef USE_EMISSIVEMAP 641 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 642 #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE 643 emissiveColor = sRGBTransferEOTF( emissiveColor ); 644 #endif 645 totalEmissiveRadiance *= emissiveColor.rgb; 646#endif`,rRe=`#ifdef USE_EMISSIVEMAP 647 uniform sampler2D emissiveMap; 648#endif`,iRe="gl_FragColor = linearToOutputTexel( gl_FragColor );",sRe=`vec4 LinearTransferOETF( in vec4 value ) { 649 return value; 650} 651vec4 sRGBTransferEOTF( in vec4 value ) { 652 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 ); 653} 654vec4 sRGBTransferOETF( in vec4 value ) { 655 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 ); 656}`,aRe=`#ifdef USE_ENVMAP 657 #ifdef ENV_WORLDPOS 658 vec3 cameraToFrag; 659 if ( isOrthographic ) { 660 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 661 } else { 662 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 663 } 664 vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); 665 #ifdef ENVMAP_MODE_REFLECTION 666 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 667 #else 668 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 669 #endif 670 #else 671 vec3 reflectVec = vReflect; 672 #endif 673 #ifdef ENVMAP_TYPE_CUBE 674 vec4 envColor = textureCube( envMap, envMapRotation * reflectVec ); 675 #ifdef ENVMAP_BLENDING_MULTIPLY 676 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 677 #elif defined( ENVMAP_BLENDING_MIX ) 678 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 679 #elif defined( ENVMAP_BLENDING_ADD ) 680 outgoingLight += envColor.xyz * specularStrength * reflectivity; 681 #endif 682 #endif 683#endif`,oRe=`#ifdef USE_ENVMAP 684 uniform float envMapIntensity; 685 uniform mat3 envMapRotation; 686 #ifdef ENVMAP_TYPE_CUBE 687 uniform samplerCube envMap; 688 #else 689 uniform sampler2D envMap; 690 #endif 691#endif`,lRe=`#ifdef USE_ENVMAP 692 uniform float reflectivity; 693 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 694 #define ENV_WORLDPOS 695 #endif 696 #ifdef ENV_WORLDPOS 697 varying vec3 vWorldPosition; 698 uniform float refractionRatio; 699 #else 700 varying vec3 vReflect; 701 #endif 702#endif`,cRe=`#ifdef USE_ENVMAP 703 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 704 #define ENV_WORLDPOS 705 #endif 706 #ifdef ENV_WORLDPOS 707 708 varying vec3 vWorldPosition; 709 #else 710 varying vec3 vReflect; 711 uniform float refractionRatio; 712 #endif 713#endif`,uRe=`#ifdef USE_ENVMAP 714 #ifdef ENV_WORLDPOS 715 vWorldPosition = worldPosition.xyz; 716 #else 717 vec3 cameraToVertex; 718 if ( isOrthographic ) { 719 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 720 } else {
721 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 722 } 723 vec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix ); 724 #ifdef ENVMAP_MODE_REFLECTION 725 vReflect = reflect( cameraToVertex, worldNormal ); 726 #else 727 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 728 #endif 729 #endif 730#endif`,dRe=`#ifdef USE_FOG 731 vFogDepth = - mvPosition.z; 732#endif`,hRe=`#ifdef USE_FOG 733 varying float vFogDepth; 734#endif`,fRe=`#ifdef USE_FOG 735 #ifdef FOG_EXP2 736 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 737 #else 738 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 739 #endif 740 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 741#endif`,pRe=`#ifdef USE_FOG 742 uniform vec3 fogColor; 743 varying float vFogDepth; 744 #ifdef FOG_EXP2 745 uniform float fogDensity; 746 #else 747 uniform float fogNear; 748 uniform float fogFar; 749 #endif 750#endif`,mRe=`#ifdef USE_GRADIENTMAP 751 uniform sampler2D gradientMap; 752#endif 753vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 754 float dotNL = dot( normal, lightDirection ); 755 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 756 #ifdef USE_GRADIENTMAP 757 return vec3( texture2D( gradientMap, coord ).r ); 758 #else 759 vec2 fw = fwidth( coord ) * 0.5; 760 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 761 #endif 762}`,gRe=`#ifdef USE_LIGHTMAP 763 uniform sampler2D lightMap; 764 uniform float lightMapIntensity;
765#endif`,ARe=`LambertMaterial material; 766material.diffuseColor = diffuseColor.rgb; 767material.specularStrength = specularStrength;`,xRe=`varying vec3 vViewPosition; 768struct LambertMaterial { 769 vec3 diffuseColor; 770 float specularStrength; 771}; 772void 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 ) { 773 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 774 vec3 irradiance = dotNL * directLight.color; 775 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 776} 777void 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 ) { 778 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 779} 780#define RE_Direct RE_Direct_Lambert 781#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,vRe=`uniform bool receiveShadow; 782uniform vec3 ambientLightColor; 783#if defined( USE_LIGHT_PROBES ) 784 uniform vec3 lightProbe[ 9 ]; 785#endif 786vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 787 float x = normal.x, y = normal.y, z = normal.z; 788 vec3 result = shCoefficients[ 0 ] * 0.886227; 789 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 790 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 791 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 792 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 793 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 794 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 795 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 796 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 797 return result; 798} 799vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 800 vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); 801 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 802 return irradiance; 803} 804vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 805 vec3 irradiance = ambientLightColor; 806 return irradiance; 807} 808float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 809 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 810 if ( cutoffDistance > 0.0 ) { 811 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 812 } 813 return distanceFalloff; 814} 815float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 816 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 817} 818#if NUM_DIR_LIGHTS > 0 819 struct DirectionalLight { 820 vec3 direction; 821 vec3 color; 822 }; 823 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 824 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 825 light.color = directionalLight.color; 826 light.direction = directionalLight.direction; 827 light.visible = true; 828 } 829#endif 830#if NUM_POINT_LIGHTS > 0 831 struct PointLight { 832 vec3 position; 833 vec3 color; 834 float distance; 835 float decay; 836 }; 837 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 838 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 839 vec3 lVector = pointLight.position - geometryPosition; 840 light.direction = normalize( lVector ); 841 float lightDistance = length( lVector ); 842 light.color = pointLight.color; 843 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 844 light.visible = ( light.color != vec3( 0.0 ) ); 845 } 846#endif 847#if NUM_SPOT_LIGHTS > 0 848 struct SpotLight { 849 vec3 position; 850 vec3 direction; 851 vec3 color; 852 float distance; 853 float decay; 854 float coneCos; 855 float penumbraCos; 856 }; 857 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 858 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 859 vec3 lVector = spotLight.position - geometryPosition; 860 light.direction = normalize( lVector ); 861 float angleCos = dot( light.direction, spotLight.direction ); 862 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 863 if ( spotAttenuation > 0.0 ) { 864 float lightDistance = length( lVector ); 865 light.color = spotLight.color * spotAttenuation; 866 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 867 light.visible = ( light.color != vec3( 0.0 ) ); 868 } else { 869 light.color = vec3( 0.0 ); 870 light.visible = false;
871 } 872 } 873#endif 874#if NUM_RECT_AREA_LIGHTS > 0 875 struct RectAreaLight { 876 vec3 color; 877 vec3 position; 878 vec3 halfWidth; 879 vec3 halfHeight; 880 }; 881 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 882 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 883#endif 884#if NUM_HEMI_LIGHTS > 0 885 struct HemisphereLight { 886 vec3 direction; 887 vec3 skyColor; 888 vec3 groundColor; 889 }; 890 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 891 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 892 float dotNL = dot( normal, hemiLight.direction ); 893 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 894 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 895 return irradiance; 896 } 897#endif 898#include <lightprobes_pars_fragment>`,yRe=`#ifdef USE_ENVMAP 899 vec3 getIBLIrradiance( const in vec3 normal ) { 900 #ifdef ENVMAP_TYPE_CUBE_UV 901 vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); 902 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 903 return PI * envMapColor.rgb * envMapIntensity; 904 #else 905 return vec3( 0.0 ); 906 #endif 907 } 908 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 909 #ifdef ENVMAP_TYPE_CUBE_UV 910 vec3 reflectVec = reflect( - viewDir, normal ); 911 reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); 912 reflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix ); 913 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 914 return envMapColor.rgb * envMapIntensity; 915 #else 916 return vec3( 0.0 ); 917 #endif 918 } 919 #ifdef USE_ANISOTROPY 920 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 921 #ifdef ENVMAP_TYPE_CUBE_UV 922 vec3 bentNormal = cross( bitangent, viewDir ); 923 bentNormal = normalize( cross( bentNormal, bitangent ) ); 924 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 925 return getIBLRadiance( viewDir, bentNormal, roughness ); 926 #else 927 return vec3( 0.0 ); 928 #endif 929 } 930 #endif 931#endif`,bRe=`ToonMaterial material; 932material.diffuseColor = diffuseColor.rgb;`,wRe=`varying vec3 vViewPosition; 933struct ToonMaterial { 934 vec3 diffuseColor; 935}; 936void 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 ) { 937 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 938 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 939} 940void 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 ) { 941 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 942} 943#define RE_Direct RE_Direct_Toon 944#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,_Re=`BlinnPhongMaterial material; 945material.diffuseColor = diffuseColor.rgb; 946material.specularColor = specular; 947material.specularShininess = shininess; 948material.specularStrength = specularStrength;`,SRe=`varying vec3 vViewPosition; 949struct BlinnPhongMaterial { 950 vec3 diffuseColor; 951 vec3 specularColor; 952 float specularShininess; 953 float specularStrength; 954}; 955void 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 ) { 956 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 957 vec3 irradiance = dotNL * directLight.color; 958 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 959 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 960} 961void 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 ) { 962 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 963} 964#define RE_Direct RE_Direct_BlinnPhong 965#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,TRe=`PhysicalMaterial material; 966material.diffuseColor = diffuseColor.rgb; 967material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 968material.metalness = metalnessFactor; 969vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 970float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 971material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 972material.roughness = min( material.roughness, 1.0 ); 973#ifdef IOR 974 material.ior = ior; 975 #ifdef USE_SPECULAR 976 float specularIntensityFactor = specularIntensity; 977 vec3 specularColorFactor = specularColor; 978 #ifdef USE_SPECULAR_COLORMAP 979 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 980 #endif 981 #ifdef USE_SPECULAR_INTENSITYMAP 982 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 983 #endif 984 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 985 #else 986 float specularIntensityFactor = 1.0; 987 vec3 specularColorFactor = vec3( 1.0 ); 988 material.specularF90 = 1.0; 989 #endif 990 material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; 991 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 992#else 993 material.specularColor = vec3( 0.04 ); 994 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 995 material.specularF90 = 1.0; 996#endif 997#ifdef USE_CLEARCOAT 998 material.clearcoat = clearcoat; 999 material.clearcoatRoughness = clearcoatRoughness; 1000 material.clearcoatF0 = vec3( 0.04 ); 1001 material.clearcoatF90 = 1.0; 1002 #ifdef USE_CLEARCOATMAP 1003 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 1004 #endif 1005 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 1006 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 1007 #endif 1008 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 1009 material.clearcoatRoughness += geometryRoughness; 1010 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 1011#endif 1012#ifdef USE_DISPERSION
1013 material.dispersion = dispersion; 1014#endif 1015#ifdef USE_IRIDESCENCE 1016 material.iridescence = iridescence; 1017 material.iridescenceIOR = iridescenceIOR; 1018 #ifdef USE_IRIDESCENCEMAP 1019 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 1020 #endif 1021 #ifdef USE_IRIDESCENCE_THICKNESSMAP 1022 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 1023 #else 1024 material.iridescenceThickness = iridescenceThicknessMaximum; 1025 #endif 1026#endif 1027#ifdef USE_SHEEN 1028 material.sheenColor = sheenColor; 1029 #ifdef USE_SHEEN_COLORMAP 1030 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 1031 #endif 1032 material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); 1033 #ifdef USE_SHEEN_ROUGHNESSMAP 1034 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 1035 #endif 1036#endif 1037#ifdef USE_ANISOTROPY 1038 #ifdef USE_ANISOTROPYMAP 1039 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 1040 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 1041 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 1042 #else 1043 vec2 anisotropyV = anisotropyVector; 1044 #endif 1045 material.anisotropy = length( anisotropyV ); 1046 if( material.anisotropy == 0.0 ) { 1047 anisotropyV = vec2( 1.0, 0.0 ); 1048 } else { 1049 anisotropyV /= material.anisotropy; 1050 material.anisotropy = saturate( material.anisotropy ); 1051 } 1052 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); 1053 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 1054 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 1055#endif`,ERe=`uniform sampler2D dfgLUT; 1056struct PhysicalMaterial { 1057 vec3 diffuseColor; 1058 vec3 diffuseContribution; 1059 vec3 specularColor; 1060 vec3 specularColorBlended; 1061 float roughness; 1062 float metalness; 1063 float specularF90; 1064 float dispersion; 1065 #ifdef USE_CLEARCOAT 1066 float clearcoat; 1067 float clearcoatRoughness; 1068 vec3 clearcoatF0; 1069 float clearcoatF90; 1070 #endif 1071 #ifdef USE_IRIDESCENCE 1072 float iridescence; 1073 float iridescenceIOR; 1074 float iridescenceThickness; 1075 vec3 iridescenceFresnel; 1076 vec3 iridescenceF0; 1077 vec3 iridescenceFresnelDielectric; 1078 vec3 iridescenceFresnelMetallic; 1079 #endif 1080 #ifdef USE_SHEEN 1081 vec3 sheenColor; 1082 float sheenRoughness; 1083 #endif 1084 #ifdef IOR 1085 float ior; 1086 #endif 1087 #ifdef USE_TRANSMISSION 1088 float transmission; 1089 float transmissionAlpha; 1090 float thickness; 1091 float attenuationDistance; 1092 vec3 attenuationColor; 1093 #endif 1094 #ifdef USE_ANISOTROPY 1095 float anisotropy; 1096 float alphaT; 1097 vec3 anisotropyT; 1098 vec3 anisotropyB; 1099 #endif 1100}; 1101vec3 clearcoatSpecularDirect = vec3( 0.0 ); 1102vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 1103vec3 sheenSpecularDirect = vec3( 0.0 ); 1104vec3 sheenSpecularIndirect = vec3(0.0 ); 1105vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 1106 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 1107 float x2 = x * x; 1108 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 1109 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 1110} 1111float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 1112 float a2 = pow2( alpha ); 1113 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1114 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1115 return 0.5 / max( gv + gl, EPSILON ); 1116} 1117float D_GGX( const in float alpha, const in float dotNH ) { 1118 float a2 = pow2( alpha ); 1119 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1120 return RECIPROCAL_PI * a2 / pow2( denom ); 1121} 1122#ifdef USE_ANISOTROPY 1123 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 ) { 1124 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1125 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1126 return 0.5 / max( gv + gl, EPSILON )
vendor: 3,169 bytes, lines 1126-1201
1126; 1127 } 1128 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1129 float a2 = alphaT * alphaB; 1130 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1131 highp float v2 = dot( v, v ); 1132 float w2 = a2 / v2; 1133 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1134 } 1135#endif 1136#ifdef USE_CLEARCOAT 1137 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1138 vec3 f0 = material.clearcoatF0; 1139 float f90 = material.clearcoatF90; 1140 float roughness = material.clearcoatRoughness; 1141 float alpha = pow2( roughness ); 1142 vec3 halfDir = normalize( lightDir + viewDir ); 1143 float dotNL = saturate( dot( normal, lightDir ) ); 1144 float dotNV = saturate( dot( normal, viewDir ) ); 1145 float dotNH = saturate( dot( normal, halfDir ) ); 1146 float dotVH = saturate( dot( viewDir, halfDir ) ); 1147 vec3 F = F_Schlick( f0, f90, dotVH ); 1148 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1149 float D = D_GGX( alpha, dotNH ); 1150 return F * ( V * D ); 1151 } 1152#endif 1153vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1154 vec3 f0 = material.specularColorBlended; 1155 float f90 = material.specularF90; 1156 float roughness = material.roughness; 1157 float alpha = pow2( roughness ); 1158 vec3 halfDir = normalize( lightDir + viewDir ); 1159 float dotNL = saturate( dot( normal, lightDir ) ); 1160 float dotNV = saturate( dot( normal, viewDir ) ); 1161 float dotNH = saturate( dot( normal, halfDir ) ); 1162 float dotVH = saturate( dot( viewDir, halfDir ) ); 1163 vec3 F = F_Schlick( f0, f90, dotVH ); 1164 #ifdef USE_IRIDESCENCE 1165 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1166 #endif 1167 #ifdef USE_ANISOTROPY 1168 float dotTL = dot( material.anisotropyT, lightDir ); 1169 float dotTV = dot( material.anisotropyT, viewDir ); 1170 float dotTH = dot( material.anisotropyT, halfDir ); 1171 float dotBL = dot( material.anisotropyB, lightDir ); 1172 float dotBV = dot( material.anisotropyB, viewDir ); 1173 float dotBH = dot( material.anisotropyB, halfDir ); 1174 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1175 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1176 #else 1177 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1178 float D = D_GGX( alpha, dotNH ); 1179 #endif 1180 return F * ( V * D ); 1181} 1182vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1183 const float LUT_SIZE = 64.0; 1184 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1185 const float LUT_BIAS = 0.5 / LUT_SIZE; 1186 float dotNV = saturate( dot( N, V ) ); 1187 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1188 uv = uv * LUT_SCALE + LUT_BIAS; 1189 return uv; 1190} 1191float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1192 float l = length( f ); 1193 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1194} 1195vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1196 float x = dot( v1, v2 ); 1197 float y = abs( x ); 1198 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1199 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1200 float v = a / b; 1201 float theta_sintheta = ( x >
vendor: 4,203 bytes, lines 1201-1285
1201 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1202 return cross( v1, v2 ) * theta_sintheta; 1203} 1204vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1205 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1206 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1207 vec3 lightNormal = cross( v1, v2 ); 1208 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1209 vec3 T1, T2; 1210 T1 = normalize( V - N * dot( V, N ) ); 1211 T2 = - cross( N, T1 ); 1212 mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); 1213 vec3 coords[ 4 ]; 1214 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1215 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1216 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1217 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1218 coords[ 0 ] = normalize( coords[ 0 ] ); 1219 coords[ 1 ] = normalize( coords[ 1 ] ); 1220 coords[ 2 ] = normalize( coords[ 2 ] ); 1221 coords[ 3 ] = normalize( coords[ 3 ] ); 1222 vec3 vectorFormFactor = vec3( 0.0 ); 1223 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1224 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1225 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1226 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1227 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1228 return vec3( result ); 1229} 1230#if defined( USE_SHEEN ) 1231float D_Charlie( float roughness, float dotNH ) { 1232 float alpha = pow2( roughness ); 1233 float invAlpha = 1.0 / alpha; 1234 float cos2h = dotNH * dotNH; 1235 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1236 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1237} 1238float V_Neubelt( float dotNV, float dotNL ) { 1239 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1240} 1241vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1242 vec3 halfDir = normalize( lightDir + viewDir ); 1243 float dotNL = saturate( dot( normal, lightDir ) ); 1244 float dotNV = saturate( dot( normal, viewDir ) ); 1245 float dotNH = saturate( dot( normal, halfDir ) ); 1246 float D = D_Charlie( sheenRoughness, dotNH ); 1247 float V = V_Neubelt( dotNV, dotNL ); 1248 return sheenColor * ( D * V ); 1249} 1250#endif 1251float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1252 float dotNV = saturate( dot( normal, viewDir ) ); 1253 float r2 = roughness * roughness; 1254 float rInv = 1.0 / ( roughness + 0.1 ); 1255 float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; 1256 float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; 1257 float DG = exp( a * dotNV + b ); 1258 return saturate( DG ); 1259} 1260vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1261 float dotNV = saturate( dot( normal, viewDir ) ); 1262 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1263 return specularColor * fab.x + specularF90 * fab.y; 1264} 1265#ifdef USE_IRIDESCENCE 1266void 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 ) { 1267#else 1268void 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 ) { 1269#endif 1270 float dotNV = saturate( dot( normal, viewDir ) ); 1271 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1272 #ifdef USE_IRIDESCENCE 1273 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1274 #else 1275 vec3 Fr = specularColor; 1276 #endif 1277 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1278 float Ess = fab.x + fab.y; 1279 float Ems = 1.0 - Ess; 1280 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1281 singleScatter += FssEss; 1282 multiScatter += Fms * Ems; 1283} 1284vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1285 vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 1286-1415
1286 float dotNL = saturate( dot( normal, lightDir ) ); 1287 float dotNV = saturate( dot( normal, viewDir ) ); 1288 vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; 1289 vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; 1290 vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; 1291 vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; 1292 float Ess_V = dfgV.x + dfgV.y; 1293 float Ess_L = dfgL.x + dfgL.y; 1294 float Ems_V = 1.0 - Ess_V; 1295 float Ems_L = 1.0 - Ess_L; 1296 vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; 1297 vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); 1298 float compensationFactor = Ems_V * Ems_L; 1299 vec3 multiScatter = Fms * compensationFactor; 1300 return singleScatter + multiScatter; 1301} 1302#if NUM_RECT_AREA_LIGHTS > 0 1303 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 ) { 1304 vec3 normal = geometryNormal; 1305 vec3 viewDir = geometryViewDir; 1306 vec3 position = geometryPosition; 1307 vec3 lightPos = rectAreaLight.position; 1308 vec3 halfWidth = rectAreaLight.halfWidth; 1309 vec3 halfHeight = rectAreaLight.halfHeight; 1310 vec3 lightColor = rectAreaLight.color; 1311 float roughness = material.roughness; 1312 vec3 rectCoords[ 4 ]; 1313 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1314 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1315 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1316 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1317 vec4 t1 = texture2D( ltc_1, uv ); 1318 vec4 t2 = texture2D( ltc_2, uv ); 1319 mat3 mInv = mat3( 1320 vec3( t1.x, 0, t1.y ), 1321 vec3( 0, 1, 0 ), 1322 vec3( t1.z, 0, t1.w ) 1323 ); 1324 vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y ); 1325 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1326 reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1327 #ifdef USE_CLEARCOAT 1328 vec3 Ncc = geometryClearcoatNormal; 1329 vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness ); 1330 vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat ); 1331 vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat ); 1332 mat3 mInvClearcoat = mat3( 1333 vec3( t1Clearcoat.x, 0, t1Clearcoat.y ), 1334 vec3( 0, 1, 0 ), 1335 vec3( t1Clearcoat.z, 0, t1Clearcoat.w ) 1336 ); 1337 vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y; 1338 clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords ); 1339 #endif 1340 } 1341#endif 1342void 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 ) { 1343 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1344 vec3 irradiance = dotNL * directLight.color; 1345 #ifdef USE_CLEARCOAT 1346 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1347 vec3 ccIrradiance = dotNLcc * directLight.color; 1348 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1349 #endif 1350 #ifdef USE_SHEEN 1351 1352 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1353 1354 float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1355 float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); 1356 1357 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); 1358 1359 irradiance *= sheenEnergyComp; 1360 1361 #endif 1362 reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); 1363 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); 1364} 1365void 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 ) { 1366 vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); 1367 #ifdef USE_SHEEN 1368 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1369 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1370 diffuse *= sheenEnergyComp; 1371 #endif 1372 reflectedLight.indirectDiffuse += diffuse; 1373} 1374void 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) { 1375 #ifdef USE_CLEARCOAT 1376 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1377 #endif 1378 #ifdef USE_SHEEN 1379 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; 1380 #endif 1381 vec3 singleScatteringDielectric = vec3( 0.0 ); 1382 vec3 multiScatteringDielectric = vec3( 0.0 ); 1383 vec3 singleScatteringMetallic = vec3( 0.0 ); 1384 vec3 multiScatteringMetallic = vec3( 0.0 ); 1385 #ifdef USE_IRIDESCENCE 1386 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1387 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1388 #else 1389 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1390 computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1391 #endif 1392 vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); 1393 vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); 1394 vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; 1395 vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); 1396 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1397 vec3 indirectSpecular = radiance * singleScattering; 1398 indirectSpecular += multiScattering * cosineWeightedIrradiance; 1399 vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; 1400 #ifdef USE_SHEEN 1401 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1402 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1403 indirectSpecular *= sheenEnergyComp; 1404 indirectDiffuse *= sheenEnergyComp; 1405 #endif 1406 reflectedLight.indirectSpecular += indirectSpecular; 1407 reflectedLight.indirectDiffuse += indirectDiffuse; 1408} 1409#define RE_Direct RE_Direct_Physical 1410#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1411#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1412#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1413float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1414 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1415}`,
1415CRe=` 1416vec3 geometryPosition = - vViewPosition; 1417vec3 geometryNormal = normal; 1418vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1419vec3 geometryClearcoatNormal = vec3( 0.0 ); 1420#ifdef USE_CLEARCOAT 1421 geometryClearcoatNormal = clearcoatNormal; 1422#endif 1423#ifdef USE_IRIDESCENCE 1424 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1425 if ( material.iridescenceThickness == 0.0 ) { 1426 material.iridescence = 0.0; 1427 } else { 1428 material.iridescence = saturate( material.iridescence ); 1429 } 1430 if ( material.iridescence > 0.0 ) { 1431 material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1432 material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); 1433 material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); 1434 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1435 } 1436#endif 1437IncidentLight directLight; 1438#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1439 PointLight pointLight; 1440 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1441 PointLightShadow pointLightShadow; 1442 #endif 1443 #pragma unroll_loop_start 1444 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1445 pointLight = pointLights[ i ]; 1446 getPointLightInfo( pointLight, geometryPosition, directLight ); 1447 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 1448 pointLightShadow = pointLightShadows[ i ]; 1449 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1450 #endif 1451 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1452 } 1453 #pragma unroll_loop_end 1454#endif 1455#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1456 SpotLight spotLight; 1457 vec4 spotColor; 1458 vec3 spotLightCoord; 1459 bool inSpotLightMap; 1460 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1461 SpotLightShadow spotLightShadow; 1462 #endif 1463 #pragma unroll_loop_start 1464 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1465 spotLight = spotLights[ i ]; 1466 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1467 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1468 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1469 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1470 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1471 #else 1472 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1473 #endif 1474 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1475 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1476 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1477 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1478 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1479 #endif 1480 #undef SPOT_LIGHT_MAP_INDEX 1481 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1482 spotLightShadow = spotLightShadows[ i ]; 1483 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1484 #endif 1485 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1486 } 1487 #pragma unroll_loop_end 1488#endif 1489#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1490 DirectionalLight directionalLight; 1491 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1492 DirectionalLightShadow directionalLightShadow; 1493 #endif 1494 #pragma unroll_loop_start 1495 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1496 directionalLight = directionalLights[ i ]; 1497 getDirectionalLightInfo( directionalLight, directLight ); 1498 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1499 directionalLightShadow = directionalLightShadows[ i ]; 1500 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1501 #endif 1502 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1503 } 1504 #pragma unroll_loop_end 1505#endif 1506#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1507 RectAreaLight rectAreaLight; 1508 #pragma unroll_loop_start 1509 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1510 rectAreaLight = rectAreaLights[ i ]; 1511 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1512 } 1513 #pragma unroll_loop_end 1514#endif 1515#if defined( RE_IndirectDiffuse ) 1516 vec3 iblIrradiance = vec3( 0.0 ); 1517 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1518 #if defined( USE_LIGHT_PROBES ) 1519 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1520 #endif 1521 #if ( NUM_HEMI_LIGHTS > 0 ) 1522 #pragma unroll_loop_start 1523 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1524 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1525 } 1526 #pragma unroll_loop_end 1527 #endif 1528 #ifdef USE_LIGHT_PROBES_GRID 1529 vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz; 1530 vec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix ); 1531 irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal ); 1532 #endif 1533#endif 1534#if defined( RE_IndirectSpecular ) 1535 vec3 radiance = vec3( 0.0 ); 1536 vec3 clearcoatRadiance = vec3( 0.0 ); 1537#endif`,NRe=`#if defined( RE_IndirectDiffuse ) 1538 #ifdef USE_LIGHTMAP 1539 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1540 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1541 irradiance += lightMapIrradiance; 1542 #endif 1543 #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV ) 1544 #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG ) 1545 iblIrradiance += getIBLIrradiance( geometryNormal ); 1546 #endif 1547 #endif 1548#endif 1549#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1550 #ifdef USE_ANISOTROPY 1551 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1552 #else 1553 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1554 #endif 1555 #ifdef USE_CLEARCOAT 1556 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1557 #endif 1558#endif`,MRe=`#if defined( RE_IndirectDiffuse ) 1559 #if defined( LAMBERT ) || defined( PHONG ) 1560 irradiance += iblIrradiance; 1561 #endif 1562 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1563#endif 1564#if defined( RE_IndirectSpecular ) 1565 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1566#endif`,kRe=`#ifdef USE_LIGHT_PROBES_GRID 1567uniform highp sampler3D probesSH; 1568uniform vec3 probesMin; 1569uniform vec3 probesMax; 1570uniform vec3 probesResolution; 1571vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) { 1572 vec3 res = probesResolution; 1573 vec3 gridRange = probesMax - probesMin; 1574 vec3 resMinusOne = res - 1.0; 1575 vec3 probeSpacing = gridRange / resMinusOne; 1576 vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5; 1577 vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 ); 1578 uvw = uvw * resMinusOne / res + 0.5 / res; 1579 float nz = res.z; 1580 float paddedSlices = nz + 2.0; 1581 float atlasDepth = 7.0 * paddedSlices; 1582 float uvZBase = uvw.z * nz + 1.0; 1583 vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) ); 1584 vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) ); 1585 vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) ); 1586 vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) ); 1587 vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) ); 1588 vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) ); 1589 vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) ); 1590 vec3 c0 = s0.xyz; 1591 vec3 c1 = vec3( s0.w, s1.xy ); 1592 vec3 c2 = vec3( s1.zw, s2.x ); 1593 vec3 c3 = s2.yzw; 1594 vec3 c4 = s3.xyz; 1595 vec3 c5 = vec3( s3.w, s4.xy ); 1596 vec3 c6 = vec3( s4.zw, s5.x ); 1597 vec3 c7 = s5.yzw; 1598 vec3 c8 = s6.xyz; 1599 float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z; 1600 vec3 result = c0 * 0.886227; 1601 result += c1 * 2.0 * 0.511664 * y; 1602 result += c2 * 2.0 * 0.511664 * z; 1603 result += c3 * 2.0 * 0.511664 * x; 1604 result += c4 * 2.0 * 0.429043 * x * y; 1605 result += c5 * 2.0 * 0.429043 * y * z; 1606 result += c6 * ( 0.743125 * z * z - 0.247708 ); 1607 result += c7 * 2.0 * 0.429043 * x * z; 1608 result += c8 * 0.429043 * ( x * x - y * y ); 1609 return max( result, vec3( 0.0 ) ); 1610} 1611#endif`,RRe=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1612 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1613#endif`,PRe=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1614 uniform float logDepthBufFC; 1615 varying float vFragDepth; 1616 varying float vIsPerspective; 1617#endif`,LRe=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1618 varying float vFragDepth; 1619 varying float vIsPerspective; 1620#endif`,ORe=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1621 vFragDepth = 1.0 + gl_Position.w; 1622 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1623#endif`,DRe=`#ifdef USE_MAP 1624 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1625 #ifdef DECODE_VIDEO_TEXTURE 1626 sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); 1627 #endif 1628 diffuseColor *= sampledDiffuseColor; 1629#endif`,jRe=`#ifdef USE_MAP 1630 uniform sampler2D map; 1631#endif`,IRe=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1632 #if defined( USE_POINTS_UV ) 1633 vec2 uv = vUv; 1634 #else 1635 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1636 #endif 1637#endif 1638#ifdef USE_MAP 1639 diffuseColor *= texture2D( map, uv ); 1640#endif 1641#ifdef USE_ALPHAMAP 1642 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1643#endif`,FRe=`#if defined( USE_POINTS_UV ) 1644 varying vec2 vUv; 1645#else 1646 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1647 uniform mat3 uvTransform; 1648 #endif 1649#endif 1650#ifdef USE_MAP 1651 uniform sampler2D map; 1652#endif 1653#ifdef USE_ALPHAMAP 1654 uniform sampler2D alphaMap; 1655#endif`,URe=`float metalnessFactor = metalness; 1656#ifdef USE_METALNESSMAP 1657 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1658 metalnessFactor *= texelMetalness.b; 1659#endif`,BRe=`#ifdef USE_METALNESSMAP 1660 uniform sampler2D metalnessMap; 1661#endif`,VRe=`#ifdef USE_INSTANCING_MORPH 1662 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1663 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1664 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1665 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1666 } 1667#endif`,zRe=`#if defined( USE_MORPHCOLORS ) 1668 vColor *= morphTargetBaseInfluence; 1669 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1670 #if defined( USE_COLOR_ALPHA ) 1671 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1672 #elif defined( USE_COLOR ) 1673 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1674 #endif 1675 } 1676#endif`,GRe=`#ifdef USE_MORPHNORMALS 1677 objectNormal *= morphTargetBaseInfluence; 1678 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1679 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1680 } 1681#endif`,qRe=`#ifdef USE_MORPHTARGETS 1682 #ifndef USE_INSTANCING_MORPH 1683 uniform float morphTargetBaseInfluence; 1684 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1685 #endif 1686 uniform sampler2DArray morphTargetsTexture; 1687 uniform ivec2 morphTargetsTextureSize; 1688 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1689 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1690 int y = texelIndex / morphTargetsTextureSize.x; 1691 int x = texelIndex - y * morphTargetsTextureSize.x; 1692 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1693 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1694 } 1695#endif`,$Re=`#ifdef USE_MORPHTARGETS 1696 transformed *= morphTargetBaseInfluence; 1697 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1698 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1699 } 1700#endif`,HRe=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1701#ifdef FLAT_SHADED 1702 vec3 fdx = dFdx( vViewPosition ); 1703 vec3 fdy = dFdy( vViewPosition ); 1704 vec3 normal = normalize( cross( fdx, fdy ) ); 1705#else 1706 vec3 normal = normalize( vNormal ); 1707 #ifdef DOUBLE_SIDED 1708 normal *= faceDirection; 1709 #endif 1710#endif 1711#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1712 #ifdef USE_TANGENT 1713 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1714 #else 1715 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1716 #if defined( USE_NORMALMAP ) 1717 vNormalMapUv 1718 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1719 vClearcoatNormalMapUv 1720 #else 1721 vUv 1722 #endif 1723 ); 1724 #endif 1725 #ifdef DOUBLE_SIDED 1726 tbn[0] *= faceDirection; 1727 tbn[1] *= faceDirection; 1728 #endif 1729#endif 1730#ifdef USE_CLEARCOAT_NORMALMAP 1731 #ifdef USE_TANGENT 1732 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1733 #else 1734 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1735 #endif 1736 #ifdef DOUBLE_SIDED 1737 tbn2[0] *= faceDirection; 1738 tbn2[1] *= faceDirection; 1739 #endif 1740#endif 1741vec3 nonPerturbedNormal = normal;`,WRe=`#ifdef USE_NORMALMAP_OBJECTSPACE 1742 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1743 #ifdef FLIP_SIDED 1744 normal = - normal; 1745 #endif 1746 #ifdef DOUBLE_SIDED 1747 normal = normal * faceDirection; 1748 #endif 1749 normal = normalize( normalMatrix * normal ); 1750#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1751 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1752 #if defined( USE_PACKED_NORMALMAP ) 1753 mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) ); 1754 #endif 1755 mapN.xy *= normalScale; 1756 normal = normalize( tbn * mapN ); 1757#elif defined( USE_BUMPMAP )
1758 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1759#endif`,XRe=`#ifndef FLAT_SHADED 1760 varying vec3 vNormal; 1761 #ifdef USE_TANGENT 1762 varying vec3 vTangent; 1763 varying vec3 vBitangent; 1764 #endif 1765#endif`,YRe=`#ifndef FLAT_SHADED 1766 varying vec3 vNormal; 1767 #ifdef USE_TANGENT 1768 varying vec3 vTangent; 1769 varying vec3 vBitangent; 1770 #endif 1771#endif`,QRe=`#ifndef FLAT_SHADED 1772 vNormal = normalize( transformedNormal ); 1773 #ifdef USE_TANGENT 1774 vTangent = normalize( transformedTangent ); 1775 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1776 #ifdef FLIP_SIDED 1777 vBitangent = - vBitangent; 1778 #endif 1779 #endif 1780#endif`,KRe=`#ifdef USE_NORMALMAP 1781 uniform sampler2D normalMap; 1782 uniform vec2 normalScale; 1783#endif 1784#ifdef USE_NORMALMAP_OBJECTSPACE 1785 uniform mat3 normalMatrix; 1786#endif 1787#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1788 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1789 vec3 q0 = dFdx( eye_pos.xyz ); 1790 vec3 q1 = dFdy( eye_pos.xyz ); 1791 vec2 st0 = dFdx( uv.st ); 1792 vec2 st1 = dFdy( uv.st ); 1793 vec3 N = surf_norm; 1794 vec3 q1perp = cross( q1, N ); 1795 vec3 q0perp = cross( N, q0 ); 1796 vec3 T = q1perp * st0.x + q0perp * st1.x; 1797 vec3 B = q1perp * st0.y + q0perp * st1.y; 1798 float det = max( dot( T, T ), dot( B, B ) ); 1799 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1800 return mat3( T * scale, B * scale, N ); 1801 } 1802#endif`,ZRe=`#ifdef USE_CLEARCOAT 1803 vec3 clearcoatNormal = nonPerturbedNormal; 1804#endif`,JRe=`#ifdef USE_CLEARCOAT_NORMALMAP 1805 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1806 clearcoatMapN.xy *= clearcoatNormalScale; 1807 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1808#endif`,ePe=`#ifdef USE_CLEARCOATMAP 1809 uniform sampler2D clearcoatMap; 1810#endif 1811#ifdef USE_CLEARCOAT_NORMALMAP 1812 uniform sampler2D clearcoatNormalMap; 1813 uniform vec2 clearcoatNormalScale; 1814#endif 1815#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1816 uniform sampler2D clearcoatRoughnessMap; 1817#endif`,tPe=`#ifdef USE_IRIDESCENCEMAP 1818 uniform sampler2D iridescenceMap; 1819#endif 1820#ifdef USE_IRIDESCENCE_THICKNESSMAP 1821 uniform sampler2D iridescenceThicknessMap; 1822#endif`,nPe=`#ifdef OPAQUE 1823diffuseColor.a = 1.0; 1824#endif 1825#ifdef USE_TRANSMISSION 1826diffuseColor.a *= material.transmissionAlpha; 1827#endif 1828gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,rPe=`vec3 packNormalToRGB( const in vec3 normal ) { 1829 return normalize( normal ) * 0.5 + 0.5; 1830} 1831vec3 unpackRGBToNormal( const in vec3 rgb ) { 1832 return 2.0 * rgb.xyz - 1.0; 1833} 1834const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 1835const float Inv255 = 1. / 255.; 1836const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 1837const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 1838const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 1839const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 1840vec4 packDepthToRGBA( const in float v ) { 1841 if( v <= 0.0 ) 1842 return vec4( 0., 0., 0., 0. ); 1843 if( v >= 1.0 ) 1844 return vec4( 1., 1., 1., 1. ); 1845 float vuf; 1846 float af = modf( v * PackFactors.a, vuf ); 1847 float bf = modf( vuf * ShiftRight8, vuf ); 1848 float gf = modf( vuf * ShiftRight8, vuf ); 1849 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 1850} 1851vec3 packDepthToRGB( const in float v ) { 1852 if( v <= 0.0 ) 1853 return vec3( 0., 0., 0. ); 1854 if( v >= 1.0 ) 1855 return vec3( 1., 1., 1. ); 1856 float vuf; 1857 float bf = modf( v * PackFactors.b, vuf ); 1858 float gf = modf( vuf * ShiftRight8, vuf ); 1859 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 1860} 1861vec2 packDepthToRG( const in float v ) { 1862 if( v <= 0.0 ) 1863 return vec2( 0., 0. ); 1864 if( v >= 1.0 ) 1865 return vec2( 1., 1. ); 1866 float vuf; 1867 float gf = modf( v * 256., vuf ); 1868 return vec2( vuf * Inv255, gf ); 1869} 1870float unpackRGBAToDepth( const in vec4 v ) { 1871 return dot( v, UnpackFactors4 ); 1872} 1873float unpackRGBToDepth( const in vec3 v ) { 1874 return dot( v, UnpackFactors3 ); 1875} 1876float unpackRGToDepth( const in vec2 v ) { 1877 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 1878} 1879vec4 pack2HalfToRGBA( const in vec2 v ) {
1880 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1881 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1882} 1883vec2 unpackRGBATo2Half( const in vec4 v ) { 1884 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1885} 1886float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1887 return ( viewZ + near ) / ( near - far ); 1888} 1889float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1890 #ifdef USE_REVERSED_DEPTH_BUFFER 1891 1892 return depth * ( far - near ) - far; 1893 #else 1894 return depth * ( near - far ) - near; 1895 #endif 1896} 1897float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1898 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1899} 1900float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1901 1902 #ifdef USE_REVERSED_DEPTH_BUFFER 1903 return ( near * far ) / ( ( near - far ) * depth - near ); 1904 #else 1905 return ( near * far ) / ( ( far - near ) * depth - far ); 1906 #endif 1907}`,iPe=`#ifdef PREMULTIPLIED_ALPHA 1908 gl_FragColor.rgb *= gl_FragColor.a; 1909#endif`,sPe=`vec4 mvPosition = vec4( transformed, 1.0 ); 1910#ifdef USE_BATCHING 1911 mvPosition = batchingMatrix * mvPosition; 1912#endif 1913#ifdef USE_INSTANCING 1914 mvPosition = instanceMatrix * mvPosition; 1915#endif 1916mvPosition = modelViewMatrix * mvPosition; 1917gl_Position = projectionMatrix * mvPosition;`,aPe=`#ifdef DITHERING 1918 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1919#endif`,oPe=`#ifdef DITHERING 1920 vec3 dithering( vec3 color ) { 1921 float grid_position = rand( gl_FragCoord.xy ); 1922 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1923 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1924 return color + dither_shift_RGB; 1925 } 1926#endif`,lPe=`float roughnessFactor = roughness; 1927#ifdef USE_ROUGHNESSMAP 1928 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1929 roughnessFactor *= texelRoughness.g; 1930#endif`,cPe=`#ifdef USE_ROUGHNESSMAP 1931 uniform sampler2D roughnessMap; 1932#endif`,uPe=`#if NUM_SPOT_LIGHT_COORDS > 0 1933 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1934#endif 1935#if NUM_SPOT_LIGHT_MAPS > 0 1936 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1937#endif 1938#ifdef USE_SHADOWMAP 1939 #if NUM_DIR_LIGHT_SHADOWS > 0 1940 #if defined( SHADOWMAP_TYPE_PCF ) 1941 uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1942 #else 1943 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1944 #endif 1945 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1946 struct DirectionalLightShadow { 1947 float shadowIntensity; 1948 float shadowBias; 1949 float shadowNormalBias; 1950 float shadowRadius; 1951 vec2 shadowMapSize; 1952 }; 1953 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1954 #endif 1955 #if NUM_SPOT_LIGHT_SHADOWS > 0 1956 #if defined( SHADOWMAP_TYPE_PCF ) 1957 uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1958 #else 1959 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1960 #endif 1961 struct SpotLightShadow { 1962 float shadowIntensity; 1963 float shadowBias; 1964 float shadowNormalBias; 1965 float shadowRadius; 1966 vec2 shadowMapSize; 1967 }; 1968 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1969 #endif 1970 #if NUM_POINT_LIGHT_SHADOWS > 0 1971 #if defined( SHADOWMAP_TYPE_PCF ) 1972 uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1973 #elif defined( SHADOWMAP_TYPE_BASIC ) 1974 uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1975 #endif 1976 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1977 struct PointLightShadow { 1978 float shadowIntensity; 1979 float shadowBias; 1980 float shadowNormalBias; 1981 float shadowRadius; 1982 vec2 shadowMapSize; 1983 float shadowCameraNear; 1984 float shadowCameraFar; 1985 }; 1986 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1987 #endif 1988 #if defined( SHADOWMAP_TYPE_PCF ) 1989 float interleavedGradientNoise( vec2 position ) { 1990 return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); 1991 } 1992 vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { 1993 const float goldenAngle = 2.399963229728653; 1994 float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); 1995 float theta = float( sampleIndex ) * goldenAngle + phi; 1996 return vec2( cos( theta ), sin( theta ) ) * r; 1997 } 1998 #endif 1999 #if defined( SHADOWMAP_TYPE_PCF ) 2000 float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 2001 float shadow = 1.0; 2002 shadowCoord.xyz /= shadowCoord.w; 2003 shadowCoord.z += shadowBias; 2004 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 2005 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 2006 if ( frustumTest ) { 2007 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 2008 float radius = shadowRadius * texelSize.x; 2009 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; 2010 shadow = ( 2011 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + 2012 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + 2013 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + 2014 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + 2015 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) 2016 ) * 0.2; 2017 } 2018 return mix( 1.0, shadow, shadowIntensity ); 2019 } 2020 #elif defined( SHADOWMAP_TYPE_VSM ) 2021 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 2022 float shadow = 1.0; 2023 shadowCoord.xyz /= shadowCoord.w; 2024 #ifdef USE_REVERSED_DEPTH_BUFFER 2025 shadowCoord.z -= shadowBias; 2026 #else 2027 shadowCoord.z += shadowBias; 2028 #endif 2029 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 2030 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 2031 if ( frustumTest ) { 2032 vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; 2033 float mean = distribution.x; 2034 float variance = distribution.y * distribution.y; 2035 #ifdef USE_REVERSED_DEPTH_BUFFER 2036 float hard_shadow = step( mean, shadowCoord.z ); 2037 #else 2038 float hard_shadow = step( shadowCoord.z, mean ); 2039 #endif 2040 2041 if ( hard_shadow == 1.0 ) { 2042 shadow = 1.0; 2043 } else { 2044 variance = max( variance, 0.0000001 ); 2045 float d = shadowCoord.z - mean; 2046 float p_max = variance / ( variance + d * d ); 2047 p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); 2048 shadow = max( hard_shadow, p_max ); 2049 } 2050 } 2051 return mix( 1.0, shadow, shadowIntensity ); 2052 } 2053 #else 2054 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 2055 float shadow = 1.0; 2056 shadowCoord.xyz /= shadowCoord.w; 2057 #ifdef USE_REVERSED_DEPTH_BUFFER 2058 shadowCoord.z -= shadowBias; 2059 #else 2060 shadowCoord.z += shadowBias; 2061 #endif 2062 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 2063 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 2064 if ( frustumTest ) { 2065 float depth = texture2D( shadowMap, shadowCoord.xy ).r; 2066 #ifdef USE_REVERSED_DEPTH_BUFFER 2067 shadow = step( depth, shadowCoord.z ); 2068 #else 2069 shadow = step( shadowCoord.z, depth ); 2070 #endif 2071 } 2072 return mix( 1.0, shadow, shadowIntensity ); 2073 } 2074 #endif 2075 #if NUM_POINT_LIGHT_SHADOWS > 0 2076 #if defined( SHADOWMAP_TYPE_PCF ) 2077 float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 2078 float shadow = 1.0; 2079 vec3 lightToPosition = shadowCoord.xyz; 2080 vec3 bd3D = normalize( lightToPosition ); 2081 vec3 absVec = abs( lightToPosition ); 2082 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 2083 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 2084 #ifdef USE_REVERSED_DEPTH_BUFFER 2085 float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
2086 dp -= shadowBias; 2087 #else 2088 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 2089 dp += shadowBias; 2090 #endif 2091 float texelSize = shadowRadius / shadowMapSize.x; 2092 vec3 absDir = abs( bd3D ); 2093 vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); 2094 tangent = normalize( cross( bd3D, tangent ) ); 2095 vec3 bitangent = cross( bd3D, tangent ); 2096 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; 2097 vec2 sample0 = vogelDiskSample( 0, 5, phi ); 2098 vec2 sample1 = vogelDiskSample( 1, 5, phi ); 2099 vec2 sample2 = vogelDiskSample( 2, 5, phi ); 2100 vec2 sample3 = vogelDiskSample( 3, 5, phi ); 2101 vec2 sample4 = vogelDiskSample( 4, 5, phi ); 2102 shadow = ( 2103 texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) + 2104 texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) + 2105 texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) + 2106 texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) + 2107 texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) ) 2108 ) * 0.2; 2109 } 2110 return mix( 1.0, shadow, shadowIntensity ); 2111 } 2112 #elif defined( SHADOWMAP_TYPE_BASIC ) 2113 float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 2114 float shadow = 1.0; 2115 vec3 lightToPosition = shadowCoord.xyz; 2116 vec3 absVec = abs( lightToPosition ); 2117 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 2118 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 2119 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 2120 dp += shadowBias; 2121 vec3 bd3D = normalize( lightToPosition ); 2122 float depth = textureCube( shadowMap, bd3D ).r; 2123 #ifdef USE_REVERSED_DEPTH_BUFFER 2124 depth = 1.0 - depth; 2125 #endif 2126 shadow = step( dp, depth ); 2127 } 2128 return mix( 1.0, shadow, shadowIntensity ); 2129 } 2130 #endif 2131 #endif 2132#endif`,dPe=`#if NUM_SPOT_LIGHT_COORDS > 0 2133 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 2134 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 2135#endif 2136#ifdef USE_SHADOWMAP 2137 #if NUM_DIR_LIGHT_SHADOWS > 0 2138 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 2139 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 2140 struct DirectionalLightShadow { 2141 float shadowIntensity; 2142 float shadowBias; 2143 float shadowNormalBias; 2144 float shadowRadius; 2145 vec2 shadowMapSize; 2146 }; 2147 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 2148 #endif 2149 #if NUM_SPOT_LIGHT_SHADOWS > 0 2150 struct SpotLightShadow { 2151 float shadowIntensity; 2152 float shadowBias; 2153 float shadowNormalBias; 2154 float shadowRadius; 2155 vec2 shadowMapSize; 2156 }; 2157 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 2158 #endif 2159 #if NUM_POINT_LIGHT_SHADOWS > 0 2160 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 2161 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 2162 struct PointLightShadow { 2163 float shadowIntensity; 2164 float shadowBias; 2165 float shadowNormalBias; 2166 float shadowRadius; 2167 vec2 shadowMapSize; 2168 float shadowCameraNear; 2169 float shadowCameraFar; 2170 }; 2171 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2172 #endif 2173#endif`,hPe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 2174 #ifdef HAS_NORMAL 2175 vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix ); 2176 #else 2177 vec3 shadowWorldNormal = vec3( 0.0 ); 2178 #endif 2179 vec4 shadowWorldPosition; 2180#endif 2181#if defined( USE_SHADOWMAP ) 2182 #if NUM_DIR_LIGHT_SHADOWS > 0 2183 #pragma unroll_loop_start 2184 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2185 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 2186 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 2187 } 2188 #pragma unroll_loop_end 2189 #endif 2190 #if NUM_POINT_LIGHT_SHADOWS > 0 2191 #pragma unroll_loop_start 2192 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2193 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 2194 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 2195 } 2196 #pragma unroll_loop_end 2197 #endif 2198#endif
2199#if NUM_SPOT_LIGHT_COORDS > 0 2200 #pragma unroll_loop_start 2201 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 2202 shadowWorldPosition = worldPosition; 2203 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2204 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 2205 #endif 2206 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 2207 } 2208 #pragma unroll_loop_end 2209#endif`,fPe=`float getShadowMask() { 2210 float shadow = 1.0; 2211 #ifdef USE_SHADOWMAP 2212 #if NUM_DIR_LIGHT_SHADOWS > 0 2213 DirectionalLightShadow directionalLight; 2214 #pragma unroll_loop_start 2215 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2216 directionalLight = directionalLightShadows[ i ]; 2217 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2218 } 2219 #pragma unroll_loop_end 2220 #endif 2221 #if NUM_SPOT_LIGHT_SHADOWS > 0 2222 SpotLightShadow spotLight; 2223 #pragma unroll_loop_start 2224 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 2225 spotLight = spotLightShadows[ i ]; 2226 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2227 } 2228 #pragma unroll_loop_end 2229 #endif 2230 #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 2231 PointLightShadow pointLight; 2232 #pragma unroll_loop_start 2233 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2234 pointLight = pointLightShadows[ i ]; 2235 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2236 } 2237 #pragma unroll_loop_end 2238 #endif 2239 #endif 2240 return shadow; 2241}`,pPe=`#ifdef USE_SKINNING 2242 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2243 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2244 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2245 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2246#endif`,mPe=`#ifdef USE_SKINNING 2247 uniform mat4 bindMatrix; 2248 uniform mat4 bindMatrixInverse; 2249 uniform highp sampler2D boneTexture; 2250 mat4 getBoneMatrix( const in float i ) { 2251 int size = textureSize( boneTexture, 0 ).x; 2252 int j = int( i ) * 4; 2253 int x = j % size; 2254 int y = j / size; 2255 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2256 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2257 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2258 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2259 return mat4( v1, v2, v3, v4 ); 2260 } 2261#endif`,gPe=`#ifdef USE_SKINNING 2262 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2263 vec4 skinned = vec4( 0.0 ); 2264 skinned += boneMatX * skinVertex * skinWeight.x; 2265 skinned += boneMatY * skinVertex * skinWeight.y; 2266 skinned += boneMatZ * skinVertex * skinWeight.z; 2267 skinned += boneMatW * skinVertex * skinWeight.w; 2268 transformed = ( bindMatrixInverse * skinned ).xyz; 2269#endif`,APe=`#ifdef USE_SKINNING 2270 mat4 skinMatrix = mat4( 0.0 ); 2271 skinMatrix += skinWeight.x * boneMatX; 2272 skinMatrix += skinWeight.y * boneMatY; 2273 skinMatrix += skinWeight.z * boneMatZ; 2274 skinMatrix += skinWeight.w * boneMatW; 2275 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2276 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2277 #ifdef USE_TANGENT 2278 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2279 #endif 2280#endif`,xPe=`float specularStrength; 2281#ifdef USE_SPECULARMAP 2282 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2283 specularStrength = texelSpecular.r; 2284#else 2285 specularStrength = 1.0; 2286#endif`,vPe=`#ifdef USE_SPECULARMAP 2287 uniform sampler2D specularMap; 2288#endif`,yPe=`#if defined( TONE_MAPPING ) 2289 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2290#endif`,bPe=`#ifndef saturate 2291#define saturate( a ) clamp( a, 0.0, 1.0 ) 2292#endif 2293uniform float toneMappingExposure; 2294vec3 LinearToneMapping( vec3 color ) { 2295 return saturate( toneMappingExposure * color ); 2296} 2297vec3 ReinhardToneMapping( vec3 color ) { 2298 color *= toneMappingExposure; 2299 return saturate( color / ( vec3( 1.0 ) + color ) ); 2300} 2301vec3 CineonToneMapping( vec3 color ) { 2302 color *= toneMappingExposure; 2303 color = max( vec3( 0.0 ), color - 0.004 ); 2304 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2305} 2306vec3 RRTAndODTFit( vec3 v ) { 2307 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2308 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2309 return a / b; 2310} 2311vec3 ACESFilmicToneMapping( vec3 color ) { 2312 const mat3 ACESInputMat = mat3( 2313 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2314 vec3( 0.04823, 0.01566, 0.83777 ) 2315 ); 2316 const mat3 ACESOutputMat = mat3( 2317 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2318 vec3( -0.07367, -0.00605, 1.07602 ) 2319 ); 2320 color *= toneMappingExposure / 0.6; 2321 color = ACESInputMat * color; 2322 color = RRTAndODTFit( color ); 2323 color = ACESOutputMat * color; 2324 return saturate( color ); 2325} 2326const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2327 vec3( 1.6605, - 0.1246, - 0.0182 ), 2328 vec3( - 0.5876, 1.1329, - 0.1006 ), 2329 vec3( - 0.0728, - 0.0083, 1.1187 ) 2330); 2331const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2332 vec3( 0.6274, 0.0691, 0.0164 ), 2333 vec3( 0.3293, 0.9195, 0.0880 ), 2334 vec3( 0.0433, 0.0113, 0.8956 ) 2335); 2336vec3 agxDefaultContrastApprox( vec3 x ) { 2337 vec3 x2 = x * x; 2338 vec3 x4 = x2 * x2; 2339 return + 15.5 * x4 * x2 2340 - 40.14 * x4 * x 2341 + 31.96 * x4 2342 - 6.868 * x2 * x 2343 + 0.4298 * x2 2344 + 0.1191 * x 2345 - 0.00232; 2346} 2347vec3 AgXToneMapping( vec3 color ) { 2348 const mat3 AgXInsetMatrix = mat3( 2349 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2350 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2351 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2352 );
2353 const mat3 AgXOutsetMatrix = mat3( 2354 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2355 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2356 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2357 ); 2358 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2359 color *= toneMappingExposure; 2360 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2361 color = AgXInsetMatrix * color; 2362 color = max( color, 1e-10 ); color = log2( color ); 2363 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2364 color = clamp( color, 0.0, 1.0 ); 2365 color = agxDefaultContrastApprox( color ); 2366 color = AgXOutsetMatrix * color; 2367 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2368 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2369 color = clamp( color, 0.0, 1.0 ); 2370 return color; 2371} 2372vec3 NeutralToneMapping( vec3 color ) { 2373 const float StartCompression = 0.8 - 0.04; 2374 const float Desaturation = 0.15; 2375 color *= toneMappingExposure; 2376 float x = min( color.r, min( color.g, color.b ) ); 2377 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2378 color -= offset; 2379 float peak = max( color.r, max( color.g, color.b ) ); 2380 if ( peak < StartCompression ) return color; 2381 float d = 1. - StartCompression; 2382 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2383 color *= newPeak / peak; 2384 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2385 return mix( color, vec3( newPeak ), g ); 2386} 2387vec3 CustomToneMapping( vec3 color ) { return color; }`,wPe=`#ifdef USE_TRANSMISSION 2388 material.transmission = transmission; 2389 material.transmissionAlpha = 1.0; 2390 material.thickness = thickness; 2391 material.attenuationDistance = attenuationDistance; 2392 material.attenuationColor = attenuationColor; 2393 #ifdef USE_TRANSMISSIONMAP 2394 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2395 #endif 2396 #ifdef USE_THICKNESSMAP 2397 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2398 #endif 2399 vec3 pos = vWorldPosition; 2400 vec3 v = normalize( cameraPosition - pos ); 2401 vec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix ); 2402 vec4 transmitted = getIBLVolumeRefraction( 2403 n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, 2404 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2405 material.attenuationColor, material.attenuationDistance ); 2406 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2407 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2408#endif`,_Pe=`#ifdef USE_TRANSMISSION 2409 uniform float transmission; 2410 uniform float thickness; 2411 uniform float attenuationDistance; 2412 uniform vec3 attenuationColor; 2413 #ifdef USE_TRANSMISSIONMAP 2414 uniform sampler2D transmissionMap; 2415 #endif 2416 #ifdef USE_THICKNESSMAP 2417 uniform sampler2D thicknessMap; 2418 #endif 2419 uniform vec2 transmissionSamplerSize; 2420 uniform sampler2D transmissionSamplerMap; 2421 uniform mat4 modelMatrix; 2422 uniform mat4 projectionMatrix; 2423 varying vec3 vWorldPosition; 2424 float w0( float a ) { 2425 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2426 } 2427 float w1( float a ) { 2428 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2429 } 2430 float w2( float a ){ 2431 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2432 } 2433 float w3( float a ) { 2434 return ( 1.0 / 6.0 ) * ( a * a * a ); 2435 } 2436 float g0( float a ) { 2437 return w0( a ) + w1( a ); 2438 } 2439 float g1( float a ) { 2440 return w2( a ) + w3( a ); 2441 } 2442 float h0( float a ) { 2443 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2444 } 2445 float h1( float a ) { 2446 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2447 } 2448 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2449 uv = uv * texelSize.zw + 0.5; 2450 vec2 iuv = floor( uv ); 2451 vec2 fuv = fract( uv ); 2452 float g0x = g0( fuv.x ); 2453 float g1x = g1( fuv.x ); 2454 float h0x = h0( fuv.x ); 2455 float h1x = h1( fuv.x ); 2456 float h0y = h0( fuv.y ); 2457 float h1y = h1( fuv.y ); 2458 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2459 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2460 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2461 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2462 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2463 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2464 } 2465 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2466 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2467 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2468 vec2 fLodSizeInv = 1.0 / fLodSize; 2469 vec2 cLodSizeInv = 1.0 / cLodSize; 2470 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2471 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2472 return mix( fSample, cSample, fract( lod ) ); 2473 } 2474 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2475 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2476 vec3 modelScale; 2477 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2478 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2479 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2480 return normalize( refractionVector ) * thickness * modelScale; 2481 } 2482 float applyIorToRoughness( const in float roughness, const in float ior ) { 2483 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2484 } 2485 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2486 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2487 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2488 } 2489 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2490 if ( isinf( attenuationDistance ) ) { 2491 return vec3( 1.0 ); 2492 } else { 2493 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2494 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2495 } 2496 } 2497 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2498 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2499 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2500 const in vec3 attenuationColor, const in float attenuationDistance ) { 2501 vec4 transmittedLight; 2502 vec3 transmittance; 2503 #ifdef USE_DISPERSION 2504 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2505 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2506 for ( int i = 0; i < 3; i ++ ) { 2507 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2508 vec3 refractedRayExit = position + transmissionRay; 2509 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2510 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2511 refractionCoords += 1.0; 2512 refractionCoords /= 2.0; 2513 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2514 transmittedLight[ i ] = transmissionSample[ i ]; 2515 transmittedLight.a += transmissionSample.a; 2516 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2517 } 2518 transmittedLight.a /= 3.0; 2519 #else 2520 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2521 vec3 refractedRayExit = position + transmissionRay; 2522 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2523 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2524 refractionCoords += 1.0; 2525 refractionCoords /= 2.0; 2526 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2527 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2528 #endif 2529 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2530 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2531 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2532 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2533 } 2534#endif`,SPe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2535 varying vec2 vUv; 2536#endif 2537#ifdef USE_MAP 2538 varying vec2 vMapUv; 2539#endif 2540#ifdef USE_ALPHAMAP
2541 varying vec2 vAlphaMapUv; 2542#endif 2543#ifdef USE_LIGHTMAP 2544 varying vec2 vLightMapUv; 2545#endif 2546#ifdef USE_AOMAP 2547 varying vec2 vAoMapUv; 2548#endif 2549#ifdef USE_BUMPMAP 2550 varying vec2 vBumpMapUv; 2551#endif 2552#ifdef USE_NORMALMAP 2553 varying vec2 vNormalMapUv; 2554#endif 2555#ifdef USE_EMISSIVEMAP 2556 varying vec2 vEmissiveMapUv; 2557#endif 2558#ifdef USE_METALNESSMAP 2559 varying vec2 vMetalnessMapUv; 2560#endif 2561#ifdef USE_ROUGHNESSMAP 2562 varying vec2 vRoughnessMapUv; 2563#endif 2564#ifdef USE_ANISOTROPYMAP 2565 varying vec2 vAnisotropyMapUv; 2566#endif 2567#ifdef USE_CLEARCOATMAP 2568 varying vec2 vClearcoatMapUv; 2569#endif 2570#ifdef USE_CLEARCOAT_NORMALMAP 2571 varying vec2 vClearcoatNormalMapUv; 2572#endif 2573#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2574 varying vec2 vClearcoatRoughnessMapUv; 2575#endif 2576#ifdef USE_IRIDESCENCEMAP 2577 varying vec2 vIridescenceMapUv; 2578#endif 2579#ifdef USE_IRIDESCENCE_THICKNESSMAP 2580 varying vec2 vIridescenceThicknessMapUv; 2581#endif 2582#ifdef USE_SHEEN_COLORMAP 2583 varying vec2 vSheenColorMapUv; 2584#endif 2585#ifdef USE_SHEEN_ROUGHNESSMAP 2586 varying vec2 vSheenRoughnessMapUv; 2587#endif 2588#ifdef USE_SPECULARMAP 2589 varying vec2 vSpecularMapUv; 2590#endif 2591#ifdef USE_SPECULAR_COLORMAP 2592 varying vec2 vSpecularColorMapUv; 2593#endif 2594#ifdef USE_SPECULAR_INTENSITYMAP 2595 varying vec2 vSpecularIntensityMapUv; 2596#endif 2597#ifdef USE_TRANSMISSIONMAP 2598 uniform mat3 transmissionMapTransform; 2599 varying vec2 vTransmissionMapUv; 2600#endif 2601#ifdef USE_THICKNESSMAP 2602 uniform mat3 thicknessMapTransform; 2603 varying vec2 vThicknessMapUv; 2604#endif`,TPe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2605 varying vec2 vUv; 2606#endif 2607#ifdef USE_MAP 2608 uniform mat3 mapTransform; 2609 varying vec2 vMapUv; 2610#endif 2611#ifdef USE_ALPHAMAP 2612 uniform mat3 alphaMapTransform; 2613 varying vec2 vAlphaMapUv; 2614#endif 2615#ifdef USE_LIGHTMAP 2616 uniform mat3 lightMapTransform; 2617 varying vec2 vLightMapUv; 2618#endif 2619#ifdef USE_AOMAP 2620 uniform mat3 aoMapTransform; 2621 varying vec2 vAoMapUv; 2622#endif 2623#ifdef USE_BUMPMAP 2624 uniform mat3 bumpMapTransform; 2625 varying vec2 vBumpMapUv; 2626#endif 2627#ifdef USE_NORMALMAP 2628 uniform mat3 normalMapTransform; 2629 varying vec2 vNormalMapUv; 2630#endif 2631#ifdef USE_DISPLACEMENTMAP 2632 uniform mat3 displacementMapTransform; 2633 varying vec2 vDisplacementMapUv; 2634#endif 2635#ifdef USE_EMISSIVEMAP 2636 uniform mat3 emissiveMapTransform; 2637 varying vec2 vEmissiveMapUv; 2638#endif 2639#ifdef USE_METALNESSMAP 2640 uniform mat3 metalnessMapTransform; 2641 varying vec2 vMetalnessMapUv; 2642#endif 2643#ifdef USE_ROUGHNESSMAP 2644 uniform mat3 roughnessMapTransform; 2645 varying vec2 vRoughnessMapUv; 2646#endif 2647#ifdef USE_ANISOTROPYMAP 2648 uniform mat3 anisotropyMapTransform; 2649 varying vec2 vAnisotropyMapUv; 2650#endif 2651#ifdef USE_CLEARCOATMAP 2652 uniform mat3 clearcoatMapTransform; 2653 varying vec2 vClearcoatMapUv; 2654#endif 2655#ifdef USE_CLEARCOAT_NORMALMAP 2656 uniform mat3 clearcoatNormalMapTransform; 2657 varying vec2 vClearcoatNormalMapUv; 2658#endif 2659#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2660 uniform mat3 clearcoatRoughnessMapTransform; 2661 varying vec2 vClearcoatRoughnessMapUv; 2662#endif 2663#ifdef USE_SHEEN_COLORMAP 2664 uniform mat3 sheenColorMapTransform; 2665 varying vec2 vSheenColorMapUv; 2666#endif 2667#ifdef USE_SHEEN_ROUGHNESSMAP 2668 uniform mat3 sheenRoughnessMapTransform; 2669 varying vec2 vSheenRoughnessMapUv; 2670#endif 2671#ifdef USE_IRIDESCENCEMAP 2672 uniform mat3 iridescenceMapTransform; 2673 varying vec2 vIridescenceMapUv; 2674#endif 2675#ifdef USE_IRIDESCENCE_THICKNESSMAP 2676 uniform mat3 iridescenceThicknessMapTransform; 2677 varying vec2 vIridescenceThicknessMapUv; 2678#endif 2679#ifdef USE_SPECULARMAP 2680 uniform mat3 specularMapTransform; 2681 varying vec2 vSpecularMapUv; 2682#endif 2683#ifdef USE_SPECULAR_COLORMAP 2684 uniform mat3 specularColorMapTransform; 2685 varying vec2 vSpecularColorMapUv; 2686#endif 2687#ifdef USE_SPECULAR_INTENSITYMAP 2688 uniform mat3 specularIntensityMapTransform; 2689 varying vec2 vSpecularIntensityMapUv; 2690#endif 2691#ifdef USE_TRANSMISSIONMAP 2692 uniform mat3 transmissionMapTransform; 2693 varying vec2 vTransmissionMapUv; 2694#endif 2695#ifdef USE_THICKNESSMAP 2696 uniform mat3 thicknessMapTransform; 2697 varying vec2 vThicknessMapUv; 2698#endif`,EPe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2699 vUv = vec3( uv, 1 ).xy; 2700#endif 2701#ifdef USE_MAP 2702 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2703#endif 2704#ifdef USE_ALPHAMAP 2705 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2706#endif 2707#ifdef USE_LIGHTMAP 2708 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2709#endif 2710#ifdef USE_AOMAP 2711 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2712#endif 2713#ifdef USE_BUMPMAP 2714 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2715#endif 2716#ifdef USE_NORMALMAP 2717 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2718#endif 2719#ifdef USE_DISPLACEMENTMAP 2720 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2721#endif 2722#ifdef USE_EMISSIVEMAP 2723 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2724#endif 2725#ifdef USE_METALNESSMAP 2726 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2727#endif 2728#ifdef USE_ROUGHNESSMAP 2729 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2730#endif 2731#ifdef USE_ANISOTROPYMAP 2732 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2733#endif 2734#ifdef USE_CLEARCOATMAP 2735 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2736#endif 2737#ifdef USE_CLEARCOAT_NORMALMAP 2738 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2739#endif 2740#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2741 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2742#endif
2743#ifdef USE_IRIDESCENCEMAP 2744 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2745#endif 2746#ifdef USE_IRIDESCENCE_THICKNESSMAP 2747 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2748#endif 2749#ifdef USE_SHEEN_COLORMAP 2750 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2751#endif 2752#ifdef USE_SHEEN_ROUGHNESSMAP 2753 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2754#endif 2755#ifdef USE_SPECULARMAP 2756 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2757#endif 2758#ifdef USE_SPECULAR_COLORMAP 2759 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2760#endif 2761#ifdef USE_SPECULAR_INTENSITYMAP 2762 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2763#endif 2764#ifdef USE_TRANSMISSIONMAP 2765 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2766#endif 2767#ifdef USE_THICKNESSMAP 2768 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2769#endif`,CPe=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2770 vec4 worldPosition = vec4( transformed, 1.0 ); 2771 #ifdef USE_BATCHING 2772 worldPosition = batchingMatrix * worldPosition; 2773 #endif 2774 #ifdef USE_INSTANCING 2775 worldPosition = instanceMatrix * worldPosition; 2776 #endif 2777 worldPosition = modelMatrix * worldPosition; 2778#endif`;const NPe=`varying vec2 vUv; 2779uniform mat3 uvTransform; 2780void main() { 2781 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2782 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2783}`,MPe=`uniform sampler2D t2D; 2784uniform float backgroundIntensity; 2785varying vec2 vUv; 2786void main() { 2787 vec4 texColor = texture2D( t2D, vUv ); 2788 #ifdef DECODE_VIDEO_TEXTURE 2789 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 ); 2790 #endif 2791 texColor.rgb *= backgroundIntensity; 2792 gl_FragColor = texColor; 2793 #include <tonemapping_fragment> 2794 #include <colorspace_fragment> 2795}`,kPe=`varying vec3 vWorldDirection; 2796#include <common> 2797void main() { 2798 vWorldDirection = transformDirection( position, modelMatrix ); 2799 #include <begin_vertex> 2800 #include <project_vertex> 2801 gl_Position.z = gl_Position.w; 2802}`,RPe=`#ifdef ENVMAP_TYPE_CUBE 2803 uniform samplerCube envMap; 2804#elif defined( ENVMAP_TYPE_CUBE_UV ) 2805 uniform sampler2D envMap; 2806#endif 2807uniform float backgroundBlurriness; 2808uniform float backgroundIntensity; 2809uniform mat3 backgroundRotation; 2810varying vec3 vWorldDirection; 2811#include <cube_uv_reflection_fragment> 2812void main() { 2813 #ifdef ENVMAP_TYPE_CUBE 2814 vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection ); 2815 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2816 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2817 #else 2818 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2819 #endif 2820 texColor.rgb *= backgroundIntensity; 2821 gl_FragColor = texColor; 2822 #include <tonemapping_fragment> 2823 #include <colorspace_fragment> 2824}`,PPe=`varying vec3 vWorldDirection; 2825#include <common> 2826void main() { 2827 vWorldDirection = transformDirection( position, modelMatrix ); 2828 #include <begin_vertex> 2829 #include <project_vertex> 2830 gl_Position.z = gl_Position.w; 2831}`,LPe=`uniform samplerCube tCube; 2832uniform float tFlip; 2833uniform float opacity; 2834varying vec3 vWorldDirection; 2835void main() { 2836 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2837 gl_FragColor = texColor; 2838 gl_FragColor.a *= opacity; 2839 #include <tonemapping_fragment> 2840 #include <colorspace_fragment> 2841}`,OPe=`#include <common> 2842#include <batching_pars_vertex> 2843#include <uv_pars_vertex> 2844#include <displacementmap_pars_vertex> 2845#include <morphtarget_pars_vertex> 2846#include <skinning_pars_vertex> 2847#include <logdepthbuf_pars_vertex> 2848#include <clipping_planes_pars_vertex> 2849varying vec2 vHighPrecisionZW; 2850void main() { 2851 #include <uv_vertex> 2852 #include <batching_vertex> 2853 #include <skinbase_vertex> 2854 #include <morphinstance_vertex> 2855 #ifdef USE_DISPLACEMENTMAP 2856 #include <beginnormal_vertex> 2857 #include <morphnormal_vertex> 2858 #include <skinnormal_vertex> 2859 #endif 2860 #include <begin_vertex> 2861 #include <morphtarget_vertex> 2862 #include <skinning_vertex> 2863 #include <displacementmap_vertex> 2864 #include <project_vertex> 2865 #include <logdepthbuf_vertex> 2866 #include <clipping_planes_vertex> 2867 vHighPrecisionZW = gl_Position.zw; 2868}`,DPe=`#if DEPTH_PACKING == 3200 2869 uniform float opacity; 2870#endif 2871#include <common> 2872#include <packing> 2873#include <uv_pars_fragment> 2874#include <map_pars_fragment> 2875#include <alphamap_pars_fragment> 2876#include <alphatest_pars_fragment> 2877#include <alphahash_pars_fragment> 2878#include <logdepthbuf_pars_fragment> 2879#include <clipping_planes_pars_fragment> 2880varying vec2 vHighPrecisionZW; 2881void main() { 2882 vec4 diffuseColor = vec4( 1.0 ); 2883 #include <clipping_planes_fragment> 2884 #if DEPTH_PACKING == 3200 2885 diffuseColor.a = opacity; 2886 #endif 2887 #include <map_fragment> 2888 #include <alphamap_fragment> 2889 #include <alphatest_fragment> 2890 #include <alphahash_fragment> 2891 #include <logdepthbuf_fragment> 2892 #ifdef USE_REVERSED_DEPTH_BUFFER 2893 float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; 2894 #else 2895 float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; 2896 #endif 2897 #if DEPTH_PACKING == 3200 2898 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2899 #elif DEPTH_PACKING == 3201 2900 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2901 #elif DEPTH_PACKING == 3202 2902 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 2903 #elif DEPTH_PACKING == 3203 2904 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 2905 #endif 2906}`,jPe=`#define DISTANCE 2907varying vec3 vWorldPosition; 2908#include <common> 2909#include <batching_pars_vertex> 2910#include <uv_pars_vertex> 2911#include <displacementmap_pars_vertex> 2912#include <morphtarget_pars_vertex> 2913#include <skinning_pars_vertex> 2914#include <clipping_planes_pars_vertex> 2915void main() { 2916 #include <uv_vertex> 2917 #include <batching_vertex> 2918 #include <skinbase_vertex> 2919 #include <morphinstance_vertex> 2920 #ifdef USE_DISPLACEMENTMAP 2921 #include <beginnormal_vertex> 2922 #include <morphnormal_vertex> 2923 #include <skinnormal_vertex> 2924 #endif 2925 #include <begin_vertex> 2926 #include <morphtarget_vertex> 2927 #include <skinning_vertex> 2928 #include <displacementmap_vertex> 2929 #include <project_vertex> 2930 #include <worldpos_vertex> 2931 #include <clipping_planes_vertex> 2932 vWorldPosition = worldPosition.xyz; 2933}`,IPe=`#define DISTANCE 2934uniform vec3 referencePosition; 2935uniform float nearDistance; 2936uniform float farDistance; 2937varying vec3 vWorldPosition; 2938#include <common> 2939#include <uv_pars_fragment> 2940#include <map_pars_fragment> 2941#include <alphamap_pars_fragment> 2942#include <alphatest_pars_fragment> 2943#include <alphahash_pars_fragment> 2944#include <clipping_planes_pars_fragment> 2945void main() { 2946 vec4 diffuseColor = vec4( 1.0 ); 2947 #include <clipping_planes_fragment> 2948 #include <map_fragment> 2949 #include <alphamap_fragment> 2950 #include <alphatest_fragment> 2951 #include <alphahash_fragment> 2952 float dist = length( vWorldPosition - referencePosition ); 2953 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2954 dist = saturate( dist ); 2955 gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); 2956}`,FPe=`varying vec3 vWorldDirection; 2957#include <common> 2958void main() { 2959 vWorldDirection = transformDirection( position, modelMatrix ); 2960 #include <begin_vertex> 2961 #include <project_vertex> 2962}`,UPe=`uniform sampler2D tEquirect; 2963varying vec3 vWorldDirection; 2964#include <common> 2965void main() { 2966 vec3 direction = normalize( vWorldDirection ); 2967 vec2 sampleUV = equirectUv( direction ); 2968 gl_FragColor = texture2D( tEquirect, sampleUV ); 2969 #include <tonemapping_fragment> 2970 #include <colorspace_fragment> 2971}`,BPe=`uniform float scale; 2972attribute float lineDistance; 2973varying float vLineDistance; 2974#include <common> 2975#include <uv_pars_vertex> 2976#include <color_pars_vertex> 2977#include <fog_pars_vertex> 2978#include <morphtarget_pars_vertex> 2979#include <logdepthbuf_pars_vertex> 2980#include <clipping_planes_pars_vertex> 2981void main() { 2982 vLineDistance = scale * lineDistance; 2983 #include <uv_vertex> 2984 #include <color_vertex> 2985 #include <morphinstance_vertex> 2986 #include <morphcolor_vertex> 2987 #include <begin_vertex> 2988 #include <morphtarget_vertex> 2989 #include <project_vertex> 2990 #include <logdepthbuf_vertex> 2991 #include <clipping_planes_vertex> 2992 #include <fog_vertex> 2993}`,VPe=`uniform vec3 diffuse; 2994uniform float opacity; 2995uniform float dashSize; 2996uniform float totalSize; 2997varying float vLineDistance; 2998#include <common> 2999#include <color_pars_fragment> 3000#include <uv_pars_fragment> 3001#include <map_pars_fragment> 3002#include <fog_pars_fragment> 3003#include <logdepthbuf_pars_fragment> 3004#include <clipping_planes_pars_fragment> 3005void main() { 3006 vec4 diffuseColor = vec4( diffuse, opacity ); 3007 #include <clipping_planes_fragment> 3008 if ( mod( vLineDistance, totalSize ) > dashSize ) { 3009 discard; 3010 } 3011 vec3 outgoingLight = vec3( 0.0 ); 3012 #include <logdepthbuf_fragment> 3013 #include <map_fragment> 3014 #include <color_fragment> 3015 outgoingLight = diffuseColor.rgb; 3016 #include <opaque_fragment> 3017 #include <tonemapping_fragment> 3018 #include <colorspace_fragment> 3019 #include <fog_fragment> 3020 #include <premultiplied_alpha_fragment> 3021}`,zPe=`#include <common> 3022#include <batching_pars_vertex> 3023#include <uv_pars_vertex> 3024#include <envmap_pars_vertex> 3025#include <color_pars_vertex> 3026#include <fog_pars_vertex> 3027#include <morphtarget_pars_vertex> 3028#include <skinning_pars_vertex> 3029#include <logdepthbuf_pars_vertex> 3030#include <clipping_planes_pars_vertex> 3031void main() { 3032 #include <uv_vertex> 3033 #include <color_vertex> 3034 #include <morphinstance_vertex> 3035 #include <morphcolor_vertex> 3036 #include <batching_vertex> 3037 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 3038 #include <beginnormal_vertex> 3039 #include <morphnormal_vertex> 3040 #include <skinbase_vertex> 3041 #include <skinnormal_vertex> 3042 #include <defaultnormal_vertex> 3043 #endif 3044 #include <begin_vertex> 3045 #include <morphtarget_vertex> 3046 #include <skinning_vertex> 3047 #include <project_vertex> 3048 #include <logdepthbuf_vertex> 3049 #include <clipping_planes_vertex> 3050 #include <worldpos_vertex> 3051 #include <envmap_vertex> 3052 #include <fog_vertex> 3053}`,GPe=`uniform vec3 diffuse; 3054uniform float opacity; 3055#ifndef FLAT_SHADED 3056 varying vec3 vNormal; 3057#endif 3058#include <common> 3059#include <dithering_pars_fragment> 3060#include <color_pars_fragment> 3061#include <uv_pars_fragment> 3062#include <map_pars_fragment> 3063#include <alphamap_pars_fragment> 3064#include <alphatest_pars_fragment> 3065#include <alphahash_pars_fragment> 3066#include <aomap_pars_fragment> 3067#include <lightmap_pars_fragment> 3068#include <envmap_common_pars_fragment> 3069#include <envmap_pars_fragment> 3070#include <fog_pars_fragment> 3071#include <specularmap_pars_fragment> 3072#include <logdepthbuf_pars_fragment> 3073#include <clipping_planes_pars_fragment> 3074void main() { 3075 vec4 diffuseColor = vec4( diffuse, opacity ); 3076 #include <clipping_planes_fragment> 3077 #include <logdepthbuf_fragment> 3078 #include <map_fragment> 3079 #include <color_fragment> 3080 #include <alphamap_fragment> 3081 #include <alphatest_fragment> 3082 #include <alphahash_fragment> 3083 #include <specularmap_fragment> 3084 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3085 #ifdef USE_LIGHTMAP 3086 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 3087 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 3088 #else 3089 reflectedLight.indirectDiffuse += vec3( 1.0 ); 3090 #endif 3091 #include <aomap_fragment> 3092 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 3093 vec3 outgoingLight = reflectedLight.indirectDiffuse; 3094 #include <envmap_fragment> 3095 #include <opaque_fragment> 3096 #include <tonemapping_fragment> 3097 #include <colorspace_fragment> 3098 #include <fog_fragment> 3099 #include <premultiplied_alpha_fragment> 3100 #include <dithering_fragment> 3101}`,qPe=`#define LAMBERT 3102varying vec3 vViewPosition; 3103#include <common> 3104#include <batching_pars_vertex> 3105#include <uv_pars_vertex> 3106#include <displacementmap_pars_vertex> 3107#include <envmap_pars_vertex> 3108#include <color_pars_vertex> 3109#include <fog_pars_vertex> 3110#include <normal_pars_vertex> 3111#include <morphtarget_pars_vertex> 3112#include <skinning_pars_vertex> 3113#include <shadowmap_pars_vertex> 3114#include <logdepthbuf_pars_vertex> 3115#include <clipping_planes_pars_vertex> 3116void main() { 3117 #include <uv_vertex> 3118 #include <color_vertex> 3119 #include <morphinstance_vertex> 3120 #include <morphcolor_vertex> 3121 #include <batching_vertex> 3122 #include <beginnormal_vertex> 3123 #include <morphnormal_vertex> 3124 #include <skinbase_vertex> 3125 #include <skinnormal_vertex> 3126 #include <defaultnormal_vertex> 3127 #include <normal_vertex> 3128 #include <begin_vertex> 3129 #include <morphtarget_vertex> 3130 #include <skinning_vertex> 3131 #include <displacementmap_vertex> 3132 #include <project_vertex> 3133 #include <logdepthbuf_vertex> 3134 #include <clipping_planes_vertex> 3135 vViewPosition = - mvPosition.xyz; 3136 #include <worldpos_vertex> 3137 #include <envmap_vertex> 3138 #include <shadowmap_vertex> 3139 #include <fog_vertex> 3140}`,$Pe=`#define LAMBERT 3141uniform vec3 diffuse; 3142uniform vec3 emissive; 3143uniform float opacity; 3144#include <common> 3145#include <dithering_pars_fragment> 3146#include <color_pars_fragment> 3147#include <uv_pars_fragment> 3148#include <map_pars_fragment> 3149#include <alphamap_pars_fragment> 3150#include <alphatest_pars_fragment> 3151#include <alphahash_pars_fragment> 3152#include <aomap_pars_fragment> 3153#include <lightmap_pars_fragment> 3154#include <emissivemap_pars_fragment> 3155#include <cube_uv_reflection_fragment> 3156#include <envmap_common_pars_fragment> 3157#include <envmap_pars_fragment> 3158#include <envmap_physical_pars_fragment> 3159#include <fog_pars_fragment> 3160#include <bsdfs> 3161#include <lights_pars_begin> 3162#include <normal_pars_fragment> 3163#include <lights_lambert_pars_fragment> 3164#include <shadowmap_pars_fragment> 3165#include <bumpmap_pars_fragment> 3166#include <normalmap_pars_fragment> 3167#include <specularmap_pars_fragment> 3168#include <logdepthbuf_pars_fragment> 3169#include <clipping_planes_pars_fragment> 3170void main() { 3171 vec4 diffuseColor = vec4( diffuse, opacity ); 3172 #include <clipping_planes_fragment> 3173 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3174 vec3 totalEmissiveRadiance = emissive; 3175 #include <logdepthbuf_fragment> 3176 #include <map_fragment> 3177 #include <color_fragment> 3178 #include <alphamap_fragment> 3179 #include <alphatest_fragment> 3180 #include <alphahash_fragment> 3181 #include <specularmap_fragment> 3182 #include <normal_fragment_begin> 3183 #include <normal_fragment_maps> 3184 #include <emissivemap_fragment> 3185 #include <lights_lambert_fragment> 3186 #include <lights_fragment_begin> 3187 #include <lights_fragment_maps> 3188 #include <lights_fragment_end> 3189 #include <aomap_fragment> 3190 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3191 #include <envmap_fragment> 3192 #include <opaque_fragment> 3193 #include <tonemapping_fragment> 3194 #include <colorspace_fragment> 3195 #include <fog_fragment> 3196 #include <premultiplied_alpha_fragment> 3197 #include <dithering_fragment> 3198}`,HPe=`#define MATCAP 3199varying vec3 vViewPosition; 3200#include <common> 3201#include <batching_pars_vertex> 3202#include <uv_pars_vertex> 3203#include <color_pars_vertex> 3204#include <displacementmap_pars_vertex> 3205#include <fog_pars_vertex> 3206#include <normal_pars_vertex> 3207#include <morphtarget_pars_vertex> 3208#include <skinning_pars_vertex> 3209#include <logdepthbuf_pars_vertex> 3210#include <clipping_planes_pars_vertex> 3211void main() { 3212 #include <uv_vertex> 3213 #include <color_vertex> 3214 #include <morphinstance_vertex> 3215 #include <morphcolor_vertex> 3216 #include <batching_vertex> 3217 #include <beginnormal_vertex> 3218 #include <morphnormal_vertex> 3219 #include <skinbase_vertex> 3220 #include <skinnormal_vertex> 3221 #include <defaultnormal_vertex> 3222 #include <normal_vertex> 3223 #include <begin_vertex> 3224 #include <morphtarget_vertex> 3225 #include <skinning_vertex> 3226 #include <displacementmap_vertex> 3227 #include <project_vertex> 3228 #include <logdepthbuf_vertex> 3229 #include <clipping_planes_vertex> 3230 #include <fog_vertex> 3231 vViewPosition = - mvPosition.xyz; 3232}`,WPe=`#define MATCAP 3233uniform vec3 diffuse; 3234uniform float opacity; 3235uniform sampler2D matcap; 3236varying vec3 vViewPosition; 3237#include <common> 3238#include <dithering_pars_fragment> 3239#include <color_pars_fragment> 3240#include <uv_pars_fragment> 3241#include <map_pars_fragment> 3242#include <alphamap_pars_fragment> 3243#include <alphatest_pars_fragment> 3244#include <alphahash_pars_fragment> 3245#include <fog_pars_fragment> 3246#include <normal_pars_fragment> 3247#include <bumpmap_pars_fragment> 3248#include <n
3248ormalmap_pars_fragment> 3249#include <logdepthbuf_pars_fragment> 3250#include <clipping_planes_pars_fragment> 3251void main() { 3252 vec4 diffuseColor = vec4( diffuse, opacity ); 3253 #include <clipping_planes_fragment> 3254 #include <logdepthbuf_fragment> 3255 #include <map_fragment> 3256 #include <color_fragment> 3257 #include <alphamap_fragment> 3258 #include <alphatest_fragment> 3259 #include <alphahash_fragment> 3260 #include <normal_fragment_begin> 3261 #include <normal_fragment_maps> 3262 vec3 viewDir = normalize( vViewPosition ); 3263 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3264 vec3 y = cross( viewDir, x ); 3265 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3266 #ifdef USE_MATCAP 3267 vec4 matcapColor = texture2D( matcap, uv ); 3268 #else 3269 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3270 #endif 3271 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3272 #include <opaque_fragment> 3273 #include <tonemapping_fragment> 3274 #include <colorspace_fragment> 3275 #include <fog_fragment> 3276 #include <premultiplied_alpha_fragment> 3277 #include <dithering_fragment> 3278}`,XPe=`#define NORMAL 3279#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3280 varying vec3 vViewPosition; 3281#endif 3282#include <common> 3283#include <batching_pars_vertex> 3284#include <uv_pars_vertex> 3285#include <displacementmap_pars_vertex> 3286#include <normal_pars_vertex> 3287#include <morphtarget_pars_vertex> 3288#include <skinning_pars_vertex> 3289#include <logdepthbuf_pars_vertex> 3290#include <clipping_planes_pars_vertex> 3291void main() { 3292 #include <uv_vertex> 3293 #include <batching_vertex> 3294 #include <beginnormal_vertex> 3295 #include <morphinstance_vertex> 3296 #include <morphnormal_vertex> 3297 #include <skinbase_vertex> 3298 #include <skinnormal_vertex> 3299 #include <defaultnormal_vertex> 3300 #include <normal_vertex> 3301 #include <begin_vertex> 3302 #include <morphtarget_vertex> 3303 #include <skinning_vertex> 3304 #include <displacementmap_vertex> 3305 #include <project_vertex> 3306 #include <logdepthbuf_vertex> 3307 #include <clipping_planes_vertex> 3308#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3309 vViewPosition = - mvPosition.xyz; 3310#endif 3311}`,YPe=`#define NORMAL 3312uniform float opacity; 3313#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3314 varying vec3 vViewPosition; 3315#endif 3316#include <uv_pars_fragment> 3317#include <normal_pars_fragment> 3318#include <bumpmap_pars_fragment> 3319#include <normalmap_pars_fragment> 3320#include <logdepthbuf_pars_fragment> 3321#include <clipping_planes_pars_fragment> 3322void main() { 3323 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3324 #include <clipping_planes_fragment> 3325 #include <logdepthbuf_fragment> 3326 #include <normal_fragment_begin> 3327 #include <normal_fragment_maps> 3328 gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); 3329 #ifdef OPAQUE 3330 gl_FragColor.a = 1.0; 3331 #endif 3332}`,QPe=`#define PHONG 3333varying vec3 vViewPosition; 3334#include <common> 3335#include <batching_pars_vertex> 3336#include <uv_pars_vertex> 3337#include <displacementmap_pars_vertex> 3338#include <envmap_pars_vertex> 3339#include <color_pars_vertex> 3340#include <fog_pars_vertex> 3341#include <normal_pars_vertex> 3342#include <morphtarget_pars_vertex> 3343#include <skinning_pars_vertex> 3344#include <shadowmap_pars_vertex> 3345#include <logdepthbuf_pars_vertex> 3346#include <clipping_planes_pars_vertex> 3347void main() { 3348 #include <uv_vertex> 3349 #include <color_vertex> 3350 #include <morphcolor_vertex> 3351 #include <batching_vertex> 3352 #include <beginnormal_vertex> 3353 #include <morphinstance_vertex> 3354 #include <morphnormal_vertex> 3355 #include <skinbase_vertex> 3356 #include <skinnormal_vertex> 3357 #include <defaultnormal_vertex> 3358 #include <normal_vertex> 3359 #include <begin_vertex> 3360 #include <morphtarget_vertex> 3361 #include <skinning_vertex> 3362 #include <displacementmap_vertex> 3363 #include <project_vertex> 3364 #include <logdepthbuf_vertex> 3365 #include <clipping_planes_vertex> 3366 vViewPosition = - mvPosition.xyz; 3367 #include <worldpos_vertex> 3368 #include <envmap_vertex> 3369 #include <shadowmap_vertex> 3370 #include <fog_vertex> 3371}`,KPe=`#define PHONG 3372uniform vec3 diffuse; 3373uniform vec3 emissive; 3374uniform vec3 specular; 3375uniform float shininess; 3376uniform float opacity; 3377#include <common> 3378#include <dithering_pars_fragment> 3379#include <color_pars_fragment> 3380#include <uv_pars_fragment> 3381#include <map_pars_fragment> 3382#include <alphamap_pars_fragment> 3383#include <alphatest_pars_fragment> 3384#include <alphahash_pars_fragment> 3385#include <aomap_pars_fragment> 3386#include <lightmap_pars_fragment> 3387#include <emissivemap_pars_fragment> 3388#include <cube_uv_reflection_fragment> 3389#include <envmap_common_pars_fragment> 3390#include <envmap_pars_fragment> 3391#include <envmap_physical_pars_fragment> 3392#include <fog_pars_fragment> 3393#include <bsdfs> 3394#include <lights_pars_begin> 3395#include <normal_pars_fragment> 3396#include <lights_phong_pars_fragment> 3397#include <shadowmap_pars_fragment> 3398#include <bumpmap_pars_fragment> 3399#include <normalmap_pars_fragment> 3400#include <specularmap_pars_fragment> 3401#include <logdepthbuf_pars_fragment> 3402#include <clipping_planes_pars_fragment> 3403void main() { 3404 vec4 diffuseColor = vec4( diffuse, opacity ); 3405 #include <clipping_planes_fragment> 3406 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3407 vec3 totalEmissiveRadiance = emissive; 3408 #include <logdepthbuf_fragment> 3409 #include <map_fragment> 3410 #include <color_fragment> 3411 #include <alphamap_fragment> 3412 #include <alphatest_fragment> 3413 #include <alphahash_fragment> 3414 #include <specularmap_fragment> 3415 #include <normal_fragment_begin> 3416 #include <normal_fragment_maps> 3417 #include <emissivemap_fragment> 3418 #include <lights_phong_fragment> 3419 #include <lights_fragment_begin> 3420 #include <lights_fragment_maps> 3421 #include <lights_fragment_end> 3422 #include <aomap_fragment> 3423 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3424 #include <envmap_fragment> 3425 #include <opaque_fragment> 3426 #include <tonemapping_fragment> 3427 #include <colorspace_fragment> 3428 #include <fog_fragment> 3429 #include <premultiplied_alpha_fragment> 3430 #include <dithering_fragment> 3431}`,ZPe=`#define STANDARD 3432varying vec3 vViewPosition; 3433#ifdef USE_TRANSMISSION 3434 varying vec3 vWorldPosition; 3435#endif 3436#include <common> 3437#include <batching_pars_vertex> 3438#include <uv_pars_vertex> 3439#include <displacementmap_pars_vertex> 3440#include <color_pars_vertex> 3441#include <fog_pars_vertex> 3442#include <normal_pars_vertex> 3443#include <morphtarget_pars_vertex> 3444#include <skinning_pars_vertex> 3445#include <shadowmap_pars_vertex> 3446#include <logdepthbuf_pars_vertex> 3447#include <clipping_planes_pars_vertex> 3448void main() { 3449 #include <uv_vertex> 3450 #include <color_vertex> 3451 #include <morphinstance_vertex> 3452 #include <morphcolor_vertex> 3453 #include <batching_vertex> 3454 #include <beginnormal_vertex> 3455 #include <morphnormal_vertex> 3456 #include <skinbase_vertex> 3457 #include <skinnormal_vertex> 3458 #include <defaultnormal_vertex> 3459 #include <normal_vertex> 3460 #include <begin_vertex> 3461 #include <morphtarget_vertex> 3462 #include <skinning_vertex> 3463 #include <displacementmap_vertex> 3464 #include <project_vertex> 3465 #include <logdepthbuf_vertex> 3466 #include <clipping_planes_vertex> 3467 vViewPosition = - mvPosition.xyz; 3468 #include <worldpos_vertex> 3469 #include <shadowmap_vertex> 3470 #include <fog_vertex> 3471#ifdef USE_TRANSMISSION 3472 vWorldPosition = worldPosition.xyz; 3473#endif 3474}`,JPe=`#define STANDARD 3475#ifdef PHYSICAL 3476 #define IOR 3477 #define USE_SPECULAR 3478#endif 3479uniform vec3 diffuse; 3480uniform vec3 emissive; 3481uniform float roughness; 3482uniform float metalness; 3483uniform float opacity; 3484#ifdef IOR 3485 uniform float ior; 3486#endif 3487#ifdef USE_SPECULAR 3488 uniform float specularIntensity; 3489 uniform vec3 specularColor; 3490 #ifdef USE_SPECULAR_COLORMAP 3491 uniform sampler2D specularColorMap; 3492 #endif 3493 #ifdef USE_SPECULAR_INTENSITYMAP 3494 uniform sampler2D specularIntensityMap; 3495 #endif 3496#endif 3497#ifdef USE_CLEARCOAT 3498 uniform float clearcoat; 3499 uniform float clearcoatRoughness; 3500#endif 3501#ifdef USE_DISPERSION 3502 uniform float dispersion; 3503#endif
3504#ifdef USE_IRIDESCENCE 3505 uniform float iridescence; 3506 uniform float iridescenceIOR; 3507 uniform float iridescenceThicknessMinimum; 3508 uniform float iridescenceThicknessMaximum; 3509#endif 3510#ifdef USE_SHEEN 3511 uniform vec3 sheenColor; 3512 uniform float sheenRoughness; 3513 #ifdef USE_SHEEN_COLORMAP 3514 uniform sampler2D sheenColorMap; 3515 #endif 3516 #ifdef USE_SHEEN_ROUGHNESSMAP 3517 uniform sampler2D sheenRoughnessMap; 3518 #endif 3519#endif 3520#ifdef USE_ANISOTROPY 3521 uniform vec2 anisotropyVector; 3522 #ifdef USE_ANISOTROPYMAP 3523 uniform sampler2D anisotropyMap; 3524 #endif 3525#endif 3526varying vec3 vViewPosition; 3527#include <common> 3528#include <dithering_pars_fragment> 3529#include <color_pars_fragment> 3530#include <uv_pars_fragment> 3531#include <map_pars_fragment> 3532#include <alphamap_pars_fragment> 3533#include <alphatest_pars_fragment> 3534#include <alphahash_pars_fragment> 3535#include <aomap_pars_fragment> 3536#include <lightmap_pars_fragment> 3537#include <emissivemap_pars_fragment> 3538#include <iridescence_fragment> 3539#include <cube_uv_reflection_fragment> 3540#include <envmap_common_pars_fragment> 3541#include <envmap_physical_pars_fragment> 3542#include <fog_pars_fragment> 3543#include <lights_pars_begin> 3544#include <normal_pars_fragment> 3545#include <lights_physical_pars_fragment> 3546#include <transmission_pars_fragment> 3547#include <shadowmap_pars_fragment> 3548#include <bumpmap_pars_fragment> 3549#include <normalmap_pars_fragment> 3550#include <clearcoat_pars_fragment> 3551#include <iridescence_pars_fragment> 3552#include <roughnessmap_pars_fragment> 3553#include <metalnessmap_pars_fragment> 3554#include <logdepthbuf_pars_fragment> 3555#include <clipping_planes_pars_fragment> 3556void main() { 3557 vec4 diffuseColor = vec4( diffuse, opacity ); 3558 #include <clipping_planes_fragment> 3559 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3560 vec3 totalEmissiveRadiance = emissive; 3561 #include <logdepthbuf_fragment> 3562 #include <map_fragment> 3563 #include <color_fragment> 3564 #include <alphamap_fragment> 3565 #include <alphatest_fragment> 3566 #include <alphahash_fragment> 3567 #include <roughnessmap_fragment> 3568 #include <metalnessmap_fragment> 3569 #include <normal_fragment_begin> 3570 #include <normal_fragment_maps> 3571 #include <clearcoat_normal_fragment_begin> 3572 #include <clearcoat_normal_fragment_maps> 3573 #include <emissivemap_fragment> 3574 #include <lights_physical_fragment> 3575 #include <lights_fragment_begin> 3576 #include <lights_fragment_maps> 3577 #include <lights_fragment_end> 3578 #include <aomap_fragment> 3579 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3580 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3581 #include <transmission_fragment> 3582 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3583 #ifdef USE_SHEEN 3584 3585 outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; 3586 3587 #endif 3588 #ifdef USE_CLEARCOAT 3589 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3590 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3591 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3592 #endif 3593 #include <opaque_fragment> 3594 #include <tonemapping_fragment> 3595 #include <colorspace_fragment> 3596 #include <fog_fragment> 3597 #include <premultiplied_alpha_fragment> 3598 #include <dithering_fragment> 3599}`,e7e=`#define TOON 3600varying vec3 vViewPosition; 3601#include <common> 3602#include <batching_pars_vertex> 3603#include <uv_pars_vertex> 3604#include <displacementmap_pars_vertex> 3605#include <color_pars_vertex> 3606#include <fog_pars_vertex> 3607#include <normal_pars_vertex> 3608#include <morphtarget_pars_vertex> 3609#include <skinning_pars_vertex> 3610#include <shadowmap_pars_vertex> 3611#include <logdepthbuf_pars_vertex> 3612#include <clipping_planes_pars_vertex> 3613void main() { 3614 #include <uv_vertex> 3615 #include <color_vertex> 3616 #include <morphinstance_vertex> 3617 #include <morphcolor_vertex> 3618 #include <batching_vertex> 3619 #include <beginnormal_vertex> 3620 #include <morphnormal_vertex> 3621 #include <skinbase_vertex> 3622 #include <skinnormal_vertex> 3623 #include <defaultnormal_vertex> 3624 #include <normal_vertex> 3625 #include <begin_vertex> 3626 #include <morphtarget_vertex> 3627 #include <skinning_vertex> 3628 #include <displacementmap_vertex> 3629 #include <project_vertex> 3630 #include <logdepthbuf_vertex> 3631 #include <clipping_planes_vertex> 3632 vViewPosition = - mvPosition.xyz; 3633 #include <worldpos_vertex> 3634 #include <shadowmap_vertex> 3635 #include <fog_vertex> 3636}`,t7e=`#define TOON 3637uniform vec3 diffuse; 3638uniform vec3 emissive; 3639uniform float opacity; 3640#include <common> 3641#include <dithering_pars_fragment> 3642#include <color_pars_fragment> 3643#include <uv_pars_fragment> 3644#include <map_pars_fragment> 3645#include <alphamap_pars_fragment> 3646#include <alphatest_pars_fragment> 3647#include <alphahash_pars_fragment> 3648#include <aomap_pars_fragment> 3649#include <lightmap_pars_fragment> 3650#include <emissivemap_pars_fragment> 3651#include <gradientmap_pars_fragment> 3652#include <fog_pars_fragment> 3653#include <bsdfs> 3654#include <lights_pars_begin> 3655#include <normal_pars_fragment> 3656#include <lights_toon_pars_fragment> 3657#include <shadowmap_pars_fragment> 3658#include <bumpmap_pars_fragment> 3659#include <normalmap_pars_fragment> 3660#include <logdepthbuf_pars_fragment> 3661#include <clipping_planes_pars_fragment> 3662void main() { 3663 vec4 diffuseColor = vec4( diffuse, opacity ); 3664 #include <clipping_planes_fragment> 3665 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3666 vec3 totalEmissiveRadiance = emissive; 3667 #include <logdepthbuf_fragment> 3668 #include <map_fragment> 3669 #include <color_fragment> 3670 #include <alphamap_fragment> 3671 #include <alphatest_fragment> 3672 #include <alphahash_fragment> 3673 #include <normal_fragment_begin> 3674 #include <normal_fragment_maps> 3675 #include <emissivemap_fragment> 3676 #include <lights_toon_fragment> 3677 #include <lights_fragment_begin> 3678 #include <lights_fragment_maps> 3679 #include <lights_fragment_end> 3680 #include <aomap_fragment> 3681 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3682 #include <opaque_fragment> 3683 #include <tonemapping_fragment> 3684 #include <colorspace_fragment> 3685 #include <fog_fragment> 3686 #include <premultiplied_alpha_fragment> 3687 #include <dithering_fragment> 3688}`,n7e=`uniform float size; 3689uniform float scale; 3690#include <common> 3691#include <color_pars_vertex> 3692#include <fog_pars_vertex> 3693#include <morphtarget_pars_vertex> 3694#include <logdepthbuf_pars_vertex> 3695#include <clipping_planes_pars_vertex> 3696#ifdef USE_POINTS_UV 3697 varying vec2 vUv; 3698 uniform mat3 uvTransform; 3699#endif 3700void main() { 3701 #ifdef USE_POINTS_UV 3702 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3703 #endif 3704 #include <color_vertex> 3705 #include <morphinstance_vertex> 3706 #include <morphcolor_vertex> 3707 #include <begin_vertex> 3708 #include <morphtarget_vertex> 3709 #include <project_vertex> 3710 gl_PointSize = size; 3711 #ifdef USE_SIZEATTENUATION 3712 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3713 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3714 #endif 3715 #include <logdepthbuf_vertex> 3716 #include <clipping_planes_vertex> 3717 #include <worldpos_vertex> 3718 #include <fog_vertex> 3719}`,r7e=`uniform vec3 diffuse; 3720uniform float opacity; 3721#include <common> 3722#include <color_pars_fragment> 3723#include <map_particle_pars_fragment> 3724#include <alphatest_pars_fragment> 3725#include <alphahash_pars_fragment> 3726#include <fog_pars_fragment> 3727#include <logdepthbuf_pars_fragment> 3728#include <clipping_planes_pars_fragment> 3729void main() { 3730 vec4 diffuseColor = vec4( diffuse, opacity ); 3731 #include <clipping_planes_fragment> 3732 vec3 outgoingLight = vec3( 0.0 ); 3733 #include <logdepthbuf_fragment> 3734 #include <map_particle_fragment> 3735 #include <color_fragment> 3736 #include <alphatest_fragment> 3737 #include <alphahash_fragment> 3738 outgoingLight = diffuseColor.rgb; 3739 #include <opaque_fragment> 3740 #include <tonemapping_fragment> 3741 #include <colorspace_fragment> 3742 #include <fog_fragment> 3743 #include <premultiplied_alpha_fragment> 3744}`,i7e=`#include <common> 3745#include <batching_pars_vertex> 3746#include <fog_pars_vertex> 3747#include <morphtarget_pars_vertex> 3748#include <skinning_pars_vertex> 3749#include <logdepthbuf_pars_vertex> 3750#include <shadowmap_pars_vertex> 3751void main() { 3752 #include <batching_vertex> 3753 #include <beginnormal_vertex> 3754 #include <morphinstance_vertex> 3755 #include <morphnormal_vertex> 3756 #include <skinbase_vertex> 3757 #include <skinnormal_vertex> 3758 #include <defaultnormal_vertex> 3759 #include <begin_vertex> 3760 #include <morphtarget_vertex> 3761 #include <skinning_vertex> 3762 #include <project_vertex> 3763 #include <logdepthbuf_vertex> 3764 #include <worldpos_vertex> 3765 #include <shadowmap_vertex> 3766 #include <fog_vertex> 3767}`,s7e=`uniform vec3 color; 3768uniform float opacity; 3769#include <common> 3770#include <fog_pars_fragment> 3771#include <bsdfs> 3772#include <lights_pars_begin> 3773#include <logdepthbuf_pars_fragment> 3774#include <shadowmap_pars_fragment> 3775#include <shadowmask_pars_fragment> 3776void main() { 3777 #include <logdepthbuf_fragment> 3778 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3779 #include <tonemapping_fragment> 3780 #include <colorspace_fragment> 3781 #include <fog_fragment> 3782 #include <premultiplied_alpha_fragment> 3783}`,a7e=`uniform float rotation; 3784uniform vec2 center; 3785#include <common> 3786#include <uv_pars_vertex> 3787#include <fog_pars_vertex> 3788#include <logdepthbuf_pars_vertex> 3789#include <clipping_planes_pars_vertex> 3790void main() { 3791 #include <uv_vertex> 3792 vec4 mvPosition = modelViewMatrix[ 3 ]; 3793 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3794 #ifndef USE_SIZEATTENUATION 3795 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3796 if ( isPerspective ) scale *= - mvPosition.z; 3797 #endif 3798 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3799 vec2 rotatedPosition; 3800 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3801 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3802 mvPosition.xy += rotatedPosition; 3803 gl_Position = projectionMatrix * mvPosition; 3804 #include <logdepthbuf_vertex> 3805 #include <clipping_planes_vertex> 3806 #include <fog_vertex> 3807}`,o7e=`uniform vec3 diffuse; 3808uniform float opacity; 3809#include <common> 3810#include <uv_pars_fragment> 3811#include <map_pars_fragment> 3812#include <alphamap_pars_fragment> 3813#include <alphatest_pars_fragment> 3814#include <alphahash_pars_fragment> 3815#include <fog_pars_fragment> 3816#include <logdepthbuf_pars_fragment> 3817#include <clipping_planes_pars_fragment> 3818void main() { 3819 vec4 diffuseColor = vec4( diffuse, opacity ); 3820 #include <clipping_planes_fragment> 3821 vec3 outgoingLight = vec3( 0.0 ); 3822 #include <logdepthbuf_fragment> 3823 #include <map_fragment> 3824 #include <alphamap_fragment> 3825 #include <alphatest_fragment> 3826 #include <alphahash_fragment> 3827 outgoingLight = diffuseColor.rgb; 3828 #include <opaque_fragment> 3829 #include <tonemapping_fragment> 3830 #include <colorspace_fragment> 3831 #include <fog_fragment> 3832}`,Zr={alphahash_fragment:N8e,alphahash_pars_fragment:M8e,alphamap_fragment:k8e,alphamap_pars_fragment:R8e,alphatest_fragment:P8e,alphatest_pars_fragment:L8e,aomap_fragment:O8e,aomap_pars_fragment:D8e,batching_pars_vertex:j8e,batching_vertex:I8e,begin_vertex:F8e,beginnormal_vertex:U8e,bsdfs:B8e,iridescence_fragment:V8e,bumpmap_pars_fragment:z8e,clipping_planes_fragment:G8e,clipping_planes_pars_fragment:q8e,clipping_planes_pars_vertex:$8e,clipping_planes_vertex:H8e,color_fragment:W8e,color_pars_fragment:X8e,color_pars_vertex:Y8e,color_vertex:Q8e,common:K8e,cube_uv_reflection_fragment:Z8e,defaultnormal_vertex:J8e,displacementmap_pars_vertex:eRe,displacementmap_vertex:tRe,emissivemap_fragment:nRe,emissivemap_pars_fragment:rRe,colorspace_fragment:iRe,colorspace_pars_fragment:sRe,envmap_fragment:aRe,envmap_common_pars_fragment:oRe,envmap_pars_fragment:lRe,envmap_pars_vertex:cRe,envmap_physical_pars_fragment:yRe,envmap_vertex:uRe,fog_vertex:dRe,fog_pars_vertex:hRe,fog_fragment:fRe,fog_pars_fragment:pRe,gradientmap_pars_fragment:mRe,lightmap_pars_fragment:gRe,lights_lambert_fragment:ARe,lights_lambert_pars_fragment:x
vendor: 5,093 bytes, line 3832
3832Re,lights_pars_begin:vRe,lights_toon_fragment:bRe,lights_toon_pars_fragment:wRe,lights_phong_fragment:_Re,lights_phong_pars_fragment:SRe,lights_physical_fragment:TRe,lights_physical_pars_fragment:ERe,lights_fragment_begin:CRe,lights_fragment_maps:NRe,lights_fragment_end:MRe,lightprobes_pars_fragment:kRe,logdepthbuf_fragment:RRe,logdepthbuf_pars_fragment:PRe,logdepthbuf_pars_vertex:LRe,logdepthbuf_vertex:ORe,map_fragment:DRe,map_pars_fragment:jRe,map_particle_fragment:IRe,map_particle_pars_fragment:FRe,metalnessmap_fragment:URe,metalnessmap_pars_fragment:BRe,morphinstance_vertex:VRe,morphcolor_vertex:zRe,morphnormal_vertex:GRe,morphtarget_pars_vertex:qRe,morphtarget_vertex:$Re,normal_fragment_begin:HRe,normal_fragment_maps:WRe,normal_pars_fragment:XRe,normal_pars_vertex:YRe,normal_vertex:QRe,normalmap_pars_fragment:KRe,clearcoat_normal_fragment_begin:ZRe,clearcoat_normal_fragment_maps:JRe,clearcoat_pars_fragment:ePe,iridescence_pars_fragment:tPe,opaque_fragment:nPe,packing:rPe,premultiplied_alpha_fragment:iPe,project_vertex:sPe,dithering_fragment:aPe,dithering_pars_fragment:oPe,roughnessmap_fragment:lPe,roughnessmap_pars_fragment:cPe,shadowmap_pars_fragment:uPe,shadowmap_pars_vertex:dPe,shadowmap_vertex:hPe,shadowmask_pars_fragment:fPe,skinbase_vertex:pPe,skinning_pars_vertex:mPe,skinning_vertex:gPe,skinnormal_vertex:APe,specularmap_fragment:xPe,specularmap_pars_fragment:vPe,tonemapping_fragment:yPe,tonemapping_pars_fragment:bPe,transmission_fragment:wPe,transmission_pars_fragment:_Pe,uv_pars_fragment:SPe,uv_pars_vertex:TPe,uv_vertex:EPe,worldpos_vertex:CPe,background_vert:NPe,background_frag:MPe,backgroundCube_vert:kPe,backgroundCube_frag:RPe,cube_vert:PPe,cube_frag:LPe,depth_vert:OPe,depth_frag:DPe,distance_vert:jPe,distance_frag:IPe,equirect_vert:FPe,equirect_frag:UPe,linedashed_vert:BPe,linedashed_frag:VPe,meshbasic_vert:zPe,meshbasic_frag:GPe,meshlambert_vert:qPe,meshlambert_frag:$Pe,meshmatcap_vert:HPe,meshmatcap_frag:WPe,meshnormal_vert:XPe,meshnormal_frag:YPe,meshphong_vert:QPe,meshphong_frag:KPe,meshphysical_vert:ZPe,meshphysical_frag:JPe,meshtoon_vert:e7e,meshtoon_frag:t7e,points_vert:n7e,points_frag:r7e,shadow_vert:i7e,shadow_frag:s7e,sprite_vert:a7e,sprite_frag:o7e},Bn={common:{diffuse:{value:new tr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Gr},alphaMap:{value:null},alphaMapTransform:{value:new Gr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Gr}},envmap:{envMap:{value:null},envMapRotation:{value:new Gr},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Gr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Gr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Gr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Gr},normalScale:{value:new Jt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Gr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Gr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Gr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Gr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tr(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 Ve},probesMax:{value:new Ve},probesResolution:{value:new Ve}},points:{diffuse:{value:new tr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Gr},alphaTest:{value:0},uvTransform:{value:new Gr}},sprite:{diffuse:{value:new tr(16777215)},opacity:{value:1},center:{value:new Jt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Gr},alphaMap:{value:null},alphaMapTransform:{value:new Gr},alphaTest:{value:0}}}
vendor: 5,463 bytes, line 3832
3832,Ou={basic:{uniforms:Kc([Bn.common,Bn.specularmap,Bn.envmap,Bn.aomap,Bn.lightmap,Bn.fog]),vertexShader:Zr.meshbasic_vert,fragmentShader:Zr.meshbasic_frag},lambert:{uniforms:Kc([Bn.common,Bn.specularmap,Bn.envmap,Bn.aomap,Bn.lightmap,Bn.emissivemap,Bn.bumpmap,Bn.normalmap,Bn.displacementmap,Bn.fog,Bn.lights,{emissive:{value:new tr(0)},envMapIntensity:{value:1}}]),vertexShader:Zr.meshlambert_vert,fragmentShader:Zr.meshlambert_frag},phong:{uniforms:Kc([Bn.common,Bn.specularmap,Bn.envmap,Bn.aomap,Bn.lightmap,Bn.emissivemap,Bn.bumpmap,Bn.normalmap,Bn.displacementmap,Bn.fog,Bn.lights,{emissive:{value:new tr(0)},specular:{value:new tr(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Zr.meshphong_vert,fragmentShader:Zr.meshphong_frag},standard:{uniforms:Kc([Bn.common,Bn.envmap,Bn.aomap,Bn.lightmap,Bn.emissivemap,Bn.bumpmap,Bn.normalmap,Bn.displacementmap,Bn.roughnessmap,Bn.metalnessmap,Bn.fog,Bn.lights,{emissive:{value:new tr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Zr.meshphysical_vert,fragmentShader:Zr.meshphysical_frag},toon:{uniforms:Kc([Bn.common,Bn.aomap,Bn.lightmap,Bn.emissivemap,Bn.bumpmap,Bn.normalmap,Bn.displacementmap,Bn.gradientmap,Bn.fog,Bn.lights,{emissive:{value:new tr(0)}}]),vertexShader:Zr.meshtoon_vert,fragmentShader:Zr.meshtoon_frag},matcap:{uniforms:Kc([Bn.common,Bn.bumpmap,Bn.normalmap,Bn.displacementmap,Bn.fog,{matcap:{value:null}}]),vertexShader:Zr.meshmatcap_vert,fragmentShader:Zr.meshmatcap_frag},points:{uniforms:Kc([Bn.points,Bn.fog]),vertexShader:Zr.points_vert,fragmentShader:Zr.points_frag},dashed:{uniforms:Kc([Bn.common,Bn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Zr.linedashed_vert,fragmentShader:Zr.linedashed_frag},depth:{uniforms:Kc([Bn.common,Bn.displacementmap]),vertexShader:Zr.depth_vert,fragmentShader:Zr.depth_frag},normal:{uniforms:Kc([Bn.common,Bn.bumpmap,Bn.normalmap,Bn.displacementmap,{opacity:{value:1}}]),vertexShader:Zr.meshnormal_vert,fragmentShader:Zr.meshnormal_frag},sprite:{uniforms:Kc([Bn.sprite,Bn.fog]),vertexShader:Zr.sprite_vert,fragmentShader:Zr.sprite_frag},background:{uniforms:{uvTransform:{value:new Gr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Zr.background_vert,fragmentShader:Zr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Gr}},vertexShader:Zr.backgroundCube_vert,fragmentShader:Zr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Zr.cube_vert,fragmentShader:Zr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Zr.equirect_vert,fragmentShader:Zr.equirect_frag},distance:{uniforms:Kc([Bn.common,Bn.displacementmap,{referencePosition:{value:new Ve},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Zr.distance_vert,fragmentShader:Zr.distance_frag},shadow:{uniforms:Kc([Bn.lights,Bn.fog,{color:{value:new tr(0)},opacity:{value:1}}]),vertexShader:Zr.shadow_vert,fragmentShader:Zr.shadow_frag}};Ou.physical={uniforms:Kc([Ou.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Gr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Gr},clearcoatNormalScale:{value:new Jt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Gr},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Gr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Gr},sheen:{value:0},sheenColor:{value:new tr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Gr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Gr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Gr},transmissionSamplerSize:{value:new Jt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Gr},attenuationDistance:{value:0},attenuationColor:{value:new tr(0)},specularColor:{value:new tr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Gr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Gr},anisotropyVector:{value:new Jt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Gr}}]),vertexShader:Zr.meshphysical_vert,fragmentShader:Zr.meshphysical_frag};const yC={r:0,b:0,g:0},l7e=new kr,Aue=new Gr;Aue.set(-1,0,0,0,1,0,0,0,1);function c7e(n,e,t,r,i,s){const a=new tr(0);let o=i===!0?0:1,l,u,d=null,h=0,f=null;function p(_){let M=_.isScene===!0?_.background:null;if(M&&M.isTexture){const T=_.backgroundBlurriness>0;M=e.get(M,T)}return M}function g(_){let M=!1;const T=p(_);T===null?x(a,o):T&&T.isColor&&(x(T,1),M=!0);const L=n.xr.getEnvironmentBlendMode();L==="additive"?t.buffers.color.setClear(0,0,0,1,s):L==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,s),(n.autoClear||M)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function A(_,M){const T=p(M);T&&(T.isCubeTexture||T.mapping===E1)?(u===void 0&&(u=new ns(new W1(1,1,1),new Nc({name:"Backgroun
3832dCubeMaterial",uniforms:qw(Ou.backgroundCube.uniforms),vertexShader:Ou.backgroundCube.vertexShader,fragmentShader:Ou.backgroundCube.fragmentShader,side:us,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(L,D,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=T,u.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(l7e.makeRotationFromEuler(M.backgroundRotation)).transpose(),T.isCubeTexture&&T.isRenderTargetTexture===!1&&u.material.uniforms.backgroundRotation.value.premultiply(Aue),u.material.toneMapped=_r.getTransfer(T.colorSpace)!==$n,(d!==T||h!==T.version||f!==n.toneMapping)&&(u.material.needsUpdate=!0,d=T,h=T.version,f=n.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null)):T&&T.isTexture&&(l===void 0&&(l=new ns(new ET(2,2),new Nc({name:"BackgroundMaterial",uniforms:qw(Ou.background.uniforms),vertexShader:Ou.background.vertexShader,fragmentShader:Ou.background.fragmentShader,side:mu,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=T,l.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,l.material.toneMapped=_r.getTransfer(T.colorSpace)!==$n,T.matrixAutoUpdate===!0&&T.updateMatrix(),l.material.uniforms.uvTransform.value.copy(T.matrix),(d!==T||h!==T.version||f!==n.toneMapping)&&(l.material.needsUpdate=!0,d=T,h=T.version,f=n.toneMapping),l.layers.enableAll(),_.unshift(l,l.geometry,l.material,0,0,null))}function x(_,M){_.getRGB(yC,lue(n)),t.buffers.color.setClear(yC.r,yC.g,yC.b,M,s)}function b(){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(_,M=1){a.set(_),o=M,x(a,o)},getClearAlpha:function(){return o},setClearAlpha:function(_){o=_,x(a,o)},render:g,addToRenderList:A,dispose:b}}function u7e(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),r={},i=f(null);let s=i,a=!1;function o(B,z,H,X,W){let J=!1;const ee=h(B,X,H,z);s!==ee&&(s=ee,u(s.object)),J=p(B,X,H,W),J&&g(B,X,H,W),W!==null&&e.update(W,n.ELEMENT_ARRAY_BUFFER),(J||a)&&(a=!1,T(B,z,H,X),W!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function l(){return n.createVertexArray()}function u(B){return n.bindVertexArray(B)}function d(B){return n.deleteVertexArray(B)}function h(B,z,H,X){const W=X.wireframe===!0;let J=r[z.id];J===void 0&&(J={},r[z.id]=J);const ee=B.isInstancedMesh===!0?B.id:0;let ae=J[ee];ae===void 0&&(ae={},J[ee]=ae);let le=ae[H.id];le===void 0&&(le={},ae[H.id]=le);let Z=le[W];return Z===void 0&&(Z=f(l()),le[W]=Z),Z}function f(B){const z=[],H=[],X=[];for(let W=0;W<t;W++)z[W]=0,H[W]=0,X[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:z,enabledAttributes:H,attributeDivisors:X,object:B,attributes:{},index:null}}function p(B,z,H,X){const W=s.attributes,J=z.attributes;let ee=0;const ae=H.getAttributes();for(const le in ae)if(ae[le].location>=0){const Y=W[le];let re=J[le];if(re===void 0&&(le==="instanceMatrix"&&B.instanceMatrix&&(re=B.instanceMatrix),le==="instanceColor"&&B.instanceColor&&(re=B.instanceColor)),Y===void 0||Y.attribute!==re||re&&Y.data!==re.data)return!0;ee++}return s.attributesNum!==ee||s.index!==X}function g(B,z,H,X){const W={},J=z.attributes;let ee=0;const ae=H.getAttributes();for(const le in ae)if(ae[le].location>=0){let Y=J[le];Y===void 0&&(le==="instanceMatrix"&&B.instanceMatrix&&(Y=B.instanceMatrix),le==="instanceColor"&&B.instanceColor&&(Y=B.instanceColor));const re={};re.attribute=Y,Y&&Y.data&&(re.data=Y.data),W[le]=re,ee++}s.attributes=W,s.attributesNum=ee,s.index=X}function A(){const B=s.newAttributes;for(let z=0,H=B.length;z<H;z++)B[z]=0}function x(B){b(B,0)}function b(B,z){const H=s.newAttributes,X=s.enabledAttributes,W=s.attributeDivisors;
vendor: 10,119 bytes, line 3832
3832H[B]=1,X[B]===0&&(n.enableVertexAttribArray(B),X[B]=1),W[B]!==z&&(n.vertexAttribDivisor(B,z),W[B]=z)}function _(){const B=s.newAttributes,z=s.enabledAttributes;for(let H=0,X=z.length;H<X;H++)z[H]!==B[H]&&(n.disableVertexAttribArray(H),z[H]=0)}function M(B,z,H,X,W,J,ee){ee===!0?n.vertexAttribIPointer(B,z,H,W,J):n.vertexAttribPointer(B,z,H,X,W,J)}function T(B,z,H,X){A();const W=X.attributes,J=H.getAttributes(),ee=z.defaultAttributeValues;for(const ae in J){const le=J[ae];if(le.location>=0){let Z=W[ae];if(Z===void 0&&(ae==="instanceMatrix"&&B.instanceMatrix&&(Z=B.instanceMatrix),ae==="instanceColor"&&B.instanceColor&&(Z=B.instanceColor)),Z!==void 0){const Y=Z.normalized,re=Z.itemSize,_e=e.get(Z);if(_e===void 0)continue;const Ee=_e.buffer,Ae=_e.type,te=_e.bytesPerElement,ve=Ae===n.INT||Ae===n.UNSIGNED_INT||Z.gpuType===oo;if(Z.isInterleavedBufferAttribute){const we=Z.data,Ue=we.stride,ze=Z.offset;if(we.isInstancedInterleavedBuffer){for(let yt=0;yt<le.locationSize;yt++)b(le.location+yt,we.meshPerAttribute);B.isInstancedMesh!==!0&&X._maxInstanceCount===void 0&&(X._maxInstanceCount=we.meshPerAttribute*we.count)}else for(let yt=0;yt<le.locationSize;yt++)x(le.location+yt);n.bindBuffer(n.ARRAY_BUFFER,Ee);for(let yt=0;yt<le.locationSize;yt++)M(le.location+yt,re/le.locationSize,Ae,Y,Ue*te,(ze+re/le.locationSize*yt)*te,ve)}else{if(Z.isInstancedBufferAttribute){for(let we=0;we<le.locationSize;we++)b(le.location+we,Z.meshPerAttribute);B.isInstancedMesh!==!0&&X._maxInstanceCount===void 0&&(X._maxInstanceCount=Z.meshPerAttribute*Z.count)}else for(let we=0;we<le.locationSize;we++)x(le.location+we);n.bindBuffer(n.ARRAY_BUFFER,Ee);for(let we=0;we<le.locationSize;we++)M(le.location+we,re/le.locationSize,Ae,Y,re*te,re/le.locationSize*we*te,ve)}}else if(ee!==void 0){const Y=ee[ae];if(Y!==void 0)switch(Y.length){case 2:n.vertexAttrib2fv(le.location,Y);break;case 3:n.vertexAttrib3fv(le.location,Y);break;case 4:n.vertexAttrib4fv(le.location,Y);break;default:n.vertexAttrib1fv(le.location,Y)}}}}_()}function L(){F();for(const B in r){const z=r[B];for(const H in z){const X=z[H];for(const W in X){const J=X[W];for(const ee in J)d(J[ee].object),delete J[ee];delete X[W]}}delete r[B]}}function D(B){if(r[B.id]===void 0)return;const z=r[B.id];for(const H in z){const X=z[H];for(const W in X){const J=X[W];for(const ee in J)d(J[ee].object),delete J[ee];delete X[W]}}delete r[B.id]}function P(B){for(const z in r){const H=r[z];for(const X in H){const W=H[X];if(W[B.id]===void 0)continue;const J=W[B.id];for(const ee in J)d(J[ee].object),delete J[ee];delete W[B.id]}}}function O(B){for(const z in r){const H=r[z],X=B.isInstancedMesh===!0?B.id:0,W=H[X];if(W!==void 0){for(const J in W){const ee=W[J];for(const ae in ee)d(ee[ae].object),delete ee[ae];delete W[J]}delete H[X],Object.keys(H).length===0&&delete r[z]}}}function F(){U(),a=!0,s!==i&&(s=i,u(s.object))}function U(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:F,resetDefaultState:U,dispose:L,releaseStatesOfGeometry:D,releaseStatesOfObject:O,releaseStatesOfProgram:P,initAttributes:A,enableAttribute:x,disableUnusedAttributes:_}}function d7e(n,e,t){let r;function i(l){r=l}function s(l,u){n.drawArrays(r,l,u),t.update(u,r,1)}function a(l,u,d){d!==0&&(n.drawArraysInstanced(r,l,u,d),t.update(u,r,d))}function o(l,u,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,l,0,u,0,d);let f=0;for(let p=0;p<d;p++)f+=u[p];t.update(f,r,1)}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o}function h7e(n,e,t,r){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const P=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(P){return!(P!==to&&r.convert(P)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(P){const O=P===Js&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(P!==Zs&&r.convert(P)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&P!==ia&&!O)}function l(P){if(P==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=t.precision!==void 0?t.precision:"highp";const d=l(u);d!==u&&(an("WebGLRenderer:",u,"not supported, using",d,"instead."),u=d);const h=t.logarithmicDepthBuffer===!0,f=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control");t.reversedDepthBuffer===!0&&f===!1&&an("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const p=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=n.getParameter(n.MAX_TEXTURE_SIZE),x=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),b=n.getParameter(n.MAX_VERTEX_ATTRIBS),_=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),M=n.getParameter(n.MAX_VARYING_VECTORS),T=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),L=n.getParameter(n.MAX_SAMPLES),D=n.getParameter(n.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:u,logarithmicDepthBuffer:h,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:g,maxTextureSize:A,maxCubemapSize:x,maxAttributes:b,maxVertexUniforms:_,maxVaryings:M,maxFragmentUniforms:T,maxSamples:L,samples:D}}function f7e(n){const e=this;let t=null,r=0,i=!1,s=!1;const a=new Xp,o=new Gr,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const p=h.length!==0||f||r!==0||i;return i=f,r=h.length,p},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,f){t=d(h,f,0)},this.setState=function(h,f,p){const g=h.clippingPlanes,A=h.clipIntersection,x=h.clipShadows,b=n.get(h);if(!i||g===null||g.length===0||s&&!x)s?d(null):u();else{const _=s?0:r,M=_*4;let T=b.clippingState||null;l.value=T,T=d(g,f,M,p);for(let L=0;L!==M;++L)T[L]=t[L];b.clippingState=T,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function d(h,f,p,g){const A=h!==null?h.length:0;let x=null;if(A!==0){if(x=l.value,g!==!0||x===null){const b=p+A*4,_=f.matrixWorldInverse;o.getNormalMatrix(_),(x===null||x.length<b)&&(x=new Float32Array(b));for(let M=0,T=p;M!==A;++M,T+=4)a.copy(h[M]).applyMatrix4(_,o),a.normal.toArray(x,T),x[T+3]=a.constant}l.value=x,l.needsUpdate=!0}return e.numPlanes=A,e.numIntersection=0,x}}const YA=4,FQ=[.125,.215,.35,.446,.526,.582],Zx=20,p7e=256,E3=new S_,UQ=new tr;let q9=null,$9=0,H9=0,W9=!1;const m7e=new Ve;let BQ=class{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,t=0,r=.1,i=100,s={}){const{size:a=256,position:o=m7e}=s;q9=this._renderer.getRenderTarget(),$9=this._renderer.getActiveCubeFace(),H9=this._renderer.getActiveMipmapLevel(),W9=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,r,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=GQ(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=zQ(),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(q9,$9,H9),this._renderer.xr.enabled=W9,e.scissorTest=!1,x2(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===np||e.mapping===R0?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),q9=this._renderer.getRenderTarget(),$9=this._renderer.getActiveCubeFace(),H9=this._renderer.getActiveMipmapLevel(),W9=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:bs,minFilter:bs,generateMipmaps:!1,type:Js,format:to,colorSpace:Uw,depthBuffer:!1},i=VQ(e,t,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=VQ(e,t,r);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=g7e(s)),this._blurMaterial=x7e(s,e,t),this._ggxMaterial=A7e(s,e,t)}return i}_compileMaterial(e){const t=new ns(new ds,e);this._renderer.compile(t,E3)}_sceneToCubeUV(e,t,r,i,s){const l=new ul(90,1,t,r),u=[1,-1,1,1,1,1],d=[1,1,1,-1,-1,-1],h=this._renderer,f=h.autoClear,p=h.toneMapping;h.getClearColor(UQ),h.toneMapping=Il,h.autoClear=!1,h.state.buffers.depth.getReversed()&&(h.setRenderTarget(i),h.clearDepth(),h.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new ns(new W1,new Lh({name:"PMREM.Backgroun
3832d",side:us,depthWrite:!1,depthTest:!1})));const A=this._backgroundBox,x=A.material;let b=!1;const _=e.background;_?_.isColor&&(x.color.copy(_),e.background=null,b=!0):(x.color.copy(UQ),b=!0);for(let M=0;M<6;M++){const T=M%3;T===0?(l.up.set(0,u[M],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+d[M],s.y,s.z)):T===1?(l.up.set(0,0,u[M]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+d[M],s.z)):(l.up.set(0,u[M],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+d[M]));const L=this._cubeSize;x2(i,T*L,M>2?L:0,L,L),h.setRenderTarget(i),b&&h.render(A,l),h.render(e,l)}h.toneMapping=p,h.autoClear=f,e.background=_}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===np||e.mapping===R0;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=GQ()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=zQ());const s=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=s;const o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;x2(t,0,0,3*l,2*l),r.setRenderTarget(t),r.render(a,E3)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const i=this._lodMeshes.length;for(let s=1;s<i;s++)this._applyGGXFilter(e,s-1,s);t.autoClear=r}_applyGGXFilter(e,t,r){const i=this._renderer,s=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[r];o.material=a;const l=a.uniforms,u=r/(this._lodMeshes.length-1),d=t/(this._lodMeshes.length-1),h=Math.sqrt(u*u-d*d),f=0+u*1.25,p=h*f,{_lodMax:g}=this,A=this._sizeLods[r],x=3*A*(r>g-YA?r-g+YA:0),b=4*(this._cubeSize-A);l.envMap.value=e.texture,l.roughness.value=p,l.mipInt.value=g-t,x2(s,x,b,3*A,2*A),i.setRenderTarget(s),i.render(o,E3),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-r,x2(e,x,b,3*A,2*A),i.setRenderTarget(e),i.render(o,E3)}_blur(e,t,r,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,r,i,"latitudinal",s),this._halfBlur(a,e,r,r,i,"longitudinal",s)}_halfBlur(e,t,r,i,s,a,o){const l=this._renderer,u=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&sn("blur direction must be either latitudinal or longitudinal!");const d=3,h=this._lodMeshes[i];h.material=u;const f=u.uniforms,p=this._sizeLods[r]-1,g=isFinite(s)?Math.PI/(2*p):2*Math.PI/(2*Zx-1),A=s/g,x=isFinite(s)?1+Math.floor(d*A):Zx;x>Zx&&an(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Zx}`);const b=[];let _=0;for(let P=0;P<Zx;++P){const O=P/A,F=Math.exp(-O*O/2);b.push(F),P===0?_+=F:P<x&&(_+=2*F)}for(let P=0;P<b.length;P++)b[P]=b[P]/_;f.envMap.value=e.texture,f.samples.value=x,f.weights.value=b,f.latitudinal.value=a==="latitudinal",o&&(f.poleAxis.value=o);const{_lodMax:M}=this;f.dTheta.value=g,f.mipInt.value=M-r;const T=this._sizeLods[i],L=3*T*(i>M-YA?i-M+YA:0),D=4*(this._cubeSize-T);x2(t,L,D,3*T,2*T),l.setRenderTarget(t),l.render(h,E3)}};function g7e(n){const e=[],t=[],r=[];let i=n;const s=n-YA+1+FQ.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);e.push(o);let l=1/o;a>n-YA?l=FQ[a-n+YA-1]:a===0&&(l=0),t.push(l);const u=1/(o-2),d=-u,h=1+u,f=[d,d,h,d,h,h,d,d,h,h,d,h],p=6,g=6,A=3,x=2,b=1,_=new Float32Array(A*g*p),M=new Float32Array(x*g*p),T=new Float32Array(b*g*p);for(let D=0;D<p;D++){const P=D%3*2/3-1,O=D>2?0:-1,F=[P,O,0,P+2/3,O,0,P+2/3,O+1,0,P,O,0,P+2/3,O+1,0,P,O+1,0];_.set(F,A*g*D),M.set(f,x*g*D);const U=[D,D,D,D,D,D];T.set(U,b*g*D)}const L=new ds;L.setAttribute("position",new Ea(_,A)),L.setAttribute("uv",new Ea(M,x)),L.setAttribute("faceIndex",new Ea(T,b)),r.push(new ns(L,null)),i>YA&&i--}return{lodMeshes:r,sizeLods:e,sigmas:t}}function VQ(n,e,t){const r=new Kf(n,e,t);return r.texture.mapping=E1,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function x2(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function A7e(n,e,t){return new Nc({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:p7e,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:J8(),fragmentShader:` 3833 3834 precision highp float; 3835 precision highp int; 3836 3837 varying vec3 vOutputDirection; 3838 3839 uniform sampler2D envMap; 3840 uniform float roughness; 3841 uniform float mipInt; 3842 3843 #define ENVMAP_TYPE_CUBE_UV 3844 #include <cube_uv_reflection_fragment> 3845 3846 #define PI 3.14159265359 3847 3848 // Van der Corput radical inverse 3849 float radicalInverse_VdC(uint bits) { 3850 bits = (bits << 16u) | (bits >> 16u); 3851 bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); 3852 bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); 3853 bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); 3854 bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); 3855 return float(bits) * 2.3283064365386963e-10; // / 0x100000000 3856 } 3857 3858 // Hammersley sequence 3859 vec2 hammersley(uint i, uint N) { 3860 return vec2(float(i) / float(N), radicalInverse_VdC(i)); 3861 } 3862 3863 // GGX VNDF importance sampling (Eric Heitz 2018) 3864 // "Sampling the GGX Distribution of Visible Normals" 3865 // https://jcgt.org/published/0007/04/01/ 3866 vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { 3867 float alpha = roughness * roughness; 3868 3869 // Section 4.1: Orthonormal basis 3870 vec3 T1 = vec3(1.0, 0.0, 0.0); 3871 vec3 T2 = cross(V, T1); 3872 3873 // Section 4.2: Parameterization of projected area 3874 float r = sqrt(Xi.x); 3875 float phi = 2.0 * PI * Xi.y; 3876 float t1 = r * cos(phi); 3877 float t2 = r * sin(phi); 3878 float s = 0.5 * (1.0 + V.z); 3879 t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; 3880 3881 // Section 4.3: Reprojection onto hemisphere 3882 vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; 3883 3884 // Section 3.4: Transform back to ellipsoid configuration 3885 return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); 3886 } 3887 3888 void main() { 3889 vec3 N = normalize(vOutputDirection); 3890 vec3 V = N; // Assume view direction equals normal for pre-filtering 3891 3892 vec3 prefilteredColor = vec3(0.0); 3893 float totalWeight = 0.0; 3894 3895 // For very low roughness, just sample the environment directly 3896 if (roughness < 0.001) { 3897 gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); 3898 return; 3899 } 3900 3901 // Tangent space basis for VNDF sampling 3902 vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); 3903 vec3 tangent = normalize(cross(up, N)); 3904 vec3 bitangent = cross(N, tangent); 3905
3906 for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { 3907 vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); 3908 3909 // For PMREM, V = N, so in tangent space V is always (0, 0, 1) 3910 vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); 3911 3912 // Transform H back to world space 3913 vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); 3914 vec3 L = normalize(2.0 * dot(V, H) * H - V); 3915 3916 float NdotL = max(dot(N, L), 0.0); 3917 3918 if(NdotL > 0.0) { 3919 // Sample environment at fixed mip level 3920 // VNDF importance sampling handles the distribution filtering 3921 vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); 3922 3923 // Weight by NdotL for the split-sum approximation 3924 // VNDF PDF naturally accounts for the visible microfacet distribution 3925 prefilteredColor += sampleColor * NdotL; 3926 totalWeight += NdotL; 3927 } 3928 } 3929 3930 if (totalWeight > 0.0) { 3931 prefilteredColor = prefilteredColor / totalWeight; 3932 } 3933 3934 gl_FragColor = vec4(prefilteredColor, 1.0); 3935 } 3936 `,blending:qo,depthTest:!1,depthWrite:!1})}function x7e(n,e,t){const r=new Float32Array(Zx),i=new Ve(0,1,0);return new Nc({name:"SphericalGaussianBlur",defines:{n:Zx,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:J8(),fragmentShader:` 3937 3938 precision mediump float; 3939 precision mediump int; 3940 3941 varying vec3 vOutputDirection; 3942 3943 uniform sampler2D envMap; 3944 uniform int samples; 3945 uniform float weights[ n ]; 3946 uniform bool latitudinal; 3947 uniform float dTheta; 3948 uniform float mipInt; 3949 uniform vec3 poleAxis; 3950 3951 #define ENVMAP_TYPE_CUBE_UV 3952 #include <cube_uv_reflection_fragment> 3953 3954 vec3 getSample( float theta, vec3 axis ) { 3955 3956 float cosTheta = cos( theta ); 3957 // Rodrigues' axis-angle rotation 3958 vec3 sampleDirection = vOutputDirection * cosTheta 3959 + cross( axis, vOutputDirection ) * sin( theta ) 3960 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3961 3962 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3963 3964 } 3965 3966 void main() { 3967 3968 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3969 3970 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3971 3972 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3973 3974 } 3975 3976 axis = normalize( axis ); 3977 3978 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3979 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3980 3981 for ( int i = 1; i < n; i++ ) { 3982 3983 if ( i >= samples ) { 3984 3985 break; 3986 3987 } 3988 3989 float theta = dTheta * float( i ); 3990 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3991 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3992 3993 } 3994 3995 } 3996 `,blending:qo,depthTest:!1,depthWrite:!1})}function zQ(){return new Nc({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:J8(),fragmentShader:` 3997 3998 precision mediump float; 3999 precision mediump int; 4000 4001 varying vec3 vOutputDirection; 4002 4003 uniform sampler2D envMap; 4004 4005 #include <common> 4006 4007 void main() { 4008 4009 vec3 outputDirection = normalize( vOutputDirection ); 4010 vec2 uv = equirectUv( outputDirection ); 4011 4012 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 4013 4014 } 4015 `,blending:qo,depthTest:!1,depthWrite:!1})}function GQ(){return new Nc({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:J8(),fragmentShader:` 4016 4017 precision mediump float; 4018 precision mediump int; 4019 4020 uniform float flipEnvMap; 4021 4022 varying vec3 vOutputDirection; 4023 4024 uniform samplerCube envMap; 4025 4026 void main() { 4027 4028 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 4029 4030 } 4031 `,blending:qo,depthTest:!1,depthWrite:!1})}function J8(){return` 4032 4033 precision mediump float; 4034 precision mediump int; 4035 4036 attribute float faceIndex; 4037 4038 varying vec3 vOutputDirection; 4039 4040 // RH coordinate system; PMREM face-indexing convention 4041 vec3 getDirection( vec2 uv, float face ) { 4042 4043 uv = 2.0 * uv - 1.0; 4044 4045 vec3 direction = vec3( uv, 1.0 ); 4046 4047 if ( face == 0.0 ) { 4048 4049 direction = direction.zyx; // ( 1, v, u ) pos x 4050 4051 } else if ( face == 1.0 ) { 4052 4053 direction = direction.xzy; 4054 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 4055 4056 } else if ( face == 2.0 ) { 4057 4058 direction.x *= -1.0; // ( -u, v, 1 ) pos z 4059 4060 } else if ( face == 3.0 ) { 4061 4062 direction = direction.zyx; 4063 direction.xz *= -1.0; // ( -1, v, -u ) neg x 4064 4065 } else if ( face == 4.0 ) { 4066 4067 direction = direction.xzy; 4068 direction.xy *= -1.0; // ( -u, -1, v ) neg y 4069 4070 } else if ( face == 5.0 ) { 4071 4072 direction.z *= -1.0; // ( u, v, -1 ) neg z 4073 4074 } 4075 4076 return direction; 4077 4078 } 4079 4080 void main() { 4081 4082 vOutputDirection = getDirection( uv, faceIndex ); 4083 gl_Position = vec4( position, 1.0 ); 4084 4085 } 4086 `}class xue extends Kf{constructor(e=1,t={}
vendor: 25,974 bytes, lines 4086-4202
4086){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new __(i),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` 4087 4088 varying vec3 vWorldDirection; 4089 4090 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 4091 4092 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 4093 4094 } 4095 4096 void main() { 4097 4098 vWorldDirection = transformDirection( position, modelMatrix ); 4099 4100 #include <begin_vertex> 4101 #include <project_vertex> 4102 4103 } 4104 `,fragmentShader:` 4105 4106 uniform sampler2D tEquirect; 4107 4108 varying vec3 vWorldDirection; 4109 4110 #include <common> 4111 4112 void main() { 4113 4114 vec3 direction = normalize( vWorldDirection ); 4115 4116 vec2 sampleUV = equirectUv( direction ); 4117 4118 gl_FragColor = texture2D( tEquirect, sampleUV ); 4119 4120 } 4121 `},i=new W1(5,5,5),s=new Nc({name:"CubemapFromEquirect",uniforms:qw(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:us,blending:qo});s.uniforms.tEquirect.value=t;const a=new ns(i,s),o=t.minFilter;return t.minFilter===hu&&(t.minFilter=bs),new fue(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,r=!0,i=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,r,i);e.setRenderTarget(s)}}function v7e(n){let e=new WeakMap,t=new WeakMap,r=null;function i(f,p=!1){return f==null?null:p?a(f):s(f)}function s(f){if(f&&f.isTexture){const p=f.mapping;if(p===Mb||p===kb)if(e.has(f)){const g=e.get(f).texture;return o(g,f.mapping)}else{const g=f.image;if(g&&g.height>0){const A=new xue(g.height);return A.fromEquirectangularTexture(n,f),e.set(f,A),f.addEventListener("dispose",u),o(A.texture,f.mapping)}else return null}}return f}function a(f){if(f&&f.isTexture){const p=f.mapping,g=p===Mb||p===kb,A=p===np||p===R0;if(g||A){let x=t.get(f);const b=x!==void 0?x.texture.pmremVersion:0;if(f.isRenderTargetTexture&&f.pmremVersion!==b)return r===null&&(r=new BQ(n)),x=g?r.fromEquirectangular(f,x):r.fromCubemap(f,x),x.texture.pmremVersion=f.pmremVersion,t.set(f,x),x.texture;if(x!==void 0)return x.texture;{const _=f.image;return g&&_&&_.height>0||A&&_&&l(_)?(r===null&&(r=new BQ(n)),x=g?r.fromEquirectangular(f):r.fromCubemap(f),x.texture.pmremVersion=f.pmremVersion,t.set(f,x),f.addEventListener("dispose",d),x.texture):null}}}return f}function o(f,p){return p===Mb?f.mapping=np:p===kb&&(f.mapping=R0),f}function l(f){let p=0;const g=6;for(let A=0;A<g;A++)f[A]!==void 0&&p++;return p===g}function u(f){const p=f.target;p.removeEventListener("dispose",u);const g=e.get(p);g!==void 0&&(e.delete(p),g.dispose())}function d(f){const p=f.target;p.removeEventListener("dispose",d);const g=t.get(p);g!==void 0&&(t.delete(p),g.dispose())}function h(){e=new WeakMap,t=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:i,dispose:h}}function y7e(n){const e={};function t(r){if(e[r]!==void 0)return e[r];const i=n.getExtension(r);return e[r]=i,i}return{has:function(r){return t(r)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(r){const i=t(r);return i===null&&_i("WebGLRenderer: "+r+" extension not supported."),i}}}function b7e(n,e,t,r){const i={},s=new WeakMap;function a(h){const f=h.target;f.index!==null&&e.remove(f.index);for(const g in f.attributes)e.remove(f.attributes[g]);f.removeEventListener("dispose",a),delete i[f.id];const p=s.get(f);p&&(e.remove(p),s.delete(f)),r.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function o(h,f){return i[f.id]===!0||(f.addEventListener("dispose",a),i[f.id]=!0,t.memory.geometries++),f}function l(h){const f=h.attributes;for(const p in f)e.update(f[p],n.ARRAY_BUFFER)}function u(h){const f=[],p=h.index,g=h.attributes.position;let A=0;if(g===void 0)return;if(p!==null){const _=p.array;A=p.version;for(let M=0,T=_.length;M<T;M+=3){const L=_[M+0],D=_[M+1],P=_[M+2];f.push(L,D,D,P,P,L)}}else{const _=g.array;A=g.version;for(let M=0,T=_.length/3-1;M<T;M+=3){const L=M+0,D=M+1,P=M+2;f.push(L,D,D,P,P,L)}}const x=new(g.count>=65535?WV:HV)(f,1);x.version=A;const b=s.get(h);b&&e.remove(b),s.set(h,x)}function d(h){const f=s.get(h);if(f){const p=h.index;p!==null&&f.version<p.version&&u(h)}else u(h);return s.get(h)}return{get:o,update:l,getWireframeAttribute:d}}function w7e(n,e,t){let r;function i(h){r=h}let s,a;function o(h){s=h.type,a=h.bytesPerElement}function l(h,f){n.drawElements(r,f,s,h*a),t.update(f,r,1)}function u(h,f,p){p!==0&&(n.drawElementsInstanced(r,f,s,h*a,p),t.update(f,r,p))}function d(h,f,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,f,0,s,h,0,p);let A=0;for(let x=0;x<p;x++)A+=f[x];t.update(A,r,1)}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=u,this.renderMultiDraw=d}function _7e(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function r(s,a,o){switch(t.calls++,a){case n.TRIANGLES:t.triangles+=o*(s/3);break;case n.LINES:t.lines+=o*(s/2);break;case n.LINE_STRIP:t.lines+=o*(s-1);break;case n.LINE_LOOP:t.lines+=o*s;break;case n.POINTS:t.points+=o*s;break;default:sn("WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:r}}function S7e(n,e,t){const r=new WeakMap,i=new Rr;function s(a,o,l){const u=a.morphTargetInfluences,d=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,h=d!==void 0?d.length:0;let f=r.get(o);if(f===void 0||f.count!==h){let U=function(){O.dispose(),r.delete(o),o.removeEventListener("dispose",U)};var p=U;f!==void 0&&f.texture.dispose();const g=o.morphAttributes.position!==void 0,A=o.morphAttributes.normal!==void 0,x=o.morphAttributes.color!==void 0,b=o.morphAttributes.position||[],_=o.morphAttributes.normal||[],M=o.morphAttributes.color||[];let T=0;g===!0&&(T=1),A===!0&&(T=2),x===!0&&(T=3);let L=o.attributes.position.count*T,D=1;L>e.maxTextureSize&&(D=Math.ceil(L/e.maxTextureSize),L=e.maxTextureSize);const P=new Float32Array(L*D*4*h),O=new GV(P,L,D,h);O.type=ia,O.needsUpdate=!0;const F=T*4;for(let B=0;B<h;B++){const z=b[B],H=_[B],X=M[B],W=L*D*4*B;for(let J=0;J<z.count;J++){const ee=J*F;g===!0&&(i.fromBufferAttribute(z,J),P[W+ee+0]=i.x,P[W+ee+1]=i.y,P[W+ee+2]=i.z,P[W+ee+3]=0),A===!0&&(i.fromBufferAttribute(H,J),P[W+ee+4]=i.x,P[W+ee+5]=i.y,P[W+ee+6]=i.z,P[W+ee+7]=0),x===!0&&(i.fromBufferAttribute(X,J),P[W+ee+8]=i.x,P[W+ee+9]=i.y,P[W+ee+10]=i.z,P[W+ee+11]=X.itemSize===4?i.w:1)}}f={count:h,texture:O,size:new Jt(L,D)},r.set(o,f),o.addEventListener("dispose",U)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(n,"morphTexture",a.morphTexture,t);else{let g=0;for(let x=0;x<u.length;x++)g+=u[x];const A=o.morphTargetsRelative?1:1-g;l.getUniforms().setValue(n,"morphTargetBaseInfluence",A),l.getUniforms().setValue(n,"morphTargetInfluences",u)}l.getUniforms().setValue(n,"morphTargetsTexture",f.texture,t),l.getUniforms().setValue(n,"morphTargetsTextureSize",f.size)}return{update:s}}function T7e(n,e,t,r,i){let s=new WeakMap;function a(u){const d=i.render.frame,h=u.geometry,f=e.get(u,h);if(s.get(f)!==d&&(e.update(f),s.set(f,d)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),s.get(u)!==d&&(t.update(u.instanceMatrix,n.ARRAY_BUFFER),u.instanceColor!==null&&t.update(u.instanceColor,n.ARRAY_BUFFER),s.set(u,d))),u.isSkinnedMesh){const p=u.skeleton;s.get(p)!==d&&(p.update(),s.set(p,d))}return f}function o(){s=new WeakMap}function l(u){const d=u.target;d.removeEventListener("dispose",l),r.releaseStatesOfObject(d),t.remove(d.instanceMatrix),d.instanceColor!==null&&t.remove(d.instanceColor)}return{update:a,dispose:o}}const E7e={[CV]:"LINEAR_TONE_MAPPING",[NV]:"REINHARD_TONE_MAPPING",[MV]:"CINEON_TONE_MAPPING",[kV]:"ACES_FILMIC_TONE_MAPPING",[RV]:"AGX_TONE_MAPPING",[PV]:"NEUTRAL_TONE_MAPPING",[Bce]:"CUSTOM_TONE_MAPPING"};function C7e(n,e,t,r,i,s){const a=new Kf(e,t,{type:n,depthBuffer:i,stencilBuffer:s,samples:r?4:0,depthTexture:i?new Bl(e,t):void 0}),o=new Kf(e,t,{type:Js,depthBuffer:!1,stencilBuffer:!1}),l=new ds;l.setAttribute("position",new Bi([-1,3,0,-1,-1,0,3,-1,0],3)),l.setAttribute("uv",new Bi([0,2,0,0,2,0],2));const u=new Jke({uniforms:{tDiffuse:{value:null}},vertexShader:` 4122 precision highp float; 4123 4124 uniform mat4 modelViewMatrix; 4125 uniform mat4 projectionMatrix; 4126 4127 attribute vec3 position; 4128 attribute vec2 uv; 4129 4130 varying vec2 vUv; 4131 4132 void main() { 4133 vUv = uv; 4134 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4135 }`,fragmentShader:` 4136 precision highp float; 4137 4138 uniform sampler2D tDiffuse; 4139 4140 varying vec2 vUv; 4141 4142 #include <tonemapping_pars_fragment> 4143 #include <colorspace_pars_fragment> 4144 4145 void main() { 4146 gl_FragColor = texture2D( tDiffuse, vUv ); 4147 4148 #ifdef LINEAR_TONE_MAPPING 4149 gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); 4150 #elif defined( REINHARD_TONE_MAPPING ) 4151 gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); 4152 #elif defined( CINEON_TONE_MAPPING ) 4153 gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); 4154 #elif defined( ACES_FILMIC_TONE_MAPPING ) 4155 gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); 4156 #elif defined( AGX_TONE_MAPPING ) 4157 gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); 4158 #elif defined( NEUTRAL_TONE_MAPPING ) 4159 gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); 4160 #elif defined( CUSTOM_TONE_MAPPING ) 4161 gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); 4162 #endif 4163 4164 #ifdef SRGB_TRANSFER 4165 gl_FragColor = sRGBTransferOETF( gl_FragColor ); 4166 #endif 4167 }`,depthTest:!1,depthWrite:!1}),d=new ns(l,u),h=new S_(-1,1,1,-1,0,1);let f=null,p=null,g=!1,A,x=null,b=[],_=!1;this.setSize=function(M,T){a.setSize(M,T),o.setSize(M,T);for(let L=0;L<b.length;L++){const D=b[L];D.setSize&&D.setSize(M,T)}},this.setEffects=function(M){b=M,_=b.length>0&&b[0].isRenderPass===!0;const T=a.width,L=a.height;for(let D=0;D<b.length;D++){const P=b[D];P.setSize&&P.setSize(T,L)}},this.begin=function(M,T){if(g||M.toneMapping===Il&&b.length===0)return!1;if(x=T,T!==null){const L=T.width,D=T.height;(a.width!==L||a.height!==D)&&this.setSize(L,D)}return _===!1&&M.setRenderTarget(a),A=M.toneMapping,M.toneMapping=Il,!0},this.hasRenderPass=function(){return _},this.end=function(M,T){M.toneMapping=A,g=!0;let L=a,D=o;for(let P=0;P<b.length;P++){const O=b[P];if(O.enabled!==!1&&(O.render(M,D,L,T),O.needsSwap!==!1)){const F=L;L=D,D=F}}if(f!==M.outputColorSpace||p!==M.toneMapping){f=M.outputColorSpace,p=M.toneMapping,u.defines={},_r.getTransfer(f)===$n&&(u.defines.SRGB_TRANSFER="");const P=E7e[p];P&&(u.defines[P]=""),u.needsUpdate=!0}u.uniforms.tDiffuse.value=L.texture,M.setRenderTarget(x),M.render(d,h),x=null,g=!1},this.isCompositing=function(){return g},this.dispose=function(){a.depthTexture&&a.depthTexture.dispose(),a.dispose(),o.dispose(),l.dispose(),u.dispose()}}const vue=new ko,$I=new Bl(1,1),yue=new GV,bue=new ZMe,wue=new __,qQ=[],$Q=[],HQ=new Float32Array(16),WQ=new Float32Array(9),XQ=new Float32Array(4);function T_(n,e,t){const r=n[0];if(r<=0||r>0)return n;const i=e*t;let s=qQ[i];if(s===void 0&&(s=new Float32Array(i),qQ[i]=s),e!==0){r.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,n[a].toArray(s,o)}return s}function $o(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t<r;t++)if(n[t]!==e[t])return!1;return!0}function Ho(n,e){for(let t=0,r=e.length;t<r;t++)n[t]=e[t]}function eR(n,e){let t=$Q[e];t===void 0&&(t=new Int32Array(e),$Q[e]=t);for(let r=0;r!==e;++r)t[r]=n.allocateTextureUnit();return t}function N7e(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function M7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if($o(t,e))return;n.uniform2fv(this.addr,e),Ho(t,e)}}function k7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if($o(t,e))return;n.uniform3fv(this.addr,e),Ho(t,e)}}function R7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if($o(t,e))return;n.uniform4fv(this.addr,e),Ho(t,e)}}function P7e(n,e){const t=this.cache,r=e.elements;if(r===void 0){if($o(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Ho(t,e)}else{if($o(t,r))return;XQ.set(r),n.uniformMatrix2fv(this.addr,!1,XQ),Ho(t,r)}}function L7e(n,e){const t=this.cache,r=e.elements;if(r===void 0){if($o(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Ho(t,e)}else{if($o(t,r))return;WQ.set(r),n.uniformMatrix3fv(this.addr,!1,WQ),Ho(t,r)}}function O7e(n,e){const t=this.cache,r=e.elements;if(r===void 0){if($o(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Ho(t,e)}else{if($o(t,r))return;HQ.set(r),n.uniformMatrix4fv(this.addr,!1,HQ),Ho(t,r)}}function D7e(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function j7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if($o(t,e))return;n.uniform2iv(this.addr,e),Ho(t,e)}}function I7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if($o(t,e))return;n.uniform3iv(this.addr,e),Ho(t,e)}}function F7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if($o(t,e))return;n.uniform4iv(this.addr,e),Ho(t,e)}}function U7e(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function B7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if($o(t,e))return;n.uniform2uiv(this.addr,e),Ho(t,e)}}function V7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if($o(t,e))return;n.uniform3uiv(this.addr,e),Ho(t,e)}}function z7e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if($o(t,e))return;n.uniform4uiv(this.addr,e),Ho(t,e)}}function G7e(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i);let s;this.type===n.SAMPLER_2D_SHADOW?($I.compareFunction=t.isReversedDepthBuffer()?eg:$1,s=$I):s=vue,t.setTexture2D(e||s,i)}function q7e(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture3D(e||bue,i)}function $7e(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTextureCube(e||wue,i)}function H7e(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture2DArray(e||yue,i)}function W7e(n){switch(n){case 5126:return N7e;case 35664:return M7e;case 35665:return k7e;case 35666:return R7e;case 35674:return P7e;case 35675:return L7e;case 35676:return O7e;case 5124:case 35670:return D7e;case 35667:case 35671:return j7e;case 35668:case 35672:return I7e;case 35669:case 35673:return F7e;case 5125:return U7e;case 36294:return B7e;case 36295:return V7e;case 36296:return z7e;case 35678:case 36198:case 36298:case 36306:case 35682:return G7e;case 35679:case 36299:case 36307:return q7e;case 35680:case 36300:case 36308:case 36293:return $7e;case 36289:case 36303:case 36311:case 36292:return H7e}}function X7e(n,e){n.uniform1fv(this.addr,e)}function Y7e(n,e){const t=T_(e,this.size,2);n.uniform2fv(this.addr,t)}function Q7e(n,e){const t=T_(e,this.size,3);n.uniform3fv(this.addr,t)}function K7e(n,e){const t=T_(e,this.size,4);n.uniform4fv(this.addr,t)}function Z7e(n,e){const t=T_(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function J7e(n,e){const t=T_(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function e9e(n,e){const t=T_(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function t9e(n,e){n.uniform1iv(this.addr,e)}function n9e(n,e){n.uniform2iv(this.addr,e)}function r9e(n,e){n.uniform3iv(this.addr,e)}function i9e(n,e){n.uniform4iv(this.addr,e)}function s9e(n,e){n.uniform1uiv(this.addr,e)}function a9e(n,e){n.uniform2uiv(this.addr,e)}function o9e(n,e){n.uniform3uiv(this.addr,e)}function l9e(n,e){n.uniform4uiv(this.addr,e)}function c9e(n,e,t){const r=this.cache,i=e.length,s=eR(t,i);$o(r,s)||(n.uniform1iv(this.addr,s),Ho(r,s));let a;this.type===n.SAMPLER_2D_SHADOW?a=$I:a=vue;for(let o=0;o!==i;++o)t.setTexture2D(e[o]||a,s[o])}function u9e(n,e,t){const r=this.cache,i=e.length,s=eR(t,i);$o(r,s)||(n.uniform1iv(this.addr,s),Ho(r,s));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||bue,s[a])}function d9e(n,e,t){const r=this.cache,i=e.length,s=eR(t,i);$o(r,s)||(n.uniform1iv(this.addr,s),Ho(r,s));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||wue,s[a])}function h9e(n,e,t){const r=this.cache,i=e.length,s=eR(t,i);$o(r,s)||(n.uniform1iv(this.addr,s),Ho(r,s));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||yue,s[a])}function f9e(n){switch(n){case 5126:return X7e;case 35664:return Y7e;case 35665:return Q7e;case 35666:return K7e;case 35674:return Z7e;case 35675:return J7e;case 35676:return e9e;case 5124:case 35670:return t9e;case 35667:case 35671:return n9e;case 35668:case 35672:return r9e;case 35669:case 35673:return i9e;case 5125:return s9e;case 36294:return a9e;case 36295:return o9e;case 36296:return l9e;case 35678:case 36198:case 36298:case 36306:case 35682:return c9e;case 35679:case 36299:case 36307:return u9e;case 35680:case 36300:case 36308:case 36293:return d9e;case 36289:case 36303:case 36311:case 36292:return h9e}}class p9e{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.setValue=W7e(t.type)}}class m9e{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=f9e(t.type)}}class g9e{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){const i=this.seq;for(let s=0,a=i.length;s!==a;++s){const o=i[s];o.setValue(e,t[o.id],r)}}}const X9=/(\w+)(\])?(\[|\.)?/g;function YQ(n,e){n.seq.push(e),n.map[e.id]=e}function A9e(n,e,t){const r=n.name,i=r.length;for(X9.lastIndex=0;;){const s=X9.exec(r),a=X9.lastIndex;let o=s[1];const l=s[2]==="]",u=s[3];if(l&&(o=o|0),u===void 0||u==="["&&a+2===i){YQ(t,u===void 0?new p9e(o,n,e):new m9e(o,n,e));break}else{let h=t.map[o];h===void 0&&(h=new g9e(o),YQ(t,h)),t=h}}}class m6{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<r;++a){const o=e.getActiveUniform(t,a),l=e.getUniformLocation(t,o.name);A9e(o,l,this)}const i=[],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?i.push(a):s.push(a);i.length>0&&(this.seq=i.concat(s))}setValue(e,t,r,i){const s=this.map[t];s!==void 0&&s.setValue(e,r,i)}setOptional(e,t,r){const i=t[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,t,r,i){for(let s=0,a=t.length;s!==a;++s){const o=t[s],l=r[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const r=[];for(let i=0,s=e.length;i!==s;++i){const a=e[i];a.id in t&&r.push(a)}return r}}function QQ(n,e,t){const r=n.createShader(e);return n.shaderSource(r,t),n.compileShader(r),r}const x9e=37297;let v9e=0;function y9e(n,e){const t=n.split(` 4168`),r=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let a=i;a<s;a++){const o=a+1;r.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return r.join(` 4169`)}const KQ=new Gr;function b9e(n){_r._getMatrix(KQ,_r.workingColorSpace,n);const e=`mat3( ${KQ.elements.map(t=>t.toFixed(4))} )`;switch(_r.getTransfer(n)){case Bw:return[e,"LinearTransferOETF"];case $n:return[e,"sRGBTransferOETF"];default:return an("WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function ZQ(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),s=(n.getShaderInfoLog(e)||"").trim();if(r&&s==="")return"";const a=/ERROR: 0:(\d+)/.exec(s);if(a){const o=parseInt(a[1]);return t.toUpperCase()+` 4170 4171`+s+` 4172 4173`+y9e(n.getShaderSource(e),o)}else return s}function w9e(n,e){const t=b9e(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` 4174`)}const _9e={[CV]:"Linear",[NV]:"Reinhard",[MV]:"Cineon",[kV]:"ACESFilmic",[RV]:"AgX",[PV]:"Neutral",[Bce]:"Custom"};function S9e(n,e){const t=_9e[e];return t===void 0?(an("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+n+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const bC=new Ve;function T9e(){_r.getLuminanceCoefficients(bC);const n=bC.x.toFixed(4),e=bC.y.toFixed(4),t=bC.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` 4175`)}function E9e(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(PS).join(` 4176`)}function C9e(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(` 4177`)}function N9e(n,e){const t={},r=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const s=n.getActiveAttrib(e,i),a=s.name;let o=1;s.type===n.FLOAT_MAT2&&(o=2),s.type===n.FLOAT_MAT3&&(o=3),s.type===n.FLOAT_MAT4&&(o=4),t[a]={type:s.type,location:n.getAttribLocation(e,a),locationSize:o}}return t}function PS(n){return n!==""}function JQ(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function eK(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const M9e=/^[ \t]*#include +<([\w\d./]+)>/gm;function HI(n){return n.replace(M9e,R9e)}const k9e=new Map;function R9e(n,e){let t=Zr[e];if(t===void 0){const r=k9e.get(e);if(r!==void 0)t=Zr[r],an('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("THREE.WebGLProgram: Can not resolve #include <"+e+">")}return HI(t)}const P9e=/#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 tK(n){return n.replace(P9e,L9e)}function L9e(n,e,t,r){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function nK(n){let e=`precision ${n.precision} float; 4178 precision ${n.precision} int; 4179 precision ${n.precision} sampler2D; 4180 precision ${n.precision} samplerCube; 4181 precision ${n.precision} sampler3D; 4182 precision ${n.precision} sampler2DArray; 4183 precision ${n.precision} sampler2DShadow; 4184 precision ${n.precision} samplerCubeShadow; 4185 precision ${n.precision} sampler2DArrayShadow; 4186 precision ${n.precision} isampler2D; 4187 precision ${n.precision} isampler3D; 4188 precision ${n.precision} isamplerCube; 4189 precision ${n.precision} isampler2DArray; 4190 precision ${n.precision} usampler2D; 4191 precision ${n.precision} usampler3D; 4192 precision ${n.precision} usamplerCube; 4193 precision ${n.precision} usampler2DArray; 4194 `;return n.precision==="highp"?e+=` 4195#define HIGH_PRECISION`:n.precision==="mediump"?e+=` 4196#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=` 4197#define LOW_PRECISION`),e}const O9e={[Nb]:"SHADOWMAP_TYPE_PCF",[s0]:"SHADOWMAP_TYPE_VSM"};function D9e(n){return O9e[n.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const j9e={[np]:"ENVMAP_TYPE_CUBE",[R0]:"ENVMAP_TYPE_CUBE",[E1]:"ENVMAP_TYPE_CUBE_UV"};function I9e(n){return n.envMap===!1?"ENVMAP_TYPE_CUBE":j9e[n.envMapMode]||"ENVMAP_TYPE_CUBE"}const F9e={[R0]:"ENVMAP_MODE_REFRACTION"};function U9e(n){return n.envMap===!1?"ENVMAP_MODE_REFLECTION":F9e[n.envMapMode]||"ENVMAP_MODE_REFLECTION"}const B9e={[vT]:"ENVMAP_BLENDING_MULTIPLY",[Fce]:"ENVMAP_BLENDING_MIX",[Uce]:"ENVMAP_BLENDING_ADD"};function V9e(n){return n.envMap===!1?"ENVMAP_BLENDING_NONE":B9e[n.combine]||"ENVMAP_BLENDING_NONE"}function z9e(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:r,maxMip:t}}function G9e(n,e,t,r){const i=n.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=D9e(t),u=I9e(t),d=U9e(t),h=V9e(t),f=z9e(t),p=E9e(t),g=C9e(s),A=i.createProgram();let x,b,_=t.glslVersion?"#version "+t.glslVersion+` 4198`:"";t.isRawShaderMaterial?(x=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(PS).join(` 4199`),x.length>0&&(x+=` 4200`),b=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(PS).join(` 4201`),b.length>0&&(b+=` 4202`)):(x=[nK(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionCl
vendor: 5,827 bytes, lines 4202-4204
4202ipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexNormals?"#define HAS_NORMAL":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.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",` 4203`].filter(PS).join(` 4204`),b=[nK(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",t.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.max
vendor: 8,632 bytes, lines 4204-4218
4204Mip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Il?"#define TONE_MAPPING":"",t.toneMapping!==Il?Zr.tonemapping_pars_fragment:"",t.toneMapping!==Il?S9e("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Zr.colorspace_pars_fragment,w9e("linearToOutputTexel",t.outputColorSpace),T9e(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 4205`].filter(PS).join(` 4206`)),a=HI(a),a=JQ(a,t),a=eK(a,t),o=HI(o),o=JQ(o,t),o=eK(o,t),a=tK(a),o=tK(o),t.isRawShaderMaterial!==!0&&(_=`#version 300 es 4207`,x=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` 4208`)+` 4209`+x,b=["#define varying in",t.glslVersion===QY?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===QY?"":"#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(` 4210`)+` 4211`+b);const M=_+x+a,T=_+b+o,L=QQ(i,i.VERTEX_SHADER,M),D=QQ(i,i.FRAGMENT_SHADER,T);i.attachShader(A,L),i.attachShader(A,D),t.index0AttributeName!==void 0?i.bindAttribLocation(A,0,t.index0AttributeName):t.hasPositionAttribute===!0&&i.bindAttribLocation(A,0,"position"),i.linkProgram(A);function P(B){if(n.debug.checkShaderErrors){const z=i.getProgramInfoLog(A)||"",H=i.getShaderInfoLog(L)||"",X=i.getShaderInfoLog(D)||"",W=z.trim(),J=H.trim(),ee=X.trim();let ae=!0,le=!0;if(i.getProgramParameter(A,i.LINK_STATUS)===!1)if(ae=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,A,L,D);else{const Z=ZQ(i,L,"vertex"),Y=ZQ(i,D,"fragment");sn("WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(A,i.VALIDATE_STATUS)+` 4212 4213Material Name: `+B.name+` 4214Material Type: `+B.type+` 4215 4216Program Info Log: `+W+` 4217`+Z+` 4218`+Y)}else W!==""?an("WebGLProgram: Program Info Log:",W):(J===""||ee==="")&&(le=!1);le&&(B.diagnostics={runnable:ae,programLog:W,vertexShader:{log:J,prefix:x},fragmentShader:{log:ee,prefix:b}})}i.deleteShader(L),i.deleteShader(D),O=new m6(i,A),F=N9e(i,A)}let O;this.getUniforms=function(){return O===void 0&&P(this),O};let F;this.getAttributes=function(){return F===void 0&&P(this),F};let U=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return U===!1&&(U=i.getProgramParameter(A,x9e)),U},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(A),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=v9e++,this.cacheKey=e,this.usedTimes=1,this.program=A,this.vertexShader=L,this.fragmentShader=D,this}let q9e=0;class $9e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,r){const i=this._getShaderCacheForMaterial(e);return i.has(t)===!1&&(i.add(t),t.usedTimes++),i.has(r)===!1&&(i.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new H9e(e),t.set(e,r)),r}}class H9e{constructor(e){this.id=q9e++,this.code=e,this.usedTimes=0}}function W9e(n){return n===fl||n===C1||n===N1}function X9e(n,e,t,r,i,s){const a=new qV,o=new $9e,l=new Set,u=[],d=new Map,h=r.logarithmicDepthBuffer;let f=r.precision;const p={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 g(O){return l.add(O),O===0?"uv":`uv${O}`}function A(O,F,U,B,z,H){const X=B.fog,W=z.geometry,J=O.isMeshStandardMaterial||O.isMeshLambertMaterial||O.isMeshPhongMaterial?B.environment:null,ee=O.isMeshStandardMaterial||O.isMeshLambertMaterial&&!O.envMap||O.isMeshPhongMaterial&&!O.envMap,ae=e.get(O.envMap||J,ee),le=ae&&ae.mapping===E1?ae.image.height:null,Z=p[O.type];O.precision!==null&&(f=r.getMaxPrecision(O.precision),f!==O.precision&&an("WebGLProgram.getParameters:",O.precision,"not supported, using",f,"instead."));const Y=W.morphAttributes.position||W.morphAttributes.normal||W.morphAttributes.color,re=Y!==void 0?Y.length:0;let _e=0;W.morphAttributes.position!==void 0&&(_e=1),W.morphAttributes.normal!==void 0&&(_e=2),W.morphAttributes.color!==void 0&&(_e=3);let Ee,Ae,te,ve;if(Z){const qt=Ou[Z];Ee=qt.vertexShader,Ae=qt.fragmentShader}else{Ee=O.vertexShader,Ae=O.fragmentShader;const qt=o.getVertexShaderStage(O),Fn=o.getFragmentShaderStage(O);o.update(O,qt,Fn),te=qt.id,ve=Fn.id}const we=n.getRenderTarget(),Ue=n.state.buffers.depth.getReversed(),ze=z.isInstancedMesh===!0,yt=z.isBatchedMesh===!0,mt=!!O.map,bt=!!O.matcap,dt=!!ae,St=!!O.aoMap,kt=!!O.lightMap,Fe=!!O.bumpMap&&O.wireframe===!1,Ze=!!O.normalMap,Ye=!!O.displacementMap,ft=!!O.emissiveMap,At=!!O.metalnessMap,Ce=!!O.roughnessMap,Se=O.anisotropy>0,qe=O.clearcoat>0,pt=O.dispersion>0,Te=O.iridescence>0,oe=O.sheen>0,ge=O.transmission>0,Ne=Se&&!!O.anisotropyMap,ke=qe&&!!O.clearcoatMap,Xe=qe&&!!O.clearcoatNormalMap,et=qe&&!!O.clearcoatRoughnessMap,Qe=Te&&!!O.iridescenceMap,lt=Te&&!!O.iridescenceThicknessMap,tt=oe&&!!O.sheenColorMap,Ft=oe&&!!O.sheenRoughnessMap,Mt=!!O.specularMap,Nt=!!O.specularColorMap,Je=!!O.specularIntensityMap,fn=ge&&!!O.transmissionMap,Tn=ge&&!!O.thicknessMap,nt=!!O.gradientMap,Kt=!!O.alphaMap,Lt=O.alphaTest>
vendor: 4,451 bytes, line 4218
42180,cn=!!O.alphaHash,dn=!!O.extensions;let Bt=Il;O.toneMapped&&(we===null||we.isXRRenderTarget===!0)&&(Bt=n.toneMapping);const Ht={shaderID:Z,shaderType:O.type,shaderName:O.name,vertexShader:Ee,fragmentShader:Ae,defines:O.defines,customVertexShaderID:te,customFragmentShaderID:ve,isRawShaderMaterial:O.isRawShaderMaterial===!0,glslVersion:O.glslVersion,precision:f,batching:yt,batchingColor:yt&&z._colorsTexture!==null,instancing:ze,instancingColor:ze&&z.instanceColor!==null,instancingMorph:ze&&z.morphTexture!==null,outputColorSpace:we===null?n.outputColorSpace:we.isXRRenderTarget===!0?we.texture.colorSpace:_r.workingColorSpace,alphaToCoverage:!!O.alphaToCoverage,map:mt,matcap:bt,envMap:dt,envMapMode:dt&&ae.mapping,envMapCubeUVHeight:le,aoMap:St,lightMap:kt,bumpMap:Fe,normalMap:Ze,displacementMap:Ye,emissiveMap:ft,normalMapObjectSpace:Ze&&O.normalMapType===Vce,normalMapTangentSpace:Ze&&O.normalMapType===Qf,packedNormalMap:Ze&&O.normalMapType===Qf&&W9e(O.normalMap.format),metalnessMap:At,roughnessMap:Ce,anisotropy:Se,anisotropyMap:Ne,clearcoat:qe,clearcoatMap:ke,clearcoatNormalMap:Xe,clearcoatRoughnessMap:et,dispersion:pt,iridescence:Te,iridescenceMap:Qe,iridescenceThicknessMap:lt,sheen:oe,sheenColorMap:tt,sheenRoughnessMap:Ft,specularMap:Mt,specularColorMap:Nt,specularIntensityMap:Je,transmission:ge,transmissionMap:fn,thicknessMap:Tn,gradientMap:nt,opaque:O.transparent===!1&&O.blending===dl&&O.alphaToCoverage===!1,alphaMap:Kt,alphaTest:Lt,alphaHash:cn,combine:O.combine,mapUv:mt&&g(O.map.channel),aoMapUv:St&&g(O.aoMap.channel),lightMapUv:kt&&g(O.lightMap.channel),bumpMapUv:Fe&&g(O.bumpMap.channel),normalMapUv:Ze&&g(O.normalMap.channel),displacementMapUv:Ye&&g(O.displacementMap.channel),emissiveMapUv:ft&&g(O.emissiveMap.channel),metalnessMapUv:At&&g(O.metalnessMap.channel),roughnessMapUv:Ce&&g(O.roughnessMap.channel),anisotropyMapUv:Ne&&g(O.anisotropyMap.channel),clearcoatMapUv:ke&&g(O.clearcoatMap.channel),clearcoatNormalMapUv:Xe&&g(O.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:et&&g(O.clearcoatRoughnessMap.channel),iridescenceMapUv:Qe&&g(O.iridescenceMap.channel),iridescenceThicknessMapUv:lt&&g(O.iridescenceThicknessMap.channel),sheenColorMapUv:tt&&g(O.sheenColorMap.channel),sheenRoughnessMapUv:Ft&&g(O.sheenRoughnessMap.channel),specularMapUv:Mt&&g(O.specularMap.channel),specularColorMapUv:Nt&&g(O.specularColorMap.channel),specularIntensityMapUv:Je&&g(O.specularIntensityMap.channel),transmissionMapUv:fn&&g(O.transmissionMap.channel),thicknessMapUv:Tn&&g(O.thicknessMap.channel),alphaMapUv:Kt&&g(O.alphaMap.channel),vertexTangents:!!W.attributes.tangent&&(Ze||Se),vertexNormals:!!W.attributes.normal,vertexColors:O.vertexColors,vertexAlphas:O.vertexColors===!0&&!!W.attributes.color&&W.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!W.attributes.uv&&(mt||Kt),fog:!!X,useFog:O.fog===!0,fogExp2:!!X&&X.isFogExp2,flatShading:O.wireframe===!1&&(O.flatShading===!0||W.attributes.normal===void 0&&Ze===!1&&(O.isMeshLambertMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isMeshPhysicalMaterial)),sizeAttenuation:O.sizeAttenuation===!0,logarithmicDepthBuffer:h,reversedDepthBuffer:Ue,skinning:z.isSkinnedMesh===!0,hasPositionAttribute:W.attributes.position!==void 0,morphTargets:W.morphAttributes.position!==void 0,morphNormals:W.morphAttributes.normal!==void 0,morphColors:W.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:_e,numDirLights:F.directional.length,numPointLights:F.point.length,numSpotLights:F.spot.length,numSpotLightMaps:F.spotLightMap.length,numRectAreaLights:F.rectArea.length,numHemiLights:F.hemi.length,numDirLightShadows:F.directionalShadowMap.length,numPointLightShadows:F.pointShadowMap.length,numSpotLightShadows:F.spotShadowMap.length,numSpotLightShadowsWithMaps:F.numSpotLightShadowsWithMaps,numLightProbes:F.numLightProbes,numLightProbeGrids:H.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:O.dithering,shadowMapEnabled:n.shadowMap.enabled&&U.length>0,shadowMapType:n.shadowMap.type,toneMapping:Bt,decodeVideoTexture:mt&&O.map.isVideoTexture===!0&&_r.getTransfer(O.map.colorSpace)===$n,decodeVideoTextureEmissive:ft&&O.emissiveMap.isVideoTexture===!0&&_r.getTransfer(O.emissiveMap.colorSpace)===$n,premultipliedAlpha:O.premultipliedAlpha,doubleSided:O.side===Fa,flipSided:O.side===us,useDepthPacking:O.depthPacking>=0,depthPacking:O.depthPacking||0,index0AttributeName:O.index0AttributeName,extensionCl
vendor: 5,150 bytes, line 4218
4218ipCullDistance:dn&&O.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(dn&&O.extensions.multiDraw===!0||yt)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:O.customProgramCacheKey()};return Ht.vertexUv1s=l.has(1),Ht.vertexUv2s=l.has(2),Ht.vertexUv3s=l.has(3),l.clear(),Ht}function x(O){const F=[];if(O.shaderID?F.push(O.shaderID):(F.push(O.customVertexShaderID),F.push(O.customFragmentShaderID)),O.defines!==void 0)for(const U in O.defines)F.push(U),F.push(O.defines[U]);return O.isRawShaderMaterial===!1&&(b(F,O),_(F,O),F.push(n.outputColorSpace)),F.push(O.customProgramCacheKey),F.join()}function b(O,F){O.push(F.precision),O.push(F.outputColorSpace),O.push(F.envMapMode),O.push(F.envMapCubeUVHeight),O.push(F.mapUv),O.push(F.alphaMapUv),O.push(F.lightMapUv),O.push(F.aoMapUv),O.push(F.bumpMapUv),O.push(F.normalMapUv),O.push(F.displacementMapUv),O.push(F.emissiveMapUv),O.push(F.metalnessMapUv),O.push(F.roughnessMapUv),O.push(F.anisotropyMapUv),O.push(F.clearcoatMapUv),O.push(F.clearcoatNormalMapUv),O.push(F.clearcoatRoughnessMapUv),O.push(F.iridescenceMapUv),O.push(F.iridescenceThicknessMapUv),O.push(F.sheenColorMapUv),O.push(F.sheenRoughnessMapUv),O.push(F.specularMapUv),O.push(F.specularColorMapUv),O.push(F.specularIntensityMapUv),O.push(F.transmissionMapUv),O.push(F.thicknessMapUv),O.push(F.combine),O.push(F.fogExp2),O.push(F.sizeAttenuation),O.push(F.morphTargetsCount),O.push(F.morphAttributeCount),O.push(F.numDirLights),O.push(F.numPointLights),O.push(F.numSpotLights),O.push(F.numSpotLightMaps),O.push(F.numHemiLights),O.push(F.numRectAreaLights),O.push(F.numDirLightShadows),O.push(F.numPointLightShadows),O.push(F.numSpotLightShadows),O.push(F.numSpotLightShadowsWithMaps),O.push(F.numLightProbes),O.push(F.shadowMapType),O.push(F.toneMapping),O.push(F.numClippingPlanes),O.push(F.numClipIntersection),O.push(F.depthPacking)}function _(O,F){a.disableAll(),F.instancing&&a.enable(0),F.instancingColor&&a.enable(1),F.instancingMorph&&a.enable(2),F.matcap&&a.enable(3),F.envMap&&a.enable(4),F.normalMapObjectSpace&&a.enable(5),F.normalMapTangentSpace&&a.enable(6),F.clearcoat&&a.enable(7),F.iridescence&&a.enable(8),F.alphaTest&&a.enable(9),F.vertexColors&&a.enable(10),F.vertexAlphas&&a.enable(11),F.vertexUv1s&&a.enable(12),F.vertexUv2s&&a.enable(13),F.vertexUv3s&&a.enable(14),F.vertexTangents&&a.enable(15),F.anisotropy&&a.enable(16),F.alphaHash&&a.enable(17),F.batching&&a.enable(18),F.dispersion&&a.enable(19),F.batchingColor&&a.enable(20),F.gradientMap&&a.enable(21),F.packedNormalMap&&a.enable(22),F.vertexNormals&&a.enable(23),O.push(a.mask),a.disableAll(),F.fog&&a.enable(0),F.useFog&&a.enable(1),F.flatShading&&a.enable(2),F.logarithmicDepthBuffer&&a.enable(3),F.reversedDepthBuffer&&a.enable(4),F.skinning&&a.enable(5),F.morphTargets&&a.enable(6),F.morphNormals&&a.enable(7),F.morphColors&&a.enable(8),F.premultipliedAlpha&&a.enable(9),F.shadowMapEnabled&&a.enable(10),F.doubleSided&&a.enable(11),F.flipSided&&a.enable(12),F.useDepthPacking&&a.enable(13),F.dithering&&a.enable(14),F.transmission&&a.enable(15),F.sheen&&a.enable(16),F.opaque&&a.enable(17),F.pointsUvs&&a.enable(18),F.decodeVideoTexture&&a.enable(19),F.decodeVideoTextureEmissive&&a.enable(20),F.alphaToCoverage&&a.enable(21),F.numLightProbeGrids>0&&a.enable(22),F.hasPositionAttribute&&a.enable(23),O.push(a.mask)}function M(O){const F=p[O.type];let U;if(F){const B=Ou[F];U=K8.clone(B.uniforms)}else U=O.uniforms;return U}function T(O,F){let U=d.get(F);return U!==void 0?++U.usedTimes:(U=new G9e(n,F,O,i),u.push(U),d.set(F,U)),U}function L(O){if(--O.usedTimes===0){const F=u.indexOf(O);u[F]=u[u.length-1],u.pop(),d.delete(O.cacheKey),O.destroy()}}function D(O){o.remove(O)}function P(){o.dispose()}return{getParameters:A,getProgramCacheKey:x,getUniforms:M,acquireProgram:T,releaseProgram:L,releaseShaderCache:D,programs:u,dispose:P}}function Y9e(){let n=new WeakMap;function e(a){return n.has(a)}function t(a){let o=n.get(a);return o===void 0&&(o={},n.set(a,o)),o}function r(a){n.delete(a)}function i(a,o,l){n.get(a)[o]=l}function s(){n=new WeakMap}return{has:e,get:t,remove:r,update:i,dispose:s}}function Q9e(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.materialVariant!==e.materialVariant?n.materialVariant-e.materialVariant:n.z!==e.z?n.z-e.z:n.id-e.id}function rK(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function iK(){const n=[];let e=0;const t=[],r=[],i=[];function s(){e=0,t.length=0,r.length=0,i.length=0}function a(f){let p=0;return f.isInstancedMesh&&(p+=2),f.isSkinnedMesh&&(p+=1),p}function o(f,p,g,A,x,b){let _=n[e];return _===void 0?(_={id:f.id,object:f,geometry:p,material:g,materialVariant:a(f),groupOrder:A,renderOrder:f.renderOrder,z:x,group:b},n[e]=_):(_.id=f.id,_.object=f,_.geometry=p,_.material=g,_.materialVariant=a(f),_.groupOrder=A,_.renderOrder=f.renderOrder,_.z
vendor: 1,911 bytes, line 4218
4218=x,_.group=b),e++,_}function l(f,p,g,A,x,b){const _=o(f,p,g,A,x,b);g.transmission>0?r.push(_):g.transparent===!0?i.push(_):t.push(_)}function u(f,p,g,A,x,b){const _=o(f,p,g,A,x,b);g.transmission>0?r.unshift(_):g.transparent===!0?i.unshift(_):t.unshift(_)}function d(f,p,g){t.length>1&&t.sort(f||Q9e),r.length>1&&r.sort(p||rK),i.length>1&&i.sort(p||rK),g&&(t.reverse(),r.reverse(),i.reverse())}function h(){for(let f=e,p=n.length;f<p;f++){const g=n[f];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:r,transparent:i,init:s,push:l,unshift:u,finish:h,sort:d}}function K9e(){let n=new WeakMap;function e(r,i){const s=n.get(r);let a;return s===void 0?(a=new iK,n.set(r,[a])):i>=s.length?(a=new iK,s.push(a)):a=s[i],a}function t(){n=new WeakMap}return{get:e,dispose:t}}function Z9e(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Ve,color:new tr};break;case"SpotLight":t={position:new Ve,direction:new Ve,color:new tr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Ve,color:new tr,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Ve,skyColor:new tr,groundColor:new tr};break;case"RectAreaLight":t={color:new tr,position:new Ve,halfWidth:new Ve,halfHeight:new Ve};break}return n[e.id]=t,t}}}function J9e(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Jt};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Jt};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Jt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let eLe=0;
vendor: 6,175 bytes, lines 4218-4223
4218function tLe(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function nLe(n){const e=new Z9e,t=J9e(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new Ve);const i=new Ve,s=new kr,a=new kr;function o(u){let d=0,h=0,f=0;for(let F=0;F<9;F++)r.probe[F].set(0,0,0);let p=0,g=0,A=0,x=0,b=0,_=0,M=0,T=0,L=0,D=0,P=0;u.sort(tLe);for(let F=0,U=u.length;F<U;F++){const B=u[F],z=B.color,H=B.intensity,X=B.distance;let W=null;if(B.shadow&&B.shadow.map&&(B.shadow.map.texture.format===fl?W=B.shadow.map.texture:W=B.shadow.map.depthTexture||B.shadow.map.texture),B.isAmbientLight)d+=z.r*H,h+=z.g*H,f+=z.b*H;else if(B.isLightProbe){for(let J=0;J<9;J++)r.probe[J].addScaledVector(B.sh.coefficients[J],H);P++}else if(B.isDirectionalLight){const J=e.get(B);if(J.color.copy(B.color).multiplyScalar(B.intensity),B.castShadow){const ee=B.shadow,ae=t.get(B);ae.shadowIntensity=ee.intensity,ae.shadowBias=ee.bias,ae.shadowNormalBias=ee.normalBias,ae.shadowRadius=ee.radius,ae.shadowMapSize=ee.mapSize,r.directionalShadow[p]=ae,r.directionalShadowMap[p]=W,r.directionalShadowMatrix[p]=B.shadow.matrix,_++}r.directional[p]=J,p++}else if(B.isSpotLight){const J=e.get(B);J.position.setFromMatrixPosition(B.matrixWorld),J.color.copy(z).multiplyScalar(H),J.distance=X,J.coneCos=Math.cos(B.angle),J.penumbraCos=Math.cos(B.angle*(1-B.penumbra)),J.decay=B.decay,r.spot[A]=J;const ee=B.shadow;if(B.map&&(r.spotLightMap[L]=B.map,L++,ee.updateMatrices(B),B.castShadow&&D++),r.spotLightMatrix[A]=ee.matrix,B.castShadow){const ae=t.get(B);ae.shadowIntensity=ee.intensity,ae.shadowBias=ee.bias,ae.shadowNormalBias=ee.normalBias,ae.shadowRadius=ee.radius,ae.shadowMapSize=ee.mapSize,r.spotShadow[A]=ae,r.spotShadowMap[A]=W,T++}A++}else if(B.isRectAreaLight){const J=e.get(B);J.color.copy(z).multiplyScalar(H),J.halfWidth.set(B.width*.5,0,0),J.halfHeight.set(0,B.height*.5,0),r.rectArea[x]=J,x++}else if(B.isPointLight){const J=e.get(B);if(J.color.copy(B.color).multiplyScalar(B.intensity),J.distance=B.distance,J.decay=B.decay,B.castShadow){const ee=B.shadow,ae=t.get(B);ae.shadowIntensity=ee.intensity,ae.shadowBias=ee.bias,ae.shadowNormalBias=ee.normalBias,ae.shadowRadius=ee.radius,ae.shadowMapSize=ee.mapSize,ae.shadowCameraNear=ee.camera.near,ae.shadowCameraFar=ee.camera.far,r.pointShadow[g]=ae,r.pointShadowMap[g]=W,r.pointShadowMatrix[g]=B.shadow.matrix,M++}r.point[g]=J,g++}else if(B.isHemisphereLight){const J=e.get(B);J.skyColor.copy(B.color).multiplyScalar(H),J.groundColor.copy(B.groundColor).multiplyScalar(H),r.hemi[b]=J,b++}}x>0&&(n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Bn.LTC_FLOAT_1,r.rectAreaLTC2=Bn.LTC_FLOAT_2):(r.rectAreaLTC1=Bn.LTC_HALF_1,r.rectAreaLTC2=Bn.LTC_HALF_2)),r.ambient[0]=d,r.ambient[1]=h,r.ambient[2]=f;const O=r.hash;(O.directionalLength!==p||O.pointLength!==g||O.spotLength!==A||O.rectAreaLength!==x||O.hemiLength!==b||O.numDirectionalShadows!==_||O.numPointShadows!==M||O.numSpotShadows!==T||O.numSpotMaps!==L||O.numLightProbes!==P)&&(r.directional.length=p,r.spot.length=A,r.rectArea.length=x,r.point.length=g,r.hemi.length=b,r.directionalShadow.length=_,r.directionalShadowMap.length=_,r.pointShadow.length=M,r.pointShadowMap.length=M,r.spotShadow.length=T,r.spotShadowMap.length=T,r.directionalShadowMatrix.length=_,r.pointShadowMatrix.length=M,r.spotLightMatrix.length=T+L-D,r.spotLightMap.length=L,r.numSpotLightShadowsWithMaps=D,r.numLightProbes=P,O.directionalLength=p,O.pointLength=g,O.spotLength=A,O.rectAreaLength=x,O.hemiLength=b,O.numDirectionalShadows=_,O.numPointShadows=M,O.numSpotShadows=T,O.numSpotMaps=L,O.numLightProbes=P,r.version=eLe++)}function l(u,d){let h=0,f=0,p=0,g=0,A=0;const x=d.matrixWorldInverse;for(let b=0,_=u.length;b<_;b++){const M=u[b];if(M.isDirectionalLight){const T=r.directional[h];T.direction.setFromMatrixPosition(M.matrixWorld),i.setFromMatrixPosition(M.target.matrixWorld),T.direction.sub(i),T.direction.transformDirection(x),h++}else if(M.isSpotLight){const T=r.spot[p];T.position.setFromMatrixPosition(M.matrixWorld),T.position.applyMatrix4(x),T.direction.setFromMatrixPosition(M.matrixWorld),i.setFromMatrixPosition(M.target.matrixWorld),T.direction.sub(i),T.direction.transformDirection(x),p++}else if(M.isRectAreaLight){const T=r.rectArea[g];T.position.setFromMatrixPosition(M.matrixWorld),T.position.applyMatrix4(x),a.identity(),s.copy(M.matrixWorld),s.premultiply(x),a.extractRotation(s),T.halfWidth.set(M.width*.5,0,0),T.halfHeight.set(0,M.height*.5,0),T.halfWidth.applyMatrix4(a),T.halfHeight.applyMatrix4(a),g++}else if(M.isPointLight){const T=r.point[f];T.position.setFromMatrixPosition(M.matrixWorld),T.position.applyMatrix4(x),f++}else if(M.isHemisphereLight){const T=r.hemi[A];T.direction.setFromMatrixPosition(M.matrixWorld),T.direction.transformDirection(x),A++}}}return{setup:o,setupView:l,state:r}}function sK(n){const e=new nLe(n),t=[],r=[],i=[];function s(f){h.camera=f,t.length=0,r.length=0,i.length=0}function a(f){t.push(f)}function o(f){r.push(f)}function l(f){i.push(f)}function u(){e.setup(t)}function d(f){e.setupView(t,f)}const h={lightsArray:t,shadowsArray:r,lightProbeGridArray:i,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:s,state:h,setupLights:u,setupLightsView:d,pushLight:a,pushShadow:o,pushLightProbeGrid:l}}function rLe(n){let e=new WeakMap;function t(i,s=0){const a=e.get(i);let o;return a===void 0?(o=new sK(n),e.set(i,[o])):s>=a.length?(o=new sK(n),a.push(o)):o=a[s],o}function r(){e=new WeakMap}return{get:t,dispose:r}}const iLe=`void main() { 4219 gl_Position = vec4( position, 1.0 ); 4220}`,sLe=`uniform sampler2D shadow_pass; 4221uniform vec2 resolution; 4222uniform float radius; 4223void main() {
4224 const float samples = float( VSM_SAMPLES ); 4225 float mean = 0.0; 4226 float squared_mean = 0.0; 4227 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 4228 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 4229 for ( float i = 0.0; i < samples; i ++ ) { 4230 float uvOffset = uvStart + i * uvStride; 4231 #ifdef HORIZONTAL_PASS 4232 vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; 4233 mean += distribution.x; 4234 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 4235 #else 4236 float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; 4237 mean += depth; 4238 squared_mean += depth * depth; 4239 #endif 4240 } 4241 mean = mean / samples; 4242 squared_mean = squared_mean / samples; 4243 float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); 4244 gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); 4245}`,aLe=[new Ve(1,0,0),new Ve(-1,0,0),new Ve(0,1,0),new Ve(0,-1,0),new Ve(0,0,1),new Ve(0,0,-1)],oLe=[new Ve(0,-1,0),new Ve(0,-1,0),new Ve(0,0,1),new Ve(0,0,-1),new Ve(0,-1,0),new Ve(0,-1,0)],aK=new kr,C3=new Ve,Y9=new Ve;function lLe(n,e,t){let r=new ny;const i=new Jt,s=new Jt,a=new Rr,o=new r8e,l=new i8e,u={},d=t.maxTextureSize,h={[mu]:us,[us]:mu,[Fa]:Fa},f=new Nc({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Jt},radius:{value:4}},vertexShader:iLe,fragmentShader:sLe}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const g=new ds;g.setAttribute("position",new Ea(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const A=new ns(g,f),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Nb;let b=this.type;this.render=function(D,P,O){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||D.length===0)return;this.type===Dce&&(an("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Nb);const F=n.getRenderTarget(),U=n.getActiveCubeFace(),B=n.getActiveMipmapLevel(),z=n.state;z.setBlending(qo),z.buffers.depth.getReversed()===!0?z.buffers.color.setClear(0,0,0,0):z.buffers.color.setClear(1,1,1,1),z.buffers.depth.setTest(!0),z.setScissorTest(!1);const H=b!==this.type;H&&P.traverse(function(X){X.material&&(Array.isArray(X.material)?X.material.forEach(W=>W.needsUpdate=!0):X.material.needsUpdate=!0)});for(let X=0,W=D.length;X<W;X++){const J=D[X],ee=J.shadow;if(ee===void 0){an("WebGLShadowMap:",J,"has no shadow.");continue}if(ee.autoUpdate===!1&&ee.needsUpdate===!1)continue;i.copy(ee.mapSize);const ae=ee.getFrameExtents();i.multiply(ae),s.copy(ee.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/ae.x),i.x=s.x*ae.x,ee.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/ae.y),i.y=s.y*ae.y,ee.mapSize.y=s.y));const le=n.state.buffers.depth.getReversed();if(ee.camera._reversedDepth=le,ee.map===null||H===!0){if(ee.map!==null&&(ee.map.depthTexture!==null&&(ee.map.depthTexture.dispose(),ee.map.depthTexture=null),ee.map.dispose()),this.type===s0){if(J.isPointLight){an("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}ee.map=new Kf(i.x,i.y,{format:fl,type:Js,minFilter:bs,magFilter:bs,generateMipmaps:!1}),ee.map.texture.name=J.name+".shadowMap",ee.map.depthTexture=new Bl(i.x,i.y,ia),ee.map.depthTexture.name=J.name+".shadowMapDepth",ee.map.depthTexture.format=ml,ee.map.depthTexture.compareFunction=null,ee.map.depthTexture.minFilter=cs,ee.map.depthTexture.magFilter=cs}else J.isPointLight?(ee.map=new xue(i.x),ee.map.depthTexture=new Yce(i.x,ts)):(ee.map=new Kf(i.x,i.y),ee.map.depthTexture=new Bl(i.x,i.y,ts)),ee.map.depthTexture.name=J.name+".shadowMap",ee.map.depthTexture.format=ml,this.type===Nb?(ee.map.depthTexture.compareFunction=le?eg:$1,ee.map.depthTexture.minFilter=bs,ee.map.depthTexture.magFilter=bs):(ee.map.depthTexture.compareFunction=null,ee.map.depthTexture.minFilter=cs,ee.map.depthTexture.magFilter=cs);ee.camera.updateProjectionMatrix()}const Z=ee.map.isWebGLCubeRenderTarget?6:1;for(let Y=0;Y<Z;Y++){if(ee.map.isWebGLCubeRenderTarget)n.setRenderTarget(ee.map,Y),n.clear();else{Y===0&&(n.setRenderTarget(ee.map),n.clear());const re=ee.getViewport(Y);a.set(s.x*re.x,s.y*re.y,s.x*re.z,s.y*re.w),z.viewport(a)}if(J.isPointLight){const re=ee.camera,_e=ee.matrix,Ee=J.distance||re.far;Ee!==re.far&&(re.far=Ee,re.updateProjectionMatrix()),C3.setFromMatrixPosition(J.matrixWorld),re.position.copy(C3),Y9.copy(re.position),Y9.add(aLe[Y]),re.up.copy(oLe[Y]),re.lookAt(Y9),re.updateMatrixWorld(),_e.makeTranslation(-C3.x,-C3.y,-C3.z),aK.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),ee._frustum.setFromProjectionMatrix(aK,re.coordinateSystem,re.reversedDepth)}else ee.updateMatrices(J);r=ee.getFrustum(),T(P,O,ee.camera,J,this.type)}ee.isPointLightShadow!==!0&&this.type===s0&&_(ee,O),ee.needsUpdate=!1}b=this.type,x.needsUpdate=!1,n.setRenderTarget(F,U,B)};function _(D,P){const O=e.update(A);
vendor: 5,560 bytes, line 4245
4245f.defines.VSM_SAMPLES!==D.blurSamples&&(f.defines.VSM_SAMPLES=D.blurSamples,p.defines.VSM_SAMPLES=D.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),D.mapPass===null&&(D.mapPass=new Kf(i.x,i.y,{format:fl,type:Js})),f.uniforms.shadow_pass.value=D.map.depthTexture,f.uniforms.resolution.value=D.mapSize,f.uniforms.radius.value=D.radius,n.setRenderTarget(D.mapPass),n.clear(),n.renderBufferDirect(P,null,O,f,A,null),p.uniforms.shadow_pass.value=D.mapPass.texture,p.uniforms.resolution.value=D.mapSize,p.uniforms.radius.value=D.radius,n.setRenderTarget(D.map),n.clear(),n.renderBufferDirect(P,null,O,p,A,null)}function M(D,P,O,F){let U=null;const B=O.isPointLight===!0?D.customDistanceMaterial:D.customDepthMaterial;if(B!==void 0)U=B;else if(U=O.isPointLight===!0?l:o,n.localClippingEnabled&&P.clipShadows===!0&&Array.isArray(P.clippingPlanes)&&P.clippingPlanes.length!==0||P.displacementMap&&P.displacementScale!==0||P.alphaMap&&P.alphaTest>0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const z=U.uuid,H=P.uuid;let X=u[z];X===void 0&&(X={},u[z]=X);let W=X[H];W===void 0&&(W=U.clone(),X[H]=W,P.addEventListener("dispose",L)),U=W}if(U.visible=P.visible,U.wireframe=P.wireframe,F===s0?U.side=P.shadowSide!==null?P.shadowSide:P.side:U.side=P.shadowSide!==null?P.shadowSide:h[P.side],U.alphaMap=P.alphaMap,U.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,U.map=P.map,U.clipShadows=P.clipShadows,U.clippingPlanes=P.clippingPlanes,U.clipIntersection=P.clipIntersection,U.displacementMap=P.displacementMap,U.displacementScale=P.displacementScale,U.displacementBias=P.displacementBias,U.wireframeLinewidth=P.wireframeLinewidth,U.linewidth=P.linewidth,O.isPointLight===!0&&U.isMeshDistanceMaterial===!0){const z=n.properties.get(U);z.light=O}return U}function T(D,P,O,F,U){if(D.visible===!1)return;if(D.layers.test(P.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&U===s0)&&(!D.frustumCulled||r.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,D.matrixWorld);const H=e.update(D),X=D.material;if(Array.isArray(X)){const W=H.groups;for(let J=0,ee=W.length;J<ee;J++){const ae=W[J],le=X[ae.materialIndex];if(le&&le.visible){const Z=M(D,le,F,U);D.onBeforeShadow(n,D,P,O,H,Z,ae),n.renderBufferDirect(O,null,H,Z,D,ae),D.onAfterShadow(n,D,P,O,H,Z,ae)}}}else if(X.visible){const W=M(D,X,F,U);D.onBeforeShadow(n,D,P,O,H,W,null),n.renderBufferDirect(O,null,H,W,D,null),D.onAfterShadow(n,D,P,O,H,W,null)}}const z=D.children;for(let H=0,X=z.length;H<X;H++)T(z[H],P,O,F,U)}function L(D){D.target.removeEventListener("dispose",L);for(const O in u){const F=u[O],U=D.target.uuid;U in F&&(F[U].dispose(),delete F[U])}}}function cLe(n,e){function t(){let nt=!1;const Kt=new Rr;let Lt=null;const cn=new Rr(0,0,0,0);return{setMask:function(dn){Lt!==dn&&!nt&&(n.colorMask(dn,dn,dn,dn),Lt=dn)},setLocked:function(dn){nt=dn},setClear:function(dn,Bt,Ht,qt,Fn){Fn===!0&&(dn*=qt,Bt*=qt,Ht*=qt),Kt.set(dn,Bt,Ht,qt),cn.equals(Kt)===!1&&(n.clearColor(dn,Bt,Ht,qt),cn.copy(Kt))},reset:function(){nt=!1,Lt=null,cn.set(-1,0,0,0)}}}function r(){let nt=!1,Kt=!1,Lt=null,cn=null,dn=null;return{setReversed:function(Bt){if(Kt!==Bt){const Ht=e.get("EXT_clip_control");Bt?Ht.clipControlEXT(Ht.LOWER_LEFT_EXT,Ht.ZERO_TO_ONE_EXT):Ht.clipControlEXT(Ht.LOWER_LEFT_EXT,Ht.NEGATIVE_ONE_TO_ONE_EXT),Kt=Bt;const qt=dn;dn=null,this.setClear(qt)}},getReversed:function(){return Kt},setTest:function(Bt){Bt?we(n.DEPTH_TEST):Ue(n.DEPTH_TEST)},setMask:function(Bt){Lt!==Bt&&!nt&&(n.depthMask(Bt),Lt=Bt)},setFunc:function(Bt){if(Kt&&(Bt=BV[Bt]),cn!==Bt){switch(Bt){case c5:n.depthFunc(n.NEVER);break;case u5:n.depthFunc(n.ALWAYS);break;case d5:n.depthFunc(n.LESS);break;case T1:n.depthFunc(n.LEQUAL);break;case h5:n.depthFunc(n.EQUAL);break;case f5:n.depthFunc(n.GEQUAL);break;case p5:n.depthFunc(n.GREATER);break;case m5:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}cn=Bt}},setLocked:function(Bt){nt=Bt},setClear:function(Bt){dn!==Bt&&(dn=Bt,Kt&&(Bt=1-Bt),n.clearDepth(Bt))},reset:function(){nt=!1,Lt=null,cn=null,dn=null,Kt=!1}}}function i(){let nt=!1,Kt=null,Lt=null,cn=null,dn=null,Bt=null,Ht=null,qt=null,Fn=null;return{setTest:function(xe){nt||(xe?we(n.STENCIL_TEST):Ue(n.STENCIL_TEST))},setMask:function(xe){Kt!==xe&&!nt&&(n.stencilMask(xe),Kt=xe)},setFunc:function(xe,Oe,Ge){(Lt!==xe||cn!==Oe||dn!==Ge)&&(n.stencilFunc(xe,Oe,Ge),Lt=xe,cn=Oe,dn=Ge)},setOp:function(xe,Oe,Ge){(Bt!==xe||Ht!==Oe||qt!==Ge)&&(n.stencilOp(xe,Oe,Ge),Bt=xe,Ht=Oe,qt=Ge)},setLocked:function(xe){nt=xe},setClear:function(xe){Fn!==xe&&(n.clearStencil(xe),Fn=xe)},reset:function(){nt=!1,Kt=null,Lt=null,cn=null,dn=null,Bt=null,Ht=null,qt=null,Fn=null}}}const s=new t,a=new r,o=new i,l=new WeakMap,u=new WeakMap;let d={},h={},f={},p=new WeakMap,g=[],A=null,x=!1,b=null,_=null,M=null,T=null,L=null,D=null,P=null,O=new tr(0,0,0),F=0,U=!1,B=null,z=null,H=null,X=null,W=null;const J=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let ee=!1,ae=0;const le=n.getParameter(n.VERSION);le.indexOf("WebGL")!==-1?(ae=parseFloat(/^WebGL (\d)/.exec(le)[1]),ee=ae>=1):le.indexOf("OpenGL ES")!==-1&&(ae=parseFloat(/^OpenGL ES (\d)/.exec(le)[1]),ee=ae>=2);let Z=null,Y={};const re=n.getParameter(n.SCISSOR_BOX),_e=n.getParameter(n.VIEWPORT),Ee=new Rr().fromArray(re),Ae=new Rr().fromArray(_e);function te(nt,Kt,Lt,cn){const dn=new Uint8Array(4),Bt=n.createTexture();n.bindTexture(nt,Bt),n.texParameteri(nt,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(nt,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ht=0;Ht<Lt;Ht++)nt===n.TEXTURE_3D||nt===n.TEXTURE_2D_ARRAY?n.texImage3D(Kt,0,n.RGBA,1,1,cn,
vendor: 13,353 bytes, line 4245
42450,n.RGBA,n.UNSIGNED_BYTE,dn):n.texImage2D(Kt+Ht,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,dn);return Bt}const ve={};ve[n.TEXTURE_2D]=te(n.TEXTURE_2D,n.TEXTURE_2D,1),ve[n.TEXTURE_CUBE_MAP]=te(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),ve[n.TEXTURE_2D_ARRAY]=te(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),ve[n.TEXTURE_3D]=te(n.TEXTURE_3D,n.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),we(n.DEPTH_TEST),a.setFunc(T1),Fe(!1),Ze(FI),we(n.CULL_FACE),St(qo);function we(nt){d[nt]!==!0&&(n.enable(nt),d[nt]=!0)}function Ue(nt){d[nt]!==!1&&(n.disable(nt),d[nt]=!1)}function ze(nt,Kt){return f[nt]!==Kt?(n.bindFramebuffer(nt,Kt),f[nt]=Kt,nt===n.DRAW_FRAMEBUFFER&&(f[n.FRAMEBUFFER]=Kt),nt===n.FRAMEBUFFER&&(f[n.DRAW_FRAMEBUFFER]=Kt),!0):!1}function yt(nt,Kt){let Lt=g,cn=!1;if(nt){Lt=p.get(Kt),Lt===void 0&&(Lt=[],p.set(Kt,Lt));const dn=nt.textures;if(Lt.length!==dn.length||Lt[0]!==n.COLOR_ATTACHMENT0){for(let Bt=0,Ht=dn.length;Bt<Ht;Bt++)Lt[Bt]=n.COLOR_ATTACHMENT0+Bt;Lt.length=dn.length,cn=!0}}else Lt[0]!==n.BACK&&(Lt[0]=n.BACK,cn=!0);cn&&n.drawBuffers(Lt)}function mt(nt){return A!==nt?(n.useProgram(nt),A=nt,!0):!1}const bt={[Ol]:n.FUNC_ADD,[AV]:n.FUNC_SUBTRACT,[xV]:n.FUNC_REVERSE_SUBTRACT};bt[jce]=n.MIN,bt[Ice]=n.MAX;const dt={[Mm]:n.ZERO,[vV]:n.ONE,[yV]:n.SRC_COLOR,[dw]:n.SRC_ALPHA,[EV]:n.SRC_ALPHA_SATURATE,[SV]:n.DST_COLOR,[wV]:n.DST_ALPHA,[bV]:n.ONE_MINUS_SRC_COLOR,[hw]:n.ONE_MINUS_SRC_ALPHA,[TV]:n.ONE_MINUS_DST_COLOR,[_V]:n.ONE_MINUS_DST_ALPHA,[oMe]:n.CONSTANT_COLOR,[lMe]:n.ONE_MINUS_CONSTANT_COLOR,[cMe]:n.CONSTANT_ALPHA,[uMe]:n.ONE_MINUS_CONSTANT_ALPHA};function St(nt,Kt,Lt,cn,dn,Bt,Ht,qt,Fn,xe){if(nt===qo){x===!0&&(Ue(n.BLEND),x=!1);return}if(x===!1&&(we(n.BLEND),x=!0),nt!==Dv){if(nt!==b||xe!==U){if((_!==Ol||L!==Ol)&&(n.blendEquation(n.FUNC_ADD),_=Ol,L=Ol),xe)switch(nt){case dl:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case HA:n.blendFunc(n.ONE,n.ONE);break;case WA:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case XA:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:sn("WebGLState: Invalid blending: ",nt);break}else switch(nt){case dl:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case HA:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case WA:sn("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case XA:sn("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:sn("WebGLState: Invalid blending: ",nt);break}M=null,T=null,D=null,P=null,O.set(0,0,0),F=0,b=nt,U=xe}return}dn=dn||Kt,Bt=Bt||Lt,Ht=Ht||cn,(Kt!==_||dn!==L)&&(n.blendEquationSeparate(bt[Kt],bt[dn]),_=Kt,L=dn),(Lt!==M||cn!==T||Bt!==D||Ht!==P)&&(n.blendFuncSeparate(dt[Lt],dt[cn],dt[Bt],dt[Ht]),M=Lt,T=cn,D=Bt,P=Ht),(qt.equals(O)===!1||Fn!==F)&&(n.blendColor(qt.r,qt.g,qt.b,Fn),O.copy(qt),F=Fn),b=nt,U=!1}function kt(nt,Kt){nt.side===Fa?Ue(n.CULL_FACE):we(n.CULL_FACE);let Lt=nt.side===us;Kt&&(Lt=!Lt),Fe(Lt),nt.blending===dl&&nt.transparent===!1?St(qo):St(nt.blending,nt.blendEquation,nt.blendSrc,nt.blendDst,nt.blendEquationAlpha,nt.blendSrcAlpha,nt.blendDstAlpha,nt.blendColor,nt.blendAlpha,nt.premultipliedAlpha),a.setFunc(nt.depthFunc),a.setTest(nt.depthTest),a.setMask(nt.depthWrite),s.setMask(nt.colorWrite);const cn=nt.stencilWrite;o.setTest(cn),cn&&(o.setMask(nt.stencilWriteMask),o.setFunc(nt.stencilFunc,nt.stencilRef,nt.stencilFuncMask),o.setOp(nt.stencilFail,nt.stencilZFail,nt.stencilZPass)),ft(nt.polygonOffset,nt.polygonOffsetFactor,nt.polygonOffsetUnits),nt.alphaToCoverage===!0?we(n.SAMPLE_ALPHA_TO_COVERAGE):Ue(n.SAMPLE_ALPHA_TO_COVERAGE)}function Fe(nt){B!==nt&&(nt?n.frontFace(n.CW):n.frontFace(n.CCW),B=nt)}function Ze(nt){nt!==Lce?(we(n.CULL_FACE),nt!==z&&(nt===FI?n.cullFace(n.BACK):nt===Oce?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Ue(n.CULL_FACE),z=nt}function Ye(nt){nt!==H&&(ee&&n.lineWidth(nt),H=nt)}function ft(nt,Kt,Lt){nt?(we(n.POLYGON_OFFSET_FILL),(X!==Kt||W!==Lt)&&(X=Kt,W=Lt,a.getReversed()&&(Kt=-Kt),n.polygonOffset(Kt,Lt))):Ue(n.POLYGON_OFFSET_FILL)}function At(nt){nt?we(n.SCISSOR_TEST):Ue(n.SCISSOR_TEST)}function Ce(nt){nt===void 0&&(nt=n.TEXTURE0+J-1),Z!==nt&&(n.activeTexture(nt),Z=nt)}function Se(nt,Kt,Lt){Lt===void 0&&(Z===null?Lt=n.TEXTURE0+J-1:Lt=Z);let cn=Y[Lt];cn===void 0&&(cn={type:void 0,texture:void 0},Y[Lt]=cn),(cn.type!==nt||cn.texture!==Kt)&&(Z!==Lt&&(n.activeTexture(Lt),Z=Lt),n.bindTexture(nt,Kt||ve[nt]),cn.type=nt,cn.texture=Kt)}function qe(){const nt=Y[Z];nt!==void 0&&nt.type!==void 0&&(n.bindTexture(nt.type,null),nt.type=void 0,nt.texture=void 0)}function pt(){try{n.compressedTexImage2D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function Te(){try{n.compressedTexImage3D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function oe(){try{n.texSubImage2D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function ge(){try{n.texSubImage3D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function Ne(){try{n.compressedTexSubImage2D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function ke(){try{n.compressedTexSubImage3D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function Xe(){try{n.texStorage2D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function et(){try{n.texStorage3D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function Qe(){try{n.texImage2D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function lt(){try{n.texImage3D(...arguments)}catch(nt){sn("WebGLState:",nt)}}function tt(nt){return h[nt]!==void 0?h[nt]:n.getParameter(nt)}function Ft(nt,Kt){h[nt]!==Kt&&(n.pixelStorei(nt,Kt),h[nt]=Kt)}function Mt(nt){Ee.equals(nt)===!1&&(n.scissor(nt.x,nt.y,nt.z,nt.w),Ee.copy(nt))}function Nt(nt){Ae.equals(nt)===!1&&(n.viewport(nt.x,nt.y,nt.z,nt.w),Ae.copy(nt))}function Je(nt,Kt){let Lt=u.get(Kt);Lt===void 0&&(Lt=new WeakMap,u.set(Kt,Lt));let cn=Lt.get(nt);cn===void 0&&(cn=n.getUniformBlockIndex(Kt,nt.name),Lt.set(nt,cn))}function fn(nt,Kt){const cn=u.get(Kt).get(nt);l.get(Kt)!==cn&&(n.uniformBlockBinding(Kt,cn,nt.__bindingPointIndex),l.set(Kt,cn))}function Tn(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),a.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),n.pixelStorei(n.PACK_ALIGNMENT,4),n.pixelStorei(n.UNPACK_ALIGNMENT,4),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL),n.pixelStorei(n.PACK_ROW_LENGTH,0),n.pixelStorei(n.PACK_SKIP_PIXELS,0),n.pixelStorei(n.PACK_SKIP_ROWS,0),n.pixelStorei(n.UNPACK_ROW_LENGTH,0),n.pixelStorei(n.UNPACK_IMAGE_HEIGHT,0),n.pixelStorei(n.UNPACK_SKIP_PIXELS,0),n.pixelStorei(n.UNPACK_SKIP_ROWS,0),n.pixelStorei(n.UNPACK_SKIP_IMAGES,0),d={},h={},Z=null,Y={},f={},p=new WeakMap,g=[],A=null,x=!1,b=null,_=null,M=null,T=null,L=null,D=null,P=null,O=new tr(0,0,0),F=0,U=!1,B=null,z=null,H=null,X=null,W=null,Ee.set(0,0,n.canvas.width,n.canvas.height),Ae.set(0,0,n.canvas.width,n.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:we,disable:Ue,bindFramebuffer:ze,drawBuffers:yt,useProgram:mt,setBlending:St,setMaterial:kt,setFlipSided:Fe,setCullFace:Ze,setLineWidth:Ye,setPolygonOffset:ft,setScissorTest:At,activeTexture:Ce,bindTexture:Se,unbindTexture:qe,compressedTexImage2D:pt,compressedTexImage3D:Te,texImage2D:Qe,texImage3D:lt,pixelStorei:Ft,getParameter:tt,updateUBOMapping:Je,uniformBlockBinding:fn,texStorage2D:Xe,texStorage3D:et,texSubImage2D:oe,texSubImage3D:ge,compressedTexSubImage2D:Ne,compressedTexSubImage3D:ke,scissor:Mt,viewport:Nt,reset:Tn}}function uLe(n,e,t,r,i,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 Jt,d=new WeakMap,h=new Set;let f;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function A(Te,oe){return g?new OffscreenCanvas(Te,oe):b5("canvas")}function x(Te,oe,ge){let Ne=1;const ke=pt(Te);if((ke.width>ge||ke.height>ge)&&(Ne=ge/Math.max(ke.width,ke.height)),Ne<1)if(typeof HTMLImageElement<"u"&&Te instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Te instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Te instanceof ImageBitmap||typeof VideoFrame<"u"&&Te instanceof VideoFrame){const Xe=Math.floor(Ne*ke.width),et=Math.floor(Ne*ke.height);f===void 0&&(f=A(Xe,et));const Qe=oe?A(Xe,et):f;return Qe.width=Xe,Qe.height=et,Qe.getContext("2d").drawImage(Te,0,0,Xe,et),an("WebGLRenderer: Texture has been resized from ("+ke.width+"x"+ke.height+") to ("+Xe+"x"+et+")."),Qe}else return"data"in Te&&an("WebGLRenderer: Image in DataTexture is too big ("+ke.width+"x"+ke.height+")."),Te;return Te}function b(Te){return Te.generateMipmaps}function _(Te){n.generateMipmap(Te)}function M(Te){return Te.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:Te.isWebGL3DRenderTarget?n.TEXTURE_3D:Te.isWebGLArrayRenderTarget||Te.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function T(Te,oe,ge,Ne,ke,Xe=!1){if(Te!==null){if(n[Te]!==void 0)return n[Te];an("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Te+"'")}let et;Ne&&(et=e.get("EXT_texture_norm16"),et||an("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let Qe=oe;if(oe===n.RED&&(ge===n.FLOAT&&(Qe=n.R32F),ge===n.HALF_FLOAT&&(Qe=n.R16F),ge===n.UNSIGNED_BYTE&&(Qe=n.R8),ge===n.UNSIGNED_SHORT&&et&&(Qe=et.R16_EXT),ge===n.SHORT&&et&&(Qe=et.R16_SNORM_EXT)),oe===n.RED_INTEGER&&(ge===n.UNSIGNED_BYTE&&(Qe=n.R8UI),ge===n.UNSIGNED_SHORT&&(Qe=n.R16UI),ge===n.UNSIGNED_INT&&(Qe=n.R32UI),ge===n.BYTE&&(Qe=n.R8I),ge===n.SHORT&&(Qe=n.R16I),ge===n.INT&&(Qe=n.R32I)),oe===n.RG&&(ge===n.FLOAT&&(Qe=n.RG32F),ge===n.HALF_FLOAT&&(Qe=n.RG16F),ge===n.UNSIGNED_BYTE&&(Qe=n.RG8),ge===n.UNSIGNED_SHORT&&et&&(Qe=et.RG16_EXT),ge===n.SHORT&&et&&(Qe=et.RG16_SNORM_EXT)),oe===n.RG_INTEGER&&(ge===n.UNSIGNED_BYTE&&(Qe=n.RG8UI),ge===n.UNSIGNED_SHORT&&(Qe=n.RG16UI),ge===n.UNSIGNED_INT&&(Qe=n.RG32UI),ge===n.BYTE&&(Qe=n.RG8I),ge===n.SHORT&&(Qe=n.RG16I),ge===n.INT&&(Qe=n.RG32I)),oe===n.RGB_INTEGER&&(ge===n.UNSIGNED_BYTE&&(Qe=n.RGB8UI),ge===n.UNSIGNED_SHORT&&(Qe=n.RGB16UI),ge===n.UNSIGNED_INT&&(Qe=n.RGB32UI),ge===n.BYTE&&(Qe=n.RGB8I),ge===n.SHORT&&(Qe=n.RGB16I),ge===n.INT&&(Qe=n.RGB32I)),oe===n.RGBA_INTEGER&&(ge===n.UNSIGNED_BYTE&&(Qe=n.RGBA8UI),ge===n.UNSIGNED_SHORT&&(Qe=n.RGBA16UI),ge===n.UNSIGNED_INT&&(Qe=n.RGBA32UI),ge===n.BYTE&&(Qe=n.RGBA8I),ge===n.SHORT&&(Qe=n.RGBA16I),ge===n.INT&&(Qe=n.RGBA32I)),oe===n.RGB&&(ge===n.UNSIGNED_SHORT&&et&&(Qe=et.RGB16_EXT),ge===n.SHORT&&et&&(Qe=et.RGB16_SNORM_EXT),ge===n.UNSIGNED_INT_5_9_9_9_REV&&(Qe=n.RGB9_E5),ge===n.UNSIGNED_INT_10F_11F_11F_REV&&(Qe=n.R11F_G11F_B10F)),oe===n.RGBA){const lt=Xe?Bw:_r.getTransfer(ke);ge===n.FLOAT&&(Qe=n.RGBA32F),ge===n.HALF_FLOAT&&(Qe=n.RGBA16F),ge===n.UNSIGNED_BYTE&&(Qe=lt===$n?n.SRGB8_ALPHA8:n.RGBA8),ge===n.UNSIGNED_SHORT&&et&&(Qe=et.RGBA16_EXT),ge===n.SHORT&&et&&(Qe=et.RGBA16_SNORM_EXT),ge===n.UNSIGNED_SHORT_4_4_4_4&&(Qe=n.RGBA4),ge===n.UNSIGNED_SHORT_5_5_5_1&&(Qe=n.RGB5_A1)}return(Qe===n.R16F||Qe===n.R32F||Qe===n.RG16F||Qe===n.RG32F||Qe===n.RGBA16F||Qe===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Qe}function L(Te,oe){let ge;return Te?oe===null||oe===ts||oe===Ku?ge=n.DEPTH24_STENCIL8:oe===ia?ge=n.DEPTH32F_STENCIL8:oe===jh&&(ge=n.DEPTH24_STENCIL8,an("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):oe===null||oe===ts||oe===Ku?ge=n.DEPTH_COMPONENT24:oe===ia?ge=n.DEPTH_COMPONENT32F:oe===jh&&(ge=n.DEPTH_COMPONENT16),ge}function D(Te,oe){return b(Te)===!0||Te.isFramebufferTexture&&Te.minFilter!==cs&&Te.minFilter!==bs?Math.log2(Math.max(oe.width,oe.height))+1:Te.mipmaps!==void 0&&Te.mipmaps.length>0?Te.mipmaps.length:Te.isCompressedTexture&&Array.isArray(Te.image)?oe.mipmaps.length:1}function P(Te){const oe=Te.target;oe.removeEventListener("dispose",P),F(oe),oe.isVideoTexture&&d.delete(oe),oe.isHTMLTexture&&h.delete(oe)}function O(Te){const oe=Te.target;oe.removeEventListener("dispose",O),B(oe)}function F(Te){const oe=r.get(Te);if(oe.__webglInit===void 0)return;const ge=Te.source,Ne=p.get(ge);if(Ne){const ke=Ne[oe.__cacheKey];ke.usedTimes--,ke.usedTimes===0&&U(Te),Object.keys(Ne).length===0&&p.delete(ge)}r.remove(Te)}function U(Te){const oe=r.get(Te);n.deleteTexture(oe.__webglTexture);const ge=Te.source,Ne=p.get(ge);delete Ne[oe.__cacheKey],a.memory.textures--}function B(Te){const oe=r.get(Te);if(Te.depthTexture&&(Te.depthTexture.dispose(),r.remove(Te.depthTexture)),Te.isWebGLCubeRen
vendor: 8,962 bytes, line 4245
4245derTarget)for(let Ne=0;Ne<6;Ne++){if(Array.isArray(oe.__webglFramebuffer[Ne]))for(let ke=0;ke<oe.__webglFramebuffer[Ne].length;ke++)n.deleteFramebuffer(oe.__webglFramebuffer[Ne][ke]);else n.deleteFramebuffer(oe.__webglFramebuffer[Ne]);oe.__webglDepthbuffer&&n.deleteRenderbuffer(oe.__webglDepthbuffer[Ne])}else{if(Array.isArray(oe.__webglFramebuffer))for(let Ne=0;Ne<oe.__webglFramebuffer.length;Ne++)n.deleteFramebuffer(oe.__webglFramebuffer[Ne]);else n.deleteFramebuffer(oe.__webglFramebuffer);if(oe.__webglDepthbuffer&&n.deleteRenderbuffer(oe.__webglDepthbuffer),oe.__webglMultisampledFramebuffer&&n.deleteFramebuffer(oe.__webglMultisampledFramebuffer),oe.__webglColorRenderbuffer)for(let Ne=0;Ne<oe.__webglColorRenderbuffer.length;Ne++)oe.__webglColorRenderbuffer[Ne]&&n.deleteRenderbuffer(oe.__webglColorRenderbuffer[Ne]);oe.__webglDepthRenderbuffer&&n.deleteRenderbuffer(oe.__webglDepthRenderbuffer)}const ge=Te.textures;for(let Ne=0,ke=ge.length;Ne<ke;Ne++){const Xe=r.get(ge[Ne]);Xe.__webglTexture&&(n.deleteTexture(Xe.__webglTexture),a.memory.textures--),r.remove(ge[Ne])}r.remove(Te)}let z=0;function H(){z=0}function X(){return z}function W(Te){z=Te}function J(){const Te=z;return Te>=i.maxTextures&&an("WebGLTextures: Trying to use "+Te+" texture units while this GPU supports only "+i.maxTextures),z+=1,Te}function ee(Te){const oe=[];return oe.push(Te.wrapS),oe.push(Te.wrapT),oe.push(Te.wrapR||0),oe.push(Te.magFilter),oe.push(Te.minFilter),oe.push(Te.anisotropy),oe.push(Te.internalFormat),oe.push(Te.format),oe.push(Te.type),oe.push(Te.generateMipmaps),oe.push(Te.premultiplyAlpha),oe.push(Te.flipY),oe.push(Te.unpackAlignment),oe.push(Te.colorSpace),oe.join()}function ae(Te,oe){const ge=r.get(Te);if(Te.isVideoTexture&&Se(Te),Te.isRenderTargetTexture===!1&&Te.isExternalTexture!==!0&&Te.version>0&&ge.__version!==Te.version){const Ne=Te.image;if(Ne===null)an("WebGLRenderer: Texture marked for update but no image data found.");else if(Ne.complete===!1)an("WebGLRenderer: Texture marked for update but image is incomplete");else{Ue(ge,Te,oe);return}}else Te.isExternalTexture&&(ge.__webglTexture=Te.sourceTexture?Te.sourceTexture:null);t.bindTexture(n.TEXTURE_2D,ge.__webglTexture,n.TEXTURE0+oe)}function le(Te,oe){const ge=r.get(Te);if(Te.isRenderTargetTexture===!1&&Te.version>0&&ge.__version!==Te.version){Ue(ge,Te,oe);return}else Te.isExternalTexture&&(ge.__webglTexture=Te.sourceTexture?Te.sourceTexture:null);t.bindTexture(n.TEXTURE_2D_ARRAY,ge.__webglTexture,n.TEXTURE0+oe)}function Z(Te,oe){const ge=r.get(Te);if(Te.isRenderTargetTexture===!1&&Te.version>0&&ge.__version!==Te.version){Ue(ge,Te,oe);return}t.bindTexture(n.TEXTURE_3D,ge.__webglTexture,n.TEXTURE0+oe)}function Y(Te,oe){const ge=r.get(Te);if(Te.isCubeDepthTexture!==!0&&Te.version>0&&ge.__version!==Te.version){ze(ge,Te,oe);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ge.__webglTexture,n.TEXTURE0+oe)}const re={[Jv]:n.REPEAT,[Uu]:n.CLAMP_TO_EDGE,[ey]:n.MIRRORED_REPEAT},_e={[cs]:n.NEAREST,[OV]:n.NEAREST_MIPMAP_NEAREST,[a0]:n.NEAREST_MIPMAP_LINEAR,[bs]:n.LINEAR,[Rb]:n.LINEAR_MIPMAP_NEAREST,[hu]:n.LINEAR_MIPMAP_LINEAR},Ee={[jV]:n.NEVER,[UV]:n.ALWAYS,[W8]:n.LESS,[$1]:n.LEQUAL,[IV]:n.EQUAL,[eg]:n.GEQUAL,[y5]:n.GREATER,[FV]:n.NOTEQUAL};function Ae(Te,oe){if(oe.type===ia&&e.has("OES_texture_float_linear")===!1&&(oe.magFilter===bs||oe.magFilter===Rb||oe.magFilter===a0||oe.magFilter===hu||oe.minFilter===bs||oe.minFilter===Rb||oe.minFilter===a0||oe.minFilter===hu)&&an("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(Te,n.TEXTURE_WRAP_S,re[oe.wrapS]),n.texParameteri(Te,n.TEXTURE_WRAP_T,re[oe.wrapT]),(Te===n.TEXTURE_3D||Te===n.TEXTURE_2D_ARRAY)&&n.texParameteri(Te,n.TEXTURE_WRAP_R,re[oe.wrapR]),n.texParameteri(Te,n.TEXTURE_MAG_FILTER,_e[oe.magFilter]),n.texParameteri(Te,n.TEXTURE_MIN_FILTER,_e[oe.minFilter]),oe.compareFunction&&(n.texParameteri(Te,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(Te,n.TEXTURE_COMPARE_FUNC,Ee[oe.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(oe.magFilter===cs||oe.minFilter!==a0&&oe.minFilter!==hu||oe.type===ia&&e.has("OES_texture_float_linear")===!1)return;if(oe.anisotropy>1||r.get(oe).__currentAnisotropy){const ge=e.get("EXT_texture_filter_anisotropic");n.texParameterf(Te,ge.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(oe.anisotropy,i.getMaxAnisotropy())),r.get(oe).__currentAnisotropy=oe.anisotropy}}}function te(Te,oe){let ge=!1;Te.__webglInit===void 0&&(Te.__webglInit=!0,oe.addEventListener("dispose",P));const Ne=oe.source;let ke=p.get(Ne);ke===void 0&&(ke={},p.set(Ne,ke));const Xe=ee(oe);if(Xe!==Te.__cacheKey){ke[Xe]===void 0&&(ke[Xe]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,ge=!0),ke[Xe].usedTimes++;const et=ke[Te.__cacheKey];et!==void 0&&(ke[Te.__cacheKey].usedTimes--,et.usedTimes===0&&U(oe)),Te.__cacheKey=Xe,Te.__webglTexture=ke[Xe].texture}return ge}function ve(Te,oe,ge){return Math.floor(Math.floor(Te/ge)/oe)}function we(Te,oe,ge,Ne){const Xe=Te.updateRanges;if(Xe.length===0)t.texSubImage2D(n.TEXTURE_2D,0,0,0,oe.width,oe.height,ge,Ne,oe.data);else{Xe.sort((Ft,Mt)=>Ft.start-Mt.start);let et=0;for(let Ft=1;Ft<Xe.length;Ft++){const Mt=Xe[et],Nt=Xe[Ft],Je=Mt.start+Mt.count,fn=ve(Nt.start,oe.width,4),Tn=ve(Mt.start,oe.width,4);Nt.start<=Je+1&&fn===Tn&&ve(Nt.start+Nt.count-1,oe.width,4)===fn?Mt.count=Math.max(Mt.count,Nt.start+Nt.count-Mt.start):(++et,Xe[et]=Nt)}Xe.length=et+1;const Qe=t.getParameter(n.UNPACK_ROW_LENGTH),lt=t.getParameter(n.UNPACK_SKIP_PIXELS),tt=t.getParameter(n.UNPACK_SKIP_ROWS);t.pixelStorei(n.UNPACK_ROW_LENGTH,oe.width);for(let Ft=0,Mt=Xe.length;Ft<Mt;Ft++){const Nt=Xe[Ft],Je=Math.floor(Nt.start/4),fn=Math.ceil(Nt.count/4),Tn=Je%oe.width,nt=Math.floor(Je/oe.width),Kt=fn,Lt=1;t.pixelStorei(n.UNPACK_SKIP_PIXELS,Tn),t.pixelStorei(n.UNPACK_SKIP_ROWS,nt),t.texSubImage2D(n.TEXTURE_2D,0,Tn,nt,Kt,Lt,ge,Ne,oe.data)}Te.clearUpdateRanges(),t.pixelStorei(n.UNPACK_ROW_LENGTH,Qe),t.pixelStorei(n.UNPACK_SKIP_PIXELS,lt),t.pixelStorei(n.UNPACK_SKIP_ROWS,tt)}}function Ue(Te,oe,ge){let Ne=n.TEXTURE_2D;(oe.isDataArrayTexture||oe.isCompressedArrayTexture)&&(Ne=n.TEXTURE_2D_ARRAY),oe.isData3DTexture&&(Ne=n.TEXTURE_3D);const ke=te(Te,oe),Xe=oe.source;t.bindTexture(Ne,Te.__webglTexture,n.TEXTURE0+ge);const et=r.get(Xe);if(Xe.version!==et.__version||ke===!0){if(t.activeTexture(n.TEXTURE0+ge),(typeof ImageBitmap<"u"&&oe.image instanceof ImageBitmap)===!1){const Lt=_r.getPrimaries(_r.workingColorSpace),cn=oe.colorSpace===Iu?null:_r.getPrimaries(oe.colorSpace),dn=oe.colorSpace===Iu||Lt===cn?n.NONE:n.BROWSER_DEFAULT_WEBGL;t.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,oe.flipY),t.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),t.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,dn)}t.pixelStorei(n.UNPACK_ALIGNMENT,oe.unpackAlignment);let lt=x(oe.image,!1,i.maxTextureSize);lt=qe(oe,lt);const tt=s.convert(oe.format,oe.colorSpace),Ft=s.convert(oe.type);let Mt=T(oe.internalFormat,tt,Ft,oe.normalized,oe.colorSpace,oe.isVideoTexture);Ae(Ne,oe);let Nt;const Je=oe.mipmaps,fn=oe.isVideoTexture!==!0,Tn=et.__version===void 0||ke===!0,nt=Xe.dataReady,Kt=D(oe,lt);if(oe.isDepthTexture)Mt=L(oe.format===vc,oe.type),Tn&&(fn?t.texStorage2D(n.TEXTURE_2D,1,Mt,lt.width,lt.height):t.texImage2D(n.TEXTURE_2D,0,Mt,lt.width,lt.height,0,tt,Ft,null));else if(oe.isDataTexture)if(Je.length>0){fn&&Tn&&t.texStorage2D(n.TEXTURE_2D,Kt,Mt,Je[0].width,Je[0].height);for(let Lt=0,cn=Je.length;Lt<cn;Lt++)Nt=Je[Lt],fn?nt&&t.texSubImage2D(n.TEXTURE_2D,Lt,0,0,Nt.width,Nt.height,tt,Ft,Nt.data):t.texImage2D(n.TEXTURE_2D,Lt,Mt,Nt.width,Nt.height,0,tt,Ft,Nt.data);oe.generateMipmaps=!1}else fn?(Tn&&t.texStorage2D(n.TEXTURE_2D,Kt,Mt,lt.width,lt.height),nt&&we(oe,lt,tt,Ft)):t.texImage2D(n.TEXTURE_2D,0,Mt,lt.width,lt.height,0,tt,Ft,lt.data);else if(oe.isCompressedTexture)if(oe.isCompressedArrayTexture){fn&&Tn&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Kt,Mt,Je[0].width,Je[0].height,lt.depth);for(let Lt=0,cn=Je.length;Lt<cn;Lt++)if(Nt=Je[Lt],oe.format!==to)if(tt!==null)if(fn){if(nt)if(oe.layerUpdates.size>0){const dn=qI(Nt.width,Nt.height,oe.format,oe.type);for(const Bt of oe.layerUpdates){const Ht=Nt.data.subarray(Bt*dn/Nt.data.BYTES_PER_ELEMENT,(Bt+1)*dn/Nt.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Lt,0,0,Bt,Nt.width,Nt.height,1,tt,Ht)}oe.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Lt,0,0,0,Nt.width,Nt.height,lt.depth,tt,Nt.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,Lt,Mt,Nt.width,Nt.height,lt.depth,0,Nt.data,0,0);else an("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else fn?nt&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,Lt,0,0,0,Nt.width,Nt.height,lt.depth,tt,Ft,Nt.data):t.texImage3D(n.TEXTURE_2D_ARRAY,Lt,Mt,Nt.width,Nt.height,lt.depth,0,tt,Ft,Nt.data)}else{fn&&Tn&&t.texStorage2D(n.TEXTURE_2D,Kt,Mt,Je[0].width,Je[0].height);for(let Lt=0,cn=Je.length;
vendor: 2,028 bytes, line 4245
4245Lt<cn;Lt++)Nt=Je[Lt],oe.format!==to?tt!==null?fn?nt&&t.compressedTexSubImage2D(n.TEXTURE_2D,Lt,0,0,Nt.width,Nt.height,tt,Nt.data):t.compressedTexImage2D(n.TEXTURE_2D,Lt,Mt,Nt.width,Nt.height,0,Nt.data):an("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):fn?nt&&t.texSubImage2D(n.TEXTURE_2D,Lt,0,0,Nt.width,Nt.height,tt,Ft,Nt.data):t.texImage2D(n.TEXTURE_2D,Lt,Mt,Nt.width,Nt.height,0,tt,Ft,Nt.data)}else if(oe.isDataArrayTexture)if(fn){if(Tn&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Kt,Mt,lt.width,lt.height,lt.depth),nt)if(oe.layerUpdates.size>0){const Lt=qI(lt.width,lt.height,oe.format,oe.type);for(const cn of oe.layerUpdates){const dn=lt.data.subarray(cn*Lt/lt.data.BYTES_PER_ELEMENT,(cn+1)*Lt/lt.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,cn,lt.width,lt.height,1,tt,Ft,dn)}oe.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,lt.width,lt.height,lt.depth,tt,Ft,lt.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Mt,lt.width,lt.height,lt.depth,0,tt,Ft,lt.data);else if(oe.isData3DTexture)fn?(Tn&&t.texStorage3D(n.TEXTURE_3D,Kt,Mt,lt.width,lt.height,lt.depth),nt&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,lt.width,lt.height,lt.depth,tt,Ft,lt.data)):t.texImage3D(n.TEXTURE_3D,0,Mt,lt.width,lt.height,lt.depth,0,tt,Ft,lt.data);else if(oe.isFramebufferTexture){if(Tn)if(fn)t.texStorage2D(n.TEXTURE_2D,Kt,Mt,lt.width,lt.height);else{let Lt=lt.width,cn=lt.height;for(let dn=0;dn<Kt;dn++)t.texImage2D(n.TEXTURE_2D,dn,Mt,Lt,cn,0,tt,Ft,null),Lt>>=1,cn>>=1}}else if(oe.isHTMLTexture){if("texElementImage2D"in n){const Lt=n.canvas;if(Lt.hasAttribute("layoutsubtree")||Lt.setAttribute("layoutsubtree","true"),lt.parentNode!==Lt){Lt.appendChild(lt),h.add(oe),Lt.onpaint=cn=>{const dn=cn.changedElements;for(const Bt of h)dn.includes(Bt.image)&&(Bt.needsUpdate=!0)},Lt.requestPaint();return}if(n.texElementImage2D.length===3)n.texElementImage2D(n.TEXTURE_2D,n.RGBA8,lt);else{const dn=n.RGBA,Bt=n.RGBA,Ht=n.UNSIGNED_BYTE;n.texElementImage2D(n.TEXTURE_2D,0,dn,Bt,Ht,lt)}
vendor: 1,032 bytes, line 4245
4245n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE)}}else if(Je.length>0){if(fn&&Tn){const Lt=pt(Je[0]);t.texStorage2D(n.TEXTURE_2D,Kt,Mt,Lt.width,Lt.height)}for(let Lt=0,cn=Je.length;Lt<cn;Lt++)Nt=Je[Lt],fn?nt&&t.texSubImage2D(n.TEXTURE_2D,Lt,0,0,tt,Ft,Nt):t.texImage2D(n.TEXTURE_2D,Lt,Mt,tt,Ft,Nt);oe.generateMipmaps=!1}else if(fn){if(Tn){const Lt=pt(lt);t.texStorage2D(n.TEXTURE_2D,Kt,Mt,Lt.width,Lt.height)}nt&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,tt,Ft,lt)}else t.texImage2D(n.TEXTURE_2D,0,Mt,tt,Ft,lt);b(oe)&&_(Ne),et.__version=Xe.version,oe.onUpdate&&oe.onUpdate(oe)}Te.__version=oe.version}function ze(Te,oe,ge){if(oe.image.length!==6)return;const Ne=te(Te,oe),ke=oe.source;t.bindTexture(n.TEXTURE_CUBE_MAP,Te.__webglTexture,n.TEXTURE0+ge);const Xe=r.get(ke);if(ke.version!==Xe.__version||Ne===!0){t.activeTexture(n.TEXTURE0+ge);const et=_r.getPrimaries(_r.workingColorSpace),Qe=oe.colorSpace
vendor: 28,934 bytes, lines 4245-4269
4245===Iu?null:_r.getPrimaries(oe.colorSpace),lt=oe.colorSpace===Iu||et===Qe?n.NONE:n.BROWSER_DEFAULT_WEBGL;t.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,oe.flipY),t.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),t.pixelStorei(n.UNPACK_ALIGNMENT,oe.unpackAlignment),t.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,lt);const tt=oe.isCompressedTexture||oe.image[0].isCompressedTexture,Ft=oe.image[0]&&oe.image[0].isDataTexture,Mt=[];for(let Bt=0;Bt<6;Bt++)!tt&&!Ft?Mt[Bt]=x(oe.image[Bt],!0,i.maxCubemapSize):Mt[Bt]=Ft?oe.image[Bt].image:oe.image[Bt],Mt[Bt]=qe(oe,Mt[Bt]);const Nt=Mt[0],Je=s.convert(oe.format,oe.colorSpace),fn=s.convert(oe.type),Tn=T(oe.internalFormat,Je,fn,oe.normalized,oe.colorSpace),nt=oe.isVideoTexture!==!0,Kt=Xe.__version===void 0||Ne===!0,Lt=ke.dataReady;let cn=D(oe,Nt);Ae(n.TEXTURE_CUBE_MAP,oe);let dn;if(tt){nt&&Kt&&t.texStorage2D(n.TEXTURE_CUBE_MAP,cn,Tn,Nt.width,Nt.height);for(let Bt=0;Bt<6;Bt++){dn=Mt[Bt].mipmaps;for(let Ht=0;Ht<dn.length;Ht++){const qt=dn[Ht];oe.format!==to?Je!==null?nt?Lt&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,Ht,0,0,qt.width,qt.height,Je,qt.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,Ht,Tn,qt.width,qt.height,0,qt.data):an("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):nt?Lt&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,Ht,0,0,qt.width,qt.height,Je,fn,qt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,Ht,Tn,qt.width,qt.height,0,Je,fn,qt.data)}}}else{if(dn=oe.mipmaps,nt&&Kt){dn.length>0&&cn++;const Bt=pt(Mt[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,cn,Tn,Bt.width,Bt.height)}for(let Bt=0;Bt<6;Bt++)if(Ft){nt?Lt&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,0,0,0,Mt[Bt].width,Mt[Bt].height,Je,fn,Mt[Bt].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,0,Tn,Mt[Bt].width,Mt[Bt].height,0,Je,fn,Mt[Bt].data);for(let Ht=0;Ht<dn.length;Ht++){const Fn=dn[Ht].image[Bt].image;nt?Lt&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,Ht+1,0,0,Fn.width,Fn.height,Je,fn,Fn.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,Ht+1,Tn,Fn.width,Fn.height,0,Je,fn,Fn.data)}}else{nt?Lt&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,0,0,0,Je,fn,Mt[Bt]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,0,Tn,Je,fn,Mt[Bt]);for(let Ht=0;Ht<dn.length;Ht++){const qt=dn[Ht];nt?Lt&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,Ht+1,0,0,Je,fn,qt.image[Bt]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Bt,Ht+1,Tn,Je,fn,qt.image[Bt])}}}b(oe)&&_(n.TEXTURE_CUBE_MAP),Xe.__version=ke.version,oe.onUpdate&&oe.onUpdate(oe)}Te.__version=oe.version}function yt(Te,oe,ge,Ne,ke,Xe){const et=s.convert(ge.format,ge.colorSpace),Qe=s.convert(ge.type),lt=T(ge.internalFormat,et,Qe,ge.normalized,ge.colorSpace),tt=r.get(oe),Ft=r.get(ge);if(Ft.__renderTarget=oe,!tt.__hasExternalTextures){const Mt=Math.max(1,oe.width>>Xe),Nt=Math.max(1,oe.height>>Xe);ke===n.TEXTURE_3D||ke===n.TEXTURE_2D_ARRAY?t.texImage3D(ke,Xe,lt,Mt,Nt,oe.depth,0,et,Qe,null):t.texImage2D(ke,Xe,lt,Mt,Nt,0,et,Qe,null)}t.bindFramebuffer(n.FRAMEBUFFER,Te),Ce(oe)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Ne,ke,Ft.__webglTexture,0,At(oe)):(ke===n.TEXTURE_2D||ke>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ke<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Ne,ke,Ft.__webglTexture,Xe),t.bindFramebuffer(n.FRAMEBUFFER,null)}function mt(Te,oe,ge){if(n.bindRenderbuffer(n.RENDERBUFFER,Te),oe.depthBuffer){const Ne=oe.depthTexture,ke=Ne&&Ne.isDepthTexture?Ne.type:null,Xe=L(oe.stencilBuffer,ke),et=oe.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;Ce(oe)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,At(oe),Xe,oe.width,oe.height):ge?n.renderbufferStorageMultisample(n.RENDERBUFFER,At(oe),Xe,oe.width,oe.height):n.renderbufferStorage(n.RENDERBUFFER,Xe,oe.width,oe.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,et,n.RENDERBUFFER,Te)}else{const Ne=oe.textures;for(let ke=0;ke<Ne.length;ke++){const Xe=Ne[ke],et=s.convert(Xe.format,Xe.colorSpace),Qe=s.convert(Xe.type),lt=T(Xe.internalFormat,et,Qe,Xe.normalized,Xe.colorSpace);Ce(oe)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,At(oe),lt,oe.width,oe.height):ge?n.renderbufferStorageMultisample(n.RENDERBUFFER,At(oe),lt,oe.width,oe.height):n.renderbufferStorage(n.RENDERBUFFER,lt,oe.width,oe.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function bt(Te,oe,ge){const Ne=oe.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(n.FRAMEBUFFER,Te),!(oe.depthTexture&&oe.depthTexture.isDepthTexture))throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");const ke=r.get(oe.depthTexture);if(ke.__renderTarget=oe,(!ke.__webglTexture||oe.depthTexture.image.width!==oe.width||oe.depthTexture.image.height!==oe.height)&&(oe.depthTexture.image.width=oe.width,oe.depthTexture.image.height=oe.height,oe.depthTexture.needsUpdate=!0),Ne){if(ke.__webglInit===void 0&&(ke.__webglInit=!0,oe.depthTexture.addEventListener("dispose",P)),ke.__webglTexture===void 0){ke.__webglTexture=n.createTexture(),t.bindTexture(n.TEXTURE_CUBE_MAP,ke.__webglTexture),Ae(n.TEXTURE_CUBE_MAP,oe.depthTexture);const tt=s.convert(oe.depthTexture.format),Ft=s.convert(oe.depthTexture.type);let Mt;oe.depthTexture.format===ml?Mt=n.DEPTH_COMPONENT24:oe.depthTexture.format===vc&&(Mt=n.DEPTH24_STENCIL8);for(let Nt=0;Nt<6;Nt++)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Nt,0,Mt,oe.width,oe.height,0,tt,Ft,null)}}else ae(oe.depthTexture,0);const Xe=ke.__webglTexture,et=At(oe),Qe=Ne?n.TEXTURE_CUBE_MAP_POSITIVE_X+ge:n.TEXTURE_2D,lt=oe.depthTexture.format===vc?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;if(oe.depthTexture.format===ml)Ce(oe)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,lt,Qe,Xe,0,et):n.framebufferTexture2D(n.FRAMEBUFFER,lt,Qe,Xe,0);else if(oe.depthTexture.format===vc)Ce(oe)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,lt,Qe,Xe,0,et):n.framebufferTexture2D(n.FRAMEBUFFER,lt,Qe,Xe,0);else throw new Error("THREE.WebGLTextures: Unknown depthTexture format.")}function dt(Te){const oe=r.get(Te),ge=Te.isWebGLCubeRenderTarget===!0;if(oe.__boundDepthTexture!==Te.depthTexture){const Ne=Te.depthTexture;if(oe.__depthDisposeCallback&&oe.__depthDisposeCallback(),Ne){const ke=()=>{delete oe.__boundDepthTexture,delete oe.__depthDisposeCallback,Ne.removeEventListener("dispose",ke)};Ne.addEventListener("dispose",ke),oe.__depthDisposeCallback=ke}oe.__boundDepthTexture=Ne}if(Te.depthTexture&&!oe.__autoAllocateDepthBuffer)if(ge)for(let Ne=0;Ne<6;Ne++)bt(oe.__webglFramebuffer[Ne],Te,Ne);else{const Ne=Te.texture.mipmaps;Ne&&Ne.length>0?bt(oe.__webglFramebuffer[0],Te,0):bt(oe.__webglFramebuffer,Te,0)}else if(ge){oe.__webglDepthbuffer=[];for(let Ne=0;Ne<6;Ne++)if(t.bindFramebuffer(n.FRAMEBUFFER,oe.__webglFramebuffer[Ne]),oe.__webglDepthbuffer[Ne]===void 0)oe.__webglDepthbuffer[Ne]=n.createRenderbuffer(),mt(oe.__webglDepthbuffer[Ne],Te,!1);else{const ke=Te.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Xe=oe.__webglDepthbuffer[Ne];n.bindRenderbuffer(n.RENDERBUFFER,Xe),n.framebufferRenderbuffer(n.FRAMEBUFFER,ke,n.RENDERBUFFER,Xe)}}else{const Ne=Te.texture.mipmaps;if(Ne&&Ne.length>0?t.bindFramebuffer(n.FRAMEBUFFER,oe.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,oe.__webglFramebuffer),oe.__webglDepthbuffer===void 0)oe.__webglDepthbuffer=n.createRenderbuffer(),mt(oe.__webglDepthbuffer,Te,!1);else{const ke=Te.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Xe=oe.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,Xe),n.framebufferRenderbuffer(n.FRAMEBUFFER,ke,n.RENDERBUFFER,Xe)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function St(Te,oe,ge){const Ne=r.get(Te);oe!==void 0&&yt(Ne.__webglFramebuffer,Te,Te.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),ge!==void 0&&dt(Te)}function kt(Te){const oe=Te.texture,ge=r.get(Te),Ne=r.get(oe);Te.addEventListener("dispose",O);const ke=Te.textures,Xe=Te.isWebGLCubeRenderTarget===!0,et=ke.length>1;if(et||(Ne.__webglTexture===void 0&&(Ne.__webglTexture=n.createTexture()),Ne.__version=oe.version,a.memory.textures++),Xe){ge.__webglFramebuffer=[];for(let Qe=0;Qe<6;Qe++)if(oe.mipmaps&&oe.mipmaps.length>0){ge.__webglFramebuffer[Qe]=[];for(let lt=0;lt<oe.mipmaps.length;lt++)ge.__webglFramebuffer[Qe][lt]=n.createFramebuffer()}else ge.__webglFramebuffer[Qe]=n.createFramebuffer()}else{if(oe.mipmaps&&oe.mipmaps.length>0){ge.__webglFramebuffer=[];for(let Qe=0;Qe<oe.mipmaps.length;Qe++)ge.__webglFramebuffer[Qe]=n.createFramebuffer()}else ge.__webglFramebuffer=n.createFramebuffer();if(et)for(let Qe=0,lt=ke.length;Qe<lt;Qe++){const tt=r.get(ke[Qe]);tt.__webglTexture===void 0&&(tt.__webglTexture=n.createTexture(),a.memory.textures++)}if(Te.samples>0&&Ce(Te)===!1){ge.__webglMultisampledFramebuffer=n.createFramebuffer(),ge.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ge.__webglMultisampledFramebuffer);for(let Qe=0;Qe<ke.length;Qe++){const lt=ke[Qe];ge.__webglColorRenderbuffer[Qe]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,ge.__webglColorRenderbuffer[Qe]);const tt=s.convert(lt.format,lt.colorSpace),Ft=s.convert(lt.type),Mt=T(lt.internalFormat,tt,Ft,lt.normalized,lt.colorSpace,Te.isXRRenderTarget===!0),Nt=At(Te);n.renderbufferStorageMultisample(n.RENDERBUFFER,Nt,Mt,Te.width,Te.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Qe,n.RENDERBUFFER,ge.__webglColorRenderbuffer[Qe])}n.bindRenderbuffer(n.RENDERBUFFER,null),Te.depthBuffer&&(ge.__webglDepthRenderbuffer=n.createRenderbuffer(),mt(ge.__webglDepthRenderbuffer,Te,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(Xe){t.bindTexture(n.TEXTURE_CUBE_MAP,Ne.__webglTexture),Ae(n.TEXTURE_CUBE_MAP,oe);for(let Qe=0;Qe<6;Qe++)if(oe.mipmaps&&oe.mipmaps.length>0)for(let lt=0;lt<oe.mipmaps.length;lt++)yt(ge.__webglFramebuffer[Qe][lt],Te,oe,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Qe,lt);else yt(ge.__webglFramebuffer[Qe],Te,oe,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Qe,0);b(oe)&&_(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(et){for(let Qe=0,lt=ke.length;Qe<lt;Qe++){const tt=ke[Qe],Ft=r.get(tt);let Mt=n.TEXTURE_2D;(Te.isWebGL3DRenderTarget||Te.isWebGLArrayRenderTarget)&&(Mt=Te.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(Mt,Ft.__webglTexture),Ae(Mt,tt),yt(ge.__webglFramebuffer,Te,tt,n.COLOR_ATTACHMENT0+Qe,Mt,0),b(tt)&&_(Mt)}t.unbindTexture()}else{let Qe=n.TEXTURE_2D;if((Te.isWebGL3DRenderTarget||Te.isWebGLArrayRenderTarget)&&(Qe=Te.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(Qe,Ne.__webglTexture),Ae(Qe,oe),oe.mipmaps&&oe.mipmaps.length>0)for(let lt=0;lt<oe.mipmaps.length;lt++)yt(ge.__webglFramebuffer[lt],Te,oe,n.COLOR_ATTACHMENT0,Qe,lt);else yt(ge.__webglFramebuffer,Te,oe,n.COLOR_ATTACHMENT0,Qe,0);b(oe)&&_(Qe),t.unbindTexture()}Te.depthBuffer&&dt(Te)}function Fe(Te){const oe=Te.textures;for(let ge=0,Ne=oe.length;ge<Ne;ge++){const ke=oe[ge];if(b(ke)){const Xe=M(Te),et=r.get(ke).__webglTexture;t.bindTexture(Xe,et),_(Xe),t.unbindTexture()}}}const Ze=[],Ye=[];function ft(Te){if(Te.samples>0){if(Ce(Te)===!1){const oe=Te.textures,ge=Te.width,Ne=Te.height;let ke=n.COLOR_BUFFER_BIT;const Xe=Te.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,et=r.get(Te),Qe=oe.length>1;if(Qe)for(let tt=0;tt<oe.length;tt++)t.bindFramebuffer(n.FRAMEBUFFER,et.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+tt,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,et.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+tt,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,et.__webglMultisampledFramebuffer);const lt=Te.texture.mipmaps;lt&<.length>0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,et.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,et.__webglFramebuffer);for(let tt=0;tt<oe.length;tt++){if(Te.resolveDepthBuffer&&(Te.depthBuffer&&(ke|=n.DEPTH_BUFFER_BIT),Te.stencilBuffer&&Te.resolveStencilBuffer&&(ke|=n.STENCIL_BUFFER_BIT)),Qe){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,et.__webglColorRenderbuffer[tt]);const Ft=r.get(oe[tt]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,Ft,0)}n.blitFramebuffer(0,0,ge,Ne,0,0,ge,Ne,ke,n.NEAREST),l===!0&&(Ze.length=0,Ye.length=0,Ze.push(n.COLOR_ATTACHMENT0+tt),Te.depthBuffer&&Te.resolveDepthBuffer===!1&&(Ze.push(Xe),Ye.push(Xe),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,Ye)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,Ze))}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),Qe)for(let tt=0;tt<oe.length;tt++){t.bindFramebuffer(n.FRAMEBUFFER,et.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+tt,n.RENDERBUFFER,et.__webglColorRenderbuffer[tt]);const Ft=r.get(oe[tt]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,et.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+tt,n.TEXTURE_2D,Ft,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,et.__webglMultisampledFramebuffer)}else if(Te.depthBuffer&&Te.resolveDepthBuffer===!1&&l){const oe=Te.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[oe])}}}function At(Te){return Math.min(i.maxSamples,Te.samples)}function Ce(Te){const oe=r.get(Te);return Te.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&oe.__useRenderToTexture!==!1}function Se(Te){const oe=a.render.frame;d.get(Te)!==oe&&(d.set(Te,oe),Te.update())}function qe(Te,oe){const ge=Te.colorSpace,Ne=Te.format,ke=Te.type;return Te.isCompressedTexture===!0||Te.isVideoTexture===!0||ge!==Uw&&ge!==Iu&&(_r.getTransfer(ge)===$n?(Ne!==to||ke!==Zs)&&an("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):sn("WebGLTextures: Unsupported texture color space:",ge)),oe}function pt(Te){return typeof HTMLImageElement<"u"&&Te instanceof HTMLImageElement?(u.width=Te.naturalWidth||Te.width,u.height=Te.naturalHeight||Te.height):typeof VideoFrame<"u"&&Te instanceof VideoFrame?(u.width=Te.displayWidth,u.height=Te.displayHeight):(u.width=Te.width,u.height=Te.height),u}this.allocateTextureUnit=J,this.resetTextureUnits=H,this.getTextureUnits=X,this.setTextureUnits=W,this.setTexture2D=ae,this.setTexture2DArray=le,this.setTexture3D=Z,this.setTextureCube=Y,this.rebindTextures=St,this.setupRenderTarget=kt,this.updateRenderTargetMipmap=Fe,this.updateMultisampleRenderTarget=ft,this.setupDepthRenderbuffer=dt,this.setupFrameBufferTexture=yt,this.useMultisampledRTT=Ce,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function dLe(n,e){function t(r,i=Iu){let s;const a=_r.getTransfer(i);if(r===Zs)return n.UNSIGNED_BYTE;if(r===yT)return n.UNSIGNED_SHORT_4_4_4_4;if(r===bT)return n.UNSIGNED_SHORT_5_5_5_1;if(r===wT)return n.UNSIGNED_INT_5_9_9_9_REV;if(r===_T)return n.UNSIGNED_INT_10F_11F_11F_REV;if(r===a1)return n.BYTE;if(r===o1)return n.SHORT;if(r===jh)return n.UNSIGNED_SHORT;if(r===oo)return n.INT;if(r===ts)return n.UNSIGNED_INT;if(r===ia)return n.FLOAT;if(r===Js)return n.HALF_FLOAT;if(r===H8)return n.ALPHA;if(r===by)return n.RGB;if(r===to)return n.RGBA;if(r===ml)return n.DEPTH_COMPONENT;if(r===vc)return n.DEPTH_STENCIL;if(r===wy)return n.RED;if(r===G1)return n.RED_INTEGER;if(r===fl)return n.RG;if(r===q1)return n.RG_INTEGER;if(r===b_)return n.RGBA_INTEGER;if(r===l1||r===c1||r===u1||r===d1)if(a===$n)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(r===l1)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===c1)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===u1)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===d1)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(r===l1)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===c1)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===u1)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===d1)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===g5||r===A5||r===x5||r===v5)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(r===g5)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===A5)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===x5)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===v5)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===fw||r===pw||r===mw||r===gw||r===Aw||r===C1||r===xw)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(r===fw||r===pw)return a===$n?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(r===mw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(r===gw)return s.COMPRESSED_R11_EAC;if(r===Aw)return s.COMPRESSED_SIGNED_R11_EAC;if(r===C1)return s.COMPRESSED_RG11_EAC;if(r===xw)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(r===vw||r===yw||r===bw||r===ww||r===_w||r===Sw||r===Tw||r===Ew||r===Cw||r===Nw||r===Mw||r===kw||r===Rw||r===Pw)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(r===vw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===yw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===bw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===ww)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===_w)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Sw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===Tw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===Ew)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===Cw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===Nw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Mw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===kw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===Rw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===Pw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Lw||r===Ow||r===Dw)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(r===Lw)return a===$n?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===Ow)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===Dw)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===jw||r===Iw||r===N1||r===Fw)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(r===jw)return s.COMPRESSED_RED_RGTC1_EXT;if(r===Iw)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===N1)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===Fw)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Ku?n.UNSIGNED_INT_24_8:n[r]!==void 0?n[r]:null}return{convert:t}}const hLe=` 4246void main() { 4247 4248 gl_Position = vec4( position, 1.0 ); 4249 4250}`,fLe=` 4251uniform sampler2DArray depthColor; 4252uniform float depthWidth; 4253uniform float depthHeight; 4254 4255void main() { 4256 4257 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 4258 4259 if ( coord.x >= 1.0 ) { 4260 4261 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 4262 4263 } else { 4264 4265 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 4266 4267 } 4268 4269}`;class pLe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const r=new Qce(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,r=new Nc({vertexShader:hLe,fragmentShader:fLe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ns(new ET(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class mLe extends ef{constructor(e,t){super();const r=this;let i=null,s=1,a=null,o="local-floor",l=1,u=null,d=null,h=null,f=null,p=null,g=null;const A=typeof XRWebGLBinding<"u",x=new pLe,b={},_=t.getContextAttributes();let M=null,T=null;const L=[],D=[],P=new Jt;let O=null;const F=new ul;F.viewport=new Rr;const U=new ul;U.viewport=new Rr;const B=[F,U],z=new pue;let H=null,X=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(te){let ve=L[te];return ve===void 0&&(ve=new p6,L[te]=ve),ve.getTargetRaySpace()},this.getControllerGrip=function(te){let ve=L[te];return ve===void 0&&(ve=new p6,L[te]=ve),ve.getGripSpace()},this.getHand=function(te){let ve=L[te];return ve===void 0&&(ve=new p6,L[te]=ve),ve.getHandSpace()};function W(te){const ve=D.indexOf(te.inputSource);if(ve===-1)return;const we=L[ve];we!==void 0&&(we.update(te.inputSource,te.frame,u||a),we.dispatchEvent({type:te.type,data:te.inputSource}))}function J(){i.removeEventListener("select",W),i.removeEventListener("selectstart",W),i.removeEventListener("selectend",W),i.removeEventListener("squeeze",W),i.removeEventListener("squeezestart",W),i.removeEventListener("squeezeend",W),i.removeEventListener("end",J),i.removeEventListener("inputsourceschange",ee);for(let te=0;te<L.length;te++){const ve=D[te];ve!==null&&(D[te]=null,L[te].disconnect(ve))}H=null,X=null,x.reset();for(const te in b)delete b[te];e.setRenderTarget(M),p=null,f=null,h=null,i=null,T=null,Ae.stop(),r.isPresenting=!1,e.setPixelRatio(O),e.setSize(P.width,P.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(te){s=te,r.isPresenting===!0&&an("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(te){o=te,r.isPresenting===!0&&an("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||a},this.setReferenceSpace=function(te){u=te},this.getBaseLayer=function(){return f!==null?f:p},this.getBinding=function(){return h===null&&A&&(h=new XRWebGLBinding(i,t)),h},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(te){if(i=te,i!==null){if(M=e.getRenderTarget(),i.addEventListener("select",W),i.addEventListener("selectstart",W),i.addEventListener("selectend",W),i.addEventListener("squeeze",W),i.addEventListener("squeezestart",W),i.addEventListener("squeezeend",W),i.addEventListener("end",J),i.addEventListener("inputsourceschange",ee),_.xrCompatible!==!0&&await t.makeXRCompatible(),O=e.getPixelRatio(),e.getSize(P),A&&"createProjectionLayer"in XRWebGLBinding.prototype){let we=null,Ue=null,ze=null;_.depth&&(ze=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,we=_.stencil?vc:ml,Ue=_.stencil?Ku:ts);const yt={colorFormat:t.RGBA8,depthFormat:ze,scaleFactor:s};h=this.getBinding(),f=h.createProjectionLayer(yt),i.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),T=new Kf(f.textureWidth,f.textureHeight,{format:to,type:Zs,depthTexture:new Bl(f.textureWidth,f.textureHeight,Ue,void 0,void 0,void 0,void 0,void 0,void 0,we),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}else{const we={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:s};p=new XRWebGLLayer(i,t,we),i.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),T=new Kf(p.framebufferWidth,p.framebufferHeight,{format:to,type:Zs,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}T.isXRRenderTarget=!0,this.setFoveation(l),u=null,a=await i.requestReferenceSpace(o),Ae.setContext(i),Ae.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};function ee(te){for(let ve=0;ve<te.removed.length;ve++){const we=te.removed[ve],Ue=D.indexOf(we);Ue>=0&&(D[Ue]=null,L[Ue].disconnect(we))}for(let ve=0;ve<te.added.length;ve++){const we=te.added[ve];let Ue=D.indexOf(we);if(Ue===-1){for(let yt=0;yt<L.length;yt++)if(yt>=D.length){D.push(we),Ue=yt;break}else if(D[yt]===null){D[yt]=we,Ue=yt;break}if(Ue===-1)break}const ze=L[Ue];ze&&ze.connect(we)}}const ae=new Ve,le=new Ve;function Z(te,ve,we){ae.setFromMatrixPosition(ve.matrixWorld),le.setFromMatrixPosition(we.matrixWorld);const Ue=ae.distanceTo(le),ze=ve.projectionMatrix.elements,yt=we.projectionMatrix.elements,mt=ze[14]/(ze[10]-1),bt=ze[14]/(ze[10]+1),dt=(ze[9]+1)/ze[5],St=(ze[9]-1)/ze[5],kt=(ze[8]-1)/ze[0],Fe=(yt[8]+1)/yt[0],Ze=mt*kt,Ye=mt*Fe,ft=Ue/(-kt+Fe),At=ft*-kt;if(ve.matrixWorld.decompose(te.position,te.quaternion,te.scale),te.translateX(At),te.translateZ(ft),te.matrixWorld.compose(te.position,te.quaternion,te.scale),te.matrixWorldInverse.copy(te.matrixWorld).invert(),ze[10]===-1)te.projectionMatrix.copy(ve.projectionMatrix),te.projectionMatrixInverse.copy(ve.projectionMatrixInverse);else{const Ce=mt+ft,Se=bt+ft,qe=Ze-At,pt=Ye+(Ue-At),Te=dt*bt/Se*Ce,oe=St*bt/Se*Ce;te.projectionMatrix.makePerspective(qe,pt,Te,oe,Ce,Se),te.projectionMatrixInverse.copy(te.projectionMatrix).invert()}}function Y(te,ve){ve===null?te.matrixWorld.copy(te.matrix):te.matrixWorld.multiplyMatrices(ve.matrixWorld,te.matrix),te.matrixWorldInverse.copy(te.matrixWorld).invert()}this.updateCamera=function(te){if(i===null)return;let ve=te.near,we=te.far;x.texture!==null&&(x.depthNear>0&&(ve=x.depthNear),x.depthFar>0&&(we=x.depthFar)),z.near=U.near=F.near=ve,z.far=U.far=F.far=we,(H!==z.near||X!==z.far)&&(i.updateRenderState({depthNear:z.near,depthFar:z.far}),H=z.near,X=z.far),z.layers.mask=te.layers.mask|6,F.layers.mask=z.layers.mask&-5,U.layers.mask=z.layers.mask&-3;const Ue=te.parent,ze=z.cameras;Y(z,Ue);for(let yt=0;yt<ze.length;yt++)Y(ze[yt],Ue);ze.length===2?Z(z,F,U):z.projectionMatrix.copy(F.projectionMatrix),re(te,z,Ue)};function re(te,ve,we){we===null?te.matrix.copy(ve.matrixWorld):(te.matrix.copy(we.matrixWorld),te.matrix.invert(),te.matrix.multiply(ve.matrixWorld)),te.matrix.decompose(te.position,te.quaternion,te.scale),te.updateMatrixWorld(!0),te.projectionMatrix.copy(ve.projectionMatrix),te.projectionMatrixInverse.copy(ve.projectionMatrixInverse),te.isPerspectiveCamera&&(te.fov=ty*2*Math.atan(1/te.projectionMatrix.elements[5]),te.zoom=1)}this.getCamera=function(){return z},this.getFoveation=function(){if(!(f===null&&p===null))return l},this.setFoveation=function(te){l=te,f!==null&&(f.fixedFoveation=te),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=te)},this.hasDepthSensing=function(){return x.texture!==null},this.getDepthSensingMesh=function(){return x.getMesh(z)},this.getCameraTexture=function(te){return b[te]};let _e=null;function Ee(te,ve){if(d=ve.getViewerPose(u||a),g=ve,d!==null){const we=d.views;p!==null&&(e.setRenderTargetFramebuffer(T,p.framebuffer),e.setRenderTarget(T));let Ue=!1;we.length!==z.cameras.length&&(z.cameras.length=0,Ue=!0);for(let bt=0;bt<we.length;bt++){const dt=we[bt];let St=null;if(p!==null)St=p.getViewport(dt);else{const Fe=h.getViewSubImage(f,dt);St=Fe.viewport,bt===0&&(e.setRenderTargetTextures(T,Fe.colorTexture,Fe.depthStencilTexture),e.setRenderTarget(T))}let kt=B[bt];kt===void 0&&(kt=new ul,kt.layers.enable(bt),kt.viewport=new Rr,B[bt]=kt),kt.matrix.fromArray(dt.transform.matrix),kt.matrix.decompose(kt.position,kt.quaternion,kt.scale),kt.projectionMatrix.fromArray(dt.projectionMatrix),kt.projectionMatrixInverse.copy(kt.projectionMatrix).invert(),kt.viewport.set(St.x,St.y,St.width,St.height),bt===0&&(z.matrix.copy(kt.matrix),z.matrix.decompose(z.position,z.quaternion,z.scale)),Ue===!0&&z.cameras.push(kt)}const ze=i.enabledFeatures;if(ze&&ze.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&A){h=r.getBinding();const bt=h.getDepthInformation(we[0]);bt&&bt.isValid&&bt.texture&&x.init(bt,i.renderState)}if(ze&&ze.includes("camera-access")&&A){e.state.unbindTexture(),h=r.getBinding();for(let bt=0;bt<we.length;bt++){const dt=we[bt].camera;if(dt){let St=b[dt];St||(St=new Qce,b[dt]=St);const kt=h.getCameraImage(dt);St.sourceTexture=kt}}}}for(let we=0;we<L.length;we++){const Ue=D[we],ze=L[we];Ue!==null&&ze!==void 0&&ze.update(Ue,ve,u||a)}_e&&_e(te,ve),ve.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:ve}),g=null}const Ae=new gue;Ae.setAnimationLoop(Ee),this.setAnimationLoop=function(te){_e=te},this.dispose=function(){}}}const gLe=new kr,_ue=new Gr;_ue.set(-1,0,0,0,1,0,0,0,1);function ALe(n,e){function t(x,b){x.matrixAutoUpdate===!0&&x.updateMatrix(),b.value.copy(x.matrix)}function r(x,b){b.color.getRGB(x.fogColor.value,lue(n)),b.isFog?(x.fogNear.value=b.near,x.fogFar.value=b.far):b.isFogExp2&&(x.fogDensity.value=b.density)}function i(x,b,_,M,T){b.isNodeMaterial?b.uniformsNeedUpdate=!1:b.
4269isMeshBasicMaterial?s(x,b):b.isMeshLambertMaterial?(s(x,b),b.envMap&&(x.envMapIntensity.value=b.envMapIntensity)):b.isMeshToonMaterial?(s(x,b),h(x,b)):b.isMeshPhongMaterial?(s(x,b),d(x,b),b.envMap&&(x.envMapIntensity.value=b.envMapIntensity)):b.isMeshStandardMaterial?(s(x,b),f(x,b),b.isMeshPhysicalMaterial&&p(x,b,T)):b.isMeshMatcapMaterial?(s(x,b),g(x,b)):b.isMeshDepthMaterial?s(x,b):b.isMeshDistanceMaterial?(s(x,b),A(x,b)):b.isMeshNormalMaterial?s(x,b):b.isLineBasicMaterial?(a(x,b),b.isLineDashedMaterial&&o(x,b)):b.isPointsMaterial?l(x,b,_,M):b.isSpriteMaterial?u(x,b):b.isShadowMaterial?(x.color.value.copy(b.color),x.opacity.value=b.opacity):b.isShaderMaterial&&(b.uniformsNeedUpdate=!1)}function s(x,b){x.opacity.value=b.opacity,b.color&&x.diffuse.value.copy(b.color),b.emissive&&x.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity),b.map&&(x.map.value=b.map,t(b.map,x.mapTransform)),b.alphaMap&&(x.alphaMap.value=b.alphaMap,t(b.alphaMap,x.alphaMapTransform)),b.bumpMap&&(x.bumpMap.value=b.bumpMap,t(b.bumpMap,x.bumpMapTransform),x.bumpScale.value=b.bumpScale,b.side===us&&(x.bumpScale.value*=-1)),b.normalMap&&(x.normalMap.value=b.normalMap,t(b.normalMap,x.normalMapTransform),x.normalScale.value.copy(b.normalScale),b.side===us&&x.normalScale.value.negate()),b.displacementMap&&(x.displacementMap.value=b.displacementMap,t(b.displacementMap,x.displacementMapTransform),x.displacementScale.value=b.displacementScale,x.displacementBias.value=b.displacementBias),b.emissiveMap&&(x.emissiveMap.value=b.emissiveMap,t(b.emissiveMap,x.emissiveMapTransform)),b.specularMap&&(x.specularMap.value=b.specularMap,t(b.specularMap,x.specularMapTransform)),b.alphaTest>0&&(x.alphaTest.value=b.alphaTest);const _=e.get(b),M=_.envMap,T=_.envMapRotation;M&&(x.envMap.value=M,x.envMapRotation.value.setFromMatrix4(gLe.makeRotationFromEuler(T)).transpose(),M.isCubeTexture&&M.isRenderTargetTexture===!1&&x.envMapRotation.value.premultiply(_ue),x.reflectivity.value=b.reflectivity,x.ior.value=b.ior,x.refractionRatio.value=b.refractionRatio),b.lightMap&&(x.lightMap.value=b.lightMap,x.lightMapIntensity.value=b.lightMapIntensity,t(b.lightMap,x.lightMapTransform)),b.aoMap&&(x.aoMap.value=b.aoMap,x.aoMapIntensity.value=b.aoMapIntensity,t(b.aoMap,x.aoMapTransform))}function a(x,b){x.diffuse.value.copy(b.color),x.opacity.value=b.opacity,b.map&&(x.map.value=b.map,t(b.map,x.mapTransform))}function o(x,b){x.dashSize.value=b.dashSize,x.totalSize.value=b.dashSize+b.gapSize,x.scale.value=b.scale}function l(x,b,_,M){x.diffuse.value.copy(b.color),x.opacity.value=b.opacity,x.size.value=b.size*_,x.scale.value=M*.5,b.map&&(x.map.value=b.map,t(b.map,x.uvTransform)),b.alphaMap&&(x.alphaMap.value=b.alphaMap,t(b.alphaMap,x.alphaMapTransform)),b.alphaTest>0&&(x.alphaTest.value=b.alphaTest)}function u(x,b){x.diffuse.value.copy(b.color),x.opacity.value=b.opacity,x.rotation.value=b.rotation,b.map&&(x.map.value=b.map,t(b.map,x.mapTransform)),b.alphaMap&&(x.alphaMap.value=b.alphaMap,t(b.alphaMap,x.alphaMapTransform)),b.alphaTest>0&&(x.alphaTest.value=b.alphaTest)}function d(x,b){x.specular.value.copy(b.specular),x.shininess.value=Math.max(b.shininess,1e-4)}function h(x,b){b.gradientMap&&(x.gradientMap.value=b.gradientMap)}function f(x,b){x.metalness.value=b.metalness,b.metalnessMap&&(x.metalnessMap.value=b.metalnessMap,t(b.metalnessMap,x.metalnessMapTransform)),x.roughness.value=b.roughness,b.roughnessMap&&(x.roughnessMap.value=b.roughnessMap,t(b.roughnessMap,x.roughnessMapTransform)),b.envMap&&(x.envMapIntensity.value=b.envMapIntensity)}function p(x,b,_){x.ior.value=b.ior,b.sheen>0&&(x.sheenColor.value.copy(b.sheenColor).multiplyScalar(b.sheen),x.sheenRoughness.value=b.sheenRoughness,b.sheenColorMap&&(x.sheenColorMap.value=b.sheenColorMap,t(b.sheenColorMap,x.sheenColorMapTransform)),b.sheenRoughnessMap&&(x.sheenRoughnessMap.value=b.sheenRoughnessMap,t(b.sheenRoughnessMap,x.sheenRoughnessMapTransform))),b.clearcoat>0&&(x.clearcoat.value=b.clearcoat,x.clearcoatRoughness.value=b.clearcoatRoughness,b.clearcoatMap&&(x.clearcoatMap.value=b.clearcoatMap,t(b.clearcoatMap,x.clearcoatMapTransform)),b.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=b.clearcoatRoughnessMap,t(b.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),b.clearcoatNormalMap&&(x.clearcoatNormalMap.value=b.clearcoatNormalMap,t(b.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(b.clearcoatNormalScale),b.side===us&&x.clearcoatNormalScale.value.negate())),b.dispersion>0&&(x.dispersion.value=b.dispersion),b.iridescence>0&&(x.iridescence.value=b.iridescence,x.iridescenceIOR.value=b.iridescenceIOR,x.iridescenceThicknessMinimum.value=b.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=b.iridescenceThicknessRange[1],b.iridescenceMap&&(x.iridescenceMap.value=b.iridescenceMap,t(b.iridescenceMap,x.iridescenceMapTransform)),b.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=b.iridescenceThicknessMap,t(b.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),b.transmission>0&&(x.transmission.value=b.transmission,x.transmissionSamplerMap.value=_.texture,x.transmissionSamplerSize.value.set(_.width,_.height),b.transmissionMap&&(x.transmissionMap.value=b.transmissionMap,t(b.transmissionMap,x.transmissionMapTransform)),x.thickness.value=b.thickness,b.thicknessMap&&(x.thicknessMap.value=b.thicknessMap,t(b.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=b.attenuationDistance,x.attenuationColor.value.copy(b.attenuationColor)),b.anisotropy>0&&(x.anisotropyVector.value.set(b.anisotropy*Math.cos(b.anisotropyRotation),b.anisotropy*Math.sin(b.anisotropyRotation)),b.anisotropyMap&&(x.anisotropyMap.value=b.anisotropyMap,t(b.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=b.specularIntensity,x.specularColor.value.copy(b.specularColor),b.specularColorMap&&(x.specularColorMap.value=b.specularColorMap,t(b.specularColorMap,x.specularColorMapTransform)),b.specularIntensityMap&&(x.specularIntensityMap.value=b.specularIntensityMap,t(b.specularIntensityMap,x.specularIntensityMapTransform))}function g(x,b){b.matcap&&(x.matcap.value=b.matcap)}function A(x,b){const _=e.get(b).light;x.referencePosition.value.setFromMatrixPosition(_.matrixWorld),x.nearDistance.value=_.shadow.camera.near,x.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function xLe(n,e,t,r){let i={},s={},a=[];const o=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(T,L){const D=L.program;r.uniformBlockBinding(T,D)}function u(T,L){let D=i[T.id];D===void 0&&(x(T),D=d(T),i[T.id]=D,T.addEventListener("dispose",_));const P=L.program;r.updateUBOMapping(T,P);const O=e.render.frame;s[T.id]!==O&&(f(T),s[T.id]=O)}function d(T){const L=h();T.__bindingPointIndex=L;const D=n.createBuffer(),P=T.__size,O=T.usage;return n.bindBuffer(n.UNIFORM_BUFFER,D),n.bufferData(n.UNIFORM_BUFFER,P,O),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,L,D),D}function h(){for(let T=0;T<o;T++)if(a.indexOf(T)===-1)return a.push(T),T;return sn("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(T){const L=i[T.id],D=T.uniforms,P=T.__cache;n.bindBuffer(n.UNIFORM_BUFFER,L);for(let O=0,F=D.length;O<F;O++){const U=D[O];if(Array.isArray(U))for(let B=0,z=U.length;B<z;B++)p(U[B],O,B,P);else p(U,O,0,P)}n.bindBuffer(n.UNIFORM_BUFFER,null)}function p(T,L,D,P){if(A(T,L,D,P)===!0){const O=T.__offset,F=T.value;if(Array.isArray(F)){let U=0;for(let B=0;B<F.length;B++){const z=F[B],H=b(z);g(z,T.__data,U),typeof z!="number"&&typeof z!="boolean"&&!z.isMatrix3&&!ArrayBuffer.isView(z)&&(U+=H.storage/Float32Array.BYTES_PER_ELEMENT)}}else g(F,T.__data,0);n.bufferSubData(n.UNIFORM_BUFFER,O,T.__data)}}function g(T,L,D){typeof T=="number"||typeof T=="boolean"?L[0]=T:T.isMatrix3?(L[0]=T.elements[0],L[1]=T.elements[1],L[2]=T.elements[2],L[3]=0,L[4]=T.elements[3],L[5]=T.elements[4],L[6]=T.elements[5],L[7]=0,L[8]=T.elements[6],L[9]=T.elements[7],L[10]=T.elements[8],L[11]=0):ArrayBuffer.isView(T)?L.set(new T.constructor(T.buffer,T.byteOffset,L.length)):T.toArray(L,D)}function A(T,L,D,P){const O=T.value,F=L+"_"+D;if(P[F]===void 0)return typeof O=="number"||typeof O=="boolean"?P[F]=O:ArrayBuffer.isView(O)?P[F]=O.slice():P[F]=O.clone(),!0;{const U=P[F];if(typeof O=="number"||typeof O=="boolean"){if(U!==O)return P[F]=O,!0}else{if(ArrayBuffer.isView(O))return!0;
vendor: 6,706 bytes, line 4269
4269if(U.equals(O)===!1)return U.copy(O),!0}}return!1}function x(T){const L=T.uniforms;let D=0;const P=16;for(let F=0,U=L.length;F<U;F++){const B=Array.isArray(L[F])?L[F]:[L[F]];for(let z=0,H=B.length;z<H;z++){const X=B[z],W=Array.isArray(X.value)?X.value:[X.value];for(let J=0,ee=W.length;J<ee;J++){const ae=W[J],le=b(ae),Z=D%P,Y=Z%le.boundary,re=Z+Y;D+=Y,re!==0&&P-re<le.storage&&(D+=P-re),X.__data=new Float32Array(le.storage/Float32Array.BYTES_PER_ELEMENT),X.__offset=D,D+=le.storage}}}const O=D%P;return O>0&&(D+=P-O),T.__size=D,T.__cache={},this}function b(T){const L={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(L.boundary=4,L.storage=4):T.isVector2?(L.boundary=8,L.storage=8):T.isVector3||T.isColor?(L.boundary=16,L.storage=12):T.isVector4?(L.boundary=16,L.storage=16):T.isMatrix3?(L.boundary=48,L.storage=48):T.isMatrix4?(L.boundary=64,L.storage=64):T.isTexture?an("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(T)?(L.boundary=16,L.storage=T.byteLength):an("WebGLRenderer: Unsupported uniform value type.",T),L}function _(T){const L=T.target;L.removeEventListener("dispose",_);const D=a.indexOf(L.__bindingPointIndex);a.splice(D,1),n.deleteBuffer(i[L.id]),delete i[L.id],delete s[L.id]}function M(){for(const T in i)n.deleteBuffer(i[T]);a=[],i={},s={}}return{bind:l,update:u,dispose:M}}const vLe=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,14942,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 Mp=null;function yLe(){return Mp===null&&(Mp=new YV(vLe,16,16,fl,Js),Mp.name="DFG_LUT",Mp.minFilter=bs,Mp.magFilter=bs,Mp.wrapS=Uu,Mp.wrapT=Uu,Mp.generateMipmaps=!1,Mp.needsUpdate=!0),Mp}class bLe{constructor(e={}){const{canvas:t=Gce(),context:r=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:h=!1,reversedDepthBuffer:f=!1,outputBufferType:p=Zs}=e;this.isWebGLRenderer=!0;let g;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=r.getContextAttributes().alpha}else g=a;const A=p,x=new Set([b_,q1,G1]),b=new Set([Zs,ts,jh,Ku,yT,bT]),_=new Uint32Array(4),M=new Int32Array(4),T=new Ve;let L=null,D=null;const P=[],O=[];let F=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Il,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const U=this;let B=!1,z=null,H=null,X=null,W=null;this._outputColorSpace=Pl;let J=0,ee=0,ae=null,le=-1,Z=null;const Y=new Rr,re=new Rr;let _e=null;const Ee=new tr(0);let Ae=0,te=t.width,ve=t.height,we=1,Ue=null,ze=null;const yt=new Rr(0,0,te,ve),mt=new Rr(0,0,te,ve);let bt=!1;const dt=new ny;let St=!1,kt=!1;const Fe=new kr,Ze=new Ve,Ye=new Rr,ft={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let At=!1;function Ce(){return ae===null?we:1}let Se=r;function qe(Pe,He){return t.getContext(Pe,He)}try{const Pe={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${yy}`),t.addEventListener("webglcontextlost",Fn,!1),t.addEventListener("webglcontextrestored",xe,!1),t.addEventListener("webglcontextcreationerror",Oe,!1),Se===null){const He="webgl2";if(Se=qe(He,Pe),Se===null)throw qe(He)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(Pe){throw sn("WebGLRenderer: "+Pe.message),Pe}let pt,Te,oe,ge,Ne,ke,Xe,et,Qe,lt,tt,Ft,Mt,Nt,Je,fn,Tn,nt,Kt,Lt,cn,dn,Bt;
vendor: 4,101 bytes, line 4269
4269function Ht(){pt=new y7e(Se),pt.init(),cn=new dLe(Se,pt),Te=new h7e(Se,pt,e,cn),oe=new cLe(Se,pt),Te.reversedDepthBuffer&&f&&oe.buffers.depth.setReversed(!0),H=Se.createFramebuffer(),X=Se.createFramebuffer(),W=Se.createFramebuffer(),ge=new _7e(Se),Ne=new Y9e,ke=new uLe(Se,pt,oe,Ne,Te,cn,ge),Xe=new v7e(U),et=new C8e(Se),dn=new u7e(Se,et),Qe=new b7e(Se,et,ge,dn),lt=new T7e(Se,Qe,et,dn,ge),nt=new S7e(Se,Te,ke),Je=new f7e(Ne),tt=new X9e(U,Xe,pt,Te,dn,Je),Ft=new ALe(U,Ne),Mt=new K9e,Nt=new rLe(pt),Tn=new c7e(U,Xe,oe,lt,g,l),fn=new lLe(U,lt,Te),Bt=new xLe(Se,ge,Te,oe),Kt=new d7e(Se,pt,ge),Lt=new w7e(Se,pt,ge),ge.programs=tt.programs,U.capabilities=Te,U.extensions=pt,U.properties=Ne,U.renderLists=Mt,U.shadowMap=fn,U.state=oe,U.info=ge}Ht(),A!==Zs&&(F=new C7e(A,t.width,t.height,o,i,s));const qt=new mLe(U,Se);this.xr=qt,this.getContext=function(){return Se},this.getContextAttributes=function(){return Se.getContextAttributes()},this.forceContextLoss=function(){const Pe=pt.get("WEBGL_lose_context");Pe&&Pe.loseContext()},this.forceContextRestore=function(){const Pe=pt.get("WEBGL_lose_context");Pe&&Pe.restoreContext()},this.getPixelRatio=function(){return we},this.setPixelRatio=function(Pe){Pe!==void 0&&(we=Pe,this.setSize(te,ve,!1))},this.getSize=function(Pe){return Pe.set(te,ve)},this.setSize=function(Pe,He,ce=!0){if(qt.isPresenting){an("WebGLRenderer: Can't change size while VR device is presenting.");return}te=Pe,ve=He,t.width=Math.floor(Pe*we),t.height=Math.floor(He*we),ce===!0&&(t.style.width=Pe+"px",t.style.height=He+"px"),F!==null&&F.setSize(t.width,t.height),this.setViewport(0,0,Pe,He)},this.getDrawingBufferSize=function(Pe){return Pe.set(te*we,ve*we).floor()},this.setDrawingBufferSize=function(Pe,He,ce){te=Pe,ve=He,we=ce,t.width=Math.floor(Pe*ce),t.height=Math.floor(He*ce),this.setViewport(0,0,Pe,He)},this.setEffects=function(Pe){if(A===Zs){sn("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(Pe){for(let He=0;He<Pe.length;He++)if(Pe[He].isOutputPass===!0){an("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}F.setEffects(Pe||[])},this.getCurrentViewport=function(Pe){return Pe.copy(Y)},this.getViewport=function(Pe){return Pe.copy(yt)},this.setViewport=function(Pe,He,ce,at){Pe.isVector4?yt.set(Pe.x,Pe.y,Pe.z,Pe.w):yt.set(Pe,He,ce,at),oe.viewport(Y.copy(yt).multiplyScalar(we).round())},this.getScissor=function(Pe){return Pe.copy(mt)},this.setScissor=function(Pe,He,ce,at){Pe.isVector4?mt.set(Pe.x,Pe.y,Pe.z,Pe.w):mt.set(Pe,He,ce,at),oe.scissor(re.copy(mt).multiplyScalar(we).round())},this.getScissorTest=function(){return bt},this.setScissorTest=function(Pe){oe.setScissorTest(bt=Pe)},this.setOpaqueSort=function(Pe){Ue=Pe},this.setTransparentSort=function(Pe){ze=Pe},this.getClearColor=function(Pe){return Pe.copy(Tn.getClearColor())},this.setClearColor=function(){Tn.setClearColor(...arguments)},this.getClearAlpha=function(){return Tn.getClearAlpha()},this.setClearAlpha=function(){Tn.setClearAlpha(...arguments)},this.clear=function(Pe=!0,He=!0,ce=!0){let at=0;if(Pe){let vt=!1;if(ae!==null){const vn=ae.texture.format;vt=x.has(vn)}if(vt){const vn=ae.texture.type,Rn=b.has(vn),ln=Tn.getClearColor(),kn=Tn.getClearAlpha(),pe=ln.r,Nr=ln.g,zr=ln.b;Rn?(_[0]=pe,_[1]=Nr,_[2]=zr,_[3]=kn,Se.clearBufferuiv(Se.COLOR,0,_)):(M[0]=pe,M[1]=Nr,M[2]=zr,M[3]=kn,Se.clearBufferiv(Se.COLOR,0,M))}else at|=Se.COLOR_BUFFER_BIT}He&&(at|=Se.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),ce&&(at|=Se.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),at!==0&&Se.clear(at)},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(Pe){Pe.setRenderer(this),z=Pe},this.dispose=function(){t.removeEventListener("webglcontextlost",Fn,!1),t.removeEventListener("webglcontextrestored",xe,!1),t.removeEventListener("webglcontextcreationerror",Oe,!1),Tn.dispose(),Mt.dispose(),Nt.dispose(),Ne.dispose(),Xe.dis
vendor: 8,727 bytes, line 4269
4269pose(),lt.dispose(),dn.dispose(),Bt.dispose(),tt.dispose(),qt.dispose(),qt.removeEventListener("sessionstart",tn),qt.removeEventListener("sessionend",Qt),Pt.stop()};function Fn(Pe){Pe.preventDefault(),w5("WebGLRenderer: Context Lost."),B=!0}function xe(){w5("WebGLRenderer: Context Restored."),B=!1;const Pe=ge.autoReset,He=fn.enabled,ce=fn.autoUpdate,at=fn.needsUpdate,vt=fn.type;Ht(),ge.autoReset=Pe,fn.enabled=He,fn.autoUpdate=ce,fn.needsUpdate=at,fn.type=vt}function Oe(Pe){sn("WebGLRenderer: A WebGL context could not be created. Reason: ",Pe.statusMessage)}function Ge(Pe){const He=Pe.target;He.removeEventListener("dispose",Ge),$e(He)}function $e(Pe){m(Pe),Ne.remove(Pe)}function m(Pe){const He=Ne.get(Pe).programs;He!==void 0&&(He.forEach(function(ce){tt.releaseProgram(ce)}),Pe.isShaderMaterial&&tt.releaseShaderCache(Pe))}this.renderBufferDirect=function(Pe,He,ce,at,vt,vn){He===null&&(He=ft);const Rn=vt.isMesh&&vt.matrixWorld.determinantAffine()<0,ln=vr(Pe,He,ce,at,vt);oe.setMaterial(at,Rn);let kn=ce.index,pe=1;if(at.wireframe===!0){if(kn=Qe.getWireframeAttribute(ce),kn===void 0)return;pe=2}const Nr=ce.drawRange,zr=ce.attributes.position;let sr=Nr.start*pe,Ai=(Nr.start+Nr.count)*pe;vn!==null&&(sr=Math.max(sr,vn.start*pe),Ai=Math.min(Ai,(vn.start+vn.count)*pe)),kn!==null?(sr=Math.max(sr,0),Ai=Math.min(Ai,kn.count)):zr!=null&&(sr=Math.max(sr,0),Ai=Math.min(Ai,zr.count));const Oi=Ai-sr;if(Oi<0||Oi===1/0)return;dn.setup(vt,at,ln,ce,kn);let ss,qi=Kt;if(kn!==null&&(ss=et.get(kn),qi=Lt,qi.setIndex(ss)),vt.isMesh)at.wireframe===!0?(oe.setLineWidth(at.wireframeLinewidth*Ce()),qi.setMode(Se.LINES)):qi.setMode(Se.TRIANGLES);else if(vt.isLine){let aa=at.linewidth;aa===void 0&&(aa=1),oe.setLineWidth(aa*Ce()),vt.isLineSegments?qi.setMode(Se.LINES):vt.isLineLoop?qi.setMode(Se.LINE_LOOP):qi.setMode(Se.LINE_STRIP)}else vt.isPoints?qi.setMode(Se.POINTS):vt.isSprite&&qi.setMode(Se.TRIANGLES);if(vt.isBatchedMesh)if(pt.get("WEBGL_multi_draw"))qi.renderMultiDraw(vt._multiDrawStarts,vt._multiDrawCounts,vt._multiDrawCount);else{const aa=vt._multiDrawStarts,Gn=vt._multiDrawCounts,ks=vt._multiDrawCount,yr=kn?et.get(kn).bytesPerElement:1,vl=Ne.get(at).currentProgram.getUniforms();for(let Yo=0;Yo<ks;Yo++)vl.setValue(Se,"_gl_DrawID",Yo),qi.render(aa[Yo]/yr,Gn[Yo])}else if(vt.isInstancedMesh)qi.renderInstances(sr,Oi,vt.count);else if(ce.isInstancedBufferGeometry){const aa=ce._maxInstanceCount!==void 0?ce._maxInstanceCount:1/0,Gn=Math.min(ce.instanceCount,aa);qi.renderInstances(sr,Oi,Gn)}else qi.render(sr,Oi)};function be(Pe,He,ce){Pe.transparent===!0&&Pe.side===Fa&&Pe.forceSinglePass===!1?(Pe.side=us,Pe.needsUpdate=!0,xr(Pe,He,ce),Pe.side=mu,Pe.needsUpdate=!0,xr(Pe,He,ce),Pe.side=Fa):xr(Pe,He,ce)}this.compile=function(Pe,He,ce=null){ce===null&&(ce=Pe),D=Nt.get(ce),D.init(He),O.push(D),ce.traverseVisible(function(vt){vt.isLight&&vt.layers.test(He.layers)&&(D.pushLight(vt),vt.castShadow&&D.pushShadow(vt))}),Pe!==ce&&Pe.traverseVisible(function(vt){vt.isLight&&vt.layers.test(He.layers)&&(D.pushLight(vt),vt.castShadow&&D.pushShadow(vt))}),D.setupLights();const at=new Set;return Pe.traverse(function(vt){if(!(vt.isMesh||vt.isPoints||vt.isLine||vt.isSprite))return;const vn=vt.material;if(vn)if(Array.isArray(vn))for(let Rn=0;Rn<vn.length;Rn++){const ln=vn[Rn];be(ln,ce,vt),at.add(ln)}else be(vn,ce,vt),at.add(vn)}),D=O.pop(),at},this.compileAsync=function(Pe,He,ce=null){const at=this.compile(Pe,He,ce);return new Promise(vt=>{function vn(){if(at.forEach(function(Rn){Ne.get(Rn).currentProgram.isReady()&&at.delete(Rn)}),at.size===0){vt(Pe);return}setTimeout(vn,10)}pt.get("KHR_parallel_shader_compile")!==null?vn():setTimeout(vn,10)})};let en=null;function on(Pe){en&&en(Pe)}function tn(){Pt.stop()}function Qt(){Pt.start()}const Pt=new gue;Pt.setAnimationLoop(on),typeof self<"u"&&Pt.setContext(self),this.setAnimationLoop=function(Pe){en=Pe,qt.setAnimationLoop(Pe),Pe===null?Pt.stop():Pt.start()},qt.addEventListener("sessionstart",tn),qt.addEventListener("sessionend",Qt),this.render=function(Pe,He){if(He!==void 0&&He.isCamera!==!0){sn("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(B===!0)return;z!==null&&z.renderStart(Pe,He);const ce=qt.enabled===!0&&qt.isPresenting===!0,at=F!==null&&(ae===null||ce)&&F.begin(U,ae);if(Pe.matrixWorldAutoUpdate===!0&&Pe.updateMatrixWorld(),He.parent===null&&He.matrixWorldAutoUpdate===!0&&He.updateMatrixWorld(),qt.enabled===!0&&qt.isPresenting===!0&&(F===null||F.isCompositing()===!1)&&(qt.cameraAutoUpdate===!0&&qt.updateCamera(He),He=qt.getCamera()),Pe.isScene===!0&&Pe.onBeforeRender(U,Pe,He,ae),D=Nt.get(Pe,O.length),D.init(He),D.state.textureUnits=ke.getTextureUnits(),O.push(D),Fe.multiplyMatrices(He.projectionMatrix,He.matrixWorldInverse),dt.setFromProjectionMatrix(Fe,fu,He.reversedDepth),kt=this.localClippingEnabled,St=Je.init(this.clippingPlanes,kt),L=Mt.get(Pe,P.length),L.init(),P.push(L),qt.enabled===!0&&qt.isPresenting===!0){const Rn=U.xr.getDepthSensingMesh();Rn!==null&&bn(Rn,He,-1/0,U.sortObjects)}bn(Pe,He,0,U.sortObjects),L.finish(),U.sortObjects===!0&&L.sort(Ue,ze,He.reversedDepth),At=qt.enabled===!1||qt.isPresenting===!1||qt.hasDepthSensing()===!1,At&&Tn.addToRenderList(L,Pe),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),St===!0&&Je.beginShadows();const vt=D.state.shadowsArray;if(fn.render(vt,Pe,He),St===!0&&Je.endShadows(),(at&&F.hasRenderPass())===!1){const Rn=L.opaque,ln=L.transmissive;if(D.setupLights(),He.isArrayCamera){const kn=He.cameras;if(ln.length>0)for(let pe=0,Nr=kn.length;pe<Nr;pe++){const zr=kn[pe];zn(Rn,ln,Pe,zr)}At&&Tn.render(Pe);for(let pe=0,Nr=kn.length;pe<Nr;pe++){const zr=kn[pe];wn(L,Pe,zr,zr.viewport)}}else ln.length>0&&zn(Rn,ln,Pe,He),At&&Tn.render(Pe),wn(L,Pe,He)}ae!==null&&ee===0&&(ke.updateMultisampleRenderTarget(ae),ke.updateRenderTargetMipmap(ae)),at&&F.end(U),Pe.isScene===!0&&Pe.onAfterRender(U,Pe,He),dn.resetDefaultState(),le=-1,Z=null,O.pop(),O.length>0?(D=O[O.length-1],ke.setTextureUnits(D.state.textureUnits),St===!0&&Je.setGlobalState(U.clippingPlanes,D.state.camera)):D=null,P.pop(),P.length>0?L=P[P.length-1]:L=null,z!==null&&z.renderEnd()};function bn(Pe,He,ce,at){if(Pe.visible===!1)return;if(Pe.layers.test(He.layers)){if(Pe.isGroup)ce=Pe.renderOrder;else if(Pe.isLOD)Pe.autoUpdate===!0&&Pe.update(He);else if(Pe.isLightProbeGrid)D.pushLightProbeGrid(Pe);else if(Pe.isLight)D.pushLight(Pe),Pe.castShadow&&D.pushShadow(Pe);else if(Pe.isSprite){if(!Pe.frustumCulled||dt.intersectsSprite(Pe)){at&&Ye.setFromMatrixPosition(Pe.matrixWorld).applyMatrix4(Fe);const Rn=lt.update(Pe),ln=Pe.material;ln.visible&&L.push(Pe,Rn,ln,ce,Ye.z,null)}}else if((Pe.isMesh||Pe.isLine||Pe.isPoints)&&(!Pe.frustumCulled||dt.intersectsObject(Pe))){const Rn=lt.update(Pe),ln=Pe.material;if(at&&(Pe.boundingSphere!==void 0?(Pe.boundingSphere===null&&Pe.computeBoundingSphere(),Ye.copy(Pe.boundingSphere.center)):(Rn.boundingSphere===null&&Rn.computeBoundingSphere(),Ye.copy(Rn.boundingSphere.center)),Ye.applyMatrix4(Pe.matrixWorld).applyMatrix4(Fe)),Array.isArray(ln)){const kn=Rn.groups;for(let pe=0,Nr=kn.length;pe<Nr;pe++){const zr=kn[pe],sr=ln[zr.materialIndex];sr&&sr.visible&&L.push(Pe,Rn,sr,ce,Ye.z,zr)}}else ln.visible&&L.push(Pe,Rn,ln,ce,Ye.z,null)}}const vn=Pe.children;for(let Rn=0,ln=vn.length;Rn<ln;Rn++)bn(vn[Rn],He,ce,at)}function wn(Pe,He,ce,at){const{opaque:vt,transmissive:vn,transparent:Rn}=Pe;D.setupLightsView(ce),St===!0&&Je.setGlobalState(U.clippingPlanes,ce),at&&oe.viewport(Y.copy(at)),vt.length>0&&Un(vt,He,ce),vn.length>0&&Un(vn,He,ce),Rn.length>0&&Un(Rn,He,ce),oe.buffers.depth.setTest(!0),oe.buffers.depth.setMask(!0),oe.buffers.color.setMask(!0),oe.setPolygonOffset(!1)}function zn(Pe,He,ce,at){if((ce.isScene===!0?ce.overrideMaterial:null)!==null)return;if(D.state.transmissionRenderTarget[at.id]===void 0){const sr=pt.has("EXT_color_buffer_half_float")||pt.has("EXT_color_buffer_float");D.state.transmissionRenderTarget[at.id]=new Kf(1,1,{generateMipmaps:!0,type:sr?Js:Zs,minFilter:hu,samples:Math.max(4,Te.samples),stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:_r.workingColorSpace})}const vn=D.state.transmissionRenderTarget[at.id],Rn=at.viewport||Y;vn.setSize(Rn.z*U.transmissionResolutionScale,Rn.w*U.transmissionResolutionScale);const ln=U.getRenderTarget(),kn=U.getActiveCubeFace(),pe=U.getActiveMipmapLevel();U.setRenderTarget(vn),U.getClearColor(Ee),Ae=U.getClearAlpha(),Ae<1&&U.setClearColor(16777215,.5),U.clear(),At&&Tn.render(ce);const Nr=U.toneMapping;U.toneMapping=Il;const zr=at.viewport;if(at.viewport!==void 0&&(at.viewport=void 0),D.setupLightsView(at),St===!0&&Je.setGlobalState(U.clippingPlanes,at),Un(Pe,ce,at),ke.updateMultisampleRenderTarget(vn),ke.updateRenderTargetMipmap(v
vendor: 9,654 bytes, line 4269
4269n),pt.has("WEBGL_multisampled_render_to_texture")===!1){let sr=!1;for(let Ai=0,Oi=He.length;Ai<Oi;Ai++){const ss=He[Ai],{object:qi,geometry:aa,material:Gn,group:ks}=ss;if(Gn.side===Fa&&qi.layers.test(at.layers)){const yr=Gn.side;Gn.side=us,Gn.needsUpdate=!0,_n(qi,ce,at,aa,Gn,ks),Gn.side=yr,Gn.needsUpdate=!0,sr=!0}}sr===!0&&(ke.updateMultisampleRenderTarget(vn),ke.updateRenderTargetMipmap(vn))}U.setRenderTarget(ln,kn,pe),U.setClearColor(Ee,Ae),zr!==void 0&&(at.viewport=zr),U.toneMapping=Nr}function Un(Pe,He,ce){const at=He.isScene===!0?He.overrideMaterial:null;for(let vt=0,vn=Pe.length;vt<vn;vt++){const Rn=Pe[vt],{object:ln,geometry:kn,group:pe}=Rn;let Nr=Rn.material;Nr.allowOverride===!0&&at!==null&&(Nr=at),ln.layers.test(ce.layers)&&_n(ln,He,ce,kn,Nr,pe)}}function _n(Pe,He,ce,at,vt,vn){Pe.onBeforeRender(U,He,ce,at,vt,vn),Pe.modelViewMatrix.multiplyMatrices(ce.matrixWorldInverse,Pe.matrixWorld),Pe.normalMatrix.getNormalMatrix(Pe.modelViewMatrix),vt.onBeforeRender(U,He,ce,at,Pe,vn),vt.transparent===!0&&vt.side===Fa&&vt.forceSinglePass===!1?(vt.side=us,vt.needsUpdate=!0,U.renderBufferDirect(ce,He,at,vt,Pe,vn),vt.side=mu,vt.needsUpdate=!0,U.renderBufferDirect(ce,He,at,vt,Pe,vn),vt.side=Fa):U.renderBufferDirect(ce,He,at,vt,Pe,vn),Pe.onAfterRender(U,He,ce,at,vt,vn)}function xr(Pe,He,ce){He.isScene!==!0&&(He=ft);const at=Ne.get(Pe),vt=D.state.lights,vn=D.state.shadowsArray,Rn=vt.state.version,ln=tt.getParameters(Pe,vt.state,vn,He,ce,D.state.lightProbeGridArray),kn=tt.getProgramCacheKey(ln);let pe=at.programs;at.environment=Pe.isMeshStandardMaterial||Pe.isMeshLambertMaterial||Pe.isMeshPhongMaterial?He.environment:null,at.fog=He.fog;const Nr=Pe.isMeshStandardMaterial||Pe.isMeshLambertMaterial&&!Pe.envMap||Pe.isMeshPhongMaterial&&!Pe.envMap;at.envMap=Xe.get(Pe.envMap||at.environment,Nr),at.envMapRotation=at.environment!==null&&Pe.envMap===null?He.environmentRotation:Pe.envMapRotation,pe===void 0&&(Pe.addEventListener("dispose",Ge),pe=new Map,at.programs=pe);let zr=pe.get(kn);if(zr!==void 0){if(at.currentProgram===zr&&at.lightsStateVersion===Rn)return is(Pe,ln),zr}else ln.uniforms=tt.getUniforms(Pe),z!==null&&Pe.isNodeMaterial&&z.build(Pe,ce,ln),Pe.onBeforeCompile(ln,U),zr=tt.acquireProgram(ln,kn),pe.set(kn,zr),at.uniforms=ln.uniforms;const sr=at.uniforms;return(!Pe.isShaderMaterial&&!Pe.isRawShaderMaterial||Pe.clipping===!0)&&(sr.clippingPlanes=Je.uniform),is(Pe,ln),at.needsLights=Vi(Pe),at.lightsStateVersion=Rn,at.needsLights&&(sr.ambientLightColor.value=vt.state.ambient,sr.lightProbe.value=vt.state.probe,sr.directionalLights.value=vt.state.directional,sr.directionalLightShadows.value=vt.state.directionalShadow,sr.spotLights.value=vt.state.spot,sr.spotLightShadows.value=vt.state.spotShadow,sr.rectAreaLights.value=vt.state.rectArea,sr.ltc_1.value=vt.state.rectAreaLTC1,sr.ltc_2.value=vt.state.rectAreaLTC2,sr.pointLights.value=vt.state.point,sr.pointLightShadows.value=vt.state.pointShadow,sr.hemisphereLights.value=vt.state.hemi,sr.directionalShadowMatrix.value=vt.state.directionalShadowMatrix,sr.spotLightMatrix.value=vt.state.spotLightMatrix,sr.spotLightMap.value=vt.state.spotLightMap,sr.pointShadowMatrix.value=vt.state.pointShadowMatrix),at.lightProbeGrid=D.state.lightProbeGridArray.length>0,at.currentProgram=zr,at.uniformsList=null,zr}function Ir(Pe){if(Pe.uniformsList===null){const He=Pe.currentProgram.getUniforms();Pe.uniformsList=m6.seqWithValue(He.seq,Pe.uniforms)}return Pe.uniformsList}function is(Pe,He){const ce=Ne.get(Pe);ce.outputColorSpace=He.outputColorSpace,ce.batching=He.batching,ce.batchingColor=He.batchingColor,ce.instancing=He.instancing,ce.instancingColor=He.instancingColor,ce.instancingMorph=He.instancingMorph,ce.skinning=He.skinning,ce.morphTargets=He.morphTargets,ce.morphNormals=He.morphNormals,ce.morphColors=He.morphColors,ce.morphTargetsCount=He.morphTargetsCount,ce.numClippingPlanes=He.numClippingPlanes,ce.numIntersection=He.numClipIntersection,ce.vertexAlphas=He.vertexAlphas,ce.vertexTangents=He.vertexTangents,ce.toneMapping=He.toneMapping}function si(Pe,He){if(Pe.length===0)return null;if(Pe.length===1)return Pe[0].texture!==null?Pe[0]:null;T.setFromMatrixPosition(He.matrixWorld);for(let ce=0,at=Pe.length;ce<at;ce++){const vt=Pe[ce];if(vt.texture!==null&&vt.boundingBox.containsPoint(T))return vt}return null}function vr(Pe,He,ce,at,vt){He.isScene!==!0&&(He=ft),ke.resetTextureUnits();const vn=He.fog,Rn=at.isMeshStandardMaterial||at.isMeshLambertMaterial||at.isMeshPhongMaterial?He.environment:null,ln=ae===null?U.outputColorSpace:ae.isXRRenderTarget===!0?ae.texture.colorSpace:_r.workingColorSpace,kn=at.isMeshStandardMaterial||at.isMeshLambertMaterial&&!at.envMap||at.isMeshPhongMaterial&&!at.envMap,pe=Xe.get(at.envMap||Rn,kn),Nr=at.vertexColors===!0&&!!ce.attributes.color&&ce.attributes.color.itemSize===4,zr=!!ce.attributes.tangent&&(!!at.normalMap||at.anisotropy>0),sr=!!ce.morphAttributes.position,Ai=!!ce.morphAttributes.normal,Oi=!!ce.morphAttributes.color;let ss=Il;at.toneMapped&&(ae===null||ae.isXRRenderTarget===!0)&&(ss=U.toneMapping);const qi=ce.morphAttributes.position||ce.morphAttributes.normal||ce.morphAttributes.color,aa=qi!==void 0?qi.length:0,Gn=Ne.get(at),ks=D.state.lights;if(St===!0&&(kt===!0||Pe!==Z)){const Xn=Pe===Z&&at.id===le;Je.setState(at,Pe,Xn)}let yr=!1;at.version===Gn.__version?(Gn.needsLights&&Gn.lightsStateVersion!==ks.state.version||Gn.outputColorSpace!==ln||vt.isBatchedMesh&&Gn.batching===!1||!vt.isBatchedMesh&&Gn.batching===!0||vt.isBatchedMesh&&Gn.batchingColor===!0&&vt.colorTexture===null||vt.isBatchedMesh&&Gn.batchingColor===!1&&vt.colorTexture!==null||vt.isInstancedMesh&&Gn.instancing===!1||!vt.isInstancedMesh&&Gn.instancing===!0||vt.isSkinnedMesh&&Gn.skinning===!1||!vt.isSkinnedMesh&&Gn.skinning===!0||vt.isInstancedMesh&&Gn.instancingColor===!0&&vt.instanceColor===null||vt.isInstancedMesh&&Gn.instancingColor===!1&&vt.instanceColor!==null||vt.isInstancedMesh&&Gn.instancingMorph===!0&&vt.morphTexture===null||vt.isInstancedMesh&&Gn.instancingMorph===!1&&vt.morphTexture!==null||Gn.envMap!==pe||at.fog===!0&&Gn.fog!==vn||Gn.numClippingPlanes!==void 0&&(Gn.numClippingPlanes!==Je.numPlanes||Gn.numIntersection!==Je.numIntersection)||Gn.vertexAlphas!==Nr||Gn.vertexTangents!==zr||Gn.morphTargets!==sr||Gn.morphNormals!==Ai||Gn.morphColors!==Oi||Gn.toneMapping!==ss||Gn.morphTargetsCount!==aa||!!Gn.lightProbeGrid!=D.state.lightProbeGridArray.length>0)&&(yr=!0):(yr=!0,Gn.__version=at.version);let vl=Gn.currentProgram;yr===!0&&(vl=xr(at,He,vt),z&&at.isNodeMaterial&&z.onUpdateProgram(at,vl,Gn));let Yo=!1,ai=!1,Rc=!1;const Qi=vl.getUniforms(),Rs=Gn.uniforms;if(oe.useProgram(vl.program)&&(Yo=!0,ai=!0,Rc=!0),at.id!==le&&(le=at.id,ai=!0),Gn.needsLights){const Xn=si(D.state.lightProbeGridArray,vt);Gn.lightProbeGrid!==Xn&&(Gn.lightProbeGrid=Xn,ai=!0)}if(Yo||Z!==Pe){oe.buffers.depth.getReversed()&&Pe.reversedDepth!==!0&&(Pe._reversedDepth=!0,Pe.updateProjectionMatrix()),Qi.setValue(Se,"projectionMatrix",Pe.projectionMatrix),Qi.setValue(Se,"viewMatrix",Pe.matrixWorldInverse);const $i=Qi.map.cameraPosition;$i!==void 0&&$i.setValue(Se,Ze.setFromMatrixPosition(Pe.matrixWorld)),Te.logarithmicDepthBuffer&&Qi.setValue(Se,"logDepthBufFC",2/(Math.log(Pe.far+1)/Math.LN2)),(at.isMeshPhongMaterial||at.isMeshToonMaterial||at.isMeshLambertMaterial||at.isMeshBasicMaterial||at.isMeshStandardMaterial||at.isShaderMaterial)&&Qi.setValue(Se,"isOrthographic",Pe.isOrthographicCamera===!0),Z!==Pe&&(Z=Pe,ai=!0,Rc=!0)}if(Gn.needsLights&&(ks.state.directionalShadowMap.length>0&&Qi.setValue(Se,"directionalShadowMap",ks.state.directionalShadowMap,ke),ks.state.spotShadowMap.length>0&&Qi.setValue(Se,"spotShadowMap",ks.state.spotShadowMap,ke),ks.state.pointShadowMap.length>0&&Qi.setValue(Se,"pointShadowMap",ks.state.pointShadowMap,ke)),vt.isSkinnedMesh){Qi.setOptional(Se,vt,"bindMatrix"),Qi.setOptional(Se,vt,"bindMatrixInverse");const Xn=vt.skeleton;Xn&&(Xn.boneTexture===null&&Xn.computeBoneTexture(),Qi.setValue(Se,"boneTexture",Xn.boneTexture,ke))}vt.isBatchedMesh&&(Qi.setOptional(Se,vt,"batchingTexture"),Qi.setValue(Se,"batchingTexture",vt._matricesTexture,ke),Qi.setOptional(Se,vt,"batchingIdTexture"),Qi.setValue(Se,"batchingIdTexture",vt._indirectTexture,ke),Qi.setOptional(Se,vt,"batchingColorTexture"),vt._colorsTexture!==null&&Qi.setValue(Se,"batchingColorTexture",vt._colorsTexture,ke));const vu=ce.morphAttributes;if((vu.position!==void 0||vu.normal!==void 0||vu.color!==void 0)&&nt.update(vt,ce,vl),(ai||Gn.receiveShadow!==vt.receiveShadow)&&(Gn.receiveShadow=vt.receiveShadow,Qi.setValue(Se,"receiveShadow",vt.receiveShadow)),(at.isMeshStandardMaterial||at.isMeshLambertMaterial||at.isMeshPhongMaterial)&&at.envMap===null&&He.environment!==null&&(Rs.envMapIntensity.value=He.environmentIntensity),Rs.dfgLUT!==void 0&&(Rs.dfgLUT.value=yLe()),ai){if(Qi.setValue(Se,"toneMappingExposure",U.toneMappingExposure),Gn.needsLights&&Yi(Rs,Rc),vn&&at.fog===!0&&Ft.refreshFogUniforms(Rs,vn),Ft.refreshMaterialUniforms(Rs,at,we,ve,D.state.transmissionRenderTarget[Pe.id]),Gn.needsLights&&Gn.lightProbeGrid){const Xn=Gn.lightProbeGrid;Rs.probesSH.value=Xn.texture,Rs.probesMin.value.copy(Xn.boundingBox.min),Rs.probesMax.value.copy(Xn.boundingBox.max),Rs.probesResolution.value.copy(Xn.resolution)}m6.upload(Se,Ir(Gn),Rs,ke)}if(at.isShaderMaterial&&at.uniformsNeedUpdate===!0&&(m6.upload(Se,Ir(Gn),Rs,ke),at.uniformsNeedUpdate=!1),at.isSpriteMaterial&&Qi.setValue(Se,"center",vt.center),Qi.setValue(Se,"modelViewMatrix",vt.modelViewMatrix),Qi.setValue(Se,"normalMatrix",vt.normalMatrix),Qi.setValue(Se,"modelMatrix",vt.matrixWorld),at.uniformsGroups!==void 0){const Xn=at.uniformsGroups;for(let $i=0,yl=Xn.length;
vendor: 10,231 bytes, line 4269
4269$i<yl;$i++){const ah=Xn[$i];Bt.update(ah,vl),Bt.bind(ah,vl)}}return vl}function Yi(Pe,He){Pe.ambientLightColor.needsUpdate=He,Pe.lightProbe.needsUpdate=He,Pe.directionalLights.needsUpdate=He,Pe.directionalLightShadows.needsUpdate=He,Pe.pointLights.needsUpdate=He,Pe.pointLightShadows.needsUpdate=He,Pe.spotLights.needsUpdate=He,Pe.spotLightShadows.needsUpdate=He,Pe.rectAreaLights.needsUpdate=He,Pe.hemisphereLights.needsUpdate=He}function Vi(Pe){return Pe.isMeshLambertMaterial||Pe.isMeshToonMaterial||Pe.isMeshPhongMaterial||Pe.isMeshStandardMaterial||Pe.isShadowMaterial||Pe.isShaderMaterial&&Pe.lights===!0}this.getActiveCubeFace=function(){return J},this.getActiveMipmapLevel=function(){return ee},this.getRenderTarget=function(){return ae},this.setRenderTargetTextures=function(Pe,He,ce){const at=Ne.get(Pe);at.__autoAllocateDepthBuffer=Pe.resolveDepthBuffer===!1,at.__autoAllocateDepthBuffer===!1&&(at.__useRenderToTexture=!1),Ne.get(Pe.texture).__webglTexture=He,Ne.get(Pe.depthTexture).__webglTexture=at.__autoAllocateDepthBuffer?void 0:ce,at.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(Pe,He){const ce=Ne.get(Pe);ce.__webglFramebuffer=He,ce.__useDefaultFramebuffer=He===void 0},this.setRenderTarget=function(Pe,He=0,ce=0){ae=Pe,J=He,ee=ce;let at=null,vt=!1,vn=!1;if(Pe){const ln=Ne.get(Pe);if(ln.__useDefaultFramebuffer!==void 0){oe.bindFramebuffer(Se.FRAMEBUFFER,ln.__webglFramebuffer),Y.copy(Pe.viewport),re.copy(Pe.scissor),_e=Pe.scissorTest,oe.viewport(Y),oe.scissor(re),oe.setScissorTest(_e),le=-1;return}else if(ln.__webglFramebuffer===void 0)ke.setupRenderTarget(Pe);else if(ln.__hasExternalTextures)ke.rebindTextures(Pe,Ne.get(Pe.texture).__webglTexture,Ne.get(Pe.depthTexture).__webglTexture);else if(Pe.depthBuffer){const Nr=Pe.depthTexture;if(ln.__boundDepthTexture!==Nr){if(Nr!==null&&Ne.has(Nr)&&(Pe.width!==Nr.image.width||Pe.height!==Nr.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");ke.setupDepthRenderbuffer(Pe)}}const kn=Pe.texture;(kn.isData3DTexture||kn.isDataArrayTexture||kn.isCompressedArrayTexture)&&(vn=!0);const pe=Ne.get(Pe).__webglFramebuffer;Pe.isWebGLCubeRenderTarget?(Array.isArray(pe[He])?at=pe[He][ce]:at=pe[He],vt=!0):Pe.samples>0&&ke.useMultisampledRTT(Pe)===!1?at=Ne.get(Pe).__webglMultisampledFramebuffer:Array.isArray(pe)?at=pe[ce]:at=pe,Y.copy(Pe.viewport),re.copy(Pe.scissor),_e=Pe.scissorTest}else Y.copy(yt).multiplyScalar(we).floor(),re.copy(mt).multiplyScalar(we).floor(),_e=bt;if(ce!==0&&(at=H),oe.bindFramebuffer(Se.FRAMEBUFFER,at)&&oe.drawBuffers(Pe,at),oe.viewport(Y),oe.scissor(re),oe.setScissorTest(_e),vt){const ln=Ne.get(Pe.texture);Se.framebufferTexture2D(Se.FRAMEBUFFER,Se.COLOR_ATTACHMENT0,Se.TEXTURE_CUBE_MAP_POSITIVE_X+He,ln.__webglTexture,ce)}else if(vn){const ln=He;for(let kn=0;kn<Pe.textures.length;kn++){const pe=Ne.get(Pe.textures[kn]);Se.framebufferTextureLayer(Se.FRAMEBUFFER,Se.COLOR_ATTACHMENT0+kn,pe.__webglTexture,ce,ln)}}else if(Pe!==null&&ce!==0){const ln=Ne.get(Pe.texture);Se.framebufferTexture2D(Se.FRAMEBUFFER,Se.COLOR_ATTACHMENT0,Se.TEXTURE_2D,ln.__webglTexture,ce)}le=-1},this.readRenderTargetPixels=function(Pe,He,ce,at,vt,vn,Rn,ln=0){if(!(Pe&&Pe.isWebGLRenderTarget)){sn("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let kn=Ne.get(Pe).__webglFramebuffer;if(Pe.isWebGLCubeRenderTarget&&Rn!==void 0&&(kn=kn[Rn]),kn){oe.bindFramebuffer(Se.FRAMEBUFFER,kn);try{const pe=Pe.textures[ln],Nr=pe.format,zr=pe.type;if(Pe.textures.length>1&&Se.readBuffer(Se.COLOR_ATTACHMENT0+ln),!Te.textureFormatReadable(Nr)){sn("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Te.textureTypeReadable(zr)){sn("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}He>=0&&He<=Pe.width-at&&ce>=0&&ce<=Pe.height-vt&&Se.readPixels(He,ce,at,vt,cn.convert(Nr),cn.convert(zr),vn)}finally{const pe=ae!==null?Ne.get(ae).__webglFramebuffer:null;oe.bindFramebuffer(Se.FRAMEBUFFER,pe)}}},this.readRenderTargetPixelsAsync=async function(Pe,He,ce,at,vt,vn,Rn,ln=0){if(!(Pe&&Pe.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let kn=Ne.get(Pe).__webglFramebuffer;if(Pe.isWebGLCubeRenderTarget&&Rn!==void 0&&(kn=kn[Rn]),kn)if(He>=0&&He<=Pe.width-at&&ce>=0&&ce<=Pe.height-vt){oe.bindFramebuffer(Se.FRAMEBUFFER,kn);const pe=Pe.textures[ln],Nr=pe.format,zr=pe.type;if(Pe.textures.length>1&&Se.readBuffer(Se.COLOR_ATTACHMENT0+ln),!Te.textureFormatReadable(Nr))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Te.textureTypeReadable(zr))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const sr=Se.createBuffer();Se.bindBuffer(Se.PIXEL_PACK_BUFFER,sr),Se.bufferData(Se.PIXEL_PACK_BUFFER,vn.byteLength,Se.STREAM_READ),Se.readPixels(He,ce,at,vt,cn.convert(Nr),cn.convert(zr),0);const Ai=ae!==null?Ne.get(ae).__webglFramebuffer:null;oe.bindFramebuffer(Se.FRAMEBUFFER,Ai);const Oi=Se.fenceSync(Se.SYNC_GPU_COMMANDS_COMPLETE,0);return Se.flush(),await RMe(Se,Oi,4),Se.bindBuffer(Se.PIXEL_PACK_BUFFER,sr),Se.getBufferSubData(Se.PIXEL_PACK_BUFFER,0,vn),Se.deleteBuffer(sr),Se.deleteSync(Oi),vn}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(Pe,He=null,ce=0){const at=Math.pow(2,-ce),vt=Math.floor(Pe.image.width*at),vn=Math.floor(Pe.image.height*at),Rn=He!==null?He.x:0,ln=He!==null?He.y:0;ke.setTexture2D(Pe,0),Se.copyTexSubImage2D(Se.TEXTURE_2D,ce,0,0,Rn,ln,vt,vn),oe.unbindTexture()},this.copyTextureToTexture=function(Pe,He,ce=null,at=null,vt=0,vn=0){let Rn,ln,kn,pe,Nr,zr,sr,Ai,Oi;const ss=Pe.isCompressedTexture?Pe.mipmaps[vn]:Pe.image;if(ce!==null)Rn=ce.max.x-ce.min.x,ln=ce.max.y-ce.min.y,kn=ce.isBox3?ce.max.z-ce.min.z:1,pe=ce.min.x,Nr=ce.min.y,zr=ce.isBox3?ce.min.z:0;else{const Rs=Math.pow(2,-vt);Rn=Math.floor(ss.width*Rs),ln=Math.floor(ss.height*Rs),Pe.isDataArrayTexture?kn=ss.depth:Pe.isData3DTexture?kn=Math.floor(ss.depth*Rs):kn=1,pe=0,Nr=0,zr=0}at!==null?(sr=at.x,Ai=at.y,Oi=at.z):(sr=0,Ai=0,Oi=0);const qi=cn.convert(He.format),aa=cn.convert(He.type);let Gn;He.isData3DTexture?(ke.setTexture3D(He,0),Gn=Se.TEXTURE_3D):He.isDataArrayTexture||He.isCompressedArrayTexture?(ke.setTexture2DArray(He,0),Gn=Se.TEXTURE_2D_ARRAY):(ke.setTexture2D(He,0),Gn=Se.TEXTURE_2D),oe.activeTexture(Se.TEXTURE0),oe.pixelStorei(Se.UNPACK_FLIP_Y_WEBGL,He.flipY),oe.pixelStorei(Se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,He.premultiplyAlpha),oe.pixelStorei(Se.UNPACK_ALIGNMENT,He.unpackAlignment);const ks=oe.getParameter(Se.UNPACK_ROW_LENGTH),yr=oe.getParameter(Se.UNPACK_IMAGE_HEIGHT),vl=oe.getParameter(Se.UNPACK_SKIP_PIXELS),Yo=oe.getParameter(Se.UNPACK_SKIP_ROWS),ai=oe.getParameter(Se.UNPACK_SKIP_IMAGES);oe.pixelStorei(Se.UNPACK_ROW_LENGTH,ss.width),oe.pixelStorei(Se.UNPACK_IMAGE_HEIGHT,ss.height),oe.pixelStorei(Se.UNPACK_SKIP_PIXELS,pe),oe.pixelStorei(Se.UNPACK_SKIP_ROWS,Nr),oe.pixelStorei(Se.UNPACK_SKIP_IMAGES,zr);const Rc=Pe.isDataArrayTexture||Pe.isData3DTexture,Qi=He.isDataArrayTexture||He.isData3DTexture;if(Pe.isDepthTexture){const Rs=Ne.get(Pe),vu=Ne.get(He),Xn=Ne.get(Rs.__renderTarget),$i=Ne.get(vu.__renderTarget);oe.bindFramebuffer(Se.READ_FRAMEBUFFER,Xn.__webglFramebuffer),oe.bindFramebuffer(Se.DRAW_FRAMEBUFFER,$i.__webglFramebuffer);for(let yl=0;yl<kn;yl++)Rc&&(Se.framebufferTextureLayer(Se.READ_FRAMEBUFFER,Se.COLOR_ATTACHMENT0,Ne.get(Pe).__webglTexture,vt,zr+yl),Se.framebufferTextureLayer(Se.DRAW_FRAMEBUFFER,Se.COLOR_ATTACHMENT0,Ne.get(He).__webglTexture,vn,Oi+yl)),Se.blitFramebuffer(pe,Nr,Rn,ln,sr,Ai,Rn,ln,Se.DEPTH_BUFFER_BIT,Se.NEAREST);oe.bindFramebuffer(Se.READ_FRAMEBUFFER,null),oe.bindFramebuffer(Se.DRAW_FRAMEBUFFER,null)}else if(vt!==0||Pe.isRenderTargetTexture||Ne.has(Pe)){const Rs=Ne.get(Pe),vu=Ne.get(He);oe.bindFramebuffer(Se.READ_FRAMEBUFFER,X),oe.bindFramebuffer(Se.DRAW_FRAMEBUFFER,W);for(let Xn=0;Xn<kn;Xn++)Rc?Se.framebufferTextureLayer(Se.READ_FRAMEBUFFER,Se.COLOR_ATTACHMENT0,Rs.__webglTexture,vt,zr+Xn):Se.framebufferTexture2D(Se.READ_FRAMEBUFFER,Se.COLOR_ATTACHMENT0,Se.TEXTURE_2D,Rs.__webglTexture,vt),Qi?Se.framebufferTextureLayer(Se.DRAW_FRAMEBUFFER,Se.COLOR_ATTACHMENT0,vu.__webglTexture,vn,Oi+Xn):Se.framebufferTexture2D(Se.DRAW_FRAMEBUFFER,Se.COLOR_ATTACHMENT0,Se.TEXTURE_2D,vu.__webglTexture,vn),vt!==0?Se.blitFramebuffer(pe,Nr,Rn,ln,sr,Ai,Rn,ln,Se.COLOR_BUFFER_BIT,Se.NEAREST):Qi?Se.copyTexSubImage3D(Gn,vn,sr,Ai,Oi+Xn,pe,Nr,Rn,ln):Se.copyTexSubImage2D(Gn,vn,sr,Ai,pe,Nr,Rn,ln);oe.bindFramebuffer(Se.READ_FRAMEBUFFER,null),oe.bindFramebuffer(Se.DRAW_FRAMEBUFFER,null)}else Qi?Pe.isDataTexture||Pe.isData3DTexture?Se.texSubImage3D(Gn,vn,sr,Ai,Oi,Rn,ln,kn,qi,aa,ss.data):He.isCompressedArrayTexture?Se.compressedTexSubImage3D(Gn,vn,sr,Ai,Oi,Rn,ln,kn,qi,ss.data):Se.texSubImage3D(Gn,vn,sr,Ai,Oi,Rn,ln,kn,qi,aa,ss):Pe.isDataTexture?Se.texSubImage2D(Se.TEXTURE_2D,vn,sr,Ai,Rn,ln,qi,aa,ss.data):Pe.isCompressedTexture?Se.compressedTexSubImage2D(Se.TEXTURE_2D,vn,sr,Ai,ss.width,ss.height,qi,ss.data):Se.texSubImage2D(Se.TEXTURE_2D,vn,sr,Ai,Rn,ln,qi,aa,ss);oe.pixelStorei(Se.UNPACK_ROW_LENGTH,ks),oe.pixelStorei(Se.UNPACK_IMAGE_HEIGHT,yr),oe.pixelStorei(Se.UNPACK_SKIP_PIXELS,vl),oe.pixelStorei(Se.UNPACK_SKIP_ROWS,Yo),oe.pixelStorei(Se.UNPACK_SKIP_IMAGES,ai),vn===0&&He.generateMipmaps&&Se.generateMipmap(Gn),oe.unbindTexture()},this.initRenderTarget=function(Pe){Ne.get(Pe).__webglFramebuffer===void 0&&ke.setupRenderTarget(Pe)},this.initTexture=function(Pe){Pe.isCubeTexture?ke.setTextureCube(Pe,0):Pe.isData3DTexture?ke.setTexture3D(Pe,0):Pe.isDataArrayTexture||Pe.isCompressedArrayTexture?ke.setTexture2DArray(Pe,0):ke.setTexture2D(Pe,0),oe.unbindTexture()},this.resetState=function(){J=0,ee=0,ae=null,oe.reset(),dn.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fu}get outputColorSpace(){return this._outputColorSpace}
4269set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=_r._getDrawingBufferColorSpace(e),t.unpackColorSpace=_r._getUnpackColorSpace()}}class wLe extends ga{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Jt(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element&&t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const v2=new Ve,oK=new kr,lK=new kr,cK=new Ve,uK=new Ve;class _Le{constructor(e={}){const t=this;let r,i,s,a;const o={objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.sortObjects=!0,this.getSize=function(){return{width:r,height:i}},this.render=function(g,A){g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),oK.copy(A.matrixWorldInverse),lK.multiplyMatrices(A.projectionMatrix,oK),d(g,g,A),this.sortObjects&&p(g)},this.setSize=function(g,A){r=g,i=A,s=r/2,a=i/2,l.style.width=g+"px",l.style.height=A+"px"};function u(g){g.isCSS2DObject&&(g.element.style.display="none");for(let A=0,x=g.children.length;A<x;A++)u(g.children[A])}function d(g,A,x){if(g.visible===!1){u(g);return}if(g.isCSS2DObject){v2.setFromMatrixPosition(g.matrixWorld),v2.applyMatrix4(lK);const b=v2.z>=-1&&v2.z<=1&&g.layers.test(x.layers)===!0,_=g.element;_.style.display=b===!0?"":"none",b===!0&&(g.onBeforeRender(t,A,x),_.style.transform="translate("+-100*g.center.x+"%,"+-100*g.center.y+"%)translate("+(v2.x*s+s)+"px,"+(-v2.y*a+a)+"px)",_.parentNode!==l&&l.appendChild(_),g.onAfterRender(t,A,x));const M={distanceToCameraSquared:h(x,g)};o.objects.set(g,M)}for(let b=0,_=g.children.length;b<_;b++)d(g.children[b],A,x)}function h(g,A){return cK.setFromMatrixPosition(g.matrixWorld),uK.setFromMatrixPosition(A.matrixWorld),cK.distanceToSquared(uK)}function f(g){const A=[];return g.traverseVisible(function(x){x.isCSS2DObject&&A.push(x)}),A}function p(g){const A=f(g).sort(function(b,_){if(b.renderOrder!==_.renderOrder)return _.renderOrder-b.renderOrder;const M=o.objects.get(b).distanceToCameraSquared,T=o.objects.get(_).distanceToCameraSquared;return M-T}),x=A.length;for(let b=0,_=A.length;b<_;b++)A[b].element.style.zIndex=x-b}}}function WI(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var SLe=typeof global=="object"&&global&&global.Object===Object&&global,TLe=typeof self=="object"&&self&&self.Object===Object&&self,Sue=SLe||TLe||Function("return this")(),Q9=function(){return Sue.Date.now()},ELe=/\s/;function CLe(n){for(var e=n.length;e--&&ELe.test(n.charAt(e)););return e}var NLe=/^\s+/;function MLe(n){return n&&n.slice(0,CLe(n)+1).replace(NLe,"")}var VM=Sue.Symbol,Tue=Object.prototype,kLe=Tue.hasOwnProperty,RLe=Tue.toString,N3=VM?VM.toStringTag:void 0;function PLe(n){var e=kLe.call(n,N3),t=n[N3];try{n[N3]=void 0;var r=!0}catch{}var i=RLe.call(n);return r&&(e?n[N3]=t:delete n[N3]),i}var LLe=Object.prototype,OLe=LLe.toString;function DLe(n){return OLe.call(n)}var jLe="[object Null]",ILe="[object Undefined]",dK=VM?VM.toStringTag:void 0;function FLe(n){return n==null?n===void 0?ILe:jLe:dK&&dK in Object(n)?PLe(n):DLe(n)}function ULe(n){return n!=null&&typeof n=="object"}var BLe="[object Symbol]";function VLe(n){return typeof n=="symbol"||ULe(n)&&FLe(n)==BLe}var hK=NaN,zLe=/^[-+]0x[0-9a-f]+$/i,GLe=/^0b[01]+$/i,qLe=/^0o[0-7]+$/i,$Le=parseInt;function fK(n){if(typeof n=="number")return n;if(VLe(n))return hK;if(WI(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=WI(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=MLe(n);var t=GLe.test(n);return t||qLe.test(n)?$Le(n.slice(2),t?2:8):zLe.test(n)?hK:+n}var HLe="Expected a function",WLe=Math.max,XLe=Math.min;function YLe(n,e,t){var r,i,s,a,o,l,u=0,d=!1,h=!1,f=!0;if(typeof n!="function")throw new TypeError(HLe);e=fK(e)||0,WI(t)&&(d=!!t.leading,h="maxWait"in t,s=h?WLe(fK(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function p(D){var P=r,O=i;return r=i=void 0,u=D,a=n.apply(O,P),a}function g(D){return u=D,o=setTimeout(b,e),d?p(D):a}function A(D){var P=D-l,O=D-u,F=e-P;return h?XLe(F,s-O):F}function x(D){var P=D-l,O=D-u;return l===void 0||P>=e||P<0||h&&O>=s}function b(){var D=Q9();if(x(D))return _(D);o=setTimeout(b,A(D))}function _(D){return o=void 0,f&&r?p(D):(r=i=void 0,a)}function M(){o!==void 0&&clearTimeout(o),u=0,r=l=i=o=void 0}function T(){return o===void 0?a:_(Q9())}function L(){var D=Q9(),P=x(D);if(r=arguments,i=this,l=D,P){if(o===void 0)return g(l);if(h)return clearTimeout(o),o=setTimeout(b,e),p(l)}return o===void 0&&(o=setTimeout(b,e)),a}return L.cancel=M,L.flush=T,L}function pK(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function QLe(n){if(Array.isArray(n))return n}function KLe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function ZLe(n,e,t){return Object.defineProperty(n,"prototype",{writable:!1}),n}function JLe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}
4269finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function eOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4270In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tOe(n,e){return QLe(n)||JLe(n,e)||nOe(n,e)||eOe()}function nOe(n,e){if(n){if(typeof n=="string")return pK(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?pK(n,e):void 0}}var rOe=ZLe(function n(e,t){var r=t.default,i=r===void 0?null:r,s=t.triggerUpdate,a=s===void 0?!0:s,o=t.onChange,l=o===void 0?function(u,d){}:o;KLe(this,n),this.name=e,this.defaultVal=i,this.triggerUpdate=a,this.onChange=l});function Wo(n){var e=n.stateInit,t=e===void 0?function(){return{}}:e,r=n.props,i=r===void 0?{}:r,s=n.methods,a=s===void 0?{}:s,o=n.aliases,l=o===void 0?{}:o,u=n.init,d=u===void 0?function(){}:u,h=n.update,f=h===void 0?function(){}:h,p=Object.keys(i).map(function(g){return new rOe(g,i[g])});return function g(){for(var A=arguments.length,x=new Array(A),b=0;b<A;b++)x[b]=arguments[b];var _=!!(this instanceof g&&this.constructor),M=_?x.shift():void 0,T=x[0],L=T===void 0?{}:T,D=Object.assign({},t instanceof Function?t(L):t,{initialised:!1}),P={};function O(B){return F(B,L),U(),O}var F=function(z,H){d.call(O,z,D,H),D.initialised=!0},U=YLe(function(){D.initialised&&(f.call(O,D,P),P={})},1);return p.forEach(function(B){O[B.name]=z(B);function z(H){var X=H.name,W=H.triggerUpdate,J=W===void 0?!1:W,ee=H.onChange,ae=ee===void 0?function(Y,re){}:ee,le=H.defaultVal,Z=le===void 0?null:le;return function(Y){var re=D[X];if(!arguments.length)return re;var _e=Y===void 0?Z:Y;return D[X]=_e,ae.call(O,_e,D,re),!P.hasOwnProperty(X)&&(P[X]=re),J&&U(),O}}}),Object.keys(a).forEach(function(B){O[B]=function(){for(var z,H=arguments.length,X=new Array(H),W=0;W<H;W++)X[W]=arguments[W];return(z=a[B]).call.apply(z,[O,D].concat(X))}}),Object.entries(l).forEach(function(B){var z=tOe(B,2),H=z[0],X=z[1];return O[H]=O[X]}),O.resetProps=function(){return p.forEach(function(B){O[B.name](B.defaultVal)}),O},O.resetProps(),D._rerender=U,_&&M&&O(M),O}}var Ro=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return n},Out:function(n){return n},InOut:function(n){return n}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var e=1.70158;return n===1?1:n*n*((e+1)*n-e)},Out:function(n){var e=1.70158;return n===0?0:--n*n*((e+1)*n+e)+1},InOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)}}),Bounce:Object.freeze({In:function(n){return 1-Ro.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?Ro.Bounce.In(n*2)*.5:Ro.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(e){return Math.pow(e,n)},Out:function(e){return 1-Math.pow(1-e,n)},InOut:function(e){return e<.5?Math.pow(e*2,n)/2:(1-Math.pow(2-e*2,
4270n))/2+.5}}}}),LS=function(){return performance.now()},tR=(function(){function n(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return n.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var i=0,s=t;i<s.length;i++){var a=s[i];(e=a._group)===null||e===void 0||e.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},n.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,i=e;r<i.length;r++){var s=i[r];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},n.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},n.prototype.update=function(e,t){e===void 0&&(e=LS()),t===void 0&&(t=!0);var r=Object.keys(this._tweens);if(r.length!==0)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var s=this._tweens[r[i]],a=!t;s&&s.update(e,a)===!1&&!t&&this.remove(s)}r=Object.keys(this._tweensAddedDuringUpdate)}},n})(),XI={Linear:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=XI.Utils.Linear;return e<0?s(n[0],n[1],r):e>1?s(n[t],n[t-1],t-r):s(n[i],n[i+1>t?t:i+1],r-i)},Utils:{Linear:function(n,e,t){return(e-n)*t+n}}},Eue=(function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n})(),YI=new tR,Mc=(function(){function n(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ro.Linear.None,this._interpolationFunction=XI.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Eue.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof t=="object"?(this._group=t,t.add(this)):t===!0&&(this._group=YI,YI.add(this))}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.getDuration=function(){return this._duration},n.prototype.to=function(e,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},n.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},n.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},n.prototype.start=function(e,t){if(e===void 0&&(e=LS()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var s in this._valuesEnd)i[s]=this._valuesEnd[s];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},n.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},n.prototype._setupProperties=function(e,t,r,i,s){for(var a in r){var o=e[a],l=Array.isArray(o),u=l?"array":typeof o,d=!l&&Array.isArray(r[a]);if(!(u==="undefined"||u==="function")){if(d){var h=r[a];if(h.length===0)continue;for(var f=[o],p=0,g=h.length;p<g;p+=1){var A=this._handleRelativeValue(o,h[p]);if(isNaN(A)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}f.push(A)}d&&(r[a]=f)}if((u==="object"||l)&&o&&!d){t[a]=l?[]:{};var x=o;for(var b in x)t[a][b]=x[b];i[a]=l?[]:{};var h=r[a];if(!this._isDynamic){var _={};for(var b in h)_[b]=h[b];r[a]=h=_}this._setupProperties(x,t[a],h,i[a],s)}else(typeof t[a]>"u"||s)&&(t[a]=o),l||(t[a]*=1),d?i[a]=r[a].slice().reverse():i[a]=t[a]||0}}},n.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},n.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},n.prototype.pause=function(e){return e===void 0&&(e=LS()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},n.prototype.resume=function(e){return e===void 0&&(e=LS()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},n.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},n.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},n.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},n.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},n.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},n.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},n.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},n.prototype.easing=function(e){return e===void 0&&(e=Ro.Linear.None),this._easingFunction=e,this},n.prototype.interpolation=function(e){return e===void 0&&(e=XI.Linear),this._interpolationFunction=e,this},n.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},n.prototype.onStart=function(e){return this._onStartCallback=e,this},n.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},n.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},n.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},n.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},n.prototype.onStop=function(e){return this._onStopCallback=e,this},n.prototype.update=function(e,t){var r=this,i;if(e===void 0&&(e=LS()),t===void 0&&(t=n.autoStartOnUpdate),this._isPaused)return!0;var s;if(!this._goToEnd&&!this._isPlaying)if(t)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,o=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),l=this._duration+this._repeat*o,u=function(){if(r._duration===0||a>l)return 1;var A=Math.trunc(a/o),x=a-A*o,b=Math.min(x/r._duration,1);return b===0&&a===r._duration?1:b},d=u(),h=this._easingFunction(d);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,d),this._duration===0||a>=this._duration)if(this._repeat>0){var f=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=f);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])
4270),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*f,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,g=this._chainedTweens.length;p<g;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(e,t,r,i){for(var s in r)if(t[s]!==void 0){var a=t[s]||0,o=r[s],l=Array.isArray(e[s]),u=Array.isArray(o),d=!l&&u;d?e[s]=this._interpolationFunction(o,i):typeof o=="object"&&o?this._updateProperties(e[s],a,o,i):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(e[s]=a+(o-a)*i))}},n.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},n.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},n.autoStartOnUpdate=!1,n})();Eue.nextId;var P0=YI;P0.getAll.bind(P0);P0.removeAll.bind(P0);P0.add.bind(P0);P0.remove.bind(P0);P0.update.bind(P0);function iOe(n){const e=+this._x.call(null,n),t=+this._y.call(null,n),r=+this._z.call(null,n);return Cue(this.cover(e,t,r),e,t,r,n)}function Cue(n,e,t,r,i){if(isNaN(e)||isNaN(t)||isNaN(r))return n;var s,a=n._root,o={data:i},l=n._x0,u=n._y0,d=n._z0,h=n._x1,f=n._y1,p=n._z1,g,A,x,b,_,M,T,L,D,P,O;if(!a)return n._root=o,n;for(;a.length;)if((T=e>=(g=(l+h)/2))?l=g:h=g,(L=t>=(A=(u+f)/2))?u=A:f=A,(D=r>=(x=(d+p)/2))?d=x:p=x,s=a,!(a=a[P=D<<2|L<<1|T]))return s[P]=o,n;if(b=+n._x.call(null,a.data),_=+n._y.call(null,a.data),M=+n._z.call(null,a.data),e===b&&t===_&&r===M)return o.next=a,s?s[P]=o:n._root=o,n;do s=s?s[P]=new Array(8):n._root=new Array(8),(T=e>=(g=(l+h)/2))?l=g:h=g,(L=t>=(A=(u+f)/2))?u=A:f=A,(D=r>=(x=(d+p)/2))?d=x:p=x;while((P=D<<2|L<<1|T)===(O=(M>=x)<<2|(_>=A)<<1|b>=g));return s[O]=a,s[P]=o,n}function sOe(n){Array.isArray(n)||(n=Array.from(n));const e=n.length,t=new Float64Array(e),r=new Float64Array(e),i=new Float64Array(e);let s=1/0,a=1/0,o=1/0,l=-1/0,u=-1/0,d=-1/0;for(let h=0,f,p,g,A;h<e;++h)isNaN(p=+this._x.call(null,f=n[h]))||isNaN(g=+this._y.call(null,f))||isNaN(A=+this._z.call(null,f))||(t[h]=p,r[h]=g,i[h]=A,p<s&&(s=p),p>l&&(l=p),g<a&&(a=g),g>u&&(u=g),A<o&&(o=A),A>d&&(d=A));if(s>l||a>u||o>d)return this;this.cover(s,a,o).cover(l,u,d);for(let h=0;h<e;++h)Cue(this,t[h],r[h],i[h],n[h]);return this}function aOe(n,e,t){if(isNaN(n=+n)||isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,i=this._y0,s=this._z0,a=this._x1,o=this._y1,l=this._z1;if(isNaN(r))a=(r=Math.floor(n))+1,o=(i=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var u=a-r||1,d=this._root,h,f;r>n||n>=a||i>e||e>=o||s>t||t>=l;)switch(f=(t<s)<<2|(e<i)<<1|n<r,h=new Array(8),h[f]=d,d=h,u*=2,f){case 0:a=r+u,o=i+u,l=s+u;break;case 1:r=a-u,o=i+u,l=s+u;break;case 2:a=r+u,i=o-u,l=s+u;break;case 3:r=a-u,i=o-u,l=s+u;break;case 4:a=r+u,o=i+u,s=l-u;break;case 5:r=a-u,o=i+u,s=l-u;break;case 6:a=r+u,i=o-u,s=l-u;break;case 7:r=a-u,i=o-u,s=l-u;break}this._root&&this._root.length&&(this._root=d)}return this._x0=r,this._y0=i,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this}function oOe(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function lOe(n){return arguments.length?this.cover(+n[0][0],+n[0][1],+n[0][2]).cover(+n[1][0],+n[1][1],+n[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function Ys(n,e,t,r,i,s,a){this.node=n,this.x0=e,this.y0=t,this.z0=r,this.x1=i,this.y1=s,this.z1=a}function cOe(n,e,t,r){var i,s=this._x0,a=this._y0,o=this._z0,l,u,d,h,f,p,g=this._x1,A=this._y1,x=this._z1,b=[],_=this._root,M,T;for(_&&b.push(new Ys(_,s,a,o,g,A,x)),r==null?r=1/0:(s=n-r,a=e-r,o=t-r,g=n+r,A=e+r,x=t+r,r*=r);M=b.pop();)if(!(!(_=M.node)||(l=M.x0)>g||(u=M.y0)>A||(d=M.z0)>x||(h=M.x1)<s||(f=M.y1)<a||(p=M.z1)<o))if(_.length){var L=(l+h)/2,D=(u+f)/2,P=(d+p)/2;
vendor: 4,270 bytes, line 4270
4270b.push(new Ys(_[7],L,D,P,h,f,p),new Ys(_[6],l,D,P,L,f,p),new Ys(_[5],L,u,P,h,D,p),new Ys(_[4],l,u,P,L,D,p),new Ys(_[3],L,D,d,h,f,P),new Ys(_[2],l,D,d,L,f,P),new Ys(_[1],L,u,d,h,D,P),new Ys(_[0],l,u,d,L,D,P)),(T=(t>=P)<<2|(e>=D)<<1|n>=L)&&(M=b[b.length-1],b[b.length-1]=b[b.length-1-T],b[b.length-1-T]=M)}else{var O=n-+this._x.call(null,_.data),F=e-+this._y.call(null,_.data),U=t-+this._z.call(null,_.data),B=O*O+F*F+U*U;if(B<r){var z=Math.sqrt(r=B);s=n-z,a=e-z,o=t-z,g=n+z,A=e+z,x=t+z,i=_.data}}return i}const uOe=(n,e,t,r,i,s)=>Math.sqrt((n-r)**2+(e-i)**2+(t-s)**2);function dOe(n,e,t,r){const i=[],s=n-r,a=e-r,o=t-r,l=n+r,u=e+r,d=t+r;return this.visit((h,f,p,g,A,x,b)=>{if(!h.length)do{const _=h.data;uOe(n,e,t,this._x(_),this._y(_),this._z(_))<=r&&i.push(_)}while(h=h.next);return f>l||p>u||g>d||A<s||x<a||b<o}),i}function hOe(n){if(isNaN(f=+this._x.call(null,n))||isNaN(p=+this._y.call(null,n))||isNaN(g=+this._z.call(null,n)))return this;var e,t=this._root,r,i,s,a=this._x0,o=this._y0,l=this._z0,u=this._x1,d=this._y1,h=this._z1,f,p,g,A,x,b,_,M,T,L,D;if(!t)return this;if(t.length)for(;;){if((_=f>=(A=(a+u)/2))?a=A:u=A,(M=p>=(x=(o+d)/2))?o=x:d=x,(T=g>=(b=(l+h)/2))?l=b:h=b,e=t,!(t=t[L=T<<2|M<<1|_]))return this;if(!t.length)break;(e[L+1&7]||e[L+2&7]||e[L+3&7]||e[L+4&7]||e[L+5&7]||e[L+6&7]||e[L+7&7])&&(r=e,D=L)}for(;t.data!==n;)if(i=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,i?(s?i.next=s:delete i.next,this):e?(s?e[L]=s:delete e[L],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[D]=t:this._root=t),this):(this._root=s,this)}function fOe(n){for(var e=0,t=n.length;e<t;++e)this.remove(n[e]);return this}function pOe(){return this._root}function mOe(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function gOe(n){var e=[],t,r=this._root,i,s,a,o,l,u,d;for(r&&e.push(new Ys(r,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!n(r=t.node,s=t.x0,a=t.y0,o=t.z0,l=t.x1,u=t.y1,d=t.z1)&&r.length){var h=(s+l)/2,f=(a+u)/2,p=(o+d)/2;(i=r[7])&&e.push(new Ys(i,h,f,p,l,u,d)),(i=r[6])&&e.push(new Ys(i,s,f,p,h,u,d)),(i=r[5])&&e.push(new Ys(i,h,a,p,l,f,d)),(i=r[4])&&e.push(new Ys(i,s,a,p,h,f,d)),(i=r[3])&&e.push(new Ys(i,h,f,o,l,u,p)),(i=r[2])&&e.push(new Ys(i,s,f,o,h,u,p)),(i=r[1])&&e.push(new Ys(i,h,a,o,l,f,p)),(i=r[0])&&e.push(new Ys(i,s,a,o,h,f,p))}return this}function AOe(n){var e=[],t=[],r;for(this._root&&e.push(new Ys(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=e.pop();){var i=r.node;if(i.length){var s,a=r.x0,o=r.y0,l=r.z0,u=r.x1,d=r.y1,h=r.z1,f=(a+u)/2,p=(o+d)/2,g=(l+h)/2;(s=i[0])&&e.push(new Ys(s,a,o,l,f,p,g)),(s=i[1])&&e.push(new Ys(s,f,o,l,u,p,g)),(s=i[2])&&e.push(new Ys(s,a,p,l,f,d,g)),(s=i[3])&&e.push(new Ys(s,f,p,l,u,d,g)),(s=i[4])&&e.push(new Ys(s,a,o,g,f,p,h)),(s=i[5])&&e.push(new Ys(s,f,o,g,u,p,h)),(s=i[6])&&e.push(new Ys(s,a,p,g,f,d,h)),(s=i[7])&&e.push(new Ys(s,f,p,g,u,d,h))}t.push(r)}for(;r=t.pop();)n(r.node,r.x0,r.y0,r.z0,r.x1,r.y1,r.z1);return this}function xOe(n){return n[0]}function vOe(n){return arguments.length?(this._x=n,this):this._x}function yOe(n){return n[1]}function bOe(n){return arguments.length?(this._y=n,this):this._y}function wOe(n){return n[2]}function _Oe(n){return arguments.length?(this._z=n,this):this._z}function Nue(n,e,t,r){var i=new lz(e??xOe,t??yOe,r??wOe,NaN,NaN,NaN,NaN,NaN,NaN);return n==null?i:i.addAll(n)}function lz(n,e,t,r,i,s,a,o,l){this._x=n,this._y=e,this._z=t,this._x0=r,this._y0=i,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this._root=void 0}function mK(n){for(var e={data:n.data},t=e;n=n.next;)t=t.next={data:n.data};return e}var zl=Nue.prototype=lz.prototype;zl.copy=function(){var n=new lz(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,r;if(!e)return n;if(!e.length)return n._root=mK(e),n;for(t=[{source:e,target:n._root=new Array(8)}];e=t.pop();)for(var i=0;i<8;++i)(r=e.source[i])&&(r.length?t.push({source:r,target:e.target[i]=new Array(8)}):e.target[i]=mK(r));return n};zl.add=iOe;zl.addAll=sOe;zl.cover=aOe;zl.data=oOe;zl.extent=lOe;zl.find=cOe;zl.findAllWithinRadius=dOe;zl.remove=hOe;zl.removeAll=fOe;zl.root=pOe;zl.size=mOe;zl.visit=gOe;zl.visitAfter=AOe;zl.x=vOe;zl.y=bOe;
vendor: 16,914 bytes, line 4270
4270zl.z=_Oe;function g6(n,e){return n==null||e==null?NaN:n<e?-1:n>e?1:n>=e?0:NaN}function SOe(n,e){return n==null||e==null?NaN:e<n?-1:e>n?1:e>=n?0:NaN}function Mue(n){let e,t,r;n.length!==2?(e=g6,t=(o,l)=>g6(n(o),l),r=(o,l)=>n(o)-l):(e=n===g6||n===SOe?n:TOe,t=n,r=n);function i(o,l,u=0,d=o.length){if(u<d){if(e(l,l)!==0)return d;do{const h=u+d>>>1;t(o[h],l)<0?u=h+1:d=h}while(u<d)}return u}function s(o,l,u=0,d=o.length){if(u<d){if(e(l,l)!==0)return d;do{const h=u+d>>>1;t(o[h],l)<=0?u=h+1:d=h}while(u<d)}return u}function a(o,l,u=0,d=o.length){const h=i(o,l,u,d-1);return h>u&&r(o[h-1],l)>-r(o[h],l)?h-1:h}return{left:i,center:a,right:s}}function TOe(){return 0}function EOe(n){return n===null?NaN:+n}const COe=Mue(g6),kue=COe.right;Mue(EOe).center;function zM(n,e){let t,r;if(e===void 0)for(const i of n)i!=null&&(t===void 0?i>=i&&(t=r=i):(t>i&&(t=i),r<i&&(r=i)));else{let i=-1;for(let s of n)(s=e(s,++i,n))!=null&&(t===void 0?s>=s&&(t=r=s):(t>s&&(t=s),r<s&&(r=s)))}return[t,r]}class Hm{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=t[i],a=e+s,o=Math.abs(e)<Math.abs(s)?e-(a-s):s-(a-e);o&&(t[r++]=o),e=a}return t[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let t=this._n,r,i,s,a=0;if(t>0){for(a=e[--t];t>0&&(r=a,i=e[--t],a=r+i,s=i-(a-r),!s););t>0&&(s<0&&e[t-1]<0||s>0&&e[t-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}const NOe=Math.sqrt(50),MOe=Math.sqrt(10),kOe=Math.sqrt(2);function GM(n,e,t){const r=(e-n)/Math.max(0,t),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=NOe?10:s>=MOe?5:s>=kOe?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(n*u),l=Math.round(e*u),o/u<n&&++o,l/u>e&&--l,u=-u):(u=Math.pow(10,i)*a,o=Math.round(n/u),l=Math.round(e/u),o*u<n&&++o,l*u>e&&--l),l<o&&.5<=t&&t<2?GM(n,e,t*2):[o,l,u]}function ROe(n,e,t){if(e=+e,n=+n,t=+t,!(t>0))return[];if(n===e)return[n];const r=e<n,[i,s,a]=r?GM(e,n,t):GM(n,e,t);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let u=0;u<o;++u)l[u]=(s-u)/-a;else for(let u=0;u<o;++u)l[u]=(s-u)*a;else if(a<0)for(let u=0;u<o;++u)l[u]=(i+u)/-a;else for(let u=0;u<o;++u)l[u]=(i+u)*a;return l}function QI(n,e,t){return e=+e,n=+n,t=+t,GM(n,e,t)[2]}function POe(n,e,t){e=+e,n=+n,t=+t;const r=e<n,i=r?QI(e,n,t):QI(n,e,t);return(r?-1:1)*(i<0?1/-i:i)}function LOe(n,e){let t;for(const r of n)r!=null&&(t<r||t===void 0&&r>=r)&&(t=r);return t}function OOe(n,e){let t=0,r=0;if(e===void 0)for(let i of n)i!=null&&(i=+i)>=i&&(++t,r+=i);else{let i=-1;for(let s of n)(s=e(s,++i,n))!=null&&(s=+s)>=s&&(++t,r+=s)}if(t)return r/t}function*DOe(n){for(const e of n)yield*e}function E5(n){return Array.from(DOe(n))}function pb(n,e,t){n=+n,e=+e,t=(i=arguments.length)<2?(e=n,n=0,1):i<3?1:+t;for(var r=-1,i=Math.max(0,Math.ceil((e-n)/t))|0,s=new Array(i);++r<i;)s[r]=n+r*t;return s}function jOe(n,e){let t=0;for(let r of n)(r=+r)&&(t+=r);return t}function Rue(n,e){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(e).domain(n);break}return this}function cz(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Pue(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function CT(){}var C5=.7,qM=1/C5,Lb="\\s*([+-]?\\d+)\\s*",N5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",x0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",IOe=/^#([0-9a-f]{3,8})$/,FOe=new RegExp(`^rgb\\(${Lb},${Lb},${Lb}\\)$`),UOe=new RegExp(`^rgb\\(${x0},${x0},${x0}\\)$`),BOe=new RegExp(`^rgba\\(${Lb},${Lb},${Lb},${N5}\\)$`),VOe=new RegExp(`^rgba\\(${x0},${x0},${x0},${N5}\\)$`),zOe=new RegExp(`^hsl\\(${N5},${x0},${x0}\\)$`),GOe=new RegExp(`^hsla\\(${N5},${x0},${x0},${N5}\\)$`),gK={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};cz(CT,iy,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:AK,formatHex:AK,formatHex8:qOe,formatHsl:$Oe,formatRgb:xK,toString:xK});function AK(){return this.rgb().formatHex()}function qOe(){return this.rgb().formatHex8()}function $Oe(){return Lue(this).formatHsl()}function xK(){return this.rgb().formatRgb()}function iy(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=IOe.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?vK(e):t===3?new Vu(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?wC(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?wC(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=FOe.exec(n))?new Vu(e[1],e[2],e[3],1):(e=UOe.exec(n))?new Vu(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=BOe.exec(n))?wC(e[1],e[2],e[3],e[4]):(e=VOe.exec(n))?wC(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=zOe.exec(n))?wK(e[1],e[2]/100,e[3]/100,1):(e=GOe.exec(n))?wK(e[1],e[2]/100,e[3]/100,e[4]):gK.hasOwnProperty(n)?vK(gK[n]):n==="transparent"?new Vu(NaN,NaN,NaN,0):null}function vK(n){return new Vu(n>>16&255,n>>8&255,n&255,1)}function wC(n,e,t,r){return r<=0&&(n=e=t=NaN),new Vu(n,e,t,r)}function HOe(n){return n instanceof CT||(n=iy(n)),n?(n=n.rgb(),new Vu(n.r,n.g,n.b,n.opacity)):new Vu}function KI(n,e,t,r){return arguments.length===1?HOe(n):new Vu(n,e,t,r??1)}function Vu(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}cz(Vu,KI,Pue(CT,{brighter(n){return n=n==null?qM:Math.pow(qM,n),new Vu(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?C5:Math.pow(C5,n),new Vu(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Vu(jv(this.r),jv(this.g),jv(this.b),$M(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yK,formatHex:yK,formatHex8:WOe,formatRgb:bK,toString:bK}));function yK(){return`#${fv(this.r)}${fv(this.g)}${fv(this.b)}`}function WOe(){return`#${fv(this.r)}${fv(this.g)}${fv(this.b)}${fv((isNaN(this.opacity)?1:this.opacity)*255)}`}function bK(){const n=$M(this.opacity);return`${n===1?"rgb(":"rgba("}${jv(this.r)}, ${jv(this.g)}, ${jv(this.b)}${n===1?")":`, ${n})`}`}function $M(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function jv(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function fv(n){return n=jv(n),(n<16?"0":"")+n.toString(16)}function wK(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Gf(n,e,t,r)}function Lue(n){if(n instanceof Gf)return new Gf(n.h,n.s,n.l,n.opacity);if(n instanceof CT||(n=iy(n)),!n)return new Gf;if(n instanceof Gf)return n;n=n.rgb();var e=n.r/255,t=n.g/255,r=n.b/255,i=Math.min(e,t,r),s=Math.max(e,t,r),a=NaN,o=s-i,l=(s+i)/2;return o?(e===s?a=(t-r)/o+(t<r)*6:t===s?a=(r-e)/o+2:a=(e-t)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new Gf(a,o,l,n.opacity)}function XOe(n,e,t,r){return arguments.length===1?Lue(n):new Gf(n,e,t,r??1)}function Gf(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}cz(Gf,XOe,Pue(CT,{brighter(n){return n=n==null?qM:Math.pow(qM,n),new Gf(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?C5:Math.pow(C5,n),new Gf(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,i=2*t-r;return new Vu(K9(n>=240?n-240:n+120,i,r),K9(n,i,r),K9(n<120?n+240:n-120,i,r),this.opacity)},clamp(){return new Gf(_K(this.h),_C(this.s),_C(this.l),$M(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=$M(this.opacity);return`${n===1?"hsl(":"hsla("}${_K(this.h)}, ${_C(this.s)*100}%, ${_C(this.l)*100}%${n===1?")":`, ${n})`}`}}));function _K(n){return n=(n||0)%360,n<0?n+360:n}function _C(n){return Math.max(0,Math.min(1,n||0))}function K9(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const uz=n=>()=>n;function YOe(n,e){return function(t){return n+t*e}}function QOe(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}function KOe(n){return(n=+n)==1?Oue:function(e,t){return t-e?QOe(e,t,n):uz(isNaN(e)?t:e)}}function Oue(n,e){var t=e-n;return t?YOe(n,t):uz(isNaN(n)?e:n)}const SK=(function n(e){var t=KOe(e);function r(i,s){var a=t((i=KI(i)).r,(s=KI(s)).r),o=t(i.g,s.g),l=t(i.b,s.b),u=Oue(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=l(d),i.opacity=u(d),i+""}}return r.gamma=n,r})(1);function Due(n,e){e||(e=[]);var t=n?Math.min(e.length,n.length):0,r=e.slice(),i;return function(s){for(i=0;i<t;++i)r[i]=n[i]*(1-s)+e[i]*s;return r}}function jue(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function ZOe(n,e){return(jue(e)?Due:Iue)(n,e)}function Iue(n,e){var t=e?e.length:0,r=n?Math.min(t,n.length):0,i=new Array(r),s=new Array(t),a;for(a=0;a<r;++a)i[a]=dz(n[a],e[a]);for(;a<t;++a)s[a]=e[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function JOe(n,e){var t=new Date;return n=+n,e=+e,function(r){return t.setTime(n*(1-r)+e*r),t}}function M5(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}function eDe(n,e){var t={},r={},i;(n===null||typeof n!="object")&&(n={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in n?t[i]=dz(n[i],e[i]):r[i]=e[i];return function(s){for(i in t)r[i]=t[i](s);return r}}var ZI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Z9=new RegExp(ZI.source,"g");function tDe(n){return function(){return n}}function nDe(n){return function(e){return n(e)+""}}function rDe(n,e){var t=ZI.lastIndex=Z9.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(n=n+"",e=e+"";(r=ZI.exec(n))&&(i=Z9.exec(e));)(s=i.index)>t&&(s=e.slice(t,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:M5(r,i)})),t=Z9.lastIndex;return t<e.length&&(s=e.slice(t),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?nDe(l[0].x):tDe(e):(e=l.length,function(u){for(var d=0,h;d<e;++d)o[(h=l[d]).i]=h.x(u);return o.join("")})}function dz(n,e){var t=typeof e,r;return e==null||t==="boolean"?uz(e):(t==="number"?M5:t==="string"?(r=iy(e))?(e=r,SK):rDe:e instanceof iy?SK:e instanceof Date?JOe:jue(e)?Due:Array.isArray(e)?Iue:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?eDe:M5)(n,e)}function iDe(n,e){return n=+n,e=+e,function(t){return Math.round(n*(1-t)+e*t)}}function sDe(n){return function(){return n}}function aDe(n){return+n}var TK=[0,1];function mb(n){return n}function JI(n,e){return(e-=n=+n)?function(t){return(t-n)/e}:sDe(isNaN(e)?NaN:.5)}function oDe(n,e){var t;return n>e&&(t=n,n=e,e=t),function(r){return Math.max(n,Math.min(e,r))}}function lDe(n,e,t){var r=n[0],i=n[1],s=e[0],a=e[1];return i<r?(r=JI(i,r),s=t(a,s)):(r=JI(r,i),s=t(s,a)),function(o){return s(r(o))}}function cDe(n,e,t){var r=Math.min(n.length,e.length)-1,i=new Array(r),s=new Array(r),a=-1;for(n[r]<n[0]&&(n=n.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=JI(n[a],n[a+1]),s[a]=t(e[a],e[a+1]);return function(o){var l=kue(n,o,1,r)-1;return s[l](i[l](o))}}function uDe(n,e){return e.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function dDe(){var n=TK,e=TK,t=dz,r,i,s,a=mb,o,l,u;function d(){var f=Math.min(n.length,e.length);return a!==mb&&(a=oDe(n[0],n[f-1])),o=f>2?cDe:lDe,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?s:(l||(l=o(n.map(r),e,t)))(r(a(f)))}return h.invert=function(f){return a(i((u||(u=o(e,n.map(r),M5)))(f)))},h.domain=function(f){return arguments.length?(n=Array.from(f,aDe),d()):n.slice()},h.range=function(f){return arguments.length?(e=Array.from(f),d()):e.slice()},h.rangeRound=function(f){return e=Array.from(f),t=iDe,d()},h.clamp=function(f){return arguments.length?(a=f?!0:mb,d()):a!==mb},h.interpolate=function(f){return arguments.length?(t=f,d()):t},h.unknown=function(f){return arguments.length?(s=f,h):s},function(f,p){return r=f,i=p,d()}}function hDe(){return dDe()(mb,mb)}function fDe(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function HM(n,e){if(!isFinite(n)||n===0)return null;var t=(n=e?n.toExponential(e-1):n.toExponential()).indexOf("e"),r=n.slice(0,t);return[r.length>1?r[0]+r.slice(2):r,+n.slice(t+1)]}function $w(n){return n=HM(Math.abs(n)),n?n[1]:NaN}function pDe(n,e){return function(t,r){for(var i=t.length,s=[],a=0,o=n[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(t.substring(i-=o,i+o)),!((l+=o+1)>r));)o=n[a=(a+1)%n.length];return s.reverse().join(e)}}function mDe(n){return function(e){return e.replace(/[0-9]/g,function(t){return n[+t]})}}var gDe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function WM(n){if(!(e=gDe.exec(n)))throw new Error("invalid format: "+n);var e;return new hz({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}WM.prototype=hz.prototype;function hz(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}hz.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ADe(n){e:for(var e=n.length,t=1,r=-1,i;t<e;++t)switch(n[t]){case".":r=i=t;break;case"0":r===0&&(r=t),i=t;break;default:if(!+n[t])break e;r>0&&(r=0);break}return r>0?n.slice(0,r)+n.slice(i+1):n}var XM;function xDe(n,e){var t=HM(n,e);if(!t)return XM=void 0,n.toPrecision(e);var r=t[0],i=t[1],s=i-(XM=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+HM(n,Math.max(0,e+s-1))[0]}function EK(n,e){var t=HM(n,e);if(!t)return n+"";var r=t[0],i=t[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const CK={"%":(n,e)=>(n*100).toFixed(e),b:n=>Math.round(n).toString(2),c:n=>n+"",d:fDe,e:(n,e)=>n.toExponential(e),f:(n,e)=>n.toFixed(e),g:(n,e)=>n.toPrecision(e),o:n=>Math.round(n).toString(8),p:(n,e)=>EK(n*100,e),r:EK,s:xDe,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>
4270Math.round(n).toString(16)};function NK(n){return n}var MK=Array.prototype.map,kK=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vDe(n){var e=n.grouping===void 0||n.thousands===void 0?NK:pDe(MK.call(n.grouping,Number),n.thousands+""),t=n.currency===void 0?"":n.currency[0]+"",r=n.currency===void 0?"":n.currency[1]+"",i=n.decimal===void 0?".":n.decimal+"",s=n.numerals===void 0?NK:mDe(MK.call(n.numerals,String)),a=n.percent===void 0?"%":n.percent+"",o=n.minus===void 0?"â":n.minus+"",l=n.nan===void 0?"NaN":n.nan+"";function u(h,f){h=WM(h);var p=h.fill,g=h.align,A=h.sign,x=h.symbol,b=h.zero,_=h.width,M=h.comma,T=h.precision,L=h.trim,D=h.type;D==="n"?(M=!0,D="g"):CK[D]||(T===void 0&&(T=12),L=!0,D="g"),(b||p==="0"&&g==="=")&&(b=!0,p="0",g="=");var P=(f&&f.prefix!==void 0?f.prefix:"")+(x==="$"?t:x==="#"&&/[boxX]/.test(D)?"0"+D.toLowerCase():""),O=(x==="$"?r:/[%p]/.test(D)?a:"")+(f&&f.suffix!==void 0?f.suffix:""),F=CK[D],U=/[defgprs%]/.test(D);T=T===void 0?6:/[gprs]/.test(D)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function B(z){var H=P,X=O,W,J,ee;if(D==="c")X=F(z)+X,z="";else{z=+z;var ae=z<0||1/z<0;if(z=isNaN(z)?l:F(Math.abs(z),T),L&&(z=ADe(z)),ae&&+z==0&&A!=="+"&&(ae=!1),H=(ae?A==="("?A:o:A==="-"||A==="("?"":A)+H,X=(D==="s"&&!isNaN(z)&&XM!==void 0?kK[8+XM/3]:"")+X+(ae&&A==="("?")":""),U){for(W=-1,J=z.length;++W<J;)if(ee=z.charCodeAt(W),48>ee||ee>57){X=(ee===46?i+z.slice(W+1):z.slice(W))+X,z=z.slice(0,W);break}}}M&&!b&&(z=e(z,1/0));var le=H.length+z.length+X.length,Z=le<_?new Array(_-le+1).join(p):"";switch(M&&b&&(z=e(Z+z,Z.length?_-X.length:1/0),Z=""),g){case"<":z=H+z+X+Z;break;case"=":z=H+Z+z+X;break;case"^":z=Z.slice(0,le=Z.length>>1)+H+z+X+Z.slice(le);break;default:z=Z+H+z+X;break}return s(z)}return B.toString=function(){return h+""},B}function d(h,f){var p=Math.max(-8,Math.min(8,Math.floor($w(f)/3)))*3,g=Math.pow(10,-p),A=u((h=WM(h),h.type="f",h),{suffix:kK[8+p/3]});return function(x){return A(g*x)}}return{format:u,formatPrefix:d}}var SC,Fue,Uue;yDe({thousands:",",grouping:[3],currency:["$",""]});function yDe(n){return SC=vDe(n),Fue=SC.format,Uue=SC.formatPrefix,SC}function bDe(n){return Math.max(0,-$w(Math.abs(n)))}function wDe(n,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($w(e)/3)))*3-$w(Math.abs(n)))}function _De(n,e){return n=Math.abs(n),e=Math.abs(e)-n,Math.max(0,$w(e)-$w(n))+1}function SDe(n,e,t,r){var i=POe(n,e,t),s;switch(r=WM(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(e));return r.precision==null&&!isNaN(s=wDe(i,a))&&(r.precision=s),Uue(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=_De(i,Math.max(Math.abs(n),Math.abs(e))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=bDe(i))&&(r.precision=s-(r.type==="%")*2);break}}return Fue(r)}function Bue(n){var e=n.domain;return n.ticks=function(t){var r=e();return ROe(r[0],r[r.length-1],t??10)},n.tickFormat=function(t,r){var i=e();return SDe(i[0],i[i.length-1],t??10,r)},n.nice=function(t){t==null&&(t=10);var r=e(),i=0,s=r.length-1,a=r[i],o=r[s],l,u,d=10;for(o<a&&(u=a,a=o,o=u,u=i,i=s,s=u);d-- >0;){if(u=QI(a,o,t),u===l)return r[i]=a,r[s]=o,e(r);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;l=u}return n},n}function tg(){var n=hDe();return n.copy=function(){return uDe(n,tg())},Rue.apply(n,arguments),Bue(n)}function Vue(){var n=0,e=1,t=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[kue(r,l,0,t)]:s}function o(){var l=-1;for(r=new Array(t);++l<t;)r[l]=((l+1)*e-(l-t)*n)/(t+1);return a}return a.domain=function(l){return arguments.length?([n,e]=l,n=+n,e=+e,o()):[n,e]},a.range=function(l){return arguments.length?(t=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[n,r[0]]:u>=t?[r[t-1],e]:[r[u-1],r[u]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Vue().domain([n,e]).range(i).unknown(s)},Rue.apply(Bue(a),arguments)}var Ti=1e-6,YM=1e-12,es=Math.PI,zu=es/2,QM=es/4,eh=es*2,Qa=180/es,Yr=es/180,Gs=Math.abs,fz=Math.atan,Hh=Math.atan2,ti=Math.cos,TC=Math.ceil,TDe=Math.exp,eF=Math.hypot,EDe=Math.log,Hr=Math.sin,CDe=Math.sign||function(n){return n>0?1:n<0?-1:0},ng=Math.sqrt,NDe=Math.tan;function MDe(n){return n>1?0:n<-1?es:Math.acos(n)}function rg(n){return n>1?zu:n<-1?-zu:Math.asin(n)}function RK(n){return(n=Hr(n/2))*n}function xc(){}function KM(n,e){n&&LK.hasOwnProperty(n.type)&&LK[n.type](n,e)}var PK={Feature:function(n,e){KM(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++r<i;)KM(t[r].geometry,e)}},LK={Sphere:function(n,e){e.sphere()},Point:function(n,e){n=n.coordinates,e.point(n[0],n[1],n[2])},MultiPoint:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)n=t[r],e.point(n[0],n[1],n[2])},LineString:function(n,e){tF(n.coordinates,e,0)},MultiLineString:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)tF(t[r],e,0)},Polygon:function(n,e){OK(n.coordinates,e)},MultiPolygon:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)OK(t[r],e)},GeometryCollection:function(n,e){for(var t=n.geometries,r=-1,i=t.length;++r<i;)KM(t[r],e)}};function tF(n,e,t){var r=-1,i=n.length-t,s;for(e.lineStart();++r<i;)s=n[r],e.point(s[0],s[1],s[2]);e.lineEnd()}function OK(n,e){var t=-1,r=n.length;for(e.polygonStart();++t<r;)tF(n[t],e,1);e.polygonEnd()}function nR(n,e){n&&PK.hasOwnProperty(n.type)?PK[n.type](n,e):KM(n,e)}var ZM=new Hm,DK=new Hm,zue,Gue,nF,rF,iF,ig={point:xc,lineStart:xc,lineEnd:xc,polygonStart:function(){ZM=new Hm,ig.lineStart=kDe,ig.lineEnd=RDe},polygonEnd:function(){var n=+ZM;DK.add(n<0?eh+n:n),this.lineStart=this.lineEnd=this.point=xc},sphere:function(){DK.add(eh)}};function kDe(){ig.point=PDe}function RDe(){que(zue,Gue)}function PDe(n,e){ig.point=que,zue=n,Gue=e,n*=Yr,e*=Yr,nF=n,rF=ti(e=e/2+QM),iF=Hr(e)}function que(n,e){n*=Yr,e*=Yr,e=e/2+QM;var t=n-nF,r=t>=0?1:-1,i=r*t,s=ti(e),a=Hr(e),o=iF*a,l=rF*s+o*ti(i),u=o*r*Hr(i);ZM.add(Hh(u,l)),nF=n,rF=s,iF=a}function JM(n){return[Hh(n[1],n[0]),rg(n[2])]}function sy(n){var e=n[0],t=n[1],r=ti(t);return[r*ti(e),r*Hr(e),Hr(t)]}function EC(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Hw(n,e){return[n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function J9(n,e){n[0]+=e[0],n[1]+=e[1],n[2]+=e[2]}
vendor: 8,859 bytes, line 4270
4270function CC(n,e){return[n[0]*e,n[1]*e,n[2]*e]}function ek(n){var e=ng(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=e,n[1]/=e,n[2]/=e}var Pa,Du,Xa,Ud,qx,$ue,Hue,Ob,m4,wA,sg,km={point:sF,lineStart:jK,lineEnd:IK,polygonStart:function(){km.point=Xue,km.lineStart=LDe,km.lineEnd=ODe,m4=new Hm,ig.polygonStart()},polygonEnd:function(){ig.polygonEnd(),km.point=sF,km.lineStart=jK,km.lineEnd=IK,ZM<0?(Pa=-(Xa=180),Du=-(Ud=90)):m4>Ti?Ud=90:m4<-Ti&&(Du=-90),sg[0]=Pa,sg[1]=Xa},sphere:function(){Pa=-(Xa=180),Du=-(Ud=90)}};function sF(n,e){wA.push(sg=[Pa=n,Xa=n]),e<Du&&(Du=e),e>Ud&&(Ud=e)}function Wue(n,e){var t=sy([n*Yr,e*Yr]);if(Ob){var r=Hw(Ob,t),i=[r[1],-r[0],0],s=Hw(i,r);ek(s),s=JM(s);var a=n-qx,o=a>0?1:-1,l=s[0]*Qa*o,u,d=Gs(a)>180;d^(o*qx<l&&l<o*n)?(u=s[1]*Qa,u>Ud&&(Ud=u)):(l=(l+360)%360-180,d^(o*qx<l&&l<o*n)?(u=-s[1]*Qa,u<Du&&(Du=u)):(e<Du&&(Du=e),e>Ud&&(Ud=e))),d?n<qx?Pd(Pa,n)>Pd(Pa,Xa)&&(Xa=n):Pd(n,Xa)>Pd(Pa,Xa)&&(Pa=n):Xa>=Pa?(n<Pa&&(Pa=n),n>Xa&&(Xa=n)):n>qx?Pd(Pa,n)>Pd(Pa,Xa)&&(Xa=n):Pd(n,Xa)>Pd(Pa,Xa)&&(Pa=n)}else wA.push(sg=[Pa=n,Xa=n]);e<Du&&(Du=e),e>Ud&&(Ud=e),Ob=t,qx=n}function jK(){km.point=Wue}function IK(){sg[0]=Pa,sg[1]=Xa,km.point=sF,Ob=null}function Xue(n,e){if(Ob){var t=n-qx;m4.add(Gs(t)>180?t+(t>0?360:-360):t)}else $ue=n,Hue=e;ig.point(n,e),Wue(n,e)}function LDe(){ig.lineStart()}function ODe(){Xue($ue,Hue),ig.lineEnd(),Gs(m4)>Ti&&(Pa=-(Xa=180)),sg[0]=Pa,sg[1]=Xa,Ob=null}function Pd(n,e){return(e-=n)<0?e+360:e}function DDe(n,e){return n[0]-e[0]}function FK(n,e){return n[0]<=n[1]?n[0]<=e&&e<=n[1]:e<n[0]||n[1]<e}function Yue(n){var e,t,r,i,s,a,o;if(Ud=Xa=-(Pa=Du=1/0),wA=[],nR(n,km),t=wA.length){for(wA.sort(DDe),e=1,r=wA[0],s=[r];e<t;++e)i=wA[e],FK(r,i[0])||FK(r,i[1])?(Pd(r[0],i[1])>Pd(r[0],r[1])&&(r[1]=i[1]),Pd(i[0],r[1])>Pd(r[0],r[1])&&(r[0]=i[0])):s.push(r=i);for(a=-1/0,t=s.length-1,e=0,r=s[t];e<=t;r=i,++e)i=s[e],(o=Pd(r[1],i[0]))>a&&(a=o,Pa=i[0],Xa=r[1])}return wA=sg=null,Pa===1/0||Du===1/0?[[NaN,NaN],[NaN,NaN]]:[[Pa,Du],[Xa,Ud]]}var OS,tk,nk,rk,ik,sk,ak,ok,aF,oF,lF,Que,Kue,iu,su,au,Wf={sphere:xc,point:pz,lineStart:UK,lineEnd:BK,polygonStart:function(){Wf.lineStart=FDe,Wf.lineEnd=UDe},polygonEnd:function(){Wf.lineStart=UK,Wf.lineEnd=BK}};function pz(n,e){n*=Yr,e*=Yr;var t=ti(e);NT(t*ti(n),t*Hr(n),Hr(e))}function NT(n,e,t){++OS,nk+=(n-nk)/OS,rk+=(e-rk)/OS,ik+=(t-ik)/OS}function UK(){Wf.point=jDe}function jDe(n,e){n*=Yr,e*=Yr;var t=ti(e);iu=t*ti(n),su=t*Hr(n),au=Hr(e),Wf.point=IDe,NT(iu,su,au)}function IDe(n,e){n*=Yr,e*=Yr;var t=ti(e),r=t*ti(n),i=t*Hr(n),s=Hr(e),a=Hh(ng((a=su*s-au*i)*a+(a=au*r-iu*s)*a+(a=iu*i-su*r)*a),iu*r+su*i+au*s);tk+=a,sk+=a*(iu+(iu=r)),ak+=a*(su+(su=i)),ok+=a*(au+(au=s)),NT(iu,su,au)}function BK(){Wf.point=pz}function FDe(){Wf.point=BDe}function UDe(){Zue(Que,Kue),Wf.point=pz}function BDe(n,e){Que=n,Kue=e,n*=Yr,e*=Yr,Wf.point=Zue;var t=ti(e);iu=t*ti(n),su=t*Hr(n),au=Hr(e),NT(iu,su,au)}function Zue(n,e){n*=Yr,e*=Yr;var t=ti(e),r=t*ti(n),i=t*Hr(n),s=Hr(e),a=su*s-au*i,o=au*r-iu*s,l=iu*i-su*r,u=eF(a,o,l),d=rg(u),h=u&&-d/u;aF.add(h*a),oF.add(h*o),lF.add(h*l),tk+=d,sk+=d*(iu+(iu=r)),ak+=d*(su+(su=i)),ok+=d*(au+(au=s)),NT(iu,su,au)}function VK(n){OS=tk=nk=rk=ik=sk=ak=ok=0,aF=new Hm,oF=new Hm,lF=new Hm,nR(n,Wf);var e=+aF,t=+oF,r=+lF,i=eF(e,t,r);return i<YM&&(e=sk,t=ak,r=ok,tk<Ti&&(e=nk,t=rk,r=ik),i=eF(e,t,r),i<YM)?[NaN,NaN]:[Hh(t,e)*Qa,rg(r/i)*Qa]}function cF(n,e){function t(r,i){return r=n(r,i),e(r[0],r[1])}return n.invert&&e.invert&&(t.invert=function(r,i){return r=e.invert(r,i),r&&n.invert(r[0],r[1])}),t}function uF(n,e){return Gs(n)>es&&(n-=Math.round(n/eh)*eh),[n,e]}uF.invert=uF;function Jue(n,e,t){return(n%=eh)?e||t?cF(GK(n),qK(e,t)):GK(n):e||t?qK(e,t):uF}function zK(n){return function(e,t){return e+=n,Gs(e)>es&&(e-=Math.round(e/eh)*eh),[e,t]}}function GK(n){var e=zK(n);return e.invert=zK(-n),e}function qK(n,e){var t=ti(n),r=Hr(n),i=ti(e),s=Hr(e);function a(o,l){var u=ti(l),d=ti(o)*u,h=Hr(o)*u,f=Hr(l),p=f*t+d*r;return[Hh(h*i-p*s,d*t-f*r),rg(p*i+h*s)]}return a.invert=function(o,l){var u=ti(l),d=ti(o)*u,h=Hr(o)*u,f=Hr(l),p=f*i-h*s;return[Hh(h*i+f*s,d*t+p*r),rg(p*t-d*r)]},a}function VDe(n){n=Jue(n[0]*Yr,n[1]*Yr,n.length>2?n[2]*Yr:0);function e(t){return t=n(t[0]*Yr,t[1]*Yr),t[0]*=Qa,t[1]*=Qa,t}return e.invert=function(t){return t=n.invert(t[0]*Yr,t[1]*Yr),t[0]*=Qa,t[1]*=Qa,t},e}function zDe(n,e,t,r,i,s){if(t){var a=ti(e),o=Hr(e),l=r*t;i==null?(i=e+r*eh,s=e-l/2):(i=$K(a,i),s=$K(a,s),(r>0?i<s:i>s)&&(i+=r*eh));for(var u,d=i;r>0?d>s:d<s;d-=l)u=JM([a,-o*ti(d),-o*Hr(d)]),n.point(u[0],u[1])}}function $K(n,e){e=sy(e),e[0]-=n,ek(e);var t=MDe(-e[1]);return((-e[2]<0?-t:t)+eh-Ti)%eh}function ede(){var n=[],e;return{point:function(t,r,i){e.push([t,r,i])},lineStart:function(){n.push(e=[])},lineEnd:xc,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],e=null,t}}}function A6(n,e){return Gs(n[0]-e[0])<Ti&&Gs(n[1]-e[1])<Ti}function NC(n,e,t,r){this.x=n,this.z=e,this.o=t,this.e=r,this.v=!1,this.n=this.p=null}function tde(n,e,t,r,i){var s=[],a=[],o,l;if(n.forEach(function(g){if(!((A=g.length-1)<=0)){var A,x=g[0],b=g[A],_;if(A6(x,b)){if(!x[2]&&!b[2]){for(i.lineStart(),o=0;o<A;++o)i.point((x=g[o])[0],x[1]);i.lineEnd();return}b[0]+=2*Ti}s.push(_=new NC(x,g,null,!0)),a.push(_.o=new NC(x,null,_,!1)),s.push(_=new NC(b,g,null,!1)),a.push(_.o=new NC(b,null,_,!0))}}),!!s.length){for(a.sort(e),HK(s),HK(a),o=0,l=a.length;o<l;++o)a[o].e=t=!t;for(var u=s[0],d,h;;){for(var f=u,p=!0;f.v;)if((f=f.n)===u)return;d=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(o=0,l=d.length;o<l;++o)i.point((h=d[o])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(d=f.p.z,o=d.length-1;o>=0;--o)i.point((h=d[o])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,d=f.z,p=!p}while(!f.v);i.lineEnd()}}}function HK(n){if(e=n.length){for(var e,t=0,r=n[0],i;++t<e;)r.n=i=n[t],i.p=r,r=i;r.n=i=n[0],i.p=r}}function eL(n){return Gs(n[0])<=es?n[0]:CDe(n[0])*((Gs(n[0])+es)%eh-es)}function nde(n,e){var t=eL(e),r=e[1],i=Hr(r),s=[Hr(t),-ti(t),0],a=0,o=0,l=new Hm;i===1?r=zu+Ti:i===-1&&(r=-zu-Ti);for(var u=0,d=n.length;u<d;++u)if(f=(h=n[u]).length)for(var h,f,p=h[f-1],g=eL(p),A=p[1]/2+QM,x=Hr(A),b=ti(A),_=0;_<f;++_,g=T,x=D,b=P,p=M){var M=h[_],T=eL(M),L=M[1]/2+QM,D=Hr(L),P=ti(L),O=T-g,F=O>=0?1:-1,U=F*O,B=U>es,z=x*D;if(l.add(Hh(z*F*Hr(U),b*P+z*ti(U))),a+=B?O+F*eh:O,B^g>=t^T>=t){var H=Hw(sy(p),sy(M));ek(H);var X=Hw(s,H);ek(X);var W=(B^O>=0?-1:1)*rg(X[2]);(r>W||r===W&&(H[0]||H[1]))&&(o+=B^O>=0?1:-1)}}return(a<-Ti||a<Ti&&l<-YM)^o&1}function rde(n,e,t,r){return function(i){var s=e(i),a=ede(),o=e(a),l=!1,u,d,h,f={point:p,lineStart:A,lineEnd:x,polygonStart:function(){f.point=b,f.lineStart=_,f.lineEnd=M,d=[],u=[]},polygonEnd:function(){f.point=p,f.lineStart=A,f.lineEnd=x,d=E5(d);var T=nde(u,r);d.length?(l||(i.polygonStart(),l=!0),tde(d,qDe,T,t,i)):T&&(l||(i.polygonStart(),l=!0),i.lineStart(),t(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),d=u=null},sphere:function(){i.polygonStart(),i.lineStart(),t(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(T,L){n(T,L)&&i.point(T,L)}function g(T,L){s.point(T,L)}function A(){f.point=g,s.lineStart()}function x(){f.point=p,s.lineEnd()}function b(T,L){h.push([T,L]),o.point(T,L)}function _(){o.lineStart(),h=[]}function M(){b(h[0][0],h[0][1]),o.lineEnd();var T=o.clean(),L=a.result(),D,P=L.length,O,F,U;if(h.pop(),u.push(h),h=null,!!P){if(T&1){if(F=L[0],(O=F.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),D=0;D<O;++D)i.point((U=F[D])[0],U[1]);i.lineEnd()}return}P>1&&T&2&&L.push(L.pop().concat(L.shift())),d.push(L.filter(GDe))}}return f}}function GDe(n){return n.length>1}function qDe(n,e){return((n=n.x)[0]<0?n[1]-zu-Ti:zu-n[1])-((e=e.x)[0]<0?e[1]-zu-Ti:zu-e[1])}const WK=rde(function(){return!0},$De,WDe,[-es,-zu]);function $De(n){var e=NaN,t=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(s,a){var o=s>0?es:-es,l=Gs(s-e);Gs(l-es)<Ti?(n.point(e,t=(t+a)/2>0?zu:-zu),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(o,t),n.point(s,t),i=0):r!==o&&l>=es&&(Gs(e-r)<Ti&&(e-=r*Ti),Gs(s-o)<Ti&&(s-=o*Ti),t=HDe(e,t,s,a),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(o,t),i=0),n.point(e=s,t=a),r=o},lineEnd:function(){n.lineEnd(),e=t=NaN},clean:function(){return 2-i}}}function HDe(n,e,t,r){var i,s,a=Hr(n-t);return Gs(a)>Ti?fz((Hr(e)*(s=ti(r))*Hr(t)-Hr(r)*(i=ti(e))*Hr(n))/(i*s*a)):(e+r)/2}function WDe(n,e,t,r){var i;if(n==null)i=t*zu,r.point(-es,i),r.point(0,i),r.point(es,i),r.point(es,0),r.point(es,-i),r.point(0,-i),r.point(-es,-i),r.point(-es,0),r.point(-es,i);else if(Gs(n[0]-e[0])>Ti){var s=n[0]<e[0]?es:-es;i=t*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(e[0],e[1])}function XDe(n){var e=ti(n),t=2*Yr,r=e>0,i=Gs(e)>Ti;function s(d,h,f,p){zDe(p,n,t,f,d,h)}function a(d,h){return ti(d)*ti(h)>e}function o(d){var h,f,p,g,A;return{lineStart:function(){g=p=!1,A=1},point:function(x,b){var _=[x,b],M,T=a(x,b),L=r?T?0:u(x,b):T?u(x+(x<0?es:-es),b):0;
vendor: 9,147 bytes, line 4270
4270if(!h&&(g=p=T)&&d.lineStart(),T!==p&&(M=l(h,_),(!M||A6(h,M)||A6(_,M))&&(_[2]=1)),T!==p)A=0,T?(d.lineStart(),M=l(_,h),d.point(M[0],M[1])):(M=l(h,_),d.point(M[0],M[1],2),d.lineEnd()),h=M;else if(i&&h&&r^T){var D;!(L&f)&&(D=l(_,h,!0))&&(A=0,r?(d.lineStart(),d.point(D[0][0],D[0][1]),d.point(D[1][0],D[1][1]),d.lineEnd()):(d.point(D[1][0],D[1][1]),d.lineEnd(),d.lineStart(),d.point(D[0][0],D[0][1],3)))}T&&(!h||!A6(h,_))&&d.point(_[0],_[1]),h=_,p=T,f=L},lineEnd:function(){p&&d.lineEnd(),h=null},clean:function(){return A|(g&&p)<<1}}}function l(d,h,f){var p=sy(d),g=sy(h),A=[1,0,0],x=Hw(p,g),b=EC(x,x),_=x[0],M=b-_*_;if(!M)return!f&&d;var T=e*b/M,L=-e*_/M,D=Hw(A,x),P=CC(A,T),O=CC(x,L);J9(P,O);var F=D,U=EC(P,F),B=EC(F,F),z=U*U-B*(EC(P,P)-1);if(!(z<0)){var H=ng(z),X=CC(F,(-U-H)/B);if(J9(X,P),X=JM(X),!f)return X;var W=d[0],J=h[0],ee=d[1],ae=h[1],le;J<W&&(le=W,W=J,J=le);var Z=J-W,Y=Gs(Z-es)<Ti,re=Y||Z<Ti;if(!Y&&ae<ee&&(le=ee,ee=ae,ae=le),re?Y?ee+ae>0^X[1]<(Gs(X[0]-W)<Ti?ee:ae):ee<=X[1]&&X[1]<=ae:Z>es^(W<=X[0]&&X[0]<=J)){var _e=CC(F,(-U+H)/B);return J9(_e,P),[X,JM(_e)]}}}function u(d,h){var f=r?n:es-n,p=0;return d<-f?p|=1:d>f&&(p|=2),h<-f?p|=4:h>f&&(p|=8),p}return rde(a,o,s,r?[0,-n]:[-es,n-es])}function YDe(n,e,t,r,i,s){var a=n[0],o=n[1],l=e[0],u=e[1],d=0,h=1,f=l-a,p=u-o,g;if(g=t-a,!(!f&&g>0)){if(g/=f,f<0){if(g<d)return;g<h&&(h=g)}else if(f>0){if(g>h)return;g>d&&(d=g)}if(g=i-a,!(!f&&g<0)){if(g/=f,f<0){if(g>h)return;g>d&&(d=g)}else if(f>0){if(g<d)return;g<h&&(h=g)}if(g=r-o,!(!p&&g>0)){if(g/=p,p<0){if(g<d)return;g<h&&(h=g)}else if(p>0){if(g>h)return;g>d&&(d=g)}if(g=s-o,!(!p&&g<0)){if(g/=p,p<0){if(g>h)return;g>d&&(d=g)}else if(p>0){if(g<d)return;g<h&&(h=g)}return d>0&&(n[0]=a+d*f,n[1]=o+d*p),h<1&&(e[0]=a+h*f,e[1]=o+h*p),!0}}}}}var DS=1e9,MC=-DS;function QDe(n,e,t,r){function i(u,d){return n<=u&&u<=t&&e<=d&&d<=r}function s(u,d,h,f){var p=0,g=0;if(u==null||(p=a(u,h))!==(g=a(d,h))||l(u,d)<0^h>0)do f.point(p===0||p===3?n:t,p>1?r:e);while((p=(p+h+4)%4)!==g);else f.point(d[0],d[1])}function a(u,d){return Gs(u[0]-n)<Ti?d>0?0:3:Gs(u[0]-t)<Ti?d>0?2:1:Gs(u[1]-e)<Ti?d>0?1:0:d>0?3:2}function o(u,d){return l(u.x,d.x)}function l(u,d){var h=a(u,1),f=a(d,1);return h!==f?h-f:h===0?d[1]-u[1]:h===1?u[0]-d[0]:h===2?u[1]-d[1]:d[0]-u[0]}return function(u){var d=u,h=ede(),f,p,g,A,x,b,_,M,T,L,D,P={point:O,lineStart:z,lineEnd:H,polygonStart:U,polygonEnd:B};function O(W,J){i(W,J)&&d.point(W,J)}function F(){for(var W=0,J=0,ee=p.length;J<ee;++J)for(var ae=p[J],le=1,Z=ae.length,Y=ae[0],re,_e,Ee=Y[0],Ae=Y[1];le<Z;++le)re=Ee,_e=Ae,Y=ae[le],Ee=Y[0],Ae=Y[1],_e<=r?Ae>r&&(Ee-re)*(r-_e)>(Ae-_e)*(n-re)&&++W:Ae<=r&&(Ee-re)*(r-_e)<(Ae-_e)*(n-re)&&--W;return W}function U(){d=h,f=[],p=[],D=!0}function B(){var W=F(),J=D&&W,ee=(f=E5(f)).length;(J||ee)&&(u.polygonStart(),J&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),ee&&tde(f,o,W,s,u),u.polygonEnd()),d=u,f=p=g=null}function z(){P.point=X,p&&p.push(g=[]),L=!0,T=!1,_=M=NaN}function H(){f&&(X(A,x),b&&T&&h.rejoin(),f.push(h.result())),P.point=O,T&&d.lineEnd()}function X(W,J){var ee=i(W,J);if(p&&g.push([W,J]),L)A=W,x=J,b=ee,L=!1,ee&&(d.lineStart(),d.point(W,J));else if(ee&&T)d.point(W,J);else{var ae=[_=Math.max(MC,Math.min(DS,_)),M=Math.max(MC,Math.min(DS,M))],le=[W=Math.max(MC,Math.min(DS,W)),J=Math.max(MC,Math.min(DS,J))];YDe(ae,le,n,e,t,r)?(T||(d.lineStart(),d.point(ae[0],ae[1])),d.point(le[0],le[1]),ee||d.lineEnd(),D=!1):ee&&(d.lineStart(),d.point(W,J),D=!1)}_=W,M=J,T=ee}return P}}var dF,hF,x6,v6,Ww={sphere:xc,point:xc,lineStart:KDe,lineEnd:xc,polygonStart:xc,polygonEnd:xc};function KDe(){Ww.point=JDe,Ww.lineEnd=ZDe}function ZDe(){Ww.point=Ww.lineEnd=xc}function JDe(n,e){n*=Yr,e*=Yr,hF=n,x6=Hr(e),v6=ti(e),Ww.point=eje}function eje(n,e){n*=Yr,e*=Yr;var t=Hr(e),r=ti(e),i=Gs(n-hF),s=ti(i),a=Hr(i),o=r*a,l=v6*t-x6*r*s,u=x6*t+v6*r*s;dF.add(Hh(ng(o*o+l*l),u)),hF=n,x6=t,v6=r}function tje(n){return dF=new Hm,nR(n,Ww),+dF}var fF=[null,null],nje={type:"LineString",coordinates:fF};function M1(n,e){return fF[0]=n,fF[1]=e,tje(nje)}var XK={Feature:function(n,e){return lk(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++r<i;)if(lk(t[r].geometry,e))return!0;return!1}},YK={Sphere:function(){return!0},Point:function(n,e){return QK(n.coordinates,e)},MultiPoint:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)if(QK(t[r],e))return!0;return!1},LineString:function(n,e){return KK(n.coordinates,e)},MultiLineString:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)if(KK(t[r],e))return!0;return!1},Polygon:function(n,e){return ZK(n.coordinates,e)},MultiPolygon:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)if(ZK(t[r],e))return!0;return!1},GeometryCollection:function(n,e){for(var t=n.geometries,r=-1,i=t.length;++r<i;)if(lk(t[r],e))return!0;return!1}};function lk(n,e){return n&&YK.hasOwnProperty(n.type)?YK[n.type](n,e):!1}function QK(n,e){return M1(n,e)===0}function KK(n,e){for(var t,r,i,s=0,a=n.length;s<a;s++){if(r=M1(n[s],e),r===0||s>0&&(i=M1(n[s],n[s-1]),i>0&&t<=i&&r<=i&&(t+r-i)*(1-Math.pow((t-r)/i,2))<YM*i))return!0;t=r}return!1}function ZK(n,e){return!!nde(n.map(rje),ide(e))}function rje(n){return n=n.map(ide),n.pop(),n}function ide(n){return[n[0]*Yr,n[1]*Yr]}function ije(n,e){return(n&&XK.hasOwnProperty(n.type)?XK[n.type]:lk)(n,e)}function JK(n,e,t){var r=pb(n,e-Ti,t).concat(e);return function(i){return r.map(function(s){return[i,s]})}}function eZ(n,e,t){var r=pb(n,e-Ti,t).concat(e);return function(i){return r.map(function(s){return[s,i]})}}function sje(){var n,e,t,r,i,s,a,o,l=10,u=l,d=90,h=360,f,p,g,A,x=2.5;function b(){return{type:"MultiLineString",coordinates:_()}}function _(){return pb(TC(r/d)*d,t,d).map(g).concat(pb(TC(o/h)*h,a,h).map(A)).concat(pb(TC(e/l)*l,n,l).filter(function(M){return Gs(M%d)>Ti}).map(f)).concat(pb(TC(s/u)*u,i,u).filter(function(M){return Gs(M%h)>Ti}).map(p))}return b.lines=function(){return _().map(function(M){return{type:"LineString",coordinates:M}})},b.outline=function(){return{type:"Polygon",coordinates:[g(r).concat(A(a).slice(1),g(t).reverse().slice(1),A(o).reverse().slice(1))]}},b.extent=function(M){return arguments.length?b.extentMajor(M).extentMinor(M):b.extentMinor()},b.extentMajor=function(M){return arguments.length?(r=+M[0][0],t=+M[1][0],o=+M[0][1],a=+M[1][1],r>t&&(M=r,r=t,t=M),o>a&&(M=o,o=a,a=M),b.precision(x)):[[r,o],[t,a]]},b.extentMinor=function(M){return arguments.length?(e=+M[0][0],n=+M[1][0],s=+M[0][1],i=+M[1][1],e>n&&(M=e,e=n,n=M),s>i&&(M=s,s=i,i=M),b.precision(x)):[[e,s],[n,i]]},b.step=function(M){return arguments.length?b.stepMajor(M).stepMinor(M):b.stepMinor()},b.stepMajor=function(M){return arguments.length?(d=+M[0],h=+M[1],b):[d,h]},b.stepMinor=function(M){return arguments.length?(l=+M[0],u=+M[1],b):[l,u]},b.precision=function(M){return arguments.length?(x=+M,f=JK(s,i,90),p=eZ(e,n,x),g=JK(o,a,90),A=eZ(r,t,x),b):x},b.extentMajor([[-180,-90+Ti],[180,90-Ti]]).extentMinor([[-180,-80-Ti],[180,80+Ti]])}function aje(){return sje()()}function mz(n,e){var t=n[0]*Yr,r=n[1]*Yr,i=e[0]*Yr,s=e[1]*Yr,a=ti(r),o=Hr(r),l=ti(s),u=Hr(s),d=a*ti(t),h=a*Hr(t),f=l*ti(i),p=l*Hr(i),g=2*rg(ng(RK(s-r)+a*l*RK(i-t))),A=Hr(g),x=g?function(b){var _=Hr(b*=g)/A,M=Hr(g-b)/A,T=M*d+_*f,L=M*h+_*p,D=M*o+_*u;return[Hh(L,T)*Qa,Hh(D,ng(T*T+L*L))*Qa]}:function(){return[t*Qa,r*Qa]};return x.distance=g,x}const tZ=n=>n;var Xw=1/0,ck=Xw,k5=-Xw,uk=k5,nZ={point:oje,lineStart:xc,lineEnd:xc,polygonStart:xc,polygonEnd:xc,result:function(){var n=[[Xw,ck],[k5,uk]];return k5=uk=-(ck=Xw=1/0),n}};function oje(n,e){n<Xw&&(Xw=n),n>k5&&(k5=n),e<ck&&(ck=e),e>uk&&(uk=e)}function gz(n){return function(e){var t=new pF;for(var r in n)t[r]=n[r];return t.stream=e,t}}function pF(){}pF.prototype={constructor:pF,point:function(n,e){this.stream.point(n,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Az(n,e,t){var r=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),r!=null&&n.clipExtent(null),nR(t,n.stream(nZ)),e(nZ.result()),r!=null&&n.clipExtent(r),n}function sde(n,e,t){return Az(n,function(r){var i=e[1][0]-e[0][0],s=e[1][1]-e[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+e[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(s-a*(r[1][1]+r[0][1]))/2;n.scale(150*a).translate([o,l])},t)}function lje(n,e,t){return sde(n,[[0,0],e],t)}function cje(n,e,t){return Az(n,function(r){var i=+e,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];n.scale(150*s).translate([a,o])},t)}function uje(n,e,t){return Az(n,function(r){var i=+e,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;n.scale(150*s).translate([a,o])},t)}var rZ=16,dje=ti(30*Yr);function iZ(n,e){return+e?fje(n,e):hje(n)}function hje(n){return gz({point:function(e,t){e=n(e,t),this.stream.point(e[0],e[1])}})}function fje(n,e){function t(r,i,s,a,o,l,u,d,h,f,p,g,A,x){var b=u-r,_=d-i,M=b*b+_*_;if(M>4*e&&A--){var T=a+f,L=o+p,D=l+g,P=ng(T*T+L*L+D*D),O=rg(D/=P),F=Gs(Gs(D)-1)<Ti||Gs(s-h)<Ti?(s+h)/2:Hh(L,T),U=n(F,O),B=U[0],z=U[1],H=B-r,X=z-i,W=_*H-b*X;(W*W/M>e||Gs((b*H+_*X)/M-.5)>
vendor: 4,753 bytes, line 4270
4270.3||a*f+o*p+l*g<dje)&&(t(r,i,s,a,o,l,B,z,F,T/=P,L/=P,D,A,x),x.point(B,z),t(B,z,F,T,L,D,u,d,h,f,p,g,A,x))}}return function(r){var i,s,a,o,l,u,d,h,f,p,g,A,x={point:b,lineStart:_,lineEnd:T,polygonStart:function(){r.polygonStart(),x.lineStart=L},polygonEnd:function(){r.polygonEnd(),x.lineStart=_}};function b(O,F){O=n(O,F),r.point(O[0],O[1])}function _(){h=NaN,x.point=M,r.lineStart()}function M(O,F){var U=sy([O,F]),B=n(O,F);t(h,f,d,p,g,A,h=B[0],f=B[1],d=O,p=U[0],g=U[1],A=U[2],rZ,r),r.point(h,f)}function T(){x.point=b,r.lineEnd()}function L(){_(),x.point=D,x.lineEnd=P}function D(O,F){M(i=O,F),s=h,a=f,o=p,l=g,u=A,x.point=M}function P(){t(h,f,d,p,g,A,s,a,i,o,l,u,rZ,r),x.lineEnd=T,T()}return x}}var pje=gz({point:function(n,e){this.stream.point(n*Yr,e*Yr)}});function mje(n){return gz({point:function(e,t){var r=n(e,t);return this.stream.point(r[0],r[1])}})}function gje(n,e,t,r,i){function s(a,o){return a*=r,o*=i,[e+n*a,t-n*o]}return s.invert=function(a,o){return[(a-e)/n*r,(t-o)/n*i]},s}function sZ(n,e,t,r,i,s){if(!s)return gje(n,e,t,r,i);var a=ti(s),o=Hr(s),l=a*n,u=o*n,d=a/n,h=o/n,f=(o*t-a*e)/n,p=(o*e+a*t)/n;function g(A,x){return A*=r,x*=i,[l*A-u*x+e,t-u*A-l*x]}return g.invert=function(A,x){return[r*(d*A-h*x+f),i*(p-h*A-d*x)]},g}function Aje(n){return xje(function(){return n})()}function xje(n){var e,t=150,r=480,i=250,s=0,a=0,o=0,l=0,u=0,d,h=0,f=1,p=1,g=null,A=WK,x=null,b,_,M,T=tZ,L=.5,D,P,O,F,U;function B(W){return O(W[0]*Yr,W[1]*Yr)}function z(W){return W=O.invert(W[0],W[1]),W&&[W[0]*Qa,W[1]*Qa]}B.stream=function(W){return F&&U===W?F:F=pje(mje(d)(A(D(T(U=W)))))},B.preclip=function(W){return arguments.length?(A=W,g=void 0,X()):A},B.postclip=function(W){return arguments.length?(T=W,x=b=_=M=null,X()):T},B.clipAngle=function(W){return arguments.length?(A=+W?XDe(g=W*Yr):(g=null,WK),X()):g*Qa},B.clipExtent=function(W){return arguments.length?(T=W==null?(x=b=_=M=null,tZ):QDe(x=+W[0][0],b=+W[0][1],_=+W[1][0],M=+W[1][1]),X()):x==null?null:[[x,b],[_,M]]},B.scale=function(W){return arguments.length?(t=+W,H()):t},B.translate=function(W){return arguments.length?(r=+W[0],i=+W[1],H()):[r,i]},B.center=function(W){return arguments.length?(s=W[0]%360*Yr,a=W[1]%360*Yr,H()):[s*Qa,a*Qa]},B.rotate=function(W){return arguments.length?(o=W[0]%360*Yr,l=W[1]%360*Yr,u=W.length>2?W[2]%360*Yr:0,H()):[o*Qa,l*Qa,u*Qa]},B.angle=function(W){return arguments.length?(h=W%360*Yr,H()):h*Qa},B.reflectX=function(W){return arguments.length?(f=W?-1:1,H()):f<0},B.reflectY=function(W){return arguments.length?(p=W?-1:1,H()):p<0},B.precision=function(W){return arguments.length?(D=iZ(P,L=W*W),X()):ng(L)},B.fitExtent=function(W,J){return sde(B,W,J)},B.fitSize=function(W,J){return lje(B,W,J)},B.fitWidth=function(W,J){return cje(B,W,J)},B.fitHeight=function(W,J){return uje(B,W,J)};function H(){var W=sZ(t,0,0,f,p,h).apply(null,e(s,a)),J=sZ(t,r-W[0],i-W[1],f,p,h);return d=Jue(o,l,u),P=cF(e,J),O=cF(d,P),D=iZ(P,L),X()}function X(){return F=U=null,B}return function(){return e=n.apply(this,arguments),B.invert=e.invert&&z,H()}}function vje(n){return function(e,t){var r=ng(e*e+t*t),i=n(r),s=Hr(i),a=ti(i);return[Hh(e*s,r*a),rg(r&&t*s/r)]}}function xz(n,e){return[n,EDe(NDe((zu+e)/2))]}xz.invert=function(n,e){return[n,2*fz(TDe(e))-zu]};function ade(n,e){var t=ti(e),r=1+ti(n)*t;return[t*Hr(n)/r,Hr(e)/r]}ade.invert=vje(function(n){return 2*fz(n)});function yje(){return Aje(ade).scale(250).clipAngle(142)}function mF(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function bje(n){if(Array.isArray(n))return n}function wje(n){if(Array.isArray(n))return mF(n)}function g4(n,e,t){if(typeof n=="function"?n===e:n.has(e))return arguments.length<3?e:t;throw new TypeError("Private element is not present on this object")}function _je(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Sje(n,e,t){return e=dk(e),Oje(n,lde()?Reflect.construct(e,[],dk(n).constructor):e.apply(n,t))}function ode(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tje(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function vi(n,e){return n.get(g4(n,e))}function nA(n,e,t){ode(n,e),e.set(n,t)}function rA(n,e,t){return n.set(g4(n,e),t),t}function Eje(n,e){ode(n,e),e.add(n)}function Cje(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,ude(r.key),r)}}function Nje(n,e,t){return e&&Cje(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function y2(n,e,t){return(e=ude(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}
4270function dk(n){return dk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dk(n)}function Mje(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&gF(n,e)}function lde(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lde=function(){return!!n})()}function kje(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Rje(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Pje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4271In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lje(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4272In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oje(n,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _je(n)}function gF(n,e){return gF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},gF(n,e)}function y6(n,e){return bje(n)||Rje(n,e)||dde(n,e)||Pje()}function cde(n){return wje(n)||kje(n)||dde(n)||Lje()}function Dje(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function ude(n){var e=Dje(n,"string");return typeof e=="symbol"?e:e+""}function dde(n,e){if(n){if(typeof n=="string")return mF(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?mF(n,e):void 0}}var hde=function(e){e instanceof Array?e.forEach(hde):(e.map&&e.map.dispose(),e.dispose())},AF=function(e){e.geometry&&e.geometry.dispose(),e.material&&hde(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(AF)};function fde(n,e,t){var r=(90-n)*Math.PI/180,i=(90-e)*Math.PI/180;return{x:t*Math.sin(r)*Math.cos(i),y:t*Math.cos(r),z:t*Math.sin(r)*Math.sin(i)}}function jje(n){var e=n.x,t=n.y,r=n.z,i=Math.sqrt(e*e+t*t+r*r),s=Math.acos(t/i),a=Math.atan2(r,e);return{lat:90-s*180/Math.PI,lng:90-a*180/Math.PI-(a<-Math.PI/2?360:0),r:i}}function Mx(n){return n*Math.PI/180}var pde=function(e){return 1-(xz(0,(.5-e)*Math.PI)[1]/Math.PI+1)/2},tL=function(e){return Math.max(0,Math.min(1,pde(e)))},aZ=function(e){return .5-xz.invert(0,(2*(1-e)-1)*Math.PI)[1]/Math.PI},Ije=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=tg().domain([1,0]).range([t,r]).clamp(!0),s=tg().domain([tL(t),tL(r)]).range([1,0]).clamp(!0),a=function(h){return s(tL(i(h)))},o=e.array,l=0,u=o.length;l<u;l+=2)o[l+1]=a(o[l+1]);e.needsUpdate=!0},oZ=function(e,t,r,i){var s=Math.pow(2,e),a=Math.max(0,Math.min(s-1,Math.floor((r+180)*s/360))),o=(90-i)/180;t&&(o=Math.max(0,Math.min(1,pde(o))));var l=Math.floor(o*s);return[a,l]},xF=function(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,o=[],l=Math.pow(2,e),u=360/l,d=180/l,h=s===void 0?l-1:s,f=a===void 0?l-1:a,p=r,g=Math.min(l-1,h);p<=g;p++)for(var A=i,x=Math.min(l-1,f);A<=x;A++){var b=A,_=d;if(t){b=A===0?A:aZ(A/l)*l;var M=A+1===l?A+1:aZ((A+1)/l)*l;_=(M-b)*180/l}var T=-180+(p+.5)*u,L=90-(b*180/l+_/2),D=_;o.push({x:p,y:A,lng:T,lat:L,latLen:D})}return o},Fje=6,Uje=7,Bje=3,Vje=90,Yp=new WeakMap,CA=new WeakMap,nL=new WeakMap,kC=new WeakMap,Nh=new WeakMap,hk=new WeakMap,Db=new WeakMap,kx=new WeakMap,RC=new WeakSet,zje=(function(n){function e(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.tileUrl,a=i.minLevel,o=a===void 0?0:a,l=i.maxLevel,u=l===void 0?17:l,d=i.mercatorProjection,h=d===void 0?!0:d;return Tje(this,e),r=Sje(this,e),Eje(r,RC),nA(r,Yp,void 0),nA(r,CA,void 0),nA(r,nL,void 0),nA(r,kC,void 0),nA(r,Nh,{}),nA(r,hk,void 0),nA(r,Db,void 0),nA(r,kx,void 0),y2(r,"minLevel",void 0),y2(r,"maxLevel",void 0),y2(r,"thresholds",cde(ne
4272w Array(30)).map(function(f,p){return 8/Math.pow(2,p)})),y2(r,"curvatureResolution",5),y2(r,"tileMargin",0),y2(r,"clearTiles",function(){Object.values(vi(Nh,r)).forEach(function(f){f.forEach(function(p){p.obj&&(r.remove(p.obj),AF(p.obj),delete p.obj)})}),rA(Nh,r,{})}),rA(Yp,r,t),r.tileUrl=s,rA(CA,r,h),r.minLevel=o,r.maxLevel=u,r.level=0,r.add(rA(kx,r,new ns(new F0(vi(Yp,r)*.99,180,90),new Lh({color:0})))),vi(kx,r).visible=!1,vi(kx,r).material.polygonOffset=!0,vi(kx,r).material.polygonOffsetUnits=3,vi(kx,r).material.polygonOffsetFactor=1,r}return Mje(e,n),Nje(e,[{key:"tileUrl",get:function(){return vi(nL,this)},set:function(r){rA(nL,this,r),this.updatePov(vi(Db,this))}},{key:"level",get:function(){return vi(kC,this)},set:function(r){var i,s=this;vi(Nh,this)[r]||g4(RC,this,Gje).call(this,r);var a=vi(kC,this);if(rA(kC,this,r),!(r===a||a===void 0)){if(vi(kx,this).visible=r>0,vi(Nh,this)[r].forEach(function(l){return l.obj&&(l.obj.material.depthWrite=!0)}),a<r&&((i=vi(Nh,this)[a])===null||i===void 0||i.forEach(function(l){return l.obj&&(l.obj.material.depthWrite=!1)})),a>r)for(var o=r+1;o<=a;o++)vi(Nh,this)[o]&&vi(Nh,this)[o].forEach(function(l){l.obj&&(s.remove(l.obj),AF(l.obj),delete l.obj)});g4(RC,this,lZ).call(this)}}},{key:"updatePov",value:function(r){var i=this;if(!(!r||!(r instanceof Z8))){rA(Db,this,r);var s;if(rA(hk,this,function(d){if(!d.hullPnts){var h=360/Math.pow(2,i.level),f=d.lng,p=d.lat,g=d.latLen,A=f-h/2,x=f+h/2,b=p-g/2,_=p+g/2;d.hullPnts=[[p,f],[b,A],[_,A],[b,x],[_,x]].map(function(M){var T=y6(M,2),L=T[0],D=T[1];return fde(L,D,vi(Yp,i))}).map(function(M){var T=M.x,L=M.y,D=M.z;return new Ve(T,L,D)})}return s||(s=new ny,r.updateMatrix(),r.updateMatrixWorld(),s.setFromProjectionMatrix(new kr().multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse))),d.hullPnts.some(function(M){return s.containsPoint(M.clone().applyMatrix4(i.matrixWorld))})}),this.tileUrl){var a=r.position.clone(),o=a.distanceTo(this.getWorldPosition(new Ve)),l=(o-vi(Yp,this))/vi(Yp,this),u=this.thresholds.findIndex(function(d){return d&&d<=l});this.level=Math.min(this.maxLevel,Math.max(this.minLevel,u<0?this.thresholds.length:u)),g4(RC,this,lZ).call(this)}}}}])})(Bu);function Gje(n){var e=this;if(n>Uje){vi(Nh,this)[n]=[];return}var t=vi(Nh,this)[n]=xF(n,vi(CA,this));t.forEach(function(r){return r.centroid=fde(r.lat,r.lng,vi(Yp,e))}),t.octree=Nue().x(function(r){return r.centroid.x}).y(function(r){return r.centroid.y}).z(function(r){return r.centroid.z}).addAll(t)}function lZ(){var n=this;if(!(!this.tileUrl||this.level===void 0||!vi(Nh,this).hasOwnProperty(this.level))&&!(!vi(hk,this)&&this.level>Fje)){var e=vi(Nh,this)[this.level];if(vi(Db,this)){var t=this.worldToLocal(vi(Db,this).position.clone());if(e.octree){var r,i=this.worldToLocal(vi(Db,this).position.clone()),s=(i.length()-vi(Yp,this))*Bje;e=(r=e.octree).findAllWithinRadius.apply(r,cde(i).concat([s]))}else{var a=jje(t),o=(a.r/vi(Yp,this)-1)*Vje,l=o/Math.cos(Mx(a.lat)),u=[a.lng-l,a.lng+l],d=[a.lat+o,a.lat-o],h=oZ(this.level,vi(CA,this),u[0],d[0]),f=y6(h,2),p=f[0],g=f[1],A=oZ(this.level,vi(CA,this),u[1],d[1]),x=y6(A,2),b=x[0],_=x[1];!e.record&&(e.record={});var M=e.record;if(!M.hasOwnProperty("".concat(Math.round((p+b)/2),"_").concat(Math.round((g+_)/2))))e=xF(this.level,vi(CA,this),p,g,b,_).map(function(O){var F="".concat(O.x,"_").concat(O.y);return M.hasOwnProperty(F)?M[F]:(M[F]=O,e.push(O),O)});else{for(var T=[],L=p;L<=b;L++)for(var D=g;D<=_;D++){var P="".concat(L,"_").concat(D);M.hasOwnProperty(P)||(M[P]=xF(this.level,vi(CA,this),L,D,L,D)[0],e.push(M[P])),T.push(M[P])}e=T}}}e.filter(function(O){return!O.obj}).filter(vi(hk,this)||function(){return!0}).forEach(function(O){var F=O.x,U=O.y,B=O.lng,z=O.lat,H=O.latLen,X=360/Math.pow(2,n.level);if(!O.obj){var W=X*(1-n.tileMargin),J=H*(1-n.tileMargin),ee=Mx(B),ae=Mx(-z),le=new ns(new F0(vi(Yp,n),Math.ceil(W/n.curvatureResolution),Math.ceil(J/n.curvatureResolution),Mx(90-W/2)+ee,Mx(W),Mx(90-J/2)+ae,Mx(J)),new hg);if(vi(CA,n)){var Z=[z+H/2,z-H/2].map(function(Ee){return .5-Ee/180}),Y=y6(Z,2),re=Y[0],_e=Y[1];Ije(le.geometry.attributes.uv,re,_e)}O.obj=le}O.loading||(O.loading=!0,new iz().load(n.tileUrl(F,U,n.level),function(Ee){var Ae=O.obj;
4272Ae&&(Ee.colorSpace=Pl,Ae.material.map=Ee,Ae.material.color=null,Ae.material.needsUpdate=!0,n.add(Ae)),O.loading=!1}))})}}const R5=new Set;let vF=!1;function qje(n,e,t=2){const r=e&&e.length,i=r?e[0]*t:n.length;R5.size&&R5.clear();let s=mde(n,0,i,t,!0);const a=[];if(!s||s.next===s.prev)return a;let o=0,l=0,u=0;if(r&&(s=Yje(n,e,s,t)),n.length>80*t){o=n[0],l=n[1];let d=o,h=l;for(let f=t;f<i;f+=t){const p=n[f],g=n[f+1];p<o&&(o=p),g<l&&(l=g),p>d&&(d=p),g>h&&(h=g)}u=Math.max(d-o,h-l),u=u!==0?32767/u:0}return yF(s,a,o,l,u),a}function mde(n,e,t,r,i){let s=null;if(i===lIe(n,e,t,r)>0)for(let a=e;a<t;a+=r)s=dZ(a/r|0,n[a],n[a+1],s);else for(let a=t-r;a>=e;a-=r)s=dZ(a/r|0,n[a],n[a+1],s);return s&&P5(s,s.next)&&(O5(s),s=s.next),s}function ay(n,e=n){const t=e===n;let r=n,i;do i=!1,r!==r.next&&(R5.size===0||!R5.has(r))&&(P5(r,r.next)||Mo(r.prev,r,r.next)===0)?((t||r===e)&&(e=r.prev),vF=!0,O5(r),r=r.prev,i=!0):(t||r!==e)&&(r=r.next,i=!t);while(i||r!==e);return e}function yF(n,e,t,r,i){i&&nIe(n,t,r,i);let s=n,a=!1;for(;n.prev!==n.next;){const o=n.prev,l=n.next;if(Mo(o,n,l)<0&&(i?Hje(n,t,r,i):$je(n))){e.push(o.i,n.i,l.i),O5(n),n=l,s=l;continue}if(n=l,n===s){if(vF=!1,n=ay(n),vF){s=n;continue}if(!a){n=Wje(n,e),s=n,a=!0;continue}Xje(n,e,t,r,i);break}}}function $je(n){const e=n.prev,t=n,r=n.next,i=e.x,s=t.x,a=r.x,o=e.y,l=t.y,u=r.y,d=Math.min(i,s,a),h=Math.min(o,l,u),f=Math.max(i,s,a),p=Math.max(o,l,u);let g=r.next;for(;g!==e;){if(g.x>=d&&g.x<=f&&g.y>=h&&g.y<=p&&!(i===g.x&&o===g.y)&&pk(i,o,s,l,a,u,g.x,g.y)&&Mo(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function Hje(n,e,t,r){const i=n.prev,s=n,a=n.next,o=i.x,l=s.x,u=a.x,d=i.y,h=s.y,f=a.y,p=Math.min(o,l,u),g=Math.min(d,h,f),A=Math.max(o,l,u),x=Math.max(d,h,f),b=SF(p,g,e,t,r),_=SF(A,x,e,t,r);let M=n.prevZ;for(;M&&M.z>=b;){if(M.x>=p&&M.x<=A&&M.y>=g&&M.y<=x&&M!==a&&!(o===M.x&&d===M.y)&&pk(o,d,l,h,u,f,M.x,M.y)&&Mo(M.prev,M,M.next)>=0)return!1;M=M.prevZ}let T=n.nextZ;for(;T&&T.z<=_;){if(T.x>=p&&T.x<=A&&T.y>=g&&T.y<=x&&T!==a&&!(o===T.x&&d===T.y)&&pk(o,d,l,h,u,f,T.x,T.y)&&Mo(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function Wje(n,e){let t=n,r=!1;do{const i=t.prev,s=t.next.next;xde(i,t,t.next,s,!1)&&L5(i,s)&&L5(s,i)&&(e.push(i.i,t.i,s.i),O5(t),O5(t.next),t=n=s,r=!0),t=t.next}while(t!==n);return r?ay(t):t}function Xje(n,e,t,r,i){let s=n;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&sIe(s,a)){let o=vde(s,a);s=ay(s,s.next),o=ay(o,o.next),yF(s,e,t,r,i),yF(o,e,t,r,i);return}a=a.next}s=s.next}while(s!==n)}let bF=!1;function Yje(n,e,t,r){const i=[];for(let s=0,a=e.length;s<a;s++){const o=e[s]*r,l=s<a-1?e[s+1]*r:n.length,u=mde(n,o,l,r,!1);u===u.next&&R5.add(u),i.push(iIe(u))}i.sort(Qje),Zje(n.length/r,e.length),Ade(t,t),bF=!0;for(let s=0;s<i.length;s++)t=Kje(i[s],t);return bF=!1,ay(t)}function Qje(n,e){return n.x-e.x||n.y-e.y||(n.next.y-n.y)/(n.next.x-n.x)-(e.next.y-e.y)/(e.next.x-e.x)}function Kje(n,e){const t=eIe(n,e);if(!t)return e;const r=vde(t,n),i=r.next;
vendor: 4,205 bytes, line 4272
4272return Ade(t,i.next),ay(r,r.next),ay(t,t.next)}const gde=16;let Ka=new Float64Array(0),fk=0;const wF=[],_F=[];function Zje(n,e){const t=Math.ceil((n+2*e)/gde)+e+2;Ka.length<t*4&&(Ka=new Float64Array(t*4)),fk=0}function Ade(n,e){let t=n;do{const r=fk++;wF[r]=t;let i=1/0,s=1/0,a=-1/0,o=-1/0,l=0;do{const d=t.next;t.z=r,t.x<i&&(i=t.x),t.x>a&&(a=t.x),t.y<s&&(s=t.y),t.y>o&&(o=t.y),d.x<i&&(i=d.x),d.x>a&&(a=d.x),d.y<s&&(s=d.y),d.y>o&&(o=d.y),t=d}while(++l<gde&&t!==e);_F[r]=t;const u=r*4;Ka[u]=i,Ka[u+1]=s,Ka[u+2]=a,Ka[u+3]=o}while(t!==e)}function Jje(n,e){const t=n.z*4;e.x<Ka[t]&&(Ka[t]=e.x),e.y<Ka[t+1]&&(Ka[t+1]=e.y),e.x>Ka[t+2]&&(Ka[t+2]=e.x),e.y>Ka[t+3]&&(Ka[t+3]=e.y)}function cZ(n){let e=_F[n];for(;e.prev.next!==e;)e=e.next;return _F[n]=e,e}function uZ(n){let e=wF[n];for(;e.prev.next!==e;)e=e.next;return wF[n]=e,e}function eIe(n,e){let t=e;const r=n.x,i=n.y;let s=-1/0,a;if(P5(n,t))return t;for(let f=0,p=0;f<fk;f++,p+=4){if(i<Ka[p+1]||i>Ka[p+3]||Ka[p]>r||Ka[p+2]<=s)continue;const g=cZ(f);t=uZ(f);do{if(t.prev.next===t){if(P5(n,t.next))return t.next;if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const A=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(A<=r&&A>s&&(s=A,a=t.x<t.next.x?t:t.next,A===r))return a}}t=t.next}while(t!==g)}if(!a)return null;const o=a.x,l=a.y,u=Math.min(i,l),d=Math.max(i,l);let h=1/0;for(let f=0,p=0;f<fk;f++,p+=4){if(Ka[p+2]<o||Ka[p]>r||Ka[p+3]<u||Ka[p+1]>d)continue;const g=cZ(f);t=uZ(f);do{if(t.prev.next===t&&r>=t.x&&t.x>=o&&r!==t.x&&pk(i<l?r:s,i,o,l,i<l?s:r,i,t.x,t.y)){const A=Math.abs(i-t.y)/(r-t.x);(L5(t,n)||t.y===i&&t.next.y===i&&t.next.x>r)&&(A<h||A===h&&(t.x>a.x||t.x===a.x&&tIe(a,t)))&&(a=t,h=A)}t=t.next}while(t!==g)}return a}function tIe(n,e){return Mo(n.prev,n,e.prev)<0&&Mo(e.next,n,n.next)<0}const Th=[];let M3=[],Rx=new Uint32Array(0),k3=new Uint32Array(0);const R3=new Uint32Array(256);function nIe(n,e,t,r){let i=n,s=0;do i.z=SF(i.x,i.y,e,t,r),Th[s++]=i,i=i.next;while(i!==n);rIe(s);let a=null;for(let o=0;o<s;o++){const l=Th[o];l.prevZ=a,a&&(a.nextZ=l),a=l}a.nextZ=null}function rIe(n){if(n<=32){for(let e=1;e<n;e++){const t=Th[e],r=t.z;let i=e-1;for(;i>=0&&Th[i].z>r;)Th[i+1]=Th[i],i--;Th[i+1]=t}return}Rx.length<n&&(Rx=new Uint32Array(n),k3=new Uint32Array(n),M3=new Array(n));for(let e=0;e<n;e++)Rx[e]=Th[e].z;PC(n,Th,Rx,M3,k3,0),PC(n,M3,k3,Th,Rx,8),PC(n,Th,Rx,M3,k3,16),PC(n,M3,k3,Th,Rx,24)}function PC(n,e,t,r,i,s){R3.fill(0);for(let o=0;o<n;o++)R3[t[o]>>>s&255]++;let a=0;for(let o=0;o<256;o++){const l=R3[o];R3[o]=a,a+=l}for(let o=0;o<n;o++){const l=t[o],u=R3[l>>>s&255]++;r[u]=e[o],i[u]=l}}function SF(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function iIe(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function pk(n,e,t,r,i,s,a,o){return(i-a)*(e-o)>=(n-a)*(s-o)&&(n-a)*(r-o)>=(t-a)*(e-o)&&(t-a)*(s-o)>=(i-a)*(r-o)}function sIe(n,e){const t=P5(n,e)&&Mo(n.prev,n,n.next)>0&&Mo(e.prev,e,e.next)>0;return n.next.i!==e.i&&(t||L5(n,e)&&L5(e,n)&&(Mo(n.prev,n,e.prev)!==0||Mo(n,e.prev,e)!==0))&&!aIe(n,e)&&(t||oIe(n,e))}function Mo(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function P5(n,e){return n.x===e.x&&n.y===e.y}function xde(n,e,t,r,i=!0){const s=Mo(n,e,t),a=Mo(n,e,r),o=Mo(t,r,n),l=Mo(t,r,e);return(s>0&&a<0||s<0&&a>0)&&(o>0&&l<0||o<0&&l>0)?!0:i?!!(s===0&&LC(n,t,e)||a===0&&LC(n,r,e)||o===0&&LC(t,n,r)||l===0&&LC(t,e,r)):!1}function LC(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function aIe(n,e){const t=Math.min(n.x,e.x),r=Math.max(n.x,e.x),i=Math.min(n.y,e.y),s=Math.max(n.y,e.y);let a=n;do{const o=a.next;if(a.x>r&&o.x>r||a.x<t&&o.x<t||a.y>s&&o.y>s||a.y<i&&o.y<i){a=o;continue}if(a.i!==n.i&&o.i!==n.i&&a.i!==e.i&&o.i!==e.i&&xde(a,o,n,e))return!0;a=o}while(a!==n);return!1}function L5(n,e){return Mo(n.prev,n,n.next)<0?Mo(n,e,n.next)>=0&&Mo(n,n.prev,e)>=0:Mo(n,e,n.prev)<0||Mo(n,n.next,e)<0}function oIe(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do{const a=t.next;t.y>s!=a.y>s&&i<(a.x-t.x)*(s-t.y)/(a.y-t.y)+t.x&&(r=!r),t=a}while(t!==n);return r}
4272function vde(n,e){const t=TF(n.i,n.x,n.y),r=TF(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function dZ(n,e,t,r){const i=TF(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O5(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ),bF&&Jje(n.prev,n.next)}function TF(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function lIe(n,e,t,r){let i=0;for(let s=e,a=t-r;s<t;s+=r)i+=(n[a]-n[s])*(n[s+1]+n[a+1]),a=s;return i}function mk(n){const e=[],t=[],r=n[0][0].length;let i=0,s=0;for(const a of n){for(const o of a)for(let l=0;l<r;l++)e.push(o[l]);s&&(i+=s,t.push(i)),s=a.length}return{vertices:e,holes:t,dimensions:r}}function EF(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function cIe(n){if(Array.isArray(n))return n}function uIe(n){if(Array.isArray(n))return EF(n)}function dIe(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function hIe(n,e,t){return e=gk(e),bIe(n,yde()?Reflect.construct(e,[],gk(n).constructor):e.apply(n,t))}function fIe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function pIe(n,e,t){return Object.defineProperty(n,"prototype",{writable:!1}),n}function mIe(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=vz(n))||e){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 4273In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw s}}}}function gk(n){return gk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gk(n)}function gIe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&CF(n,e)}function yde(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yde=function(){return!!n})()}function AIe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function xIe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function vIe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4274In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yIe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4275In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bIe(n,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dIe(n)}function CF(n,e){return CF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},CF(n,e)}function P3(n,e){return cIe(n)||xIe(n,e)||vz(n,e)||vIe()}function wIe(n){return uIe(n)||AIe(n)||vz(n)||yIe()}function vz(n,e){if(n){if(typeof n=="string")return EF(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?EF(n,e):void 0}}var hZ=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=[],i=null;return e.forEach(function(s){if(i){var a=M1(s,i)*180/Math.PI;if(a>t)for(var o=mz(i,s),l=i.length>2||s.length>2?M5(i[2]||0,s[2]||0):null,u=l?function(f){return[].concat(wIe(o(f)),[l(f)])}:o,d=1/Math.ceil(a/t),h=d;h<1;)r.push(u(h)),h+=d}r.push(i=s)}),r},NF=typeof window<"u"&&window.THREE?window.THREE:{BufferGeometry:ds,Float32BufferAttribute:Bi},_Ie=new NF.BufferGeometry().setAttribute?"setAttribute":"addAttribute",bde=(function(n){function e(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:5;fIe(this,e),r=hIe(this,e),r.type="GeoJsonGeometry",r.parameters={geoJson:t,radius:i,resolution:s};var a=({Point:d,MultiPoint:h,LineString:f,MultiLineString:p,Polygon:g,MultiPolygon:A}[t.type]||function(){return[]})(t.coordinates,i),o=[],l=[],u=0;a.forEach(function(x){var b=o.length;L3({indices:o,vertices:l},x),r.addGroup(b,o.length-b,u++)}),o.length&&r.setIndex(o),l.length&&r[_Ie]("position",new NF.Float32BufferAttribute(l,3));function d(x,b){var _=rL(x[1],x[0],b+(x[2]||0)),M=[];return[{vertices:_,indices:M}]}function h(x,b){var _={vertices:[],indices:[]};return x.map(function(M){return d(M,b)}
4275).forEach(function(M){var T=P3(M,1),L=T[0];L3(_,L)}),[_]}function f(x,b){for(var _=hZ(x,s).map(function(O){var F=P3(O,3),U=F[0],B=F[1],z=F[2],H=z===void 0?0:z;return rL(B,U,b+H)}),M=mk([_]),T=M.vertices,L=Math.round(T.length/3),D=[],P=1;P<L;P++)D.push(P-1,P);return[{vertices:T,indices:D}]}function p(x,b){var _={vertices:[],indices:[]};return x.map(function(M){return f(M,b)}).forEach(function(M){var T=P3(M,1),L=T[0];L3(_,L)}),[_]}function g(x,b){for(var _=x.map(function(W){return hZ(W,s).map(function(J){var ee=P3(J,3),ae=ee[0],le=ee[1],Z=ee[2],Y=Z===void 0?0:Z;return rL(le,ae,b+Y)})}),M=mk(_),T=M.vertices,L=M.holes,D=L[0]||1/0,P=T.slice(0,D*3),O=T.slice(D*3),F=new Set(L),U=Math.round(T.length/3),B=[],z=[],H=1;H<U;H++)F.has(H)||(H<D?B.push(H-1,H):z.push(H-1-D,H-D));var X=[{indices:B,vertices:P}];return L.length&&X.push({indices:z,vertices:O}),X}function A(x,b){var _={vertices:[],indices:[]},M={vertices:[],indices:[]};x.map(function(L){return g(L,b)}).forEach(function(L){var D=P3(L,2),P=D[0],O=D[1];L3(_,P),O&&L3(M,O)});var T=[_];return M.vertices.length&&T.push(M),T}return r}return gIe(e,n),pIe(e)})(NF.BufferGeometry);function L3(n,e){var t=Math.round(n.vertices.length/3);fZ(n.vertices,e.vertices),fZ(n.indices,e.indices.map(function(r){return r+t}))}function fZ(n,e){var t=mIe(e),r;try{for(t.s();!(r=t.n()).done;){var i=r.value;n.push(i)}}catch(s){t.e(s)}finally{t.f()}}function rL(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=(90-n)*Math.PI/180,i=(90-e)*Math.PI/180;return[t*Math.sin(r)*Math.cos(i),t*Math.cos(r),t*Math.sin(r)*Math.sin(i)]}function SIe(n,e,t=!0){if(!e||!e.isReady)throw new Error("THREE.BufferGeometryUtils: Initialized MikkTSpace library required.");if(!n.hasAttribute("position")||!n.hasAttribute("normal")||!n.hasAttribute("uv"))throw new Error('THREE.BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function r(a){if(a.normalized||a.isInterleavedBufferAttribute){const o=new Float32Array(a.count*a.itemSize);for(let l=0,u=0;l<a.count;l++)o[u++]=a.getX(l),o[u++]=a.getY(l),a.itemSize>2&&(o[u++]=a.getZ(l));return o}return a.array instanceof Float32Array?a.array:new Float32Array(a.array)}const i=n.index?n.toNonIndexed():n,s=e.generateTangents(r(i.attributes.position),r(i.attributes.normal),r(i.attributes.uv));if(t)for(let a=3;a<s.length;a+=4)s[a]*=-1;return i.setAttribute("tangent",new Ea(s,4)),n!==i&&n.copy(i),n}function TIe(n,e=!1){const t=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),s={},a={},o=n[0].morphTargetsRelative,l=new ds;let u=0;for(let d=0;d<n.length;++d){const h=n[d];let f=0;if(t!==(h.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const p in h.attributes){if(!r.has(p))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+'. All geometries must have compatible attributes; make sure "'+p+'" attribute exists among all geometries, or in none of them.'),null;s[p]===void 0&&(s[p]=[]),s[p].push(h.attributes[p]),f++}if(f!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". Make sure all geometries have the same number of attributes."),null;if(o!==h.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const p in h.morphAttributes){if(!i.has(p))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". .morphAttributes must be consistent throughout all geometries."),null;
4275a[p]===void 0&&(a[p]=[]),a[p].push(h.morphAttributes[p])}if(e){let p;if(t)p=h.index.count;else if(h.attributes.position!==void 0)p=h.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". The geometry must have either an index or a position attribute"),null;l.addGroup(u,p,d),u+=p}}if(t){let d=0;const h=[];for(let f=0;f<n.length;++f){const p=n[f].index;for(let g=0;g<p.count;++g)h.push(p.getX(g)+d);d+=n[f].attributes.position.count}l.setIndex(h)}for(const d in s){const h=MF(s[d]);if(!h)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+d+" attribute."),null;l.setAttribute(d,h)}for(const d in a){const h=a[d][0].length;if(h!==0){l.morphAttributes=l.morphAttributes||{},l.morphAttributes[d]=[];for(let f=0;f<h;++f){const p=[];for(let A=0;A<a[d].length;++A)p.push(a[d][A][f]);const g=MF(p);if(!g)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+d+" morphAttribute."),null;l.morphAttributes[d].push(g)}}}return l}function MF(n){let e,t,r,i=-1,s=0;for(let u=0;u<n.length;++u){const d=n[u];if(e===void 0&&(e=d.array.constructor),e!==d.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=d.itemSize),t!==d.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(r===void 0&&(r=d.normalized),r!==d.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=d.gpuType),i!==d.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=d.count*t}const a=new e(s),o=new Ea(a,t,r);let l=0;for(let u=0;u<n.length;++u){const d=n[u];if(d.isInterleavedBufferAttribute){const h=l/t;for(let f=0,p=d.count;f<p;f++)for(let g=0;g<t;g++){const A=d.getComponent(f,g);o.setComponent(f+h,g,A)}}else a.set(d.array,l);l+=d.count*t}return i!==void 0&&(o.gpuType=i),o}function EIe(n){return n.isInstancedInterleavedBufferAttribute||n.isInterleavedBufferAttribute?Ak(n):n.isInstancedBufferAttribute?new h1().copy(n):new Ea().copy(n)}function CIe(n){let e,t=0,r=0;for(let u=0,d=n.length;u<d;++u){const h=n[u];
4275if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;t+=h.array.length,r+=h.itemSize}const i=new XV(new e(t),r);let s=0;const a=[],o=["getX","getY","getZ","getW"],l=["setX","setY","setZ","setW"];for(let u=0,d=n.length;u<d;u++){const h=n[u],f=h.itemSize,p=h.count,g=new l0(i,f,s,h.normalized);a.push(g),s+=f;for(let A=0;A<p;A++)for(let x=0;x<f;x++)g[l[x]](A,h[o[x]](A))}return a}function Ak(n){const e=n.data.array.constructor,t=n.count,r=n.itemSize,i=n.normalized,s=new e(t*r);let a;n.isInstancedInterleavedBufferAttribute?a=new h1(s,r,i,n.meshPerAttribute):a=new Ea(s,r,i);for(let o=0;o<t;o++)a.setX(o,n.getX(o)),r>=2&&a.setY(o,n.getY(o)),r>=3&&a.setZ(o,n.getZ(o)),r>=4&&a.setW(o,n.getW(o));return a}function NIe(n){const e=n.attributes,t=n.morphTargets,r=new Map;for(const i in e){const s=e[i];s.isInterleavedBufferAttribute&&(r.has(s)||r.set(s,Ak(s)),e[i]=r.get(s))}for(const i in t){const s=t[i];s.isInterleavedBufferAttribute&&(r.has(s)||r.set(s,Ak(s)),t[i]=r.get(s))}}function MIe(n){let e=0;for(const r in n.attributes){const i=n.getAttribute(r);e+=i.count*i.itemSize*i.array.BYTES_PER_ELEMENT}const t=n.getIndex();return e+=t?t.count*t.itemSize*t.array.BYTES_PER_ELEMENT:0,e}function kIe(n,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},r=n.getIndex(),i=n.getAttribute("position"),s=r?r.count:i.count;let a=0;const o=Object.keys(n.attributes),l={},u={},d=[],h=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"];for(let _=0,M=o.length;_<M;_++){const T=o[_],L=n.attributes[T];l[T]=new L.constructor(new L.array.constructor(L.count*L.itemSize),L.itemSize,L.normalized);const D=n.morphAttributes[T];D&&(u[T]||(u[T]=[]),D.forEach((P,O)=>{const F=new P.array.constructor(P.count*P.itemSize);u[T][O]=new P.constructor(F,P.itemSize,P.normalized)}))}const p=e*.5,g=Math.log10(1/e),A=Math.pow(10,g),x=p*A;for(let _=0;_<s;_++){const M=r?r.getX(_):_;let T="";for(let L=0,D=o.length;L<D;L++){const P=o[L],O=n.getAttribute(P),F=O.itemSize;for(let U=0;U<F;U++)T+=`${~~(O[h[U]](M)*A+x)},`}if(T in t)d.push(t[T]);else{for(let L=0,D=o.length;L<D;L++){const P=o[L],O=n.getAttribute(P),F=n.morphAttributes[P],U=O.itemSize,B=l[P],z=u[P];for(let H=0;H<U;H++){const X=h[H],W=f[H];if(B[W](a,O[X](M)),F)for(let J=0,ee=F.length;J<ee;J++)z[J][W](a,F[J][X](M))}}t[T]=a,d.push(a),a++}}const b=n.clone();for(const _ in n.attributes){const M=l[_];if(b.setAttribute(_,new M.constructor(M.array.slice(0,a*M.itemSize),M.itemSize,M.normalized)),_ in u)for(let T=0;T<u[_].length;T++){const L=u[_][T];b.morphAttributes[_][T]=new L.constructor(L.array.slice(0,a*L.itemSize),L.itemSize,L.normalized)}}return b.setIndex(d),b}function RIe(n,e){if(e===hMe)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===YY||e===fMe){let t=n.getIndex();if(t===null){const a=[],o=n.getAttribute("position");if(o!==void 0){for(let l=0;l<o.count;l++)a.push(l);n.setIndex(a),t=n.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const r=t.count-2,i=[];if(e===YY)for(let a=1;a<=r;a++)i.push(t.getX(0)),i.push(t.getX(a)),i.push(t.getX(a+1));else for(let a=0;a<r;a++)a%2===0?(i.push(t.getX(a)),i.push(t.getX(a+1)),i.push(t.getX(a+2))):(i.push(t.getX(a+2)),i.push(t.getX(a+1)),i.push(t.getX(a)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),n}function PIe(n){const e=new Ve,t=new Ve,r=new Ve,i=new Ve,s=new Ve,a=new Ve,o=new Ve,l=new Ve,u=new Ve;function d(le,Z,Y,re,_e,Ee,Ae,te){e.fromBufferAttribute(Z,_e),t.fromBufferAttribute(Z,Ee),r.fromBufferAttribute(Z,Ae);const ve=le.morphTargetInfluences;if(Y&&ve){o.set(0,0,0),l.set(0,0,0),u.set(0,0,0);for(let we=0,Ue=Y.length;we<Ue;we++){const ze=ve[we],yt=Y[we];ze!==0&&(i.fromBufferAttribute(yt,_e),s.fromBufferAttribute(yt,Ee),a.fromBufferAttribute(yt,Ae),re?(o.addScaledVector(i,ze),l.addScaledVector(s,ze),u.addScaledVector(a,ze)):(o.addScaledVector(i.sub(e),ze),l.addScaledVector(s.sub(t),ze),u.addScaledVector(a.sub(r),ze)))}e.add(o),t.add(l),r.add(u)}le.isSkinnedMesh&&(le.applyBoneTransform(_e,e),le.applyBoneTransform(Ee,t),le.applyBoneTransform(Ae,r)),te[_e*3+0]=e.x,te[_e*3+1]=e.y,te[_e*3+2]=e.z,te[Ee*3+0]=t.x,te[Ee*3+1]=t.y,te[Ee*3+2]=t.z,te[Ae*3+0]=r.x,te[Ae*3+1]=r.y,te[Ae*3+2]=r.z}const h=n.geometry,f=n.material;let p,g,A;const x=h.index,b=h.attributes.position,_=h.morphAttributes.position,M=h.morphTargetsRelative,T=h.attributes.normal,L=h.morphAttributes.normal,D=h.groups,P=h.drawRange;let O,F,U,B,z,H,X;const W=new Float32Array(b.count*b.itemSize),J=new Float32Array(T.count*T.itemSize);if(x!==null)if(Array.isArray(f))for(O=0,U=D.length;O<U;O++)for(z=D[O],H=Math.max(z.start,P.start),X=Math.min(z.start+z.count,P.start+P.count),F=H,B=X;F<B;F+=3)p=x.getX(F),g=x.getX(F+1),A=x.getX(F+2),d(n,b,_,M,p,g,A,W),d(n,T,L,M,p,g,A,J);else for(H=Math.max(0,P.start),X=Math.min(x.count,P.start+P.count),O=H,U=X;O<U;O+=3)p=x.getX(O),g=x.getX(O+1),A=x.getX(O+2),d(n,b,_,M,p,g,A,W),d(n,T,L,M,p,g,A,J);else if(Array.isArray(f))for(O=0,U=D.length;O<U;O++)for(z=D[O],H=Math.max(z.start,P.start),X=Math.min(z.start+z.count,P.start+P.count),F=H,B=X;F<B;F+=3)p=F,g=F+1,A=F+2,d(n,b,_,M,p,g,A,W),d(n,T,L,M,p,g,A,J);else for(H=Math.max(0,P.start),X=Math.min(b.count,P.start+P.count),O=H,U=X;O<U;O+=3)p=O,g=O+1,A=O+2,d(n,b,_,M,p,g,A,W),d(n,T,L,M,p,g,A,J);const ee=new Bi(W,3),ae=new Bi(J,3);return{positionAttribute:b,normalAttribute:T,morphedPositionAttribute:ee,morphedNormalAttribute:ae}}function LIe(n){if(n.groups.length===0)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),n;let e=n.groups;if(e=e.sort((a,o)=>a.materialIndex!==o.materialIndex?a.materialIndex-o.materialIndex:a.start-o.start),n.getIndex()===null){const a=n.getAttribute("position"),o=[];for(let l=0;l<a.count;l+=3)o.push(l,l+1,l+2);n.setIndex(o)}const t=n.getIndex(),r=[];for(let a=0;a<e.length;a++){const o=e[a],l=o.start,u=l+o.count;for(let d=l;d<u;d++)r.push(t.getX(d))}n.dispose(),n.setIndex(r);let i=0;for(let a=0;a<e.length;a++){const o=e[a];o.start=i,i+=o.count}let s=e[0];n.groups=[s];for(let a=1;a<e.length;a++){const o=e[a];s.materialIndex===o.materialIndex?s.count+=o.count:(s=o,n.groups.push(s))}return n}function OIe(n,e=Math.PI/3){const t=n.index?n.toNonIndexed():n,r=t.attributes.position,i=r.count;let s;if(r.isBufferAttribute===!0&&r.itemSize===3&&r.normalized===!1)s=r.array;else{s=new Float64Array(i*3);for(let T=0;T<i;T++)s[3*T+0]=r.getX(T),s[3*T+1]=r.getY(T),s[3*T+2]=r.getZ(T)}const a=Math.cos(e),o=(1+1e-10)*100,l=i/3,u=new Float64Array(l*3);for(let T=0;T<l;T++){const L=9*T,D=s[L+0],P=s[L+1],O=s[L+2],F=s[L+3],U=s[L+4],B=s[L+5],z=s[L+6],H=s[L+7],X=s[L+8],W=z-F,J=H-U,ee=X-B,ae=D-F,le=P-U,Z=O-B,Y=J*Z-ee*le,re=ee*ae-W*Z,_e=W*le-J*ae,Ee=1/(Math.sqrt(Y*Y+re*re+_e*_e)||1);u[3*T+0]=Y*Ee,u[3*T+1]=re*Ee,u[3*T+2]=_e*Ee}const d=new Int32Array(i),h=new Int32Array(i*3);let f=1;for(;f<i*2;)f<<=1;const p=f-1,g=new Int32Array(f);let A=0;for(let T=0;T<i;T++){const L=3*T,D=~~(s[L+0]*o),P=~~(s[L+1]*o),O=~~(s[L+2]*o);let F=(Math.imul(D,73856093)^Math.imul(P,19349663)^Math.imul(O,83492791))&p;for(;;){const U=g[F];if(U===0){const z=3*A;h[z+0]=D,h[z+1]=P,h[z+2]=O,g[F]=A+1,d[T]=A++;break}const B=3*(U-1);if(h[B+0]===D&&h[B+1]===P&&h[B+2]===O){d[T]=U-1;break}F=F+1&p}}const x=new Int32Array(A+1);for(let T=0;T<i;T++)x[d[T]+1]++;for(let T=0;T<A;T++)x[T+1]+=x[T];const b=new Int32Array(i),_=x.slice(0,A);for(let T=0;T<l;T++){const L=3*T;b[_[d[L+0]]++]=T,b[_[d[L+1]]++]=T,b[_[d[L+2]]++]=T}const M=new Float32Array(i*3);for(let T=0;T<l;T++){const L=3*T,D=u[L+0],P=u[L+1],O=u[L+2];for(let F=0;F<3;F++){const U=L+F,B=d[U];let z=0,H=0,X=0;for(let J=x[B],ee=x[B+1];J<ee;J++){const ae=3*b[J],le=u[ae+0],Z=u[ae+1],Y=u[ae+2];D*le+P*Z+O*Y>a&&(z+=le,H+=Z,X+=Y)}const W=1/(Math.sqrt(z*z+H*H+X*X)||1);M[3*U+0]=z*W,M[3*U+1]=H*W,M[3*U+2]=X*W}}return t.setAttribute("normal",new Ea(M,3,!1)),t}const yz=Object.freeze(Object.defineProperty({__proto__:null,computeMikkTSpaceTangents:SIe,computeMorphedAttributes:PIe,deepCloneAttribute:EIe,deinterleaveAttribute:Ak,deinterleaveGeometry:NIe,estimateBytesUsed:MIe,interleaveAttributes:CIe,mergeAttributes:MF,mergeGeometries:TIe,mergeGroups:LIe,mergeVertices:kIe,toCreasedNormals:OIe,toTrianglesDrawMode:RIe},Symbol.toStringTag,{value:"Module"}));var pn=(function(n){return typeof n=="function"?n:typeof n=="string"?function(e){return e[n]}:function(e){return n}});function xk(n){"@babel/helpers - typeof";return xk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xk(n)}var DIe=/^\s+/,jIe=/\s+$/;function Sr(n,e){if(n=n||"",e=e||{},n instanceof Sr)return n;if(!(this instanceof Sr))return new Sr(n,e);var t=IIe(n);this._originalInput=n,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=t.ok}Sr.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t,r,i,s,a,o;return t=e.r/255,r=e.g/255,i=e.b/255,t<=.03928?s=t/12.92:s=Math.pow((t+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*a+.0722*o},setAlpha:function(e){return this._a=wde(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=mZ(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=mZ(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+r+"%, "+i+"%)":"hsva("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=pZ(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=pZ(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+r+"%, "+i+"%)":"hsla("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return gZ(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return VIe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(wa(this._r,255)*100)+"%",g:Math.round(wa(this._g,255)*100)+"%",b:Math.round(wa(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(wa(this._r,255)*100)+"%, "+Math.round(wa(this._g,255)*100)+"%, "+Math.round(wa(this._b,255)*100)+"%)":"rgba("+Math.round(wa(this._r,255)*100)+"%, "+Math.round(wa(this._g,255)*100)+"%, "+Math.round(wa(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:JIe[gZ(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+AZ(this._r,this._g,this._b,this._a),r=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var s=Sr(e);r="#"+AZ(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,i=this._a<1&&this._a>=0,s=!t&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return s?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return Sr(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification($Ie,arguments)},brighten:function(){return this._applyModification(HIe,arguments)},darken:function(){return this._applyModification(WIe,arguments)},desaturate:function(){return this._applyModification(zIe,arguments)},saturate:function(){return this._applyModification(GIe,arguments)},greyscale:function(){return this._applyModification(qIe,arguments)},spin:function(){return this._applyModification(XIe,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(KIe,arguments)},complement:function(){return this._applyCombination(YIe,arguments)},monochromatic:function(){return this._applyCombination(ZIe,arguments)},splitcomplement:function(){return this._applyCombination(QIe,arguments)},triad:function(){return this._applyCombination(xZ,[3])},tetrad:function(){return this._applyCombination(xZ,[4])}};Sr.fromRatio=function(n,e){if(xk(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=jS(n[r]));n=t}return Sr(n,e)};function IIe(n){var e={r:0,g:0,b:0}
vendor: 6,218 bytes, line 4275
4275,t=1,r=null,i=null,s=null,a=!1,o=!1;return typeof n=="string"&&(n=rFe(n)),xk(n)=="object"&&(xm(n.r)&&xm(n.g)&&xm(n.b)?(e=FIe(n.r,n.g,n.b),a=!0,o=String(n.r).substr(-1)==="%"?"prgb":"rgb"):xm(n.h)&&xm(n.s)&&xm(n.v)?(r=jS(n.s),i=jS(n.v),e=BIe(n.h,r,i),a=!0,o="hsv"):xm(n.h)&&xm(n.s)&&xm(n.l)&&(r=jS(n.s),s=jS(n.l),e=UIe(n.h,r,s),a=!0,o="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=wde(t),{ok:a,format:n.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}function FIe(n,e,t){return{r:wa(n,255)*255,g:wa(e,255)*255,b:wa(t,255)*255}}function pZ(n,e,t){n=wa(n,255),e=wa(e,255),t=wa(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),s,a,o=(r+i)/2;if(r==i)s=a=0;else{var l=r-i;switch(a=o>.5?l/(2-r-i):l/(r+i),r){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:a,l:o}}function UIe(n,e,t){var r,i,s;n=wa(n,360),e=wa(e,100),t=wa(t,100);function a(u,d,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?u+(d-u)*6*h:h<1/2?d:h<2/3?u+(d-u)*(2/3-h)*6:u}if(e===0)r=i=s=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;r=a(l,o,n+1/3),i=a(l,o,n),s=a(l,o,n-1/3)}return{r:r*255,g:i*255,b:s*255}}function mZ(n,e,t){n=wa(n,255),e=wa(e,255),t=wa(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),s,a,o=r,l=r-i;if(a=r===0?0:l/r,r==i)s=0;else{switch(r){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:a,v:o}}function BIe(n,e,t){n=wa(n,360)*6,e=wa(e,100),t=wa(t,100);var r=Math.floor(n),i=n-r,s=t*(1-e),a=t*(1-i*e),o=t*(1-(1-i)*e),l=r%6,u=[t,a,s,s,o,t][l],d=[o,t,t,a,s,s][l],h=[s,s,o,t,t,a][l];return{r:u*255,g:d*255,b:h*255}}function gZ(n,e,t,r){var i=[Xf(Math.round(n).toString(16)),Xf(Math.round(e).toString(16)),Xf(Math.round(t).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function VIe(n,e,t,r,i){var s=[Xf(Math.round(n).toString(16)),Xf(Math.round(e).toString(16)),Xf(Math.round(t).toString(16)),Xf(_de(r))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function AZ(n,e,t,r){var i=[Xf(_de(r)),Xf(Math.round(n).toString(16)),Xf(Math.round(e).toString(16)),Xf(Math.round(t).toString(16))];return i.join("")}Sr.equals=function(n,e){return!n||!e?!1:Sr(n).toRgbString()==Sr(e).toRgbString()};Sr.random=function(){return Sr.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function zIe(n,e){e=e===0?0:e||10;var t=Sr(n).toHsl();return t.s-=e/100,t.s=rR(t.s),Sr(t)}function GIe(n,e){e=e===0?0:e||10;var t=Sr(n).toHsl();return t.s+=e/100,t.s=rR(t.s),Sr(t)}function qIe(n){return Sr(n).desaturate(100)}function $Ie(n,e){e=e===0?0:e||10;var t=Sr(n).toHsl();return t.l+=e/100,t.l=rR(t.l),Sr(t)}function HIe(n,e){e=e===0?0:e||10;var t=Sr(n).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),Sr(t)}function WIe(n,e){e=e===0?0:e||10;var t=Sr(n).toHsl();return t.l-=e/100,t.l=rR(t.l),Sr(t)}function XIe(n,e){var t=Sr(n).toHsl(),r=(t.h+e)%360;return t.h=r<0?360+r:r,Sr(t)}function YIe(n){var e=Sr(n).toHsl();return e.h=(e.h+180)%360,Sr(e)}function xZ(n,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=Sr(n).toHsl(),r=[Sr(n)],i=360/e,s=1;s<e;s++)r.push(Sr({h:(t.h+s*i)%360,s:t.s,l:t.l}));return r}function QIe(n){var e=Sr(n).toHsl(),t=e.h;return[Sr(n),Sr({h:(t+72)%360,s:e.s,l:e.l}),Sr({h:(t+216)%360,s:e.s,l:e.l})]}function KIe(n,e,t){e=e||6,t=t||30;var r=Sr(n).toHsl(),i=360/t,s=[Sr(n)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,s.push(Sr(r));return s}function ZIe(n,e){e=e||6;for(var t=Sr(n).toHsv(),r=t.h,i=t.s,s=t.v,a=[],o=1/e;e--;)a.push(Sr({h:r,s:i,v:s})),s=(s+o)%1;return a}Sr.mix=function(n,e,t){t=t===0?0:t||50;var r=Sr(n).toRgb(),i=Sr(e).toRgb(),s=t/100,a={r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a};return Sr(a)};Sr.readability=function(n,e){var t=Sr(n),r=Sr(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};Sr.isReadable=function(n,e,t){var r=Sr.readability(n,e),i,s;switch(s=!1,i=iFe(t),i.level+i.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s};Sr.mostReadable=function(n,e,t){var r=null,i=0,s,a,o,l;t=t||{},a=t.includeFallbackColors,o=t.level,l=t.size;for(var u=0;u<e.length;u++)s=Sr.readability(n,e[u]),s>i&&(i=s,r=Sr(e[u]));return Sr.isReadable(n,r,{level:o,size:l})||!a?r:(t.includeFallbackColors=!1,Sr.mostReadable(n,["#fff","#000"],t))};var kF=Sr.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
42750",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},JIe=Sr.hexNames=eFe(kF);function eFe(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function wde(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function wa(n,e){tFe(n)&&(n="100%");var t=nFe(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function rR(n){return Math.min(1,Math.max(0,n))}function Ed(n){return parseInt(n,16)}function tFe(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function nFe(n){return typeof n=="string"&&n.indexOf("%")!=-1}function Xf(n){return n.length==1?"0"+n:""+n}function jS(n){return n<=1&&(n=n*100+"%"),n}function _de(n){return Math.round(parseFloat(n)*255).toString(16)}function vZ(n){return Ed(n)/255}var Rf=(function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"
4275+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function xm(n){return!!Rf.CSS_UNIT.exec(n)}function rFe(n){n=n.replace(DIe,"").replace(jIe,"").toLowerCase();var e=!1;if(kF[n])n=kF[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Rf.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=Rf.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Rf.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=Rf.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Rf.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=Rf.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Rf.hex8.exec(n))?{r:Ed(t[1]),g:Ed(t[2]),b:Ed(t[3]),a:vZ(t[4]),format:e?"name":"hex8"}:(t=Rf.hex6.exec(n))?{r:Ed(t[1]),g:Ed(t[2]),b:Ed(t[3]),format:e?"name":"hex"}:(t=Rf.hex4.exec(n))?{r:Ed(t[1]+""+t[1]),g:Ed(t[2]+""+t[2]),b:Ed(t[3]+""+t[3]),a:vZ(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=Rf.hex3.exec(n))?{r:Ed(t[1]+""+t[1]),g:Ed(t[2]+""+t[2]),b:Ed(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function iFe(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}function RF(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function sFe(n){if(Array.isArray(n))return n}function aFe(n){if(Array.isArray(n))return RF(n)}function Sde(n,e,t){if(typeof n=="function"?n===e:n.has(e))return arguments.length<3?e:t;throw new TypeError("Private element is not present on this object")}function oFe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lFe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function rc(n,e){return n.get(Sde(n,e))}function b2(n,e,t){oFe(n,e),e.set(n,t)}function OC(n,e,t){return n.set(Sde(n,e),t),t}function cFe(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,xFe(r.key),r)}}function uFe(n,e,t){return e&&cFe(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function dFe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function hFe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function fFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4276In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pFe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4277In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mFe(n,e){return sFe(n)||hFe(n,e)||Tde(n,e)||fFe()}function gFe(n){return aFe(n)||dFe(n)||Tde(n)||pFe()}function AFe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function xFe(n){var e=AFe(n,"string");return typeof e=="symbol"?e:e+""}function Tde(n,e){if(n){if(typeof n=="string")return RF(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?RF(n,e):void 0}}var w2=new WeakMap,O3=new WeakMap,_2=new WeakMap,iL=new WeakMap,sL=new WeakMap,aL=new WeakMap,vFe=(function(){function n(){lFe(this,n),b2(this,w2,new Map),b2(this,O3,new Map),b2(this,_2,function(e){return e}),b2(this,iL,function(){return{}}),b2(this,sL,function(){}),b2(this,aL,function(){})}return uFe(n,[{key:"getObj",value:function(t){return rc(w2,this).get(rc(_2,this).call(this,t))}},{key:"getData",value:function(t){return rc(O3,this).get(t)}},{key:"entries",value:function(){return gFe(rc(O3,this).entries()).map(function(t){var r=mFe(t,2),i=r[0],s=r[1];return[s,i]})}},{key:"id",value:function(t){return OC(_2,this,pn(t)),this}},{key:"onCreateObj",value:function(t){return OC(iL,this,t),this}}
4277,{key:"onUpdateObj",value:function(t){return OC(sL,this,t),this}},{key:"onRemoveObj",value:function(t){return OC(aL,this,t),this}},{key:"digest",value:function(t){var r=this;t.filter(function(s){return!rc(w2,r).has(rc(_2,r).call(r,s))}).forEach(function(s){var a=rc(iL,r).call(r,s);rc(w2,r).set(rc(_2,r).call(r,s),a),rc(O3,r).set(a,s)});var i=new Map(t.map(function(s){return[rc(_2,r).call(r,s),s]}));return rc(w2,this).forEach(function(s,a){i.has(a)?rc(sL,r).call(r,s,i.get(a)):(rc(aL,r).call(r,s,a),rc(w2,r).delete(a),rc(O3,r).delete(s))}),this}},{key:"clear",value:function(){return this.digest([]),this}}])})(),b6={exports:{}},yFe=b6.exports,yZ;function bFe(){return yZ||(yZ=1,(function(n,e){(function(t,r){n.exports=r()})(yFe,function(){return(function(t){function r(s){if(i[s])return i[s].exports;var a=i[s]={exports:{},id:s,loaded:!1};return t[s].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}var i={};return r.m=t,r.c=i,r.p="",r(0)})([function(t,r,i){var s=i(1),a=(function(){function o(l,u,d){l===void 0&&(l=NaN),u===void 0&&(u=NaN),d===void 0&&(d=!1),this._minFPS=u,this._maxFPS=l,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new s.default,this._onPause=new s.default,this._onTick=new s.default,this._onTickOncePerFrame=new s.default,d||this.resume()}return o.prototype.updateOnce=function(l){l(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},o.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce())},o.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},o.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(o.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"timeScale",{get:function(){return this._timeScale},set:function(l){this._timeScale!==l&&(this._timeScale=l)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),o.prototype.animateOnce=function(){var l=this;this._animationFrameHandle=window.requestAnimationFrame(function(){return l.onFrame()})},o.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},o.prototype.update=function(l,u){u===void 0&&(u=!0),this._currentTick++,this._currentTime+=l,this._tickDeltaTime=l,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),u&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},o.prototype.getTimer=function(){return Date.now()},o})();
vendor: 9,378 bytes, line 4277
4277Object.defineProperty(r,"__esModule",{value:!0}),r.default=a},function(t,r,i){(function(s,a){t.exports=a()})(this,function(){return(function(s){function a(l){if(o[l])return o[l].exports;var u=o[l]={exports:{},id:l,loaded:!1};return s[l].call(u.exports,u,u.exports,a),u.loaded=!0,u.exports}var o={};return a.m=s,a.c=o,a.p="",a(0)})([function(s,a){var o=(function(){function l(){this.functions=[]}return l.prototype.add=function(u){return this.functions.indexOf(u)===-1&&(this.functions.push(u),!0)},l.prototype.remove=function(u){var d=this.functions.indexOf(u);return d>-1&&(this.functions.splice(d,1),!0)},l.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},l.prototype.dispatch=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];var h=this.functions.concat();h.forEach(function(f){f.apply(void 0,u)})},Object.defineProperty(l.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),l})();Object.defineProperty(a,"__esModule",{value:!0}),a.default=o}])})}])})})(b6)),b6.exports}var wFe=bFe();const Yw=F1(wFe),Wm=11102230246251565e-32,ic=134217729,_Fe=(3+8*Wm)*Wm;function oL(n,e,t,r,i){let s,a,o,l,u=e[0],d=r[0],h=0,f=0;d>u==d>-u?(s=u,u=e[++h]):(s=d,d=r[++f]);let p=0;if(h<n&&f<t)for(d>u==d>-u?(a=u+s,o=s-(a-u),u=e[++h]):(a=d+s,o=s-(a-d),d=r[++f]),s=a,o!==0&&(i[p++]=o);h<n&&f<t;)d>u==d>-u?(a=s+u,l=a-s,o=s-(a-l)+(u-l),u=e[++h]):(a=s+d,l=a-s,o=s-(a-l)+(d-l),d=r[++f]),s=a,o!==0&&(i[p++]=o);for(;h<n;)a=s+u,l=a-s,o=s-(a-l)+(u-l),u=e[++h],s=a,o!==0&&(i[p++]=o);for(;f<t;)a=s+d,l=a-s,o=s-(a-l)+(d-l),d=r[++f],s=a,o!==0&&(i[p++]=o);return(s!==0||p===0)&&(i[p++]=s),p}function SFe(n,e){let t=e[0];for(let r=1;r<n;r++)t+=e[r];return t}function MT(n){return new Float64Array(n)}const TFe=(3+16*Wm)*Wm,EFe=(2+12*Wm)*Wm,CFe=(9+64*Wm)*Wm*Wm,S2=MT(4),bZ=MT(8),wZ=MT(12),_Z=MT(16),Xc=MT(4);function NFe(n,e,t,r,i,s,a){let o,l,u,d,h,f,p,g,A,x,b,_,M,T,L,D,P,O;const F=n-i,U=t-i,B=e-s,z=r-s;T=F*z,f=ic*F,p=f-(f-F),g=F-p,f=ic*z,A=f-(f-z),x=z-A,L=g*x-(T-p*A-g*A-p*x),D=B*U,f=ic*B,p=f-(f-B),g=B-p,f=ic*U,A=f-(f-U),x=U-A,P=g*x-(D-p*A-g*A-p*x),b=L-P,h=L-b,S2[0]=L-(b+h)+(h-P),_=T+b,h=_-T,M=T-(_-h)+(b-h),b=M-D,h=M-b,S2[1]=M-(b+h)+(h-D),O=_+b,h=O-_,S2[2]=_-(O-h)+(b-h),S2[3]=O;let H=SFe(4,S2),X=EFe*a;if(H>=X||-H>=X||(h=n-F,o=n-(F+h)+(h-i),h=t-U,u=t-(U+h)+(h-i),h=e-B,l=e-(B+h)+(h-s),h=r-z,d=r-(z+h)+(h-s),o===0&&l===0&&u===0&&d===0)||(X=CFe*a+_Fe*Math.abs(H),H+=F*d+z*o-(B*u+U*l),H>=X||-H>=X))return H;T=o*z,f=ic*o,p=f-(f-o),g=o-p,f=ic*z,A=f-(f-z),x=z-A,L=g*x-(T-p*A-g*A-p*x),D=l*U,f=ic*l,p=f-(f-l),g=l-p,f=ic*U,A=f-(f-U),x=U-A,P=g*x-(D-p*A-g*A-p*x),b=L-P,h=L-b,Xc[0]=L-(b+h)+(h-P),_=T+b,h=_-T,M=T-(_-h)+(b-h),b=M-D,h=M-b,Xc[1]=M-(b+h)+(h-D),O=_+b,h=O-_,Xc[2]=_-(O-h)+(b-h),Xc[3]=O;const W=oL(4,S2,4,Xc,bZ);T=F*d,f=ic*F,p=f-(f-F),g=F-p,f=ic*d,A=f-(f-d),x=d-A,L=g*x-(T-p*A-g*A-p*x),D=B*u,f=ic*B,p=f-(f-B),g=B-p,f=ic*u,A=f-(f-u),x=u-A,P=g*x-(D-p*A-g*A-p*x),b=L-P,h=L-b,Xc[0]=L-(b+h)+(h-P),_=T+b,h=_-T,M=T-(_-h)+(b-h),b=M-D,h=M-b,Xc[1]=M-(b+h)+(h-D),O=_+b,h=O-_,Xc[2]=_-(O-h)+(b-h),Xc[3]=O;const J=oL(W,bZ,4,Xc,wZ);T=o*d,f=ic*o,p=f-(f-o),g=o-p,f=ic*d,A=f-(f-d),x=d-A,L=g*x-(T-p*A-g*A-p*x),D=l*u,f=ic*l,p=f-(f-l),g=l-p,f=ic*u,A=f-(f-u),x=u-A,P=g*x-(D-p*A-g*A-p*x),b=L-P,h=L-b,Xc[0]=L-(b+h)+(h-P),_=T+b,h=_-T,M=T-(_-h)+(b-h),b=M-D,h=M-b,Xc[1]=M-(b+h)+(h-D),O=_+b,h=O-_,Xc[2]=_-(O-h)+(b-h),Xc[3]=O;const ee=oL(J,wZ,4,Xc,_Z);return _Z[ee-1]}function IS(n,e,t,r,i,s){const a=(e-s)*(t-i),o=(n-i)*(r-s),l=a-o,u=Math.abs(a+o);return Math.abs(l)>=TFe*u?l:-NFe(n,e,t,r,i,s,u)}const SZ=Math.pow(2,-52),DC=new Uint32Array(512);class D5{static from(e,t=LFe,r=OFe){const i=e.length,s=new Float64Array(i*2);for(let a=0;a<i;a++){const o=e[a];s[2*a]=t(o),s[2*a+1]=r(o)}return new D5(s)}constructor(e){const t=e.length>>1;if(t>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*t-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.trianglesLen=0,this._cx=0,this._cy=0,this._hullStart=0,this.hull=this._triangles,this.triangles=this._triangles,this.halfedges=this._halfedges,this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:r,_hullTri:i,_hullHash:s}=this,a=e.length>>1;let o=1/0,l=1/0,u=-1/0,d=-1/0;for(let F=0;F<a;F++){const U=e[2*F],B=e[2*F+1];U<o&&(o=U),B<l&&(l=B),U>u&&(u=U),B>d&&(d=B),this._ids[F]=F}const h=(o+u)/2,f=(l+d)/2;let p=0,g=0,A=0;for(let F=0,U=1/0;F<a;F++){const B=lL(h,f,e[2*F],e[2*F+1]);B<U&&(p=F,U=B)}const x=e[2*p],b=e[2*p+1];for(let F=0,U=1/0;F<a;F++){if(F===p)continue;const B=lL(x,b,e[2*F],e[2*F+1]);B<U&&B>0&&(g=F,U=B)}let _=e[2*g],M=e[2*g+1],T=1/0;for(let F=0;F<a;F++){if(F===p||F===g)continue;const U=RFe(x,b,_,M,e[2*F],e[2*F+1]);U<T&&(A=F,T=U)}let L=e[2*A],D=e[2*A+1];if(T===1/0){for(let B=0;B<a;B++)this._dists[B]=e[2*B]-e[0]||e[2*B+1]-e[1];gb(this._ids,this._dists,0,a-1);const F=new Uint32Array(a);let U=0;for(let B=0,z=-1/0;B<a;B++){const H=this._ids[B],X=this._dists[H];X>z&&(F[U++]=H,z=X)}this.hull=F.subarray(0,U),this.triangles=new Uint32Array(0),this.halfedges=new Int32Array(0);return}if(IS(x,b,_,M,L,D)<0){const F=g,U=_,B=M;g=A,_=L,M=D,A=F,L=U,D=B}const P=PFe(x,b,_,M,L,D);this._cx=P.x,this._cy=P.y;for(let F=0;F<a;F++)this._dists[F]=lL(e[2*F],e[2*F+1],P.x,P.y);gb(this._ids,this._dists,0,a-1),this._hullStart=p;let O=3;r[p]=t[A]=g,r[g]=t[p]=A,r[A]=t[g]=p,i[p]=0,i[g]=1,i[A]=2,s.fill(-1),s[this._hashKey(x,b)]=p,s[this._hashKey(_,M)]=g,s[this._hashKey(L,D)]=A,this.trianglesLen=0,this._addTriangle(p,g,A,-1,-1,-1);for(let F=0,U=0,B=0;F<this._ids.length;F++){const z=this._ids[F],H=e[2*z],X=e[2*z+1];if(F>0&&Math.abs(H-U)<=SZ&&Math.abs(X-B)<=SZ||(U=H,B=X,z===p||z===g||z===A))continue;let W=0;for(let Z=0,Y=this._hashKey(H,X);Z<this._hashSize&&(W=s[(Y+Z)%this._hashSize],!(W!==-1&&W!==r[W]));Z++);W=t[W];let J=W,ee;for(;ee=r[J],IS(H,X,e[2*J],e[2*J+1],e[2*ee],e[2*ee+1])>=0;)if(J=ee,J===W){J=-1;break}if(J===-1)continue;let ae=this._addTriangle(J,z,r[J],-1,-1,i[J]);i[z]=this._legalize(ae+2),i[J]=ae,O++;let le=r[J];for(;ee=r[le],IS(H,X,e[2*le],e[2*le+1],e[2*ee],e[2*ee+1])<0;)ae=this._addTriangle(le,z,ee,i[z],-1,i[le]),i[z]=this._legalize(ae+2),r[le]=le,O--,le=ee;if(J===W)for(;ee=t[J],IS(H,X,e[2*ee],e[2*ee+1],e[2*J],e[2*J+1])<0;)ae=this._addTriangle(ee,z,J,-1,i[J],i[ee]),this._legalize(ae+2),i[ee]=ae,r[J]=J,O--,J=ee;this._hullStart=t[z]=J,r[J]=t[le]=z,r[z]=le,s[this._hashKey(H,X)]=z,s[this._hashKey(e[2*J],e[2*J+1])]=J}this.hull=new Uint32Array(O);for(let F=0,U=this._hullStart;F<O;F++)this.hull[F]=U,U=r[U];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(MFe(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:r,coords:i}=this;let s=0,a=0;for(;;){const o=r[e],l=e-e%3;if(a=l+(e+2)%3,o===-1){if(s===0)break;e=DC[--s];continue}const u=o-o%3,d=l+(e+1)%3,h=u+(o+2)%3,f=t[a],p=t[e],g=t[d],A=t[h];if(kFe(i[2*f],i[2*f+1],i[2*p],i[2*p+1],i[2*g],i[2*g+1],i[2*A],i[2*A+1])){t[e]=A,t[o]=f;const b=r[h];if(b===-1){let M=this._hullStart;do{if(this._hullTri[M]===h){this._hullTri[M]=e;break}M=this._hullPrev[M]}while(M!==this._hullStart)}this._link(e,b),this._link(o,r[a]),this._link(a,h);const _=u+(o+1)%3;s<DC.length&&(DC[s++]=_)}else{if(s===0)break;e=DC[--s]}}return a}_link(e,t){this._halfedges[e]=t,t!==-1&&(this._halfedges[t]=e)}_addTriangle(e,t,r,i,s,a){const o=this.trianglesLen;return this._triangles[o]=e,this._triangles[o+1]=t,this._triangles[o+2]=r,this._link(o,i),this._link(o+1,s),this._link(o+2,a),this.trianglesLen+=3,o}}function MFe(n,e){const t=n/(Math.abs(n)+Math.abs(e));return(e>0?3-t:1+t)/4}function lL(n,e,t,r){const i=n-t,s=e-r;return i*i+s*s}function kFe(n,e,t,r,i,s,a,o){const l=n-a,u=e-o,d=t-a,h=r-o,f=i-a,p=s-o,g=l*l+u*u,A=d*d+h*h,x=f*f+p*p;return l*(h*x-A*p)-u*(d*x-A*f)+g*(d*p-h*f)<0}function RFe(n,e,t,r,i,s){const a=t-n,o=r-e,l=i-n,u=s-e,d=a*a+o*o,h=l*l+u*u,f=.5/(a*u-o*l),p=(u*d-o*h)*f,g=(a*h-l*d)*f;return p*p+g*g}function PFe(n,e,t,r,i,s){const a=t-n,o=r-e,l=i-n,u=s-e,d=a*a+o*o,h=l*l+u*u,f=.5/(a*u-o*l),p=n+(u*d-o*h)*f,g=e+(a*h-l*d)*f;return{x:p,y:g}}function gb(n,e,t,r){if(r-t<=20)for(let i=t+1;i<=r;i++){const s=n[i],a=e[s];let o=i-1;for(;o>=t&&e[n[o]]>a;)n[o+1]=n[o--];n[o+1]=s}else{const i=t+r>>1;let s=t+1,a=r;D3(n,i,s),e[n[t]]>e[n[r]]&&D3(n,t,r),e[n[s]]>e[n[r]]&&D3(n,s,r),e[n[t]]>e[n[s]]&&D3(n,t,s);const o=n[s],l=e[o];for(;;){do s++;while(e[n[s]]<l);do a--;while(e[n[a]]>l);if(a<s)break;D3(n,s,a)}n[t+1]=n[a],n[a]=o,r-s+1>=a-t?(gb(n,e,s,r),gb(n,e,t,a-1)):(gb(n,e,t,a-1),gb(n,e,s,r))}}function D3(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function LFe(n){return n[0]}function OFe(n){return n[1]}function DFe(n,e){var t,r,i=0,s,a,o,l,u,d,h,f=n[0],p=n[1],g=e.length;for(t=0;t<g;t++){r=0;var A=e[t],x=A.length-1;if(d=A[0],d[0]!==A[x][0]&&d[1]!==A[x][1])throw new Error("First and last coordinates in a ring must be the same");for(a=d[0]-f,o=d[1]-p,r;r<x;r++){if(h=A[r+1],l=h[0]-f,u=h[1]-p,o===0&&u===0){if(l<=0&&a>=0||a<=0&&l>=0)return 0}else if(u>=0&&o<=0||u<=0&&o>=0){if(s=IS(a,l,o,u,0,0),s===0)return 0;(s>0&&u>0&&o<=0||s<0&&u<=0&&o>0)&&i++}
4277d=h,o=u,a=l}}return i%2!==0}function jFe(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function IFe(n){return n.type==="Feature"?n.geometry:n}function FFe(n,e,t={}){if(!n)throw new Error("point is required");if(!e)throw new Error("polygon is required");const r=jFe(n),i=IFe(e),s=i.type,a=e.bbox;let o=i.coordinates;if(a&&UFe(r,a)===!1)return!1;s==="Polygon"&&(o=[o]);let l=!1;for(var u=0;u<o.length;++u){const d=DFe(r,o[u]);if(d===0)return!t.ignoreBoundary;d&&(l=!0)}return l}function UFe(n,e){return e[0]<=n[0]&&e[1]<=n[1]&&e[2]>=n[0]&&e[3]>=n[1]}var BFe=FFe;const TZ=1e-6;class pv{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,r){e=+e,t=+t,r=+r;const i=e+r,s=t;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${s}`:(Math.abs(this._x1-i)>TZ||Math.abs(this._y1-s)>TZ)&&(this._+="L"+i+","+s),r&&(this._+=`A${r},${r},0,1,1,${e-r},${t}A${r},${r},0,1,1,${this._x1=i},${this._y1=s}`)}
vendor: 10,065 bytes, line 4277
4277rect(e,t,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class PF{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class VFe{constructor(e,[t,r,i,s]=[0,0,960,500]){if(!((i=+i)>=(t=+t))||!((s=+s)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=t,this.ymax=s,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:r},vectors:i}=this;let s,a;const o=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let A=0,x=0,b=r.length,_,M;A<b;A+=3,x+=2){const T=r[A]*2,L=r[A+1]*2,D=r[A+2]*2,P=e[T],O=e[T+1],F=e[L],U=e[L+1],B=e[D],z=e[D+1],H=F-P,X=U-O,W=B-P,J=z-O,ee=(H*J-X*W)*2;if(Math.abs(ee)<1e-9){if(s===void 0){s=a=0;for(const le of t)s+=e[le*2],a+=e[le*2+1];s/=t.length,a/=t.length}const ae=1e9*Math.sign((s-P)*J-(a-O)*W);_=(P+B)/2-ae*J,M=(O+z)/2+ae*W}else{const ae=1/ee,le=H*H+X*X,Z=W*W+J*J;_=P+(J*le-X*Z)*ae,M=O+(H*Z-W*le)*ae}o[x]=_,o[x+1]=M}let l=t[t.length-1],u,d=l*4,h,f=e[2*l],p,g=e[2*l+1];i.fill(0);for(let A=0;A<t.length;++A)l=t[A],u=d,h=f,p=g,d=l*4,f=e[2*l],g=e[2*l+1],i[u+2]=i[d]=p-g,i[u+3]=i[d+1]=f-h}render(e){const t=e==null?e=new pv:void 0,{delaunay:{halfedges:r,inedges:i,hull:s},circumcenters:a,vectors:o}=this;if(s.length<=1)return null;for(let d=0,h=r.length;d<h;++d){const f=r[d];if(f<d)continue;const p=Math.floor(d/3)*2,g=Math.floor(f/3)*2,A=a[p],x=a[p+1],b=a[g],_=a[g+1];this._renderSegment(A,x,b,_,e)}let l,u=s[s.length-1];for(let d=0;d<s.length;++d){l=u,u=s[d];const h=Math.floor(i[u]/3)*2,f=a[h],p=a[h+1],g=l*4,A=this._project(f,p,o[g+2],o[g+3]);A&&this._renderSegment(f,p,A[0],A[1],e)}return t&&t.value()}renderBounds(e){const t=e==null?e=new pv:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){const r=t==null?t=new pv:void 0,i=this._clip(e);if(i===null||!i.length)return;t.moveTo(i[0],i[1]);let s=i.length;for(;i[0]===i[s-2]&&i[1]===i[s-1]&&s>1;)s-=2;for(let a=2;a<s;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&t.lineTo(i[a],i[a+1]);return t.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let t=0,r=e.length/2;t<r;++t){const i=this.cellPolygon(t);i&&(i.index=t,yield i)}}cellPolygon(e){const t=new PF;return this.renderCell(e,t),t.value()}_renderSegment(e,t,r,i,s){let a;const o=this._regioncode(e,t),l=this._regioncode(r,i);o===0&&l===0?(s.moveTo(e,t),s.lineTo(r,i)):(a=this._clipSegment(e,t,r,i,o,l))&&(s.moveTo(a[0],a[1]),s.lineTo(a[2],a[3]))}contains(e,t,r){return t=+t,t!==t||(r=+r,r!==r)?!1:this.delaunay._step(e,t,r)===e}*neighbors(e){const t=this._clip(e);if(t)for(const r of this.delaunay.neighbors(e)){const i=this._clip(r);if(i){e:for(let s=0,a=t.length;s<a;s+=2)for(let o=0,l=i.length;o<l;o+=2)if(t[s]===i[o]&&t[s+1]===i[o+1]&&t[(s+2)%a]===i[(o+l-2)%l]&&t[(s+3)%a]===i[(o+l-1)%l]){yield r;break e}}}}_cell(e){const{circumcenters:t,delaunay:{inedges:r,halfedges:i,triangles:s}}=this,a=r[e];if(a===-1)return null;const o=[];let l=a;do{const u=Math.floor(l/3);if(o.push(t[u*2],t[u*2+1]),l=l%3===2?l-2:l+1,s[l]!==e)break;l=i[l]}while(l!==a&&l!==-1);return o}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const t=this._cell(e);if(t===null)return null;const{vectors:r}=this,i=e*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(e,t,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(e,t))}_clipFinite(e,t){const r=t.length;let i=null,s,a,o=t[r-2],l=t[r-1],u,d=this._regioncode(o,l),h,f=0;for(let p=0;p<r;p+=2)if(s=o,a=l,o=t[p],l=t[p+1],u=d,d=this._regioncode(o,l),u===0&&d===0)h=f,f=0,i?i.push(o,l):i=[o,l];else{let g,A,x,b,_;if(u===0){if((g=this._clipSegment(s,a,o,l,u,d))===null)continue;[A,x,b,_]=g}else{if((g=this._clipSegment(o,l,s,a,d,u))===null)continue;[b,_,A,x]=g,h=f,f=this._edgecode(A,x),h&&f&&this._edge(e,h,f,i,i.length),i?i.push(A,x):i=[A,x]}h=f,f=this._edgecode(b,_),h&&f&&this._edge(e,h,f,i,i.length),i?i.push(b,_):i=[b,_]}if(i)h=f,f=this._edgecode(i[0],i[1]),h&&f&&this._edge(e,h,f,i,i.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(e,t,r,i,s,a){const o=s<a;for(o&&([e,t,r,i,s,a]=[r,i,e,t,a,s]);;){if(s===0&&a===0)return o?[r,i,e,t]:[e,t,r,i];if(s&a)return null;let l,u,d=s||a;d&8?(l=e+(r-e)*(this.ymax-t)/(i-t),u=this.ymax):d&4?(l=e+(r-e)*(this.ymin-t)/(i-t),u=this.ymin):d&2?(u=t+(i-t)*(this.xmax-e)/(r-e),l=this.xmax):(u=t+(i-t)*(this.xmin-e)/(r-e),l=this.xmin),s?(e=l,t=u,s=this._regioncode(e,t)):(r=l,i=u,a=this._regioncode(r,i))}}_clipInfinite(e,t,r,i,s,a){let o=Array.from(t),l;if((l=this._project(o[0],o[1],r,i))&&o.unshift(l[0],l[1]),(l=this._project(o[o.length-2],o[o.length-1],s,a))&&o.push(l[0],l[1]),o=this._clipFinite(e,o))for(let u=0,d=o.length,h,f=this._edgecode(o[d-2],o[d-1]);u<d;u+=2)h=f,f=this._edgecode(o[u],o[u+1]),h&&f&&(u=this._edge(e,h,f,o,u),d=o.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return o}_edge(e,t,r,i,s){for(;t!==r;){let a,o;switch(t){case 5:t=4;continue;case 4:t=6,a=this.xmax,o=this.ymin;break;case 6:t=2;continue;case 2:t=10,a=this.xmax,o=this.ymax;break;case 10:t=8;continue;case 8:t=9,a=this.xmin,o=this.ymax;break;case 9:t=1;continue;case 1:t=5,a=this.xmin,o=this.ymin;break}(i[s]!==a||i[s+1]!==o)&&this.contains(e,a,o)&&(i.splice(s,0,a,o),s+=2)}return s}_project(e,t,r,i){let s=1/0,a,o,l;if(i<0){if(t<=this.ymin)return null;(a=(this.ymin-t)/i)<s&&(l=this.ymin,o=e+(s=a)*r)}else if(i>0){if(t>=this.ymax)return null;(a=(this.ymax-t)/i)<s&&(l=this.ymax,o=e+(s=a)*r)}if(r>0){if(e>=this.xmax)return null;(a=(this.xmax-e)/r)<s&&(o=this.xmax,l=t+(s=a)*i)}else if(r<0){if(e<=this.xmin)return null;(a=(this.xmin-e)/r)<s&&(o=this.xmin,l=t+(s=a)*i)}return[o,l]}_edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}_regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t<e.length;t+=2){const r=(t+2)%e.length,i=(t+4)%e.length;(e[t]===e[r]&&e[r]===e[i]||e[t+1]===e[r+1]&&e[r+1]===e[i+1])&&(e.splice(r,2),t-=2)}e.length||(e=null)}return e}}const zFe=2*Math.PI,T2=Math.pow;function GFe(n){return n[0]}function qFe(n){return n[1]}function $Fe(n){const{triangles:e,coords:t}=n;for(let r=0;r<e.length;r+=3){const i=2*e[r],s=2*e[r+1],a=2*e[r+2];if((t[a]-t[i])*(t[s+1]-t[i+1])-(t[s]-t[i])*(t[a+1]-t[i+1])>1e-10)return!1}return!0}function HFe(n,e,t){return[n+Math.sin(n+e)*t,e+Math.cos(n-e)*t]}class bz{static from(e,t=GFe,r=qFe,i){return new bz("length"in e?WFe(e,t,r,i):Float64Array.from(XFe(e,t,r,i)))}constructor(e){this._delaunator=new D5(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&$Fe(e)){this.collinear=Int32Array.from({length:t.length/2},(f,p)=>p).sort((f,p)=>t[2*f]-t[2*p]||t[2*f+1]-t[2*p+1]);const l=this.collinear[0],u=this.collinear[this.collinear.length-1],d=[t[2*l],t[2*l+1],t[2*u],t[2*u+1]],h=1e-8*Math.hypot(d[3]-d[1],d[2]-d[0]);for(let f=0,p=t.length/2;f<p;++f){const g=HFe(t[2*f],t[2*f+1],h);t[2*f]=g[0],t[2*f+1]=g[1]}this._delaunator=new D5(t)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,s=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let l=0,u=r.length;l<u;++l){const d=s[l%3===2?l-2:l+1];(r[l]===-1||a[d]===-1)&&(a[d]=l)}for(let l=0,u=i.length;l<u;++l)o[i[l]]=l;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new VFe(this,e)}*neighbors(e){const{inedges:t,hull:r,_hullIndex:i,halfedges:s,triangles:a,collinear:o}=this;if(o){const h=o.indexOf(e);h>0&&(yield o[h-1]),h<o.length-1&&(yield o[h+1]);return}const l=t[e];if(l===-1)return;let u=l,d=-1;do{if(yield d=a[u],u=u%3===2?u-2:u+1,a[u]!==e)return;if(u=s[u],u===-1){const h=r[(i[e]+1)%r.length];h!==d&&(yield h);return}}while(u!==l)}find(e,t,r=0){if(e=+e,e!==e||(t=+t,t!==t))return-1;const i=r;let s;for(;(s=this._step(r,e,t))>=0&&s!==r&&s!==i;)r=s;return s}_step(e,t,r){const{inedges:i,hull:s,_hullIndex:a,halfedges:o,triangles:l,points:u}=this;if(i[e]===-1||!u.length)return(e+1)%(u.length>>1);let d=e,h=T2(t-u[e*2],2)+T2(r-u[e*2+1],2);const f=i[e];let p=f;do{let g=l[p];const A=T2(t-u[g*2],2)+T2(r-u[g*2+1],2);if(A<h&&(h=A,d=g),p=p%3===2?p-2:p+1,l[p]!==e)break;if(p=o[p],p===-1){if(p=s[(a[e]+1)%s.length],p!==g&&T2(t-u[p*2],2)+T2(r-u[p*2+1],2)<h)return p;break}}while(p!==f);return d}render(e){const t=e==null?e=new pv:void 0,{points:r,halfedges:i,triangles:s}=this;for(let a=0,o=i.length;a<o;++a){const l=i[a];if(l<a)continue;const u=s[a]*2,d=s[l]*2;e.moveTo(r[u],r[u+1]),e.lineTo(r[d],r[d+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){t===void 0&&(!e||typeof e.moveTo!="function")&&(t=e,e=null),t=t==null?2:+t;const r=e==null?e=new pv:void 0,{points:i}=this;for(let s=0,a=i.length;s<a;s+=2){const o=i[s],l=i[s+1];e.moveTo(o+t,l),e.arc(o,l,t,0,zFe)}return r&&r.value()}renderHull(e){const t=e==null?e=new pv:void 0,{hull:r,points:i}=this,s=r[0]*2,a=r.length;e.moveTo(i[s],i[s+1]);for(let o=1;o<a;++o){const l=2*r[o];e.lineTo(i[l],i[l+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new PF;return this.renderHull(e),e.value()}renderTriangle(e,t){const r=t==null?t=new pv:void 0,{points:i,tri
4277angles:s}=this,a=s[e*=3]*2,o=s[e+1]*2,l=s[e+2]*2;return t.moveTo(i[a],i[a+1]),t.lineTo(i[o],i[o+1]),t.lineTo(i[l],i[l+1]),t.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,r=e.length/3;t<r;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new PF;return this.renderTriangle(e,t),t.value()}}function WFe(n,e,t,r){const i=n.length,s=new Float64Array(i*2);for(let a=0;a<i;++a){const o=n[a];s[a*2]=e.call(r,o,a,n),s[a*2+1]=t.call(r,o,a,n)}return s}function*XFe(n,e,t,r){let i=0;for(const s of n)yield e.call(r,s,i,n),yield t.call(r,s,i,n),++i}const wz=Math.PI,EZ=wz/2,CZ=180/wz,NZ=wz/180,YFe=Math.atan2,MZ=Math.cos,QFe=Math.max,KFe=Math.min,kZ=Math.sin,ZFe=Math.sign||function(n){return n>0?1:n<0?-1:0},Ede=Math.sqrt;function JFe(n){return n>1?EZ:n<-1?-EZ:Math.asin(n)}function Cde(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Ld(n,e){return[n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function vk(n,e){return[n[0]+e[0],n[1]+e[1],n[2]+e[2]]}function yk(n){var e=Ede(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);return[n[0]/e,n[1]/e,n[2]/e]}function _z(n){return[YFe(n[1],n[0])*CZ,JFe(QFe(-1,KFe(1,n[2])))*CZ]}function v0(n){const e=n[0]*NZ,t=n[1]*NZ,r=MZ(t);return[r*MZ(e),r*kZ(e),kZ(t)]}function Sz(n){return n=n.map(e=>v0(e)),Cde(n[0],Ld(n[2],n[1]))}function eUe(n){const e=nUe(n),t=iUe(e),r=rUe(t,n),i=aUe(t,n.length),s=tUe(i,n),a=sUe(t,n),{polygons:o,centers:l}=oUe(a,t,n),u=lUe(o),d=uUe(t,n),h=cUe(r,t);return{delaunay:e,edges:r,triangles:t,centers:l,neighbors:i,polygons:o,mesh:u,hull:d,urquhart:h,find:s}}function tUe(n,e){function t(r,i){let s=r[0]-i[0],a=r[1]-i[1],o=r[2]-i[2];return s*s+a*a+o*o}return function(i,s,a){a===void 0&&(a=0);let o,l,u=a;const d=v0([i,s]);do o=a,a=null,l=t(d,v0(e[o])),n[o].forEach(h=>{let f=t(d,v0(e[h]));if(f<l){l=f,a=h,u=h;return}});while(a!==null);return u}}function nUe(n){if(n.length<2)return{};let e=0;for(;isNaN(n[e][0]+n[e][1])&&e++<n.length;);const t=VDe(n[e]),r=yje().translate([0,0]).scale(1).rotate(t.invert([180,0]));n=n.map(r);const i=[];let s=1;for(let h=0,f=n.length;h<f;h++){let p=n[h][0]**2+n[h][1]**2;!isFinite(p)||p>1e32?i.push(h):p>s&&(s=p)}const a=1e6*Ede(s);i.forEach(h=>n[h]=[a,0]),n.push([0,a]),n.push([-a,0]),n.push([0,-a]);const o=bz.from(n);o.projection=r;const{triangles:l,halfedges:u,inedges:d}=o;for(let h=0,f=u.length;h<f;h++)if(u[h]<0){const p=h%3==2?h-2:h+1,g=h%3==0?h+2:h-1,A=u[p],x=u[g];u[A]=x,u[x]=A,u[p]=u[g]=-1,l[h]=l[p]=l[g]=e,d[l[A]]=A%3==0?A+2:A-1,d[l[x]]=x%3==0?x+2:x-1,h+=2-h%3}else l[h]>n.length-3-1&&(l[h]=e);return o}function rUe(n,e){const t=new Set;return e.length===2?[[0,1]]:(n.forEach(r=>{if(r[0]!==r[1]&&!(Sz(r.map(i=>e[i]))<0))for(let i=0,s;i<3;i++)s=(i+1)%3,t.add(zM([r[i],r[s]]).join("-"))}),Array.from(t,r=>r.split("-").map(Number)))}function iUe(n){const{triangles:e}=n;if(!e)return[];const t=[];for(let r=0,i=e.length/3;r<i;r++){const s=e[3*r],a=e[3*r+1],o=e[3*r+2];s!==a&&a!==o&&t.push([s,o,a])}return t}function sUe(n,e){return n.map(t=>{const r=t.map(s=>e[s]).map(v0),i=vk(vk(Ld(r[1],r[0]),Ld(r[2],r[1])),Ld(r[0],r[2]));return _z(yk(i))})}function aUe(n,e){const t=[];return n.forEach(r=>{for(let i=0;i<3;i++){const s=r[i],a=r[(i+1)%3];t[s]=t[s]||[],t[s].push(a)}}),n.length===0&&(e===2?(t[0]=[1],t[1]=[0]):e===1&&(t[0]=[])),t}function oUe(n,e,t){const r=[],i=n.slice();if(e.length===0){if(t.length<2)return{polygons:r,centers:i};if(t.length===2){const o=v0(t[0]),l=v0(t[1]),u=yk(vk(o,l)),d=yk(Ld(o,l)),h=Ld(u,d),f=[u,Ld(u,h),Ld(Ld(u,h),h),Ld(Ld(Ld(u,h),h),h)].map(_z).map(a);return r.push(f),r.push(f.slice().reverse()),{polygons:r,centers:i}}}e.forEach((o,l)=>{for(let u=0;u<3;u++){const d=o[u],h=o[(u+1)%3],f=o[(u+2)%3];r[d]=r[d]||[],r[d].push([h,f,l,[d,h,f]])}});const s=r.map(o=>{const l=[o[0][2]];let u=o[0][1];for(let d=1;d<o.length;d++)for(let h=0;h<o.length;h++)if(o[h][0]==u){u=o[h][1],l.push(o[h][2]);break}if(l.length>2)return l;if(l.length==2){const d=RZ(t[o[0][3][0]],t[o[0][3][1]],i[l[0]]),h=RZ(t[o[0][3][2]],t[o[0][3][0]],i[l[0]]),f=a(d),p=a(h);return[l[0],p,l[1],f]}});function a(o){let l=-1;return i.slice(e.length,1/0).forEach((u,d)=>{u[0]===o[0]&&u[1]===o[1]&&(l=d+e.length)}),l<0&&(l=i.length,i.push(o)),l}return{polygons:s,centers:i}}function RZ(n,e,t){n=v0(n),e=v0(e),t=v0(t);const r=ZFe(Cde(Ld(e,n),t));return _z(yk(vk(n,e)).map(i=>r*i))}function lUe(n){const e=[];
4277return n.forEach(t=>{if(!t)return;let r=t[t.length-1];for(let i of t)i>r&&e.push([r,i]),r=i}),e}function cUe(n,e){return function(t){const r=new Map,i=new Map;return n.forEach((s,a)=>{const o=s.join("-");r.set(o,t[a]),i.set(o,!0)}),e.forEach(s=>{let a=0,o=-1;for(let l=0;l<3;l++){let u=zM([s[l],s[(l+1)%3]]).join("-");r.get(u)>a&&(a=r.get(u),o=u)}i.set(o,!1)}),n.map(s=>i.get(s.join("-")))}}function uUe(n,e){const t=new Set,r=[];n.map(o=>{if(!(Sz(o.map(l=>e[l>e.length?0:l]))>1e-12))for(let l=0;l<3;l++){let u=[o[l],o[(l+1)%3]],d=`${u[0]}-${u[1]}`;t.has(d)?t.delete(d):t.add(`${u[1]}-${u[0]}`)}});const i=new Map;let s;if(t.forEach(o=>{o=o.split("-").map(Number),i.set(o[0],o[1]),s=o[0]}),s===void 0)return r;let a=s;do{r.push(a);let o=i.get(a);i.set(a,-1),a=o}while(a>-1&&a!==s);return r}function dUe(n){const e=function(t){if(e.delaunay=null,e._data=t,typeof e._data=="object"&&e._data.type==="FeatureCollection"&&(e._data=e._data.features),typeof e._data=="object"){const r=e._data.map(i=>[e._vx(i),e._vy(i),i]).filter(i=>isFinite(i[0]+i[1]));e.points=r.map(i=>[i[0],i[1]]),e.valid=r.map(i=>i[2]),e.delaunay=eUe(e.points)}return e};return e._vx=function(t){if(typeof t=="object"&&"type"in t)return VK(t)[0];if(0 in t)return t[0]},e._vy=function(t){if(typeof t=="object"&&"type"in t)return VK(t)[1];if(1 in t)return t[1]},e.x=function(t){return t?(e._vx=t,e):e._vx},e.y=function(t){return t?(e._vy=t,e):e._vy},e.polygons=function(t){if(t!==void 0&&e(t),!e.delaunay)return!1;const r={type:"FeatureCollection",features:[]};return e.valid.length===0||(e.delaunay.polygons.forEach((i,s)=>r.features.push({type:"Feature",geometry:i?{type:"Polygon",coordinates:[[...i,i[0]].map(a=>e.delaunay.centers[a])]}:null,properties:{site:e.valid[s],sitecoordinates:e.points[s],neighbours:e.delaunay.neighbors[s]}})),e.valid.length===1&&r.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:e.valid[0],sitecoordinates:e.points[0],neighbours:[]}})),r},e.triangles=function(t){return t!==void 0&&e(t),e.delaunay?{type:"FeatureCollection",features:e.delaunay.triangles.map((r,i)=>(r=r.map(s=>e.points[s]),r.center=e.delaunay.centers[i],r)).filter(r=>Sz(r)>0).map(r=>({type:"Feature",properties:{circumcenter:r.center},geometry:{type:"Polygon",coordinates:[[...r,r[0]]]}}))}:!1},e.links=function(t){if(t!==void 0&&e(t),!e.delaunay)return!1;const r=e.delaunay.edges.map(s=>M1(e.points[s[0]],e.points[s[1]])),i=e.delaunay.urquhart(r);return{type:"FeatureCollection",features:e.delaunay.edges.map((s,a)=>({type:"Feature",properties:{source:e.valid[s[0]],target:e.valid[s[1]],length:r[a],urquhart:!!i[a]},geometry:{type:"LineString",coordinates:[e.points[s[0]],e.points[s[1]]]}}))}},e.mesh=function(t){return t!==void 0&&e(t),e.delaunay?{type:"MultiLineString",coordinates:e.delaunay.edges.map(r=>[e.points[r[0]],e.points[r[1]]])}:!1},e.cellMesh=function(t){if(t!==void 0&&e(t),!e.delaunay)return!1;const{centers:r,polygons:i}=e.delaunay,s=[];for(const a of i)if(a)for(let o=a.length,l=a[o-1],u=a[0],d=0;d<o;l=u,u=a[++d])u>l&&s.push([r[l],r[u]]);return{type:"MultiLineString",coordinates:s}},e._found=void 0,e.find=function(t,r,i){if(e._found=e.delaunay.find(t,r,e._found),!i||M1([t,r],e.points[e._found])<i)return e._found},e.hull=function(t){t!==void 0&&e(t);const r=e.delaunay.hull,i=e.points;return r.length===0?null:{type:"Polygon",coordinates:[[...r.map(s=>i[s]),i[r[0]]]]}},n?e(n):e}function LF(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function hUe(n){if(Array.isArray(n))return n}function fUe(n){if(Array.isArray(n))return LF(n)}function pUe(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function mUe(n,e,t){return e=bk(e),_Ue(n,Nde()?Reflect.construct(e,[],bk(n).constructor):e.apply(n,t))}function gUe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function AUe(n,e,t){return Object.defineProperty(n,"prototype",{writable:!1}),n}function bk(n){return bk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bk(n)}function xUe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&OF(n,e)}function Nde(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Nde=function(){return!!n})()}function vUe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function yUe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}
4277finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function bUe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4278In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wUe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4279In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Ue(n,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pUe(n)}function OF(n,e){return OF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},OF(n,e)}function Qp(n,e){return hUe(n)||yUe(n,e)||Mde(n,e)||bUe()}function cL(n){return fUe(n)||vUe(n)||Mde(n)||wUe()}function Mde(n,e){if(n){if(typeof n=="string")return LF(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?LF(n,e):void 0}}function SUe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.resolution,r=t===void 0?1/0:t,i=TUe(n,r),s=E5(i),a=EUe(n,r),o=[].concat(cL(s),cL(a)),l={type:"Polygon",coordinates:n},u=Yue(l),d=Qp(u,2),h=Qp(d[0],2),f=h[0],p=h[1],g=Qp(d[1],2),A=g[0],x=g[1],b=f>A||x>=89||p<=-89,_=[];if(b){var M=dUe(o).triangles(),T=new Map(o.map(function(ee,ae){var le=Qp(ee,2),Z=le[0],Y=le[1];return["".concat(Z,"-").concat(Y),ae]}));M.features.forEach(function(ee){var ae,le=ee.geometry.coordinates[0].slice(0,3).reverse(),Z=[];if(le.forEach(function(re){var _e=Qp(re,2),Ee=_e[0],Ae=_e[1],te="".concat(Ee,"-").concat(Ae);T.has(te)&&Z.push(T.get(te))}),Z.length===3){if(Z.some(function(re){return re<s.length})){var Y=ee.properties.circumcenter;if(!DF(Y,l,b))return}(ae=_).push.apply(ae,Z)}})}else if(a.length)for(var F=D5.from(o),U=function(ae){var le,Z=[2,1,0].map(function(_e){return F.triangles[ae+_e]}),Y=Z.map(function(_e){return o[_e]});if(Z.some(function(_e){return _e<s.length})){var re=[0,1].map(function(_e){return OOe(Y,function(Ee){return Ee[_e]})});if(!DF(re,l,b))return 1}(le=_).push.apply(le,cL(Z))},B=0,z=F.triangles.length;B<z;B+=3)U(B);else{var L=mk(i),D=L.vertices,P=L.holes,O=P===void 0?[]:P;_=qje(D,O,2)}var H=tg(zM(o,function(ee){return ee[0]}),[0,1]),X=tg(zM(o,function(ee){return ee[1]}),[0,1]),W=o.map(function(ee){var ae=Qp(ee,2),le=ae[0],Z=ae[1];return[H(le),X(Z)]}),J={points:o,indices:_,uvs:W};return{contour:i,triangles:J}}function TUe(n,e){return n.map(function(t){var r=[],i;return t.forEach(function(s){if(i){var a=M1(s,i)*180/Math.PI;if(a>e)for(var o=mz(i,s),l=1/Math.ceil(a/e),u=l;u<1;)r.push(o(u)),u+=l}r.push(i=s)}),r})}function EUe(n,e){var t={type:"Polygon",coordinates:n},r=Yue(t),i=Qp(r,2),s=Qp(i[0],2),a=s[0],o=s[1],l=Qp(i[1],2),u=l[0],d=l[1];if(Math.min(Math.abs(u-a),Math.abs(d-o))<e)return[];var h=a>u||d>=89||o<=-89;return CUe(e,{minLng:a,maxLng:u,minLat:o,maxLat:d}).filter(function(f){return DF(f,t,h)})}function CUe(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.minLng,r=e.maxLng,i=e.minLat,s=e.maxLat,a=Math.round(Math.pow(360/n,2)/Math.PI),o=(1+Math.sqrt(5))/2,l=function(b){return b/o*360%360-180},u=function(b){return Math.acos(2*b/a-1)/Math.PI*180-90},d=function(b){return a*(Math.cos((b+90)*Math.PI/180)+1)/2},h=[s!==void 0?Math.ceil(d(s)):0,i!==void 0?Math.floor(d(i)):a-1],f=t===void 0&&r===void 0?function(){return!0}:t===void 0?function(x){return x<=r}:r===void 0?function(x){return x>=t}:r>=t?function(x){return x>=t&&x<=r}:function(x){return x>=t||x<=r},p=[],g=h[0];g<=h[1];g++){var A=l(g);f(A)&&p.push([A,u(g)])}return p}function DF(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return t?ije(e,n):BFe(n,e)}var w6=window.THREE?window.THREE:{BufferGeometry:ds,Float32BufferAttribute:Bi},PZ=new w6.BufferGeometry().setAttribute?"setAttribute":"addAttribute",Tz=(function(n){function e(t,r,i,s,a,o,l){var u;gUe(this,e),u=mUe(this,e),u.type="ConicPolygonGeometry",u.parameters={polygonGeoJson:t,bottomHeight:r,topHeight:i,closedBottom:s,closedTop:a,includeSides:o,curvatureResolution:l},r=r||0,i=i||1,s=s!==void 0?s:!0,a=a!==void 0?a:!0,o=o!==void 0?o:!0,l=l||5;var d=SUe(t,{resolution:l}),h=d.contour,f=d.triangles,p=E5(f.uvs),g=[],A=[],x=[],b=0,_=function(P){var O=Math.round(g.length/3),F=x.length;
4279g=g.concat(P.vertices),A=A.concat(P.uvs),x=x.concat(O?P.indices.map(function(U){return U+O}):P.indices),u.addGroup(F,x.length-F,b++)};o&&_(T()),s&&_(L(r,!1)),a&&_(L(i,!0)),u.setIndex(x),u[PZ]("position",new w6.Float32BufferAttribute(g,3)),u[PZ]("uv",new w6.Float32BufferAttribute(A,2)),u.computeVertexNormals();function M(D,P){var O=typeof P=="function"?P:function(){return P},F=D.map(function(U){return U.map(function(B){var z=Qp(B,2),H=z[0],X=z[1];return NUe(X,H,O(H,X))})});return mk(F)}function T(){for(var D=M(h,r),P=D.vertices,O=D.holes,F=M(h,i),U=F.vertices,B=E5([U,P]),z=Math.round(U.length/3),H=new Set(O),X=0,W=[],J=0;J<z;J++){var ee=J+1;if(ee===z)ee=X;else if(H.has(ee)){var ae=ee;ee=X,X=ae}W.push(J,J+z,ee+z),W.push(ee+z,ee,J)}for(var le=[],Z=1;Z>=0;Z--)for(var Y=0;Y<z;Y+=1)le.push(Y/(z-1),Z);return{indices:W,vertices:B,uvs:le}}function L(D){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{indices:P?f.indices:f.indices.slice().reverse(),vertices:M([f.points],D).vertices,uvs:p}}return u}return xUe(e,n),AUe(e)})(w6.BufferGeometry);function NUe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=(90-n)*Math.PI/180,i=(90-e)*Math.PI/180;return[t*Math.sin(r)*Math.cos(i),t*Math.cos(r),t*Math.sin(r)*Math.sin(i)]}function jF(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function MUe(n){if(Array.isArray(n))return n}function kUe(n){if(Array.isArray(n))return jF(n)}function RUe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function PUe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function LUe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4280In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OUe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4281In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DUe(n,e){if(n==null)return{};var t,r,i=jUe(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.includes(t)||{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function jUe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.includes(r))continue;t[r]=n[r]}return t}function IUe(n,e){return MUe(n)||PUe(n,e)||kde(n,e)||LUe()}function FUe(n){return kUe(n)||RUe(n)||kde(n)||OUe()}function UUe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function BUe(n){var e=UUe(n,"string");return typeof e=="symbol"?e:e+""}function kde(n,e){if(n){if(typeof n=="string")return jF(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?jF(n,e):void 0}}var VUe=(function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=(e instanceof Array?e.length?e:[void 0]:[e]).map(function(o){return{keyAccessor:o,isProp:!(o instanceof Function)}}),s=n.reduce(function(o,l){var u=o,d=l;return i.forEach(function(h,f){var p=h.keyAccessor,g=h.isProp,A;if(g){var x=d,b=x[p],_=DUe(x,[p].map(BUe));A=b,d=_}else A=p(d,f);f+1<i.length?(u.hasOwnProperty(A)||(u[A]={}),u=u[A]):t?(u.hasOwnProperty(A)||(u[A]=[]),u[A].push(d)):u[A]=d}),o},{});t instanceof Function&&(function o(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;u===i.length?Object.keys(l).forEach(function(d){return l[d]=t(l[d])}):Object.values(l).forEach(function(d){return o(d,u+1)})})(s);var a=s;return r&&(a=[],(function o(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];u.length===i.length?a.push({keys:u,vals:l}):Object.entries(l).forEach(function(d){var h=IUe(d,2),f=h[0],p=h[1];return o(p,[].concat(FUe(u),[f]))})})(s),e instanceof Array&&e.length===0&&a.length===1&&(a[0].keys=[])),a}),Ui=(function(n){n=n||{};var e=typeof n<"u"?n:{},t={},r;for(r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);var i="";function s(xe){return e.locateFile?e.locateFile(xe,i):i+xe}var a;typeof document<"u"&&document.currentScript&&(i=document.currentScript.src),i.indexOf("blob:")!==0?i=i.substr(0,i.lastIndexOf("/")+1):i="",a=function(Oe,Ge,$e){var m=new XMLHttpRequest;m.open("GET",Oe,!0),m.responseType="arraybuffer",m.onload=function(){if(m.status==200||m.status==0&&m.response){Ge(m.response);return}var en=Ft(Oe);
4281if(en){Ge(en.buffer);return}$e()},m.onerror=$e,m.send(null)};var o=e.print||console.log.bind(console),l=e.printErr||console.warn.bind(console);for(r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);t=null,e.arguments&&e.arguments;var u=0,d=function(xe){u=xe},h=function(){return u},f=8;function p(xe,Oe,Ge,$e){switch(Ge=Ge||"i8",Ge.charAt(Ge.length-1)==="*"&&(Ge="i32"),Ge){case"i1":z[xe>>0]=Oe;break;case"i8":z[xe>>0]=Oe;break;case"i16":X[xe>>1]=Oe;break;case"i32":W[xe>>2]=Oe;break;case"i64":pt=[Oe>>>0,(qe=Oe,+bt(qe)>=1?qe>0?(kt(+St(qe/4294967296),4294967295)|0)>>>0:~~+dt((qe-+(~~qe>>>0))/4294967296)>>>0:0)],W[xe>>2]=pt[0],W[xe+4>>2]=pt[1];break;case"float":J[xe>>2]=Oe;break;case"double":ee[xe>>3]=Oe;break;default:Fn("invalid type for setValue: "+Ge)}}function g(xe,Oe,Ge){switch(Oe=Oe||"i8",Oe.charAt(Oe.length-1)==="*"&&(Oe="i32"),Oe){case"i1":return z[xe>>0];case"i8":return z[xe>>0];case"i16":return X[xe>>1];case"i32":return W[xe>>2];case"i64":return W[xe>>2];case"float":return J[xe>>2];case"double":return ee[xe>>3];default:Fn("invalid type for getValue: "+Oe)}return null}var A=!1;function x(xe,Oe){xe||Fn("Assertion failed: "+Oe)}function b(xe){var Oe=e["_"+xe];return x(Oe,"Cannot call unknown function "+xe+", make sure it is exported"),Oe}function _(xe,Oe,Ge,$e,m){var be={string:function(zn){var Un=0;if(zn!=null&&zn!==0){var _n=(zn.length<<2)+1;Un=Tn(_n),O(zn,Un,_n)}return Un},array:function(zn){var Un=Tn(zn.length);return F(zn,Un),Un}};function en(zn){return Oe==="string"?D(zn):Oe==="boolean"?!!zn:zn}var on=b(xe),tn=[],Qt=0;if($e)for(var Pt=0;Pt<$e.length;Pt++){var bn=be[Ge[Pt]];bn?(Qt===0&&(Qt=Kt()),tn[Pt]=bn($e[Pt])):tn[Pt]=$e[Pt]}var wn=on.apply(null,tn);return wn=en(wn),Qt!==0&&nt(Qt),wn}function M(xe,Oe,Ge,$e){Ge=Ge||[];var m=Ge.every(function(en){return en==="number"}),be=Oe!=="string";return be&&m&&!$e?b(xe):function(){return _(xe,Oe,Ge,arguments)}}var T=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function L(xe,Oe,Ge){for(var $e=Oe+Ge,m=Oe;xe[m]&&!(m>=$e);)++m;if(m-Oe>16&&xe.subarray&&T)return T.decode(xe.subarray(Oe,m));for(var be="";Oe<m;){var en=xe[Oe++];if(!(en&128)){be+=String.fromCharCode(en);continue}var on=xe[Oe++]&63;if((en&224)==192){be+=String.fromCharCode((en&31)<<6|on);continue}var tn=xe[Oe++]&63;if((en&240)==224?en=(en&15)<<12|on<<6|tn:en=(en&7)<<18|on<<12|tn<<6|xe[Oe++]&63,en<65536)be+=String.fromCharCode(en);else{var Qt=en-65536;be+=String.fromCharCode(55296|Qt>>10,56320|Qt&1023)}}return be}function D(xe,Oe){return xe?L(H,xe,Oe):""}function P(xe,Oe,Ge,$e){if(!($e>0))return 0;for(var m=Ge,be=Ge+$e-1,en=0;en<xe.length;++en){var on=xe.charCodeAt(en);if(on>=55296&&on<=57343){var tn=xe.charCodeAt(++en);on=65536+((on&1023)<<10)|tn&1023}if(on<=127){if(Ge>=be)break;Oe[Ge++]=on}else if(on<=2047){if(Ge+1>=be)break;Oe[Ge++]=192|on>>6,Oe[Ge++]=128|on&63}else if(on<=65535){if(Ge+2>=be)break;Oe[Ge++]=224|on>>12,Oe[Ge++]=128|on>>6&63,Oe[Ge++]=128|on&63}else{if(Ge+3>=be)break;Oe[Ge++]=240|on>>18,Oe[Ge++]=128|on>>12&63,Oe[Ge++]=128|on>>6&63,Oe[Ge++]=128|on&63}}return Oe[Ge]=0,Ge-m}function O(xe,Oe,Ge){return P(xe,H,Oe,Ge)}typeof TextDecoder<"u"&&new TextDecoder("utf-16le");function F(xe,Oe){z.set(xe,Oe)}function U(xe,Oe){return xe%Oe>0&&(xe+=Oe-xe%Oe),xe}var B,z,H,X,W,J,ee;function ae(xe){B=xe,e.HEAP8=z=new Int8Array(xe),e.HEAP16=X=new Int16Array(xe),e.HEAP32=W=new Int32Array(xe),e.HEAPU8=H=new Uint8Array(xe),e.HEAPU16=new Uint16Array(xe),e.HEAPU32=new Uint32Array(xe),e.HEAPF32=J=new Float32Array(xe),e.HEAPF64=ee=new Float64Array(xe)}var le=5271296,Z=28384,Y=e.TOTAL_MEMORY||33554432;e.buffer?B=e.buffer:B=new ArrayBuffer(Y),Y=B.byteLength,ae(B),W[Z>>2]=le;function re(xe){for(;xe.length>0;){var Oe=xe.shift();if(typeof Oe=="function"){Oe();continue}var Ge=Oe.func;typeof Ge=="number"?Oe.arg===void 0?e.dynCall_v(Ge):e.dynCall_vi(Ge,Oe.arg):Ge(Oe.arg===void 0?null:Oe.arg)}}var _e=[],Ee=[],Ae=[],te=[];function ve(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)yt(e.preRun.shift());re(_e)}function we(){re(Ee)}function Ue(){re(Ae)}function ze(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)mt(e.postRun.shift());re(te)}function yt(xe){_e.unshift(xe)}function mt(xe){te.unshift(xe)}var bt=Math.abs,dt=Math.ceil,St=Math.floor,kt=Math.min,Fe=0,Ze=null;function Ye(xe){Fe++,e.monitorRunDependencies&&e.monitorRunDependencies(Fe)}function ft(xe){if(Fe--,e.monitorRunDependencies&&e.monitorRunDependencies(Fe),Fe==0&&Ze){var Oe=Ze;Ze=null,Oe()}}e.preloadedImages={},e.preloadedAudios={};var At=null,Ce="data:application/octet-stream;base64,";function Se(xe){return String.prototype.startsWith?xe.startsWith(Ce):xe.indexOf(Ce)===0}var qe,pt;At
vendor: 27,817 bytes, line 4281
4281="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+T8AAAAAAAAAABgtRFT7IQlAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPshCUAAAAAAAAAAABgtRFT7Ifm/GC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgtRFT7Ifm/GC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAABgtRFT7IQnAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPshCcAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAMpi5RexJsw/BlIKPVwR5T95Wyu0/QjnP5PjoT7YYcu/mBhKZ6zrwj8wRYS7NebuP3qW6geh+Ls/SLrixebL3r+pcyymN9XrPwmkNHp7xec/GWNMZVAA17+82s+x2BLiPwn2ytbJ9ek/LgEH1sMS1j8yp/2LhTfeP+SnWwtQBbu/d38gkp5X7z8ytsuHaADGPzUYObdf1+m/7IauECWhwz+cjSACjzniP76Z+wUhN9K/1+GEKzup67+/GYr/04baPw6idWOvsuc/ZedTWsRa5b/EJQOuRzi0v/OncYhHPes/h49PixY53j+i8wWfC03Nvw2idWOvsue/ZedTWsRa5T/EJQOuRzi0P/KncYhHPeu/iY9PixY53r+i8wWfC03NP9anWwtQBbs/d38gkp5X778ytsuHaADGvzUYObdf1+k/74auECWhw7+cjSACjzniv8CZ+wUhN9I/1uGEKzup6z+/GYr/04bavwmkNHp7xee/F2NMZVAA1z+82s+x2BLivwr2ytbJ9em/KwEH1sMS1r8yp/2LhTfev81i5RexJsy/BlIKPVwR5b95Wyu0/Qjnv5DjoT7YYcs/nBhKZ6zrwr8wRYS7Nebuv3OW6geh+Lu/SLrixebL3j+pcyymN9Xrv8rHIFfWehZAMBwUdlo0DECTUc17EOb2PxpVB1SWChdAzjbhb9pTDUDQhmdvECX5P9FlMKCC9+g/IIAzjELgE0DajDngMv8GQFhWDmDPjNs/y1guLh96EkAxPi8k7DIEQJCc4URlhRhA3eLKKLwkEECqpNAyTBD/P6xpjXcDiwVAFtl//cQm4z+Ibt3XKiYTQM7mCLUb3QdAoM1t8yVv7D8aLZv2Nk8UQEAJPV5nQwxAtSsfTCoE9z9TPjXLXIIWQBVanC5W9AtAYM3d7Adm9j++5mQz1FoWQBUThyaVBghAwH5muQsV7T89Q1qv82MUQJoWGOfNuBdAzrkClkmwDkDQjKq77t37Py+g0dtitsE/ZwAMTwVPEUBojepluNwBQGYbtuW+t9w/HNWIJs6MEkDTNuQUSlgEQKxktPP5TcQ/ixbLB8JjEUCwuWjXMQYCQAS/R09FkRdAowpiZjhhDkB7LmlczD/7P01iQmhhsAVAnrtTwDy84z/Z6jfQ2TgTQChOCXMnWwpAhrW3daoz8z/HYJvVPI4VQLT3ik5FcA5Angi7LOZd+z+NNVzDy5gXQBXdvVTFUA1AYNMgOeYe+T8+qHXGCwkXQKQTOKwa5AJA8gFVoEMW0T+FwzJyttIRQAEAAAD/////BwAAAP////8xAAAA/////1cBAAD/////YQkAAP////+nQQAA/////5HLAQD/////95AMAP/////B9lcAAAAAAAAAAAAAAAAAAgAAAP////8OAAAA/////2IAAAD/////rgIAAP/////CEgAA/////06DAAD/////IpcDAP/////uIRkA/////4LtrwAAAAAAAAAAAAAAAAAAAAAAAgAAAP//////////AQAAAAMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////wIAAAD//////////wEAAAAAAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA/////////////////////wEAAAD///////////////8CAAAA////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD///////////////////////////////8CAAAA////////////////AQAAAP////////////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAAAQAAAP//////////AgAAAP//////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAAEAAAD//////////wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAAAAAAAAACAAAAAQAAAAEAAAACAAAAAgAAAAAAAAAFAAAABQAAAAAAAAACAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAAAAAAUAAAAGAAAAAAAAAAIAAAACAAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAEAAAADAAAAAgAAAAIAAAAAAAAABQAAAAcAAAAAAAAAAgAAAAIAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAACAAAAAQAAAAQAAAACAAAAAgAAAAAAAAAFAAAACAAAAAAAAAACAAAAAgAAAAMAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAJAAAAAAAAAAIAAAACAAAAAwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAIAAAACAAAAAAAAAAMAAAAOAAAAAgAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAgAAAAIAAAADAAAABgAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAgAAAAIAAAAAAAAAAwAAAAoAAAACAAAAAAAAAAIAAAADAAAAAQAAAAAAAAACAAAAAgAAAAMAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAgAAAAAAAAADAAAACwAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAIAAAACAAAAAwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAACAAAAAAAAAAMAAAAMAAAAAgAAAAAAAAACAAAAAwAAAAMAAAAAAAAAAgAAAAIAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAIAAAAAAAAAAwAAAA0AAAACAAAAAAAAAAIAAAADAAAABAAAAAAAAAACAAAAAgAAAAMAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAgAAAAAAAAADAAAABgAAAAIAAAAAAAAAAgAAAAMAAAAPAAAAAAAAAAIAAAACAAAAAwAAAAsAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAAAAAACAAAAAwAAABAAAAAAAAAAAgAAAAIAAAADAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAIAAAAAAAAAAwAAAAgAAAACAAAAAAAAAAIAAAADAAAAEQAAAAAAAAACAAAAAgAAAAMAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAAgAAAAAAAAADAAAACQAAAAIAAAAAAAAAAgAAAAMAAAASAAAAAAAAAAIAAAACAAAAAwAAAA4AAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAACAAAAAAAAAAMAAAAFAAAAAgAAAAAAAAACAAAAAwAAABMAAAAAAAAAAgAAAAIAAAADAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAAAAAAACAAAAAQAAABMAAAACAAAAAgAAAAAAAAAFAAAACgAAAAAAAAACAAAAAgAAAAMAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABEAAAACAAAAAAAAAAIAAAABAAAADwAAAAIAAAACAAAAAAAAAAUAAAALAAAAAAAAAAIAAAACAAAAAwAAABEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAIAAAAAAAAAAgAAAAEAAAAQAAAAAgAAAAIAAAAAAAAABQAAAAwAAAAAAAAAAgAAAAIAAAADAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAACAAAAAQAAABEAAAACAAAAAgAAAAAAAAAFAAAADQAAAAAAAAACAAAAAgAAAAMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAACAAAAAAAAAAIAAAABAAAAEgAAAAIAAAACAAAAAAAAAAUAAAAOAAAAAAAAAAIAAAACAAAAAwAAAAIAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAABAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23
vendor: 9,112 bytes, line 4281
4281VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP6phvycGBZRAJbod0OgwfkCp+L8jatBmQCjl3pGrPlFAfMWm114SOkButwtqS7UjQHQwbcjXyw1A8jnLuuyA9j9KwjL0VwHhPyotk0lcs8k/Q5PvEs9rsz+SfsOQEVqdPzUAKDojLoY/WJz/kcjCcD8YFu070FRZPyoLC2BdJEM/YOXQAuiMM0HIBz1bw3sdQdV46aaHRwZByatzjDPX8EDb3Jie8HXZQCJxj6ULP8NAUaG6uRAZrUCWdmou5/mVQLb9huRPm4BAhvoCHygZaUCuX/I3SPdSQC9/bC/1qTxAfKxsYQ6pJUCuslH+N14QQMS/cv7SvPg/Ol8maYKx4j8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAKriWFiWZfg/Y2nmTbY/8z8MHSPSqmnjv6hnn18HR3c/quJYWJZl+D/jq5TzDdzyPwwdI9KqaeO/u0kC1eFSBECq4lhYlmX4P69pJmt7c/E/NnkJi6jSBsDESFlzKkr6P33ArMz7sfY/o2q2uqM08D+oZ59fB0d3PzEqCi3qrvK/kmm4ANp49D+4wS2wzhzvP9WJvyAnx+E/upcY75RVx7+95t+9y0T1P9L18g1caO0/k6CkRyVzAEBf99+e/GjxP6QMsuuLQ/U/PlP4Qr8q7j8Mb/GO2GMCwLl2K/DQIghAePiwytEp9D9UHrsuI/nqPzjMedJ+yuy/k6xgf58n/L+XoQtn22DzP2lzCnsYk+s/JhUSDI4P8z+8lFcBhgTcPxOqKRxEX/M/89MEdoPQ6j8OKQaXDob7vzWwNvblgAPAzGkxMcl88j9Nm4okPkbpP0vI89vxSgRAdac2Z6W2/T+6UFOMC3zyP/+2XEF3hug/QqhELwGKCMAwdlQerEoEQFcr/B+VnvE/hB1hfFzT5j8wdsE/Da64P0hIvnF/sOC/KH/hrXUg8T9bI5OQHaLlP+mYzla7td6/CtKG6iOm8b8FW3TV8oXwP8ORhtNuJ+c/q8JrTMz/AcC8PaUl+PUFwAXv9rkMT/A/m+sAswr15D+7hk/O3yvkP6c/yVsOHKI/qqAX9idJ8D/8hNz1KNPiP7xSXh3Ggvg/epbkiKr57T/23/LB1GLvP4GTTeNZi+M/W4TqlTheBcDupZgIdYUIQGwlcW3YZO8/tQvDXQ3H4j8Bt+sf9DkAQMdFie+nNvg/Z5Uh1wDX7j9h5X2d4KjhPxMJ1ZVT4Pa/evqB8xB//7+W183U9QLsPwzNxsC7AOA/af/LqCnK/r/lPceQ0FQDwHoY0nYIW+w/bHNSHrTg4D/DFcMAdabuv2sz5Ojhnve/FvLf01HN6z/tEDL2Hz/gP0bBv0KUhPA/pd7sEnMc4D8EGon4Lo7sP5NVbYtSON8/DAMC50odBkB+Z2J8MGYCQIhlM1gubOo/FssiPwWy4D8OIlGqRnkCQAd1vopp6f4/QS1keLLK6T9rfoBuT7LZP3KQbH5ugwjAjqVPXTmbBUBL/JxcqR3qP3oSeovuktg/Y6pRhJmqy7+0kwuU0Yjmv2wvsfFmQ+g/R98lJFqQ2T/IGb5gjLkCwK3mNff3kQbAqDznPFM86T+iiP0FfsvYP7fzKG6Mls0/h7+at2btzL8tsUTgk+LmP/YEIrTDINU/WmwKoVjA5L9aC02r6FHxvzzFCT/Qg+Y/nx0V97en0j8+1toJOm77P1kZ7h8KjfQ/GBbbqxgk5j9RGXM79G/SP+beHsWmweQ/9REi4eX0xD/V9s+kmMHkP+pb9yNs09A/c5ERjVDTAECqEr3OBCH7P14ILfMECOU/piRx4P8P0j+JYU//bfL0Pw62fw28B+w/l5YW2Ga45D9+CyKRbenOP5cH6fHy1/S/o/egk03++r91nTYRL/bjP3fHN6OJVdA/7xXQh1XLBcAB3g6tBdUIQKW2KnGYjeQ/SqIpagclyz8F9P3YgNL6v9H6NBsZ8QDAW2k5L5Qs4z/0axa1l6zLP1GE65Mu4wNAwfX+BYmWAEBBgJP90M3hP6/03qhPLdA/zqo5bJz2778/ESlPCTn1v7JkhGyvzuE/DM7sj5twwz/6xbXLavYGQH29RFRGkgNA7bOXVSJ54T9fEhTHO/TDP+8t+HMOiwDAxa0SbGTtA8Atii7y0mLgP4cecHFB3sM/uPUpyv+K7j8nktD1/WvhP2cWmi772d8/Fj7uU9kEvD8oKOESLzKmvwSdCqrHdNu/XCluGsvI3T929OW5md+uP9dP6rXcZNq/gXM+ggzL6b+eKjsPgJncP6i1e9aVu7E/2CnPNJyD1D/DnyGgSe+xvy8k7g9bp9s/nYmLvHn1sz9cFOwApH8IwGa6Mjy9cgZAJr95SiSW2z8rCkhOFvqdP3SIKmO/UwPAEy0zkN7bBsCds8Hg/13YP1zv413hVGi/FVtqixSn6L9XAPQGul3yv7SGu2BoCNk/n94bv7Maj79p13T6X9z3P45MPCW3WvI/rU/8/LRj1T9cgR6SXd+ZPymL2DstbPI/8s/pAkIz6z/fmoB+8efYPz2XyfWgYaa/6wys72AW/j8LZImhgrf3P729Zla/n9U/ySB8B3PBqL8O2nhevvbxv17+5A+n6fe/YrGIqEGB1T+wCEGbkhaxv989QHVE5wFAzd12PTu3/T9AHUPZY2DUP3SQDST0zq2/JCxAlIoj5T+Mhe1IJkrQP/cRpl8QhtU/amc4seFts79khiUSVaz3vxYfWtjPwf2/CHscxQqD0j/ctUBQ9my3v0POnFiyXv2/pjjn2Ju/AcDk45DwBhPRP/GjwlCrv7m/aT2ciwolBsAQOzHr/wUJQCzpq5UYvtI/gDCf3SlCwb+4i7S+mukEQBDA1f8mowFA2utnRN3KyT9T+9EYAVG6v9/IVZ0enrE/7NbRtdGfzr/8y8GpRz7LP3U0vTSk18e/JzHEcwiBB0AGm8Q7AJkEQNLciyt4Esk/gLou5zoQxr+RrOfM91oBwEzd36KybgTAgLou5zoQxj/S3IsreBLJv1gCch0OHO8/FD+RxSLN4j91NL00pNfHP/zLwalHPsu/nL7/By4Pyr8tSP5h7CPiv1P70RgBUbo/2utnRN3Kyb/KfllfCpUIwLkP5zj+NwdAgDCf3SlCwT8s6auVGL7Sv2aFPlaC4eC/XrS5UVH77b/xo8JQq7+5P+TjkPAGE9G/Q30/RYbn1z8FF/ISafuLv9y1QFD2bLc/CHscxQqD0r/fi+tPROX0P6vRc+19ie0/amc4seFtsz/3EaZfEIbVv77TYpahl/o/DDsu0CaC9D90kA0k9M6tP0AdQ9ljYNS/CCI0rxjZA8BgfCaLthgHwLAIQZuSFrE/YrGIqEGB1b8kvQ982+rsv4J8EWu7jPS/ySB8B3PBqD+9vWZWv5/VvwrAByWcJgBAxFujmE9a+j89l8n1oGGmP9+agH7x59i/N03cuJUt9L8X9v4GdIz6v1yBHpJd35m/rU/8/LRj1b8mz69sydf/vyu5idMqVQLAn94bv7Majz8AhrtgaAjZv+aCE66WZ/q/lA1Mgz/p/79c7+Nd4VRoP52zweD/Xdi/TJZpMTb4AkDLWZShPOb/PysKSE4W+p2/Jr95SiSW27/PkmbE7zjnP6UAiCDmMNI/nYmLvHn1s78vJO4PW6fbv5MWA2vqSrQ/V5WLwPB51b+otXvWlbuxv54qOw+Amdy/1keqzYeRBsApIEMHgZIIQHb05bmZ366/XCluGsvI3b8W44a9X9UFQEeQtDM4rwJAFj7uU9kEvL9nFpou+9nfv3Co+JcyyQhAcdkCX2KzBUCHHnBxQd7Dvy2KLvLSYuC/o6+5YTt/AcCHCNDW+8YEwF8SFMc79MO/7bOXVSJ54b9E/pfA2S3xPzD9xaBb0uQ/DM7sj5tww7+yZIRsr87hv7c4c0SEXNG/Tr79/9M+5r+v9N6oTy3Qv5uAk/3QzeG/XcI1OVQkAUAQSV9Z7Qr9P/RrFrWXrMu/W2k5L5Qs479Zo2IBM/vkv6FuipzkFvG/SqIpagcly7+ltipxmI3kv0pmis91cfc/gWQecsRh8D93xzejiVXQv3WdNhEv9uO/D7mgYy612j+PyVPNaT2jv34LIpFt6c6/l5YW2Ga45L+LUp+2A2z9P39i5xSpRfc/piRx4P8P0r9eCC3zBAjlv5n4OKmIUf2/jj/kUAwgAsDqW/cjbNPQv9X2z6SYweS/aTdljlWd8L94R8vZ8SL3v1EZczv0b9K/GBbbqxgk5r9XdfyikfEDwPILMvas0gfAnx0V97en0r88xQk/0IPmvxGErZ681fa/9kCaiOy2/b/2BCK0wyDVvy2xROCT4ua/+5EBLOXxA0B7p53+BnkAQKKI/QV+y9i/qDznPFM86b/snWGNkkgHwC+ByugkUwdAR98lJFqQ2b9sL7HxZkPovyJNGM67oek/HzNy6BqA1D96EnqL7pLYv0v8nFypHeq/axL/u1FnB0AkSEHvxn8DQGt+gG5Pstm/QS1keLLK6b/Sk/O6mtGzPxU8pLcPNty/FssiPwWy4L+IZTNYLmzqvw4szKfSouq/G+XJHY1a87+TVW2LUjjfvwQaifgujuy/3VARaoMl2L9NFodfK+/qv+0QMvYfP+C/FvLf01HN67+ETOQysd8AwH71iI/eGgXAbHNSHrTg4L96GNJ2CFvsv6BnExReeAFA5CakvxSl+j8MzcbAuwDgv5bXzdT1Auy/uVq8/8x58z+uvPMNqzTnP2HlfZ3gqOG/Z5Uh1wDX7r8PUbMSo2P7P9VfBrXlxPI/tQvDXQ3H4r9sJXFt2GTvvyDssGgO0PG/WxT/uE4N+r+Bk03jWYvjv/bf8sHUYu+/rUXN8hUe3j9m5HB1yZCzv/yE3PUo0+K/qqAX9idJ8L9mByqLMMH5v4kHC7KQowHAm+sAswr15L8F7/a5DE/wv2JLsGADFwTAKQjVGovZCMDDkYbTbifnvwVbdNXyhfC/malhH7yI7D+oevd0GWDZP1sjk5AdouW/KH/hrXUg8b8KWmrpQ0sFQAzEAF/pTgBAhB1hfFzT5r9XK/wflZ7xv18hRuqKXAjA/5rUd9v1BED/tlxBd4bov7pQU4wLfPK/4pnwn0T/sj/c277XPF3jv02biiQ+Rum/zGkxMcl88r8Yk0HhJVzjv62yUUFRjfS/89MEdoPQ6r8TqikcRF/zvxQxghHovfY/cfM1eFWE5j9pcwp7GJPrv5ehC2fbYPO/KUV2nGg0/795OhmUaqEFwFQeuy4j+eq/ePiwytEp9L8DuqWfW+8BQLytJylXHPY/PlP4Qr8q7r+kDLLri0P1vxT4ShWL+Oo/DMsWg0zlv7/S9fINXGjtv73m373LRPW/+xg/Gaxd8b94MdQEfW0AwLjBLbDOHO+/kmm4ANp49L+cShSMMbAEwKyjUgWirAdAo2q2uqM08L99wKzM+7H2v3RdlNBXFgnA8S9+ewyV/z+vaSZre3Pxv6riWFiWZfi/2J7VSZZ60j+LES81zPn3v+OrlPMN3PK/quJYWJZl+L/OZbufkEcEQLCNB/1lPOO/Y2nmTbY/87+q4lhYlmX4v7CNB/1lPOO/zmW7n5BHBEBwKD1Aa57LP/XsSsw7RbU/PMDPJGsfoD/TqningGKIPzFtCLYmb3I/qYfrJr7eWz9pQmleXRFFP0rWlJkA2i8/pCvcttgTGD9Dt8IWbjMCPyCG4GRlhOs+1JI2GhDN1D7ns8cGvXK/Pi8m8UTJxac+hNTfA2z4kT7GI8kjLyt7Pv//////HwAI//////8zEAj/////fzIgCP////9vMjAI/////2MyQAj///8/YjJQCP///zdiMmAI////M2IycAj//78zYjKACP//qzNiMpAI/3+rM2IyoAj/D6szYjKwCP8DqzNiMsAIvwOrM2Iy0AifA6szYjLgCJkDqzNiMvAI//////8/Dwj//////ysfCP////9/KS8I/////z8pPwj/////OSlPCP///z84KV8I////Dzgpbwj///8OOCl/CP//Hw44KY8I//8PDjgpnwj/fw0OOCmvCP8PDQ44Kb8I/w0NDjgpzwj/DA0OOCnfCMcMDQ44Ke8IxAwNDjgp/wgHAAAABwAAAAEAAAACAAAABAAAAAMAAAAAAAAAAAAAAAcAAAADAAAAAQAAAAIAAAAFAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAgAAAAEAAAADAAAADgAAAAYAAAALAAAAAgAAAAcAAAABAAAAGAAAAAUAAAAKAAAAAQAAAAYAAAAAAAAAJgAAAAcAAAAMAAAAAwAAAAgAAAACAAAAMQAAAAkAAAAOAAAAAAAAAAUAAAAEAAAAOgAAAAgAAAANAAAABAAAAAkAAAADAAAAPwAAAAsAAAAGAAAADwAAAAoAAAAQAAAASAAAAAwAAAAHAAAAEAAAAAsAAAARAAAAUwAAAAoAAAAFAAAAEwAAAA4AAAAPAAAAYQAAAA0AAAAIAAAAEQAAAAwAAAASAAAAawAAAA4AAAAJAAAAEgAAAA0AAAATAAAAdQAAAA8AAAATAAAAEQAAABIAAAAQAAAABgAAAAIAAAADAAAABQAAAAQAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAMAAAABAAAABQAAAAQAAAAAAAAAAAAAAAcAAAAFAAAAAwAAAAQAAAABAAAAAAAAAAIAAAAAAAAAAgAAAAMAAAABAAAABQAAAAQAAAAGAAAAAAAAAAAAAAAYLURU+yH5PxgtRFT7Ifm/GC1EVPshCUAYLURU+yEJwGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjZWxsc1RvTXVsdGlQb2x5LmMAY2VsbFRvRWRnZUFyY3MAAAEDAgQABAMFAQJjYW5jZWxBcmNQYWlycwBjcmVhdGVTb3J0YWJsZUxvb3AAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAdmVjM1RvQ2VsbABjZWxsVG9DaGlsZFBvcwB2YWxpZGF0ZUNoaWxkUG9zAHJldkRpciAhPSBJTlZBTElEX0RJR0lUAGxvY2FsaWouYwBjZWxsVG9Mb2NhbElqawBiYXNlQ2VsbCAhPSBvcmlnaW5CYXNlQ2VsbAAhKG9yaWdpbk9uUGVudCAmJiBpbmRleE9uUGVudCkAYmFzZUNlbGwgPT0gb3JpZ2luQmFzZUNlbGwALi4vaW5jbHVkZS9jb29yZGlqay5oAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAYmFzZUNlbGwgIT0gSU5WQUxJRF9CQVNFX0NFTEwAbG9jYWxJamtUb0NlbGwAIV9pc0Jhc2VDZWxsUGVudGFnb24oYmFzZUNlbGwpAGJhc2VDZWxsUm90YXRpb25zID49IDAAZ3JpZFBhdGhDZWxsc0ludGVycG9sYXRlAHBvbHlmaWxsLmMAaXRlclN0ZXBQb2x5Z29uQ29tcGFjdAAwAHZlcnRleC5jAHZlcnRleFJvdGF0aW9ucwBjZWxsVG9WZXJ0ZXg=";
4281var Te=28400;function oe(xe,Oe,Ge,$e){Fn("Assertion failed: "+D(xe)+", at: "+[Oe?D(Oe):"unknown filename",Ge,$e?D($e):"unknown function"])}function ge(){return z.length}function Ne(xe,Oe,Ge){H.set(H.subarray(Oe,Oe+Ge),xe)}function ke(xe){return e.___errno_location&&(W[e.___errno_location()>>2]=xe),xe}function Xe(xe){Fn("OOM")}function et(xe){try{var Oe=new ArrayBuffer(xe);return Oe.byteLength!=xe?void 0:(new Int8Array(Oe).set(z),fn(Oe),ae(Oe),1)}catch{}}function Qe(xe){var Oe=ge(),Ge=16777216,$e=2147483648-Ge;if(xe>$e)return!1;for(var m=16777216,be=Math.max(Oe,m);be<xe;
4281)be<=536870912?be=U(2*be,Ge):be=Math.min(U((3*be+2147483648)/4,Ge),$e);var en=et(be);return!!en}var lt=typeof atob=="function"?atob:function(xe){var Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ge="",$e,m,be,en,on,tn,Qt,Pt=0;xe=xe.replace(/[^A-Za-z0-9\+\/\=]/g,"");do en=Oe.indexOf(xe.charAt(Pt++)),on=Oe.indexOf(xe.charAt(Pt++)),tn=Oe.indexOf(xe.charAt(Pt++)),Qt=Oe.indexOf(xe.charAt(Pt++)),$e=en<<2|on>>4,m=(on&15)<<4|tn>>2,be=(tn&3)<<6|Qt,Ge=Ge+String.fromCharCode($e),tn!==64&&(Ge=Ge+String.fromCharCode(m)),Qt!==64&&(Ge=Ge+String.fromCharCode(be));while(Pt<xe.length);return Ge};function tt(xe){try{for(var Oe=lt(xe),Ge=new Uint8Array(Oe.length),$e=0;$e<Oe.length;++$e)Ge[$e]=Oe.charCodeAt($e);return Ge}catch{throw new Error("Converting base64 string to bytes failed.")}}function Ft(xe){if(Se(xe))return tt(xe.slice(Ce.length))}var Mt={Math,Int8Array,Int32Array,Uint8Array,Float32Array,Float64Array},Nt={a:Fn,b:d,c:h,d:oe,e:ke,f:ge,g:Ne,h:Qe,i:Xe,o:Te,p:Z},Je=(function(xe,Oe,Ge){"almost asm";var $e=new xe.Int8Array(Ge),m=new xe.Int32Array(Ge);new xe.Uint8Array(Ge),new xe.Float32Array(Ge);var be=new xe.Float64Array(Ge),en=Oe.o|0,on=Oe.p|0,tn=xe.Math.floor,Qt=xe.Math.abs,Pt=xe.Math.sqrt,bn=xe.Math.cos,wn=xe.Math.sin,zn=xe.Math.tan,Un=xe.Math.acos,_n=xe.Math.asin,xr=xe.Math.atan,Ir=xe.Math.atan2,is=xe.Math.ceil,si=xe.Math.imul,vr=xe.Math.min,Yi=xe.Math.max,Vi=xe.Math.clz32,Pe=Oe.a,He=Oe.b,ce=Oe.c,at=Oe.d,vt=Oe.e,vn=Oe.f,Rn=Oe.g,ln=Oe.h,kn=Oe.i,pe=28416;function Nr(v){return $e=new Int8Array(v),m=new Int32Array(v),be=new Float64Array(v),Ge=v,!0}function zr(v){v=v|0;var w=0;return w=pe,pe=pe+v|0,pe=pe+15&-16,w|0}function sr(){return pe|0}function Ai(v){v=v|0,pe=v}function Oi(v,w){v=v|0,pe=v}function ss(v,w){v=v|0,w=w|0;var S=0,N=0,C=0;return(v|0)<0?(w=2,w|0):(v|0)>13780509?(w=ux(15,w)|0,w|0):(S=((v|0)<0)<<31>>31,C=as(v|0,S|0,3,0)|0,N=ce()|0,S=An(v|0,S|0,1,0)|0,S=as(C|0,N|0,S|0,ce()|0)|0,S=An(S|0,ce()|0,1,0)|0,v=ce()|0,m[w>>2]=S,m[w+4>>2]=v,w=0,w|0)}function qi(v,w,S,N){return v=v|0,w=w|0,S=S|0,N=N|0,aa(v,w,S,N,0)|0}function aa(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0;if(V=pe,pe=pe+16|0,R=V,!(Gn(v,w,S,N,C)|0))return N=0,pe=V,N|0;do if((S|0)>=0){if((S|0)>13780509){if(k=ux(15,R)|0,k|0)break;I=R,R=m[I>>2]|0,I=m[I+4>>2]|0}else k=((S|0)<0)<<31>>31,$=as(S|0,k|0,3,0)|0,I=ce()|0,k=An(S|0,k|0,1,0)|0,k=as($|0,I|0,k|0,ce()|0)|0,k=An(k|0,ce()|0,1,0)|0,I=ce()|0,m[R>>2]=k,m[R+4>>2]=I,R=k;if(qn(N|0,0,R<<3|0)|0,C|0){qn(C|0,0,R<<2|0)|0,k=ks(v,w,S,N,C,R,I,0)|0;break}k=xo(R,4)|0,k?($=ks(v,w,S,N,k,R,I,0)|0,Nn(k),k=$):k=13}else k=2;while(!1);return $=k,pe=V,$|0}function Gn(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0;if(je=pe,pe=pe+16|0,fe=je,ye=je+8|0,he=fe,m[he>>2]=v,m[he+4>>2]=w,(S|0)<0)return ye=2,pe=je,ye|0;if(k=N,m[k>>2]=v,m[k+4>>2]=w,k=(C|0)!=0,k&&(m[C>>2]=0),Er(v,w)|0)return ye=9,pe=je,ye|0;m[ye>>2]=0;e:do if((S|0)>=1)if(k)for(K=1,$=0,ie=0,he=1,k=v;;){if(!($|ie)){if(k=yr(k,w,4,ye,fe)|0,k|0)break e;if(w=fe,k=m[w>>2]|0,w=m[w+4>>2]|0,Er(k,w)|0){k=9;break e}}if(k=yr(k,w,m[26864+(ie<<2)>>2]|0,ye,fe)|0,k|0)break e;if(w=fe,k=m[w>>2]|0,w=m[w+4>>2]|0,v=N+(K<<3)|0,m[v>>2]=k,m[v+4>>2]=w,m[C+(K<<2)>>2]=he,v=$+1|0,R=(v|0)==(he|0),I=ie+1|0,V=(I|0)==6,Er(k,w)|0){k=9;break e}if(he=he+(V&R&1)|0,(he|0)>(S|0)){k=0;break}else K=K+1|0,$=R?0:v,ie=R?V?0:I:ie}else for(K=1,$=0,ie=0,he=1,k=v;;){if(!($|ie)){if(k=yr(k,w,4,ye,fe)|0,k|0)break e;if(w=fe,k=m[w>>2]|0,w=m[w+4>>2]|0,Er(k,w)|0){k=9;break e}}if(k=yr(k,w,m[26864+(ie<<2)>>2]|0,ye,fe)|0,k|0)break e;if(w=fe,k=m[w>>2]|0,w=m[w+4>>2]|0,v=N+(K<<3)|0,m[v>>2]=k,m[v+4>>2]=w,v=$+1|0,R=(v|0)==(he|0),I=ie+1|0,V=(I|0)==6,Er(k,w)|0){k=9;break e}if(he=he+(V&R&1)|0,(he|0)>(S|0)){k=0;break}else K=K+1|0,$=R?0:v,ie=R?V?0:I:ie}else k=0;while(!1);return ye=k,pe=je,ye|0}function ks(v,w,S,N,C,k,R,I){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,k=k|0,R=R|0,I=I|0;var V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0;if(je=pe,pe=pe+16|0,fe=je+8|0,ye=je,V=Su(v|0,w|0,k|0,R|0)|0,K=ce()|0,ie=N+(V<<3)|0,We=ie,De=m[We>>2]|0,We=m[We+4>>2]|0,$=(De|0)==(v|0)&(We|0)==(w|0),!((De|0)==0&(We|0)==0|$))do V=An(V|0,K|0,1,0)|0,V=gd(V|0,ce()|0,k|0,R|0)|0,K=ce()|0,ie=N+(V<<3)|0,De=ie,We=m[De>>2]|0,De=m[De+4>>2]|0,$=(We|0)==(v|0)&(De|0)==(w|0);while(!((We|0)==0&(De|0)==0|$));if(V=C+(V<<2)|0,$&&(m[V>>2]|0)<=(I|0)||(De=ie,m[De>>2]=v,m[De+4>>2]=w,m[V>>2]=I,(I|0)>=(S|0)))return De=0,pe=je,De|0;switch($=I+1|0,m[fe>>2]=0,V=yr(v,w,2,fe,ye)|0,V|0){case 9:{he=9;break}case 0:{V=ye,V=ks(m[V>>2]|0,m[V+4>>
42812]|0,S,N,C,k,R,$)|0,V||(he=9);break}}e:do if((he|0)==9){switch(m[fe>>2]=0,V=yr(v,w,3,fe,ye)|0,V|0){case 9:break;case 0:{if(V=ye,V=ks(m[V>>2]|0,m[V+4>>2]|0,S,N,C,k,R,$)|0,V|0)break e;break}default:break e}switch(m[fe>>2]=0,V=yr(v,w,1,fe,ye)|0,V|0){case 9:break;case 0:{if(V=ye,V=ks(m[V>>2]|0,m[V+4>>2]|0,S,N,C,k,R,$)|0,V|0)break e;break}default:break e}switch(m[fe>>2]=0,V=yr(v,w,5,fe,ye)|0,V|0){case 9:break;case 0:{if(V=ye,V=ks(m[V>>2]|0,m[V+4>>2]|0,S,N,C,k,R,$)|0,V|0)break e;break}default:break e}switch(m[fe>>2]=0,V=yr(v,w,4,fe,ye)|0,V|0){case 9:break;case 0:{if(V=ye,V=ks(m[V>>2]|0,m[V+4>>2]|0,S,N,C,k,R,$)|0,V|0)break e;break}default:break e}switch(m[fe>>2]=0,V=yr(v,w,6,fe,ye)|0,V|0){case 9:break;case 0:{if(V=ye,V=ks(m[V>>2]|0,m[V+4>>2]|0,S,N,C,k,R,$)|0,V|0)break e;break}default:break e}return De=0,pe=je,De|0}while(!1);return De=V,pe=je,De|0}function yr(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0;if(S>>>0>6)return C=1,C|0;R=(m[N>>2]|0)%6|0,m[N>>2]=R;e:do if((R|0)>0)for(k=0;;){switch(S|0){case 1:{S=5;break}case 5:{S=4;break}case 4:{S=6;break}case 6:{S=2;break}case 2:{S=3;break}case 3:{S=1;break}}if(k=k+1|0,(k|0)==(R|0))break e}while(!1);if(ie=de(v|0,w|0,45)|0,ce()|0,K=ie&127,K>>>0>121)return C=5,C|0;V=xa(v,w)|0,k=de(v|0,w|0,52)|0,ce()|0,k=k&15;e:do if(!k)$=15;else{for(;;){if(R=(15-k|0)*3|0,I=de(v|0,w|0,R|0)|0,ce()|0,I=I&7,(I|0)==7){w=5;break}if(ye=(Ni(k)|0)==0,k=k+-1|0,he=me(7,0,R|0)|0,w=w&~(ce()|0),fe=me(m[(ye?432:16)+(I*28|0)+(S<<2)>>2]|0,0,R|0)|0,R=ce()|0,S=m[(ye?640:224)+(I*28|0)+(S<<2)>>2]|0,v=fe|v&~he,w=R|w,!S){S=0;break e}if(!k){$=15;break e}}return w|0}while(!1);($|0)==15&&(ye=m[848+(K*28|0)+(S<<2)>>2]|0,fe=me(ye|0,0,45)|0,v=fe|v,w=ce()|0|w&-1040385,S=m[4272+(K*28|0)+(S<<2)>>2]|0,(ye&127|0)==127&&(ye=me(m[848+(K*28|0)+20>>2]|0,0,45)|0,w=ce()|0|w&-1040385,S=m[4272+(K*28|0)+20>>2]|0,v=Ao(ye|v,w)|0,w=ce()|0,m[N>>2]=(m[N>>2]|0)+1)),I=de(v|0,w|0,45)|0,ce()|0,I=I&127;e:do if(pi(I)|0){t:do if((xa(v,w)|0)==1){if((K|0)!=(I|0))if(ql(I,m[7696+(K*28|0)>>2]|0)|0){v=ud(v,w)|0,R=1,w=ce()|0;break}else at(27634,26928,533,26936);switch(V|0){case 3:{v=Ao(v,w)|0,w=ce()|0,m[N>>2]=(m[N>>2]|0)+1,R=0;break t}case 5:{v=ud(v,w)|0,w=ce()|0,m[N>>2]=(m[N>>2]|0)+5,R=0;break t}case 0:return ye=9,ye|0;default:return ye=1,ye|0}}else R=0;while(!1);if((S|0)>0){k=0;do v=wu(v,w)|0,w=ce()|0,k=k+1|0;while((k|0)!=(S|0))}if((K|0)!=(I|0)){if(!(yu(I)|0)){if((R|0)!=0|(xa(v,w)|0)!=5)break;m[N>>2]=(m[N>>2]|0)+1;break}switch(ie&127){case 8:case 118:break e}(xa(v,w)|0)!=3&&(m[N>>2]=(m[N>>2]|0)+1)}}else if((S|0)>0){k=0;do v=Ao(v,w)|0,w=ce()|0,k=k+1|0;while((k|0)!=(S|0))}while(!1);return m[N>>2]=((m[N>>2]|0)+S|0)%6|0,ye=C,m[ye>>2]=v,m[ye+4>>2]=w,ye=0,ye|0}function vl(v,w,S,N){return v=v|0,w=w|0,S=S|0,N=N|0,Yo(v,w,S,N)|0?(qn(N|0,0,S*48|0)|0,N=ai(v,w,S,N)|0,N|0):(N=0,N|0)}function Yo(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0;if(ye=pe,pe=pe+16|0,he=ye,fe=ye+8|0,ie=he,m[ie>>2]=v,m[ie+4>>2]=w,(S|0)<0)return fe=2,pe=ye,fe|0;if(!S)return fe=N,m[fe>>2]=v,m[fe+4>>2]=w,fe=0,pe=ye,fe|0;m[fe>>2]=0;e:do if(Er(v,w)|0)v=9;else{C=0,ie=v;do{if(v=yr(ie,w,4,fe,he)|0,v|0)break e;if(w=he,ie=m[w>>2]|0,w=m[w+4>>2]|0,C=C+1|0,Er(ie,w)|0){v=9;break e}}while((C|0)<(S|0));K=N,m[K>>2]=ie,m[K+4>>2]=w,K=S+-1|0,$=0,v=1;do{if(C=26864+($<<2)|0,($|0)==5)for(R=m[C>>2]|0,k=0,C=v;;){if(v=he,v=yr(m[v>>2]|0,m[v+4>>2]|0,R,fe,he)|0,v|0)break e;if((k|0)!=(K|0))if(V=he,I=m[V>>2]|0,V=m[V+4>>2]|0,v=N+(C<<3)|0,m[v>>2]=I,m[v+4>>2]=V,!(Er(I,V)|0))v=C+1|0;else{v=9;break e}else v=C;if(k=k+1|0,(k|0)>=(S|0))break;C=v}else for(R=he,V=m[C>>2]|0,I=0,C=v,k=m[R>>2]|0,R=m[R+4>>2]|0;;){if(v=yr(k,R,V,fe,he)|0,v|0)break e;if(R=he,k=m[R>>2]|0,R=m[R+4>>2]|0,v=N+(C<<3)|0,m[v>>2]=k,m[v+4>>2]=R,v=C+1|0,Er(k,R)|0){v=9;break e}if(I=I+1|0,(I|0)>=(S|0))break;C=v}$=$+1|0}while($>>>0<6);v=he,v=(ie|0)==(m[v>>2]|0)&&(w|0)==(m[v+4>>2]|0)?0:9}while(!1);return fe=v,pe=ye,fe|0}function ai(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0;if(ie=pe,pe=pe+16|0,R=ie,!S)return m[N>>2]=v,m[N+4>>2]=w,N=0,pe=ie,N|0;do if((S|0)>=0){if((S|0)>13780509){if(C=ux(15,R)|0,C|0)break;k=R,C=m[k>>2]|0,k=m[k+4>>2]|0}else C=((S|0)<0)<<31>>31,K=as(S|0,C|0,3,0)|0,k=ce()|0,C=An(S|0,C|0,1,0)|0,C=as(K|0,k|0,C|0,ce()|0)|0,C=An(C|0,ce()|0,1,0)|0,k=ce()|0,K=R,m[K>>2]=C,m[K+4>>2]=k;if($=xo(C,8)|0,!$)C=13;else{if(K=xo(C,4)|0,!K){Nn($),C=13;break}
4281if(C=ks(v,w,S,$,K,C,k,0)|0,C|0){Nn($),Nn(K);break}if(w=m[R>>2]|0,R=m[R+4>>2]|0,(R|0)>0|(R|0)==0&w>>>0>0){C=0,I=0,V=0;do v=$+(I<<3)|0,k=m[v>>2]|0,v=m[v+4>>2]|0,!((k|0)==0&(v|0)==0)&&(m[K+(I<<2)>>2]|0)==(S|0)&&(he=N+(C<<3)|0,m[he>>2]=k,m[he+4>>2]=v,C=C+1|0),I=An(I|0,V|0,1,0)|0,V=ce()|0;while((V|0)<(R|0)|(V|0)==(R|0)&I>>>0<w>>>0)}Nn($),Nn(K),C=0}}else C=2;while(!1);return he=C,pe=ie,he|0}function Rc(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0;for(I=pe,pe=pe+16|0,k=I,R=I+8|0,C=(Er(v,w)|0)==0,C=C?1:2;;){if(m[R>>2]=0,$=(yr(v,w,C,R,k)|0)==0,V=k,$&((m[V>>2]|0)==(S|0)?(m[V+4>>2]|0)==(N|0):0)){v=4;break}if(C=C+1|0,C>>>0>=7){C=7,v=4;break}}return(v|0)==4?(pe=I,C|0):0}function Qi(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0;if(I=pe,pe=pe+48|0,C=I+16|0,k=I+8|0,R=I,S=wp(S)|0,S|0)return R=S,pe=I,R|0;if($=v,V=m[$+4>>2]|0,S=k,m[S>>2]=m[$>>2],m[S+4>>2]=V,df(k,C),S=hp(C,w,R)|0,!S){if(w=m[k>>2]|0,k=m[v+8>>2]|0,(k|0)>0){C=m[v+12>>2]|0,S=0;do w=(m[C+(S<<3)>>2]|0)+w|0,S=S+1|0;while((S|0)<(k|0))}S=R,C=m[S>>2]|0,S=m[S+4>>2]|0,k=((w|0)<0)<<31>>31,(S|0)<(k|0)|(S|0)==(k|0)&C>>>0<w>>>0?(S=R,m[S>>2]=w,m[S+4>>2]=k,S=k):w=C,V=An(w|0,S|0,12,0)|0,$=ce()|0,S=R,m[S>>2]=V,m[S+4>>2]=$,S=N,m[S>>2]=V,m[S+4>>2]=$,S=0}return $=S,pe=I,$|0}function Rs(v,w,S,N,C,k,R){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,k=k|0,R=R|0;var I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0,Xt=0,Et=0,Zt=0,nn=0,rn=0,oi=0,li=0,Ga=0,Lr=0,Br=0,Vr=0;if(li=pe,pe=pe+64|0,Zt=li+48|0,nn=li+32|0,rn=li+24|0,Ot=li+8|0,$t=li,V=m[v>>2]|0,(V|0)<=0)return oi=0,pe=li,oi|0;for(Tt=v+4|0,ht=Zt+8|0,Xt=nn+8|0,Et=Ot+8|0,I=0,ot=0;;){$=m[Tt>>2]|0,Me=$+(ot<<4)|0,m[Zt>>2]=m[Me>>2],m[Zt+4>>2]=m[Me+4>>2],m[Zt+8>>2]=m[Me+8>>2],m[Zt+12>>2]=m[Me+12>>2],(ot|0)==(V+-1|0)?(m[nn>>2]=m[$>>2],m[nn+4>>2]=m[$+4>>2],m[nn+8>>2]=m[$+8>>2],m[nn+12>>2]=m[$+12>>2]):(Me=$+(ot+1<<4)|0,m[nn>>2]=m[Me>>2],m[nn+4>>2]=m[Me+4>>2],m[nn+8>>2]=m[Me+8>>2],m[nn+12>>2]=m[Me+12>>2]),V=wg(Zt,nn,N,rn)|0;e:do if(V)$=0,I=V;else if(V=rn,$=m[V>>2]|0,V=m[V+4>>2]|0,(V|0)>0|(V|0)==0&$>>>0>0){De=0,Me=0;t:for(;;){if(Lr=1/(+($>>>0)+4294967296*+(V|0)),Vr=+be[Zt>>3],V=va($|0,V|0,De|0,Me|0)|0,Br=+(V>>>0)+4294967296*+(ce()|0),Ga=+(De>>>0)+4294967296*+(Me|0),be[Ot>>3]=Lr*(Vr*Br)+Lr*(+be[nn>>3]*Ga),be[Et>>3]=Lr*(+be[ht>>3]*Br)+Lr*(+be[Xt>>3]*Ga),V=jc(Ot,N,$t)|0,V|0){I=V;break}We=$t,je=m[We>>2]|0,We=m[We+4>>2]|0,he=Su(je|0,We|0,w|0,S|0)|0,K=ce()|0,V=R+(he<<3)|0,ie=V,$=m[ie>>2]|0,ie=m[ie+4>>2]|0;n:do if(($|0)==0&(ie|0)==0)Ke=V,oi=16;else for(fe=0,ye=0;;){if((fe|0)>(S|0)|(fe|0)==(S|0)&ye>>>0>w>>>0){I=1;break t}if(($|0)==(je|0)&(ie|0)==(We|0))break n;if(V=An(he|0,K|0,1,0)|0,he=gd(V|0,ce()|0,w|0,S|0)|0,K=ce()|0,ye=An(ye|0,fe|0,1,0)|0,fe=ce()|0,V=R+(he<<3)|0,ie=V,$=m[ie>>2]|0,ie=m[ie+4>>2]|0,($|0)==0&(ie|0)==0){Ke=V,oi=16;break}}while(!1);if((oi|0)==16&&(oi=0,!((je|0)==0&(We|0)==0))&&(ye=Ke,m[ye>>2]=je,m[ye+4>>2]=We,ye=k+(m[C>>2]<<3)|0,m[ye>>2]=je,m[ye+4>>2]=We,ye=C,ye=An(m[ye>>2]|0,m[ye+4>>2]|0,1,0)|0,je=ce()|0,We=C,m[We>>2]=ye,m[We+4>>2]=je),De=An(De|0,Me|0,1,0)|0,Me=ce()|0,V=rn,$=m[V>>2]|0,V=m[V+4>>2]|0,!((V|0)>(Me|0)|(V|0)==(Me|0)&$>>>0>De>>>0)){$=1;break e}}$=0}else $=1;while(!1);if(ot=ot+1|0,!$){oi=21;break}if(V=m[v>>2]|0,(ot|0)>=(V|0)){I=0,oi=21;break}}return(oi|0)==21?(pe=li,I|0):0}function vu(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0,Xt=0,Et=0,Zt=0,nn=0,rn=0,oi=0,li=0,Ga=0,Lr=0,Br=0;if(Br=pe,pe=pe+112|0,oi=Br+80|0,V=Br+72|0,li=Br,Ga=Br+56|0,C=wp(S)|0,C|0)return Lr=C,pe=Br,Lr|0;if($=v+8|0,Lr=hs((m[$>>2]<<5)+32|0)|0,!Lr)return Lr=13,pe=Br,Lr|0;if(js(v,Lr),C=wp(S)|0,!C){if(nn=v,rn=m[nn+4>>2]|0,C=V,m[C>>2]=m[nn>>2],m[C+4>>2]=rn,df(V,oi),C=hp(oi,w,li)|0,C)nn=0,rn=0;else{if(C=m[V>>2]|0,k=m[$>>2]|0,(k|0)>0){R=m[v+12>>2]|0,S=0;do C=(m[R+(S<<3)>>2]|0)+C|0,S=S+1|0;while((S|0)!=(k|0));S=C}else S=C;C=li,k=m[C>>2]|0,C=m[C+4>>2]|0,R=((S|0)<0)<<31>>31,(C|0)<(R|0)|(C|0)==(R|0)&k>>>0<S>>>0?(C=li,m[C>>2]=S,m[C+4>>2]=R,C=R):S=k,nn=An(S|0,C|0,12,0)|0,rn=ce()|0,C=li,m[C>>2]=nn,m[C+4>>2]=rn,C=0}if(!C){if(S=xo(nn,8)|0,!S)return Nn(Lr),Lr=13,pe=Br,Lr|0;if(I=xo(nn,8)|0,!I)return Nn(Lr),Nn(S),Lr=13,pe=Br,Lr|0;Et=oi,m[Et>>2]=0,m[Et+4>>2]=0,Et=v,Zt=m[Et+4>>2]|0,C=V,m[C>>2]=m[Et>>2],m[C+4>>2]=Zt,C=Rs(V,nn,rn,w,oi,S,I)|0;e:do if(C)Nn(S),Nn(I),Nn(Lr);else{t:do if((m[$>>2]|0)>0){for(R=v+12|0,k=0;C=Rs((m[R>>2]|0)+(k<<3)|0,nn,rn,w,oi,S,I)|0,k=k+1|0,!(C|0);)if((k|0)>=(m[$>>2]|0))break t;Nn(S),Nn(I),Nn(Lr);break e}while(!1);(rn|0)>0|(rn|0)==0&nn>>>0>0&&qn(I|0,0,nn<<3|0)|0,Zt=oi,Et=m[Zt+4>>2]|0;
4281t:do if((Et|0)>0|(Et|0)==0&(m[Zt>>2]|0)>>>0>0){Tt=S,ht=I,Xt=S,Et=I,Zt=S,C=S,Ke=S,Ot=I,$t=I,S=I;n:for(;;){for(We=0,De=0,Me=0,ot=0,k=0,R=0;;){I=li,V=I+56|0;do m[I>>2]=0,I=I+4|0;while((I|0)<(V|0));if(w=Tt+(We<<3)|0,$=m[w>>2]|0,w=m[w+4>>2]|0,Gn($,w,1,li,0)|0){I=li,V=I+56|0;do m[I>>2]=0,I=I+4|0;while((I|0)<(V|0));I=xo(7,4)|0,I|0&&(ks($,w,1,li,I,7,0,0)|0,Nn(I))}for(je=0;;){ye=li+(je<<3)|0,fe=m[ye>>2]|0,ye=m[ye+4>>2]|0;r:do if((fe|0)==0&(ye|0)==0)I=k,V=R;else{if(K=Su(fe|0,ye|0,nn|0,rn|0)|0,$=ce()|0,I=N+(K<<3)|0,w=I,V=m[w>>2]|0,w=m[w+4>>2]|0,!((V|0)==0&(w|0)==0)){ie=0,he=0;do{if((ie|0)>(rn|0)|(ie|0)==(rn|0)&he>>>0>nn>>>0)break n;if((V|0)==(fe|0)&(w|0)==(ye|0)){I=k,V=R;break r}I=An(K|0,$|0,1,0)|0,K=gd(I|0,ce()|0,nn|0,rn|0)|0,$=ce()|0,he=An(he|0,ie|0,1,0)|0,ie=ce()|0,I=N+(K<<3)|0,w=I,V=m[w>>2]|0,w=m[w+4>>2]|0}while(!((V|0)==0&(w|0)==0))}if((fe|0)==0&(ye|0)==0){I=k,V=R;break}ea(fe,ye,Ga)|0,tm(v,Lr,Ga)|0&&(he=An(k|0,R|0,1,0)|0,R=ce()|0,ie=I,m[ie>>2]=fe,m[ie+4>>2]=ye,k=ht+(k<<3)|0,m[k>>2]=fe,m[k+4>>2]=ye,k=he),I=k,V=R}while(!1);if(je=je+1|0,je>>>0>=7)break;k=I,R=V}if(We=An(We|0,De|0,1,0)|0,De=ce()|0,Me=An(Me|0,ot|0,1,0)|0,ot=ce()|0,R=oi,k=m[R>>2]|0,R=m[R+4>>2]|0,(ot|0)<(R|0)|(ot|0)==(R|0)&Me>>>0<k>>>0)k=I,R=V;else break}if((R|0)>0|(R|0)==0&k>>>0>0){k=0,R=0;do ot=Tt+(k<<3)|0,m[ot>>2]=0,m[ot+4>>2]=0,k=An(k|0,R|0,1,0)|0,R=ce()|0,ot=oi,Me=m[ot+4>>2]|0;while((R|0)<(Me|0)|((R|0)==(Me|0)?k>>>0<(m[ot>>2]|0)>>>0:0))}if(ot=oi,m[ot>>2]=I,m[ot+4>>2]=V,(V|0)>0|(V|0)==0&I>>>0>0)je=S,We=$t,De=Zt,Me=Ot,ot=ht,S=Ke,$t=C,Ot=Xt,Ke=je,C=We,Zt=Et,Et=De,Xt=Me,ht=Tt,Tt=ot;else break t}Nn(Xt),Nn(Et),Nn(Lr),C=1;break e}else C=I;while(!1);Nn(Lr),Nn(S),Nn(C),C=0}while(!1);return Lr=C,pe=Br,Lr|0}}return Nn(Lr),Lr=C,pe=Br,Lr|0}function Xn(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0;if(I=pe,pe=pe+16|0,R=I,v=jy(v,w,((w|0)<0)<<31>>31,R)|0,v|0)return R=v,pe=I,R|0;if(k=cf(R,S)|0,S=R+4|0,(m[R>>2]|0)>0){w=0;do{if(C=m[S>>2]|0,N=C+(w<<4)+4|0,Nn(m[N>>2]|0),m[N>>2]=0,m[C+(w<<4)>>2]=0,N=C+(w<<4)+8|0,C=C+(w<<4)+12|0,(m[N>>2]|0)>0){v=0;do V=m[C>>2]|0,$=V+(v<<3)+4|0,Nn(m[$>>2]|0),m[$>>2]=0,m[V+(v<<3)>>2]=0,v=v+1|0;while((v|0)<(m[N>>2]|0))}Nn(m[C>>2]|0),m[C>>2]=0,m[N>>2]=0,w=w+1|0}while((w|0)<(m[R>>2]|0))}return Nn(m[S>>2]|0),m[S>>2]=0,m[R>>2]=0,$=k,pe=I,$|0}function $i(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0;if(R=m[v>>2]|0,(R|0)<=0)return C=0,N=0,R=C<0,N=12.566370614359172-N,N=C+N,C=R?N:C,be[w>>3]=C,0;if(k=m[v+4>>2]|0,v=(R|0)!=1&1,I=+be[k>>3]*.5+.7853981633974483,C=+be[k+(v<<4)>>3]*.5+.7853981633974483,S=+wn(+I)*+wn(+C),N=+be[k+(v<<4)+8>>3]-+be[k+8>>3],S=+Ir(+(+wn(+N)*S),+(+bn(+I)*+bn(+C)+ +bn(+N)*S))*-2,N=S+0,S=N-S,(R|0)==1)return I=N,C=S,R=I<0,C=12.566370614359172-C,C=I+C,I=R?C:I,be[w>>3]=I,0;for(v=1,C=N;K=v,v=v+1|0,ie=(v|0)%(R|0)|0,$=+be[k+(K<<4)>>3]*.5+.7853981633974483,V=+be[k+(ie<<4)>>3]*.5+.7853981633974483,N=+wn(+$)*+wn(+V),I=+be[k+(ie<<4)+8>>3]-+be[k+(K<<4)+8>>3],S=+Ir(+(+wn(+I)*N),+(+bn(+$)*+bn(+V)+ +bn(+I)*N))*-2-S,N=C+S,S=N-C-S,!((v|0)>=(R|0));)C=N;return ie=N<0,$=12.566370614359172-S,$=N+$,$=ie?$:N,be[w>>3]=$,0}function yl(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0;return R=pe,pe=pe+192|0,N=R+176|0,C=R,k=R+168|0,v=Xl(v,w,C)|0,v|0?(k=v,pe=R,k|0):(m[k>>2]=m[C>>2],m[k+4>>2]=C+8,m[N>>2]=m[k>>2],m[N+4>>2]=m[k+4>>2],$i(N,S)|0,k=0,pe=R,k|0)}function ah(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0;return R=pe,pe=pe+192|0,N=R+176|0,C=R,k=R+168|0,v=Xl(v,w,C)|0,v?(k=v,pe=R,k|0):(m[k>>2]=m[C>>2],m[k+4>>2]=C+8,m[N>>2]=m[k>>2],m[N+4>>2]=m[k+4>>2],$i(N,S)|0,be[S>>3]=+be[S>>3]*4058973249931477e-8,k=0,pe=R,k|0)}function Pc(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0;return R=pe,pe=pe+192|0,N=R+176|0,C=R,k=R+168|0,v=Xl(v,w,C)|0,v?(k=v,pe=R,k|0):(m[k>>2]=m[C>>2],m[k+4>>2]=C+8,m[N>>2]=m[k>>2],m[N+4>>2]=m[k+4>>2],$i(N,S)|0,be[S>>3]=+be[S>>3]*4058973249931477e-8*1e6,k=0,pe=R,k|0)}function pi(v){return v=v|0,v>>>0>121?(v=0,v|0):(v=m[7696+(v*28|0)+16>>2]|0,v|0)}function yu(v){return v=v|0,(v|0)==4|(v|0)==117|0}function tf(v){return v=v|0,m[11120+((m[v>>2]|0)*216|0)+((m[v+4>>2]|0)*72|0)+((m[v+8>>2]|0)*24|0)+(m[v+12>>2]<<3)>>2]|0}function dp(v){return v=v|0,m[11120+((m[v>>2]|0)*216|0)+((m[v+4>>2]|0)*72|0)+((m[v+8>>2]|0)*24|0)+(m[v+12>>2]<<3)+4>>2]|0}function Qo(v,w){v=v|0,w=w|0,v=7696+(v*28|0)|0,m[w>>2]=m[v>>2],m[w+4>>2]=m[v+4>>2],m[w+8>>2]=m[v+8>>2],m[w+12>>2]=m[v+12>>2]}function oh(v,w){v=v|0,w=w|0;var S=0,N=0;if(w>>>0>20)return w=-1,w|0;do if((m[11120+(w*216|0)>>2]|0)!=(v|0))if((m[11120+(w*216|0)+8>>2]|0)!=(v|0))if((m[11120+(w*216|0)+16>>2]|0)!=(v|0))if((m[11120+(w*216|0)+24>>2]|0)!=(v|0))if((m[11120+(w*216|0)+32>>
42812]|0)!=(v|0))if((m[11120+(w*216|0)+40>>2]|0)!=(v|0))if((m[11120+(w*216|0)+48>>2]|0)!=(v|0))if((m[11120+(w*216|0)+56>>2]|0)!=(v|0))if((m[11120+(w*216|0)+64>>2]|0)!=(v|0))if((m[11120+(w*216|0)+72>>2]|0)!=(v|0))if((m[11120+(w*216|0)+80>>2]|0)!=(v|0))if((m[11120+(w*216|0)+88>>2]|0)!=(v|0))if((m[11120+(w*216|0)+96>>2]|0)!=(v|0))if((m[11120+(w*216|0)+104>>2]|0)!=(v|0))if((m[11120+(w*216|0)+112>>2]|0)!=(v|0))if((m[11120+(w*216|0)+120>>2]|0)!=(v|0))if((m[11120+(w*216|0)+128>>2]|0)!=(v|0))if((m[11120+(w*216|0)+136>>2]|0)==(v|0))v=2,S=1,N=2;else{if((m[11120+(w*216|0)+144>>2]|0)==(v|0)){v=0,S=2,N=0;break}if((m[11120+(w*216|0)+152>>2]|0)==(v|0)){v=0,S=2,N=1;break}if((m[11120+(w*216|0)+160>>2]|0)==(v|0)){v=0,S=2,N=2;break}if((m[11120+(w*216|0)+168>>2]|0)==(v|0)){v=1,S=2,N=0;break}if((m[11120+(w*216|0)+176>>2]|0)==(v|0)){v=1,S=2,N=1;break}if((m[11120+(w*216|0)+184>>2]|0)==(v|0)){v=1,S=2,N=2;break}if((m[11120+(w*216|0)+192>>2]|0)==(v|0)){v=2,S=2,N=0;break}if((m[11120+(w*216|0)+200>>2]|0)==(v|0)){v=2,S=2,N=1;break}if((m[11120+(w*216|0)+208>>2]|0)==(v|0)){v=2,S=2,N=2;break}else v=-1;return v|0}else v=2,S=1,N=1;else v=2,S=1,N=0;else v=1,S=1,N=2;else v=1,S=1,N=1;else v=1,S=1,N=0;else v=0,S=1,N=2;else v=0,S=1,N=1;else v=0,S=1,N=0;else v=2,S=0,N=2;else v=2,S=0,N=1;else v=2,S=0,N=0;else v=1,S=0,N=2;else v=1,S=0,N=1;else v=1,S=0,N=0;else v=0,S=0,N=2;else v=0,S=0,N=1;else v=0,S=0,N=0;while(!1);return w=m[11120+(w*216|0)+(S*72|0)+(v*24|0)+(N<<3)+4>>2]|0,w|0}function ql(v,w){return v=v|0,w=w|0,(m[7696+(v*28|0)+20>>2]|0)==(w|0)?(w=1,w|0):(w=(m[7696+(v*28|0)+24>>2]|0)==(w|0),w|0)}function lh(v,w){return v=v|0,w=w|0,m[848+(v*28|0)+(w<<2)>>2]|0}function oa(v,w){return v=v|0,w=w|0,(m[848+(v*28|0)>>2]|0)==(w|0)?(w=0,w|0):(m[848+(v*28|0)+4>>2]|0)==(w|0)?(w=1,w|0):(m[848+(v*28|0)+8>>2]|0)==(w|0)?(w=2,w|0):(m[848+(v*28|0)+12>>2]|0)==(w|0)?(w=3,w|0):(m[848+(v*28|0)+16>>2]|0)==(w|0)?(w=4,w|0):(m[848+(v*28|0)+20>>2]|0)==(w|0)?(w=5,w|0):((m[848+(v*28|0)+24>>2]|0)==(w|0)?6:7)|0}function ix(){return 122}function id(v){v=v|0;var w=0,S=0,N=0;w=0;do me(w|0,0,45)|0,N=ce()|0|134225919,S=v+(w<<3)|0,m[S>>2]=-1,m[S+4>>2]=N,w=w+1|0;while((w|0)!=122);return 0}function bg(v){v=v|0;var w=0,S=0,N=0;return N=+be[v+16>>3],S=+be[v+24>>3],w=N-S,+(N<S?w+6.283185307179586:w)}function Dy(v){return v=v|0,+be[v+16>>3]<+be[v+24>>3]|0}function nf(v){return v=v|0,+(+be[v>>3]-+be[v+8>>3])}function sd(v,w){v=v|0,w=w|0;var S=0,N=0,C=0;return S=+be[w>>3],!(S>=+be[v+8>>3])||!(S<=+be[v>>3])?(w=0,w|0):(N=+be[v+16>>3],S=+be[v+24>>3],C=+be[w+8>>3],w=C>=S,v=C<=N&1,N<S?w&&(v=1):w||(v=0),w=(v|0)!=0,w|0)}function rf(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;return+be[v>>3]<+be[w+8>>3]||+be[v+8>>3]>+be[w>>3]?(N=0,N|0):(k=+be[v+16>>3],S=v+24|0,K=+be[S>>3],R=k<K,N=w+16|0,$=+be[N>>3],C=w+24|0,V=+be[C>>3],I=$<V,w=K-$<V-k,v=R?I|w?1:2:0,w=I?R?1:w?2:1:0,k=+bl(k,v),k<+bl(+be[C>>3],w)||(K=+bl(+be[S>>3],v),K>+bl(+be[N>>3],w))?(I=0,I|0):(I=1,I|0))}function sx(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0;k=+be[v+16>>3],V=+be[v+24>>3],v=k<V,I=+be[w+16>>3],R=+be[w+24>>3],C=I<R,w=V-I<R-k,m[S>>2]=v?C|w?1:2:0,m[N>>2]=C?v?1:w?2:1:0}function U_(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;return+be[v>>3]<+be[w>>3]||+be[v+8>>3]>+be[w+8>>3]?(N=0,N|0):(N=v+16|0,V=+be[N>>3],k=+be[v+24>>3],R=V<k,S=w+16|0,K=+be[S>>3],C=w+24|0,$=+be[C>>3],I=K<$,w=k-K<$-V,v=R?I|w?1:2:0,w=I?R?1:w?2:1:0,k=+bl(k,v),k<=+bl(+be[C>>3],w)?(K=+bl(+be[N>>3],v),I=K>=+bl(+be[S>>3],w),I|0):(I=0,I|0))}function Lo(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0;C=pe,pe=pe+176|0,N=C,m[N>>2]=4,I=+be[w>>3],be[N+8>>3]=I,k=+be[w+16>>3],be[N+16>>3]=k,be[N+24>>3]=I,I=+be[w+24>>3],be[N+32>>3]=I,R=+be[w+8>>3],be[N+40>>3]=R,be[N+48>>3]=I,be[N+56>>3]=R,be[N+64>>3]=k,w=N+72|0,S=w+96|0;do m[w>>2]=0,w=w+4|0;while((w|0)<(S|0));Wt(v|0,N|0,168)|0,pe=C}function hp(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0;ye=pe,pe=pe+288|0,K=ye+264|0,ie=ye+96|0,$=ye,I=$,V=I+96|0;do m[I>>2]=0,I=I+4|0;while((I|0)<(V|0));return w=Uy(w,$)|0,w|0?(fe=w,pe=ye,fe|0):(V=$,$=m[V>>2]|0,V=m[V+4>>2]|0,ea($,V,K)|0,Xl($,V,ie)|0,R=+Zo(K,ie+8|0),be[K>>3]=+be[v>>3],V=K+8|0,be[V>>3]=+be[v+16>>3],be[ie>>3]=+be[v+8>>3],$=ie+8|0,be[$>>3]=+be[v+24>>3],C=+Zo(K,ie),We=+be[V>>3]-+be[$>>
42813],k=+Qt(+We),je=+be[K>>3]-+be[ie>>3],N=+Qt(+je),!(We==0|je==0)&&(We=+xt(+k,+N),We=+is(+(C*C/+Ct(+(We/+Ct(+k,+N)),3)/(R*(R*2.59807621135)*.8))),be[en>>3]=We,he=~~We>>>0,fe=+Qt(We)>=1?We>0?~~+vr(+tn(We/4294967296),4294967295)>>>0:~~+is((We-+(~~We>>>0))/4294967296)>>>0:0,(m[en+4>>2]&2146435072|0)!=2146435072)?(ie=(he|0)==0&(fe|0)==0,w=S,m[w>>2]=ie?1:he,m[w+4>>2]=ie?0:fe,w=0):w=1,fe=w,pe=ye,fe|0)}function wg(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0;$=pe,pe=pe+288|0,R=$+264|0,I=$+96|0,V=$,C=V,k=C+96|0;do m[C>>2]=0,C=C+4|0;while((C|0)<(k|0));return S=Uy(S,V)|0,S|0?(N=S,pe=$,N|0):(S=V,C=m[S>>2]|0,S=m[S+4>>2]|0,ea(C,S,R)|0,Xl(C,S,I)|0,K=+Zo(R,I+8|0),K=+is(+(+Zo(v,w)/(K*2))),be[en>>3]=K,S=~~K>>>0,C=+Qt(K)>=1?K>0?~~+vr(+tn(K/4294967296),4294967295)>>>0:~~+is((K-+(~~K>>>0))/4294967296)>>>0:0,(m[en+4>>2]&2146435072|0)==2146435072?(N=1,pe=$,N|0):(V=(S|0)==0&(C|0)==0,m[N>>2]=V?1:S,m[N+4>>2]=V?0:C,N=0,pe=$,N|0))}function _g(v,w){v=v|0,w=+w;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;k=v+16|0,R=+be[k>>3],S=v+24|0,C=+be[S>>3],N=R-C,N=R<C?N+6.283185307179586:N,$=+be[v>>3],I=v+8|0,V=+be[I>>3],K=$-V,N=(N*w-N)*.5,w=(K*w-K)*.5,$=$+w,be[v>>3]=$>1.5707963267948966?1.5707963267948966:$,w=V-w,be[I>>3]=w<-1.5707963267948966?-1.5707963267948966:w,w=R+N,w=w>3.141592653589793?w+-6.283185307179586:w,be[k>>3]=w<-3.141592653589793?w+6.283185307179586:w,w=C-N,w=w>3.141592653589793?w+-6.283185307179586:w,be[S>>3]=w<-3.141592653589793?w+6.283185307179586:w}function jy(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0,Xt=0,Et=0,Zt=0,nn=0,rn=0;if(rn=pe,pe=pe+224|0,Xt=rn,Ot=rn+48|0,V=(S|0)>0|(S|0)==0&w>>>0>0,V&(S>>>0>0|(S|0)==0&w>>>0>17895697))return nn=14,pe=rn,nn|0;if((S|0)<0)return nn=2,pe=rn,nn|0;if((w|0)==0&(S|0)==0)return m[N>>2]=0,m[N+4>>2]=0,nn=0,pe=rn,nn|0;for(C=v,C=Q0(m[C>>2]|0,m[C+4>>2]|0)|0,R=0,I=0;;){if(k=v+(R<<3)|0,nn=k,!(K0(m[nn>>2]|0,m[nn+4>>2]|0)|0)){C=5,Et=159;break}if(nn=k,nn=(Q0(m[nn>>2]|0,m[nn+4>>2]|0)|0)==(C|0),R=An(R|0,I|0,1,0)|0,I=ce()|0,!nn){C=12,Et=159;break}if(!((I|0)<(S|0)|(I|0)==(S|0)&R>>>0<w>>>0)){Et=8;break}}if((Et|0)==8){do if((S|0)>0|(S|0)==0&w>>>0>1){if(C=w<<3,R=hs(C)|0,!R)return nn=13,pe=rn,nn|0;for(Wt(R|0,v|0,C|0)|0,_p(R,w,8,1),C=1,k=0;Zt=R+(C<<3)|0,nn=R+(C+-1<<3)|0,nn=(m[Zt>>2]|0)==(m[nn>>2]|0)?(m[Zt+4>>2]|0)==(m[nn+4>>2]|0):0,C=An(C|0,k|0,1,0)|0,k=ce()|0,!nn;)if(!((k|0)<(S|0)|(k|0)==(S|0)&C>>>0<w>>>0)){Et=14;break}if((Et|0)==14){Nn(R);break}return Nn(R),nn=10,pe=rn,nn|0}while(!1);if(C=as(w|0,S|0,6,0)|0,k=ce()|0,V){R=0,I=0;do nn=v+(I<<3)|0,nn=((Er(m[nn>>2]|0,m[nn+4>>2]|0)|0)!=0)<<31>>31,C=An(C|0,k|0,nn|0,((nn|0)<0)<<31>>31|0)|0,k=ce()|0,I=An(I|0,R|0,1,0)|0,R=ce()|0;while((R|0)<(S|0)|(R|0)==(S|0)&I>>>0<w>>>0);Ke=C,ot=k}else Ke=C,ot=k;if(De=as(Ke|0,ot|0,10,0)|0,Me=ce()|0,Zt=hs(Ke<<5)|0,!Zt)return nn=13,pe=rn,nn|0;if(nn=xo(De,4)|0,!nn)return Nn(Zt),nn=13,pe=rn,nn|0;e:do if(V){for(ht=v,ld(m[ht>>2]|0,m[ht+4>>2]|0,Xt)|0,fe=Zt,ye=0,je=0,C=0,We=0;;){V=Xt,V=(m[V>>2]|0)==0&(m[V+4>>2]|0)==0,k=V?26990:26995,R=V?5:6,I=0,V=Xt+((V&1)<<3)|0,$=An(R|0,I|0,-1,-1)|0,K=ce()|0,ie=0,he=0;do Tt=V+(ie<<3)|0,$t=m[Tt+4>>2]|0,ht=fe+(ie<<5)|0,m[ht>>2]=m[Tt>>2],m[ht+4>>2]=$t,$e[fe+(ie<<5)+9>>0]=0,$e[fe+(ie<<5)+8>>0]=0,m[fe+(ie<<5)+20>>2]=fe,ht=fe+(ie<<5)+24|0,m[ht>>2]=1,m[ht+4>>2]=0,ht=$e[k+ie>>0]|0,$t=An($|0,K|0,ie|0,he|0)|0,$t=Su($t|0,ce()|0,R|0,I|0)|0,ce()|0,$t=$e[k+$t>>0]|0,ie=An(ie|0,he|0,1,0)|0,he=ce()|0,Tt=$e[k+((ie|0)==(R|0)&(he|0)==(I|0)?0:ie)>>0]|0,ht=ht&255,m[fe+(ht<<5)+16>>2]=fe+(($t&255)<<5),m[fe+(ht<<5)+12>>2]=fe+((Tt&255)<<5);while(he>>>0<I>>>0|(he|0)==(I|0)&ie>>>0<R>>>0);if(ye=An(ye|0,je|0,1,0)|0,je=ce()|0,C=An(R|0,I|0,C|0,We|0)|0,We=ce()|0,!((je|0)<(S|0)|(je|0)==(S|0)&ye>>>0<w>>>0))break e;ht=v+(ye<<3)|0,ld(m[ht>>2]|0,m[ht+4>>2]|0,Xt)|0||(fe=Zt+(C<<5)|0)}at(27634,26956,108,26975)}while(!1);if((ot|0)>0|(ot|0)==0&Ke>>>0>0){I=0,V=0;do{if(k=Zt+(I<<5)|0,R=m[k>>2]|0,k=m[k+4>>2]|0,C=de(R|0,k|0,30)|0,k=as(C^R|0,(ce()|0)^k|0,484763065,-1084733587)|0,R=ce()|0,C=de(k|0,R|0,27)|0,R=as(C^k|0,(ce()|0)^R|0,321982955,-1798288965)|0,k=ce()|0,C=de(R|0,k|0,31)|0,k=Su(C^R|0,(ce()|0)^k|0,De|0,Me|0)|0,R=ce()|0,C=nn+(k<<2)|0,m[C>>2]|0)do C=An(k|0,R|0,1,0)|0,k=gd(C|0,ce()|0,De|0,Me|0)|0,R=ce()|0,C=nn+(k<<2)|0;while((m[C>>2]|0)!=0);m[C>>2]=Zt+(I<<5),I=An(I|0,V|0,1,0)|0,V=ce()|0}while((V|0)<(ot|0)|(V|0)==(ot|0)&I>>>0<Ke>>>0);ie=0,he=0;do{if(I=Zt+(ie<<5)|0,V=Zt+(ie<<5)+9|0,!($e[V>>0]|0)){if(ht=I,W0(m[ht>>
vendor: 5,678 bytes, line 4281
42812]|0,m[ht+4>>2]|0,Xt)|0){Et=39;break}K=Xt,$=m[K>>2]|0,K=m[K+4>>2]|0,k=de($|0,K|0,30)|0,k=as(k^$|0,(ce()|0)^K|0,484763065,-1084733587)|0,R=ce()|0,C=de(k|0,R|0,27)|0,R=as(C^k|0,(ce()|0)^R|0,321982955,-1798288965)|0,k=ce()|0,C=de(R|0,k|0,31)|0,k=Su(C^R|0,(ce()|0)^k|0,De|0,Me|0)|0,R=ce()|0,C=m[nn+(k<<2)>>2]|0;e:do if(C|0){for(;ht=C,!((m[ht>>2]|0)==($|0)&&(m[ht+4>>2]|0)==(K|0));)if(C=An(k|0,R|0,1,0)|0,k=gd(C|0,ce()|0,De|0,Me|0)|0,R=ce()|0,C=m[nn+(k<<2)>>2]|0,!C)break e;$e[V>>0]=1,$e[C+9>>0]=1,k=C+16|0,ht=Zt+(ie<<5)+12|0,m[(m[ht>>2]|0)+16>>2]=m[k>>2],S=C+12|0,Tt=m[Zt+(ie<<5)+16>>2]|0,m[Tt+12>>2]=m[S>>2],m[(m[S>>2]|0)+16>>2]=Tt,m[(m[k>>2]|0)+12>>2]=m[ht>>2],k=z0(I)|0,ht=z0(C)|0,C=k+24|0,S=m[C+4>>2]|0,Tt=ht+24|0,$t=m[Tt+4>>2]|0,Tt=(S|0)<($t|0)|((S|0)==($t|0)?(m[C>>2]|0)>>>0<(m[Tt>>2]|0)>>>0:0),C=Tt?k:ht,k=Tt?ht:k,(k|0)!=(C|0)&&($t=C+24|0,ht=k+24|0,Tt=ht,$t=An(m[Tt>>2]|0,m[Tt+4>>2]|0,m[$t>>2]|0,m[$t+4>>2]|0)|0,Tt=ce()|0,m[ht>>2]=$t,m[ht+4>>2]=Tt,m[C+20>>2]=k)}while(!1)}ie=An(ie|0,he|0,1,0)|0,he=ce()|0}while((he|0)<(ot|0)|(he|0)==(ot|0)&ie>>>0<Ke>>>0);(Et|0)==39&&at(27634,26956,258,27001),C=0,k=0;do $e[Zt+(C<<5)+8>>0]=0,C=An(C|0,k|0,1,0)|0,k=ce()|0;while((k|0)<(ot|0)|(k|0)==(ot|0)&C>>>0<Ke>>>0);for($=0,R=0,V=0,K=0;;){if(C=Zt+($<<5)|0,($e[Zt+($<<5)+8>>0]|0)==0&&($e[Zt+($<<5)+9>>0]|0)==0){I=C,k=m[I>>2]|0,I=m[I+4>>2]|0;do $e[C+8>>0]=1,C=m[C+12>>2]|0,ht=C;while(!((m[ht>>2]|0)==(k|0)&&(m[ht+4>>2]|0)==(I|0)));R=An(R|0,V|0,1,0)|0,I=ce()|0}else I=V;if($=An($|0,K|0,1,0)|0,K=ce()|0,(K|0)<(ot|0)|(K|0)==(ot|0)&$>>>0<Ke>>>0)V=I;else break}C=0,k=0;do $e[Zt+(C<<5)+8>>0]=0,C=An(C|0,k|0,1,0)|0,k=ce()|0;while((k|0)<(ot|0)|(k|0)==(ot|0)&C>>>0<Ke>>>0);Tt=R,$t=I,C=1}else Tt=0,$t=0,C=0;ht=hs(Tt*24|0)|0;e:do if(ht|0){t:do if(C){v=0,De=0,S=0,w=0;n:for(;;){if(C=Zt+(v<<5)|0,($e[Zt+(v<<5)+8>>0]|0)==0&&($e[Zt+(v<<5)+9>>0]|0)==0){We=C,je=m[We>>2]|0,We=m[We+4>>2]|0,k=0,R=0;do k=An(k|0,R|0,2,0)|0,R=ce()|0,C=m[C+12>>2]|0,Me=C;while(!((m[Me>>2]|0)==(je|0)&&(m[Me+4>>2]|0)==(We|0)));if(ye=hs(k<<4)|0,!ye)break;k=je,R=We,fe=0,he=0,I=0,V=0;do{if(H0(k,R,Ot)|0){Et=69;break n}if(Me=m[Ot>>2]|0,K=Me+-1|0,ie=((K|0)<0)<<31>>31,(Me|0)>1){R=I,$=0,k=V,I=0;do Me=ye+(R<<4)|0,V=Ot+8+($<<4)|0,m[Me>>2]=m[V>>2],m[Me+4>>2]=m[V+4>>2],m[Me+8>>2]=m[V+8>>2],m[Me+12>>2]=m[V+12>>2],R=An(R|0,k|0,1,0)|0,k=ce()|0,$=An($|0,I|0,1,0)|0,I=ce()|0;while((I|0)<(ie|0)|(I|0)==(ie|0)&$>>>0<K>>>0);I=R,V=k}fe=An(fe|0,he|0,K|0,ie|0)|0,he=ce()|0,$e[C+8>>0]=1,C=m[C+12>>2]|0,R=C,k=m[R>>2]|0,R=m[R+4>>2]|0}while(!((k|0)==(je|0)&(R|0)==(We|0)));if(k=$_(ye,fe<<4)|0,!k){Et=75;break}We=z0(C)|0,Me=m[We+4>>2]|0,C=ht+(S*24|0)|0,m[C>>2]=m[We>>2],m[C+4>>2]=Me,C=ht+(S*24|0)+16|0,m[C>>2]=fe,m[ht+(S*24|0)+20>>2]=k,m[Xt>>2]=m[C>>2],m[Xt+4>>2]=m[C+4>>2],$i(Xt,ht+(S*24|0)+8|0)|0,k=An(S|0,De|0,1,0)|0,C=ce()|0}else k=S,C=De;if(v=An(v|0,w|0,1,0)|0,w=ce()|0,(w|0)<(ot|0)|(w|0)==(ot|0)&v>>>0<Ke>>>0)De=C,S=k;else break t}if((Et|0)==69?at(27634,26956,351,27016):(Et|0)==75&&Nn(ye),(De|0)>0|(De|0)==0&S>>>0>0)for(I=0,V=0,C=S,R=De;k=m[ht+(I*24|0)+20>>2]|0,k?(Nn(k),k=De,C=S):k=R,I=An(I|0,V|0,1,0)|0,V=ce()|0,(V|0)<(k|0)|(V|0)==(k|0)&I>>>0<C>>>0;)R=k;Nn(ht);break e}while(!1);_p(ht,Tt,24,2);t:do if((Tt|0)==0&($t|0)==0){if(Me=hs(192)|0,Me|0){if(m[Me+16>>2]=0,m[Me+20>>2]=0,he=Me+8|0,m[he>>2]=3,C=hs(48)|0,fe=Me+12|0,m[fe>>2]=C,C|0){m[C>>2]=m[3860],m[C+4>>2]=m[3861],m[C+8>>2]=m[3862],m[C+12>>2]=m[3863],ie=C+16|0,m[ie>>2]=m[3864],m[ie+4>>2]=m[3865],m[ie+8>>2]=m[3866],m[ie+12>>2]=m[3867],ie=C+32|0,m[ie>>2]=m[3868],m[ie+4>>2]=m[3869],m[ie+8>>2]=m[3870],m[ie+12>>2]=m[3871],m[Xt>>2]=m[he>>2],m[Xt+4>>2]=m[he+4>>2],$i(Xt,Me)|0,m[Me+40>>2]=0,m[Me+44>>2]=0,ie=Me+32|0,m[ie>>2]=3,C=hs(48)|0,ye=Me+36|0,m[ye>>2]=C;do if(!C)I=0,V=1;else{if(m[C>>2]=m[3872],m[C+4>>2]=m[3873],m[C+8>>2]=m[3874],m[C+12>>2]=m[3875],K=C+16|0,m[K>>2]=m[3876],m[K+4>>2]=m[3877],m[K+8>>2]=m[3878],m[K+12>>2]=m[3879],K=C+32|0,m[K>>2]=m[3880],m[K+4>>2]=m[3881],m[K+8>>2]=m[3882],m[K+12>>2]=m[3883],m[Xt>>2]=m[ie>>2],m[Xt+4>>2]=m[ie+4>>2],$i(Xt,Me+24|0)|0,m[Me+64>>2]=0,m[Me+68>>2]=0,K=Me+56|0,m[K>>2]=3,C=hs(48)|0,je=Me+60|0,m[je>>2]=C,!C){I=0,V=2;break}if(m[C>>2]=m[3884],m[C+4>>2]=m[3885],m[C+8>>2]=m[3886],m[C+12>>2]=m[3887],$=C+16|0,m[$>>2]=m[3888],m[$+4>>2]=m[3889],m[$+8>>2]=m[3890],m[$+12>>2]=m[3891],$=C+32|0,m[$>>2]=m[3892],m[$+4>>2]=m[3893],m[$+8>>2]=m[3894],m[$+12>>2]=m[3895],m[Xt>>2]=m[K>>2],m[Xt+4>>2]=m[K+4>>2],$i(Xt,Me+48|0)|0,m[Me+88>>2]=0,m[Me+92>>2]=0,$=Me+80|0,m[$>>2]=3,C=hs(48)|0,We=Me+84|0,m[We>>2]=C,!C){I=0,V=3;break}if(m[C>>2]=m[3896],m[C+4>>2]=m[3897],m[C+8>>2]=m[3898],m[C+12>>2]=m[3899],V=C+16|0,m[V>>2]=m[3900],m[V+4>>2]=m[3901],m[V+8>>2]=m[3902],m[V+12>>2]=m[3903],V=C+32|0,m[V>>2]=m[3904],m[V+4>>2]=m[3905],m[V+8>>2]=m[3906],m[V+12>>2]=m[3907],m[Xt>>2]=m[$>>2],m[Xt+4>>2]=m[$+4>>2],$i(Xt,Me+72|0)|0,m[Me+112>>2]=0,m[Me+116>>2]=0,V=Me+104|0,m[V>>2]=3,C=hs(48)|0,v=Me+108|0,m[v>>2]=C,!C){I=0,V=4;break}if(m[C>>2]=m[3908],m[C+4>>2]=m[3909],m[C+8>>2]=m[3910],m[C+12>>2]=m[3911],I=C+16|0,m[I>>2]=m[3912],m[I+4>>2]=m[3913],m[I+8>>2]=m[3914],m[I+12>>2]=m[3915],I=C+32|0,m[I>>2]=m[3916],m[I+4>>2]=m[3917],m[I+8>>2]=m[3918],m[I+12>>2]=m[3919],m[Xt>>2]=m[V>>2],m[Xt+4>>2]=m[V+4>>2],$i(Xt,Me+96|0)|0,m[Me+136>>2]=0,m[Me+140>>2]=0,I=Me+128|0,m[I>>2]=3,C=hs(48)|0,w=Me+132|0,m[w>>2]=C,!C){I=0,V=5;break}if(m[C>>2]=m[3920],m[C+4>>2]=m[3921],m[C+8>>2]=m[3922],m[C+12>>2]=m[3923],R=C+16|0,m[R>>2]=m[3924],m[R+4>>2]=m[3925],m[R+8>>2]=m[3926],m[R+12>>2]=m[3927],R=C+32|0,m[R>>2]=m[3928],m[R+4>>2]=m[3929],m[R+8>>2]=m[3930],m[R+12>>2]=m[3931],m[Xt>>2]=m[I>>2],m[Xt+4>>2]=m[I+4>>2],$i(Xt,Me+120|0)|0,m[Me+160>>2]=0,m[Me+164>>2]=0,R=Me+152|0,m[R>>2]=3,C=hs(48)|0,S=Me+156|0,m[S>>2]=C,!C){I=0,V=6;break}if(m[C>>2]=m[3932],m[C+4>>2]=m[3933],m[C+8>>2]=m[3934],m[C+12>>
42812]=m[3935],k=C+16|0,m[k>>2]=m[3936],m[k+4>>2]=m[3937],m[k+8>>2]=m[3938],m[k+12>>2]=m[3939],k=C+32|0,m[k>>2]=m[3940],m[k+4>>2]=m[3941],m[k+8>>2]=m[3942],m[k+12>>2]=m[3943],m[Xt>>2]=m[R>>2],m[Xt+4>>2]=m[R+4>>2],$i(Xt,Me+144|0)|0,m[Me+184>>2]=0,m[Me+188>>2]=0,k=Me+176|0,m[k>>2]=3,C=hs(48)|0,De=Me+180|0,m[De>>2]=C,!C){I=0,V=7;break}if(m[C>>2]=m[3944],m[C+4>>2]=m[3945],m[C+8>>2]=m[3946],m[C+12>>2]=m[3947],Ot=C+16|0,m[Ot>>2]=m[3948],m[Ot+4>>2]=m[3949],m[Ot+8>>2]=m[3950],m[Ot+12>>2]=m[3951],C=C+32|0,m[C>>2]=m[3952],m[C+4>>2]=m[3953],m[C+8>>2]=m[3954],m[C+12>>2]=m[3955],m[Xt>>2]=m[k>>2],m[Xt+4>>2]=m[k+4>>2],$i(Xt,Me+168|0)|0,_p(Me,8,24,3),C=hs(128)|0,m[N+4>>2]=C,C|0){m[N>>2]=8,m[C>>2]=m[he>>2],m[C+4>>2]=m[he+4>>2],m[C+8>>2]=m[he+8>>2],m[C+12>>2]=m[he+12>>2],Et=C+16|0,m[Et>>2]=m[ie>>2],m[Et+4>>2]=m[ie+4>>2],m[Et+8>>2]=m[ie+8>>2],m[Et+12>>2]=m[ie+12>>2],Et=C+32|0,m[Et>>2]=m[K>>2],m[Et+4>>2]=m[K+4>>2],m[Et+8>>2]=m[K+8>>2],m[Et+12>>2]=m[K+12>>2],Et=C+48|0,m[Et>>2]=m[$>>2],m[Et+4>>2]=m[$+4>>2],m[Et+8>>2]=m[$+8>>2],m[Et+12>>2]=m[$+12>>2],Et=C+64|0,m[Et>>2]=m[V>>2],m[Et+4>>2]=m[V+4>>2],m[Et+8>>2]=m[V+8>>2],m[Et+12>>2]=m[V+12>>2],Et=C+80|0,m[Et>>2]=m[I>>2],m[Et+4>>2]=m[I+4>>2],m[Et+8>>2]=m[I+8>>2],m[Et+12>>2]=m[I+12>>2],Et=C+96|0,m[Et>>2]=m[R>>2],m[Et+4>>2]=m[R+4>>2],m[Et+8>>2]=m[R+8>>2],m[Et+12>>2]=m[R+12>>2],Et=C+112|0,m[Et>>2]=m[k>>2],m[Et+4>>2]=m[k+4>>2],m[Et+8>>2]=m[k+8>>2],m[Et+12>>2]=m[k+12>>2],Nn(Me),Et=158;break t}C=m[fe>>2]|0,C|0&&Nn(C),C=m[ye>>2]|0,C|0&&Nn(C),C=m[je>>2]|0,C|0&&Nn(C),C=m[We>>2]|0,C|0&&Nn(C),C=m[v>>2]|0,C|0&&Nn(C),C=m[w>>2]|0,C|0&&Nn(C),C=m[S>>2]|0,C|0&&Nn(C),C=m[De>>2]|0,C|0&&Nn(C),Nn(Me);break t}while(!1);C=0,R=0;do k=m[Me+(C*24|0)+12>>2]|0,k|0&&Nn(k),C=An(C|0,R|0,1,0)|0,R=ce()|0;while(R>>>0<I>>>0|(R|0)==(I|0)&C>>>0<V>>>0)}Nn(Me),Et=152}}else{if(($t|0)>0|($t|0)==0&Tt>>>0>0){R=0,I=0,V=0,k=0,C=0,$=0;do Ot=ht+(R*24|0)|0,Xt=I,I=m[Ot>>2]|0,Et=V,V=m[Ot+4>>2]|0,k=An(k|0,C|0,((I|0)!=(Xt|0)|(V|0)!=(Et|0))&1|0,0)|0,C=ce()|0,R=An(R|0,$|0,1,0)|0,$=ce()|0;while(($|0)<($t|0)|($|0)==($t|0)&R>>>0<Tt>>>0);We=k,je=C}else We=0,je=0;if(v=hs(We*24|0)|0,v){n:do if(($t|0)>=0){for(he=0,fe=0,k=0,R=0,ye=0,I=0;;){if(!((he|0)==(Tt|0)&(fe|0)==($t|0))&&(Xt=ht+(k*24|0)|0,Et=ht+(he*24|0)|0,(m[Xt>>2]|0)==(m[Et>>2]|0)?(m[Xt+4>>2]|0)==(m[Et+4>>2]|0):0))C=ye;else{if(K=ht+(k*24|0)|0,Et=va(he|0,fe|0,k|0,R|0)|0,Xt=ce()|0,ie=An(Et|0,Xt|0,-1,-1)|0,R=ce()|0,(Xt|0)>0|(Xt|0)==0&Et>>>0>1){if(C=hs(ie<<3)|0,!C)break;V=0,$=0;do Et=V,V=An(V|0,$|0,1,0)|0,$=ce()|0,Ot=K+(V*24|0)+16|0,Xt=m[Ot+4>>2]|0,Et=C+(Et<<3)|0,m[Et>>2]=m[Ot>>2],m[Et+4>>2]=Xt;while(($|0)<(R|0)|($|0)==(R|0)&V>>>0<ie>>>0)}else C=0;Xt=ht+(k*24|0)+16|0,Et=m[Xt+4>>2]|0,R=v+(I*24|0)+8|0,m[R>>2]=m[Xt>>2],m[R+4>>2]=Et,m[v+(I*24|0)+16>>2]=ie,m[v+(I*24|0)+20>>2]=C,be[v+(I*24|0)>>3]=+be[ht+(k*24|0)+8>>3],I=An(I|0,ye|0,1,0)|0,k=he,R=fe,C=ce()|0}if(Et=he,he=An(he|0,fe|0,1,0)|0,Xt=fe,fe=ce()|0,(Xt|0)<($t|0)|(Xt|0)==($t|0)&Et>>>0<Tt>>>0)ye=C;else break n}if((ye|0)>0|(ye|0)==0&I>>>0>0){C=0,R=0;do k=m[v+(C*24|0)+20>>2]|0,k|0&&Nn(k),C=An(C|0,R|0,1,0)|0,R=ce()|0;while((R|0)<(ye|0)|(R|0)==(ye|0)&C>>>0<I>>>0)}Nn(v),Et=152;break t}while(!1);if(_p(v,We,24,3),C=hs(We<<4)|0,R=N+4|0,m[R>>2]=C,C){m[N>>2]=We;do if((je|0)>0|(je|0)==0&We>>>0>0){if(N=v+8|0,m[C>>2]=m[N>>2],m[C+4>>2]=m[N+4>>2],m[C+8>>2]=m[N+8>>2],m[C+12>>2]=m[N+12>>2],(We|0)==1&(je|0)==0||(N=C+16|0,Et=v+32|0,m[N>>2]=m[Et>>2],m[N+4>>2]=m[Et+4>>2],m[N+8>>2]=m[Et+8>>2],m[N+12>>2]=m[Et+12>>2],!((je|0)>0|(je|0)==0&We>>>0>2)))break;C=2,k=0;do N=(m[R>>2]|0)+(C<<4)|0,Et=v+(C*24|0)+8|0,m[N>>2]=m[Et>>2],m[N+4>>2]=m[Et+4>>2],m[N+8>>2]=m[Et+8>>2],m[N+12>>2]=m[Et+12>>2],C=An(C|0,k|0,1,0)|0,k=ce()|0;while((k|0)<(je|0)|(k|0)==(je|0)&C>>>0<We>>>0)}while(!1);Nn(v),Et=158;break}else{if((je|0)>0|(je|0)==0&We>>>0>0){C=0,R=0;do k=m[v+(C*24|0)+20>>2]|0,k|0&&Nn(k),C=An(C|0,R|0,1,0)|0,R=ce()|0;while((R|0)<(je|0)|(R|0)==(je|0)&C>>>0<We>>>0)}Nn(v),Et=152;break}}else Et=152}while(!1);if((Et|0)==158)return Nn(Zt),Nn(nn),Nn(ht),nn=0,pe=rn,nn|0;if((Et|0)==152&&($t|0)>0|($t|0)==0&Tt>>>0>0)for(I=0,V=0,C=Tt,R=$t;k=m[ht+(I*24|0)+20>>2]|0,k?(Nn(k),k=$t,C=Tt):k=R,I=An(I|0,V|0,1,0)|0,V=ce()|0,(V|0)<(k|0)|(V|0)==(k|0)&I>>>0<C>>>0;)R=k;return Nn(ht),Nn(Zt),Nn(nn),nn=13,pe=rn,nn|0}while(!1);return Nn(Zt),Nn(nn),nn=13,pe=rn,nn|0}
vendor: 4,946 bytes, line 4281
4281else if((Et|0)==159)return pe=rn,C|0;return 0}function ad(v,w){v=v|0,w=w|0;var S=0,N=0;return N=v,v=m[N>>2]|0,N=m[N+4>>2]|0,S=w,w=m[S>>2]|0,S=m[S+4>>2]|0,(N>>>0<S>>>0|(N|0)==(S|0)&v>>>0<w>>>0?-1:(N>>>0>S>>>0|(N|0)==(S|0)&v>>>0>w>>>0)&1)|0}function z0(v){v=v|0;var w=0,S=0;return w=v+20|0,S=m[w>>2]|0,(S|0)==(v|0)?v|0:(S=z0(S)|0,m[w>>2]=S,S|0)}function G0(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0;return I=v,R=m[I>>2]|0,I=m[I+4>>2]|0,k=w,C=m[k>>2]|0,k=m[k+4>>2]|0,I>>>0<k>>>0|(I|0)==(k|0)&R>>>0<C>>>0?(w=-1,w|0):I>>>0>k>>>0|(I|0)==(k|0)&R>>>0>C>>>0?(w=1,w|0):(N=+be[v+8>>3],S=+be[w+8>>3],N<S?(w=-1,w|0):(w=N>S&1,w|0))}function q0(v,w){v=v|0,w=w|0;var S=0,N=0;return N=+be[v>>3],S=+be[w>>3],(N>S?-1:N<S&1)|0}function ax(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0;if(ie=pe,pe=pe+64|0,K=ie,I=ie+56|0,!(!0&(w&2013265920|0)==134217728&(!0&(N&2013265920|0)==134217728)))return C=5,pe=ie,C|0;if((v|0)==(S|0)&(w|0)==(N|0))return m[C>>2]=0,C=0,pe=ie,C|0;if(R=de(v|0,w|0,52)|0,ce()|0,R=R&15,$=de(S|0,N|0,52)|0,ce()|0,(R|0)!=($&15|0))return C=12,pe=ie,C|0;if(k=R+-1|0,R>>>0>1){Tg(v,w,k,K)|0,Tg(S,N,k,I)|0,$=K,V=m[$>>2]|0,$=m[$+4>>2]|0;e:do if((V|0)==(m[I>>2]|0)&&($|0)==(m[I+4>>2]|0)){R=(R^15)*3|0,k=de(v|0,w|0,R|0)|0,ce()|0,k=k&7,R=de(S|0,N|0,R|0)|0,ce()|0,R=R&7;do if((k|0)==0|(R|0)==0)m[C>>2]=1,k=0;else if((k|0)==7)k=5;else{if((k|0)==1|(R|0)==1&&Er(V,$)|0){k=5;break}if((m[15824+(k<<2)>>2]|0)!=(R|0)&&(m[15856+(k<<2)>>2]|0)!=(R|0))break e;m[C>>2]=1,k=0}while(!1);return C=k,pe=ie,C|0}while(!1)}k=K,R=k+56|0;do m[k>>2]=0,k=k+4|0;while((k|0)<(R|0));return qi(v,w,1,K)|0,w=K,!((m[w>>2]|0)==(S|0)&&(m[w+4>>2]|0)==(N|0))&&(w=K+8|0,!((m[w>>2]|0)==(S|0)&&(m[w+4>>2]|0)==(N|0)))&&(w=K+16|0,!((m[w>>2]|0)==(S|0)&&(m[w+4>>2]|0)==(N|0)))&&(w=K+24|0,!((m[w>>2]|0)==(S|0)&&(m[w+4>>2]|0)==(N|0)))&&(w=K+32|0,!((m[w>>2]|0)==(S|0)&&(m[w+4>>2]|0)==(N|0)))&&(w=K+40|0,!((m[w>>2]|0)==(S|0)&&(m[w+4>>2]|0)==(N|0)))?(k=K+48|0,k=((m[k>>2]|0)==(S|0)?(m[k+4>>2]|0)==(N|0):0)&1):k=1,m[C>>2]=k,C=0,pe=ie,C|0}function od(v,w,S,N,C){return v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,S=Rc(v,w,S,N)|0,(S|0)==7?(C=11,C|0):(N=me(S|0,0,56)|0,w=w&-2130706433|(ce()|0)|268435456,m[C>>2]=v|N,m[C+4>>2]=w,C=0,C|0)}function $0(v,w,S){return v=v|0,w=w|0,S=S|0,!0&(w&2013265920|0)==268435456?(m[S>>2]=v,m[S+4>>2]=w&-2130706433|134217728,S=0,S|0):(S=6,S|0)}function Oo(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0;return C=pe,pe=pe+16|0,N=C,m[N>>2]=0,!0&(w&2013265920|0)==268435456?(k=de(v|0,w|0,56)|0,ce()|0,N=yr(v,w&-2130706433|134217728,k&7,N,S)|0,pe=C,N|0):(N=6,pe=C,N|0)}function fp(v,w){v=v|0,w=w|0;var S=0;switch(S=de(v|0,w|0,56)|0,ce()|0,S&7){case 0:case 7:return S=0,S|0}return S=w&-2130706433|134217728,!(!0&(w&2013265920|0)==268435456)||!0&(w&117440512|0)==16777216&(Er(v,S)|0)!=0?(S=0,S|0):(S=K0(v,S)|0,S|0)}function pp(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0;return C=pe,pe=pe+16|0,N=C,!0&(w&2013265920|0)==268435456?(k=w&-2130706433|134217728,R=S,m[R>>2]=v,m[R+4>>2]=k,m[N>>2]=0,w=de(v|0,w|0,56)|0,ce()|0,N=yr(v,k,w&7,N,S+8|0)|0,pe=C,N|0):(N=6,pe=C,N|0)}function ld(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0;return C=(Er(v,w)|0)==0,w=w&-2130706433,N=S,m[N>>2]=C?v:0,m[N+4>>2]=C?w|285212672:0,N=S+8|0,m[N>>2]=v,m[N+4>>2]=w|301989888,N=S+16|0,m[N>>2]=v,m[N+4>>2]=w|318767104,N=S+24|0,m[N>>2]=v,m[N+4>>2]=w|335544320,N=S+32|0,m[N>>2]=v,m[N+4>>2]=w|352321536,S=S+40|0,m[S>>2]=v,m[S+4>>2]=w|369098752,0}function H0(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0;return R=pe,pe=pe+16|0,C=R,k=w&-2130706433|134217728,!0&(w&2013265920|0)==268435456?(N=de(v|0,w|0,56)|0,ce()|0,N=Dg(v,k,N&7)|0,(N|0)==-1?(m[S>>2]=0,k=6,pe=R,k|0):(Wl(v,k,C)|0&&at(27634,27035,282,27050),w=de(v|0,w|0,52)|0,ce()|0,w=w&15,Er(v,k)|0?X0(C,w,N,2,S):uh(C,w,N,2,S),k=0,pe=R,k|0)):(k=6,pe=R,k|0)}function W0(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0;return R=pe,pe=pe+16|0,N=R+8|0,C=R,k=w&-2130706433|134217728,!0&(w&2013265920|0)==268435456?(m[N>>2]=0,w=de(v|0,w|0,56)|0,ce()|0,w=yr(v,k,w&7,N,C)|0,w|0?(S=w,pe=R,S|0):(N=m[C>>2]|0,C=m[C+4>>2]|0,w=Rc(N,C,v,k)|0,(w|0)==7?(S=11,pe=R,S|0):(v=me(w|0,0,56)|0,k=C&-2130706433|(ce()|0)|268435456,m[S>>2]=N|v,m[S+4>>2]=k,S=0,pe=R,S|0))):(S=6,pe=R,S|0)}function ox(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0;m[S>>2]=0,$=+be[v>>3],K=+be[v+8>>3],V=+be[v+16>>3],C=0,k=5,N=5,v=0;do je=+be[15888+(C*24|0)>>3]-$,ye=+be[15888+(C*24|0)+8>>3]-K,R=+be[15888+(C*24|0)+16>>3]-V,R=je*je+ye*ye+R*R,R<N&&(m[S>>2]=C,k=R,v=C,N=R),C=C+1|0;while((C|0)!=20);if(k=+Un(+(1-k*.5)),k<1e-16)V=0,R=0;else{if(Ke=+be[16368+(v*24|0)>>3],Me=+be[15888+(v*24|0)>>3],ot=+be[15888+(v*24|0)+8>>3],De=+be[15888+(v*24|0)+16>>3],Ot=-(De+(Me*0+ot*0)),R=Me*Ot+0,je=ot*Ot+0,Ot=De*Ot+1,We=+Pt(+(Ot*Ot+(R*R+je*je))),We=We>0?1/We:0,R=R*We,je=je*We,We=Ot*We,Ot=-($*Me+K*ot+V*De),ye=$+Me*Ot,N=K+ot*Ot,$=V+De*Ot,K=+Pt(+($*$+(ye*ye+N*N))),K=K>0?1/K:0,ye=ye*K,N=N*K,K=$*K,N=+dh(Ke-+dh(+Ir(+(K*(ot*R-Me*je)+(ye*(De*je-ot*We)+N*(Me*We-
4281De*R))),+(We*K+(R*ye+je*N))))),Ni(w)|0?R=+dh(N+-.3334731722518321):R=N,N=+zn(+k)*2.618033988749896,(w|0)>0){v=0;do N=N*2.6457513110645907,v=v+1|0;while((v|0)!=(w|0))}V=+bn(+R)*N,R=+wn(+R)*N}w=S+4|0,fe=S+12|0,m[fe>>2]=0,k=+Qt(+R)*1.1547005383792515,N=+Qt(+V)+k*.5,v=~~N,C=~~k,N=N-+(v|0),k=k-+(C|0);do if(N<.5)if(N<.3333333333333333)if(m[w>>2]=v,k<(N+1)*.5){m[S+8>>2]=C;break}else{C=C+1|0,m[S+8>>2]=C;break}else if(Ot=1-N,C=(!(k<Ot)&1)+C|0,m[S+8>>2]=C,Ot<=k&k<N*2){v=v+1|0,m[w>>2]=v;break}else{m[w>>2]=v;break}else{if(!(N<.6666666666666666))if(v=v+1|0,m[w>>2]=v,k<N*.5){m[S+8>>2]=C;break}else{C=C+1|0,m[S+8>>2]=C;break}if(k<1-N){if(m[S+8>>2]=C,N*2+-1<k){m[w>>2]=v;break}}else C=C+1|0,m[S+8>>2]=C;v=v+1|0,m[w>>2]=v}while(!1);do if(V<0)if(C&1){he=(C+1|0)/2|0,he=va(v|0,((v|0)<0)<<31>>31|0,he|0,((he|0)<0)<<31>>31|0)|0,v=~~(+(v|0)-((+(he>>>0)+4294967296*+(ce()|0))*2+1)),m[w>>2]=v,he=w;break}else{he=(C|0)/2|0,he=va(v|0,((v|0)<0)<<31>>31|0,he|0,((he|0)<0)<<31>>31|0)|0,v=~~(+(v|0)-(+(he>>>0)+4294967296*+(ce()|0))*2),m[w>>2]=v,he=w;break}else he=w;while(!1);ie=S+8|0,w=0-C|0,R<0?(S=v-((C<<1|1|0)/2|0)|0,m[he>>2]=S,m[ie>>2]=w,C=w):S=v,v=C-S|0,w=0-S|0,(S|0)<0?(m[ie>>2]=v,m[fe>>2]=w,m[he>>2]=0,I=0):(v=C,I=S,w=0),S=I-v|0,C=w-v|0,(v|0)<0?(m[he>>2]=S,m[fe>>2]=C,m[ie>>2]=0,I=S,v=0):C=w,S=I-C|0,w=v-C|0,(C|0)<0?(m[he>>2]=S,m[ie>>2]=w,m[fe>>2]=0,C=0):(w=v,S=I),v=(w|0)<(S|0)?w:S,v=(C|0)<(v|0)?C:v,!((v|0)<=0)&&(m[he>>2]=S-v,m[ie>>2]=w-v,m[fe>>2]=C-v)}function ch(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0;N=pe,pe=pe+16|0,C=N,R=m[v+12>>2]|0,k=+((m[v+8>>2]|0)-R|0),be[C>>3]=+((m[v+4>>2]|0)-R|0)-k*.5,be[C+8>>3]=k*.8660254037844386,Ko(C,m[v>>2]|0,w,0,S),pe=N}function Ko(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0;if(k=+Vy(v),k<1e-16){w=15888+(w*24|0)|0,m[C>>2]=m[w>>2],m[C+4>>2]=m[w+4>>2],m[C+8>>2]=m[w+8>>2],m[C+12>>2]=m[w+12>>2],m[C+16>>2]=m[w+16>>2],m[C+20>>2]=m[w+20>>2];return}if(R=+Ir(+ +be[v+8>>3],+ +be[v>>3]),(S|0)>0){v=0;do k=k*.37796447300922725,v=v+1|0;while((v|0)!=(S|0))}I=k*.3333333333333333,N?(S=(Ni(S)|0)==0,k=+xr(+((S?I:I*.37796447300922725)*.381966011250105))):(k=+xr(+(k*.381966011250105)),Ni(S)|0&&(R=+dh(R+.3334731722518321))),ie=+dh(+be[16368+(w*24|0)>>3]-R),I=+be[15888+(w*24|0)>>3],K=+be[15888+(w*24|0)+8>>3],je=+be[15888+(w*24|0)+16>>3],fe=-(je+(I*0+K*0)),$=I*fe+0,R=K*fe+0,fe=je*fe+1,he=+Pt(+(fe*fe+($*$+R*R))),he=he>0?1/he:0,$=$*he,R=R*he,he=fe*he,fe=+bn(+ie),ie=+wn(+ie),We=+bn(+k),ye=+wn(+k),V=We*I+ye*(fe*$+ie*(je*R-K*he)),k=We*K+ye*(fe*R+ie*(I*he-je*$)),R=We*je+ye*(fe*he+ie*(K*$-I*R)),I=+Pt(+(R*R+(V*V+k*k))),I=I>0?1/I:0,be[C>>3]=V*I,be[C+8>>3]=k*I,be[C+16>>3]=R*I}function X0(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0,Xt=0,Et=0,Zt=0,nn=0,rn=0,oi=0,li=0,Ga=0,Lr=0,Br=0,Vr=0,ji=0,Is=0,Ss=0,na=0,_l=0,io=0,la=0,Vc=0,qa=0,Ii=0,Tu=0;if(_l=pe,pe=pe+256|0,k=_l+240|0,oi=_l+224|0,Is=_l,Ss=_l+208|0,na=_l+192|0,li=_l+168|0,Ga=_l+152|0,Lr=_l+136|0,Br=_l+120|0,Vr=_l+104|0,ji=_l+80|0,m[k>>2]=w,m[oi>>2]=m[v>>2],m[oi+4>>2]=m[v+4>>2],m[oi+8>>2]=m[v+8>>2],m[oi+12>>2]=m[v+12>>2],Do(oi,k,Is),m[C>>2]=0,oi=N+S+((N|0)==5&1)|0,(oi|0)<=(S|0)){pe=_l;return}Ke=m[k>>2]|0,ot=Ss+4|0,De=Ss+8|0,Me=Ss+12|0,Ot=na+8|0,$t=S+5|0,Tt=16848+(Ke<<2)|0,ht=li+8|0,Xt=16928+(Ke<<2)|0,Et=Ga+8|0,Zt=Lr+8|0,nn=Br+8|0,rn=na+8|0,fe=li+8|0,je=li+16|0,ye=ji+8|0,We=ji+16|0,he=S,N=0,R=0,I=0,V=0;e:for(;;){ie=Is+(((he|0)%5|0)<<4)|0,m[Ss>>2]=m[ie>>2],m[Ss+4>>2]=m[ie+4>>2],m[Ss+8>>2]=m[ie+8>>2],m[Ss+12>>2]=m[ie+12>>2];do;while((Lc(Ss,Ke,0,1)|0)==2);if((he|0)>(S|0)&(Ni(w)|0)!=0){if(ie=m[Ss>>2]|0,v=m[ot>>2]|0,$=m[De>>2]|0,k=m[Me>>2]|0,io=+(I-V|0),be[na>>3]=+(R-V|0)-io*.5,be[Ot>>3]=io*.8660254037844386,V=m[17008+(ie*80|0)+(N<<2)>>2]|0,K=m[18608+(ie*80|0)+(V*20|0)>>2]|0,I=m[18608+(ie*80|0)+(V*20|0)+16>>2]|0,(I|0)>0){R=0,N=$;do qa=k+v|0,Ii=(qa|0)<0,$=N+v-(Ii?qa:0)|0,Vc=($|0)<0,la=k+N-(Ii?qa:0)-(Vc?$:0)|0,k=(la|0)<0,v=(Ii?0:qa)-(Vc?$:0)-(k?la:0)|0,N=(Vc?0:$)-(k?la:0)|0,la=k?0:la,k=(N|0)<(v|0)?N:v,k=(la|0)<(k|0)?la:k,$=(k|0)>0,v=v-($?k:0)|0,N=N-($?k:0)|0,k=la-($?k:0)|0,R=R+1|0;while((R|0)<(I|0))}else N=$;switch(Ii=(m[Tt>>2]|0)*3|0,la=(si(Ii,m[18608+(ie*80|0)+(V*20|0)+4>>2]|0)|0)+v|0,$=(si(Ii,m[18608+(ie*80|0)+(V*20|0)+8>>2]|0)|0)+N|0,Ii=(si(Ii,m[18608+(ie*80|0)+(V*20|0)+12>>2]|0)|0)+k|0,V=(la|0)<0,$=$-(V?la:0)|0,Vc=($|0)<0,Ii=Ii+(V?0-la|0:0)+(Vc?0-$|0:0)|0,qa=(Ii|0)<0,la=(V?0:la)-(Vc?$:0)-(qa?Ii:0)|0,$=(Vc?0:$)-(qa?Ii:0)|0,Ii=qa?0:Ii,qa=($|0)<(la|0)?$:la,qa=(Ii|0)<(qa|0)?Ii:qa,Vc=(qa|0)>0,Ii=Ii-(Vc?qa:0)|0,io=+($-(Vc?qa:0)-Ii|0),be[li>>3]=+(la-(Vc?qa:0)-Ii|0)-io*.5,be[ht>>3]=io*.8660254037844386,io=+(m[Xt>>2]|0),be[Ga>>3]=io*3,be[Et>>3]=0,Tu=io*-1.5,be[Lr>>3]=Tu,be[Zt>>3]=io*2.598076211353316,be[Br>>3]=Tu,be[nn>>3]=io*-2.598076211353316,m[17008+(K*80|0)+(ie<<2)>>2]|0){case 1:{v=Lr,N=Ga;break}case 3:{v=Br,N=Lr;break}case 2:{v=Ga,N=Br;break}default:{v=12;break e}}_s(na,li,N,v,Vr),Ko(Vr,K,Ke,1,ji),Ii=m[C>>2]|0,io=+_n(+ +be[We>>3]),Tu=+Ir(+ +be[ye>>3],+ +be[ji>>3]),be[C+8+(Ii<<4)>>3]=io,be[C+8+(Ii<<4)+8>>3]=Tu,m[C>>2]=(m[C>>2]|0)+1}if((he|0)<($t|0)&&(Ii=m[Me>>2]|0,io=+((m[De>>2]|0)-Ii|0),be[na>>3]=+((m[ot>>2]|0)-Ii|0)-io*.5,be[rn>>3]=io*.8660254037844386,Ko(na,m[Ss>>2]|0,Ke,1,li),Ii=m[C>>2]|0,io=+_n(+ +be[je>>3]),Tu=+Ir(+ +be[fe>>3],+ +be[li>>3]),be[C+8+(Ii<<4)>>3]=io,be[C+8+(Ii<<4)+8>>3]=Tu,m[C>>2]=(m[C>>2]|0)+1),he=he+1|0,(he|0)>=(oi|0)){v=3;break}else N=m[Ss>>2]|0,R=m[ot>>2]|0,I=m[De>>2]|0,V=m[Me>>2]|0}if((v|0)==3){pe=_l;return}else(v|0)==12&&at(27073,27120,599,27130)}function Do(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0;ye=pe,pe=pe+128|0,N=ye+64|0,C=ye,k=N,R=20208,I=k+60|0;do m[k>>2]=m[R>>2],k=k+4|0,R=R+4|0;while((k|0)<(I|0));k=C,R=20272,I=k+60|0;do m[k>>2]=m[R>>2],k=k+4|0,R=R+4|0;while((k|0)<(I|0));if(K=(Ni(m[w>>2]|0)|0)==0,K=K?N:C,fe=v+4|0,k=m[fe>>2]|0,ie=v+8|0,N=m[ie>>2]|0,he=v+12|0,C=m[he>>2]|0,R=N+(k<<1)|0,m[fe>>2]=R,N=C+(N<<1)|0,m[ie>>2]=N,k=(C<<1)+k|0,m[he>>2]=k,C=N-R|0,I=k-R|0,(R|0)<0&&(m[ie>>2]=C,m[he>>2]=I,m[fe>>2]=0,N=C,R=0,k=I),I=R-N|0,C=k-N|0,(N|0)<0?(m[fe>>2]=I,m[he>>2]=C,m[ie>>2]=0,N=0):(C=k,I=R),R=I-C|0,k=N-C|0,(C|0)<0?(m[fe>>2]=R,m[ie>>2]=k,m[he>>2]=0,C=0):(k=N,R=I),N=(k|0)<(R|0)?k:R,N=(C|0)<(N|0)?C:N,(N|0)>0&&(C=C-N|0,k=k-N|0,R=R-N|0,m[fe>>2]=R,m[ie>>2]=k,m[he>>2]=C),V=(k<<1)+R|0,I=C+(R<<1)|0,m[fe>>2]=I,m[ie>>2]=V,k=(C<<1)+k|0,m[he>>2]=k,N=V-I|0,C=k-I|0,(I|0)<0?(m[ie>>2]=N,m[he>>2]=C,m[fe>>2]=0,I=0,k=C):N=V,R=I-N|0,C=k-N|0,(N|0)<0?(m[fe>>2]=R,m[he>>2]=C,m[ie>>2]=0,I=R,N=0):C=k,R=I-C|0,k=N-C|0,(C|0)<0?(m[fe>>2]=R,m[ie>>2]=k,m[he>>2]=0,C=0):(k=N,R=I),N=(k|0)<(R|0)?k:R,N=(C|0)<(N|0)?C:N,(N|0)>0&&(m[fe>>2]=R-N,m[ie>>2]=k-N,m[he>>2]=C-N),Ni(m[w>>2]|0)|0&&(k=m[fe>>2]|0,R=m[ie>>2]|0,C=m[he>>
vendor: 9,011 bytes, line 4281
42812]|0,N=(R*3|0)+k|0,k=C+(k*3|0)|0,m[fe>>2]=k,m[ie>>2]=N,R=(C*3|0)+R|0,m[he>>2]=R,C=N-k|0,I=R-k|0,(k|0)<0?(m[ie>>2]=C,m[he>>2]=I,m[fe>>2]=0,N=C,V=0):(V=k,I=R),k=V-N|0,C=I-N|0,(N|0)<0?(m[fe>>2]=k,m[he>>2]=C,m[ie>>2]=0,V=k,R=0):(R=N,C=I),k=V-C|0,N=R-C|0,(C|0)<0?(m[fe>>2]=k,m[ie>>2]=N,m[he>>2]=0,R=N,C=0):k=V,N=(R|0)<(k|0)?R:k,N=(C|0)<(N|0)?C:N,(N|0)>0&&(m[fe>>2]=k-N,m[ie>>2]=R-N,m[he>>2]=C-N),m[w>>2]=(m[w>>2]|0)+1),m[S>>2]=m[v>>2],C=m[ie>>2]|0,N=m[he>>2]|0,w=m[K+4>>2]|0,$=m[K+8>>2]|0,R=(m[K>>2]|0)+(m[fe>>2]|0)|0,V=S+4|0,m[V>>2]=R,C=w+C|0,w=S+8|0,m[w>>2]=C,N=$+N|0,$=S+12|0,m[$>>2]=N,k=C-R|0,(R|0)<0&&(N=N-R|0,m[w>>2]=k,m[$>>2]=N,m[V>>2]=0,C=k,R=0),(C|0)<0&&(R=R-C|0,m[V>>2]=R,N=N-C|0,m[$>>2]=N,m[w>>2]=0,C=0),I=R-N|0,k=C-N|0,(N|0)<0?(m[V>>2]=I,m[w>>2]=k,m[$>>2]=0,R=I,N=0):k=C,C=(k|0)<(R|0)?k:R,C=(N|0)<(C|0)?N:C,(C|0)>0&&(m[V>>2]=R-C,m[w>>2]=k-C,m[$>>2]=N-C),m[S+16>>2]=m[v>>2],C=m[ie>>2]|0,N=m[he>>2]|0,w=m[K+16>>2]|0,$=m[K+20>>2]|0,R=(m[K+12>>2]|0)+(m[fe>>2]|0)|0,V=S+20|0,m[V>>2]=R,C=w+C|0,w=S+24|0,m[w>>2]=C,N=$+N|0,$=S+28|0,m[$>>2]=N,k=C-R|0,(R|0)<0&&(N=N-R|0,m[w>>2]=k,m[$>>2]=N,m[V>>2]=0,C=k,R=0),(C|0)<0&&(R=R-C|0,m[V>>2]=R,N=N-C|0,m[$>>2]=N,m[w>>2]=0,C=0),I=R-N|0,k=C-N|0,(N|0)<0?(m[V>>2]=I,m[w>>2]=k,m[$>>2]=0,R=I,N=0):k=C,C=(k|0)<(R|0)?k:R,C=(N|0)<(C|0)?N:C,(C|0)>0&&(m[V>>2]=R-C,m[w>>2]=k-C,m[$>>2]=N-C),m[S+32>>2]=m[v>>2],C=m[ie>>2]|0,N=m[he>>2]|0,w=m[K+28>>2]|0,$=m[K+32>>2]|0,R=(m[K+24>>2]|0)+(m[fe>>2]|0)|0,V=S+36|0,m[V>>2]=R,C=w+C|0,w=S+40|0,m[w>>2]=C,N=$+N|0,$=S+44|0,m[$>>2]=N,k=C-R|0,(R|0)<0&&(N=N-R|0,m[w>>2]=k,m[$>>2]=N,m[V>>2]=0,C=k,R=0),(C|0)<0&&(R=R-C|0,m[V>>2]=R,N=N-C|0,m[$>>2]=N,m[w>>2]=0,C=0),I=R-N|0,k=C-N|0,(N|0)<0?(m[V>>2]=I,m[w>>2]=k,m[$>>2]=0,R=I,N=0):k=C,C=(k|0)<(R|0)?k:R,C=(N|0)<(C|0)?N:C,(C|0)>0&&(m[V>>2]=R-C,m[w>>2]=k-C,m[$>>2]=N-C),m[S+48>>2]=m[v>>2],C=m[ie>>2]|0,N=m[he>>2]|0,w=m[K+40>>2]|0,$=m[K+44>>2]|0,R=(m[K+36>>2]|0)+(m[fe>>2]|0)|0,V=S+52|0,m[V>>2]=R,C=w+C|0,w=S+56|0,m[w>>2]=C,N=$+N|0,$=S+60|0,m[$>>2]=N,k=C-R|0,(R|0)<0&&(N=N-R|0,m[w>>2]=k,m[$>>2]=N,m[V>>2]=0,C=k,R=0),(C|0)<0&&(R=R-C|0,m[V>>2]=R,N=N-C|0,m[$>>2]=N,m[w>>2]=0,C=0),I=R-N|0,k=C-N|0,(N|0)<0?(m[V>>2]=I,m[w>>2]=k,m[$>>2]=0,R=I,N=0):k=C,C=(k|0)<(R|0)?k:R,C=(N|0)<(C|0)?N:C,(C|0)>0&&(m[V>>2]=R-C,m[w>>2]=k-C,m[$>>2]=N-C),m[S+64>>2]=m[v>>2],k=m[ie>>2]|0,N=m[he>>2]|0,$=m[K+52>>2]|0,V=m[K+56>>2]|0,R=(m[K+48>>2]|0)+(m[fe>>2]|0)|0,w=S+68|0,m[w>>2]=R,k=$+k|0,$=S+72|0,m[$>>2]=k,N=V+N|0,V=S+76|0,m[V>>2]=N,C=k-R|0,(R|0)<0?(N=N-R|0,m[$>>2]=C,m[V>>2]=N,m[w>>2]=0,k=0):(C=k,k=R),(C|0)<0&&(k=k-C|0,m[w>>2]=k,N=N-C|0,m[V>>2]=N,m[$>>2]=0,C=0),I=k-N|0,R=C-N|0,(N|0)<0?(m[w>>2]=I,m[$>>2]=R,m[V>>2]=0,k=I,N=0):R=C,C=(R|0)<(k|0)?R:k,C=(N|0)<(C|0)?N:C,(C|0)<=0){pe=ye;return}m[w>>2]=k-C,m[$>>2]=R-C,m[V>>2]=N-C,pe=ye}function Lc(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0;if(he=m[16928+(w<<2)>>2]|0,ie=(N|0)!=0,he=ie?he*3|0:he,K=v+4|0,I=m[K>>2]|0,$=v+8|0,k=m[$>>2]|0,ie){if(R=v+12|0,N=m[R>>2]|0,C=k+I+N|0,(C|0)==(he|0))return he=1,he|0;V=R}else V=v+12|0,C=m[V>>2]|0,N=C,C=k+I+C|0;if((C|0)<=(he|0))return he=0,he|0;do if((N|0)>0){if(C=m[v>>2]|0,(k|0)>0){C=18608+(C*80|0)+60|0,R=I;break}C=18608+(C*80|0)+40|0,S?(R=I-he|0,S=k+R|0,fe=(S|0)<0,k=N+k-(fe?S:0)|0,I=(k|0)<0,N=N+R-(fe?S:0)-(I?k:0)|0,R=(N|0)<0,S=(fe?0:S)-(I?k:0)-(R?N:0)|0,k=(I?0:k)-(R?N:0)|0,N=R?0:N,R=(k|0)<(S|0)?k:S,R=(N|0)<(R|0)?N:R,I=(R|0)>0,k=k-(I?R:0)|0,N=N-(I?R:0)|0,R=S-(I?R:0)+he|0,m[K>>2]=R,m[$>>2]=k,m[V>>2]=N):R=I}else C=18608+((m[v>>2]|0)*80|0)+20|0,R=I;while(!1);if(m[v>>2]=m[C>>2],I=m[C+16>>2]|0,(I|0)>0){S=0;do fe=N+R|0,ye=(fe|0)<0,De=ye?fe:0,je=k+R-De|0,We=(je|0)<0,v=We?je:0,R=N+k-De-v|0,k=(R|0)<0,N=k?0:R,R=k?R:0,k=(We?0:je)-R|0,R=(ye?0:fe)-v-R|0,v=(k|0)<(R|0)?k:R,v=(N|0)<(v|0)?N:v,(v|0)>0&&(R=R-v|0,k=k-v|0,N=N-v|0),S=S+1|0;while((S|0)<(I|0));m[K>>2]=R,m[$>>2]=k,m[V>>2]=N}return je=m[16848+(w<<2)>>2]|0,je=ie?je*3|0:je,We=si(je,m[C+8>>2]|0)|0,De=si(je,m[C+12>>2]|0)|0,R=(si(je,m[C+4>>2]|0)|0)+R|0,m[K>>2]=R,k=We+k|0,m[$>>2]=k,N=De+N|0,m[V>>2]=N,C=k-R|0,(R|0)<0?(N=N-R|0,m[$>>2]=C,m[V>>2]=N,m[K>>2]=0,k=0):(C=k,k=R),(C|0)<0?(v=k-C|0,m[K>>2]=v,N=N-C|0,m[V>>2]=N,m[$>>2]=0,R=0):(v=k,R=C),k=v-N|0,C=R-N|0,(N|0)<0?(m[K>>2]=k,m[$>>2]=C,m[V>>2]=0,N=0):(C=R,k=v),R=(C|0)<(k|0)?C:k,R=(N|0)<(R|0)?N:R,(R|0)>0&&(k=k-R|0,C=C-R|0,N=N-R|0,m[K>>2]=k,m[$>>2]=C,m[V>>2]=N),ie?(De=(C+k+N|0)==(he|0)?1:2,De|0):(De=2,De|0)}function $l(v,w){v=v|0,w=w|0;var S=0;do S=Lc(v,w,0,1)|0;while((S|0)==2);return S|0}function uh(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0,Xt=0,Et=0,Zt=0,nn=0,rn=0,oi=0,li=0,Ga=0,Lr=0,Br=0,Vr=0,ji=0,Is=0,Ss=0,na=0;if(ji=pe,pe=pe+272|0,k=ji+256|0,R=ji+240|0,Lr=ji,Br=ji+224|0,Vr=ji+208|0,Et=ji+184|0,Zt=ji+168|0,nn=ji+152|0,rn=ji+136|0,oi=ji+120|0,li=ji+96|0,m[k>>2]=w,m[R>>2]=m[v>>2],m[R+4>>2]=m[v+4>>2],m[R+8>>2]=m[v+8>>2],m[R+12>>2]=m[v+12>>2],Y0(R,k,Lr),m[C>>2]=0,Xt=N+S+((N|0)==6&1)|0,(Xt|0)<=(S|0)){pe=ji;return}De=m[k>>2]|0,Me=S+6|0,ot=Vr+8|0,Ke=Et+8|0,Ot=16928+(De<<2)|0,$t=Zt+8|0,Tt=nn+8|0,ht=rn+8|0,je=m[R>>2]|0,he=Br+4|0,fe=Br+8|0,ye=Br+12|0,We=Vr+8|0,V=Et+8|0,K=Et+16|0,$=li+8|0,ie=li+16|0,R=0,I=S,N=-1;e:for(;;){if(k=(I|0)%6|0,v=Lr+(k<<4)|0,m[Br>>2]=m[v>>2],m[Br+4>>2]=m[v+4>>2],m[Br+8>>2]=m[v+8>>2],m[Br+12>>2]=m[v+12>>2],v=R,R=Lc(Br,De,0,1)|0,(I|0)>(S|0)&(Ni(w)|0)!=0&&(Ga=m[Br>>2]|0,(v|0)!=1&(Ga|0)!=(N|0))){switch(na=(k+5|0)%6|0,v=m[Lr+(na<<4)+12>>2]|0,Is=+((m[Lr+(na<<4)+8>>2]|0)-v|0),be[Vr>>3]=+((m[Lr+(na<<4)+4>>2]|0)-v|0)-Is*.5,be[ot>>3]=Is*.8660254037844386,v=m[Lr+(k<<4)+12>>2]|0,Is=+((m[Lr+(k<<4)+8>>2]|0)-v|0),be[Et>>3]=+((m[Lr+(k<<4)+4>>2]|0)-v|0)-Is*.5,be[Ke>>3]=Is*.8660254037844386,Is=+(m[Ot>>2]|0),be[Zt>>3]=Is*3,be[$t>>3]=0,Ss=Is*-1.5,be[nn>>3]=Ss,be[Tt>>3]=Is*2.598076211353316,be[rn>>3]=Ss,be[ht>>3]=Is*-2.598076211353316,m[17008+(je*80|0)+(((N|0)==(je|0)?Ga:N)<<2)>>2]|0){case 1:{v=nn,N=Zt;break}case 3:{v=rn,N=nn;break}case 2:{v=Zt,N=rn;break}default:{v=8;break e}}_s(Vr,Et,N,v,oi),!(Og(Vr,oi)|0)&&!(Og(Et,oi)|0)&&(Ko(oi,je,De,1,li),na=m[C>>2]|0,Is=+_n(+ +be[ie>>3]),Ss=+Ir(+ +be[$>>3],+ +be[li>>3]),be[C+8+(na<<4)>>3]=Is,be[C+8+(na<<4)+8>>3]=Ss,m[C>>2]=(m[C>>2]|0)+1)}if((I|0)<(Me|0)&&(na=m[ye>>2]|0,Is=+((m[fe>>2]|0)-na|0),be[Vr>>3]=+((m[he>>2]|0)-na|0)-Is*.5,be[We>>3]=Is*.8660254037844386,Ko(Vr,m[Br>>2]|0,De,1,Et),na=m[C>>2]|0,Is=+_n(+ +be[K>>3]),Ss=+Ir(+ +be[V>>3],+ +be[Et>>3]),be[C+8+(na<<4)>>3]=Is,be[C+8+(na<<4)+8>>3]=Ss,m[C>>2]=(m[C>>2]|0)+1),I=I+1|0,(I|0)>=(Xt|0)){v=3;break}else N=m[Br>>2]|0}if((v|0)==3){pe=ji;return}else(v|0)==8&&at(27157,27120,766,27202)}function Y0(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0;je=pe,pe=pe+160|0,N=je+80|0,C=je,k=N,R=20336,I=k+72|0;do m[k>>2]=m[R>>2],k=k+4|0,R=R+4|0;while((k|0)<(I|0));k=C,R=20416,I=k+72|0;do m[k>>2]=m[R>>2],k=k+4|0,R=R+4|0;while((k|0)<(I|0));ie=(Ni(m[w>>2]|0)|0)==0,ie=ie?N:C,ye=v+4|0,k=m[ye>>2]|0,he=v+8|0,N=m[he>>2]|0,fe=v+12|0,C=m[fe>>2]|0,R=N+(k<<1)|0,m[ye>>2]=R,N=C+(N<<1)|0,m[he>>2]=N,k=(C<<1)+k|0,m[fe>>2]=k,C=N-R|0,I=k-R|0,(R|0)<0&&(m[he>>2]=C,m[fe>>2]=I,m[ye>>2]=0,N=C,R=0,k=I),I=R-N|0,C=k-N|0,(N|0)<0?(m[ye>>2]=I,m[fe>>2]=C,m[he>>2]=0,N=0):(C=k,I=R),R=I-C|0,k=N-C|0,(C|0)<0?(m[ye>>2]=R,m[he>>2]=k,m[fe>>2]=0,C=0):(k=N,R=I),N=(k|0)<(R|0)?k:R,N=(C|0)<(N|0)?C:N,(N|0)>0&&(C=C-N|0,k=k-N|0,R=R-N|0,m[ye>>2]=R,m[he>>2]=k,m[fe>>2]=C),V=(k<<1)+R|0,I=C+(R<<1)|0,m[ye>>2]=I,m[he>>2]=V,k=(C<<1)+k|0,m[fe>>2]=k,N=V-I|0,C=k-I|0,(I|0)<0?(m[he>>2]=N,m[fe>>2]=C,m[ye>>2]=0,I=0,k=C):N=V,R=I-N|0,C=k-N|0,(N|0)<0?(m[ye>>2]=R,m[fe>>2]=C,m[he>>2]=0,I=R,N=0):C=k,R=I-C|0,k=N-C|0,(C|0)<0?(m[ye>>2]=R,m[he>>2]=k,m[fe>>2]=0,C=0):(k=N,R=I),N=(k|0)<(R|0)?k:R,N=(C|0)<(N|0)?C:N,(N|0)>0&&(m[ye>>2]=R-N,m[he>>2]=k-N,m[fe>>2]=C-N),Ni(m[w>>2]|0)|0&&(k=m[ye>>2]|0,R=m[he>>2]|0,C=m[fe>>2]|0,N=(R*3|0)+k|0,k=C+(k*3|0)|0,m[ye>>2]=k,m[he>>2]=N,R=(C*3|0)+R|0,m[fe>>2]=R,C=N-k|0,I=R-k|0,(k|0)<0?(m[he>>2]=C,m[fe>>2]=I,m[ye>>2]=0,N=C,V=0):(V=k,I=R),k=V-N|0,C=I-N|0,(N|0)<0?(m[ye>>2]=k,m[fe>>2]=C,m[he>>2]=0,V=k,R=0):(R=N,C=I),k=V-C|0,N=R-C|0,(C|0)<0?(m[ye>>2]=k,m[he>>2]=N,m[fe>>2]=0,R=N,C=0):k=V,N=(R|0)<(k|0)?R:k,N=(C|0)<(N|0)?C:N,(N|0)>0&&(m[ye>>2]=k-N,m[he>>2]=R-N,m[fe>>2]=C-N),m[w>>2]=(m[w>>2]|0)+1),V=0;do m[S+(V<<4)>>2]=m[v>>2],C=m[he>>2]|0,N=m[fe>>2]|0,$=m[ie+(V*12|0)+4>>2]|0,K=m[ie+(V*12|0)+8>>2]|0,R=(m[ie+(V*12|0)>>2]|0)+(m[ye>>2]|0)|0,w=S+(V<<4)+4|0,m[w>>2]=R,C=$+C|0,$=S+(V<<4)+8|0,m[$>>2]=C,N=K+N|0,K=S+(V<<4)+12|0,m[K>>2]=N,k=C-R|0,(R|0)<0&&(N=N-R|0,m[$>>2]=k,m[K>>2]=N,m[w>>2]=0,C=k,R=0),(C|0)<0&&(R=R-C|0,m[w>>2]=R,N=N-C|0,m[K>>2]=N,m[$>>2]=0,C=0),I=R-N|0,k=C-N|0,(N|0)<0?(m[w>>2]=I,m[$>>2]=k,m[K>>2]=0,R=I,N=0):k=C,C=(k|0)<(R|0)?k:R,C=(N|0)<(C|0)?N:C,(C|0)>0&&(m[w>>2]=R-C,m[$>>2]=k-C,m[K>>2]=N-C),V=V+1|0;while((V|0)!=6);pe=je}function Q0(v,w){return v=v|0,w=w|0,w=de(v|0,w|0,52)|0,ce()|0,w&15|0}function Iy(v,w){return v=v|0,w=w|0,w=de(v|0,w|0,45)|0,ce()|0,w&127|0}function B_(v,w,S,N){return v=v|0,w=w|0,S=S|0,N=N|0,(S+-1|0)>>>0>14?(N=4,N|0):(S=de(v|0,w|0,(15-S|0)*3|0)|0,ce()|0,m[N>>2]=S&7,N=0,N|0)}function V_(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;
4281var C=0,k=0,R=0,I=0,V=0,$=0;if(v>>>0>15)return N=4,N|0;if(w>>>0>121)return N=17,N|0;R=me(v|0,0,52)|0,C=ce()|0,I=me(w|0,0,45)|0,C=C|(ce()|0)|134225919;e:do if((v|0)>=1){for(I=1,R=($e[20496+w>>0]|0)!=0,k=-1;;){if(w=m[S+(I+-1<<2)>>2]|0,w>>>0>6){C=18,w=10;break}if(!((w|0)==0|R^1))if((w|0)==1){C=19,w=10;break}else R=0;if($=(15-I|0)*3|0,V=me(7,0,$|0)|0,C=C&~(ce()|0),w=me(w|0,((w|0)<0)<<31>>31|0,$|0)|0,k=w|k&~V,C=ce()|0|C,(I|0)<(v|0))I=I+1|0;else break e}if((w|0)==10)return C|0}else k=-1;while(!1);return $=N,m[$>>2]=k,m[$+4>>2]=C,$=0,$|0}function K0(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0;return!(!0&(w&-16777216|0)==134217728)||(N=de(v|0,w|0,52)|0,ce()|0,N=N&15,S=de(v|0,w|0,45)|0,ce()|0,S=S&127,S>>>0>121)?(v=0,v|0):(R=(N^15)*3|0,C=de(v|0,w|0,R|0)|0,R=me(C|0,ce()|0,R|0)|0,C=ce()|0,k=va(-1227133514,-1171,R|0,C|0)|0,!((R&613566756&k|0)==0&(C&4681&(ce()|0)|0)==0)||(R=(N*3|0)+19|0,k=me(~v|0,~w|0,R|0)|0,R=de(k|0,ce()|0,R|0)|0,!((N|0)==15|(R|0)==0&(ce()|0)==0))?(R=0,R|0):!($e[20496+S>>0]|0)||(w=w&8191,(v|0)==0&(w|0)==0)?(R=1,R|0):(R=Be(v|0,w|0)|0,ce()|0,((63-R|0)%3|0|0)!=0|0))}function Fy(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0;return!0&(w&-16777216|0)==134217728&&(N=de(v|0,w|0,52)|0,ce()|0,N=N&15,S=de(v|0,w|0,45)|0,ce()|0,S=S&127,S>>>0<=121)&&(R=(N^15)*3|0,C=de(v|0,w|0,R|0)|0,R=me(C|0,ce()|0,R|0)|0,C=ce()|0,k=va(-1227133514,-1171,R|0,C|0)|0,(R&613566756&k|0)==0&(C&4681&(ce()|0)|0)==0)&&(R=(N*3|0)+19|0,k=me(~v|0,~w|0,R|0)|0,R=de(k|0,ce()|0,R|0)|0,(N|0)==15|(R|0)==0&(ce()|0)==0)&&(!($e[20496+S>>0]|0)||(S=w&8191,(v|0)==0&(S|0)==0)||(R=Be(v|0,S|0)|0,ce()|0,(63-R|0)%3|0|0))||fp(v,w)|0?(R=1,R|0):(R=(im(v,w)|0)!=0&1,R|0)}function Sg(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0;if(C=me(w|0,0,52)|0,k=ce()|0,S=me(S|0,0,45)|0,S=k|(ce()|0)|134225919,(w|0)<1){k=-1,N=S,w=v,m[w>>2]=k,v=v+4|0,m[v>>2]=N;return}for(k=1,C=-1;R=(15-k|0)*3|0,I=me(7,0,R|0)|0,S=S&~(ce()|0),R=me(N|0,0,R|0)|0,C=C&~I|R,S=S|(ce()|0),(k|0)!=(w|0);)k=k+1|0;I=v,R=I,m[R>>2]=C,I=I+4|0,m[I>>2]=S}function Tg(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0;if(k=de(v|0,w|0,52)|0,ce()|0,k=k&15,S>>>0>15)return N=4,N|0;if((k|0)<(S|0))return N=12,N|0;if((k|0)==(S|0))return m[N>>2]=v,m[N+4>>2]=w,N=0,N|0;if(C=me(S|0,0,52)|0,C=C|v,v=ce()|0|w&-15728641,(k|0)>(S|0))do w=me(7,0,(14-S|0)*3|0)|0,S=S+1|0,C=w|C,v=ce()|0|v;while((S|0)<(k|0));return m[N>>2]=C,m[N+4>>2]=v,N=0,N|0}function mp(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0;if(k=de(v|0,w|0,52)|0,ce()|0,k=k&15,!((S|0)<16&(k|0)<=(S|0)))return N=4,N|0;C=S-k|0,S=de(v|0,w|0,45)|0,ce()|0;e:do if(!(pi(S&127)|0))S=hd(7,0,C,((C|0)<0)<<31>>31)|0,C=ce()|0;else{t:do if(k|0){for(S=1;R=me(7,0,(15-S|0)*3|0)|0,!!((R&v|0)==0&((ce()|0)&w|0)==0);)if(S>>>0<k>>>0)S=S+1|0;else break t;S=hd(7,0,C,((C|0)<0)<<31>>31)|0,C=ce()|0;break e}while(!1);S=hd(7,0,C,((C|0)<0)<<31>>31)|0,S=as(S|0,ce()|0,5,0)|0,S=An(S|0,ce()|0,-5,-1)|0,S=Kl(S|0,ce()|0,6,0)|0,S=An(S|0,ce()|0,1,0)|0,C=ce()|0}while(!1);return R=N,m[R>>2]=S,m[R+4>>2]=C,R=0,R|0}function Er(v,w){v=v|0,w=w|0;var S=0,N=0,C=0;if(C=de(v|0,w|0,45)|0,ce()|0,!(pi(C&127)|0))return C=0,C|0;C=de(v|0,w|0,52)|0,ce()|0,C=C&15;e:do if(!C)S=0;else for(N=1;;){if(S=de(v|0,w|0,(15-N|0)*3|0)|0,ce()|0,S=S&7,S|0)break e;if(N>>>0<C>>>0)N=N+1|0;else{S=0;break}}while(!1);return C=(S|0)==0&1,C|0}function Hl(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0;if(R=pe,pe=pe+16|0,k=R,dd(k,v,w,S),w=k,v=m[w>>2]|0,w=m[w+4>>2]|0,(v|0)==0&(w|0)==0)return pe=R,0;C=0,S=0;do I=N+(C<<3)|0,m[I>>2]=v,m[I+4>>2]=w,C=An(C|0,S|0,1,0)|0,S=ce()|0,lx(k),I=k,v=m[I>>2]|0,w=m[I+4>>2]|0;while(!((v|0)==0&(w|0)==0));return pe=R,0}function Oc(v,w,S,N){return v=v|0,w=w|0,S=S|0,N=N|0,(N|0)<(S|0)?(S=w,N=v,He(S|0),N|0):(S=me(-1,-1,((N-S|0)*3|0)+3|0)|0,N=me(~S|0,~(ce()|0)|0,(15-N|0)*3|0)|0,S=~(ce()|0)&w,N=~N&v,He(S|0),N|0)}function cd(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0;return C=de(v|0,w|0,52)|0,ce()|0,C=C&15,(S|0)<16&(C|0)<=(S|0)?((C|0)<(S|0)&&(C=me(-1,-1,((S+-1-C|0)*3|0)+3|0)|0,C=me(~C|0,~(ce()|0)|0,(15-S|0)*3|0)|0,w=~(ce()|0)&w,v=~C&v),C=me(S|0,0,52)|0,S=w&-15728641|(ce()|0),m[N>>2]=v|C,m[N+4>>2]=S,N=0,N|0):(N=4,N|0)}function bu(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;
4281var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0,Xt=0,Et=0,Zt=0,nn=0,rn=0;if((S|0)==0&(N|0)==0)return rn=0,rn|0;if(C=v,k=m[C>>2]|0,C=m[C+4>>2]|0,!0&(C&15728640|0)==0){if(!((N|0)>0|(N|0)==0&S>>>0>0)||(rn=w,m[rn>>2]=k,m[rn+4>>2]=C,(S|0)==1&(N|0)==0))return rn=0,rn|0;C=1,k=0;do Zt=v+(C<<3)|0,nn=m[Zt+4>>2]|0,rn=w+(C<<3)|0,m[rn>>2]=m[Zt>>2],m[rn+4>>2]=nn,C=An(C|0,k|0,1,0)|0,k=ce()|0;while((k|0)<(N|0)|(k|0)==(N|0)&C>>>0<S>>>0);return C=0,C|0}if(Et=S<<3,nn=hs(Et)|0,!nn)return rn=13,rn|0;if(Wt(nn|0,v|0,Et|0)|0,Zt=xo(S,8)|0,!Zt)return Nn(nn),rn=13,rn|0;e:for(;;){C=nn,$=m[C>>2]|0,C=m[C+4>>2]|0,ht=de($|0,C|0,52)|0,ce()|0,ht=ht&15,Xt=ht+-1|0,Tt=(ht|0)!=0,$t=(N|0)>0|(N|0)==0&S>>>0>0;t:do if(Tt&$t){if(Me=me(Xt|0,0,52)|0,ot=ce()|0,Xt>>>0>15){if(!(($|0)==0&(C|0)==0)){rn=16;break e}for(k=0,v=0;;){if(k=An(k|0,v|0,1,0)|0,v=ce()|0,!((v|0)<(N|0)|(v|0)==(N|0)&k>>>0<S>>>0))break t;if(R=nn+(k<<3)|0,Ot=m[R>>2]|0,R=m[R+4>>2]|0,!((Ot|0)==0&(R|0)==0)){C=R,rn=16;break e}}}for(I=$,v=C,k=0,R=0;;){if(!((I|0)==0&(v|0)==0)){if(!(!0&(v&117440512|0)==0)){rn=21;break e}if(K=de(I|0,v|0,52)|0,ce()|0,K=K&15,(K|0)<(Xt|0)){C=12,rn=27;break e}if((K|0)!=(Xt|0)&&(I=I|Me,v=v&-15728641|ot,K>>>0>=ht>>>0)){V=Xt;do Ot=me(7,0,(14-V|0)*3|0)|0,V=V+1|0,I=Ot|I,v=ce()|0|v;while(V>>>0<K>>>0)}if(he=Su(I|0,v|0,S|0,N|0)|0,fe=ce()|0,V=Zt+(he<<3)|0,K=V,ie=m[K>>2]|0,K=m[K+4>>2]|0,!((ie|0)==0&(K|0)==0)){We=0,De=0;do{if((We|0)>(N|0)|(We|0)==(N|0)&De>>>0>S>>>0){rn=31;break e}if((ie|0)==(I|0)&(K&-117440513|0)==(v|0)){ye=de(ie|0,K|0,56)|0,ce()|0,ye=ye&7,je=ye+1|0,Ot=de(ie|0,K|0,45)|0,ce()|0;n:do if(!(pi(Ot&127)|0))K=7;else{if(ie=de(ie|0,K|0,52)|0,ce()|0,ie=ie&15,!ie){K=6;break}for(K=1;;){if(Ot=me(7,0,(15-K|0)*3|0)|0,!((Ot&I|0)==0&((ce()|0)&v|0)==0)){K=7;break n}if(K>>>0<ie>>>0)K=K+1|0;else{K=6;break}}}while(!1);if((ye+2|0)>>>0>K>>>0){rn=41;break e}Ot=me(je|0,0,56)|0,v=ce()|0|v&-117440513,Ke=V,m[Ke>>2]=0,m[Ke+4>>2]=0,I=Ot|I}else he=An(he|0,fe|0,1,0)|0,he=gd(he|0,ce()|0,S|0,N|0)|0,fe=ce()|0;De=An(De|0,We|0,1,0)|0,We=ce()|0,V=Zt+(he<<3)|0,K=V,ie=m[K>>2]|0,K=m[K+4>>2]|0}while(!((ie|0)==0&(K|0)==0))}Ot=V,m[Ot>>2]=I,m[Ot+4>>2]=v}if(k=An(k|0,R|0,1,0)|0,R=ce()|0,!((R|0)<(N|0)|(R|0)==(N|0)&k>>>0<S>>>0))break t;v=nn+(k<<3)|0,I=m[v>>2]|0,v=m[v+4>>2]|0}}while(!1);if(Ot=An(S|0,N|0,5,0)|0,Ke=ce()|0,Ke>>>0<0|(Ke|0)==0&Ot>>>0<11){rn=85;break}if(Ot=Kl(S|0,N|0,6,0)|0,ce()|0,Ot=xo(Ot,8)|0,!Ot){rn=48;break}do if($t){for(je=0,v=0,ye=0,We=0;;){if(K=Zt+(je<<3)|0,R=K,k=m[R>>2]|0,R=m[R+4>>2]|0,(k|0)==0&(R|0)==0)Ke=ye;else{ie=de(k|0,R|0,56)|0,ce()|0,ie=ie&7,I=ie+1|0,he=R&-117440513,Ke=de(k|0,R|0,45)|0,ce()|0;t:do if(pi(Ke&127)|0){if(fe=de(k|0,R|0,52)|0,ce()|0,fe=fe&15,fe|0)for(V=1;;){if(Ke=me(7,0,(15-V|0)*3|0)|0,!((k&Ke|0)==0&(he&(ce()|0)|0)==0))break t;if(V>>>0<fe>>>0)V=V+1|0;else break}R=me(I|0,0,56)|0,k=R|k,R=ce()|0|he,I=K,m[I>>2]=k,m[I+4>>2]=R,I=ie+2|0}while(!1);(I|0)==7?(Ke=Ot+(v<<3)|0,m[Ke>>2]=k,m[Ke+4>>2]=R&-117440513,v=An(v|0,ye|0,1,0)|0,Ke=ce()|0):Ke=ye}if(je=An(je|0,We|0,1,0)|0,We=ce()|0,(We|0)<(N|0)|(We|0)==(N|0)&je>>>0<S>>>0)ye=Ke;else break}if($t){if(De=Xt>>>0>15,Me=me(Xt|0,0,52)|0,ot=ce()|0,!Tt){for(k=0,V=0,I=0,R=0;($|0)==0&(C|0)==0||(Xt=w+(k<<3)|0,m[Xt>>2]=$,m[Xt+4>>2]=C,k=An(k|0,V|0,1,0)|0,V=ce()|0),I=An(I|0,R|0,1,0)|0,R=ce()|0,!!((R|0)<(N|0)|(R|0)==(N|0)&I>>>0<S>>>0);)C=nn+(I<<3)|0,$=m[C>>2]|0,C=m[C+4>>2]|0;C=Ke;break}for(k=0,V=0,R=0,I=0;;){do if(!(($|0)==0&(C|0)==0)){if(fe=de($|0,C|0,52)|0,ce()|0,fe=fe&15,De|(fe|0)<(Xt|0)){rn=80;break e}if((fe|0)!=(Xt|0)){if(K=$|Me,ie=C&-15728641|ot,fe>>>0>=ht>>>0){he=Xt;do Tt=me(7,0,(14-he|0)*3|0)|0,he=he+1|0,K=Tt|K,ie=ce()|0|ie;while(he>>>0<fe>>>0)}}else K=$,ie=C;ye=Su(K|0,ie|0,S|0,N|0)|0,he=0,fe=0,We=ce()|0;do{if((he|0)>(N|0)|(he|0)==(N|0)&fe>>>0>S>>>0){rn=81;break e}if(Tt=Zt+(ye<<3)|0,je=m[Tt+4>>2]|0,(je&-117440513|0)==(ie|0)&&(m[Tt>>2]|0)==(K|0)){rn=65;break}Tt=An(ye|0,We|0,1,0)|0,ye=gd(Tt|0,ce()|0,S|0,N|0)|0,We=ce()|0,fe=An(fe|0,he|0,1,0)|0,he=ce()|0,Tt=Zt+(ye<<3)|0}while(!((m[Tt>>2]|0)==(K|0)&&(m[Tt+4>>2]|0)==(ie|0)));if((rn|0)==65&&(rn=0,!0&(je&117440512|0)==100663296))break;Tt=w+(k<<3)|0,m[Tt>>2]=$,m[Tt+4>>2]=C,k=An(k|0,V|0,1,0)|0,V=ce()|0}while(!1);if(R=An(R|0,I|0,1,0)|0,I=ce()|0,!((I|0)<(N|0)|(I|0)==(N|0)&R>>>0<S>>>0))break;C=nn+(R<<3)|0,$=m[C>>2]|0,C=m[C+4>>2]|0}C=Ke}else k=0,C=Ke}else k=0,v=0,C=0;while(!1);
4281if(qn(Zt|0,0,Et|0)|0,Wt(nn|0,Ot|0,v<<3|0)|0,Nn(Ot),(v|0)==0&(C|0)==0){rn=89;break}else w=w+(k<<3)|0,N=C,S=v}if((rn|0)==16)!0&(C&117440512|0)==0?(C=4,rn=27):rn=21;else if((rn|0)==31)at(27634,27225,620,27235);else{if((rn|0)==41)return Nn(nn),Nn(Zt),rn=10,rn|0;if((rn|0)==48)return Nn(nn),Nn(Zt),rn=13,rn|0;(rn|0)==80?at(27634,27225,711,27235):(rn|0)==81?at(27634,27225,723,27235):(rn|0)==85&&(Wt(w|0,nn|0,S<<3|0)|0,rn=89)}return(rn|0)==21?(Nn(nn),Nn(Zt),rn=5,rn|0):(rn|0)==27?(Nn(nn),Nn(Zt),rn=C,rn|0):(rn|0)==89?(Nn(nn),Nn(Zt),rn=0,rn|0):0}function Dc(v,w,S,N,C,k,R){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,k=k|0,R=R|0;var I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0;if(je=pe,pe=pe+16|0,ye=je,!((S|0)>0|(S|0)==0&w>>>0>0))return ye=0,pe=je,ye|0;if((R|0)>=16)return ye=12,pe=je,ye|0;he=0,fe=0,ie=0,I=0;e:for(;;){if($=v+(he<<3)|0,V=m[$>>2]|0,$=m[$+4>>2]|0,K=de(V|0,$|0,52)|0,ce()|0,(K&15|0)>(R|0)){I=12,V=11;break}if(dd(ye,V,$,R),K=ye,$=m[K>>2]|0,K=m[K+4>>2]|0,($|0)==0&(K|0)==0)V=ie;else{V=ie;do{if(!((I|0)<(k|0)|(I|0)==(k|0)&V>>>0<C>>>0)){V=10;break e}ie=N+(V<<3)|0,m[ie>>2]=$,m[ie+4>>2]=K,V=An(V|0,I|0,1,0)|0,I=ce()|0,lx(ye),ie=ye,$=m[ie>>2]|0,K=m[ie+4>>2]|0}while(!(($|0)==0&(K|0)==0))}if(he=An(he|0,fe|0,1,0)|0,fe=ce()|0,(fe|0)<(S|0)|(fe|0)==(S|0)&he>>>0<w>>>0)ie=V;else{I=0,V=11;break}}return(V|0)==10?(ye=14,pe=je,ye|0):(V|0)==11?(pe=je,I|0):0}function sf(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0;he=pe,pe=pe+16|0,ie=he;e:do if((S|0)>0|(S|0)==0&w>>>0>0){for($=0,R=0,k=0,K=0;;){if(V=v+($<<3)|0,I=m[V>>2]|0,V=m[V+4>>2]|0,!((I|0)==0&(V|0)==0)&&(V=(mp(I,V,N,ie)|0)==0,I=ie,R=An(m[I>>2]|0,m[I+4>>2]|0,R|0,k|0)|0,k=ce()|0,!V)){k=12;break}if($=An($|0,K|0,1,0)|0,K=ce()|0,!((K|0)<(S|0)|(K|0)==(S|0)&$>>>0<w>>>0))break e}return pe=he,k|0}else R=0,k=0;while(!1);return m[C>>2]=R,m[C+4>>2]=k,C=0,pe=he,C|0}function af(v,w){return v=v|0,w=w|0,w=de(v|0,w|0,52)|0,ce()|0,w&1|0}function xa(v,w){v=v|0,w=w|0;var S=0,N=0,C=0;if(C=de(v|0,w|0,52)|0,ce()|0,C=C&15,!C)return C=0,C|0;for(N=1;;){if(S=de(v|0,w|0,(15-N|0)*3|0)|0,ce()|0,S=S&7,S|0){N=5;break}if(N>>>0<C>>>0)N=N+1|0;else{S=0,N=5;break}}return(N|0)==5?S|0:0}function wu(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;if(K=de(v|0,w|0,52)|0,ce()|0,K=K&15,!K)return $=w,K=v,He($|0),K|0;for($=1,S=0;;){switch(N=(15-$|0)*3|0,I=me(7,0,N|0)|0,V=ce()|0,k=v&~I,R=w&~V,v=de(v|0,w|0,N|0)|0,ce()|0,v&7){case 1:{v=5;break}case 5:{v=4;break}case 4:{v=6;break}case 6:{v=2;break}case 2:{v=3;break}case 3:{v=1;break}default:v=v&7}N=me(v|0,0,N|0)|0,C=ce()|0,v=N|k,w=C|R;e:do if(!S)if((N&I|0)==0&(C&V|0)==0)S=0;else if(R=de(v|0,w|0,52)|0,ce()|0,R=R&15,!R)S=1;else{S=1;t:for(;;){switch(V=de(v|0,w|0,(15-S|0)*3|0)|0,ce()|0,V&7){case 1:break t;case 0:break;default:{S=1;break e}}if(S>>>0<R>>>0)S=S+1|0;else{S=1;break e}}for(k=1;;){switch(C=(15-k|0)*3|0,S=de(v|0,w|0,C|0)|0,ce()|0,N=me(7,0,C|0)|0,N=v&~N,w=w&~(ce()|0),S&7){case 1:{v=5;break}case 5:{v=4;break}case 4:{v=6;break}case 6:{v=2;break}case 2:{v=3;break}case 3:{v=1;break}default:v=S&7}if(v=me(v|0,0,C|0)|0,v=v|N,w=ce()|0|w,k>>>0<R>>>0)k=k+1|0;else{S=1;break e}}}while(!1);if($>>>0<K>>>0)$=$+1|0;else break}return He(w|0),v|0}function Ao(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0;if(R=de(v|0,w|0,52)|0,ce()|0,R=R&15,!R)return k=w,R=v,He(k|0),R|0;for(k=1;;){switch(C=(15-k|0)*3|0,S=de(v|0,w|0,C|0)|0,ce()|0,N=me(7,0,C|0)|0,N=v&~N,w=w&~(ce()|0),S&7){case 1:{v=5;break}case 5:{v=4;break}case 4:{v=6;break}case 6:{v=2;break}case 2:{v=3;break}case 3:{v=1;break}default:v=S&7}if(v=me(v|0,0,C|0)|0,v=v|N,w=ce()|0|w,k>>>0<R>>>0)k=k+1|0;else break}return He(w|0),v|0}function Eg(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;if(K=de(v|0,w|0,52)|0,ce()|0,K=K&15,!K)return $=w,K=v,He($|0),K|0;for($=1,S=0;;){switch(N=(15-$|0)*3|0,I=me(7,0,N|0)|0,V=ce()|0,k=v&~I,R=w&~V,v=de(v|0,w|0,N|0)|0,ce()|0,v&7){case 1:{v=3;break}case 3:{v=2;break}case 2:{v=6;break}case 6:{v=4;break}case 4:{v=5;break}case 5:{v=1;break}default:v=v&7}N=me(v|0,0,N|0)|0,C=ce()|0,v=N|k,w=C|R;e:do if(!S)if((N&I|0)==0&(C&V|0)==0)S=0;else if(R=de(v|0,w|0,52)|0,ce()|0,R=R&15,!R)S=1;else{S=1;t:for(;;){switch(V=de(v|0,w|0,(15-S|0)*3|0)|0,ce()|0,V&7){case 1:break t;case 0:break;default:{S=1;break e}}if(S>>>0<R>>>0)S=S+1|0;else{S=1;break e}}for(k=1;;){switch(S=(15-k|0)*3|0,N=me(7,0,S|0)|0,N=v&~N,C=w&~(ce()|0),v=de(v|0,w|0,S|0)|0,ce()|0,v&7){case 1:{v=3;break}case 3:{v=2;break}case 2:{v=6;break}case 6:{v=4;break}case 4:{v=5;break}case 5:{v=1;break}default:v=v&7}if(v=me(v|0,0,S|0)|0,v=v|N,w=ce()|0|C,k>>>0<R>>>0)k=k+1|0;else{S=1;break e}}}while(!1);if($>>>0<K>>>0)$=$+1|0;else break}return He(w|0),v|0}function ud(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0;if(R=de(v|0,w|0,52)|0,ce()|0,R=R&15,!R)return k=w,R=v,He(k|0),R|0;for(k=1;;){switch(N=(15-k|0)*3|0,S=me(7,0,N|0)|0,S=v&~S,C=w&~(ce()|0),v=de(v|0,w|0,N|0)|0,ce()|0,v&7){case 1:{v=3;break}case 3:{v=2;break}case 2:{v=6;break}case 6:{v=4;break}case 4:{v=5;break}case 5:{v=1;break}default:v=v&7}if(v=me(v|0,0,N|0)|0,v=v|S,w=ce()|0|C,k>>>0<R>>>0)k=k+1|0;else break}return He(w|0),v|0}function gp(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0;if(Ke=pe,pe=pe+16|0,ot=Ke,me(w|0,0,52)|0,S=ce()|0|134225919,!w)return(m[v+4>>2]|0)>2||(m[v+8>>2]|0)>2||(m[v+12>>2]|0)>
vendor: 2,190 bytes, line 4281
42812?(Me=0,ot=0,He(Me|0),pe=Ke,ot|0):(me(tf(v)|0,0,45)|0,Me=ce()|0|S,ot=-1,He(Me|0),pe=Ke,ot|0);m[ot>>2]=m[v>>2],m[ot+4>>2]=m[v+4>>2],m[ot+8>>2]=m[v+8>>2],m[ot+12>>2]=m[v+12>>2],Me=ot+4|0;e:do if((w|0)>0)for(je=ot+8|0,We=ot+12|0,ye=w,ie=m[je>>2]|0,he=m[We>>2]|0,w=-1,K=m[ot+4>>2]|0;;){fe=ye,ye=ye+-1|0,v=K-he|0,N=ie-he|0,fe&1?(k=Ql(+((v*3|0)-N|0)*.14285714285714285)|0,m[Me>>2]=k,v=Ql(+((N<<1)+v|0)*.14285714285714285)|0,m[je>>2]=v,m[We>>2]=0,N=v-k|0,C=0-k|0,(k|0)<0?(m[je>>2]=N,m[We>>2]=C,m[Me>>2]=0,v=N,R=0):(R=k,C=0),k=R-v|0,N=C-v|0,(v|0)<0?(m[Me>>2]=k,m[We>>2]=N,m[je>>2]=0,R=k,k=0):(N=C,k=v),v=R-N|0,C=k-N|0,(N|0)<0?(m[Me>>2]=v,m[je>>2]=C,m[We>>2]=0,k=0):(C=k,v=R,k=N),N=(C|0)<(v|0)?C:v,N=(k|0)<(N|0)?k:N,(N|0)>0&&(k=k-N|0,C=C-N|0,v=v-N|0,m[Me>>2]=v,m[je>>2]=C,m[We>>2]=k),$t=C+(v*3|0)|0,Ot=($t|0)<0,$=k+(C*3|0)-(Ot?$t:0)|0,V=($|0)<0,N=(k*3|0)+v-(Ot?$t:0)-(V?$:0)|0,I=(N|0)<0,Tt=I?0:N,R=(V?0:$)-(I?N:0)|0,N=(Ot?0:$t)-(V?$:0)-(I?N:0)|0,I=(R|0)<(N|0)?R:N,I=(Tt|0)<(I|0)?Tt:I,$=(I|0)>0,V=$?I:0,R=R-($?I:0)|0,I=Tt-($?I:0)|0,$=k):(I=Ql(+((v<<1)+N|0)*.14285714285714285)|0,m[Me>>2]=I,C=Ql(+((N*3|0)-v|0)*.14285714285714285)|0,m[je>>2]=C,m[We>>2]=0,N=C-I|0,v=0-I|0,(I|0)<0?(m[je>>2]=N,m[We>>2]=v,m[Me>>2]=0,C=N,I=0):v=0,R=I-C|0,N=v-C|0,(C|0)<0?(m[Me>>2]=R,m[We>>2]=N,m[je>>2]=0,k=N,C=0):(k=v,R=I),v=R-k|0,N=C-k|0,(k|0)<0?(m[Me>>2]=v,m[je>>2]=N,m[We>>2]=0,C=N,k=0):v=R,N=(C|0)<(v|0)?C:v,N=(k|0)<(N|0)?k:N,(N|0)>0&&(k=k-N|0,C=C-N|0,v=v-N|0,m[Me>>2]=v,m[je>>2]=C,m[We>>2]=k),$t=k+(v*3|0)|0,Tt=($t|0)<0,$=(C*3|0)+v-(Tt?$t:0)|0,V=($|0)<0,N=(k*3|0)+C-(Tt?$t:0)-(V?$:0)|0,I=(N|0)<0,Ot=I?0:N,R=(V?0:$)-(I?N:0)|0,N=(Tt?0:$t)-(V?$:0)-(I?N:0)|0,I=(R|0)<(N|0)?R:N,I=(Ot|0)<(I|0)?Ot:I,$=(I|0)>0,V=$?I:0,R=R-($?I:0)|0,I=Ot-($?I:0)|0,$=k),N=K+(V-N)|0,k=(N|0)<0,V=ie-R-(k?N:0)|0,R=(V|0)<0,he=he-I+(k?0-N|0:0)+(R?0-V|0:0)|0,K=(he|0)<0,I=K?0:he,Tt=(R?0:V)-(K?he:0)|0,he=(k?0:N)-(R?V:0)-(K?he:0)|0,K=(Tt|0)<(he|0)?Tt:he,K=(I|0)<(K|0)?I:K,V=(K|0)>0,he=he-(V?K:0)|0,R=(15-fe|0)*3|0,N=me(7,0,R|0)|0,N=w&~N,k=S&~(ce()|0),ie=(he|0)<0,$t=ie?he:0,Tt=Tt-(V?K:0)-$t|0,Ot=(Tt|0)<0,$t=(Ot?0-Tt|0:0)+(I-(V?K:0)-$t)|0,S=($t|0)<0,w=S?0:$t,$t=S?$t:0,S=(Ot?0:Tt)-$t|0,$t=(ie?0:he)-(Ot?Tt:0)-$t|0,Tt=(S|0)<($t|0)?S:$t,Tt=(w|0)<(Tt|
42810)?w:Tt,Tt=(Tt|0)>0?Tt:0,w=w-Tt|0,S=S-Tt|0;t:do switch($t-Tt|0){case 0:switch(S|0){case 0:{w=(w|0)==0?0:(w|0)==1?1:7;break t}case 1:{w=(w|0)==0?2:(w|0)==1?3:7;break t}default:{De=36;break t}}case 1:switch(S|0){case 0:{w=(w|0)==0?4:(w|0)==1?5:7;break t}case 1:if(w){De=36;break t}else{w=6;break t}default:{De=36;break t}}default:De=36}while(!1);if((De|0)==36&&(De=0,w=7),w=me(w|0,0,R|0)|0,w=w|N,S=ce()|0|k,(fe|0)<=1)break e;ie=C,he=$,K=v}else w=-1,v=m[Me>>2]|0;while(!1);e:do if((v|0)<=2&&(m[ot+8>>2]|0)<=2&&(m[ot+12>>2]|0)<=2){if(N=tf(ot)|0,v=me(N|0,0,45)|0,w=v|w,v=ce()|0|S&-1040385,V=dp(ot)|0,!(pi(N)|0)){if((V|0)<=0)break;for(I=0;;){R=de(w|0,v|0,52)|0,ce()|0,R=R&15;t:do if(R)for(k=1;;){switch(C=(15-k|0)*3|0,S=de(w|0,v|0,C|0)|0,ce()|0,N=me(7,0,C|0)|0,w=w&~N,N=v&~(ce()|0),S&7){case 1:{v=5;break}case 5:{v=4;break}case 4:{v=6;break}case 6:{v=2;break}case 2:{v=3;break}case 3:{v=1;break}default:v=S&7}if(v=me(v|0,0,C|0)|0,w=v|w,v=ce()|0|N,k>>>0<R>>>0)k=k+1|0;else break t}while(!1);if(I=I+1|0,(I|0)==(V|0))break e}}R=de(w|0,v|0,52)|0,ce()|0,R=R&15;t:do if(R){S=1;n:for(;;){switch(Tt=de(w|0,v|0,(15-S|0)*3|0)|0,ce()|0,Tt&7){case 1:break n;case 0:break;default:break t}if(S>>>0<R>>>0)S=S+1|0;else break t}if(ql(N,m[ot>>2]|0)|0)for(k=1;;){switch(S=(15-k|0)*3|0,N=me(7,0,S|0)|0,N=w&~N,C=v&~(ce()|0),v=de(w|0,v|0,S|0)|0,ce()|0,v&7){case 1:{v=3;break}case 3:{v=2;break}case 2:{v=6;break}case 6:{v=4;break}case 4:{v=5;break}case 5:{v=1;break}default:v=v&7}if(w=me(v|0,0,S|0)|0,w=w|N,v=ce()|0|C,k>>>0<R>>>0)k=k+1|0;else break t}else for(k=1;;){switch(C=(15-k|0)*3|0,S=de(w|0,v|0,C|0)|0,ce()|0,N=me(7,0,C|0)|0,w=w&~N,N=v&~(ce()|0),S&7){case 1:{v=5;break}case 5:{v=4;break}case 4:{v=6;break}case 6:{v=2;break}case 2:{v=3;break}case 3:{v=1;break}default:v=S&7}if(v=me(v|0,0,C|0)|0,w=v|w,v=ce()|0|N,k>>>0<R>>>0)k=k+1|0;else break t}}while(!1);if((V|0)>0){S=0;do w=wu(w,v)|0,v=ce()|0,S=S+1|0;while((S|0)!=(V|0))}}else w=0,v=0;while(!1);return $t=v,Tt=w,He($t|0),pe=Ke,Tt|0}function Ni(v){return v=v|0,(v|0)%2|0|0}function jc(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0;if(K=pe,pe=pe+64|0,I=K+24|0,V=K+48|0,$=K,w>>>0>15)return $=4,pe=K,$|0;if(k=+be[v>>3],be[en>>3]=k,(m[en+4>>2]&2146435072|0)==2146435072||(N=+be[v+8>>3],be[en>>3]=N,(m[en+4>>2]&2146435072|0)==2146435072))return $=3,pe=K,$|0;C=+bn(+k),ie=C*+bn(+N),C=C*+wn(+N),N=+wn(+k),be[$>>3]=ie,be[$+8>>3]=C,be[$+16>>3]=N,be[en>>3]=ie;do if((m[en+4>>2]&2146435072|0)!=2146435072&&(be[en>>3]=N,v=m[en+4>>2]|0,be[en>>3]=C,!((m[en+4>>2]&2146435072|0)==2146435072|!0&(v&2146435072|0)==2146435072)))if(m[I>>2]=m[$>>2],m[I+4>>2]=m[$+4>>2],m[I+8>>2]=m[$+8>>2],m[I+12>>2]=m[$+12>>2],m[I+16>>2]=m[$+16>>2],m[I+20>>2]=m[$+20>>2],ox(I,w,V),V=gp(V,w)|0,$=ce()|0,m[S>>2]=V,m[S+4>>2]=$,(V|0)==0&($|0)==0)at(27634,27225,1073,27248);else{R=0;break}else R=2;while(!1);return $=R,pe=K,$|0}function Ic(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0;if(fe=S+4|0,ye=de(v|0,w|0,52)|0,ce()|0,ye=ye&15,he=de(v|0,w|0,45)|0,ce()|0,N=(ye|0)==0,pi(he&127)|0){if(N)return ye=1,ye|0;N=1}else{if(N)return ye=0,ye|0;(m[fe>>2]|0)==0&&(m[S+8>>2]|0)==0?N=(m[S+12>>2]|0)!=0&1:N=1}for(he=S+8|0,ie=S+12|0,K=1,S=m[fe>>2]|0,R=m[he>>2]|0,k=m[ie>>2]|0;C=S*3|0,I=R*3|0,$=k*3|0,K&1?(V=R+C|0,m[fe>>2]=V,k=k+I|0,m[he>>2]=k,C=$+S|0,m[ie>>2]=C,S=k-V|0,R=C-V|0,(V|0)<0?(m[he>>2]=S,m[ie>>2]=R,m[fe>>2]=0,I=0,C=R):(S=k,I=V),R=I-S|0,k=C-S|0,(S|0)<0?(m[fe>>2]=R,m[ie>>2]=k,m[he>>2]=0,I=R,C=0):(k=C,C=S),S=I-k|0,R=C-k|0,(k|0)<0?(m[fe>>2]=S,m[he>>2]=R,m[ie>>2]=0,k=0):(R=C,S=I),C=(R|0)<(S|0)?R:S,C=(k|0)<(C|0)?k:C,(C|0)>0&&(k=k-C|0,R=R-C|0,S=S-C|0,m[fe>>2]=S,m[he>>2]=R,m[ie>>2]=k)):(V=I+S|0,I=k+C|0,m[fe>>2]=I,m[he>>2]=V,C=$+R|0,m[ie>>2]=C,S=V-I|0,k=C-I|0,(I|0)<0?(m[he>>2]=S,m[ie>>2]=k,m[fe>>2]=0,I=0,C=k):S=V,R=I-S|0,k=C-S|0,(S|0)<0?(m[fe>>2]=R,m[ie>>2]=k,m[he>>2]=0,I=R,C=0):(k=C,C=S),S=I-k|0,R=C-k|0,(k|0)<0?(m[fe>>2]=S,m[he>>2]=R,m[ie>>2]=0,k=0):(R=C,S=I),C=(R|0)<(S|0)?R:S,C=(k|0)<(C|0)?k:C,(C|0)>0&&(k=k-C|0,R=R-C|0,S=S-C|0,m[fe>>2]=S,m[he>>2]=R,m[ie>>2]=k)),C=de(v|0,w|0,(15-K|0)*3|0)|0,ce()|0,C=C&7,(C+-1|0)>>>0<6&&(V=m[22032+(C*12|0)+4>>2]|0,$=m[22032+(C*12|0)+8>>2]|0,I=(m[22032+(C*12|0)>>2]|0)+S|0,m[fe>>2]=I,R=V+R|0,m[he>>2]=R,S=$+k|0,m[ie>>2]=S,k=R-I|0,C=S-I|0,(I|0)<0&&(m[he>>2]=k,m[ie>>2]=C,m[fe>>2]=0,I=0,S=C,R=k),C=I-R|0,k=S-R|0,(R|0)<0?(m[fe>>2]=C,m[ie>>2]=k,m[he>>2]=0,I=C,R=0):k=S,S=I-k|0,C=R-k|0,(k|0)<0?(m[fe>>2]=S,m[he>>2]=C,m[ie>>2]=0,R=C,k=0):S=I,C=(R|0)<(S|0)?R:S,C=(k|0)<(C|0)?k:C,(C|0)>0&&(k=k-C|0,R=R-C|0,S=S-C|0,m[fe>>2]=S,m[he>>2]=R,m[ie>>2]=k)),K>>>0<ye>>>0;)K=K+1|0;return N|0}function Wl(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0;if(ye=pe,pe=pe+16|0,ie=ye,he=de(v|0,w|0,45)|0,ce()|0,he=he&127,he>>>0>121)return m[S>>2]=0,m[S+4>>2]=0,m[S+8>>2]=0,m[S+12>>2]=0,fe=5,pe=ye,fe|0;
4281e:do if((pi(he)|0)!=0&&(I=de(v|0,w|0,52)|0,ce()|0,I=I&15,(I|0)!=0)){N=1;t:for(;;){switch(fe=de(v|0,w|0,(15-N|0)*3|0)|0,ce()|0,fe&7){case 5:break t;case 0:break;default:{$=w;break e}}if(N>>>0<I>>>0)N=N+1|0;else{$=w;break e}}for(R=1,N=w;;){switch(w=(15-R|0)*3|0,C=me(7,0,w|0)|0,C=v&~C,k=N&~(ce()|0),N=de(v|0,N|0,w|0)|0,ce()|0,N&7){case 1:{N=3;break}case 3:{N=2;break}case 2:{N=6;break}case 6:{N=4;break}case 4:{N=5;break}case 5:{N=1;break}default:N=N&7}if(v=me(N|0,0,w|0)|0,v=v|C,N=ce()|0|k,R>>>0<I>>>0)R=R+1|0;else{$=N;break e}}}else $=w;while(!1);if(fe=7696+(he*28|0)|0,m[S>>2]=m[fe>>2],m[S+4>>2]=m[fe+4>>2],m[S+8>>2]=m[fe+8>>2],m[S+12>>2]=m[fe+12>>2],!(Ic(v,$,S)|0))return fe=0,pe=ye,fe|0;if(fe=S+4|0,m[ie>>2]=m[fe>>2],m[ie+4>>2]=m[fe+4>>2],m[ie+8>>2]=m[fe+8>>2],V=de(v|0,$|0,52)|0,ce()|0,K=V&15,V&1?(k=m[fe>>2]|0,I=S+8|0,C=m[I>>2]|0,V=S+12|0,w=m[V>>2]|0,N=(C*3|0)+k|0,k=w+(k*3|0)|0,m[fe>>2]=k,m[I>>2]=N,C=(w*3|0)+C|0,m[V>>2]=C,w=N-k|0,R=C-k|0,(k|0)<0&&(m[I>>2]=w,m[V>>2]=R,m[fe>>2]=0,N=w,k=0,C=R),R=k-N|0,w=C-N|0,(N|0)<0?(m[fe>>2]=R,m[V>>2]=w,m[I>>2]=0,N=0):(w=C,R=k),k=R-w|0,C=N-w|0,(w|0)<0?(m[fe>>2]=k,m[I>>2]=C,m[V>>2]=0,w=0):(C=N,k=R),N=(C|0)<(k|0)?C:k,N=(w|0)<(N|0)?w:N,(N|0)>0&&(m[fe>>2]=k-N,m[I>>2]=C-N,m[V>>2]=w-N),C=K+1|0):C=K,!(pi(he)|0))N=0;else{e:do if(!K)N=0;else for(w=1;;){if(N=de(v|0,$|0,(15-w|0)*3|0)|0,ce()|0,N=N&7,N|0)break e;if(w>>>0<K>>>0)w=w+1|0;else{N=0;break}}while(!1);N=(N|0)==4&1}if(!(Lc(S,C,N,0)|0))(C|0)!=(K|0)&&(m[fe>>2]=m[ie>>2],m[fe+4>>2]=m[ie+4>>2],m[fe+8>>2]=m[ie+8>>2]);else{if(pi(he)|0)do;while((Lc(S,C,0,0)|0)!=0);(C|0)!=(K|0)&&(I=S+12|0,v=m[I>>2]|0,N=(m[fe>>2]|0)-v|0,R=S+8|0,v=(m[R>>2]|0)-v|0,w=Ql(+((N<<1)+v|0)*.14285714285714285)|0,m[fe>>2]=w,N=Ql(+((v*3|0)-N|0)*.14285714285714285)|0,m[R>>2]=N,m[I>>2]=0,v=N-w|0,C=0-w|0,(w|0)<0?(m[R>>2]=v,m[I>>2]=C,m[fe>>2]=0,N=v,w=0):C=0,k=w-N|0,v=C-N|0,(N|0)<0?(m[fe>>2]=k,m[I>>2]=v,m[R>>2]=0,w=k,N=0):v=C,k=w-v|0,C=N-v|0,(v|0)<0?(m[fe>>2]=k,m[R>>2]=C,m[I>>2]=0,w=k,v=0):C=N,N=(C|0)<(w|0)?C:w,N=(v|0)<(N|0)?v:N,(N|0)>0&&(m[fe>>2]=w-N,m[R>>2]=C-N,m[I>>2]=v-N))}return fe=0,pe=ye,fe|0}function ea(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0;return R=pe,pe=pe+48|0,N=R+24|0,C=R,k=Wl(v,w,N)|0,k?(pe=R,k|0):(k=de(v|0,w|0,52)|0,ce()|0,ch(N,k&15,C),V=+_n(+ +be[C+16>>3]),I=+Ir(+ +be[C+8>>3],+ +be[C>>3]),be[S>>3]=V,be[S+8>>3]=I,k=0,pe=R,k|0)}function Xl(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0;if(R=pe,pe=pe+16|0,k=R,N=Wl(v,w,k)|0,N|0)return k=N,pe=R,k|0;N=de(v|0,w|0,45)|0,ce()|0,N=(pi(N&127)|0)==0,C=de(v|0,w|0,52)|0,ce()|0,C=C&15;e:do if(!N){if(C|0)for(N=1;;){if(I=me(7,0,(15-N|0)*3|0)|0,!((I&v|0)==0&((ce()|0)&w|0)==0))break e;if(N>>>0<C>>>0)N=N+1|0;else break}return X0(k,C,0,5,S),I=0,pe=R,I|0}while(!1);return uh(k,C,0,6,S),I=0,pe=R,I|0}function ta(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0;if(C=de(v|0,w|0,45)|0,ce()|0,!(pi(C&127)|0))return C=2,m[S>>2]=C,0;if(C=de(v|0,w|0,52)|0,ce()|0,C=C&15,!C)return C=5,m[S>>2]=C,0;for(N=1;;){if(k=me(7,0,(15-N|0)*3|0)|0,!((k&v|0)==0&((ce()|0)&w|0)==0)){N=2,v=6;break}if(N>>>0<C>>>0)N=N+1|0;else{N=5,v=6;break}}return(v|0)==6&&(m[S>>2]=N),0}function of(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0;ie=pe,pe=pe+128|0,$=ie+112|0,k=ie+96|0,K=ie,C=de(v|0,w|0,52)|0,ce()|0,I=C&15,m[$>>2]=I,R=de(v|0,w|0,45)|0,ce()|0,R=R&127;e:do if(pi(R)|0){if(I|0)for(N=1;;){if(V=me(7,0,(15-N|0)*3|0)|0,!((V&v|0)==0&((ce()|0)&w|0)==0)){C=0;break e}if(N>>>0<I>>>0)N=N+1|0;else break}if(C&1)C=1;else return V=me(I+1|0,0,52)|0,K=ce()|0|w&-15728641,$=me(7,0,(14-I|0)*3|0)|0,K=of((V|v)&~$,K&~(ce()|0),S)|0,pe=ie,K|0}else C=0;while(!1);if(N=Wl(v,w,k)|0,!N){C?(Do(k,$,K),V=5):(Y0(k,$,K),V=6);e:do if(pi(R)|0)if(!I)v=5;else for(N=1;;){if(R=me(7,0,(15-N|0)*3|0)|0,!((R&v|0)==0&((ce()|0)&w|0)==0)){v=2;break e}if(N>>>0<I>>>0)N=N+1|0;else{v=5;break}}else v=2;while(!1);qn(S|0,-1,v<<2|0)|0;e:do if(C)for(k=0;;){if(R=K+(k<<4)|0,$l(R,m[$>>2]|0)|0,R=m[R>>2]|0,I=m[S>>2]|0,(I|0)==-1|(I|0)==(R|0))N=S;else{C=0;do{if(C=C+1|0,C>>>0>=v>>>0){N=1;break e}N=S+(C<<2)|0,I=m[N>>2]|0}while(!((I|0)==-1|(I|0)==(R|0)))}if(m[N>>2]=R,k=k+1|0,k>>>0>=V>>>0){N=0;break}}else for(k=0;;){if(R=K+(k<<4)|0,Lc(R,m[$>>2]|0,0,1)|0,R=m[R>>2]|0,I=m[S>>2]|0,(I|0)==-1|(I|0)==(R|0))N=S;else{C=0;do{if(C=C+1|0,C>>>0>=v>>>0){N=1;break e}N=S+(C<<2)|0,I=m[N>>2]|0}while(!((I|0)==-1|(I|0)==(R|0)))}if(m[N>>2]=R,k=k+1|0,k>>>0>=V>>>0){N=0;break}}while(!1)}return K=N,pe=ie,K|0}
4281function YT(){return 12}function Uy(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0;if(v>>>0>15)return I=4,I|0;if(me(v|0,0,52)|0,I=ce()|0|134225919,!v){S=0,N=0;do pi(N)|0&&(me(N|0,0,45)|0,R=I|(ce()|0),v=w+(S<<3)|0,m[v>>2]=-1,m[v+4>>2]=R,S=S+1|0),N=N+1|0;while((N|0)!=122);return S=0,S|0}S=0,R=0;do{if(pi(R)|0){for(me(R|0,0,45)|0,N=1,C=-1,k=I|(ce()|0);V=me(7,0,(15-N|0)*3|0)|0,C=C&~V,k=k&~(ce()|0),(N|0)!=(v|0);)N=N+1|0;V=w+(S<<3)|0,m[V>>2]=C,m[V+4>>2]=k,S=S+1|0}R=R+1|0}while((R|0)!=122);return S=0,S|0}function Ap(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0;if(Me=pe,pe=pe+16|0,We=Me,De=de(v|0,w|0,52)|0,ce()|0,De=De&15,S>>>0>15)return De=4,pe=Me,De|0;if((De|0)<(S|0))return De=12,pe=Me,De|0;if((De|0)!=(S|0))if(k=me(S|0,0,52)|0,k=k|v,I=ce()|0|w&-15728641,(De|0)>(S|0)){V=S;do je=me(7,0,(14-V|0)*3|0)|0,V=V+1|0,k=je|k,I=ce()|0|I;while((V|0)<(De|0));je=k}else je=k;else je=v,I=w;ye=de(je|0,I|0,45)|0,ce()|0;e:do if(pi(ye&127)|0){if(V=de(je|0,I|0,52)|0,ce()|0,V=V&15,V|0)for(k=1;;){if(ye=me(7,0,(15-k|0)*3|0)|0,!((ye&je|0)==0&((ce()|0)&I|0)==0)){$=33;break e}if(k>>>0<V>>>0)k=k+1|0;else break}if(ye=N,m[ye>>2]=0,m[ye+4>>2]=0,(De|0)>(S|0)){for(ye=w&-15728641,fe=De;;){if(he=fe,fe=fe+-1|0,fe>>>0>15|(De|0)<(fe|0)){$=19;break}if((De|0)!=(fe|0))if(k=me(fe|0,0,52)|0,k=k|v,V=ce()|0|ye,(De|0)<(he|0))ie=k;else{$=fe;do ie=me(7,0,(14-$|0)*3|0)|0,$=$+1|0,k=ie|k,V=ce()|0|V;while(($|0)<(De|0));ie=k}else ie=v,V=w;if(K=de(ie|0,V|0,45)|0,ce()|0,!(pi(K&127)|0))k=0;else{K=de(ie|0,V|0,52)|0,ce()|0,K=K&15;t:do if(!K)k=0;else for($=1;;){if(k=de(ie|0,V|0,(15-$|0)*3|0)|0,ce()|0,k=k&7,k|0)break t;if($>>>0<K>>>0)$=$+1|0;else{k=0;break}}while(!1);k=(k|0)==0&1}if(V=de(v|0,w|0,(15-he|0)*3|0)|0,ce()|0,V=V&7,(V|0)==7){C=5,$=42;break}if(k=(k|0)!=0,(V|0)==1&k){C=5,$=42;break}if(ie=V+(((V|0)!=0&k)<<31>>31)|0,ie|0&&($=De-he|0,$=hd(7,0,$,(($|0)<0)<<31>>31)|0,K=ce()|0,k?(k=as($|0,K|0,5,0)|0,k=An(k|0,ce()|0,-5,-1)|0,k=Kl(k|0,ce()|0,6,0)|0,k=An(k|0,ce()|0,1,0)|0,V=ce()|0):(k=$,V=K),he=ie+-1|0,he=as($|0,K|0,he|0,((he|0)<0)<<31>>31|0)|0,he=An(k|0,V|0,he|0,ce()|0)|0,ie=ce()|0,K=N,K=An(he|0,ie|0,m[K>>2]|0,m[K+4>>2]|0)|0,ie=ce()|0,he=N,m[he>>2]=K,m[he+4>>2]=ie),(fe|0)<=(S|0)){$=37;break}}if(($|0)==19)at(27634,27225,1407,27259);else if(($|0)==37){R=N,C=m[R+4>>2]|0,R=m[R>>2]|0;break}else if(($|0)==42)return pe=Me,C|0}else C=0,R=0}else $=33;while(!1);e:do if(($|0)==33)if(ye=N,m[ye>>2]=0,m[ye+4>>2]=0,(De|0)>(S|0)){for(k=De;;){if(C=de(v|0,w|0,(15-k|0)*3|0)|0,ce()|0,C=C&7,(C|0)==7){C=5;break}if(R=De-k|0,R=hd(7,0,R,((R|0)<0)<<31>>31)|0,C=as(R|0,ce()|0,C|0,0)|0,R=ce()|0,ye=N,R=An(m[ye>>2]|0,m[ye+4>>2]|0,C|0,R|0)|0,C=ce()|0,ye=N,m[ye>>2]=R,m[ye+4>>2]=C,k=k+-1|0,(k|0)<=(S|0))break e}return pe=Me,C|0}else C=0,R=0;while(!1);return mp(je,I,De,We)|0&&at(27634,27225,1367,27274),De=We,We=m[De+4>>2]|0,((C|0)>-1|(C|0)==-1&R>>>0>4294967295)&((We|0)>(C|0)|((We|0)==(C|0)?(m[De>>2]|0)>>>0>R>>>0:0))?(De=0,pe=Me,De|0):(at(27634,27225,1447,27259),0)}function xp(v,w,S,N,C,k){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,k=k|0;var R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0;if(ie=pe,pe=pe+16|0,R=ie,C>>>0>15)return k=4,pe=ie,k|0;if(I=de(S|0,N|0,52)|0,ce()|0,I=I&15,(I|0)>(C|0))return k=12,pe=ie,k|0;if(mp(S,N,C,R)|0&&at(27634,27225,1367,27274),K=R,$=m[K+4>>2]|0,!(((w|0)>-1|(w|0)==-1&v>>>0>4294967295)&(($|0)>(w|0)|(($|0)==(w|0)?(m[K>>2]|0)>>>0>v>>>0:0))))return k=2,pe=ie,k|0;K=C-I|0,C=me(C|0,0,52)|0,V=ce()|0|N&-15728641,$=k,m[$>>2]=C|S,m[$+4>>2]=V,$=de(S|0,N|0,45)|0,ce()|0;e:do if(pi($&127)|0){if(I|0)for(R=1;;){if($=me(7,0,(15-R|0)*3|0)|0,!(($&S|0)==0&((ce()|0)&N|0)==0))break e;if(R>>>0<I>>>0)R=R+1|0;else break}if((K|0)<1)return k=0,pe=ie,k|0;for($=I^15,N=-1,V=1,R=1;;){I=K-V|0,I=hd(7,0,I,((I|0)<0)<<31>>31)|0,S=ce()|0;do if(R)if(R=as(I|0,S|0,5,0)|0,R=An(R|0,ce()|0,-5,-1)|0,R=Kl(R|0,ce()|0,6,0)|0,C=ce()|0,(w|0)>(C|0)|(w|0)==(C|0)&v>>>0>R>>>0){w=An(v|0,w|0,-1,-1)|0,w=va(w|0,ce()|0,R|0,C|0)|0,R=ce()|0,he=k,ye=m[he>>2]|0,he=m[he+4>>2]|0,je=($+N|0)*3|0,fe=me(7,0,je|0)|0,he=he&~(ce()|0),N=Kl(w|0,R|0,I|0,S|0)|0,v=ce()|0,C=An(N|0,v|0,2,0)|0,je=me(C|0,ce()|0,je|0)|0,he=ce()|0|he,C=k,m[C>>2]=je|ye&~fe,m[C+4>>2]=he,v=as(N|0,v|0,I|0,S|0)|0,v=va(w|0,R|0,v|0,ce()|0)|0,R=0,w=ce()|0;break}else{je=k,fe=m[je>>2]|0,je=m[je+4>>2]|0,ye=me(7,0,($+N|0)*3|0)|0,je=je&~(ce()|0),R=k,m[R>>2]=fe&~ye,m[R+4>>2]=je,R=1;break}else fe=k,C=m[fe>>2]|0,fe=m[fe+4>>2]|0,N=($+N|0)*3|0,he=me(7,0,N|0)|0,fe=fe&~(ce()|0),je=Kl(v|0,w|0,I|0,S|0)|0,R=ce()|0,N=me(je|0,R|0,N|0)|0,fe=ce()|0|fe,ye=k,m[ye>>2]=N|C&~he,m[ye+4>>2]=fe,R=as(je|0,R|0,I|0,S|0)|0,v=va(v|0,w|0,R|0,ce()|0)|0,R=0,w=ce()|0;while(!1);if((K|0)>(V|0))N=~V,V=V+1|0;else{w=0;break}}return pe=ie,w|0}while(!1);if((K|0)<1)return je=0,pe=ie,je|0;for(C=I^15,R=1;;)if(ye=K-R|0,ye=hd(7,0,ye,((ye|0)<0)<<31>>31)|0,je=ce()|0,V=k,S=m[V>>2]|0,V=m[V+4>>2]|0,I=(C-R|0)*3|0,N=me(7,0,I|0)|0,V=V&~(ce()|0),he=Kl(v|0,w|0,ye|0,je|0)|0,fe=ce()|0,I=me(he|0,fe|0,I|0)|0,V=ce()|0|V,$=k,m[$>>2]=I|S&~N,m[$+4>>2]=V,je=as(he|0,fe|0,ye|0,je|0)|0,v=va(v|0,w|0,je|0,ce()|0)|0,w=ce()|0,(K|0)<=(R|0)){w=0;break}else R=R+1|0;return pe=ie,w|0}function dd(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;
4281var C=0,k=0,R=0;C=de(w|0,S|0,52)|0,ce()|0,C=C&15,(w|0)==0&(S|0)==0|((N|0)>15|(C|0)>(N|0))?(k=-1,w=-1,S=0,C=0):(w=Oc(w,S,C+1|0,N)|0,R=(ce()|0)&-15728641,S=me(N|0,0,52)|0,S=w|S,R=R|(ce()|0),w=(Er(S,R)|0)==0,k=C,w=w?-1:N,C=R),R=v,m[R>>2]=S,m[R+4>>2]=C,m[v+8>>2]=k,m[v+12>>2]=w}function lf(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0;if(C=de(v|0,w|0,52)|0,ce()|0,C=C&15,k=N+8|0,m[k>>2]=C,(v|0)==0&(w|0)==0|((S|0)>15|(C|0)>(S|0))){S=N,m[S>>2]=0,m[S+4>>2]=0,m[k>>2]=-1,m[N+12>>2]=-1;return}if(v=Oc(v,w,C+1|0,S)|0,k=(ce()|0)&-15728641,C=me(S|0,0,52)|0,C=v|C,k=k|(ce()|0),v=N,m[v>>2]=C,m[v+4>>2]=k,v=N+12|0,Er(C,k)|0){m[v>>2]=S;return}else{m[v>>2]=-1;return}}function lx(v){v=v|0;var w=0,S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0;if(S=v,w=m[S>>2]|0,S=m[S+4>>2]|0,!((w|0)==0&(S|0)==0)&&(N=de(w|0,S|0,52)|0,ce()|0,N=N&15,I=me(1,0,(N^15)*3|0)|0,w=An(I|0,ce()|0,w|0,S|0)|0,S=ce()|0,I=v,m[I>>2]=w,m[I+4>>2]=S,I=v+8|0,R=m[I>>2]|0,!((N|0)<(R|0)))){for(V=v+12|0,k=N;;){if((k|0)==(R|0)){N=5;break}if($=(k|0)==(m[V>>2]|0),C=(15-k|0)*3|0,N=de(w|0,S|0,C|0)|0,ce()|0,N=N&7,$&((N|0)==1&!0)){N=7;break}if(!((N|0)==7&!0)){N=10;break}if($=me(1,0,C|0)|0,w=An(w|0,S|0,$|0,ce()|0)|0,S=ce()|0,$=v,m[$>>2]=w,m[$+4>>2]=S,(k|0)>(R|0))k=k+-1|0;else{N=10;break}}if((N|0)==5){$=v,m[$>>2]=0,m[$+4>>2]=0,m[I>>2]=-1,m[V>>2]=-1;return}else if((N|0)==7){R=me(1,0,C|0)|0,R=An(w|0,S|0,R|0,ce()|0)|0,I=ce()|0,$=v,m[$>>2]=R,m[$+4>>2]=I,m[V>>2]=k+-1;return}else if((N|0)==10)return}}function dh(v){v=+v;var w=0;return w=v<0?v+6.283185307179586:v,+(v>=6.283185307179586?w+-6.283185307179586:w)}function bl(v,w){switch(v=+v,w=w|0,w|0){case 1:{v=v<0?v+6.283185307179586:v;break}case 2:{v=v>0?v+-6.283185307179586:v;break}}return+v}function vp(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0;return C=+be[w>>3],N=+be[v>>3],k=+wn(+((C-N)*.5)),S=+wn(+((+be[w+8>>3]-+be[v+8>>3])*.5)),S=k*k+S*(+bn(+C)*+bn(+N)*S),+(+Ir(+ +Pt(+S),+ +Pt(+(1-S)))*2)}function Zo(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0;return C=+be[w>>3],N=+be[v>>3],k=+wn(+((C-N)*.5)),S=+wn(+((+be[w+8>>3]-+be[v+8>>3])*.5)),S=k*k+S*(+bn(+C)*+bn(+N)*S),+(+Ir(+ +Pt(+S),+ +Pt(+(1-S)))*2*6371.007180918475)}function yp(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0;return C=+be[w>>3],N=+be[v>>3],k=+wn(+((C-N)*.5)),S=+wn(+((+be[w+8>>3]-+be[v+8>>3])*.5)),S=k*k+S*(+bn(+C)*+bn(+N)*S),+(+Ir(+ +Pt(+S),+ +Pt(+(1-S)))*2*6371.007180918475*1e3)}function Z0(v,w){return v=v|0,w=w|0,v>>>0>15?(w=4,w|0):(be[w>>3]=+be[20624+(v<<3)>>3],w=0,w|0)}function Di(v,w){return v=v|0,w=w|0,v>>>0>15?(w=4,w|0):(be[w>>3]=+be[20752+(v<<3)>>3],w=0,w|0)}function Cg(v,w){return v=v|0,w=w|0,v>>>0>15?(w=4,w|0):(be[w>>3]=+be[20880+(v<<3)>>3],w=0,w|0)}function cx(v,w){return v=v|0,w=w|0,v>>>0>15?(w=4,w|0):(be[w>>3]=+be[21008+(v<<3)>>3],w=0,w|0)}function ux(v,w){v=v|0,w=w|0;var S=0;return v>>>0>15?(w=4,w|0):(S=hd(7,0,v,((v|0)<0)<<31>>31)|0,S=as(S|0,ce()|0,120,0)|0,v=ce()|0,m[w>>2]=S|2,m[w+4>>2]=v,w=0,w|0)}function QT(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;if(I=pe,pe=pe+176|0,R=I,v=H0(v,w,R)|0,v|0)return R=v,pe=I,R|0;if(be[S>>3]=0,v=m[R>>2]|0,(v|0)<=1)return R=0,pe=I,R|0;w=v+-1|0,v=0,N=+be[R+8>>3],C=+be[R+16>>3],k=0;do v=v+1|0,$=N,N=+be[R+8+(v<<4)>>3],K=+wn(+((N-$)*.5)),V=C,C=+be[R+8+(v<<4)+8>>3],V=+wn(+((C-V)*.5)),V=K*K+V*(+bn(+N)*+bn(+$)*V),k=k+ +Ir(+ +Pt(+V),+ +Pt(+(1-V)))*2;while((v|0)<(w|0));return be[S>>3]=k,R=0,pe=I,R|0}function Yl(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;if(I=pe,pe=pe+176|0,R=I,v=H0(v,w,R)|0,v|0)return R=v,k=+be[S>>3],k=k*6371.007180918475,be[S>>3]=k,pe=I,R|0;if(be[S>>3]=0,v=m[R>>2]|0,(v|0)<=1)return R=0,k=0,k=k*6371.007180918475,be[S>>3]=k,pe=I,R|0;w=v+-1|0,v=0,N=+be[R+8>>3],C=+be[R+16>>3],k=0;do v=v+1|0,$=N,N=+be[R+8+(v<<4)>>3],K=+wn(+((N-$)*.5)),V=C,C=+be[R+8+(v<<4)+8>>3],V=+wn(+((C-V)*.5)),V=K*K+V*(+bn(+$)*+bn(+N)*V),k=k+ +Ir(+ +Pt(+V),+ +Pt(+(1-V)))*2;while((v|0)!=(w|0));return be[S>>3]=k,R=0,K=k,K=K*6371.007180918475,be[S>>3]=K,pe=I,R|0}function KT(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;if(I=pe,pe=pe+176|0,R=I,v=H0(v,w,R)|0,v|0)return R=v,k=+be[S>>3],k=k*6371.007180918475,k=k*1e3,be[S>>3]=k,pe=I,R|0;if(be[S>>3]=0,v=m[R>>2]|0,(v|0)<=1)return R=0,k=0,k=k*6371.007180918475,k=k*1e3,be[S>>3]=k,pe=I,R|0;w=v+-1|0,v=0,N=+be[R+8>>3],C=+be[R+16>>3],k=0;do v=v+1|0,$=N,N=+be[R+8+(v<<4)>>3],K=+wn(+((N-$)*.5)),V=C,C=+be[R+8+(v<<4)+8>>3],V=+wn(+((C-V)*.5)),V=K*K+V*(+bn(+$)*+bn(+N)*V),k=k+ +Ir(+ +Pt(+V),+ +Pt(+(1-V)))*2;while((v|0)!=(w|0));return be[S>>3]=k,R=0,K=k,K=K*6371.007180918475,K=K*1e3,be[S>>3]=K,pe=I,R|0}function Fc(v){v=v|0;var w=0,S=0,N=0,C=0,k=0,R=0,I=0;if(v)for(k=v+4|0,R=v+8|0,N=1,C=v;;){if(w=m[C>>2]|0,w|0)do{if(S=m[w>>2]|0,S|0)do I=S,S=m[S+16>>2]|0,Nn(I);while((S|0)!=0);I=w,w=m[w+8>>2]|0,Nn(I)}while((w|0)!=0);if(w=C,C=m[C+8>>2]|0,N?(m[v>>2]=0,m[k>>2]=0,m[R>>2]=0):Nn(w),C)N=0;else break}}function cf(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0;if(m[w>>2]=0,We=w+4|0,m[We>>2]=0,De=w+8|0,m[De>>2]=0,je=m[v>>2]|0,(je|0)<=0)return w=0,w|0;ye=v+4|0,v=w,fe=0;e:for(;;){if(fe){if(S=xo(1,12)|0,!S){S=5;break}m[v+8>>2]=S,v=S}if(V=m[ye>>2]|0,$=xo(1,12)|0,!$){v=13,S=37;break}if(he=v+4|0,N=m[he>>2]|0,m[((N|0)==0?v:N+8|0)>>2]=$,m[he>>2]=$,N=m[V+(fe<<4)>>2]|0,(N|0)<3){v=1,S=37;break}C=V+(fe<<4)+4|0,k=$+4|0,S=0,R=0;do{if(I=R,R=hs(24)|0,!R){v=13,S=37;break e}hn(R|0,(m[C>>2]|0)+(S<<4)|0,16)|0,m[R+16>>2]=0,I?m[I+16>>2]=R:m[$>>2]=R,m[k>>2]=R,S=S+1|0}while((S|0)<(N|0));if(ie=m[V+(fe<<4)+8>>2]|0,(ie|0)>0){K=V+(fe<<4)+12|0,V=0;do{if(N=m[K>>2]|0,S=$,$=xo(1,12)|0,!$){v=13,S=37;break e}if(m[S+8>>2]=$,m[he>>2]=$,I=m[N+(V<<3)>>2]|0,(I|0)<3){v=1,S=37;break e}N=N+(V<<3)+4|0,C=$+4|0,S=0,k=0;do{if(R=k,k=hs(24)|0,!k){v=13,S=37;break e}hn(k|0,(m[N>>2]|0)+(S<<4)|0,16)|0,m[k+16>>2]=0,R?m[R+16>>2]=k:m[$>>2]=k,m[C>>2]=k,S=S+1|0}while((S|0)<(I|0));V=V+1|0}while((V|0)<(ie|0))}if(fe=fe+1|0,(fe|0)>=(je|0)){v=0,S=50;break}}if((S|0)==5){if(!w)return w=13,w|0;for(N=1,C=w;;){if(v=m[C>>2]|0,v|0)do{if(S=m[v>>2]|0,S|0)do je=S,S=m[S+16>>2]|0,Nn(je);while((S|0)!=0);je=v,v=m[v+8>>2]|0,Nn(je)}while((v|0)!=0);if(v=C,C=m[C+8>>2]|0,N?(m[w>>2]=0,m[We>>2]=0,m[De>>2]=0):Nn(v),C)N=0;else{v=13;break}}return v|0}else if((S|0)==37){if(!w)return w=v,w|0;for(C=1,k=w;;){if(S=m[k>>2]|0,S|0)do{if(N=m[S>>2]|0,N|0)do je=N,N=m[N+16>>2]|0,Nn(je);while((N|0)!=0);je=S,S=m[S+8>>2]|0,Nn(je)}while((S|0)!=0);if(S=k,k=m[k+8>>2]|0,C?(m[w>>2]=0,m[We>>2]=0,m[De>>
42812]=0):Nn(S),k)C=0;else break}return v|0}else if((S|0)==50)return v|0;return 0}function uf(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0;if(De=pe,pe=pe+16|0,We=De,K=de(v|0,w|0,52)|0,ce()|0,K=K&15,fe=de(S|0,N|0,52)|0,ce()|0,(K|0)!=(fe&15|0))return We=12,pe=De,We|0;if(V=de(v|0,w|0,45)|0,ce()|0,V=V&127,$=de(S|0,N|0,45)|0,ce()|0,$=$&127,V>>>0>121|$>>>0>121)return We=5,pe=De,We|0;if(fe=(V|0)!=($|0),fe){if(R=oa(V,$)|0,(R|0)==7)return We=1,pe=De,We|0;I=oa($,V)|0,(I|0)==7?at(27291,27315,164,27325):(je=R,k=I)}else je=0,k=0;ie=pi(V)|0,he=pi($)|0,m[We>>2]=0,m[We+4>>2]=0,m[We+8>>2]=0,m[We+12>>2]=0;do if(je){$=m[4272+(V*28|0)+(je<<2)>>2]|0,R=($|0)>0;e:do if(he)if(R)for(V=0,I=S,R=N;;){switch(I=Eg(I,R)|0,R=ce()|0,k|0){case 5:case 1:{k=3;break}case 3:{k=2;break}case 2:{k=6;break}case 6:{k=4;break}case 4:{k=5;break}}if(V=V+1|0,(V|0)==($|0)){$=k,V=I,I=R;break e}}else $=k,V=S,I=N;else if(R)for(V=0,I=S,R=N;;){switch(I=ud(I,R)|0,R=ce()|0,k|0){case 1:{k=3;break}case 3:{k=2;break}case 2:{k=6;break}case 6:{k=4;break}case 4:{k=5;break}case 5:{k=1;break}}if(V=V+1|0,(V|0)==($|0)){$=k,V=I,I=R;break e}}else $=k,V=S,I=N;while(!1);if(Ic(V,I,We)|0,fe||at(27340,27315,194,27325),R=(ie|0)!=0,k=(he|0)!=0,R&k&&at(27367,27315,195,27325),R){if(k=xa(v,w)|0,(k|0)==7){k=5;break}if($e[21968+(k*7|0)+je>>0]|0){k=1;break}he=m[21136+(k*28|0)+(je<<2)>>2]|0,fe=he}else if(k){if(k=xa(V,I)|0,(k|0)==7){k=5;break}if($e[21968+(k*7|0)+$>>0]|0){k=1;break}fe=0,he=m[21136+($*28|0)+(k<<2)>>2]|0}else fe=0,he=0;if((fe|he|0)>=0){if((he|0)>0){S=We+4|0,N=We+8|0,ie=We+12|0,$=0,I=m[S>>2]|0,R=m[N>>2]|0,k=m[ie>>2]|0;do ye=R+I|0,w=(ye|0)<0,Me=w?ye:0,R=k+R-Me|0,v=(R|0)<0,V=v?R:0,I=k+I-Me-V|0,Me=(I|0)<0,k=Me?0:I,I=Me?I:0,R=(v?0:R)-I|0,I=(w?0:ye)-V-I|0,V=(R|0)<(I|0)?R:I,V=(k|0)<(V|0)?k:V,(V|0)>0&&(I=I-V|0,R=R-V|0,k=k-V|0),$=$+1|0;while(($|0)!=(he|0));m[S>>2]=I,m[N>>2]=R,m[ie>>2]=k}if((je+-1|0)>>>0<6?(k=m[22032+(je*12|0)>>2]|0,I=m[22032+(je*12|0)+4>>2]|0,Me=m[22032+(je*12|0)+8>>2]|0,R=(I|0)<(k|0)?I:k,R=(Me|0)<(R|0)?Me:R,R=(R|0)>0?R:0,k=k-R|0,I=I-R|0,R=Me-R|0):(k=0,I=0,R=0),K)for(;;)if(V=k*3|0,$=I*3|0,S=R*3|0,Ni(K)|0?(w=V+I|0,v=(w|0)<0,Me=$+R-(v?w:0)|0,ye=(Me|0)<0,I=k+S-(v?w:0)-(ye?Me:0)|0,R=(I|0)<0,je=R?0:I,V=(ye?0:Me)-(R?I:0)|0,I=(v?0:w)-(ye?Me:0)-(R?I:0)|0,R=(V|0)<(I|0)?V:I,R=(je|0)<(R|0)?je:R,Me=(R|0)>0,k=Me?R:0,V=V-(Me?R:0)|0,R=je-(Me?R:0)|0):(ye=V+R|0,w=(ye|0)<0,Me=$+k-(w?ye:0)|0,k=(Me|0)<0,I=S+I-(w?ye:0)-(k?Me:0)|0,R=(I|0)<0,je=R?0:I,V=(k?0:Me)-(R?I:0)|0,I=(w?0:ye)-(k?Me:0)-(R?I:0)|0,R=(V|0)<(I|0)?V:I,R=(je|0)<(R|0)?je:R,Me=(R|0)>0,k=Me?R:0,V=V-(Me?R:0)|0,R=je-(Me?R:0)|0),k=I-k|0,(K|0)>1)K=K+-1|0,I=V;else{I=V;break}if((fe|0)>0){V=0;do w=k+I|0,v=(w|0)<0,Me=I+R-(v?w:0)|0,ye=(Me|0)<0,je=k+R-(v?w:0)-(ye?Me:0)|0,k=(je|0)<0,R=k?0:je,I=(ye?0:Me)-(k?je:0)|0,je=(v?0:w)-(ye?Me:0)-(k?je:0)|0,k=(I|0)<(je|0)?I:je,k=(R|0)<(k|0)?R:k,Me=(k|0)>0,R=R-(Me?k:0)|0,I=I-(Me?k:0)|0,k=je-(Me?k:0)|0,V=V+1|0;while((V|0)!=(fe|0))}S=We+4|0,K=We+8|0,je=m[K>>2]|0,N=We+12|0,Me=m[N>>2]|0,V=(m[S>>2]|0)+k|0,m[S>>2]=V,I=je+I|0,m[K>>2]=I,k=Me+R|0,m[N>>2]=k,R=I-V|0,(V|0)<0?(k=k-V|0,m[K>>2]=R,m[N>>2]=k,m[S>>2]=0,I=0):(R=I,I=V),(R|0)<0&&(I=I-R|0,m[S>>2]=I,k=k-R|0,m[N>>2]=k,m[K>>2]=0,R=0),$=I-k|0,V=R-k|0,(k|0)<0?(m[S>>2]=$,m[K>>2]=V,m[N>>2]=0,I=$,k=0):V=R,R=(V|0)<(I|0)?V:I,R=(k|0)<(R|0)?k:R,(R|0)>0&&(m[S>>2]=I-R,m[K>>2]=V-R,m[N>>2]=k-R),ye=77}else k=5}else if(Ic(S,N,We)|0,(ie|0)!=0&(he|0)!=0)if(($|0)!=(V|0)&&at(27398,27315,264,27325),R=xa(v,w)|0,k=xa(S,N)|0,(R|0)==7|(k|0)==7)k=5;else if($e[21968+(R*7|0)+k>>0]|0)k=1;else if(S=m[21136+(R*28|0)+(k<<2)>>2]|0,(S|0)>0){K=We+4|0,N=We+8|0,ie=We+12|0,$=0,I=m[K>>2]|0,R=m[N>>2]|0,k=m[ie>>2]|0;do je=R+I|0,ye=(je|0)<0,v=ye?je:0,R=k+R-v|0,w=(R|0)<0,V=w?R:0,I=k+I-v-V|0,v=(I|0)<0,k=v?0:I,I=v?I:0,R=(w?0:R)-I|0,I=(ye?0:je)-V-I|0,V=(R|0)<(I|0)?R:I,V=(k|0)<(V|0)?k:V,(V|0)>0&&(I=I-V|0,R=R-V|0,k=k-V|0),$=$+1|0;while(($|0)!=(S|0));m[K>>2]=I,m[N>>2]=R,m[ie>>2]=k,ye=77}else ye=77;else ye=77;while(!1);return(ye|0)==77&&(k=We+4|0,m[C>>2]=m[k>>2],m[C+4>>2]=m[k+4>>2],m[C+8>>2]=m[k+8>>2],k=0),Me=k,pe=De,Me|0}function dx(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;
4281var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0;if(k=de(v|0,w|0,52)|0,ce()|0,k=k&15,Ke=de(v|0,w|0,45)|0,ce()|0,Ke=Ke&127,Ke>>>0>121)return N=5,N|0;if(We=pi(Ke)|0,me(k|0,0,52)|0,I=ce()|0|134225919,R=N,m[R>>2]=-1,m[R+4>>2]=I,R=m[S>>2]|0,I=m[S+4>>2]|0,S=m[S+8>>2]|0,!k){w=(R|0)<0,De=w?R:0,ot=I-De|0,We=(ot|0)<0,De=(We?0-ot|0:0)+(S-De)|0,S=(De|0)<0,C=S?0:De,De=S?De:0,S=(We?0:ot)-De|0,De=(w?0:R)-(We?ot:0)-De|0,ot=(S|0)<(De|0)?S:De,ot=(C|0)<(ot|0)?C:ot,ot=(ot|0)>0?ot:0,C=C-ot|0,S=S-ot|0;e:do switch(De-ot|0){case 0:switch(S|0){case 0:if(C){C=(C|0)==1?1:7,Me=11;break e}else{C=0;break e}case 1:if(C){C=(C|0)==1?3:7,Me=11;break e}else{C=2;break e}default:return N=1,N|0}case 1:switch(S|0){case 0:if(C){C=(C|0)==1?5:7,Me=11;break e}else{C=4;break e}case 1:{if(C)C=1;else{C=6;break e}return C|0}default:return N=1,N|0}default:return N=1,N|0}while(!1);return(Me|0)==11&&(C|0)==7||(C=lh(Ke,C)|0,(C|0)==127)?(N=1,N|0):(ot=me(C|0,0,45)|0,Ke=ce()|0,Me=N,Ke=m[Me+4>>2]&-1040385|Ke,m[N>>2]=m[Me>>2]|ot,m[N+4>>2]=Ke,N=0,N|0)}for(;;){if(je=k,k=k+-1|0,ye=R-S|0,fe=I-S|0,V=ye>>>0>715827881|fe>>>0>715827881,Ni(je)|0){if(V){if(K=(ye|0)>0,ie=2147483647-ye|0,he=-2147483648-ye|0,K?(ie|0)<(ye|0):(he|0)>(ye|0)){C=1,Me=107;break}if(ht=ye<<1,K?(2147483647-ht|0)<(ye|0):(-2147483648-ht|0)>(ye|0)){C=1,Me=107;break}if((fe|0)>0?(2147483647-fe|0)<(fe|0):(-2147483648-fe|0)>(fe|0)){C=1,Me=107;break}if(V=ye*3|0,$=fe<<1,(K?(ie|0)<($|0):(he|0)>($|0))||((ye|0)>-1?(V|-2147483648|0)>=(fe|0):(V^-2147483648|0)<(fe|0))){C=1,Me=107;break}}else V=ye*3|0,$=fe<<1;if(ie=Ql(+(V-fe|0)*.14285714285714285)|0,K=Ql(+($+ye|0)*.14285714285714285)|0,$=(K|0)<(ie|0),V=$?ie:K,$=$?K:ie,($|0)<0){if(($|0)==-2147483648||((V|0)>0?(2147483647-V|0)<($|0):(-2147483648-V|0)>($|0))){Me=24;break}if((V|0)>-1?(V|-2147483648|0)>=($|0):(V^-2147483648|0)<($|0)){Me=24;break}}he=(ie|0)<0,fe=K-(he?ie:0)|0,$t=(fe|0)<0,Ot=(he?0-ie|0:0)-($t?fe:0)|0,ye=(Ot|0)<0,he=(he?0:ie)-($t?fe:0)-(ye?Ot:0)|0,fe=($t?0:fe)-(ye?Ot:0)|0,Ot=ye?0:Ot,ye=(fe|0)<(he|0)?fe:he,ye=(Ot|0)<(ye|0)?Ot:ye,$t=(ye|0)>0,he=he-($t?ye:0)|0,fe=fe-($t?ye:0)|0,ye=Ot-($t?ye:0)|0,$t=(he*3|0)+fe|0,Ot=($t|0)<0,ht=(fe*3|0)+ye-(Ot?$t:0)|0,V=(ht|0)<0,ie=(ye*3|0)+he-(Ot?$t:0)-(V?ht:0)|0,K=(ie|0)<0,Tt=K?0:ie,$=(V?0:ht)-(K?ie:0)|0,ie=(Ot?0:$t)-(V?ht:0)-(K?ie:0)|0,K=($|0)<(ie|0)?$:ie,K=(Tt|0)<(K|0)?Tt:K,ht=(K|0)>0,V=ht?K:0,$=$-(ht?K:0)|0,K=Tt-(ht?K:0)|0}else{if(V){if($=(ye|0)>0,$?(2147483647-ye|0)<(ye|0):(-2147483648-ye|0)>(ye|0)){C=1,Me=107;break}if(V=ye<<1,K=(fe|0)>0,K?(2147483647-fe|0)<(fe|0):(-2147483648-fe|0)>(fe|0)){C=1,Me=107;break}if(he=fe<<1,K?(2147483647-he|0)<(fe|0):(-2147483648-he|0)>(fe|0)){C=1,Me=107;break}if($?(2147483647-V|0)<(fe|0):(-2147483648-V|0)>(fe|0)){C=1,Me=107;break}if($=fe*3|0,(fe|0)>-1?($|-2147483648|0)>=(ye|0):($^-2147483648|0)<(ye|0)){C=1,Me=107;break}}else V=ye<<1,$=fe*3|0;if(ie=Ql(+(V+fe|0)*.14285714285714285)|0,K=Ql(+($-ye|0)*.14285714285714285)|0,$=(K|0)<(ie|0),V=$?ie:K,$=$?K:ie,($|0)<0){if(($|0)==-2147483648||((V|0)>0?(2147483647-V|0)<($|0):(-2147483648-V|0)>($|0))){Me=36;break}if((V|0)>-1?(V|-2147483648|0)>=($|0):(V^-2147483648|0)<($|0)){Me=36;break}}he=(ie|0)<0,fe=K-(he?ie:0)|0,Tt=(fe|0)<0,ht=(he?0-ie|0:0)-(Tt?fe:0)|0,ye=(ht|0)<0,he=(he?0:ie)-(Tt?fe:0)-(ye?ht:0)|0,fe=(Tt?0:fe)-(ye?ht:0)|0,ht=ye?0:ht,ye=(fe|0)<(he|0)?fe:he,ye=(ht|0)<(ye|0)?ht:ye,Tt=(ye|0)>0,he=he-(Tt?ye:0)|0,fe=fe-(Tt?ye:0)|0,ye=ht-(Tt?ye:0)|0,Tt=(he*3|0)+ye|0,ht=(Tt|0)<0,Ot=(fe*3|0)+he-(ht?Tt:0)|0,V=(Ot|0)<0,ie=(ye*3|0)+fe-(ht?Tt:0)-(V?Ot:0)|0,K=(ie|0)<0,$t=K?0:ie,$=(V?0:Ot)-(K?ie:0)|0,ie=(ht?0:Tt)-(V?Ot:0)-(K?ie:0)|0,K=($|0)<(ie|0)?$:ie,K=($t|0)<(K|0)?$t:K,Ot=(K|0)>0,V=Ot?K:0,$=$-(Ot?K:0)|0,K=$t-(Ot?K:0)|0}V=R+(V-ie)|0,Tt=(V|0)<0,$=I-$-(Tt?V:0)|0,ie=($|0)<0,Ot=S-K+(Tt?0-V|0:0)+(ie?0-$|0:0)|0,R=(Ot|0)<0,K=R?0:Ot,ht=(ie?0:$)-(R?Ot:0)|0,Ot=(Tt?0:V)-(ie?$:0)-(R?Ot:0)|0,R=(ht|0)<(Ot|0)?ht:Ot,R=(K|0)<(R|0)?K:R,S=(R|0)>0,Ot=Ot-(S?R:0)|0,$=N,ie=m[$>>2]|0,$=m[$+4>>2]|0,I=(15-je|0)*3|0,V=me(7,0,I|0)|0,V=ie&~V,$=$&~(ce()|0),ie=(Ot|0)<0,Tt=ie?Ot:0,ht=ht-(S?R:0)-Tt|0,$t=(ht|0)<0,Tt=($t?0-ht|0:0)+(K-(S?R:0)-Tt)|0,R=(Tt|0)<0,S=R?0:Tt,Tt=R?Tt:0,R=($t?0:ht)-Tt|0,Tt=(ie?0:Ot)-($t?ht:0)-Tt|0,ht=(R|0)<(Tt|
vendor: 5,773 bytes, line 4281
42810)?R:Tt,ht=(S|0)<(ht|0)?S:ht,ht=(ht|0)>0?ht:0,S=S-ht|0,R=R-ht|0;e:do switch(Tt-ht|0){case 0:switch(R|0){case 0:{S=(S|0)==0?0:(S|0)==1?1:7;break e}case 1:{S=(S|0)==0?2:(S|0)==1?3:7;break e}default:{Me=45;break e}}case 1:switch(R|0){case 0:{S=(S|0)==0?4:(S|0)==1?5:7;break e}case 1:if(S){Me=45;break e}else{S=6;break e}default:{Me=45;break e}}default:Me=45}while(!1);if((Me|0)==45&&(Me=0,S=7),$t=me(S|0,0,I|0)|0,Tt=ce()|0|$,ht=N,m[ht>>2]=$t|V,m[ht+4>>2]=Tt,(je|0)<=1){Me=47;break}else R=he,I=fe,S=ye}if((Me|0)==24)at(27634,27425,416,27447);else if((Me|0)==36)at(27634,27425,464,27461);else if((Me|0)==47){if((he|0)>1|(fe|0)>1|(ye|0)>1)return ht=1,ht|0;Ot=(he|0)<0,Tt=Ot?he:0,ht=fe-Tt|0,$t=(ht|0)<0,Tt=($t?0-ht|0:0)+(ye-Tt)|0,k=(Tt|0)<0,S=k?0:Tt,Tt=k?Tt:0,k=($t?0:ht)-Tt|0,Tt=(Ot?0:he)-($t?ht:0)-Tt|0,ht=(k|0)<(Tt|0)?k:Tt,ht=(S|0)<(ht|0)?S:ht,ht=(ht|0)>0?ht:0,S=S-ht|0,k=k-ht|0;e:do switch(Tt-ht|0){case 0:switch(k|0){case 0:{k=(S|0)==0?0:(S|0)==1?1:7;break e}case 1:{k=(S|0)==0?2:(S|0)==1?3:7;break e}default:{Me=55;break e}}case 1:switch(k|0){case 0:{k=(S|0)==0?4:(S|0)==1?5:7;break e}case 1:if(S){Me=55;break e}else{k=6;break e}default:{Me=55;break e}}default:Me=55}while(!1);(Me|0)==55&&(k=7),I=lh(Ke,k)|0,(I|0)==127?$=0:$=pi(I)|0;e:do if(k){if(We){if(S=xa(v,w)|0,(S|0)==7)return ht=5,ht|0;R=m[21344+(S*28|0)+(k<<2)>>2]|0;t:do if((R|0)>0)for(S=k,k=0;;){switch(S|0){case 1:{S=5;break}case 5:{S=4;break}case 4:{S=6;break}case 6:{S=2;break}case 2:{S=3;break}case 3:{S=1;break}}if(k=k+1|0,(k|0)==(R|0))break t}else S=k;while(!1);if((S|0)==1)return ht=9,ht|0;k=lh(Ke,S)|0,(k|0)==127&&at(27476,27315,415,27506),pi(k)|0?at(27521,27315,416,27506):(C=k,ot=R,De=S)}else C=I,ot=0,De=k;if(V=m[4272+(Ke*28|0)+(De<<2)>>2]|0,(V|0)<=-1&&at(27552,27315,423,27506),!$){if((ot|0)<0)return ht=5,ht|0;if(ot|0){R=N,S=0,k=m[R>>2]|0,R=m[R+4>>2]|0;do k=Ao(k,R)|0,R=ce()|0,ht=N,m[ht>>2]=k,m[ht+4>>2]=R,S=S+1|0;while((S|0)<(ot|0))}if((V|0)<=0){Me=104;break}for(R=N,S=0,k=m[R>>2]|0,R=m[R+4>>2]|0;;)if(k=Ao(k,R)|0,R=ce()|0,ht=N,m[ht>>2]=k,m[ht+4>>2]=R,S=S+1|0,(S|0)==(V|0)){Me=104;break e}}if(I=oa(C,Ke)|0,(I|0)==7&&at(27291,27315,432,27506),S=N,k=m[S>>2]|0,S=m[S+4>>2]|0,(V|0)>0){R=0;do k=Ao(k,S)|0,S=ce()|0,ht=N,m[ht>>2]=k,m[ht+4>>2]=S,R=R+1|0;while((R|0)!=(V|0))}if(S=xa(k,S)|0,(S|0)==7&&at(27634,27315,444,27506),k=yu(C)|0,k=m[(k?21760:21552)+(I*28|0)+(S<<2)>>2]|0,(k|0)<0&&at(27634,27315,458,27506),!k)Me=104;else{I=N,S=0,R=m[I>>2]|0,I=m[I+4>>2]|0;do R=wu(R,I)|0,I=ce()|0,ht=N,m[ht>>2]=R,m[ht+4>>2]=I,S=S+1|0;while((S|0)<(k|0));Me=104}}else if((We|0)!=0&($|0)!=0){if(C=xa(v,w)|0,S=N,S=xa(m[S>>2]|0,m[S+4>>2]|0)|0,(C|0)==7|(S|0)==7||(S=m[21344+(C*28|0)+(S<<2)>>2]|0,(S|0)<0))return ht=5,ht|0;if(!S)C=I,Me=105;else{R=N,C=0,k=m[R>>2]|0,R=m[R+4>>2]|0;do k=Ao(k,R)|0,R=ce()|0,ht=N,m[ht>>2]=k,m[ht+4>>2]=R,C=C+1|0;while((C|0)<(S|0));C=I,Me=104}}else C=I,Me=104;while(!1);return(Me|0)==104&&$&&(Me=105),(Me|0)==105&&(ht=N,(xa(m[ht>>2]|0,m[ht+4>>2]|0)|0)==1)?(ht=9,ht|0):(Tt=N,Ot=m[Tt>>2]|0,Tt=m[Tt+4>>2]&-1040385,$t=me(C|0,0,45)|0,Tt=Tt|(ce()|0),ht=N,m[ht>>2]=Ot|$t,m[ht+4>>2]=Tt,ht=0,ht|0)}else if((Me|0)==107)return C|0;return 0}function By(v,w,S,N,C,k){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,k=k|0;var R=0,I=0;return I=pe,pe=pe+16|0,R=I,C|0?(R=15,pe=I,R|0):(v=uf(v,w,S,N,R)|0,v||(C=m[R+4>>2]|0,v=m[R+8>>2]|0,m[k>>2]=(m[R>>2]|0)-v,m[k+4>>2]=C-v,v=0),R=v,pe=I,R|0)}function Ng(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0;return ie=pe,pe=pe+16|0,K=ie,N|0?(K=15,pe=ie,K|0):(I=m[S>>2]|0,R=m[S+4>>2]|0,m[K>>2]=I,V=K+4|0,m[V>>2]=R,$=K+8|0,m[$>>2]=0,S=(R|0)<(I|0),N=S?I:R,S=S?R:I,(S|0)<0?!((S|0)==-2147483648||((N|0)>0?(2147483647-N|0)<(S|0):(-2147483648-N|0)>(S|0)))&&!((N|0)>-1?(N|-2147483648|0)>=(S|0):(N^-2147483648|0)<(S|0))?k=5:N=1:k=5,(k|0)==5&&(N=R-I|0,k=0-I|0,(I|0)<0?(m[V>>2]=N,m[$>>2]=k,m[K>>2]=0,I=0):(N=R,k=0),R=I-N|0,S=k-N|0,(N|0)<0?(m[K>>2]=R,m[$>>2]=S,m[V>>2]=0,I=R,N=0):S=k,R=I-S|0,k=N-S|0,(S|0)<0?(m[K>>2]=R,m[V>>2]=k,m[$>>2]=0,S=0):(k=N,R=I),N=(k|0)<(R|0)?k:R,N=(S|0)<(N|0)?S:N,(N|0)>0&&(m[K>>2]=R-N,m[V>>2]=k-N,m[$>>2]=S-N),N=dx(v,w,K,C)|0),K=N,pe=ie,K|0)}function Mg(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0;return V=pe,pe=pe+32|0,R=V+12|0,I=V,k=uf(v,w,v,w,R)|0,k|0?(I=k,pe=V,I|0):(v=uf(v,w,S,N,I)|0,v|0?(I=v,pe=V,I|0):(v=(m[R>>2]|0)-(m[I>>2]|0)|0,$=(v|0)<0,N=$?0-v|0:0,S=N+((m[R+4>>2]|0)-(m[I+4>>2]|0))|0,w=(S|0)<0,N=(m[R+8>>2]|0)-(m[I+8>>2]|0)+N+(w?0-S|0:0)|0,k=(N|0)<0,R=k?0:N,N=k?N:0,k=(w?0:S)-N|0,N=($?0:v)-(w?S:0)-N|0,I=(k|0)<(N|0)?k:N,I=(R|0)<(I|0)?R:I,I=(I|0)>0?I:0,R=R-I|0,k=k-I|0,I=N-I|0,I=(I|0)>-1?I:0-I|0,k=(k|0)>-1?k:0-k|0,R=(R|0)>-1?R:0-R|0,R=(k|0)>(R|0)?k:R,R=(I|0)>(R|0)?I:R,I=C,m[I>>2]=R,m[I+4>>2]=((R|0)<0)<<31>>31,I=0,pe=V,I|0))}function ZT(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0;return R=pe,pe=pe+16|0,k=R,v=Mg(v,w,S,N,k)|0,v|0?(k=v,pe=R,k|0):(S=k,S=An(m[S>>2]|0,m[S+4>>2]|0,1,0)|0,N=ce()|0,k=C,m[k>>2]=S,m[k+4>>2]=N,k=0,pe=R,k|0)}function JT(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0;return V=pe,pe=pe+16|0,k=V,R=Mg(v,w,S,N,k)|0,R|0?(C=R,pe=V,C|0):(R=k,k=m[R>>2]|0,R=m[R+4>>2]|0,(k|0)==0&(R|0)==0?(m[C>>2]=v,m[C+4>>2]=w,C=0,pe=V,C|0):(I=bp(v,w,S,N,k,R,C,0,0,1,0)|0,I?(C=(bp(S,N,v,w,k,R,C,k,R,-1,-1)|0)==0,C=C?0:I,pe=V,C|0):(C=0,pe=V,C|0)))}function bp(v,w,S,N,C,k,R,I,V,$,K){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,k=k|0,R=R|0,I=I|0,V=V|0,$=$|0,K=K|0;var ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0,Xt=0,Et=0,Zt=0,nn=0;if(Zt=pe,pe=pe+48|0,ie=Zt+24|0,he=Zt+12|0,Et=Zt,m[ie>>2]=0,m[ie+4>>2]=0,m[ie+8>>2]=0,m[he>>2]=0,m[he+4>>2]=0,m[he+8>>2]=0,uf(v,w,v,w,ie)|0&&at(27634,27315,696,27575),uf(v,w,S,N,he)|0&&at(27634,27315,701,27575),je=ie+8|0,N=m[je>>2]|0,S=N-(m[ie>>2]|0)|0,m[ie>>2]=S,Xt=ie+4|0,N=(m[Xt>>2]|0)-N|0,m[Xt>>2]=N,Xt=N+S|0,ie=0-Xt|0,m[je>>2]=ie,je=he+8|0,Me=m[je>>
42812]|0,De=Me-(m[he>>2]|0)|0,m[he>>2]=De,ht=he+4|0,Me=(m[ht>>2]|0)-Me|0,m[ht>>2]=Me,ht=Me+De|0,m[je>>2]=0-ht,Tt=1/(+(C>>>0)+4294967296*+(k|0)),Ot=Tt*+(De-S|0),$t=Tt*+(Me-N|0),Tt=Tt*+(Xt-ht|0),m[Et>>2]=S,ht=Et+4|0,m[ht>>2]=N,Xt=Et+8|0,m[Xt>>2]=ie,(k|0)<0)return $=0,pe=Zt,$|0;for(Ke=+(S|0),ot=+(N|0),We=+(ie|0),De=0,Me=0;;){if(ye=+(De>>>0)+4294967296*+(Me|0),nn=Ot*ye+Ke,fe=$t*ye+ot,ye=Tt*ye+We,N=~~+zt(+nn),ie=~~+zt(+fe),S=~~+zt(+ye),nn=+Qt(+(+(N|0)-nn)),fe=+Qt(+(+(ie|0)-fe)),ye=+Qt(+(+(S|0)-ye)),nn>fe&nn>ye?(he=S+ie|0,N=0-he|0):(he=0-N|0,fe>ye&&(ie=he-S|0)),m[ht>>2]=ie,m[Et>>2]=he,m[Xt>>2]=0,S=N+ie|0,(N|0)>0?(m[ht>>2]=S,m[Xt>>2]=N,m[Et>>2]=0,he=0):(S=ie,N=0),(S|0)<0?(ie=he-S|0,m[Et>>2]=ie,N=N-S|0,m[Xt>>2]=N,m[ht>>2]=0,he=ie-N|0,S=0-N|0,(N|0)<0?(m[Et>>2]=he,m[ht>>2]=S,m[Xt>>2]=0,je=S,N=0):(je=0,he=ie)):je=S,S=(je|0)<(he|0)?je:he,S=(N|0)<(S|0)?N:S,(S|0)>0&&(m[Et>>2]=he-S,m[ht>>2]=je-S,m[Xt>>2]=N-S),S=as(De|0,Me|0,$|0,K|0)|0,S=An(S|0,ce()|0,I|0,V|0)|0,ce()|0,S=dx(v,w,Et,R+(S<<3)|0)|0,S|0){N=20;break}if(je=De,De=An(De|0,Me|0,1,0)|0,he=Me,Me=ce()|0,!((he|0)<(k|0)|(he|0)==(k|0)&je>>>0<C>>>0)){S=0,N=20;break}}return(N|0)==20?(pe=Zt,S|0):0}function hd(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0;if((S|0)==0&(N|0)==0)return C=0,k=1,He(C|0),k|0;k=v,C=w,v=1,w=0;do R=(S&1|0)==0&!0,v=as((R?1:k)|0,(R?0:C)|0,v|0,w|0)|0,w=ce()|0,S=Ad(S|0,N|0,1)|0,N=ce()|0,k=as(k|0,C|0,k|0,C|0)|0,C=ce()|0;while(!((S|0)==0&(N|0)==0));return He(w|0),v|0}function Uc(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0;I=pe,pe=pe+16|0,k=I,R=de(v|0,w|0,52)|0,ce()|0,R=R&15;do if(R){if(C=ea(v,w,k)|0,!C){$=+be[k>>3],V=1/+bn(+$),K=+be[26032+(R<<3)>>3],be[S>>3]=$+K,be[S+8>>3]=$-K,$=+be[k+8>>3],V=K*V,be[S+16>>3]=V+$,be[S+24>>3]=$-V;break}return R=C,pe=I,R|0}else{if(C=de(v|0,w|0,45)|0,ce()|0,C=C&127,C>>>0>121)return R=5,pe=I,R|0;k=22128+(C<<5)|0,m[S>>2]=m[k>>2],m[S+4>>2]=m[k+4>>2],m[S+8>>2]=m[k+8>>2],m[S+12>>2]=m[k+12>>2],m[S+16>>2]=m[k+16>>2],m[S+20>>2]=m[k+20>>2],m[S+24>>2]=m[k+24>>2],m[S+28>>2]=m[k+28>>2];break}while(!1);return _g(S,N?1.4:1.1),N=26160+(R<<3)|0,(m[N>>2]|0)==(v|0)&&(m[N+4>>2]|0)==(w|0)&&(be[S>>3]=1.5707963267948966),R=26288+(R<<3)|0,(m[R>>2]|0)==(v|0)&&(m[R+4>>2]|0)==(w|0)&&(be[S+8>>3]=-1.5707963267948966),+be[S>>3]!=1.5707963267948966&&+be[S+8>>3]!=-1.5707963267948966?(R=0,pe=I,R|0):(be[S+16>>3]=3.141592653589793,be[S+24>>3]=-3.141592653589793,R=0,pe=I,R|0)}function kg(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0;$=pe,pe=pe+48|0,R=$+32|0,k=$+40|0,I=$,Sg(R,0,0,0),V=m[R>>2]|0,R=m[R+4>>2]|0;do if(S>>>0<=15){if(C=wp(N)|0,C|0){N=I,m[N>>2]=0,m[N+4>>2]=0,m[I+8>>2]=C,m[I+12>>2]=-1,N=I+16|0,V=I+29|0,m[N>>2]=0,m[N+4>>2]=0,m[N+8>>2]=0,$e[N+12>>0]=0,$e[V>>0]=$e[k>>0]|0,$e[V+1>>0]=$e[k+1>>0]|0,$e[V+2>>0]=$e[k+2>>0]|0;break}if(C=xo((m[w+8>>2]|0)+1|0,32)|0,C){js(w,C),K=I,m[K>>2]=V,m[K+4>>2]=R,m[I+8>>2]=0,m[I+12>>2]=S,m[I+16>>2]=N,m[I+20>>2]=w,m[I+24>>2]=C,$e[I+28>>0]=0,V=I+29|0,$e[V>>0]=$e[k>>0]|0,$e[V+1>>0]=$e[k+1>>0]|0,$e[V+2>>0]=$e[k+2>>0]|0;break}else{N=I,m[N>>2]=0,m[N+4>>2]=0,m[I+8>>2]=13,m[I+12>>2]=-1,N=I+16|0,V=I+29|0,m[N>>2]=0,m[N+4>>2]=0,m[N+8>>2]=0,$e[N+12>>0]=0,$e[V>>0]=$e[k>>0]|0,$e[V+1>>0]=$e[k+1>>0]|0,$e[V+2>>0]=$e[k+2>>0]|0;break}}else V=I,m[V>>2]=0,m[V+4>>2]=0,m[I+8>>2]=4,m[I+12>>2]=-1,V=I+16|0,K=I+29|0,m[V>>2]=0,m[V+4>>2]=0,m[V+8>>2]=0,$e[V+12>>0]=0,$e[K>>0]=$e[k>>0]|0,$e[K+1>>0]=$e[k+1>>0]|0,$e[K+2>>0]=$e[k+2>>0]|0;while(!1);J0(I),m[v>>2]=m[I>>2],m[v+4>>2]=m[I+4>>2],m[v+8>>2]=m[I+8>>2],m[v+12>>2]=m[I+12>>2],m[v+16>>2]=m[I+16>>2],m[v+20>>2]=m[I+20>>2],m[v+24>>2]=m[I+24>>2],m[v+28>>2]=m[I+28>>2],pe=$}function J0(v){v=v|0;var w=0,S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0;if(Ke=pe,pe=pe+336|0,fe=Ke+168|0,ye=Ke,N=v,S=m[N>>2]|0,N=m[N+4>>2]|0,(S|0)==0&(N|0)==0){pe=Ke;return}if(w=v+28|0,$e[w>>0]|0?(S=Rg(S,N)|0,N=ce()|0):$e[w>>0]=1,ot=v+20|0,!(m[m[ot>>2]>>2]|0)){w=v+24|0,S=m[w>>2]|0,S|0&&Nn(S),Me=v,m[Me>>2]=0,m[Me+4>>2]=0,m[v+8>>2]=0,m[ot>>2]=0,m[v+12>>2]=-1,m[v+16>>2]=0,m[w>>2]=0,pe=Ke;return}Me=v+16|0,w=m[Me>>2]|0,C=w&15;e:do if((S|0)==0&(N|0)==0)De=v+24|0;else{je=v+12|0,ie=(C|0)==3,K=w&255,V=(C|1|0)==3,he=v+24|0,$=(C+-1|0)>>>0<3,R=(C|2|0)==3,I=ye+8|0;t:for(;;){if(k=de(S|0,N|0,52)|0,ce()|0,k=k&15,(k|0)==(m[je>>2]|0)){switch(K&15){case 0:case 2:case 3:{if(C=ea(S,N,fe)|0,C|0){We=15;break t}if(tm(m[ot>>2]|0,m[he>>2]|0,fe)|0){We=19;break t}break}}if(V&&(C=m[(m[ot>>2]|0)+4>>2]|0,m[fe>>2]=m[C>>2],m[fe+4>>2]=m[C+4>>2],m[fe+8>>2]=m[C+8>>2],m[fe+12>>2]=m[C+12>>2],sd(26896,fe)|0)){if(jc(m[(m[ot>>2]|0)+4>>2]|0,k,ye)|0){We=25;break}if(C=ye,(m[C>>2]|0)==(S|0)&&(m[C+4>>2]|0)==(N|0)){We=29;break}}if($){if(C=Xl(S,N,fe)|0,C|0){We=32;break}if(Uc(S,N,ye,0)|0){We=36;break}if(R&&Pg(m[ot>>2]|0,m[he>>2]|0,fe,ye)|0){We=42;break}if(V&&hx(m[ot>>2]|0,m[he>>2]|0,fe,ye)|0){We=42;break}}if(ie){if(w=Uc(S,N,fe,1)|0,C=m[he>>2]|0,w|0){We=45;break}if(rf(C,fe)|0){if(Lo(ye,fe),U_(fe,m[he>>2]|0)|0){We=53;break}if(tm(m[ot>>2]|0,m[he>>2]|0,I)|0){We=53;break}if(hx(m[ot>>2]|0,m[he>>2]|0,ye,fe)|0){We=53;break}}}}do if((k|0)<(m[je>>2]|0)){if(w=Uc(S,N,fe,1)|0,C=m[he>>2]|0,w|0){We=58;break t}if(!(rf(C,fe)|0)){We=73;break}if(U_(m[he>>2]|0,fe)|0&&(Lo(ye,fe),Pg(m[ot>>2]|0,m[he>>2]|0,ye,fe)|0)){We=65;break t}if(S=cd(S,N,k+1|0,ye)|0,S|0){We=67;break t}N=ye,S=m[N>>2]|0,N=m[N+4>>2]|0}else We=73;while(!1);if((We|0)==73&&(We=0,S=Rg(S,N)|0,N=ce()|0),(S|0)==0&(N|0)==0){De=he;break e}}switch(We|0){case 15:{w=m[he>>2]|0,w|0&&Nn(w),We=v,m[We>>2]=0,m[We+4>>2]=0,m[ot>>2]=0,m[je>>2]=-1,m[Me>>2]=0,m[he>>2]=0,m[v+8>>2]=C,We=20;break}case 19:{m[v>>2]=S,m[v+4>>2]=N,We=20;break}case 25:{at(27634,27600,470,27611);break}case 29:{m[v>>2]=S,m[v+4>>2]=N,pe=Ke;return}case 32:{w=m[he>>2]|0,w|0&&Nn(w),De=v,m[De>>2]=0,m[De+4>>2]=0,m[ot>>2]=0,m[je>>2]=-1,m[Me>>2]=0,m[he>>2]=0,m[v+8>>2]=C,pe=Ke;return}case 36:{at(27634,27600,493,27611);break}case 42:{m[v>>2]=S,m[v+4>>2]=N,pe=Ke;return}case 45:{C|0&&Nn(C),We=v,m[We>>2]=0,m[We+4>>2]=0,m[ot>>2]=0,m[je>>2]=-1,m[Me>>2]=0,m[he>>2]=0,m[v+8>>2]=w,We=55;break}case 53:{m[v>>2]=S,m[v+4>>2]=N,We=55;break}case 58:{C|0&&Nn(C),We=v,m[We>>2]=0,m[We+4>>2]=0,m[ot>>2]=0,m[je>>2]=-1,m[Me>>2]=0,m[he>>2]=0,m[v+8>>2]=w,We=71;break}case 65:{m[v>>2]=S,m[v+4>>2]=N,We=71;break}case 67:{w=m[he>>2]|0,w|0&&Nn(w),De=v,m[De>>2]=0,m[De+4>>2]=0,m[ot>>2]=0,m[je>>2]=-1,m[Me>>2]=0,m[he>>2]=0,m[v+8>>2]=S,pe=Ke;return}}if((We|0)==20){pe=Ke;return}else if((We|0)==55){pe=Ke;return}else if((We|0)==71){pe=Ke;return}}while(!1);w=m[De>>2]|0,w|0&&Nn(w),We=v,m[We>>2]=0,m[We+4>>2]=0,m[v+8>>2]=0,m[ot>>2]=0,m[v+12>>2]=-1,m[Me>>2]=0,m[De>>2]=0,pe=Ke}function Rg(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0;ie=pe,pe=pe+16|0,K=ie,N=de(v|0,w|0,52)|0,ce()|0,N=N&15,S=de(v|0,w|0,45)|0,ce()|0;do if(N){for(;S=me(N+4095|0,0,52)|0,C=ce()|0|w&-15728641,k=(15-N|0)*3|0,R=me(7,0,k|0)|0,I=ce()|0,S=S|v|R,C=C|I,V=de(v|0,w|0,k|0)|0,ce()|0,V=V&7,N=N+-1|0,!(V>>>0<6);)if(N)w=C,v=S;else{$=4;break}if(($|0)==4){S=de(S|0,C|0,45)|0,ce()|0;break}return K=(V|0)==0&(Er(S,C)|0)!=0,K=me((K?2:1)+V|0,0,k|0)|0,$=ce()|0|w&~I,K=K|v&~R,He($|0
4281),pe=ie,K|0}while(!1);return S=S&127,S>>>0>120?($=0,K=0,He($|0),pe=ie,K|0):(Sg(K,0,S+1|0,0),$=m[K+4>>2]|0,K=m[K>>2]|0,He($|0),pe=ie,K|0)}function em(v,w,S,N,C,k){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,k=k|0;var R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0;We=pe,pe=pe+160|0,ie=We+80|0,I=We+64|0,he=We+112|0,je=We,kg(ie,v,w,S),$=ie,dd(I,m[$>>2]|0,m[$+4>>2]|0,w),$=I,V=m[$>>2]|0,$=m[$+4>>2]|0,R=m[ie+8>>2]|0,fe=he+4|0,m[fe>>2]=m[ie>>2],m[fe+4>>2]=m[ie+4>>2],m[fe+8>>2]=m[ie+8>>2],m[fe+12>>2]=m[ie+12>>2],m[fe+16>>2]=m[ie+16>>2],m[fe+20>>2]=m[ie+20>>2],m[fe+24>>2]=m[ie+24>>2],m[fe+28>>2]=m[ie+28>>2],fe=je,m[fe>>2]=V,m[fe+4>>2]=$,fe=je+8|0,m[fe>>2]=R,v=je+12|0,w=he,S=v+36|0;do m[v>>2]=m[w>>2],v=v+4|0,w=w+4|0;while((v|0)<(S|0));if(he=je+48|0,m[he>>2]=m[I>>2],m[he+4>>2]=m[I+4>>2],m[he+8>>2]=m[I+8>>2],m[he+12>>2]=m[I+12>>2],(V|0)==0&($|0)==0)return je=R,pe=We,je|0;S=je+16|0,K=je+24|0,ie=je+28|0,R=0,I=0,w=V,v=$;do{if(!((R|0)<(C|0)|(R|0)==(C|0)&I>>>0<N>>>0)){ye=4;break}if($=I,I=An(I|0,R|0,1,0)|0,R=ce()|0,$=k+($<<3)|0,m[$>>2]=w,m[$+4>>2]=v,lx(he),v=he,w=m[v>>2]|0,v=m[v+4>>2]|0,(w|0)==0&(v|0)==0){if(J0(S),w=S,v=m[w>>2]|0,w=m[w+4>>2]|0,(v|0)==0&(w|0)==0){ye=10;break}lf(v,w,m[ie>>2]|0,he),v=he,w=m[v>>2]|0,v=m[v+4>>2]|0}$=je,m[$>>2]=w,m[$+4>>2]=v}while(!((w|0)==0&(v|0)==0));return(ye|0)==4?(v=je+40|0,w=m[v>>2]|0,w|0&&Nn(w),ye=je+16|0,m[ye>>2]=0,m[ye+4>>2]=0,m[K>>2]=0,m[je+36>>2]=0,m[ie>>2]=-1,m[je+32>>2]=0,m[v>>2]=0,lf(0,0,0,he),m[je>>2]=0,m[je+4>>2]=0,m[fe>>2]=0,je=14,pe=We,je|0):((ye|0)==10&&(m[je>>2]=0,m[je+4>>2]=0,m[fe>>2]=m[K>>2]),je=m[fe>>2]|0,pe=We,je|0)}function zi(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0;if(ie=pe,pe=pe+48|0,V=ie+32|0,I=ie+40|0,$=ie,!(m[v>>2]|0))return K=N,m[K>>2]=0,m[K+4>>2]=0,K=0,pe=ie,K|0;Sg(V,0,0,0),R=V,C=m[R>>2]|0,R=m[R+4>>2]|0;do if(w>>>0>15)K=$,m[K>>2]=0,m[K+4>>2]=0,m[$+8>>2]=4,m[$+12>>2]=-1,K=$+16|0,S=$+29|0,m[K>>2]=0,m[K+4>>2]=0,m[K+8>>2]=0,$e[K+12>>0]=0,$e[S>>0]=$e[I>>0]|0,$e[S+1>>0]=$e[I+1>>0]|0,$e[S+2>>0]=$e[I+2>>0]|0,S=4,K=9;else{if(S=wp(S)|0,S|0){V=$,m[V>>2]=0,m[V+4>>2]=0,m[$+8>>2]=S,m[$+12>>2]=-1,V=$+16|0,K=$+29|0,m[V>>2]=0,m[V+4>>2]=0,m[V+8>>2]=0,$e[V+12>>0]=0,$e[K>>0]=$e[I>>0]|0,$e[K+1>>0]=$e[I+1>>0]|0,$e[K+2>>0]=$e[I+2>>0]|0,K=9;break}if(S=xo((m[v+8>>2]|0)+1|0,32)|0,!S){K=$,m[K>>2]=0,m[K+4>>2]=0,m[$+8>>2]=13,m[$+12>>2]=-1,K=$+16|0,S=$+29|0,m[K>>2]=0,m[K+4>>2]=0,m[K+8>>2]=0,$e[K+12>>0]=0,$e[S>>0]=$e[I>>0]|0,$e[S+1>>0]=$e[I+1>>0]|0,$e[S+2>>0]=$e[I+2>>0]|0,S=13,K=9;break}js(v,S),fe=$,m[fe>>2]=C,m[fe+4>>2]=R,R=$+8|0,m[R>>2]=0,m[$+12>>2]=w,m[$+20>>2]=v,m[$+24>>2]=S,$e[$+28>>0]=0,C=$+29|0,$e[C>>0]=$e[I>>0]|0,$e[C+1>>0]=$e[I+1>>0]|0,$e[C+2>>0]=$e[I+2>>0]|0,m[$+16>>2]=3,he=+nf(S),he=he*+bg(S),k=+Qt(+ +be[S>>3]),k=he/+bn(+ +Ct(+k,+ +Qt(+ +be[S+8>>3])))*6371.007180918475*6371.007180918475,C=$+12|0,S=m[C>>2]|0;e:do if((S|0)>0)do{if(Z0(S+-1|0,V)|0,!(k/+be[V>>3]>10))break e;fe=m[C>>2]|0,S=fe+-1|0,m[C>>2]=S}while((fe|0)>1);while(!1);if(J0($),C=N,m[C>>2]=0,m[C+4>>2]=0,C=$,S=m[C>>2]|0,C=m[C+4>>2]|0,!((S|0)==0&(C|0)==0))do mp(S,C,w,V)|0,I=V,v=N,I=An(m[v>>2]|0,m[v+4>>2]|0,m[I>>2]|0,m[I+4>>2]|0)|0,v=ce()|0,fe=N,m[fe>>2]=I,m[fe+4>>2]=v,J0($),fe=$,S=m[fe>>2]|0,C=m[fe+4>>2]|0;while(!((S|0)==0&(C|0)==0));S=m[R>>2]|0}while(!1);return fe=S,pe=ie,fe|0}function hh(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0;if(!(sd(w,S)|0)||(w=Dy(w)|0,N=+be[S>>3],C=+be[S+8>>3],C=w&C<0?C+6.283185307179586:C,he=m[v>>2]|0,(he|0)<=0))return he=0,he|0;if(ie=m[v+4>>2]|0,w){w=0,K=C,S=-1,v=0;e:for(;;){for($=v;R=+be[ie+($<<4)>>3],C=+be[ie+($<<4)+8>>3],v=(S+2|0)%(he|0)|0,k=+be[ie+(v<<4)>>3],I=+be[ie+(v<<4)+8>>3],R>k?(V=R,R=I):(V=k,k=R,R=C,C=I),N=N==k|N==V?N+2220446049250313e-31:N,!!(N<k|N>V);)if(S=$+1|0,(S|0)>=(he|0)){S=22;break e}else v=$,$=S,S=v;if(I=R<0?R+6.283185307179586:R,R=C<0?C+6.283185307179586:C,K=I==K|R==K?K+-2220446049250313e-31:K,V=I+(R-I)*((N-k)/(V-k)),(V<0?V+6.283185307179586:V)>K&&(w=w^1),v=$+1|0,(v|0)>=(he|0)){S=22;break}else S=$}if((S|0)==22)return w|0}else{w=0,K=C,S=-1,v=0;e:for(;;){for($=v;R=+be[ie+($<<4)>>3],C=+be[ie+($<<4)+8>>3],v=(S+2|0)%(he|0)|0,k=+be[ie+(v<<4)>>3],I=+be[ie+(v<<4)+8>>3],R>k?(V=R,R=I):(V=k,k=R,R=C,C=I),N=N==k|N==V?N+2220446049250313e-31:N,
4281!!(N<k|N>V);)if(S=$+1|0,(S|0)>=(he|0)){S=22;break e}else v=$,$=S,S=v;if(K=R==K|C==K?K+-2220446049250313e-31:K,R+(C-R)*((N-k)/(V-k))>K&&(w=w^1),v=$+1|0,(v|0)>=(he|0)){S=22;break}else S=$}if((S|0)==22)return w|0}return 0}function df(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0;if(ye=m[v>>2]|0,!ye){m[w>>2]=0,m[w+4>>2]=0,m[w+8>>2]=0,m[w+12>>2]=0,m[w+16>>2]=0,m[w+20>>2]=0,m[w+24>>2]=0,m[w+28>>2]=0;return}if(je=w+8|0,be[je>>3]=17976931348623157e292,We=w+24|0,be[We>>3]=17976931348623157e292,be[w>>3]=-17976931348623157e292,De=w+16|0,be[De>>3]=-17976931348623157e292,!((ye|0)<=0)){for(he=m[v+4>>2]|0,$=17976931348623157e292,K=-17976931348623157e292,ie=0,v=-1,k=17976931348623157e292,R=17976931348623157e292,V=-17976931348623157e292,N=-17976931348623157e292,fe=0;S=+be[he+(fe<<4)>>3],I=+be[he+(fe<<4)+8>>3],v=v+2|0,C=+be[he+(((v|0)==(ye|0)?0:v)<<4)+8>>3],S<k&&(be[je>>3]=S,k=S),I<R&&(be[We>>3]=I,R=I),S>V?be[w>>3]=S:S=V,I>N&&(be[De>>3]=I,N=I),$=I>0&I<$?I:$,K=I<0&I>K?I:K,ie=ie|+Qt(+(I-C))>3.141592653589793,v=fe+1|0,(v|0)!=(ye|0);)Me=fe,V=S,fe=v,v=Me;ie&&(be[De>>3]=K,be[We>>3]=$)}}function wp(v){return v=v|0,(v>>>0<4?0:15)|0}function js(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0;if(ye=m[v>>2]|0,ye){if(je=w+8|0,be[je>>3]=17976931348623157e292,We=w+24|0,be[We>>3]=17976931348623157e292,be[w>>3]=-17976931348623157e292,De=w+16|0,be[De>>3]=-17976931348623157e292,(ye|0)>0){for(C=m[v+4>>2]|0,he=17976931348623157e292,fe=-17976931348623157e292,N=0,S=-1,V=17976931348623157e292,$=17976931348623157e292,ie=-17976931348623157e292,R=-17976931348623157e292,Me=0;k=+be[C+(Me<<4)>>3],K=+be[C+(Me<<4)+8>>3],$t=S+2|0,I=+be[C+((($t|0)==(ye|0)?0:$t)<<4)+8>>3],k<V&&(be[je>>3]=k,V=k),K<$&&(be[We>>3]=K,$=K),k>ie?be[w>>3]=k:k=ie,K>R&&(be[De>>3]=K,R=K),he=K>0&K<he?K:he,fe=K<0&K>fe?K:fe,N=N|+Qt(+(K-I))>3.141592653589793,S=Me+1|0,(S|0)!=(ye|0);)$t=Me,ie=k,Me=S,S=$t;N&&(be[De>>3]=fe,be[We>>3]=he)}}else m[w>>2]=0,m[w+4>>2]=0,m[w+8>>2]=0,m[w+12>>2]=0,m[w+16>>2]=0,m[w+20>>2]=0,m[w+24>>2]=0,m[w+28>>2]=0;if($t=v+8|0,S=m[$t>>2]|0,!((S|0)<=0)){Ot=v+12|0,Ke=0;do if(C=m[Ot>>2]|0,N=Ke,Ke=Ke+1|0,We=w+(Ke<<5)|0,De=m[C+(N<<3)>>2]|0,De){if(Me=w+(Ke<<5)+8|0,be[Me>>3]=17976931348623157e292,v=w+(Ke<<5)+24|0,be[v>>3]=17976931348623157e292,be[We>>3]=-17976931348623157e292,ot=w+(Ke<<5)+16|0,be[ot>>3]=-17976931348623157e292,(De|0)>0){for(ye=m[C+(N<<3)+4>>2]|0,he=17976931348623157e292,fe=-17976931348623157e292,C=0,N=-1,je=0,V=17976931348623157e292,$=17976931348623157e292,K=-17976931348623157e292,R=-17976931348623157e292;k=+be[ye+(je<<4)>>3],ie=+be[ye+(je<<4)+8>>3],N=N+2|0,I=+be[ye+(((N|0)==(De|0)?0:N)<<4)+8>>3],k<V&&(be[Me>>3]=k,V=k),ie<$&&(be[v>>3]=ie,$=ie),k>K?be[We>>3]=k:k=K,ie>R&&(be[ot>>3]=ie,R=ie),he=ie>0&ie<he?ie:he,fe=ie<0&ie>fe?ie:fe,C=C|+Qt(+(ie-I))>3.141592653589793,N=je+1|0,(N|0)!=(De|0);)Tt=je,je=N,K=k,N=Tt;C&&(be[ot>>3]=fe,be[v>>3]=he)}}else m[We>>2]=0,m[We+4>>2]=0,m[We+8>>2]=0,m[We+12>>2]=0,m[We+16>>2]=0,m[We+20>>2]=0,m[We+24>>2]=0,m[We+28>>2]=0,S=m[$t>>2]|0;while((Ke|0)<(S|0))}}function tm(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0;if(!(hh(v,w,S)|0))return C=0,C|0;if(C=v+8|0,(m[C>>2]|0)<=0)return C=1,C|0;for(N=v+12|0,v=0;;){if(k=v,v=v+1|0,hh((m[N>>2]|0)+(k<<3)|0,w+(v<<5)|0,S)|0){v=0,N=6;break}if((v|0)>=(m[C>>2]|0)){v=1,N=6;break}}return(N|0)==6?v|0:0}function Pg(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0;if($=pe,pe=pe+16|0,I=$,R=S+8|0,!(hh(v,w,R)|0))return V=0,pe=$,V|0;V=v+8|0;e:do if((m[V>>2]|0)>0){for(k=v+12|0,C=0;;){if(K=C,C=C+1|0,hh((m[k>>2]|0)+(K<<3)|0,w+(C<<5)|0,R)|0){C=0;break}if((C|0)>=(m[V>>2]|0))break e}return pe=$,C|0}while(!1);if(nm(v,w,S,N)|0)return K=0,pe=$,K|0;m[I>>2]=m[S>>2],m[I+4>>2]=R,C=m[V>>2]|0;e:do if((C|0)>0)for(v=v+12|0,R=0,k=C;;){if(C=m[v>>2]|0,(m[C+(R<<3)>>2]|0)>0){if(hh(I,N,m[C+(R<<3)+4>>2]|0)|0){C=0;break e}if(C=R+1|0,nm((m[v>>2]|0)+(R<<3)|0,w+(C<<5)|0,S,N)|0){C=0;break e}k=m[V>>2]|0}else C=R+1|0;if((C|0)<(k|0))R=C;else{C=1;break}}else C=1;while(!1);return K=C,pe=$,K|0}function nm(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;
4281var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0,$t=0,Tt=0,ht=0;if($t=pe,pe=pe+176|0,Me=$t+172|0,C=$t+168|0,ot=$t,!(rf(w,N)|0))return v=0,pe=$t,v|0;if(sx(w,N,Me,C),Wt(ot|0,S|0,168)|0,(m[S>>2]|0)>0){w=0;do Tt=ot+8+(w<<4)+8|0,De=+bl(+be[Tt>>3],m[C>>2]|0),be[Tt>>3]=De,w=w+1|0;while((w|0)<(m[S>>2]|0))}je=+be[N>>3],We=+be[N+8>>3],De=+bl(+be[N+16>>3],m[C>>2]|0),fe=+bl(+be[N+24>>3],m[C>>2]|0);e:do if((m[v>>2]|0)>0){if(N=v+4|0,C=m[ot>>2]|0,(C|0)<=0){for(w=0;;)if(w=w+1|0,(w|0)>=(m[v>>2]|0)){w=0;break e}}for(S=0;;){if(w=m[N>>2]|0,he=+be[w+(S<<4)>>3],ye=+bl(+be[w+(S<<4)+8>>3],m[Me>>2]|0),w=m[N>>2]|0,S=S+1|0,Tt=(S|0)%(m[v>>2]|0)|0,k=+be[w+(Tt<<4)>>3],R=+bl(+be[w+(Tt<<4)+8>>3],m[Me>>2]|0),!(he>=je)|!(k>=je)&&!(he<=We)|!(k<=We)&&!(ye<=fe)|!(R<=fe)&&!(ye>=De)|!(R>=De)){ie=k-he,$=R-ye,w=0;do if(ht=w,w=w+1|0,Tt=(w|0)==(C|0)?0:w,k=+be[ot+8+(ht<<4)+8>>3],R=+be[ot+8+(Tt<<4)+8>>3]-k,I=+be[ot+8+(ht<<4)>>3],V=+be[ot+8+(Tt<<4)>>3]-I,K=ie*R-$*V,K!=0&&(Ke=ye-k,Ot=he-I,V=(Ke*V-R*Ot)/K,!(V<0|V>1))&&(K=(ie*Ke-$*Ot)/K,K>=0&K<=1)){w=1;break e}while((w|0)<(C|0))}if((S|0)>=(m[v>>2]|0)){w=0;break}}}else w=0;while(!1);return ht=w,pe=$t,ht|0}function hx(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0;if(nm(v,w,S,N)|0)return k=1,k|0;if(k=v+8|0,(m[k>>2]|0)<=0)return k=0,k|0;for(C=v+12|0,v=0;;){if(R=v,v=v+1|0,nm((m[C>>2]|0)+(R<<3)|0,w+(v<<5)|0,S,N)|0){v=1,C=6;break}if((v|0)>=(m[k>>2]|0)){v=0,C=6;break}}return(C|0)==6?v|0:0}function fh(){return 8}function rm(){return 16}function Lg(){return 168}function z_(){return 8}function G_(){return 16}function Bc(){return 12}function q_(){return 8}function fx(v){return v=v|0,+(+((m[v>>2]|0)>>>0)+4294967296*+(m[v+4>>2]|0))}function Vy(v){v=v|0;var w=0,S=0;return S=+be[v>>3],w=+be[v+8>>3],+ +Pt(+(S*S+w*w))}function _s(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0;$=+be[v>>3],V=+be[w>>3]-$,I=+be[v+8>>3],R=+be[w+8>>3]-I,ie=+be[S>>3],k=+be[N>>3]-ie,he=+be[S+8>>3],K=+be[N+8>>3]-he,k=(k*(I-he)-($-ie)*K)/(V*K-R*k),be[C>>3]=$+V*k,be[C+8>>3]=I+R*k}function Og(v,w){return v=v|0,w=w|0,+Qt(+(+be[v>>3]-+be[w>>3]))<11920928955078125e-23?(w=+Qt(+(+be[v+8>>3]-+be[w+8>>3]))<11920928955078125e-23,w|0):(w=0,w|0)}function Dg(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0;if(k=pe,pe=pe+16|0,C=k,N=Er(v,w)|0,(S+-1|0)>>>0>5||(N=(N|0)!=0,(S|0)==1&N))return C=-1,pe=k,C|0;do if(fd(v,w,C)|0)N=-1;else if(N){N=((m[26416+(S<<2)>>2]|0)+5-(m[C>>2]|0)|0)%5|0;break}else{N=((m[26448+(S<<2)>>2]|0)+6-(m[C>>2]|0)|0)%6|0;break}while(!1);return C=N,pe=k,C|0}function fd(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0;if(K=pe,pe=pe+32|0,I=K+16|0,V=K,N=Wl(v,w,I)|0,N|0)return S=N,pe=K,S|0;k=Iy(v,w)|0,$=xa(v,w)|0,Qo(k,V),N=oh(k,m[I>>2]|0)|0;do if(pi(k)|0){do switch(k|0){case 4:{C=0;break}case 14:{C=1;break}case 24:{C=2;break}case 38:{C=3;break}case 49:{C=4;break}case 58:{C=5;break}case 63:{C=6;break}case 72:{C=7;break}case 83:{C=8;break}case 97:{C=9;break}case 107:{C=10;break}case 117:{C=11;break}default:at(27634,27636,75,27645)}while(!1);if(R=m[26480+(C*24|0)+8>>2]|0,w=m[26480+(C*24|0)+16>>2]|0,v=m[I>>2]|0,(v|0)!=(m[V>>2]|0)&&(V=yu(k)|0,v=m[I>>2]|0,V|(v|0)==(w|0)&&(N=(N+1|0)%6|0)),($|0)==3&(v|0)==(w|0)){N=(N+5|0)%6|0;break}($|0)==5&(v|0)==(R|0)&&(N=(N+1|0)%6|0)}while(!1);return m[S>>2]=N,S=0,pe=K,S|0}function wl(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0;if(ot=pe,pe=pe+32|0,Me=ot+24|0,We=ot+20|0,ye=ot+8|0,fe=ot+16|0,he=ot,V=(Er(v,w)|0)==0,V=V?6:5,K=de(v|0,w|0,52)|0,ce()|0,K=K&15,V>>>0<=S>>>0)return N=2,pe=ot,N|0;ie=(K|0)==0,!ie&&(je=me(7,0,(K^15)*3|0)|0,(je&v|0)==0&((ce()|0)&w|0)==0)?C=S:k=4;e:do if((k|0)==4){if(C=(Er(v,w)|0)!=0,((C?4:5)|0)<(S|0)||fd(v,w,Me)|0||(k=(m[Me>>2]|0)+S|0,C?C=26768+(((k|0)%5|0)<<2)|0:C=26800+(((k|0)%6|0)<<2)|0,je=m[C>>2]|0,(je|0)==7))return N=1,pe=ot,N|0;m[We>>2]=0,C=yr(v,w,je,We,ye)|0;do if(!C){if(I=ye,$=m[I>>2]|0,I=m[I+4>>2]|0,R=I>>>0<w>>>0|(I|0)==(w|0)&$>>>0<v>>>0,k=R?$:v,R=R?I:w,!ie&&(ie=me(7,0,(K^15)*3|0)|0,($&ie|0)==0&(I&(ce()|0)|0)==0))C=S;else{if(I=(S+-1+V|0)%(V|0)|0,C=Er(v,w)|0,(I|0)<0&&at(27634,27636,248,27661),V=(C|0)!=0,((V?4:5)|0)<(I|0)&&at(27634,27636,248,27661),fd(v,w,Me)|0&&at(27634,27636,248,27661),C=(m[Me>>2]|0)+I|0,V?C=26768+(((C|0)%5|0)<<2)|0:C=26800+(((C|0)%6|0)<<2)|0,I=m[C>>2]|0,(I|0)==7&&at(27634,27636,248,27661),m[fe>>2]=0,C=yr(v,w,I,fe,he)|0,C|0)break;$=he,V=m[$>>2]|0,$=m[$+4>>2]|0;do if($>>>0<R>>>0|($|0)==(R|0)&V>>>0<k>>>0){if(Er(V,$)|0?k=Rc(V,$,v,w)|0:k=m[26864+((((m[fe>>2]|0)+(m[26832+(I<<2)>>2]|0)|0)%6|0)<<2)>>2]|0,C=Er(V,$)|0,(k+-1|0)>>>0>5){C=-1,k=V,R=$;break}if(C=(C|0)!=0,(k|0)==1&C){C=-1,k=V,R=$;break}do if(fd(V,$,Me)|0)C=-1;else if(C){C=((m[26416+(k<<2)>>2]|0)+5-(m[Me>>2]|0)|0)%5|0;break}else{C=((m[26448+(k<<2)>>2]|0)+6-(m[Me>>2]|0)|0)%6|0;break}while(!1);k=V,R=$}else C=S;while(!1);I=ye,$=m[I>>2]|0,I=m[I+4>>2]|0}if((k|0)==($|0)&(R|0)==(I|0)){if(V=(Er($,I)|0)!=0,V?v=Rc($,I,v,w)|0:v=m[26864+((((m[We>>2]|0)+(m[26832+(je<<2)>>2]|0)|0)%6|0)<<2)>>2]|0,C=Er($,I)|0,(v+-1|0)>>>0<=5&&(De=(C|0)!=0,!((v|0)==1&De)))do if(fd($,I,Me)|0)C=-1;else if(De){C=((m[26416+(v<<2)>>2]|0)+5-(m[Me>>2]|0)|0)%5|0;break}else{C=((m[26448+(v<<2)>>2]|0)+6-(m[Me>>2]|0)|0)%6|0;break}while(!1);else C=-1;C=C+1|0,C=(C|0)==6|V&(C|0)==5?0:C}w=R,v=k;break e}while(!1);return N=C,pe=ot,N|0}while(!1);return De=me(C|0,0,56)|0,Me=ce()|0|w&-2130706433|536870912,m[N>>2]=De|v,m[N+4>>2]=Me,N=0,pe=ot,N|0}function pd(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0;return k=(Er(v,w)|0)==0,N=wl(v,w,0,S)|0,C=(N|0)==0,k?!C||(N=wl(v,w,1,S+8|0)|0,N|0)||
vendor: 5,715 bytes, line 4281
4281(N=wl(v,w,2,S+16|0)|0,N|0)||(N=wl(v,w,3,S+24|0)|0,N|0)||(N=wl(v,w,4,S+32|0)|0,N)?(k=N,k|0):wl(v,w,5,S+40|0)|0:!C||(N=wl(v,w,1,S+8|0)|0,N|0)||(N=wl(v,w,2,S+16|0)|0,N|0)||(N=wl(v,w,3,S+24|0)|0,N|0)||(N=wl(v,w,4,S+32|0)|0,N|0)?(k=N,k|0):(k=S+40|0,m[k>>2]=0,m[k+4>>2]=0,k=0,k|0)}function ph(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0,V=0;return V=pe,pe=pe+192|0,C=V,k=V+168|0,R=de(v|0,w|0,56)|0,ce()|0,R=R&7,I=w&-2130706433|134217728,N=Wl(v,I,k)|0,N|0?(I=N,pe=V,I|0):(w=de(v|0,w|0,52)|0,ce()|0,w=w&15,Er(v,I)|0?X0(k,w,R,1,C):uh(k,w,R,1,C),I=C+8|0,m[S>>2]=m[I>>2],m[S+4>>2]=m[I+4>>2],m[S+8>>2]=m[I+8>>2],m[S+12>>2]=m[I+12>>2],I=0,pe=V,I|0)}function im(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0;return C=pe,pe=pe+16|0,S=C,!(!0&(w&2013265920|0)==536870912)||(N=w&-2130706433|134217728,!(K0(v,N)|0))?(N=0,pe=C,N|0):(k=de(v|0,w|0,56)|0,ce()|0,k=(wl(v,N,k&7,S)|0)==0,N=S,N=k&((m[N>>2]|0)==(v|0)?(m[N+4>>2]|0)==(w|0):0)&1,pe=C,N|0)}function hf(){return 27680}function _p(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0;ie=pe,pe=pe+208|0,V=ie,$=ie+192|0,R=si(S,w)|0,I=$,m[I>>2]=1,m[I+4>>2]=0;e:do if(R|0){for(I=0-S|0,m[V+4>>2]=S,m[V>>2]=S,C=2,w=S,k=S;w=w+S+k|0,m[V+(C<<2)>>2]=w,w>>>0<R>>>0;)he=k,C=C+1|0,k=w,w=he;if(k=v+R+I|0,k>>>0>v>>>0){R=k,C=1,w=1;do{do if((w&3|0)!=3)if(w=C+-1|0,(m[V+(w<<2)>>2]|0)>>>0<(R-v|0)>>>0?px(v,S,N,C,V):sm(v,S,N,$,C,0,V),(C|0)==1){ff($,1),C=0;break}else{ff($,w),C=1;break}else px(v,S,N,C,V),jg($,2),C=C+2|0;while(!1);w=m[$>>2]|1,m[$>>2]=w,v=v+S|0}while(v>>>0<k>>>0)}else C=1,w=1;for(sm(v,S,N,$,C,0,V),k=$+4|0;;){if((C|0)==1&(w|0)==1)if(m[k>>2]|0)K=19;else break e;else(C|0)<2?K=19:(ff($,2),he=C+-2|0,m[$>>2]=m[$>>2]^7,jg($,1),sm(v+(0-(m[V+(he<<2)>>2]|0))+I|0,S,N,$,C+-1|0,1,V),ff($,1),w=m[$>>2]|1,m[$>>2]=w,v=v+I|0,sm(v,S,N,$,he,1,V),C=he);(K|0)==19&&(K=0,w=am($)|0,jg($,w),v=v+I|0,C=w+C|0,w=m[$>>2]|0)}}while(!1);pe=ie}function px(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0;ie=pe,pe=pe+240|0,K=ie,m[K>>2]=v;e:do if((N|0)>1)for($=0-w|0,I=v,k=N,N=1,R=v;;){if(I=I+$|0,V=k+-2|0,v=I+(0-(m[C+(V<<2)>>2]|0))|0,(En[S&3](R,v)|0)>-1&&(En[S&3](R,I)|0)>-1||(R=K+(N<<2)|0,(En[S&3](v,I)|0)>-1?(m[R>>2]=v,k=k+-1|0):(m[R>>2]=I,v=I,k=V),N=N+1|0,(k|0)<=1))break e;I=v,R=m[K>>2]|0}else N=1;while(!1);Ig(w,K,N),pe=ie}function jg(v,w){v=v|0,w=w|0;var S=0,N=0,C=0;C=v+4|0,w>>>0>31?(N=m[C>>2]|0,m[v>>2]=N,m[C>>2]=0,w=w+-32|0,S=0):(S=m[C>>2]|0,N=m[v>>2]|0),m[v>>2]=S<<32-w|N>>>w,m[C>>2]=S>>>w}function sm(v,w,S,N,C,k,R){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0,k=k|0,R=R|0;var I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0;fe=pe,pe=pe+240|0,ie=fe+232|0,he=fe,ye=m[N>>2]|0,m[ie>>2]=ye,V=m[N+4>>2]|0,$=ie+4|0,m[$>>2]=V,m[he>>2]=v;e:do if((ye|0)!=1|(V|0)!=0&&(K=0-w|0,I=v+(0-(m[R+(C<<2)>>2]|0))|0,(En[S&3](I,v)|0)>=1))for(N=1,k=(k|0)==0,V=I;;){if(k&(C|0)>1){if(k=v+K|0,I=m[R+(C+-2<<2)>>2]|0,(En[S&3](k,V)|0)>-1){I=10;break e}if((En[S&3](k+(0-I)|0,V)|0)>-1){I=10;break e}}if(k=N+1|0,m[he+(N<<2)>>2]=V,ye=am(ie)|0,jg(ie,ye),C=ye+C|0,!((m[ie>>2]|0)!=1|(m[$>>2]|0)!=0)){N=k,v=V,I=10;break e}if(v=V+(0-(m[R+(C<<2)>>2]|0))|0,(En[S&3](v,m[he>>2]|0)|0)<1){v=V,N=k,k=0,I=9;break}else ye=V,N=k,k=1,V=v,v=ye}else N=1,I=9;while(!1);(I|0)==9&&(k|0)==0&&(I=10),(I|0)==10&&(Ig(w,he,N),px(v,w,S,C,R)),pe=fe}function ff(v,w){v=v|0,w=w|0;var S=0,N=0,C=0;C=v+4|0,w>>>0>31?(N=m[v>>2]|0,m[C>>2]=N,m[v>>2]=0,w=w+-32|0,S=0):(S=m[v>>2]|0,N=m[C>>2]|0),m[C>>2]=S>>>(32-w|0)|N<<w,m[v>>2]=S<<w}function am(v){v=v|0;var w=0;return w=md((m[v>>2]|0)+-1|0)|0,w?w|0:(w=md(m[v+4>>2]|0)|0,((w|0)==0?0:w+32|0)|0)}function md(v){v=v|0;var w=0;if(v)if(v&1)v=0;else for(w=v,v=0;v=v+1|0,!(w&2);)w=w>>>1;else v=32;return v|0}function Ig(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0,I=0;R=pe,pe=pe+256|0,N=R;e:do if((S|0)>=2&&(k=w+(S<<2)|0,m[k>>2]=N,v|0))for(;;){C=v>>>0<256?v:256,Wt(N|0,m[w>>2]|0,C|0)|0,N=0;do I=w+(N<<2)|0,N=N+1|0,Wt(m[I>>2]|0,m[w+(N<<2)>>2]|0,C|0)|0,m[I>>2]=(m[I>>2]|0)+C;while((N|0)!=(S|0));if(v=v-C|0,!v)break e;N=m[k>>2]|0}while(!1);pe=R}function Ql(v){return v=+v,~~+Yn(+v)|0}function hs(v){v=v|0;var w=0,S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0,je=0,We=0,De=0,Me=0,ot=0,Ke=0,Ot=0;Ot=pe,pe=pe+16|0,he=Ot;do if(v>>>0<245){if($=v>>>0<11?16:v+11&-8,v=$>>>3,ie=m[6921]|0,S=ie>>>v,S&3|0)return w=(S&1^1)+v|0,v=27724+(w<<1<<2)|0,S=v+8|0,N=m[S>>2]|0,C=N+8|0,k=m[C>>2]|0,(k|0)==(v|0)?m[6921]=ie&~(1<<w):(m[k+12>>2]=v,m[S>>2]=k),Ke=w<<3,m[N+4>>2]=Ke|3,Ke=N+Ke+4|0,m[Ke>>2]=m[Ke>>2]|1,Ke=C,pe=Ot,Ke|0;if(K=m[6923]|0,$>>>0>K>>>0){if(S|0)return w=2<<v,w=S<<v&(w|0-w),w=(w&0-w)+-1|0,I=w>>>12&16,w=w>>>I,S=w>>>5&8,w=w>>>S,k=w>>>2&4,w=w>>>k,v=w>>>1&2,w=w>>>v,N=w>>>1&1,N=(S|I|k|v|N)+(w>>>N)|0,w=27724+(N<<1<<2)|0,v=w+8|0,k=m[v>>2]|0,I=k+8|0,S=m[I>>2]|0,(S|0)==(w|0)?(v=ie&~(1<<N),m[6921]=v):(m[S+12>>2]=w,m[v>>2]=S,v=ie),Ke=N<<3,R=Ke-$|0,m[k+4>>2]=$|3,C=k+$|0,m[C+4>>2]=R|1,m[k+Ke>>2]=R,K|0&&(N=m[6926]|0,w=K>>>3,S=27724+(w<<1<<2)|0,w=1<<w,v&w?(v=S+8|0,w=m[v>>2]|0):(m[6921]=v|w,w=S,v=S+8|0),m[v>>2]=N,m[w+12>>2]=N,m[N+8>>2]=w,m[N+12>>2]=S),m[6923]=R,m[6926]=C,Ke=I,pe=Ot,Ke|0;if(k=m[6922]|0,k){for(S=(k&0-k)+-1|0,C=S>>>12&16,S=S>>>C,N=S>>>5&8,S=S>>>N,R=S>>>2&4,S=S>>>R,I=S>>>1&2,S=S>>>I,V=S>>>1&1,V=m[27988+((N|C|R|I|V)+(S>>>V)<<2)>>2]|0,S=V,I=V,V=(m[V+4>>2]&-8)-$|0;v=m[S+16>>2]|0,!(!v&&(v=m[S+20>>2]|0,!v));)R=(m[v+4>>2]&-8)-$|0,C=R>>>0<V>>>0,S=v,I=C?v:I,V=C?R:V;if(R=I+$|0,R>>>0>I>>>0){C=m[I+24>>2]|0,w=m[I+12>>2]|0;do if((w|0)==(I|0)){if(v=I+20|0,w=m[v>>2]|0,!w&&(v=I+16|0,w=m[v>>2]|0,!w)){S=0;break}for(;;)if(N=w+20|0,S=m[N>>2]|0,S)w=S,v=N;else if(N=w+16|0,S=m[N>>2]|0,S)w=S,v=N;else break;m[v>>2]=0,S=w}else S=m[I+8>>2]|0,m[S+12>>2]=w,m[w+8>>2]=S,S=w;while(!1);do if(C|0){if(w=m[I+28>>2]|0,v=27988+(w<<2)|0,(I|0)==(m[v>>2]|0)){if(m[v>>2]=S,!S){m[6922]=k&~(1<<w);break}}else if(Ke=C+16|0,m[((m[Ke>>
42812]|0)==(I|0)?Ke:C+20|0)>>2]=S,!S)break;m[S+24>>2]=C,w=m[I+16>>2]|0,w|0&&(m[S+16>>2]=w,m[w+24>>2]=S),w=m[I+20>>2]|0,w|0&&(m[S+20>>2]=w,m[w+24>>2]=S)}while(!1);return V>>>0<16?(Ke=V+$|0,m[I+4>>2]=Ke|3,Ke=I+Ke+4|0,m[Ke>>2]=m[Ke>>2]|1):(m[I+4>>2]=$|3,m[R+4>>2]=V|1,m[R+V>>2]=V,K|0&&(N=m[6926]|0,w=K>>>3,S=27724+(w<<1<<2)|0,w=1<<w,w&ie?(v=S+8|0,w=m[v>>2]|0):(m[6921]=w|ie,w=S,v=S+8|0),m[v>>2]=N,m[w+12>>2]=N,m[N+8>>2]=w,m[N+12>>2]=S),m[6923]=V,m[6926]=R),Ke=I+8|0,pe=Ot,Ke|0}else ie=$}else ie=$}else ie=$}else if(v>>>0<=4294967231)if(v=v+11|0,$=v&-8,N=m[6922]|0,N){C=0-$|0,v=v>>>8,v?$>>>0>16777215?V=31:(ie=(v+1048320|0)>>>16&8,je=v<<ie,I=(je+520192|0)>>>16&4,je=je<<I,V=(je+245760|0)>>>16&2,V=14-(I|ie|V)+(je<<V>>>15)|0,V=$>>>(V+7|0)&1|V<<1):V=0,S=m[27988+(V<<2)>>2]|0;e:do if(!S)S=0,v=0,je=61;else for(v=0,I=$<<((V|0)==31?0:25-(V>>>1)|0),k=0;;){if(R=(m[S+4>>2]&-8)-$|0,R>>>0<C>>>0)if(R)v=S,C=R;else{v=S,C=0,je=65;break e}if(je=m[S+20>>2]|0,S=m[S+16+(I>>>31<<2)>>2]|0,k=(je|0)==0|(je|0)==(S|0)?k:je,S)I=I<<1;else{S=k,je=61;break}}while(!1);if((je|0)==61){if((S|0)==0&(v|0)==0){if(v=2<<V,v=(v|0-v)&N,!v){ie=$;break}ie=(v&0-v)+-1|0,R=ie>>>12&16,ie=ie>>>R,k=ie>>>5&8,ie=ie>>>k,I=ie>>>2&4,ie=ie>>>I,V=ie>>>1&2,ie=ie>>>V,S=ie>>>1&1,v=0,S=m[27988+((k|R|I|V|S)+(ie>>>S)<<2)>>2]|0}S?je=65:(I=v,R=C)}if((je|0)==65)for(k=S;;)if(ie=(m[k+4>>2]&-8)-$|0,S=ie>>>0<C>>>0,C=S?ie:C,v=S?k:v,S=m[k+16>>2]|0,S||(S=m[k+20>>2]|0),S)k=S;else{I=v,R=C;break}if((I|0)!=0&&R>>>0<((m[6923]|0)-$|0)>>>0&&(K=I+$|0,K>>>0>I>>>0)){k=m[I+24>>2]|0,w=m[I+12>>2]|0;do if((w|0)==(I|0)){if(v=I+20|0,w=m[v>>2]|0,!w&&(v=I+16|0,w=m[v>>2]|0,!w)){w=0;break}for(;;)if(C=w+20|0,S=m[C>>2]|0,S)w=S,v=C;else if(C=w+16|0,S=m[C>>2]|0,S)w=S,v=C;else break;m[v>>2]=0}else Ke=m[I+8>>2]|0,m[Ke+12>>2]=w,m[w+8>>2]=Ke;while(!1);do if(k){if(v=m[I+28>>2]|0,S=27988+(v<<2)|0,(I|0)==(m[S>>2]|0)){if(m[S>>2]=w,!w){N=N&~(1<<v),m[6922]=N;break}}else if(Ke=k+16|0,m[((m[Ke>>2]|0)==(I|0)?Ke:k+20|0)>>2]=w,!w)break;m[w+24>>2]=k,v=m[I+16>>2]|0,v|0&&(m[w+16>>2]=v,m[v+24>>2]=w),v=m[I+20>>2]|0,v&&(m[w+20>>2]=v,m[v+24>>2]=w)}while(!1);e:do if(R>>>0<16)Ke=R+$|0,m[I+4>>2]=Ke|3,Ke=I+Ke+4|0,m[Ke>>2]=m[Ke>>2]|1;else{if(m[I+4>>2]=$|3,m[K+4>>2]=R|1,m[K+R>>2]=R,w=R>>>3,R>>>0<256){S=27724+(w<<1<<2)|0,v=m[6921]|0,w=1<<w,v&w?(v=S+8|0,w=m[v>>2]|0):(m[6921]=v|w,w=S,v=S+8|0),m[v>>2]=K,m[w+12>>2]=K,m[K+8>>2]=w,m[K+12>>2]=S;break}if(w=R>>>8,w?R>>>0>16777215?S=31:(ot=(w+1048320|0)>>>16&8,Ke=w<<ot,Me=(Ke+520192|0)>>>16&4,Ke=Ke<<Me,S=(Ke+245760|0)>>>16&2,S=14-(Me|ot|S)+(Ke<<S>>>15)|0,S=R>>>(S+7|0)&1|S<<1):S=0,w=27988+(S<<2)|0,m[K+28>>2]=S,v=K+16|0,m[v+4>>2]=0,m[v>>2]=0,v=1<<S,!(N&v)){m[6922]=N|v,m[w>>2]=K,m[K+24>>2]=w,m[K+12>>2]=K,m[K+8>>2]=K;break}w=m[w>>2]|0;t:do if((m[w+4>>2]&-8|0)!=(R|0)){for(N=R<<((S|0)==31?0:25-(S>>>1)|0);S=w+16+(N>>>31<<2)|0,v=m[S>>2]|0,!!v;)if((m[v+4>>2]&-8|0)==(R|0)){w=v;break t}else N=N<<1,w=v;m[S>>2]=K,m[K+24>>2]=w,m[K+12>>2]=K,m[K+8>>2]=K;break e}while(!1);ot=w+8|0,Ke=m[ot>>2]|0,m[Ke+12>>2]=K,m[ot>>2]=K,m[K+8>>2]=Ke,m[K+12>>2]=w,m[K+24>>2]=0}while(!1);return Ke=I+8|0,pe=Ot,Ke|0}else ie=$}else ie=$;else ie=-1;while(!1);if(S=m[6923]|0,S>>>0>=ie>>>0)return w=S-ie|0,v=m[6926]|0,w>>>0>15?(Ke=v+ie|0,m[6926]=Ke,m[6923]=w,m[Ke+4>>2]=w|1,m[v+S>>2]=w,m[v+4>>2]=ie|3):(m[6923]=0,m[6926]=0,m[v+4>>2]=S|3,Ke=v+S+4|0,m[Ke>>2]=m[Ke>>2]|1),Ke=v+8|0,pe=Ot,Ke|0;if(R=m[6924]|0,R>>>0>ie>>>0)return Me=R-ie|0,m[6924]=Me,Ke=m[6927]|0,ot=Ke+ie|0,m[6927]=ot,m[ot+4>>2]=Me|1,m[Ke+4>>2]=ie|3,Ke=Ke+8|0,pe=Ot,Ke|0;if(m[7039]|0?v=m[7041]|0:(m[7041]=4096,m[7040]=4096,m[7042]=-1,m[7043]=-1,m[7044]=0,m[7032]=0,m[7039]=he&-16^1431655768,v=4096),I=ie+48|0,V=ie+47|0,k=v+V|0,C=0-v|0,$=k&C,$>>>0<=ie>>>0||(v=m[7031]|0,v|0&&(K=m[7029]|0,he=K+$|0,he>>>0<=K>>>0|he>>>0>v>>>0)))return Ke=0,pe=Ot,Ke|0;e:do if(m[7032]&4)w=0,je=143;else{S=m[6927]|0;t:do if(S){for(N=28132;he=m[N>>2]|0,!(he>>>0<=S>>>0&&(he+(m[N+4>>2]|0)|0)>>>0>S>>>0);)if(v=m[N+8>>2]|0,v)N=v;else{je=128;break t}if(w=k-R&C,w>>>0<2147483647)if(v=xn(w|0)|0,(v|0)==((m[N>>2]|0)+(m[N+4>>2]|0)|0)){if((v|0)!=-1){R=w,k=v,je=145;break e}}else N=v,je=136;else w=0}else je=128;while(!1);do if((je|0)==128)if(S=xn(0)|0,(S|0)!=-1&&(w=S,fe=m[7040]|0,ye=fe+-1|0,w=((ye&w|0)==0?0:(ye+w&0-fe)-w|0)+$|0,fe=m[7029]|0,ye=w+fe|0,w>>>0>ie>>>0&w>>>0<2147483647)){if(he=m[7031]|0,he|0&&ye>>>0<=fe>>>0|ye>>>0>he>>>0){w=0;break}if(v=xn(w|0)|0,(v|0)==(S|0)){R=w,k=S,je=145;break e}else N=v,je=136}else w=0;while(!1);do if((je|0)==136){if(S=0-w|0,!(I>>>0>w>>>0&(w>>>0<2147483647&(N|0)!=-1)))if((N|0)==-1){w=0;break}else{R=w,k=N,je=145;break e}if(v=m[7041]|0,v=V-w+v&0-v,v>>>0>=2147483647){R=w,k=N,je=145;break e}if((xn(v|0)|0)==-1){xn(S|0)|0,w=0;break}else{R=v+w|0,k=N,je=145;break e}}while(!1);m[7032]=m[7032]|4,je=143}while(!1);if((je|0)==143&&$>>>0<2147483647&&(Me=xn($|0)|0,ye=xn(0)|0,We=ye-Me|0,De=We>>>0>(ie+40|0)>>>0,!((Me|0)==-1|De^1|Me>>>0<ye>>>0&((Me|0)!=-1&(ye|0)!=-1)^1))&&(R=De?We:w,k=Me,je=145),(je|0)==145){w=(m[7029]|0)+R|0,m[7029]=w,w>>>0>(m[7030]|0)>>>0&&(m[7030]=w),V=m[6927]|0;e:do if(V){for(w=28132;;){if(v=m[w>>
42812]|0,S=m[w+4>>2]|0,(k|0)==(v+S|0)){je=154;break}if(N=m[w+8>>2]|0,N)w=N;else break}if((je|0)==154&&(ot=w+4|0,(m[w+12>>2]&8|0)==0)&&k>>>0>V>>>0&v>>>0<=V>>>0){m[ot>>2]=S+R,Ke=(m[6924]|0)+R|0,Me=V+8|0,Me=(Me&7|0)==0?0:0-Me&7,ot=V+Me|0,Me=Ke-Me|0,m[6927]=ot,m[6924]=Me,m[ot+4>>2]=Me|1,m[V+Ke+4>>2]=40,m[6928]=m[7043];break}for(k>>>0<(m[6925]|0)>>>0&&(m[6925]=k),S=k+R|0,w=28132;;){if((m[w>>2]|0)==(S|0)){je=162;break}if(v=m[w+8>>2]|0,v)w=v;else break}if((je|0)==162&&(m[w+12>>2]&8|0)==0){m[w>>2]=k,K=w+4|0,m[K>>2]=(m[K>>2]|0)+R,K=k+8|0,K=k+((K&7|0)==0?0:0-K&7)|0,w=S+8|0,w=S+((w&7|0)==0?0:0-w&7)|0,$=K+ie|0,I=w-K-ie|0,m[K+4>>2]=ie|3;t:do if((V|0)==(w|0))Ke=(m[6924]|0)+I|0,m[6924]=Ke,m[6927]=$,m[$+4>>2]=Ke|1;else{if((m[6926]|0)==(w|0)){Ke=(m[6923]|0)+I|0,m[6923]=Ke,m[6926]=$,m[$+4>>2]=Ke|1,m[$+Ke>>2]=Ke;break}if(v=m[w+4>>2]|0,(v&3|0)==1){R=v&-8,N=v>>>3;n:do if(v>>>0<256)if(v=m[w+8>>2]|0,S=m[w+12>>2]|0,(S|0)==(v|0)){m[6921]=m[6921]&~(1<<N);break}else{m[v+12>>2]=S,m[S+8>>2]=v;break}else{k=m[w+24>>2]|0,v=m[w+12>>2]|0;do if((v|0)==(w|0)){if(S=w+16|0,N=S+4|0,v=m[N>>2]|0,v)S=N;else if(v=m[S>>2]|0,!v){v=0;break}for(;;)if(C=v+20|0,N=m[C>>2]|0,N)v=N,S=C;else if(C=v+16|0,N=m[C>>2]|0,N)v=N,S=C;else break;m[S>>2]=0}else Ke=m[w+8>>2]|0,m[Ke+12>>2]=v,m[v+8>>2]=Ke;while(!1);if(!k)break;S=m[w+28>>2]|0,N=27988+(S<<2)|0;do if((m[N>>2]|0)!=(w|0)){if(Ke=k+16|0,m[((m[Ke>>2]|0)==(w|0)?Ke:k+20|0)>>2]=v,!v)break n}else{if(m[N>>2]=v,v|0)break;m[6922]=m[6922]&~(1<<S);break n}while(!1);if(m[v+24>>2]=k,S=w+16|0,N=m[S>>2]|0,N|0&&(m[v+16>>2]=N,m[N+24>>2]=v),S=m[S+4>>2]|0,!S)break;m[v+20>>2]=S,m[S+24>>2]=v}while(!1);w=w+R|0,C=R+I|0}else C=I;if(w=w+4|0,m[w>>2]=m[w>>2]&-2,m[$+4>>2]=C|1,m[$+C>>2]=C,w=C>>>3,C>>>0<256){S=27724+(w<<1<<2)|0,v=m[6921]|0,w=1<<w,v&w?(v=S+8|0,w=m[v>>2]|0):(m[6921]=v|w,w=S,v=S+8|0),m[v>>2]=$,m[w+12>>2]=$,m[$+8>>2]=w,m[$+12>>2]=S;break}w=C>>>8;do if(!w)N=0;else{if(C>>>0>16777215){N=31;break}ot=(w+1048320|0)>>>16&8,Ke=w<<ot,Me=(Ke+520192|0)>>>16&4,Ke=Ke<<Me,N=(Ke+245760|0)>>>16&2,N=14-(Me|ot|N)+(Ke<<N>>>15)|0,N=C>>>(N+7|0)&1|N<<1}while(!1);if(w=27988+(N<<2)|0,m[$+28>>2]=N,v=$+16|0,m[v+4>>2]=0,m[v>>2]=0,v=m[6922]|0,S=1<<N,!(v&S)){m[6922]=v|S,m[w>>2]=$,m[$+24>>2]=w,m[$+12>>2]=$,m[$+8>>2]=$;break}w=m[w>>2]|0;n:do if((m[w+4>>2]&-8|0)!=(C|0)){for(N=C<<((N|0)==31?0:25-(N>>>1)|0);S=w+16+(N>>>31<<2)|0,v=m[S>>2]|0,!!v;)if((m[v+4>>2]&-8|0)==(C|0)){w=v;break n}else N=N<<1,w=v;m[S>>2]=$,m[$+24>>2]=w,m[$+12>>2]=$,m[$+8>>2]=$;break t}while(!1);ot=w+8|0,Ke=m[ot>>2]|0,m[Ke+12>>2]=$,m[ot>>2]=$,m[$+8>>2]=Ke,m[$+12>>2]=w,m[$+24>>2]=0}while(!1);return Ke=K+8|0,pe=Ot,Ke|0}for(w=28132;v=m[w>>2]|0,!(v>>>0<=V>>>0&&(Ke=v+(m[w+4>>2]|0)|0,Ke>>>0>V>>>0));)w=m[w+8>>2]|0;C=Ke+-47|0,v=C+8|0,v=C+((v&7|0)==0?0:0-v&7)|0,C=V+16|0,v=v>>>0<C>>>0?V:v,w=v+8|0,S=R+-40|0,Me=k+8|0,Me=(Me&7|0)==0?0:0-Me&7,ot=k+Me|0,Me=S-Me|0,m[6927]=ot,m[6924]=Me,m[ot+4>>2]=Me|1,m[k+S+4>>2]=40,m[6928]=m[7043],S=v+4|0,m[S>>2]=27,m[w>>2]=m[7033],m[w+4>>2]=m[7034],m[w+8>>2]=m[7035],m[w+12>>2]=m[7036],m[7033]=k,m[7034]=R,m[7036]=0,m[7035]=w,w=v+24|0;do ot=w,w=w+4|0,m[w>>2]=7;while((ot+8|0)>>>0<Ke>>>0);if((v|0)!=(V|0)){if(k=v-V|0,m[S>>2]=m[S>>2]&-2,m[V+4>>2]=k|1,m[v>>2]=k,w=k>>>3,k>>>0<256){S=27724+(w<<1<<2)|0,v=m[6921]|0,w=1<<w,v&w?(v=S+8|0,w=m[v>>2]|0):(m[6921]=v|w,w=S,v=S+8|0),m[v>>2]=V,m[w+12>>2]=V,m[V+8>>2]=w,m[V+12>>2]=S;break}if(w=k>>>8,w?k>>>0>16777215?N=31:(ot=(w+1048320|0)>>>16&8,Ke=w<<ot,Me=(Ke+520192|0)>>>16&4,Ke=Ke<<Me,N=(Ke+245760|0)>>>16&2,N=14-(Me|ot|N)+(Ke<<N>>>15)|0,N=k>>>(N+7|0)&1|N<<1):N=0,S=27988+(N<<2)|0,m[V+28>>2]=N,m[V+20>>2]=0,m[C>>2]=0,w=m[6922]|0,v=1<<N,!(w&v)){m[6922]=w|v,m[S>>2]=V,m[V+24>>2]=S,m[V+12>>2]=V,m[V+8>>2]=V;break}w=m[S>>2]|0;t:do if((m[w+4>>2]&-8|0)!=(k|0)){for(N=k<<((N|0)==31?0:25-(N>>>1)|0);S=w+16+(N>>>31<<2)|0,v=m[S>>2]|0,!!v;)if((m[v+4>>2]&-8|0)==(k|0)){w=v;break t}else N=N<<1,w=v;m[S>>2]=V,m[V+24>>2]=w,m[V+12>>2]=V,m[V+8>>2]=V;break e}while(!1);ot=w+8|0,Ke=m[ot>>2]|0,m[Ke+12>>2]=V,m[ot>>2]=V,m[V+8>>2]=Ke,m[V+12>>2]=w,m[V+24>>2]=0}}else Ke=m[6925]|0,(Ke|0)==0|k>>>0<Ke>>>0&&(m[6925]=k),m[7033]=k,m[7034]=R,m[7036]=0,m[6930]=m[7039],m[6929]=-1,m[6934]=27724,m[6933]=27724,m[6936]=27732,m[6935]=27
4281732,m[6938]=27740,m[6937]=27740,m[6940]=27748,m[6939]=27748,m[6942]=27756,m[6941]=27756,m[6944]=27764,m[6943]=27764,m[6946]=27772,m[6945]=27772,m[6948]=27780,m[6947]=27780,m[6950]=27788,m[6949]=27788,m[6952]=27796,m[6951]=27796,m[6954]=27804,m[6953]=27804,m[6956]=27812,m[6955]=27812,m[6958]=27820,m[6957]=27820,m[6960]=27828,m[6959]=27828,m[6962]=27836,m[6961]=27836,m[6964]=27844,m[6963]=27844,m[6966]=27852,m[6965]=27852,m[6968]=27860,m[6967]=27860,m[6970]=27868,m[6969]=27868,m[6972]=27876,m[6971]=27876,m[6974]=27884,m[6973]=27884,m[6976]=27892,m[6975]=27892,m[6978]=27900,m[6977]=27900,m[6980]=27908,m[6979]=27908,m[6982]=27916,m[6981]=27916,m[6984]=27924,m[6983]=27924,m[6986]=27932,m[6985]=27932,m[6988]=27940,m[6987]=27940,m[6990]=27948,m[6989]=27948,m[6992]=27956,m[6991]=27956,m[6994]=27964,m[6993]=27964,m[6996]=27972,m[6995]=27972,Ke=R+-40|0,Me=k+8|0,Me=(Me&7|0)==0?0:0-Me&7,ot=k+Me|0,Me=Ke-Me|0,m[6927]=ot,m[6924]=Me,m[ot+4>>2]=Me|1,m[k+Ke+4>>2]=40,m[6928]=m[7043];while(!1);if(w=m[6924]|0,w>>>0>ie>>>0)return Me=w-ie|0,m[6924]=Me,Ke=m[6927]|0,ot=Ke+ie|0,m[6927]=ot,m[ot+4>>2]=Me|1,m[Ke+4>>2]=ie|3,Ke=Ke+8|0,pe=Ot,Ke|0}return Ke=hf()|0,m[Ke>>2]=12,Ke=0,pe=Ot,Ke|0}function Nn(v){v=v|0;var w=0,S=0,N=0,C=0,k=0,R=0,I=0,V=0;if(v){S=v+-8|0,C=m[6925]|0,v=m[v+-4>>2]|0,w=v&-8,V=S+w|0;do if(v&1)I=S,R=S;else{if(N=m[S>>2]|0,!(v&3)||(R=S+(0-N)|0,k=N+w|0,R>>>0<C>>>0))return;if((m[6926]|0)==(R|0)){if(v=V+4|0,w=m[v>>2]|0,(w&3|0)!=3){I=R,w=k;break}m[6923]=k,m[v>>2]=w&-2,m[R+4>>2]=k|1,m[R+k>>2]=k;return}if(S=N>>>3,N>>>0<256)if(v=m[R+8>>2]|0,w=m[R+12>>2]|0,(w|0)==(v|0)){m[6921]=m[6921]&~(1<<S),I=R,w=k;break}else{m[v+12>>2]=w,m[w+8>>2]=v,I=R,w=k;break}C=m[R+24>>2]|0,v=m[R+12>>2]|0;do if((v|0)==(R|0)){if(w=R+16|0,S=w+4|0,v=m[S>>2]|0,v)w=S;else if(v=m[w>>2]|0,!v){v=0;break}for(;;)if(N=v+20|0,S=m[N>>2]|0,S)v=S,w=N;else if(N=v+16|0,S=m[N>>2]|0,S)v=S,w=N;else break;m[w>>2]=0}else I=m[R+8>>2]|0,m[I+12>>2]=v,m[v+8>>2]=I;while(!1);if(C){if(w=m[R+28>>2]|0,S=27988+(w<<2)|0,(m[S>>2]|0)==(R|0)){if(m[S>>2]=v,!v){m[6922]=m[6922]&~(1<<w),I=R,w=k;break}}else if(I=C+16|0,m[((m[I>>2]|0)==(R|0)?I:C+20|0)>>2]=v,!v){I=R,w=k;break}m[v+24>>2]=C,w=R+16|0,S=m[w>>2]|0,S|0&&(m[v+16>>2]=S,m[S+24>>2]=v),w=m[w+4>>2]|0,w?(m[v+20>>2]=w,m[w+24>>2]=v,I=R,w=k):(I=R,w=k)}else I=R,w=k}while(!1);if(!(R>>>0>=V>>>0)&&(v=V+4|0,N=m[v>>2]|0,!!(N&1))){if(N&2)m[v>>2]=N&-2,m[I+4>>2]=w|1,m[R+w>>2]=w,C=w;else{if((m[6927]|0)==(V|0)){if(V=(m[6924]|0)+w|0,m[6924]=V,m[6927]=I,m[I+4>>2]=V|1,(I|0)!=(m[6926]|0))return;m[6926]=0,m[6923]=0;return}if((m[6926]|0)==(V|0)){V=(m[6923]|0)+w|0,m[6923]=V,m[6926]=R,m[I+4>>2]=V|1,m[R+V>>2]=V;return}C=(N&-8)+w|0,S=N>>>3;do if(N>>>0<256)if(w=m[V+8>>2]|0,v=m[V+12>>
vendor: 4,441 bytes, line 4281
42812]|0,(v|0)==(w|0)){m[6921]=m[6921]&~(1<<S);break}else{m[w+12>>2]=v,m[v+8>>2]=w;break}else{k=m[V+24>>2]|0,v=m[V+12>>2]|0;do if((v|0)==(V|0)){if(w=V+16|0,S=w+4|0,v=m[S>>2]|0,v)w=S;else if(v=m[w>>2]|0,!v){S=0;break}for(;;)if(N=v+20|0,S=m[N>>2]|0,S)v=S,w=N;else if(N=v+16|0,S=m[N>>2]|0,S)v=S,w=N;else break;m[w>>2]=0,S=v}else S=m[V+8>>2]|0,m[S+12>>2]=v,m[v+8>>2]=S,S=v;while(!1);if(k|0){if(v=m[V+28>>2]|0,w=27988+(v<<2)|0,(m[w>>2]|0)==(V|0)){if(m[w>>2]=S,!S){m[6922]=m[6922]&~(1<<v);break}}else if(N=k+16|0,m[((m[N>>2]|0)==(V|0)?N:k+20|0)>>2]=S,!S)break;m[S+24>>2]=k,v=V+16|0,w=m[v>>2]|0,w|0&&(m[S+16>>2]=w,m[w+24>>2]=S),v=m[v+4>>2]|0,v|0&&(m[S+20>>2]=v,m[v+24>>2]=S)}}while(!1);if(m[I+4>>2]=C|1,m[R+C>>2]=C,(I|0)==(m[6926]|0)){m[6923]=C;return}}if(v=C>>>3,C>>>0<256){S=27724+(v<<1<<2)|0,w=m[6921]|0,v=1<<v,w&v?(w=S+8|0,v=m[w>>2]|0):(m[6921]=w|v,v=S,w=S+8|0),m[w>>2]=I,m[v+12>>2]=I,m[I+8>>2]=v,m[I+12>>2]=S;return}v=C>>>8,v?C>>>0>16777215?N=31:(R=(v+1048320|0)>>>16&8,V=v<<R,k=(V+520192|0)>>>16&4,V=V<<k,N=(V+245760|0)>>>16&2,N=14-(k|R|N)+(V<<N>>>15)|0,N=C>>>(N+7|0)&1|N<<1):N=0,v=27988+(N<<2)|0,m[I+28>>2]=N,m[I+20>>2]=0,m[I+16>>2]=0,w=m[6922]|0,S=1<<N;e:do if(!(w&S))m[6922]=w|S,m[v>>2]=I,m[I+24>>2]=v,m[I+12>>2]=I,m[I+8>>2]=I;else{v=m[v>>2]|0;t:do if((m[v+4>>2]&-8|0)!=(C|0)){for(N=C<<((N|0)==31?0:25-(N>>>1)|0);S=v+16+(N>>>31<<2)|0,w=m[S>>2]|0,!!w;)if((m[w+4>>2]&-8|0)==(C|0)){v=w;break t}else N=N<<1,v=w;m[S>>2]=I,m[I+24>>2]=v,m[I+12>>2]=I,m[I+8>>2]=I;break e}while(!1);R=v+8|0,V=m[R>>2]|0,m[V+12>>2]=I,m[R>>2]=I,m[I+8>>2]=V,m[I+12>>2]=v,m[I+24>>2]=0}while(!1);if(V=(m[6929]|0)+-1|0,m[6929]=V,!(V|0)){for(v=28140;v=m[v>>2]|0,v;)v=v+8|0;m[6929]=-1}}}}function xo(v,w){v=v|0,w=w|0;var S=0;return v?(S=si(w,v)|0,(w|v)>>>0>65535&&(S=((S>>>0)/(v>>>0)|0|0)==(w|0)?S:-1)):S=0,v=hs(S)|0,!v||!(m[v+-4>>2]&3)||qn(v|0,0,S|0)|0,v|0}function $_(v,w){v=v|0,w=w|0;var S=0,N=0;return v?w>>>0>4294967231?(w=hf()|0,m[w>>2]=12,w=0,w|0):(S=H_(v+-8|0,w>>>0<11?16:w+11&-8)|0,S|0?(w=S+8|0,w|0):(S=hs(w)|0,S?(N=m[v+-4>>2]|0,N=(N&-8)-((N&3|0)==0?8:4)|0,Wt(S|0,v|0,(N>>>0<w>>>0?N:w)|0)|0,Nn(v),w=S,w|0):(w=0,w|0))):(w=hs(w)|0,w|0)}function H_(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0,V=0,$=0,K=0,ie=0;if(K=v+4|0,ie=m[K>>2]|0,S=ie&-8,I=v+S|0,!(ie&3))return w>>>0<256?(v=0,v|0):(S>>>0>=(w+4|0)>>>0&&(S-w|0)>>>0<=m[7041]<<1>>>0||(v=0),v|0);if(S>>>0>=w>>>0)return S=S-w|0,S>>>0<=15||($=v+w|0,m[K>>2]=ie&1|w|2,m[$+4>>2]=S|3,ie=I+4|0,m[ie>>2]=m[ie>>2]|1,pf($,S)),v|0;if((m[6927]|0)==(I|0))return $=(m[6924]|0)+S|0,S=$-w|0,N=v+w|0,$>>>0<=w>>>0?(v=0,v|0):(m[K>>2]=ie&1|w|2,m[N+4>>2]=S|1,m[6927]=N,m[6924]=S,v|0);if((m[6926]|0)==(I|0))return N=(m[6923]|0)+S|0,N>>>0<w>>>0?(v=0,v|0):(S=N-w|0,S>>>0>15?($=v+w|0,N=v+N|0,m[K>>2]=ie&1|w|2,m[$+4>>2]=S|1,m[N>>2]=S,N=N+4|0,m[N>>2]=m[N>>2]&-2,N=$):(m[K>>2]=ie&1|N|2,N=v+N+4|0,m[N>>2]=m[N>>2]|1,N=0,S=0),m[6923]=S,m[6926]=N,v|0);if(N=m[I+4>>2]|0,N&2|0||(V=(N&-8)+S|0,V>>>0<w>>>0))return v=0,v|0;$=V-w|0,C=N>>>3;do if(N>>>0<256)if(N=m[I+8>>2]|0,S=m[I+12>>2]|0,(S|0)==(N|0)){m[6921]=m[6921]&~(1<<C);break}else{m[N+12>>2]=S,m[S+8>>2]=N;break}else{R=m[I+24>>2]|0,S=m[I+12>>2]|0;do if((S|0)==(I|0)){if(N=I+16|0,C=N+4|0,S=m[C>>2]|0,S)N=C;else if(S=m[N>>2]|0,!S){C=0;break}for(;;)if(k=S+20|0,C=m[k>>2]|0,C)S=C,N=k;else if(k=S+16|0,C=m[k>>2]|0,C)S=C,N=k;else break;m[N>>2]=0,C=S}else C=m[I+8>>2]|0,m[C+12>>2]=S,m[S+8>>2]=C,C=S;while(!1);if(R|0){if(S=m[I+28>>2]|0,N=27988+(S<<2)|0,(m[N>>2]|0)==(I|0)){if(m[N>>2]=C,!C){m[6922]=m[6922]&~(1<<S);break}}else if(k=R+16|0,m[((m[k>>2]|0)==(I|0)?k:R+20|0)>>2]=C,!C)break;m[C+24>>2]=R,S=I+16|0,N=m[S>>2]|0,N|0&&(m[C+16>>2]=N,m[N+24>>2]=C),S=m[S+4>>2]|0,S|0&&(m[C+20>>2]=S,m[S+24>>2]=C)}}while(!1);return $>>>0<16?(m[K>>2]=ie&1|V|2,ie=v+V+4|0,m[ie>>2]=m[ie>>2]|1,v|0):(I=v+w|0,m[K>>2]=ie&1|w|2,m[I+4>>2]=$|3,ie=v+V+4|0,m[ie>>2]=m[ie>>2]|1,pf(I,$),v|0)}function pf(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0,R=0,I=0;I=v+w|0,S=m[v+4>>2]|0;do if(S&1)R=v;else{if(C=m[v>>2]|0,!(S&3))return;if(R=v+(0-C)|0,w=C+w|0,(m[6926]|0)==(R|0)){if(v=I+4|0,S=m[v>>2]|0,(S&3|0)!=3)break;m[6923]=w,m[v>>2]=S&-2,m[R+4>>2]=w|1,m[I>>2]=w;return}if(N=C>>>3,C>>>0<256)if(v=m[R+8>>2]|0,S=m[R+12>>2]|0,(S|0)==(v|0)){m[6921]=m[6921]&~(1<<N);break}else{m[v+12>>2]=S,m[S+8>>2]=v;break}k=m[R+24>>2]|0,v=m[R+12>>2]|0;do if((v|0)==(R|0)){if(S=R+16|0,N=S+4|0,v=m[N>>2]|0,v)S=N;else if(v=m[S>>2]|0,!v){v=0;break}for(;;)if(C=v+20|0,N=m[C>>2]|0,N)v=N,S=C;else if(C=v+16|0,N=m[C>>2]|0,N)v=N,S=C;else break;m[S>>2]=0}else C=m[R+8>>2]|0,m[C+12>>
42812]=v,m[v+8>>2]=C;while(!1);if(k){if(S=m[R+28>>2]|0,N=27988+(S<<2)|0,(m[N>>2]|0)==(R|0)){if(m[N>>2]=v,!v){m[6922]=m[6922]&~(1<<S);break}}else if(C=k+16|0,m[((m[C>>2]|0)==(R|0)?C:k+20|0)>>2]=v,!v)break;m[v+24>>2]=k,S=R+16|0,N=m[S>>2]|0,N|0&&(m[v+16>>2]=N,m[N+24>>2]=v),S=m[S+4>>2]|0,S&&(m[v+20>>2]=S,m[S+24>>2]=v)}}while(!1);if(v=I+4|0,N=m[v>>2]|0,N&2)m[v>>2]=N&-2,m[R+4>>2]=w|1,m[R+w>>2]=w,C=w;else{if((m[6927]|0)==(I|0)){if(I=(m[6924]|0)+w|0,m[6924]=I,m[6927]=R,m[R+4>>2]=I|1,(R|0)!=(m[6926]|0))return;m[6926]=0,m[6923]=0;return}if((m[6926]|0)==(I|0)){I=(m[6923]|0)+w|0,m[6923]=I,m[6926]=R,m[R+4>>2]=I|1,m[R+I>>2]=I;return}C=(N&-8)+w|0,S=N>>>3;do if(N>>>0<256)if(v=m[I+8>>2]|0,w=m[I+12>>2]|0,(w|0)==(v|0)){m[6921]=m[6921]&~(1<<S);break}else{m[v+12>>2]=w,m[w+8>>2]=v;break}else{k=m[I+24>>2]|0,w=m[I+12>>2]|0;do if((w|0)==(I|0)){if(v=I+16|0,S=v+4|0,w=m[S>>2]|0,w)v=S;else if(w=m[v>>2]|0,!w){S=0;break}for(;;)if(N=w+20|0,S=m[N>>2]|0,S)w=S,v=N;else if(N=w+16|0,S=m[N>>2]|0,S)w=S,v=N;else break;m[v>>2]=0,S=w}else S=m[I+8>>2]|0,m[S+12>>2]=w,m[w+8>>2]=S,S=w;while(!1);if(k|0){if(w=m[I+28>>2]|0,v=27988+(w<<2)|0,(m[v>>2]|0)==(I|0)){if(m[v>>2]=S,!S){m[6922]=m[6922]&~(1<<w);break}}else if(N=k+16|0,m[((m[N>>2]|0)==(I|0)?N:k+20|0)>>2]=S,!S)break;m[S+24>>2]=k,w=I+16|0,v=m[w>>2]|0,v|0&&(m[S+16>>2]=v,m[v+24>>2]=S),w=m[w+4>>2]|0,w|0&&(m[S+20>>2]=w,m[w+24>>2]=S)}}while(!1);if(m[R+4>>2]=C|1,m[R+C>>2]=C,(R|0)==(m[6926]|0)){m[6923]=C;return}}if(w=C>>>3,C>>>0<256){S=27724+(w<<1<<2)|0,v=m[6921]|0,w=1<<w,v&w?(v=S+8|0,w=m[v>>2]|0):(m[6921]=v|w,w=S,v=S+8|0),m[v>>2]=R,m[w+12>>2]=R,m[R+8>>2]=w,m[R+12>>2]=S;return}if(w=C>>>8,w?C>>>0>16777215?N=31:(k=(w+1048320|0)>>>16&8,I=w<<k,S=(I+520192|0)>>>16&4,I=I<<S,N=(I+245760|0)>>>16&2,N=14-(S|k|N)+(I<<N>>>15)|0,N=C>>>(N+7|0)&1|N<<1):N=0,w=27988+(N<<2)|0,m[R+28>>2]=N,m[R+20>>2]=0,m[R+16>>2]=0,v=m[6922]|0,S=1<<N,!(v&S)){m[6922]=v|S,m[w>>2]=R,m[R+24>>2]=w,m[R+12>>2]=R,m[R+8>>2]=R;return}w=m[w>>2]|0;e:do if((m[w+4>>2]&-8|0)!=(C|0)){for(N=C<<((N|0)==31?0:25-(N>>>1)|0);S=w+16+(N>>>31<<2)|0,v=m[S>>2]|0,!!v;)if((m[v+4>>2]&-8|0)==(C|0)){w=v;break e}else N=N<<1,w=v;m[S>>2]=R,m[R+24>>2]=w,m[R+12>>2]=R,m[R+8>>2]=R;return}while(!1);k=w+8|0,I=m[k>>2]|0,m[I+12>>2]=R,m[k>>2]=R,m[R+8>>2]=I,m[R+12>>2]=w,m[R+24>>2]=0}function An(v,w,S,N){return v=v|0,w=w|0,S=S|0,N=N|0,S=v+S>>>0,He(w+N+(S>>>0<v>>>0|0)>>>0|0),S|0|0}function va(v,w,S,N){return v=v|0,w=w|0,S=S|0,N=N|0,N=w-N-(S>>>0>v>>>0|0)>>>0,He(N|0),v-S>>>0|0|0}function mh(v){return v=v|0,(v?31-(Vi(v^v-1)|0)|0:32)|0}function Jo(v,w,S,N,C){v=v|0,w=w|0,S=S|0,N=N|0,C=C|0;var k=0,R=0,I=0,V=0,$=0,K=0,ie=0,he=0,fe=0,ye=0;if(K=v,V=w,$=V,R=S,he=N,I=he,!$)return k=(C|0)!=0,I?k?(m[C>>2]=v|0,m[C+4>>2]=w&0,he=0,C=0,He(he|0),C|0):(he=0,C=0,He(he|0),C|0):(k&&(m[C>>2]=(K>>>0)%(R>>>0),m[C+4>>2]=0),he=0,C=(K>>>0)/(R>>>0)>>>0,He(he|0),C|0);k=(I|0)==0;do if(R){if(!k){if(k=(Vi(I|0)|0)-(Vi($|0)|0)|0,k>>>0<=31){ie=k+1|0,I=31-k|0,w=k-31>>31,R=ie,v=K>>>(ie>>>0)&w|$<<I,w=$>>>(ie>>>0)&w,k=0,I=K<<I;break}return C?(m[C>>2]=v|0,m[C+4>>2]=V|w&0,he=0,C=0,He(he|0),C|0):(he=0,C=0,He(he|0),C|0)}if(k=R-1|0,k&R|0){I=(Vi(R|0)|0)+33-(Vi($|0)|0)|0,ye=64-I|0,ie=32-I|0,V=ie>>31,fe=I-32|0,w=fe>>31,R=I,v=ie-1>>31&$>>>(fe>>>0)|($<<ie|K>>>(I>>>0))&w,w=w&$>>>(I>>>0),k=K<<ye&V,I=($<<ye|K>>>(fe>>>0))&V|K<<ie&I-33>>31;break}return C|0&&(m[C>>2]=k&K,m[C+4>>2]=0),(R|0)==1?(fe=V|w&0,ye=v|0|0,He(fe|0),ye|0):(ye=mh(R|0)|0,fe=$>>>(ye>>>0)|0,ye=$<<32-ye|K>>>(ye>>>0)|0,He(fe|0),ye|0)}else{if(k)return C|0&&(m[C>>2]=($>>>0)%(R>>>0),m[C+4>>2]=0),fe=0,ye=($>>>0)/(R>>>0)>>>0,He(fe|0),ye|0;if(!K)return C|0&&(m[C>>2]=0,m[C+4>>2]=($>>>0)%(I>>>0)),fe=0,ye=($>>>0)/(I>>>0)>>>0,He(fe|0),ye|0;if(k=I-1|0,!(k&I))return C|0&&(m[C>>2]=v|0,m[C+4>>2]=k&$|w&0),fe=0,ye=$>>>((mh(I|0)|0)>>>0),He(fe|0),ye|0;if(k=(Vi(I|0)|0)-(Vi($|0)|0)|0,k>>>0<=30){w=k+1|0,I=31-k|0,R=w,v=$<<I|K>>>(w>>>0),w=$>>>(w>>>0),k=0,I=K<<I;break}return C?(m[C>>2]=v|0,m[C+4>>2]=V|w&0,fe=0,ye=0,He(fe|0),ye|0):(fe=0,ye=0,He(fe|0),ye|0)}while(!1);if(!R)$=I,V=0,I=0;else{ie=S|0|0,K=he|N&0,$=An(ie|0,K|0,-1,-1)|0,S=ce()|0,V=I,I=0;do N=V,V=k>>>31|V<<1,k=I|k<<1,N=v<<1|N>>>31|0,he=v>>>31|w<<1|0,va($|0,S|0,N|0,he|0)|0,ye=ce()|0,fe=ye>>31|((ye|0)<0?-1:0)<<1,I=fe&1,v=va(N|0,he|0,fe&ie|0,(((ye|0)<0?-1:0)>>31|((ye|0)<0?-1:0)<<1)&K|0)|0,w=ce()|0,R=R-1|0;while((R|0)!=0);$=V,V=0}return R=0,C|0&&(m[C>>2]=v,m[C+4>>2]=w),fe=(k|0)>>>31|($|R)<<1|(R<<1|k>>>31)&0|V,ye=(k<<1|0)&-2|I,He(fe|0),ye|0}function Kl(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;
4281var C=0,k=0,R=0,I=0,V=0,$=0;return $=w>>31|((w|0)<0?-1:0)<<1,V=((w|0)<0?-1:0)>>31|((w|0)<0?-1:0)<<1,k=N>>31|((N|0)<0?-1:0)<<1,C=((N|0)<0?-1:0)>>31|((N|0)<0?-1:0)<<1,I=va($^v|0,V^w|0,$|0,V|0)|0,R=ce()|0,v=k^$,w=C^V,va((Jo(I,R,va(k^S|0,C^N|0,k|0,C|0)|0,ce()|0,0)|0)^v|0,(ce()|0)^w|0,v|0,w|0)|0}function _u(v,w){v=v|0,w=w|0;var S=0,N=0,C=0,k=0;return k=v&65535,C=w&65535,S=si(C,k)|0,N=v>>>16,v=(S>>>16)+(si(C,N)|0)|0,C=w>>>16,w=si(C,k)|0,He((v>>>16)+(si(C,N)|0)+(((v&65535)+w|0)>>>16)|0),v+w<<16|S&65535|0|0}function as(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0;return C=v,k=S,S=_u(C,k)|0,v=ce()|0,He((si(w,k)|0)+(si(N,C)|0)+v|v&0|0),S|0|0|0}function gd(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0,R=0,I=0,V=0,$=0;return C=pe,pe=pe+16|0,I=C|0,R=w>>31|((w|0)<0?-1:0)<<1,k=((w|0)<0?-1:0)>>31|((w|0)<0?-1:0)<<1,$=N>>31|((N|0)<0?-1:0)<<1,V=((N|0)<0?-1:0)>>31|((N|0)<0?-1:0)<<1,v=va(R^v|0,k^w|0,R|0,k|0)|0,w=ce()|0,Jo(v,w,va($^S|0,V^N|0,$|0,V|0)|0,ce()|0,I)|0,N=va(m[I>>2]^R|0,m[I+4>>2]^k|0,R|0,k|0)|0,S=ce()|0,pe=C,He(S|0),N|0}function Su(v,w,S,N){v=v|0,w=w|0,S=S|0,N=N|0;var C=0,k=0;return k=pe,pe=pe+16|0,C=k|0,Jo(v,w,S,N,C)|0,pe=k,He(m[C+4>>2]|0),m[C>>2]|0|0}function Ad(v,w,S){return v=v|0,w=w|0,S=S|0,(S|0)<32?(He(w>>S|0),v>>>S|(w&(1<<S)-1)<<32-S):(He(((w|0)<0?-1:0)|0),w>>S-32|0)}function de(v,w,S){return v=v|0,w=w|0,S=S|0,(S|0)<32?(He(w>>>S|0),v>>>S|(w&(1<<S)-1)<<32-S):(He(0),w>>>S-32|0)}function me(v,w,S){return v=v|0,w=w|0,S=S|0,(S|0)<32?(He(w<<S|(v&(1<<S)-1<<32-S)>>>32-S|0),v<<S):(He(v<<S-32|0),0)}function Be(v,w,S){return v=v|0,w=w|0,w=Vi(w)|0,(w|0)==32&&(w=w+(Vi(v)|0)|0),He(0),w|0}function xt(v,w){return v=+v,w=+w,v!=v?+w:w!=w?+v:+Yi(+v,+w)}function Ct(v,w){return v=+v,w=+w,v!=v?+w:w!=w?+v:+vr(+v,+w)}function zt(v){return v=+v,v>=0?+tn(v+.5):+is(v-.5)}function Wt(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0;if((S|0)>=8192)return Rn(v|0,w|0,S|0)|0,v|0;if(k=v|0,C=v+S|0,(v&3)==(w&3)){for(;v&3;){if(!S)return k|0;$e[v>>0]=$e[w>>0]|0,v=v+1|0,w=w+1|0,S=S-1|0}for(S=C&-4|0,N=S-64|0;(v|0)<=(N|0);)m[v>>2]=m[w>>2],m[v+4>>2]=m[w+4>>2],m[v+8>>2]=m[w+8>>2],m[v+12>>2]=m[w+12>>2],m[v+16>>2]=m[w+16>>2],m[v+20>>2]=m[w+20>>2],m[v+24>>2]=m[w+24>>2],m[v+28>>2]=m[w+28>>2],m[v+32>>2]=m[w+32>>2],m[v+36>>2]=m[w+36>>2],m[v+40>>2]=m[w+40>>2],m[v+44>>2]=m[w+44>>2],m[v+48>>2]=m[w+48>>2],m[v+52>>2]=m[w+52>>2],m[v+56>>2]=m[w+56>>2],m[v+60>>2]=m[w+60>>2],v=v+64|0,w=w+64|0;for(;(v|0)<(S|0);)m[v>>2]=m[w>>2],v=v+4|0,w=w+4|0}else for(S=C-4|0;(v|0)<(S|0);)$e[v>>0]=$e[w>>0]|0,$e[v+1>>0]=$e[w+1>>0]|0,$e[v+2>>0]=$e[w+2>>0]|0,$e[v+3>>0]=$e[w+3>>0]|0,v=v+4|0,w=w+4|0;for(;(v|0)<(C|0);)$e[v>>0]=$e[w>>0]|0,v=v+1|0,w=w+1|0;return k|0}function hn(v,w,S){v=v|0,w=w|0,S=S|0;var N=0;if((w|0)<(v|0)&(v|0)<(w+S|0)){for(N=v,w=w+S|0,v=v+S|0;(S|0)>0;)v=v-1|0,w=w-1|0,S=S-1|0,$e[v>>0]=$e[w>>0]|0;v=N}else Wt(v,w,S)|0;return v|0}function qn(v,w,S){v=v|0,w=w|0,S=S|0;var N=0,C=0,k=0,R=0;if(k=v+S|0,w=w&255,(S|0)>=67){for(;v&3;)$e[v>>0]=w,v=v+1|0;for(N=k&-4|0,R=w|w<<8|w<<16|w<<24,C=N-64|0;(v|0)<=(C|0);)m[v>>2]=R,m[v+4>>2]=R,m[v+8>>2]=R,m[v+12>>2]=R,m[v+16>>2]=R,m[v+20>>2]=R,m[v+24>>2]=R,m[v+28>>2]=R,m[v+32>>2]=R,m[v+36>>2]=R,m[v+40>>2]=R,m[v+44>>2]=R,m[v+48>>2]=R,m[v+52>>2]=R,m[v+56>>2]=R,m[v+60>>2]=R,v=v+64|0;for(;(v|0)<(N|0);)m[v>>2]=R,v=v+4|0}for(;(v|0)<(k|0);)$e[v>>0]=w,v=v+1|0;return k-S|0}function Yn(v){return v=+v,v>=0?+tn(v+.5):+is(v-.5)}function xn(v){v=v|0;var w=0,S=0,N=0;return N=vn()|0,S=m[on>>2]|0,w=S+v|0,(v|0)>0&(w|0)<(S|0)|(w|0)<0?(kn(w|0)|0,vt(12),-1):(w|0)>(N|0)&&!(ln(w|0)|0)?(vt(12),-1):(m[on>>2]=w,S|0)}function Wr(v,w,S){return v=v|0,w=w|0,S=S|0,En[v&3](w|0,S|0)|0}function jt(v,w){return Pe(0),0}var En=[jt,ad,G0,q0];return{___divdi3:Kl,___muldi3:as,___remdi3:gd,___uremdi3:Su,_areNeighborCells:ax,_bitshift64Ashr:Ad,_bitshift64Lshr:de,_bitshift64Shl:me,_calloc:xo,_cellAreaKm2:ah,_cellAreaM2:Pc,_cellAreaRads2:yl,_cellToBoundary:Xl,_cellToCenterChild:cd,_cellToChildPos:Ap,_cellToChildren:Hl,_cellToChildrenSize:mp,_cellToLatLng:ea,_cellToLocalIj:By,_cellToParent:Tg,_cellToVertex:wl,_cellToVertexes:pd,_cellsToDirectedEdge:od,_cellsToLinkedMultiPolygon:Xn,_childPosToCell:xp,_compactCells:bu,_constructCell:V_,_destroyLinkedMultiPolygon:Fc,_directedEdgeToBoundary:H0,_directedEdgeToCells:pp,_edgeLengthKm:Yl,_edgeLengthM:KT,_edgeLengthRads:QT,_emscripten_replace_memory:Nr,_free:Nn,_getBaseCellNumber:Iy,_getDirectedEdgeDestination:Oo,_getDirectedEdgeOrigin:$0,_getHexagonAreaAvgKm2:Z0,_getHexagonAreaAvgM2:Di,_getHexagonEdgeLengthAvgKm:Cg,_getHexagonEdgeLengthAvgM:cx,_getIcosahedronFaces:of,_getIndexDigit:B_,_getNumCells:ux,_getPentagons:Uy,_getRes0Cells:id,_getResolution:Q0,_greatCircleDistanceKm:Zo,_greatCircleDistanceM:yp,_greatCircleDistanceRads:vp,_gridDisk:qi,_gridDiskDistances:aa,_gridDistance:Mg,_gridPathCells:JT,_gridPathCellsSize:ZT,_gridRing:vl,_gridRingUnsafe:Yo,_i64Add:An,_i64Subtract:va,_isPentagon:Er,_isResClassIII:af,_isValidCell:K0,_isValidDirectedEdge:fp,_isValidIndex:Fy,_isValidVertex:im,_latLngToCell:jc,_llvm_ctlz_i64:Be,_llvm_maxnum_f64:xt,_llvm_minnum_f64:Ct,_llvm_round_f64:zt,_localIjToCell:Ng,_malloc:hs,_maxFaceCount:ta,_maxGr
4281idDiskSize:ss,_maxPolygonToCellsSize:Qi,_maxPolygonToCellsSizeExperimental:zi,_memcpy:Wt,_memmove:hn,_memset:qn,_originToDirectedEdges:ld,_pentagonCount:YT,_polygonToCells:vu,_polygonToCellsExperimental:em,_readInt64AsDoubleFromPointer:fx,_res0CellCount:ix,_reverseDirectedEdge:W0,_round:Yn,_sbrk:xn,_sizeOfCellBoundary:Lg,_sizeOfCoordIJ:q_,_sizeOfGeoLoop:z_,_sizeOfGeoPolygon:G_,_sizeOfH3Index:fh,_sizeOfLatLng:rm,_sizeOfLinkedGeoPolygon:Bc,_uncompactCells:Dc,_uncompactCellsSize:sf,_vertexToLatLng:ph,dynCall_iii:Wr,establishStackSpace:Oi,stackAlloc:zr,stackRestore:Ai,stackSave:sr}})(Mt,Nt,B);e.___divdi3=Je.___divdi3,e.___muldi3=Je.___muldi3,e.___remdi3=Je.___remdi3,e.___uremdi3=Je.___uremdi3,e._areNeighborCells=Je._areNeighborCells,e._bitshift64Ashr=Je._bitshift64Ashr,e._bitshift64Lshr=Je._bitshift64Lshr,e._bitshift64Shl=Je._bitshift64Shl,e._calloc=Je._calloc,e._cellAreaKm2=Je._cellAreaKm2,e._cellAreaM2=Je._cellAreaM2,e._cellAreaRads2=Je._cellAreaRads2,e._cellToBoundary=Je._cellToBoundary,e._cellToCenterChild=Je._cellToCenterChild,e._cellToChildPos=Je._cellToChildPos,e._cellToChildren=Je._cellToChildren,e._cellToChildrenSize=Je._cellToChildrenSize,e._cellToLatLng=Je._cellToLatLng,e._cellToLocalIj=Je._cellToLocalIj,e._cellToParent=Je._cellToParent,e._cellToVertex=Je._cellToVertex,e._cellToVertexes=Je._cellToVertexes,e._cellsToDirectedEdge=Je._cellsToDirectedEdge,e._cellsToLinkedMultiPolygon=Je._cellsToLinkedMultiPolygon,e._childPosToCell=Je._childPosToCell,e._compactCells=Je._compactCells,e._constructCell=Je._constructCell,e._destroyLinkedMultiPolygon=Je._destroyLinkedMultiPolygon,e._directedEdgeToBoundary=Je._directedEdgeToBoundary,e._directedEdgeToCells=Je._directedEdgeToCells,e._edgeLengthKm=Je._edgeLengthKm,e._edgeLengthM=Je._edgeLengthM,e._edgeLengthRads=Je._edgeLengthRads;var fn=e._emscripten_replace_memory=Je._emscripten_replace_memory;e._free=Je._free,e._getBaseCellNumber=Je._getBaseCellNumber,e._getDirectedEdgeDestination=Je._getDirectedEdgeDestination,e._getDirectedEdgeOrigin=Je._getDirectedEdgeOrigin,e._getHexagonAreaAvgKm2=Je._getHexagonAreaAvgKm2,e._getHexagonAreaAvgM2=Je._getHexagonAreaAvgM2,e._getHexagonEdgeLengthAvgKm=Je._getHexagonEdgeLengthAvgKm,e._getHexagonEdgeLengthAvgM=Je._getHexagonEdgeLengthAvgM,e._getIcosahedronFaces=Je._getIcosahedronFaces,e._getIndexDigit=Je._getIndexDigit,e._getNumCells=Je._getNumCells,e._getPentagons=Je._getPentagons,e._getRes0Cells=Je._getRes0Cells,e._getResolution=Je._getResolution,e._greatCircleDistanceKm=Je._greatCircleDistanceKm,e._greatCircleDistanceM=Je._greatCircleDistanceM,e._greatCircleDistanceRads=Je._greatCircleDistanceRads,e._gridDisk=Je._gridDisk,e._gridDiskDistances=Je._gridDiskDistances,e._gridDistance=Je._gridDistance,e._gridPathCells=Je._gridPathCells,e._gridPathCellsSize=Je._gridPathCellsSize,e._gridRing=Je._gridRing,e._gridRingUnsafe=Je._gridRingUnsafe,e._i64Add=Je._i64Add,e._i64Subtract=Je._i64Subtract,e._isPentagon=Je._isPentagon,e._isResClassIII=Je._isResClassIII,e._isValidCell=Je._isValidCell,e._isValidDirectedEdge=Je._isValidDirectedEdge,e._isValidIndex=Je._isValidIndex,e._isValidVertex=Je._isValidVertex,e._latLngToCell=Je._latLngToCell,e._llvm_ctlz_i64=Je._llvm_ctlz_i64,e._llvm_maxnum_f64=Je._llvm_maxnum_f64,e._llvm_minnum_f64=Je._llvm_minnum_f64,e._llvm_round_f64=Je._llvm_round_f64,e._localIjToCell=Je._localIjToCell,e._malloc=Je._malloc,e._maxFaceCount=Je._maxFaceCount,e._maxGridDiskSize=Je._maxGridDiskSize,e._maxPolygonToCellsSize=Je._maxPolygonToCellsSize,e._maxPolygonToCellsSizeExperimental=Je._maxPolygonToCellsSizeExperimental,e._memcpy=Je._memcpy,e._memmove=Je._memmove,e._memset=Je._memset,e._originToDirectedEdges=Je._originToDirectedEdges,e._pentagonCount=Je._pentagonCount,e._polygonToCells=Je._polygonToCells,e._polygonToCellsExperimental=Je._polygonToCellsExperimental,e._readInt64AsDoubleFromPointer=Je._readInt64AsDoubleFromPointer,e._res0CellCount=Je._res0CellCount,e._reverseDirectedEdge=Je._reverseDirectedEdge,e._round=Je._round,e._sbrk=Je._sbrk,e._sizeOfCellBoundary=Je._sizeOfCellBoundary,e._sizeOfCoordIJ=Je._sizeOfCoordIJ,e._sizeOfGeoLoop=Je._sizeOfGeoLoop,e._sizeOfGeoPolygon=Je._sizeOfGeoPolygon,e._sizeOfH3Index=Je._sizeOfH3Index,e._sizeOfLatLng=Je._sizeOfLatLng,e._sizeOfLinkedGeoPolygon=Je._sizeOfLinkedGeoPolygon,e._uncompactCells=Je._uncompactCells,e._uncompactCellsSize=Je._uncompactCellsSize,e._vertexToLatLng=Je._vertexToLatLng,e.establishStackSpace=Je.establishStackSpace;var Tn=e.stackAlloc=Je.stackAlloc,nt=e.stackRestore=Je.stackRestore,Kt=e.stackSave=Je.stackSave;if(e.dynCall_iii=Je.dynCall_iii,e.asm=Je,e.cwrap=M,e.setValue=p,e.getValue=g,At){Se(At)||(At=s(At));{Ye();var Lt=function(xe){xe.byteLength&&(xe=new Uint8Array(xe)),H.set(xe,f),e.memoryInitializerRequest&&delete e.memoryInitializerRequest.response,ft()},cn=function(){a(At,Lt,function(){throw"could not load memory initializer "+At})},dn=Ft(At);if(dn)Lt(dn.buffer);else if(e.memoryInitializerRequest){var Bt=function(){var xe=e.memoryInitializerRequest,Oe=xe.response;if(xe.status!==200&&xe.status!==0){var Ge=Ft(e.memoryInitializerRequestURL);if(Ge)Oe=Ge.buffer;else{console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+xe.status+", retrying "+At),cn();return}}Lt(Oe)};e.memoryInitializerRequest.response?setTimeout(Bt,0):e.memoryInitializerRequest.addEventListener("load",Bt)}else cn()}}var Ht;Ze=function xe(){Ht||qt(),Ht||(Ze=xe)};function qt(xe){if(Fe>0||(ve(),Fe>0))return;function Oe(){Ht||(Ht=!0,!A&&(we(),Ue(),e.onRuntimeInitialized&&e.onRuntimeInitialized(),ze()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),Oe()},1)):Oe()}e.run=qt;function Fn(xe){throw e.onAbort&&e.onAbort(xe),xe+="",o(xe),l(xe),A=!0,"abort("+xe+"). Build with -s ASSERTIONS=1 for more info."}if(e.abort=Fn,e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return qt(),n})(typeof Ui=="object"?Ui:{}),jr="number",Mr=jr,E2=jr,Fr=jr,Ur=jr,il=jr,Wn=jr,zUe=[["sizeOfH3Index",jr],["sizeOfLatLng",jr],["sizeOfCellBoundary",jr],["sizeOfGeoLoop",jr],["sizeOfGeoPolygon",jr],["sizeOfLinkedGeoPolygon",jr],["sizeOfCoordIJ",jr],["readInt64AsDoubleFromPointer",jr],["isValidCell",E2,[Fr,Ur]],["isValidIndex",E2,[Fr,Ur]],["latLngToCell",Mr,[jr,jr,il,Wn]],["cellToLatLng",Mr,[Fr,Ur,Wn]],["cellToBoundary",Mr,[Fr,Ur,Wn]],["maxGridDiskSize",Mr,[jr,W
4281n]],["gridDisk",Mr,[Fr,Ur,jr,Wn]],["gridDiskDistances",Mr,[Fr,Ur,jr,Wn,Wn]],["gridRing",Mr,[Fr,Ur,jr,Wn]],["gridRingUnsafe",Mr,[Fr,Ur,jr,Wn]],["maxPolygonToCellsSize",Mr,[Wn,il,jr,Wn]],["polygonToCells",Mr,[Wn,il,jr,Wn]],["maxPolygonToCellsSizeExperimental",Mr,[Wn,il,jr,Wn]],["polygonToCellsExperimental",Mr,[Wn,il,jr,jr,jr,Wn]],["cellsToLinkedMultiPolygon",Mr,[Wn,jr,Wn]],["destroyLinkedMultiPolygon",null,[Wn]],["compactCells",Mr,[Wn,Wn,jr,jr]],["uncompactCells",Mr,[Wn,jr,jr,Wn,jr,il]],["uncompactCellsSize",Mr,[Wn,jr,jr,il,Wn]],["isPentagon",E2,[Fr,Ur]],["isResClassIII",E2,[Fr,Ur]],["getBaseCellNumber",jr,[Fr,Ur]],["getResolution",jr,[Fr,Ur]],["getIndexDigit",jr,[Fr,Ur,jr]],["constructCell",Mr,[jr,jr,Wn,Wn]],["maxFaceCount",Mr,[Fr,Ur,Wn]],["getIcosahedronFaces",Mr,[Fr,Ur,Wn]],["cellToParent",Mr,[Fr,Ur,il,Wn]],["cellToChildren",Mr,[Fr,Ur,il,Wn]],["cellToCenterChild",Mr,[Fr,Ur,il,Wn]],["cellToChildrenSize",Mr,[Fr,Ur,il,Wn]],["cellToChildPos",Mr,[Fr,Ur,il,Wn]],["childPosToCell",Mr,[jr,jr,Fr,Ur,il,Wn]],["areNeighborCells",Mr,[Fr,Ur,Fr,Ur,Wn]],["cellsToDirectedEdge",Mr,[Fr,Ur,Fr,Ur,Wn]],["getDirectedEdgeOrigin",Mr,[Fr,Ur,Wn]],["getDirectedEdgeDestination",Mr,[Fr,Ur,Wn]],["isValidDirectedEdge",E2,[Fr,Ur]],["directedEdgeToCells",Mr,[Fr,Ur,Wn]],["originToDirectedEdges",Mr,[Fr,Ur,Wn]],["directedEdgeToBoundary",Mr,[Fr,Ur,Wn]],["reverseDirectedEdge",Mr,[Fr,Ur,Wn]],["gridDistance",Mr,[Fr,Ur,Fr,Ur,Wn]],["gridPathCells",Mr,[Fr,Ur,Fr,Ur,Wn]],["gridPathCellsSize",Mr,[Fr,Ur,Fr,Ur,Wn]],["cellToLocalIj",Mr,[Fr,Ur,Fr,Ur,jr,Wn]],["localIjToCell",Mr,[Fr,Ur,Wn,jr,Wn]],["getHexagonAreaAvgM2",Mr,[il,Wn]],["getHexagonAreaAvgKm2",Mr,[il,Wn]],["getHexagonEdgeLengthAvgM",Mr,[il,Wn]],["getHexagonEdgeLengthAvgKm",Mr,[il,Wn]],["greatCircleDistanceM",jr,[Wn,Wn]],["greatCircleDistanceKm",jr,[Wn,Wn]],["greatCircleDistanceRads",jr,[Wn,Wn]],["cellAreaM2",Mr,[Fr,Ur,Wn]],["cellAreaKm2",Mr,[Fr,Ur,Wn]],["cellAreaRads2",Mr,[Fr,Ur,Wn]],["edgeLengthM",Mr,[Fr,Ur,Wn]],["edgeLengthKm",Mr,[Fr,Ur,Wn]],["edgeLengthRads",Mr,[Fr,Ur,Wn]],["getNumCells",Mr,[il,Wn]],["getRes0Cells",Mr,[Wn]],["res0CellCount",jr],["getPentagons",Mr,[jr,Wn]],["pentagonCount",jr],["cellToVertex",Mr,[Fr,Ur,jr,Wn]],["cellToVertexes",Mr,[Fr,Ur,Wn]],["vertexToLatLng",Mr,[Fr,Ur,Wn]],["isValidVertex",E2,[Fr,Ur]]],GUe=0,qUe=1,$Ue=2,HUe=3,Rde=4,WUe=5,XUe=6,YUe=7,QUe=8,KUe=9,ZUe=10,JUe=11,eBe=12,tBe=13,nBe=14,rBe=15,iBe=16,sBe=17,aBe=18,oBe=19,go={};go[GUe]="Success";go[qUe]="The operation failed but a more specific error is not available";go[$Ue]="Argument was outside of acceptable range";go[HUe]="Latitude or longitude arguments were outside of acceptable range";go[Rde]="Resolution argument was outside of acceptable range";go[WUe]="Cell argument was not valid";go[XUe]="Directed edge argument was not valid";go[YUe]="Undirected edge argument was not valid";go[QUe]="Vertex argument was not valid";go[KUe]="Pentagon distortion was encountered";go[ZUe]="Duplicate input";go[JUe]="Cell arguments were not neighbors";go[eBe]="Cell arguments had incompatible resolutions";go[tBe]="Memory allocation failed";go[nBe]="Bounds of provided memory were insufficient";go[rBe]="Mode or flags argument was not valid";go[iBe]="Index argument was not valid";go[sBe]="Base cell number was outside of acceptable range";go[aBe]="Child indexing digits invalid";go[oBe]="Child indexing digits refer to a deleted subsequence";var lBe=1e3,Pde=1001,Lde=1002,iR={};iR[lBe]="Unknown unit";iR[Pde]="Array length out of bounds";iR[Lde]="Got unexpected null value for H3 index";var cBe="Unknown error";function Ode(n,e,t){var r=t&&"value"in t,i=new Error((n[e]||cBe)+" (code: "+e+(r?", value: "+t.value:"")+")");return i.code=e,i}function Dde(n,e){var t=arguments.length===2?{value:e}:{};return Ode(go,n,t)}function jde(n,e){var t=arguments.length===2?{value:e}:{};return Ode(iR,n,t)}function j5(n){if(n!==0)throw Dde(n)}var ed={};zUe.forEach(function(e){ed[e[0]]=Ui.cwrap.apply(Ui,e)});var Ab=16,I5=4,Qw=8,uBe=8,wk=ed.sizeOfH3Index(),Ez=ed.sizeOfLatLng(),dBe=ed.sizeOfCellBoundary(),hBe=ed.sizeOfGeoPolygon(),A4=ed.sizeOfGeoLoop();ed.sizeOfLinkedGeoPolygon();ed.sizeOfCoordIJ();function fBe(n){if(typeof n!="number"||n<0||n>15||Math.floor(n)!==n)throw Dde(Rde,n);return n}function pBe(n){if(!n)throw jde(Lde);return n}var mBe=Math.pow(2,32)-1;function gBe(n){if(n>mBe)throw jde(Pde,n);return n}var ABe=/[^0-9a-fA-F]/;function Ide(n){if(Array.isArray(n)&&n.length===2&&Number.isInteger(n[0])&&Number.isInteger(n[1]))return n;
4281if(typeof n!="string"||ABe.test(n))return[0,0];var e=parseInt(n.substring(0,n.length-8),Ab),t=parseInt(n.substring(n.length-8),Ab);return[t,e]}function LZ(n){if(n>=0)return n.toString(Ab);n=n&2147483647;var e=Fde(8,n.toString(Ab)),t=(parseInt(e[0],Ab)+8).toString(Ab);return e=t+e.substring(1),e}function xBe(n,e){return LZ(e)+Fde(8,LZ(n))}function Fde(n,e){for(var t=n-e.length,r="",i=0;i<t;i++)r+="0";return r=r+e,r}function OZ(n,e,t){for(var r=n.length,i=Ui._calloc(r,Ez),s=t?1:0,a=t?0:1,o=0;o<r*2;o+=2)Ui.HEAPF64.set([n[o/2][s],n[o/2][a]].map(zde),i/Qw+o);return Ui.HEAPU32.set([r,i],e/I5),e}function vBe(n,e){var t=n.length-1,r=Ui._calloc(hBe),i=0,s=i+A4,a=s+I5;OZ(n[0],r+i,e);var o;if(t>0){o=Ui._calloc(t,A4);for(var l=0;l<t;l++)OZ(n[l+1],o+A4*l,e)}return Ui.setValue(r+s,t,"i32"),Ui.setValue(r+a,o,"i32"),r}function yBe(n){var e=0,t=e+A4,r=t+I5,i=I5;Ui._free(Ui.getValue(n+e+i,"i8*"));var s=Ui.getValue(n+t,"i32");if(s>0){for(var a=Ui.getValue(n+r,"i32"),o=0;o<s;o++)Ui._free(Ui.getValue(a+A4*o+i,"i8*"));Ui._free(a)}Ui._free(n)}function Ude(n,e){e===void 0&&(e=0);var t=Ui.getValue(n+wk*e,"i32"),r=Ui.getValue(n+wk*e+I5,"i32");return r?xBe(t,r):null}function bBe(n){return ed.readInt64AsDoubleFromPointer(n)}function wBe(n,e){for(var t=[],r=0;r<e;r++){var i=Ude(n,r);i!==null&&t.push(i)}return t}function _k(n){return CBe(Ui.getValue(n,"double"))}function _Be(n){return[_k(n),_k(n+Qw)]}function SBe(n){return[_k(n+Qw),_k(n)]}function TBe(n,e,t){for(var r=Ui.getValue(n,"i32"),i=n+Qw,s=[],a=SBe,o=0;o<r*2;o+=2)s.push(a(i+Qw*o));return s.push(s[0]),s}function EBe(n,e,t){var r=Ui._malloc(Ez);Ui.HEAPF64.set([n,e].map(zde),r/Qw);var i=Ui._malloc(wk);try{return j5(ed.latLngToCell(r,t,i)),pBe(Ude(i))}finally{Ui._free(i),Ui._free(r)}}function Bde(n){var e=Ui._malloc(Ez),t=Ide(n),r=t[0],i=t[1];try{return j5(ed.cellToLatLng(r,i,e)),_Be(e)}finally{Ui._free(e)}}function Vde(n,e){var t=Ui._malloc(dBe),r=Ide(n),i=r[0],s=r[1];try{return j5(ed.cellToBoundary(i,s,t)),TBe(t,e,e)}finally{Ui._free(t)}}function DZ(n,e,t){if(fBe(e),t=!!t,n.length===0||n[0].length===0)return[];var r=typeof n[0][0]=="number"?[n]:n,i=vBe(r,t),s=Ui._malloc(uBe);try{j5(ed.maxPolygonToCellsSize(i,e,0,s));var a=gBe(bBe(s)),o=Ui._calloc(a,wk);try{return j5(ed.polygonToCells(i,e,0,o)),wBe(o,a)}finally{Ui._free(o)}}finally{Ui._free(s),yBe(i)}}function zde(n){return n*Math.PI/180}function CBe(n){return n*180/Math.PI}function NBe(n){return n=Math.max(0,Math.min(1,n)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+n*(1172.33-n*(10793.56-n*(33300.12-n*(38394.49-n*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+n*(557.33+n*(1225.33-n*(3574.96-n*(1073.77+n*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+n*(3211.1-n*(15327.97-n*(27814-n*(22569.18-n*6838.66)))))))+")"}/** 4282 * @license 4283 * Copyright 2010-2026 Three.js Authors 4284 * SPDX-License-Identifier: MIT 4285 */const MBe=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","aoMapIntensity","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveIntensity","emissiveMap","envMap","envMapIntensity","envMapRotation","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","lightMapIntensity","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"],jZ=new WeakMap,IZ=new WeakMap,FZ=new WeakMap;class kBe{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=e.object.isSkinnedMesh===!0,this.refreshUniforms=MBe,this.renderId=0}firstInitialization(e){return this.renderObjects.has(e)===!1?(this.getRenderObjectData(e),!0):!1}needsVelocity(e){const t=e.getMRT();return t!==null&&t.has("velocity")}getRenderObjectData(e){let t=this.renderObjects.get(e);if(t===void 0){const{geometry:r,object:i}=e;if(t={geometryId:r.id,worldMatrix:i.matrixWorld.clone()},i.center&&(t.center=i.center.clone()),i.morphTargetInfluences&&(t.morphTargetInfluences=i.morphTargetInfluences.slice()),e.bundle!==null&&(t.version=e.bundle.version),e.material.transmission>0){const{width:o,height:l}=e.context;t.bufferWidth=o,t.bufferHeight=l}const{environmentIntensity:s,environmentRotation:a}=e.scene;t.environmentIntensity=s,t.environmentRotation=a.clone(),t.lights=this.getLightsData(e.lightsNode.getLights(),[]),this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const r in e){const i=e[r];t[r]={id:i.isInterleavedBufferAttribute?i.data.uuid:i.id,version:i.isInterleavedBufferAttribute?i.data.version:i.version}}return t}containsNode(e){const t=e.material;for(const r in t)if(t[r]&&t[r].isNode)return!0;return!!(e.context.modelViewMatrix||e.context.modelNormalViewMatrix||e.context.getAO||e.context.getShadow)}getGeometryData(e){let t=FZ.get(e);return t===void 0&&(t={_renderId:-1,_equal:!1,attributes:this.getAttributesData(e.attributes),indexId:e.index?e.index.id:null,indexVersion:e.index?e.index.version:null,drawRange:{start:e.drawRange.start,count:e.drawRange.count}},FZ.set(e,t)),t}getMaterialData(e){let t=IZ.get(e);if(t===void 0){t={_renderId:-1,_equal:!1};for(const r of this.refreshUniforms){const i=e[r];i!=null&&(typeof i=="object"&&i.clone!==void 0?i.isTexture===!0?t[r]={id:i.id,version:0}:t[r]=i.clone():t[r]=i)}IZ.set(e,t)}return t}equals(e,t,r){const{object:i,material:s,geometry:a}=e,o=this.getRenderObjectData(e);if(o.worldMatrix.equals(i.matrixWorld)!==!0)return o.worldMatrix.copy(i.matrixWorld),!1;const l=this.getMaterialData(e.material);
4285if(l._renderId!==r){l._renderId=r;for(const h in l){const f=l[h],p=s[h];if(h!=="_renderId"&&h!=="_equal"){if(f.equals!==void 0){if(f.equals(p)===!1)return f.copy(p),l._equal=!1,!1}else if(p.isTexture===!0){if(f.id!==p.id||f.version!==p.version)return f.id=p.id,f.version=p.version,l._equal=!1,!1}else if(f!==p)return l[h]=p,l._equal=!1,!1}}if(l.transmission>0){const{width:h,height:f}=e.context;if(o.bufferWidth!==h||o.bufferHeight!==f)return o.bufferWidth=h,o.bufferHeight=f,l._equal=!1,!1}l._equal=!0}else if(l._equal===!1)return!1;if(o.geometryId!==a.id)return o.geometryId=a.id,!1;const u=this.getGeometryData(e.geometry);if(u._renderId!==r){u._renderId=r;const h=a.attributes,f=u.attributes;let p=0,g=0;for(const T in h)p++;for(const T in f){g++;const L=f[T],D=h[T];if(D===void 0)return delete f[T],u._equal=!1,!1;const P=D.isInterleavedBufferAttribute?D.data.uuid:D.id,O=D.isInterleavedBufferAttribute?D.data.version:D.version;if(L.id!==P||L.version!==O)return L.id=P,L.version=O,u._equal=!1,!1}if(g!==p)return u.attributes=this.getAttributesData(h),u._equal=!1,!1;const A=a.index,x=u.indexId,b=u.indexVersion,_=A?A.id:null,M=A?A.version:null;if(x!==_||b!==M)return u.indexId=_,u.indexVersion=M,u._equal=!1,!1;if(u.drawRange.start!==a.drawRange.start||u.drawRange.count!==a.drawRange.count)return u.drawRange.start=a.drawRange.start,u.drawRange.count=a.drawRange.count,u._equal=!1,!1;u._equal=!0}else if(u._equal===!1)return!1;if(o.morphTargetInfluences){let h=!1;for(let f=0;f<o.morphTargetInfluences.length;f++)o.morphTargetInfluences[f]!==i.morphTargetInfluences[f]&&(o.morphTargetInfluences[f]=i.morphTargetInfluences[f],h=!0);if(h)return!1}if(o.lights){for(let h=0;h<t.length;h++)if(o.lights[h].map!==t[h].map)return!1}const d=e.scene;return d.environment!==null&&s.envMap===null&&(o.environmentIntensity!==d.environmentIntensity||o.environmentRotation.equals(d.environmentRotation)===!1)?(o.environmentIntensity=d.environmentIntensity,o.environmentRotation.copy(d.environmentRotation),!1):o.center&&o.center.equals(i.center)===!1?(o.center.copy(i.center),!1):(e.bundle!==null&&(o.version=e.bundle.version),!0)}getLightsData(e,t){t.length=0;for(const r of e)r.isSpotLight===!0&&r.map!==null&&t.push({map:r.map.version});return t}getLights(e,t){let r=jZ.get(e);return r===void 0&&(r={renderId:-1,lightsData:[]},jZ.set(e,r)),r.renderId===t||(r.renderId=t,this.getLightsData(e.getLights(),r.lightsData)),r.lightsData}needsRefresh(e,t){if(this.hasNode||this.hasAnimation||this.firstInitialization(e)||this.needsVelocity(t.renderer))return!0;const{renderId:r}=t;if(this.renderId!==r)return this.renderId=r,!0;const i=e.object.static===!0,s=e.bundle!==null&&e.bundle.static===!0&&this.getRenderObjectData(e).version===e.bundle.version;if(i||s)return!1;const a=this.getLights(e.lightsNode,r);return this.equals(e,a,r)!==!0}}const RBe=[/^StackTrace\.js$/,/^TSLCore\.js$/,/^.*Node\.js$/,/^three\.webgpu.*\.js$/];function PBe(n){const e=/(?:at\s+(.+?)\s+\()?(?:(.+?)@)?([^@\s()]+):(\d+):(\d+)/;return n.split(` 4286`).map(t=>{const r=t.match(e);if(!r)return null;const i=r[1]||r[2]||"",s=r[3].split("?")[0],a=parseInt(r[4],10),o=parseInt(r[5],10),l=s.split("/").pop();return{fn:i,file:l,line:a,column:o}}).filter(t=>t&&!RBe.some(r=>r.test(t.file)))}class ho{constructor(e=null){this.isStackTrace=!0,this.stack=PBe(e||new Error().stack)}getLocation(){if(this.stack.length===0)return"[Unknown location]";const e=this.stack[0],t=e.fn;return`${t?`"${t}()" at `:""}"${e.file}:${e.line}"`}getError(e){if(this.stack.length===0)return e;const t=this.stack.map(r=>{const i=`${r.file}:${r.line}:${r.column}`;return r.fn?` at ${r.fn} (${i})`:` at ${i}`}).join(` 4287`);return`${e} 4288${t}`}}function Cz(n,e=0){let t=3735928559^e,r=1103547991^e;if(Array.isArray(n))for(let i=0,s;i<n.length;i++)s=n[i],t=Math.imul(t^s,2654435761),r=Math.imul(r^s,1597334677);else for(let i=0,s;i<n.length;i++)s=n.charCodeAt(i),t=Math.imul(t^s,2654435761),r=Math.imul(r^s,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&r)+(t>>>0)}const E_=n=>Cz(n),kT=n=>Cz(n),x4=(...n)=>Cz(n),LBe=new Map([[1,"float"],[2,"vec2"],[3,"vec3"],[4,"vec4"],[9,"mat3"],[16,"mat4"]]),UZ=new WeakMap;function Gde(n){return LBe.get(n)}function Sk(n){if(/[iu]?vec\d/.test(n))return n.startsWith("ivec")?Int32Array:n.startsWith("uvec")?Uint32Array:Float32Array;
4288if(/mat\d/.test(n)||/float/.test(n))return Float32Array;if(/uint/.test(n))return Uint32Array;if(/int/.test(n))return Int32Array;throw new Error(`THREE.NodeUtils: Unsupported type: ${n}`)}function qde(n){if(/float|int|uint|bool/.test(n))return 1;if(/vec2/.test(n))return 2;if(/vec3/.test(n))return 3;if(/vec4/.test(n)||/mat2/.test(n))return 4;if(/mat3/.test(n))return 9;if(/mat4/.test(n))return 16;sn(`TSL: Unsupported type: ${n}`,new ho)}function OBe(n){if(/float|int|uint|bool/.test(n))return 1;if(/vec2/.test(n))return 2;if(/vec3/.test(n))return 3;if(/vec4/.test(n)||/mat2/.test(n))return 4;if(/mat3/.test(n))return 12;if(/mat4/.test(n))return 16;sn(`TSL: Unsupported type: ${n}`,new ho)}function DBe(n){if(/float|int|uint|bool/.test(n))return 1;if(/vec2/.test(n))return 2;if(/vec3/.test(n)||/vec4/.test(n))return 4;if(/mat2/.test(n))return 2;if(/mat3/.test(n)||/mat4/.test(n))return 4;sn(`TSL: Unsupported type: ${n}`,new ho)}function QA(n){if(n==null)return null;const e=typeof n;return n.isNode===!0?"node":e==="number"?"float":e==="boolean"?"bool":e==="string"?"string":e==="function"?"shader":n.isVector2===!0?"vec2":n.isVector3===!0?"vec3":n.isVector4===!0?"vec4":n.isMatrix2===!0?"mat2":n.isMatrix3===!0?"mat3":n.isMatrix4===!0?"mat4":n.isColor===!0?"color":n instanceof ArrayBuffer?"ArrayBuffer":null}function Nz(n,...e){const t=n?n.slice(-4):void 0;return e.length===1&&(t==="vec2"?e=[e[0],e[0]]:t==="vec3"?e=[e[0],e[0],e[0]]:t==="vec4"&&(e=[e[0],e[0],e[0],e[0]])),n==="color"?new tr(...e):t==="vec2"?new Jt(...e):t==="vec3"?new Ve(...e):t==="vec4"?new Rr(...e):t==="mat2"?new BM(...e):t==="mat3"?new Gr(...e):t==="mat4"?new kr(...e):n==="bool"?e[0]||!1:n==="float"||n==="int"||n==="uint"?e[0]||0:n==="string"?e[0]||"":n==="ArrayBuffer"?IBe(e[0]):null}function $de(n){let e=UZ.get(n);return e===void 0&&(e={},UZ.set(n,e)),e}function jBe(n){let e="";const t=new Uint8Array(n);for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function IBe(n){return Uint8Array.from(atob(n),e=>e.charCodeAt(0)).buffer}const nb={VERTEX:"vertex",FRAGMENT:"fragment"},Tr={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},FBe={BOOLEAN:"bool",INTEGER:"int",FLOAT:"float",VECTOR2:"vec2",VECTOR3:"vec3",VECTOR4:"vec4",MATRIX2:"mat2",MATRIX3:"mat3",MATRIX4:"mat4"},Fl={READ_ONLY:"readOnly",WRITE_ONLY:"writeOnly",READ_WRITE:"readWrite"},Hde=["fragment","vertex"],_6=["setup","analyze","generate"],S6=[...Hde,"compute"],Ty=["x","y","z","w"],UBe={analyze:"setup",generate:"analyze"};let BBe=0,cr=class Wde extends ef{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=Tr.NONE,this.updateBeforeType=Tr.NONE,this.updateAfterType=Tr.NONE,this.version=0,this.name="",this.global=!1,this.parents=!1,this.isNode=!0,this._beforeNodes=null,this._cacheKey=null,this._uuid=null,this._cacheKeyVersion=0,this.id=BBe++,this.stackTrace=null,Wde.captureStackTrace===!0&&(this.stackTrace=new ho)}set needsUpdate(e){e===!0&&this.version++}get uuid(){return this._uuid===null&&(this._uuid=zw.generateUUID()),this._uuid}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this),this}onFrameUpdate(e){return this.onUpdate(e,Tr.FRAME)}onRenderUpdate(e){return this.onUpdate(e,Tr.RENDER)}onObjectUpdate(e){return this.onUpdate(e,Tr.OBJECT)}onReference(e){return this.updateReference=e.bind(this),this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of this._getChildren())yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}_getChildren(e=new Set){const t=[];e.add(this);for(const r of Object.getOwnPropertyNames(this)){const i=this[r];if(!(r.startsWith("_")===!0||e.has(i))){if(Array.isArray(i)===!0)for(let s=0;s<i.length;s++){const a=i[s];a&&a.isNode===!0&&t.push({property:r,index:s,childNode:a})}else if(i&&i.isNode===!0)t.push({property:r,childNode:i});else if(i&&Object.getPrototypeOf(i)===Object.prototype)for(const s in i){if(s.startsWith("_")===!0)continue;const a=i[s];a&&a.isNode===!0&&t.push({property:r,index:s,childNode:a})}}}return t}getCacheKey(e=!1,t=null){if(e=e||this.version!==this._cacheKeyVersion,e===!0||this._cacheKey===null){t===null&&(t=new Set);const r=[];for(const{property:i,childNode:s}of this._getChildren(t))r.push(E_(i.slice(0,-4)),s.getCacheKey(e,t));this._cacheKey=x4(kT(r),this.customCacheKey()),this._cacheKeyVersion=this.version}return this._cacheKey}customCacheKey(){return this.id}getScope(){return this}
4288getHash(){return String(this.id)}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e,t=null){const r=e.getDataFromNode(this);let i;return t!==null?(r.typeFromOutput=r.typeFromOutput||{},i=r.typeFromOutput[t],i===void 0&&(i=this.generateNodeType(e,t),r.typeFromOutput[t]=i)):(i=r.type,i===void 0&&(i=this.generateNodeType(e),r.type=i)),i}generateNodeType(e,t=null){const r=e.getNodeProperties(this);return r.outputNode?r.outputNode.getNodeType(e,t):this.nodeType}getShared(e){const t=this.getHash(e),r=e.getNodeFromHash(t);let i=null;if(r&&r!==this)i=r;else if(e.context.overrideNodes){const s=e.context.overrideNodes.get(this);if(s){const a=e.getDataFromNode(this);a.isOverwritten!==!0?(a.isOverwritten=!0,i=s(e).overrideNode(this,null),a.sharedNode=i):i=a.sharedNode}}return i||this}getArrayCount(){return null}setup(e){const t=e.getNodeProperties(this);let r=0;for(const i of this.getChildren())t["node"+r++]=i;return t.outputNode||null}analyze(e,t=null){const r=e.increaseUsage(this);if(this.parents===!0){const i=e.getDataFromNode(this,"any");
4288i.stages=i.stages||{},i.stages[e.shaderStage]=i.stages[e.shaderStage]||[],i.stages[e.shaderStage].push(t)}if(r===1){const i=e.getNodeProperties(this);for(const s of Object.values(i))s&&s.isNode===!0&&s.build(e,this)}}generate(e,t){const{outputNode:r}=e.getNodeProperties(this);if(r&&r.isNode===!0)return r.build(e,t)}updateBefore(){an("Abstract function.")}updateAfter(){an("Abstract function.")}update(){an("Abstract function.")}before(e){return this._beforeNodes===null&&(this._beforeNodes=[]),this._beforeNodes.push(e),this}build(e,t=null){const r=this.getShared(e);if(this!==r)return r.build(e,t);if(this._beforeNodes!==null){const l=this._beforeNodes;this._beforeNodes=null;for(const u of l)u.build(e,t);this._beforeNodes=l}const i=e.getDataFromNode(this);i.buildStages=i.buildStages||{},i.buildStages[e.buildStage]=!0;const s=UBe[e.buildStage];if(s&&i.buildStages[s]!==!0){const l=e.getBuildStage();e.setBuildStage(s),this.build(e),e.setBuildStage(l)}e.addChain(this);let a=null;const o=e.getBuildStage();if(o==="setup"){e.addNode(this),this.updateReference(e);const l=e.getNodeProperties(this);if(l.initialized!==!0){l.initialized=!0,l.outputNode=this.setup(e)||l.outputNode||null;for(const u of Object.values(l))if(u&&u.isNode===!0){if(u.parents===!0){const d=e.getNodeProperties(u);d.parents=d.parents||[],d.parents.push(this)}u.build(e)}e.addSequentialNode(this)}a=l.outputNode}else if(o==="analyze")this.analyze(e,t);else if(o==="generate"){if(this.generate.length<2){const u=this.getNodeType(e),d=e.getDataFromNode(this);a=d.snippet,a===void 0?d.generated===void 0?(d.generated=!0,a=this.generate(e)||"",d.snippet=a):(an("Node: Recursion detected.",this),a="/* Recursion detected. */"):d.flowCodes!==void 0&&e.context.nodeBlock!==void 0&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),a=e.format(a,u,t)}else a=this.generate(e,t)||"";a===""&&t!==null&&t!=="void"&&t!=="OutputType"&&(sn(`TSL: Invalid generated code, expected a "${t}".`),a=e.generateConst(t))}return e.removeChain(this),a}getSerializeChildren(){return this._getChildren()}serialize(e){const t=this.getSerializeChildren(),r={};for(const{property:i,index:s,childNode:a}of t)s!==void 0?(r[i]===void 0&&(r[i]=Number.isInteger(s)?[]:{}),r[i][s]=a.toJSON(e.meta).uuid):r[i]=a.toJSON(e.meta).uuid;Object.keys(r).length>0&&(e.inputNodes=r)}deserialize(e){if(e.inputNodes!==void 0){const t=e.meta.nodes;for(const r in e.inputNodes)if(Array.isArray(e.inputNodes[r])){const i=[];for(const s of e.inputNodes[r])i.push(t[s]);this[r]=i}else if(typeof e.inputNodes[r]=="object"){const i={};for(const s in e.inputNodes[r]){const a=e.inputNodes[r][s];i[s]=t[a]}this[r]=i}else{const i=e.inputNodes[r];this[r]=t[i]}}}toJSON(e){const{uuid:t,type:r}=this,i=e===void 0||typeof e=="string";i&&(e={textures:{},images:{},nodes:{}});let s=e.nodes[t];s===void 0&&(s={uuid:t,type:r,meta:e,metadata:{version:4.7,type:"Node",generator:"Node.toJSON"}},i!==!0&&(e.nodes[s.uuid]=s),this.serialize(s),delete s.meta);function a(o){const l=[];for(const u in o){const d=o[u];delete d.metadata,l.push(d)}return l}if(i){const o=a(e.textures),l=a(e.images),u=a(e.nodes);o.length>0&&(s.textures=o),l.length>0&&(s.images=l),u.length>0&&(s.nodes=u)}return s}};cr.captureStackTrace=!1;class Ey extends cr{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}generateNodeType(e){return this.node.getElementType(e)}getMemberType(e,t){return this.node.getMemberType(e,t)}generate(e){const t=this.indexNode.getNodeType(e),r=this.node.build(e),i=this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:"uint");return`${r}[ ${i} ]`}}class Xde extends cr{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}generateNodeType(e){const t=this.node.getNodeType(e);let r=null;for(const i of this.convertTo.split("|"))(r===null||e.getTypeLength(t)===e.getTypeLength(i))&&(r=i);return r}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const r=this.node,i=this.getNodeType(e),s=r.build(e,i);return e.format(s,i,t)}}class za extends cr{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if(e.getBuildStage()==="generate"){const i=e.getVectorType(this.getNodeType(e,t)),s=e.getDataFromNode(this);if(s.propertyName!==void 0)return e.format(s.propertyName,i,t);if(i!=="void"&&t!=="void"&&this.hasDependencies(e)){const a=super.build(e,i),o=e.getVarFromNode(this,null,i),l=e.getPropertyName(o);return e.addLineFlowCode(`${l} = ${a}`,this),s.snippet=a,s.propertyName=l,e.format(s.propertyName,i,t)}}return super.build(e,t)}}class VBe extends za{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}generateNodeType(e){return this.nodeType!==null?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce((t,r)=>t+e.getTypeLength(r.getNodeType(e)),0))}generate(e,t){const r=this.getNodeType(e),i=e.getTypeLength(r),s=this.nodes,a=e.getComponentType(r),o=[];let l=0;for(const d of s){if(l>=i){sn(`TSL: Length of parameters exceeds maximum length of function '${r}()' type.`,this.stackTrace);break}let h=d.getNodeType(e),f=e.getTypeLength(h),p;if(l+f>i&&(sn(`TSL: Length of '${r}()' data exceeds maximum length of output type.`,this.stackTrace),f=i-l,h=e.getTypeFromLength(f)),l+=f,p=d.build(e,h),e.getComponentType(h)!==a){const A=e.getTypeFromLength(f,a);p=e.format(p,h,A)}o.push(p)}const u=`${e.getType(r)}( ${o.join(", ")} )`;return e.format(u,r,t)}}const zBe=Ty.join("");class Yde extends cr{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(Ty.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}generateNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}getScope(){return this.node.getScope()}generate(e,t){const r=this.node,i=e.getTypeLength(r.getNodeType(e));let s=null;if(i>1){let a=null;this.getVectorLength()>=i&&(a=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const l=r.build(e,a);this.components.length===i&&this.components===zBe.slice(0,this.components.length)?s=e.format(l,a,t):s=e.format(`${l}.${this.components}`,this.getNodeType(e),t)}else s=r.build(e,t);return s}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class GBe extends za{static get type(){return"SetNode"}constructor(e,t,r){super(),this.sourceNode=e,this.components=t,this.targetNode=r}generateNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:r,targetNode:i}=this,s=this.getNodeType(e),a=e.getComponentType(i.getNodeType(e)),o=e.getTypeFromLength(r.length,a),l=i.build(e,o),u=t.build(e,s),d=e.getTypeLength(s),h=[];for(let f=0;f<d;f++){const p=Ty[f];p===r[0]?(h.push(l),f+=r.length-1):h.push(u+"."+p)}return`${e.getType(s)}( ${h.join(", ")} )`}}class qBe extends za{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}generateNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:r}=this,i=this.getNodeType(e),s=r.build(e),a=e.getVarFromNode(this),o=e.getPropertyName(a);e.addLineFlowCode(o+" = "+s,this);const l=e.getTypeLength(i),u=[];let d=0;for(let h=0;h<l;h++){const f=Ty[h];f===t[d]?(u.push("1.0 - "+(o+"."+f)),d++):u.push(o+"."+f)}return`${e.getType(i)}( ${u.join(", ")} )`}}class Mz extends cr{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}generateNodeType(){return this.nodeType===null?QA(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=QA(this.value),e.nodeType=this.nodeType,e.valueType==="ArrayBuffer"&&(e.value=jBe(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?Nz(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){an("Abstract function.")}}const BZ=/float|u?int/;class U0 extends Mz{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const r=this.getNodeType(e);return BZ.test(r)&&BZ.test(t)?e.generateConst(t,this.value):e.format(this.generateConst(e),r,t)}}class $Be extends cr{static get type(){return"MemberNode"}constructor(e,t){super(),this.structNode=e,this.property=t,this.isMemberNode=!0}hasMember(e){return this.structNode.isMemberNode&&this.structNode.hasMember(e)===!1?!1:this.structNode.getMemberType(e,this.property)!=="void"}generateNodeType(e){return this.hasMember(e)===!1?"float":this.structNode.getMemberType(e,this.property)}getMemberType(e,t){if(this.hasMember(e)===!1)return"float";const r=this.getNodeType(e);return e.getStructTypeNode(r).getMemberType(e,t)}generate(e){if(this.hasMember(e)===!1){an(`TSL: Member "${this.property}" does not exist in struct.`,this.stackTrace);const r=this.getNodeType(e);return e.generateConst(r)}return this.structNode.build(e)+"."+this.property}}let k1=null;const IF=new Map;function Ut(n,e){if(IF.has(n)){an(`TSL: Redefinition of method chaining '${n}'.`);return}if(typeof e!="function")throw new Error(`THREE.TSL: Node element ${n} is not a function`);IF.set(n,e),n!=="assign"&&(cr.prototype[n]=function(...t){return this.isStackNode?this.addToStack(e(...t)):e(this,...t)},cr.prototype[n+"Assign"]=function(...t){return this.isStackNode?this.assign(t[0],e(...t)):this.assign(e(this,...t))})}const HBe=n=>n.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),VZ=n=>HBe(n).split("").sort().join("");cr.prototype.assign=function(...n){if(this.isStackNode!==!0)return k1!==null?k1.assign(this,...n
4288):sn("TSL: No stack defined for assign operation. Make sure the assign is inside a Fn().",new ho),this;{const e=IF.get("assign");return this.addToStack(e(...n))}};cr.prototype.toVarIntent=function(){return this};cr.prototype.get=function(n){return new $Be(this,n)};const v4={};function jC(n,e,t){v4[n]=v4[e]=v4[t]={get(){this._cache=this._cache||{};let a=this._cache[n];return a===void 0&&(a=new Yde(this,n),this._cache[n]=a),a},set(a){this[n].assign(Hn(a))}};const r=n.toUpperCase(),i=e.toUpperCase(),s=t.toUpperCase();cr.prototype["set"+r]=cr.prototype["set"+i]=cr.prototype["set"+s]=function(a){const o=VZ(n);return new GBe(this,o,Hn(a))},cr.prototype["flip"+r]=cr.prototype["flip"+i]=cr.prototype["flip"+s]=function(){const a=VZ(n);return new qBe(this,a)}}const kp=["x","y","z","w"],Rp=["r","g","b","a"],Pp=["s","t","p","q"];for(let n=0;n<4;n++){let e=kp[n],t=Rp[n],r=Pp[n];jC(e,t,r);for(let i=0;i<4;i++){e=kp[n]+kp[i],t=Rp[n]+Rp[i],r=Pp[n]+Pp[i],jC(e,t,r);for(let s=0;s<4;s++){e=kp[n]+kp[i]+kp[s],t=Rp[n]+Rp[i]+Rp[s],r=Pp[n]+Pp[i]+Pp[s],jC(e,t,r);for(let a=0;a<4;a++)e=kp[n]+kp[i]+kp[s]+kp[a],t=Rp[n]+Rp[i]+Rp[s]+Rp[a],r=Pp[n]+Pp[i]+Pp[s]+Pp[a],jC(e,t,r)}}}for(let n=0;n<32;n++)v4[n]={get(){this._cache=this._cache||{};let e=this._cache[n];return e===void 0&&(e=new Ey(this,new U0(n,"uint")),this._cache[n]=e),e},set(e){this[n].assign(Hn(e))}};Object.defineProperties(cr.prototype,v4);const WBe=function(n,e=null){const t=QA(n);return t==="node"?n:e===null&&(t==="float"||t==="boolean")||t&&t!=="shader"&&t!=="string"?Hn(FF(n,e)):t==="shader"?n.isFn?n:ut(n):n},XBe=function(n,e=null){for(const t in n)n[t]=Hn(n[t],e);return n},YBe=function(n,e=null){const t=n.length;for(let r=0;r<t;
4288r++)n[r]=Hn(n[r],e);return n},Qde=function(n,e=null,t=null,r=null){function i(d){return r!==null?(d=Hn(Object.assign(d,r)),r.intent===!0&&(d=d.toVarIntent())):d=Hn(d),d}let s,a=e,o,l;function u(d){let h;return a?h=/[a-z]/i.test(a)?a+"()":a:h=n.type,o!==void 0&&d.length<o?(sn(`TSL: "${h}" parameter length is less than minimum required.`,new ho),d.concat(new Array(o-d.length).fill(0))):l!==void 0&&d.length>l?(sn(`TSL: "${h}" parameter length exceeds limit.`,new ho),d.slice(0,l)):d}return e===null?s=(...d)=>i(new n(...Iv(u(d)))):t!==null?(t=Hn(t),s=(...d)=>i(new n(e,...Iv(u(d)),t))):s=(...d)=>i(new n(e,...Iv(u(d)))),s.setParameterLength=(...d)=>(d.length===1?o=l=d[0]:d.length===2&&([o,l]=d),s),s.setName=d=>(a=d,s),s},QBe=function(n,...e){return new n(...Iv(e))};class KBe extends cr{constructor(e,t){super(),this.shaderNode=e,this.rawInputs=t,this.isShaderCallNodeInternal=!0}generateNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getElementType(e){return this.getOutputNode(e).getElementType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,rawInputs:r}=this,i=e.getNodeProperties(t),s=e.getClosestSubBuild(t.subBuilds)||"",a=s||"default";if(i[a])return i[a];const o=e.subBuildFn,l=e.fnCall;e.subBuildFn=s,e.fnCall=this;let u=null;if(t.layout){if(r){const f=t.layout.inputs;if(Kde(r)){const p=r;for(let g=0;g<f.length;g++){const A=p[g];A&&A.isNode&&A.build(e)}}else{const p=r[0];for(const g of f){const A=p[g.name];A&&A.isNode&&A.build(e)}}}const d=e.buildFunctionNode(t);e.addInclude(d);const h=r?ZBe(r):null;u=d.call(h)}else{const d=new Proxy(e,{get:(A,x,b)=>{let _;return Symbol.iterator===x?_=function*(){yield void 0}:_=Reflect.get(A,x,b),_}}),h=r?JBe(r):null,f=Array.isArray(r)?r.length>0:r!==null,p=t.jsFunc,g=f||p.length>1?p(h,d):p(d);u=Hn(g)}return e.subBuildFn=o,e.fnCall=l,t.once&&(i[a]=u),u}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}getOutputNode(e){const t=e.getNodeProperties(this),r=e.getSubBuildOutput(this);return t[r]=t[r]||this.setupOutput(e),t[r].subBuild=e.getClosestSubBuild(this),t[r]}build(e,t=null){let r=null;const i=e.getBuildStage(),s=e.getNodeProperties(this),a=e.getSubBuildOutput(this),o=this.getOutputNode(e),l=e.fnCall;if(e.fnCall=this,i==="setup"){const u=e.getSubBuildProperty("initialized",this);if(s[u]!==!0&&(s[u]=!0,s[a]=this.getOutputNode(e),s[a].build(e),this.shaderNode.subBuilds))for(const d of e.chaining){const h=e.getDataFromNode(d,"any");h.subBuilds=h.subBuilds||new Set;for(const f of this.shaderNode.subBuilds)h.subBuilds.add(f)}r=s[a]}else i==="analyze"?o.build(e,t):i==="generate"&&(r=o.build(e,t)||"");return e.fnCall=l,r}}function Kde(n){return n[0]&&(n[0].isNode||Object.getPrototypeOf(n[0])!==Object.prototype)}function ZBe(n){let e;return oR(n),Kde(n)?e=[...n]:e=n[0],e}function JBe(n){let e=0;return oR(n),new Proxy(n,{get:(t,r,i)=>{let s;if(r==="length")return s=n.length,s;if(Symbol.iterator===r)s=function*(){for(const a of n)yield Hn(a)};else{if(n.length>0)if(Object.getPrototypeOf(n[0])===Object.prototype){const a=n[0];a[r]===void 0?s=a[e++]:s=Reflect.get(a,r,i)}else n[0]instanceof cr&&(n[r]===void 0?s=n[e++]:s=Reflect.get(n,r,i));else s=Reflect.get(t,r,i);s=Hn(s)}return s}})}class eVe extends cr{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}getLayout(){return this.layout}call(e=null){return new KBe(this,e)}setup(){return this.call()}}const tVe=[!1,!0],nVe=[0,1,2,3],rVe=[-1,-2],Zde=[.5,1.5,1/3,1e-6,1e6,Math.PI,Math.PI*2,1/Math.PI,2/Math.PI,1/(Math.PI*2),Math.PI/2],kz=new Map;for(const n of tVe)kz.set(n,new U0(n));const Rz=new Map;for(const n of nVe)Rz.set(n,new U0(n,"uint"));const Pz=new Map([...Rz].map(n=>new U0(n.value,"int")));for(const n of rVe)Pz.set(n,new U0(n,"int"));const sR=new Map([...Pz].map(n=>new U0(n.value)));for(const n of Zde)sR.set(n,new U0(n));for(const n of Zde)sR.set(-n,new U0(-n));const aR={bool:kz,uint:Rz,ints:Pz,float:sR},zZ=new Map([...kz,...sR]),FF=(n,e)=>zZ.has(n)?zZ.get(n):n.isNode===!0?n:new U0(n,e),Po=function(n,e=null){return(...t)=>{for(const i of t)if(i===void 0)return sn(`TSL: Invalid parameter for the type "${n}".`,new ho),new U0(0,n);if((t.length===0||!["bool","float","int","uint"].includes(n)&&t.every(i=>{const s=typeof i;return s!=="object"&&s!=="function"}))&&(t=[Nz(n,...t)]),t.length===1&&e!==null&&e.has(t[0]))return FS(e.get(t[0]));if(t.length===1){const i=FF(t[0],n);return i.nodeType===n?FS(i):FS(new Xde(i,n))}const r=t.map(i=>FF(i));return FS(new VBe(r,n))}};function Kw(n){return n&&n.isNode&&n.traverse(e=>{e.isConstNode&&(n=e.value)}),!!n}const Jde=n=>n!=null?n.nodeType||n.convertTo||(typeof n=="string"?n:null):null;function xb(n,e){return new eVe(n,e)}const Hn=(n,e=null)=>WBe(n,e),FS=(n,e=null)=>
4288Hn(n,e).toVarIntent(),oR=(n,e=null)=>new XBe(n,e),Iv=(n,e=null)=>new YBe(n,e),ri=(n,e=null,t=null,r=null)=>new Qde(n,e,t,r),Pn=(n,...e)=>new QBe(n,...e),mn=(n,e=null,t=null,r={})=>new Qde(n,e,t,{...r,intent:!0}),Lz=(n,e)=>new Proxy(n,{get(t,r,i){return Reflect.get(e,r,i)},set(t,r,i){return Reflect.set(e,r,i)}});let iVe=0;class sVe extends cr{constructor(e,t=null){super();let r=null;t!==null&&(typeof t=="object"?r=t.return:(typeof t=="string"?r=t:sn("TSL: Invalid layout type.",new ho),t=null)),this.shaderNode=new xb(e,r),t!==null&&this.setLayout(t),this.isFn=!0}setLayout(e){const t=this.shaderNode.nodeType;if(typeof e.inputs!="object"){const r={name:"fn"+iVe++,type:t,inputs:[]};for(const i in e)i!=="return"&&r.inputs.push({name:i,type:e[i]});e=r}return this.shaderNode.setLayout(e),this}generateNodeType(e){return this.shaderNode.getNodeType(e)||"float"}call(...e){const t=this.shaderNode.call(e);return this.shaderNode.nodeType==="void"&&t.toStack(),t.toVarIntent()}once(e=null){return this.shaderNode.once=!0,this.shaderNode.subBuilds=e,this}generate(e){const t=this.getNodeType(e);return sn('TSL: "Fn()" was declared but not invoked. Try calling it like "Fn()( ...params )".',this.stackTrace),e.generateConst(t)}}function ut(n,e=null){const t=new sVe(n,e);return new Proxy(()=>{},{apply(r,i,s){return t.call(...s)},get(r,i,s){return Reflect.get(t,i,s)},set(r,i,s,a){return Reflect.set(t,i,s,a)}})}const F5=n=>{k1=n},Oz=()=>k1,nr=(...n)=>k1.If(...n),aVe=(...n)=>k1.Switch(...n);function lR(n){return k1&&k1.addToStack(n),n}Ut("toStack",lR);
vendor: 3,856 bytes, line 4288
4288const ehe=new Po("color"),Ie=new Po("float",aR.float),st=new Po("int",aR.ints),un=new Po("uint",aR.uint),th=new Po("bool",aR.bool),Cn=new Po("vec2"),_a=new Po("ivec2"),Dz=new Po("uvec2"),the=new Po("bvec2"),ct=new Po("vec3"),jz=new Po("ivec3"),Cy=new Po("uvec3"),Iz=new Po("bvec3"),Vn=new Po("vec4"),Fz=new Po("ivec4"),Uz=new Po("uvec4"),nhe=new Po("bvec4"),cR=new Po("mat2"),gl=new Po("mat3"),f1=new Po("mat4");Ut("toColor",ehe);Ut("toFloat",Ie);Ut("toInt",st);Ut("toUint",un);Ut("toBool",th);Ut("toVec2",Cn);Ut("toIVec2",_a);Ut("toUVec2",Dz);Ut("toBVec2",the);Ut("toVec3",ct);Ut("toIVec3",jz);Ut("toUVec3",Cy);Ut("toBVec3",Iz);Ut("toVec4",Vn);Ut("toIVec4",Fz);Ut("toUVec4",Uz);Ut("toBVec4",nhe);Ut("toMat2",cR);Ut("toMat3",gl);Ut("toMat4",f1);const rhe=ri(Ey).setParameterLength(2),ihe=(n,e)=>new Xde(Hn(n),e),oVe=(n,e)=>new Yde(Hn(n),e);Ut("element",rhe);Ut("convert",ihe);const lVe=n=>(an("TSL: append() has been renamed to Stack().",new ho),lR(n));Ut("append",n=>(an("TSL: .append() has been renamed to .toStack().",new ho),lR(n)));class Xi extends cr{static get type(){return"PropertyNode"}constructor(e,t=null,r=!1,i=null){super(e),this.name=t,this.varying=r,this.placeholderNode=Hn(i),this.isPropertyNode=!0,this.global=!0}getNodeType(e){const t=super.getNodeType(e);return t==="output"?e.getOutputType():t}customCacheKey(){return E_(this.type+":"+(this.name||"")+":"+(this.varying?"1":"0"))}getHash(e){return this.name||super.getHash(e)}generate(e){let t;if(this.varying===!0)t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0;else if(t=e.getVarFromNode(this,this.name),this.placeholderNode!==null&&e.hasWriteUsage(this)===!1){const r=this.placeholderNode.build(e,this.getNodeType(e));e.addLineFlowCode(`${e.getPropertyName(t)} = ${r}`,this)}return e.getPropertyName(t)}}const fg=(n,e,t=null)=>new Xi(n,e,!1,t),Ny=(n,e,t=null)=>new Xi(n,e,!0,t),As=Pn(Xi,"vec4","DiffuseColor"),Jx=Pn(Xi,"vec3","DiffuseContribution"),UF=Pn(Xi,"vec3","EmissiveColor"),e0=Pn(Xi,"float","Roughness"),Fm=Pn(Xi,"float","Metalness"),Tk=Pn(Xi,"float","Clearcoat"),jb=Pn(Xi,"float","ClearcoatRoughness"),Cd=Pn(Xi,"vec3","Sheen"),NA=Pn(Xi,"float","SheenRoughness"),uR=Pn(Xi,"float","Iridescence"),Ek=Pn(Xi,"float","IridescenceIOR"),Ck=Pn(Xi,"float","IridescenceThickness"),Nk=Pn(Xi,"float","AlphaT"),_A=Pn(Xi,"float","Anisotropy"),y4=Pn(Xi,"vec3","AnisotropyT"),Fv=Pn(Xi,"vec3","AnisotropyB"),R1=Pn(Xi,"color","SpecularColor"),mv=Pn(Xi,"color","SpecularColorBlended"),gv=Pn(Xi,"float","SpecularF90"),Mk=Pn(Xi,"float","Shininess"),Ib=Pn(Xi,"output","Output"),Uv=Pn(Xi,"float","dashSize"),U5=Pn(Xi,"float","gapSize"),cVe=Pn(Xi,"float","pointWidth"),b4=Pn(Xi,"float","IOR"),kk=Pn(Xi,"float","Transmission"),Bz=Pn(Xi,"float","Thickness"),Vz=Pn(Xi,"float","AttenuationDistance"),zz=Pn(Xi,"color","AttenuationColor"),Gz=Pn(Xi,"float","Dispersion"),BF=Pn(Xi,"float","AmbientOcclusion",!1,1);class she extends cr{static get type(){return"UniformGroupNode"}constructor(e,t=!1,r=1,i=null){super("string"),this.name=e,this.shared=t,this.order=r,this.updateType=i,this.isUniformGroup=!0}update(){this.needsUpdate=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const ahe=(n,e=1,t=null)=>new she(n,!1,e,t),dR=(n,e=0,t=null)=>new she(n,!0,e,t),uVe=dR("frame",0,Tr.FRAME),lr=dR("render",0,Tr.RENDER),ohe=ahe("object",1,Tr.OBJECT);class RT extends Mz{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=ohe}setName(e){return this.name=e,this}label(e){return an('TSL: "label()" has been deprecated. Use "setName()" instead.',new ho),this.setName(e)}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}
4288onUpdate(e,t){return e=e.bind(this),super.onUpdate(r=>{const i=e(r,this);i!==void 0&&(this.value=i)},t)}getInputType(e){let t=super.getInputType(e);return t==="bool"&&(t="uint"),t}generate(e,t){const r=this.getNodeType(e),i=this.getUniformHash(e);let s=e.getNodeFromHash(i);s===void 0&&(e.setHashNode(this,i),s=this);const a=s.getInputType(e),o=e.getUniformFromNode(s,a,e.shaderStage,this.name||e.context.nodeName),l=e.getPropertyName(o);e.context.nodeName!==void 0&&delete e.context.nodeName;let u=l;if(r==="bool"){const d=e.getDataFromNode(this);let h=d.propertyName;if(h===void 0){const f=e.getVarFromNode(this,null,"bool");h=e.getPropertyName(f),d.propertyName=h,u=e.format(l,a,r),e.addLineFlowCode(`${h} = ${u}`,this)}u=h}return e.format(u,r,t)}}const Qn=(n,e)=>{const t=Jde(e||n);if(t===n&&(n=Nz(t)),n&&n.isNode===!0){let r=n.value;n.traverse(i=>{i.isConstNode===!0&&(r=i.value)}),n=r}return new RT(n,t)};class GZ extends za{static get type(){return"ArrayNode"}constructor(e,t,r=null){super(e),this.count=t,this.values=r,this.isArrayNode=!0}getArrayCount(){return this.count}generateNodeType(e){return this.nodeType===null?this.values[0].getNodeType(e):this.nodeType}getElementType(e){return this.getNodeType(e)}getMemberType(e,t){return this.nodeType===null?this.values[0].getMemberType(e,t):super.getMemberType(e,t)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const lhe=(...n)=>{let e;if(n.length===1){const t=n[0];e=new GZ(null,t.length,t)}else{const t=n[0],r=n[1];e=new GZ(t,r)}return Hn(e)};Ut("toArray",(n,e)=>lhe(Array(e).fill(n)));class dVe extends za{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t,this.isAssignNode=!0}hasDependencies(){return!1}generateNodeType(e,t){return t!=="void"?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(e.isAvailable("swizzleAssign")===!1&&t.isSplitNode&&t.components.length>1){const r=e.getTypeLength(t.node.getNodeType(e));return Ty.join("").slice(0,r)!==t.components}return!1}setup(e){const{targetNode:t,sourceNode:r}=this,i=t.getScope(),s=e.getDataFromNode(i);s.assign=!0;const a=e.getNodeProperties(this);a.sourceNode=r,a.targetNode=t.context({assign:!0})}generate(e,t){const{targetNode:r,sourceNode:i}=e.getNodeProperties(this),s=this.needsSplitAssign(e),a=r.build(e),o=r.getNodeType(e),l=i.build(e,o),u=i.getNodeType(e),d=e.getDataFromNode(this);let h;if(d.initialized===!0)t!=="void"&&(h=a);else if(s){const f=e.getVarFromNode(this,null,o),p=e.getPropertyName(f);e.addLineFlowCode(`${p} = ${l}`,this);const g=r.node,x=g.node.context({assign:!0}).build(e);for(let b=0;b<g.components.length;b++){const _=g.components[b];e.addLineFlowCode(`${x}.${_} = ${p}[ ${b} ]`,this)}t!=="void"&&(h=a)}else h=`${a} = ${l}`,(t==="void"||u==="void")&&(e.addLineFlowCode(h,this),t!=="void"&&(h=a));return d.initialized=!0,e.format(h,o,t)}}const che=ri(dVe).setParameterLength(2);Ut("assign",che);class hVe extends za{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}generateNodeType(e){return this.functionNode.getNodeType(e)}getMemberType(e,t){return this.functionNode.getMemberType(e,t)}generate(e){const t=[],r=this.functionNode,i=r.getInputs(e),s=this.parameters,a=(l,u)=>{const d=u.type,h=d==="pointer";let f;return h?f="&"+l.build(e):f=l.build(e,d),f};if(Array.isArray(s)){if(s.length>i.length)sn("TSL: The number of provided parameters exceeds the expected number of inputs in 'Fn()'."),s.length=i.length;else if(s.length<i.length)for(sn("TSL: The number of provided parameters is less than the expected number of inputs in 'Fn()'.");s.length<i.length;)s.push(Ie(0));for(let l=0;l<s.length;l++)t.push(a(s[l],i[l]))}else for(const l of i){const u=s[l.name];u!==void 0?t.push(a(u,l)):(sn(`TSL: Input '${l.name}' not found in 'Fn()'.`),t.push(a(Ie(0),l)))}return`${r.build(e,"property")}( ${t.join(", ")} )`}}const uhe=(n,...e)=>(e=e.length>1||e[0]&&e[0].isNode===!0?Iv(e):oR(e[0]),new hVe(Hn(n),e));Ut("call",uhe);const fVe={"==":"equal","!=":"notEqual","<":"lessThan",">":"greaterThan","<=":"lessThanEqual",">=":"greaterThanEqual","%":"mod"};class Ca extends za{static get type(){return"OperatorNode"}constructor(e,t,r,...i){if(super(),i.length>0){let s=new Ca(e,t,r);for(let a=0;a<i.length-1;a++)s=new Ca(e,s,i[a]);t=s,r=i[i.length-1]}this.op=e,this.aNode=t,this.bNode=r,this.isOperatorNode=!0}getOperatorMethod(e,t){return e.getMethod(fVe[this.op],t)}generateNodeType(e,t=null){const r=this.op,i=this.aNode,s=this.bNode,a=i.getNodeType(e),o=s?s.getNodeType(e):null;if(a==="void"||o==="void")return t||"void";if(r==="%")return a;
4288if(r==="~"||r==="&"||r==="|"||r==="^"||r===">>"||r==="<<")return e.getIntegerType(a);if(r==="&&"||r==="||"||r==="^^")return"bool";if(r==="!"){const l=e.getTypeLength(a);return l>1?`bvec${l}`:"bool"}else if(r==="=="||r==="!="||r==="<"||r===">"||r==="<="||r===">="){const l=Math.max(e.getTypeLength(a),e.getTypeLength(o));return l>1?`bvec${l}`:"bool"}else{if(e.isMatrix(a)){if(o==="float")return a;if(e.isVector(o))return e.getVectorFromMatrix(a);if(e.isMatrix(o))return a}else if(e.isMatrix(o)){if(a==="float")return o;if(e.isVector(a))return e.getVectorFromMatrix(o)}return e.getTypeLength(o)>e.getTypeLength(a)?o:a}}generate(e,t){const r=this.op,{aNode:i,bNode:s}=this,a=this.getNodeType(e,t);let o=null,l=null;a!=="void"?(o=i.getNodeType(e),l=s?s.getNodeType(e):null,r==="<"||r===">"||r==="<="||r===">="||r==="=="||r==="!="?e.isVector(o)?l=o:e.isVector(l)?o=l:o!==l&&(o=l="float"):r===">>"||r==="<<"?(o=a,l=e.changeComponentType(l,"uint")):r==="%"?(o=a,l=e.isInteger(o)&&e.isInteger(l)?l:o):e.isMatrix(o)?l==="float"?l="float":e.isVector(l)?l=e.getVectorFromMatrix(o):e.isMatrix(l)||(o=l=a):e.isMatrix(l)?o==="float"?o="float":e.isVector(o)?o=e.getVectorFromMatrix(l):o=l=a:o=l=a):o=l=a;const u=i.build(e,o),d=s?s.build(e,l):null,h=e.getFunctionOperator(r);if(t!=="void"){const f=e.renderer.coordinateSystem===fu;if(r==="=="||r==="!="||r==="<"||r===">"||r==="<="||r===">=")return f?e.isVector(o)?e.format(`${this.getOperatorMethod(e,t)}( ${u}, ${d} )`,a,t):e.format(`( ${u} ${r} ${d} )`,a,t):e.format(`( ${u} ${r} ${d} )`,a,t);if(r==="%")return e.isInteger(l)?e.format(`( ${u} % ${d} )`,a,t):e.format(`${this.getOperatorMethod(e,a)}( ${u}, ${d} )`,a,t);if(r==="!")return f&&e.isVector(o)?e.format(`not( ${u} )`,t):e.format(`( ${r} ${u} )`,o,t);if(r==="~")return e.format(`( ${r} ${u} )`,o,t);if(h)return e.format(`${h}( ${u}, ${d} )`,a,t);if(e.isMatrix(o)&&l==="float")return e.format(`( ${d} ${r} ${u} )`,a,t);if(o==="float"&&e.isMatrix(l))return e.format(`${u} ${r} ${d}`,a,t);{let p=`( ${u} ${r} ${d} )`;return!f&&a==="bool"&&e.isVector(o)&&e.isVector(l)&&(p=`all${p}`),e.format(p,a,t)}}else if(o!=="void")return h?e.format(`${h}( ${u}, ${d} )`,a,t):e.isMatrix(o)&&l==="float"?e.format(`${d} ${r} ${u}`,a,t):e.format(`${u} ${r} ${d}`,a,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const fo=mn(Ca,"+").setParameterLength(2,1/0).setName("add"),Ei=mn(Ca,"-").setParameterLength(2,1/0).setName("sub"),Pr=mn(Ca,"*").setParameterLength(2,1/0).setName("mul"),nh=mn(Ca,"/").setParameterLength(2,1/0).setName("div"),hR=mn(Ca,"%").setParameterLength(2).setName("mod"),dhe=mn(Ca,"==").setParameterLength(2).setName("equal"),hhe=mn(Ca,"!=").setParameterLength(2).setName("notEqual"),fhe=mn(Ca,"<").setParameterLength(2).setName("lessThan"),qz=mn(Ca,">").setParameterLength(2).setName("greaterThan"),phe=mn(Ca,"<=").setParameterLength(2).setName("lessThanEqual"),mhe=mn(Ca,">=").setParameterLength(2).setName("greaterThanEqual"),ghe=mn(Ca,"&&").setParameterLength(2,1/0).setName("and"),Ahe=mn(Ca,"||").setParameterLength(2,1/0).setName("or"),xhe=mn(Ca,"!").setParameterLength(1).setName("not"),vhe=mn(Ca,"^^").setParameterLength(2).setName("xor"),yhe=mn(Ca,"&").setParameterLength(2).setName("bitAnd"),bhe=mn(Ca,"~").setParameterLength(1).setName("bitNot"),whe=mn(Ca,"|").setParameterLength(2).setName("bitOr"),_he=mn(Ca,"^").setParameterLength(2).setName("bitXor"),She=mn(Ca,"<<").setParameterLength(2).setName("shiftLeft"),The=mn(Ca,">>").setParameterLength(2).setName("shiftRight"),Ehe=ut(([n])=>(n.addAssign(1),n)),Che=ut(([n])=>(n.subAssign(1),n)),Nhe=ut(([n])=>{const e=st(n).toConst();return n.addAssign(1),e}),Mhe=ut(([n])=>{const e=st(n).toConst();return n.subAssign(1),e});Ut("add",fo);Ut("sub",Ei);Ut("mul",Pr);Ut("div",nh);Ut("mod",hR);Ut("equal",dhe);Ut("notEqual",hhe);Ut("lessThan",fhe);Ut("greaterThan",qz);Ut("lessThanEqual",phe);Ut("greaterThanEqual",mhe);Ut("and",ghe);Ut("or",Ahe);Ut("not",xhe);Ut("xor",vhe);Ut("bitAnd",yhe);Ut("bitNot",bhe);Ut("bitOr",whe);Ut("bitXor",_he);Ut("shiftLeft",She);Ut("shiftRight",The);Ut("incrementBefore",Ehe);Ut("decrementBefore",Che);Ut("increment",Nhe);Ut("decrement",Mhe);class _t extends za{static get type(){return"MathNode"}constructor(e,t,r=null,i=null){if(super(),(e===_t.MAX||e===_t.MIN)&&arguments.length>3){let s=new _t(e,t,r);for(let a=3;a<arguments.length-1;a++)s=new _t(e,s,arguments[a]);t=s,r=arguments[arguments.length-1],i=null}this.method=e,this.aNode=t,this.bNode=r,this.cNode=i,this.isMathNode=!0}getInputType(e){const t=this.aNode.getNodeType(e),r=this.bNode?this.bNode.getNodeType(e):null,i=this.cNode?this.cNode.getNodeType(e):null,s=e.isMatrix(t)?0:e.getTypeLength(t),a=e.isMatrix(r)?0:e.getTypeLength(r),o=e.isMatrix(i)?0:e.getTypeLength(i);return s>a&&s>o?t:a>o?r:o>s?i:t}generateNodeType(e){const t=this.method;return t===_t.LENGTH||t===_t.DISTANCE||t===_t.DOT?"float":t===_t.CROSS?"vec3":t===_t.ALL||t===_t.ANY?"bool":t===_t.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):this.getInputType(e)}setup(e){const{aNode:t,bNode:r,method:i}=this;let s=null;if(i===_t.ONE_MINUS)s=Ei(1,t);else if(i===_t.RECIPROCAL)s=nh(1,t);else if(i===_t.DIFFERENCE)s=zs(Ei(t,r));else if(i===_t.TRANSFORM_DIRECTION){let a,o;e.isMatrix(t.getNodeType(e))?(a=t,o=r):(a=r,o=t),s=_c(Pr(a,Vn(ct(o),0)).xyz)}return s!==null?s:super.setup(e)}generate(e,t){if(e.getNodeProperties(this).outputNode)return super.generate(e,t);let i=this.method;const s=this.getNodeType(e),a=this.getInputType(e),o=this.aNode,l=this.bNode,u=this.cNode,d=e.renderer.coordinateSystem;if(i===_t.NEGATE)return e.format("( - "+o.build(e,a)+" )",s,t);{const h=[];return i===_t.CROSS?h.push(o.build(e,s),l.build(e,s)):d===fu&&i===_t.STEP?h.push(o.build(e,e.getTypeLength(o.getNodeType(e))===1?"float":a),l.build(e,a)):d===fu&&(i===_t.MIN||i===_t.MAX)?h.push(o.build(e,a),l.build(e,e.getTypeLength(l.getNodeType(e))===1?"float":a)):i===_t.REFRACT?h.push(o.build(e,a),l.build(e,a),u.build(e,"float")):i===_t.MIX?h.push(o.build(e,a),l.build(e,a),u.build(e,e.getTypeLength(u.getNodeType(e))===1?"float":a)):(d===qh&&i===_t.ATAN&&l!==null&&(i="atan2"),e.shaderStage!=="fragment"&&(i===_t.DFDX||i===_t.DFDY)&&(an(`TSL: '${i}' is not supported in the ${e.shaderStage} stage.`,this.stackTrace),i="/*"+i+"*/"),h.push(o.build(e,a)),l!==null&&h.push(l.build(e,a)),u!==null&&h.push(u.build(e,a))),e.format(`${e.getMethod(i,s)}( ${h.join(", ")} )`,s,t)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}_t.ALL="all";_t.ANY="any";
vendor: 5,374 bytes, line 4288
4288_t.RADIANS="radians";_t.DEGREES="degrees";_t.EXP="exp";_t.EXP2="exp2";_t.LOG="log";_t.LOG2="log2";_t.SQRT="sqrt";_t.INVERSE_SQRT="inversesqrt";_t.FLOOR="floor";_t.CEIL="ceil";_t.NORMALIZE="normalize";_t.FRACT="fract";_t.SIN="sin";_t.SINH="sinh";_t.COS="cos";_t.COSH="cosh";_t.TAN="tan";_t.TANH="tanh";_t.ASIN="asin";_t.ASINH="asinh";_t.ACOS="acos";_t.ACOSH="acosh";_t.ATAN="atan";_t.ATANH="atanh";_t.ABS="abs";_t.SIGN="sign";_t.LENGTH="length";_t.NEGATE="negate";_t.ONE_MINUS="oneMinus";_t.DFDX="dFdx";_t.DFDY="dFdy";_t.ROUND="round";_t.RECIPROCAL="reciprocal";_t.TRUNC="trunc";_t.FWIDTH="fwidth";_t.TRANSPOSE="transpose";_t.DETERMINANT="determinant";_t.INVERSE="inverse";_t.EQUALS="equals";_t.MIN="min";_t.MAX="max";_t.STEP="step";_t.REFLECT="reflect";_t.DISTANCE="distance";_t.DIFFERENCE="difference";_t.DOT="dot";_t.CROSS="cross";_t.POW="pow";_t.TRANSFORM_DIRECTION="transformDirection";_t.MIX="mix";_t.CLAMP="clamp";_t.REFRACT="refract";_t.SMOOTHSTEP="smoothstep";_t.FACEFORWARD="faceforward";const fR=Ie(1e-6),pVe=Ie(1e6),Rk=Ie(Math.PI),mVe=Ie(Math.PI*2),gVe=Ie(Math.PI*2),AVe=Ie(Math.PI*.5),khe=mn(_t,_t.ALL).setParameterLength(1),Rhe=mn(_t,_t.ANY).setParameterLength(1),Phe=mn(_t,_t.RADIANS).setParameterLength(1),Lhe=mn(_t,_t.DEGREES).setParameterLength(1),$z=mn(_t,_t.EXP).setParameterLength(1),Zw=mn(_t,_t.EXP2).setParameterLength(1),pR=mn(_t,_t.LOG).setParameterLength(1),y0=mn(_t,_t.LOG2).setParameterLength(1),gu=mn(_t,_t.SQRT).setParameterLength(1),Hz=mn(_t,_t.INVERSE_SQRT).setParameterLength(1),b0=mn(_t,_t.FLOOR).setParameterLength(1),mR=mn(_t,_t.CEIL).setParameterLength(1),_c=mn(_t,_t.NORMALIZE).setParameterLength(1),rp=mn(_t,_t.FRACT).setParameterLength(1),ou=mn(_t,_t.SIN).setParameterLength(1),Ohe=mn(_t,_t.SINH).setParameterLength(1),If=mn(_t,_t.COS).setParameterLength(1),Dhe=mn(_t,_t.COSH).setParameterLength(1),jhe=mn(_t,_t.TAN).setParameterLength(1),Ihe=mn(_t,_t.TANH).setParameterLength(1),Fhe=mn(_t,_t.ASIN).setParameterLength(1),Uhe=mn(_t,_t.ASINH).setParameterLength(1),Wz=mn(_t,_t.ACOS).setParameterLength(1),Bhe=mn(_t,_t.ACOSH).setParameterLength(1),Xz=mn(_t,_t.ATAN).setParameterLength(1,2),Vhe=mn(_t,_t.ATANH).setParameterLength(1),zs=mn(_t,_t.ABS).setParameterLength(1),Yz=mn(_t,_t.SIGN).setParameterLength(1),w0=mn(_t,_t.LENGTH).setParameterLength(1),Qz=mn(_t,_t.NEGATE).setParameterLength(1),zhe=mn(_t,_t.ONE_MINUS).setParameterLength(1),Kz=mn(_t,_t.DFDX).setParameterLength(1),Zz=mn(_t,_t.DFDY).setParameterLength(1),Ghe=mn(_t,_t.ROUND).setParameterLength(1),qhe=mn(_t,_t.RECIPROCAL).setParameterLength(1),Jz=mn(_t,_t.TRUNC).setParameterLength(1),eG=mn(_t,_t.FWIDTH).setParameterLength(1),$he=mn(_t,_t.TRANSPOSE).setParameterLength(1),Hhe=mn(_t,_t.DETERMINANT).setParameterLength(1),Whe=mn(_t,_t.INVERSE).setParameterLength(1),td=mn(_t,_t.MIN).setParameterLength(2,1/0),Na=mn(_t,_t.MAX).setParameterLength(2,1/0),oy=mn(_t,_t.STEP).setParameterLength(2),Xhe=mn(_t,_t.REFLECT).setParameterLength(2),Yhe=mn(_t,_t.DISTANCE).setParameterLength(2),Qhe=mn(_t,_t.DIFFERENCE).setParameterLength(2),Wh=mn(_t,_t.DOT).setParameterLength(2),ag=mn(_t,_t.CROSS).setParameterLength(2),Ih=mn(_t,_t.POW).setParameterLength(2),tG=n=>Pr(n,n),Khe=n=>Pr(n,n,n),nG=n=>Pr(n,n,n,n),Zhe=mn(_t,_t.TRANSFORM_DIRECTION).setParameterLength(2),Jhe=(n,e)=>_c(Pr(e,Vn(ct(n),0)).xyz),efe=(n,e)=>_c(Vn(ct(n),0).mul(e).xyz),tfe=n=>Pr(Yz(n),Ih(zs(n),1/3)),rG=n=>Wh(n,n),ui=mn(_t,_t.MIX).setParameterLength(3),ip=(n,e=0,t=1)=>new _t(_t.CLAMP,Hn(n),Hn(e),Hn(t)),gR=n=>ip(n),iG=mn(_t,_t.REFRACT).setParameterLength(3),rh=mn(_t,_t.SMOOTHSTEP).setParameterLength(3),sG=mn(_t,_t.FACEFORWARD).setParameterLength(3),nfe=ut(([n])=>{const r=43758.5453,i=Wh(n.xy,Cn(12.9898,78.233)),s=hR(i,Rk);return rp(ou(s).mul(r))}),rfe=(n,e,t)=>ui(e,t,n),ife=(n,e,t)=>rh(e,t,n),sfe=(n,e)=>oy(e,n),xVe=sG,vVe=Hz;Ut("all",khe);Ut("any",Rhe);Ut("radians",Phe);Ut("degrees",Lhe);Ut("exp",$z);Ut("exp2",Zw);Ut("log",pR);Ut("log2",y0);Ut("sqrt",gu);Ut("inverseSqrt",Hz);Ut("floor",b0);Ut("ceil",mR);Ut("normalize",_c);Ut("fract",rp);Ut("sin",ou);Ut("sinh",Ohe);Ut("cos",If);Ut("cosh",Dhe);Ut("tan",jhe);Ut("tanh",Ihe);Ut("asin",Fhe);Ut("asinh",Uhe);Ut("acos",Wz);Ut("acosh",Bhe);Ut("atan",Xz);Ut("atanh",Vhe);Ut("abs",zs);Ut("sign",Yz);Ut("length",w0);Ut("lengthSq",rG);Ut("negate",Qz);Ut("oneMinus",zhe);Ut("dFdx",Kz);Ut("dFdy",Zz);Ut("round",Ghe);Ut("reciprocal",qhe);Ut("trunc",Jz);Ut("fwidth",eG);Ut("min",td);Ut("max",Na);Ut("step",sfe);Ut("reflect",Xhe);Ut("distance",Yhe);Ut("dot",Wh);Ut("cross",ag);Ut("pow",Ih);Ut("pow2",tG);Ut("pow3",Khe);Ut("pow4",nG);Ut("transformDirection",Zhe);Ut("transformNormalByViewMatrix",Jhe);Ut("transformNormalByInverseViewMatrix",efe);Ut("mix",rfe);Ut("clamp",ip);Ut("refract",iG);Ut("smoothstep",ife);Ut("faceForward",sG);Ut("difference",Qhe);Ut("saturate",gR);Ut("cbrt",tfe);Ut("transpose",$he);Ut("determinant",Hhe);Ut("inverse",Whe);Ut("rand",nfe);class yVe extends cr{static get type(){return"ConditionalNode"}constructor(e,t,r=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=r}generateNodeType(e){const{ifNode:t,elseNode:r}=e.getNodeProperties(this);if(t===void 0)return e.flowBuildStage(this,"setup"),this.getNodeType(e);const i=t.getNodeType(e);if(r!==null){const s=r.getNodeType(e);if(e.getTypeLength(s)>e.getTypeLength(i))return s}return i}setup(e){const t=this.condNode,r=this.ifNode.isolate(),i=this.elseNode?this.elseNode.isolate():null,
4288s=e.context.nodeBlock;e.getDataFromNode(r).parentNodeBlock=s,i!==null&&(e.getDataFromNode(i).parentNodeBlock=s);const a=e.context.uniformFlow,o=e.getNodeProperties(this);o.condNode=t,o.ifNode=a?r:r.context({nodeBlock:r}),o.elseNode=i?a?i:i.context({nodeBlock:i}):null}generate(e,t){const r=this.getNodeType(e),i=e.getDataFromNode(this);if(i.nodeProperty!==void 0)return i.nodeProperty;const{condNode:s,ifNode:a,elseNode:o}=e.getNodeProperties(this),l=e.currentFunctionNode,u=t!=="void",d=u?fg(r).build(e):"";i.nodeProperty=d;const h=s.build(e,"bool");if(e.context.uniformFlow&&o!==null){const g=a.build(e,r),A=o.build(e,r),x=e.getTernary(h,g,A);return e.format(x,r,t)}e.addFlowCode(` 4289${e.tab}if ( ${h} ) { 4290 4291`).addFlowTab();let p=a.build(e,r);if(p&&(u?p=d+" = "+p+";":(p="return "+p+";",l===null&&(an("TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values.",this.stackTrace),p="// "+p))),e.removeFlowTab().addFlowCode(e.tab+" "+p+` 4292 4293`+e.tab+"}"),o!==null){e.addFlowCode(` else { 4294 4295`).addFlowTab();let g=o.build(e,r);g&&(u?g=d+" = "+g+";":(g="return "+g+";",l===null&&(an("TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values.",this.stackTrace),g="// "+g))),e.removeFlowTab().addFlowCode(e.tab+" "+g+` 4296 4297`+e.tab+`} 4298 4299`)}else e.addFlowCode(` 4300 4301`);return e.format(d,r,t)}}const yc=ri(yVe).setParameterLength(2,3);Ut("select",yc);class aG extends cr{static get type(){return"ContextNode"}constructor(e=null,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}generateNodeType(e){return this.node.getNodeType(e)}getFlowContextData(){const e=[];return this.traverse(t=>{t.isContextNode===!0&&e.push(t.value)}),Object.assign({},...e)}getMemberType(e,t){return this.node.getMemberType(e,t)}analyze(e){const t=e.addContext(this.value);this.node.build(e),e.setContext(t)}setup(e){const t=e.addContext(this.value);this.node.build(e),e.setContext(t)}generate(e,t){const r=e.addContext(this.value),i=this.node.build(e,t);return e.setContext(r),i}}const pg=(n=null,e={})=>{let t=n;return(t===null||t.isNode!==!0)&&(e=t||e,t=null),new aG(t,e)},afe=n=>pg(n,{uniformFlow:!0}),oG=(n,e)=>pg(n,{nodeName:e});function ofe(n,e,t=null){return pg(t,{getShadow:({light:r,shadowColorNode:i})=>e===r?i.mul(n):i})}function lfe(n,e=null){return pg(e,{getAO:(t,{material:r})=>r.transparent===!0?t:t!==null?t.mul(n):n})}function cfe(n,e){return an('TSL: "label()" has been deprecated. Use "setName()" instead.'),oG(n,e)}Ut("context",pg);Ut("label",cfe);Ut("uniformFlow",afe);Ut("setName",oG);Ut("builtinShadowContext",(n,e,t)=>ofe(e,t,n));Ut("builtinAOContext",(n,e)=>lfe(e,n));class T6 extends cr{static get type(){return"VarNode"}constructor(e,t=null,r=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=r,this.parents=!0,this.intent=!1}setIntent(e){return this.intent=e,this}isIntent(e){return e.getDataFromNode(this).forceDeclaration===!0?!1:this.intent}getIntent(){return this.intent}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}generateNodeType(e){return this.node.getNodeType(e)}getArrayCount(e){return this.node.getArrayCount(e)}isAssign(e){return e.getDataFromNode(this).assign}build(...e){const t=e[0],r=this.getShared(t);if(this!==r)return r.build(...e);if(this._hasStack(t)===!1&&t.buildStage==="setup"&&(t.context.nodeLoop||t.context.nodeBlock)){let i=!1;if(this.node.isShaderCallNodeInternal&&this.node.shaderNode.getLayout()===null&&t.fnCall&&t.fnCall.shaderNode&&t.getDataFromNode(this.node.shaderNode).hasLoop){const o=t.getDataFromNode(this);o.forceDeclaration=!0,i=!0}const s=t.getBaseStack();i?s.addToStackBefore(this):s.addToStack(this)}return this.isIntent(t)&&this.isAssign(t)!==!0?this.node.build(...e):super.build(...e)}generate(e){const{node:t,name:r,readOnly:i}=this,{renderer:s}=e,a=s.backend.isWebGPUBackend===!0;let o=!1,l=!1;i&&(o=e.isDeterministic(t),l=a?i:o);const u=this.getNodeType(e);if(u=="void")return this.isIntent(e)!==!0&&sn('TSL: ".toVar()" can not be used with void type.',this.stackTrace),t.build(e);const d=e.getVectorType(u),h=t.build(e,d),f=e.getVarFromNode(this,r,d,void 0,l),p=e.getPropertyName(f);let g=p;if(l)if(a)g=o?`const ${p}`:`let ${p}`;else{const A=t.getArrayCount(e);g=`const ${e.getVar(f.type,p,A)}`}return e.addLineFlowCode(`${g} = ${h}`,this),p}_hasStack(e){return e.getDataFromNode(this).stack!==void 0}}const lG=ri(T6),ufe=(n,e=null)=>lG(n,e).toStack(),dfe=(n,e=null)=>lG(n,e,!0).toStack(),hfe=n=>lG(n).setIntent(!0).toStack();Ut("toVar",ufe);Ut("toConst",dfe);Ut("toVarIntent",hfe);class bVe extends cr{static get type(){return"SubBuild"}constructor(e,t,r=null){super(r),this.node=e,this.name=t,this.isSubBuildNode=!0}generateNodeType(e){if(this.nodeType!==null)return this.nodeType;e.addSubBuild(this.name);const t=this.node.getNodeType(e);return e.removeSubBuild(),t}build(e,...t){e.addSubBuild(this.name);const r=this.node.build(e,...t);return e.removeSubBuild(),r}}const Bv=(n,e,t=null)=>new bVe(Hn(n),e,t);class wVe extends cr{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=Bv(e,"VERTEX"),this.name=t,this.isVaryingNode=!0,this.interpolationType=null,this.interpolationSampling=null,this.global=!0}setInterpolation(e,t=null){return this.interpolationType=e,this.interpolationSampling=t,this}getHash(e){return this.name||super.getHash(e)}generateNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let r=t.varying;if(r===void 0){const i=this.name,s=this.getNodeType(e),a=this.interpolationType,o=this.interpolationSampling;t.varying=r=e.getVaryingFromNode(this,i,s,a,o),t.node=Bv(this.node,"VERTEX")}return r.needsInterpolation||(r.needsInterpolation=e.shaderStage==="fragment"),r}setup(e){this.setupVarying(e),e.flowNodeFromShaderStage(nb.VERTEX,this.node)}analyze(e){this.setupVarying(e),e.flowNodeFromShaderStage(nb.VERTEX,this.node)}generate(e){const t=e.getSubBuildProperty("property",e.currentStack),r=e.getNodeProperties(this),i=this.setupVarying(e);if(r[t]===void 0){const s=this.getNodeType(e),a=e.getPropertyName(i,nb.VERTEX);if(e.shaderStage===nb.VERTEX){const o=r.node.build(e,s);e.addLineFlowCode(`${a} = ${o}`,this)}else e.flowNodeFromShaderStage(nb.VERTEX,r.node,s,a);r[t]=a}return e.getPropertyName(i)}}const X1=ri(wVe).setParameterLength(1,2),ffe=n=>X1(n);Ut("toVarying",X1);Ut("toVertexStage",ffe);const pfe=ut(([n])=>{const e=n.mul(.9478672986).add(.0521327014).pow(2.4),t=n.mul(.0773993808),r=n.lessThanEqual(.04045);return ui(e,t,r)}
4301).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),mfe=ut(([n])=>{const e=n.pow(.41666).mul(1.055).sub(.055),t=n.mul(12.92),r=n.lessThanEqual(.0031308);return ui(e,t,r)}).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),cG="WorkingColorSpace",_Ve="OutputColorSpace";class uG extends za{static get type(){return"ColorSpaceNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.source=t,this.target=r}resolveColorSpace(e,t){return t===cG?_r.workingColorSpace:t===_Ve?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,r=this.resolveColorSpace(e,this.source),i=this.resolveColorSpace(e,this.target);let s=t;return _r.enabled===!1||r===i||!r||!i||(_r.getTransfer(r)===$n&&(s=Vn(pfe(s.rgb),s.a)),_r.getPrimaries(r)!==_r.getPrimaries(i)&&(s=Vn(gl(_r._getMatrix(new Gr,r,i)).mul(s.rgb),s.a)),_r.getTransfer(i)===$n&&(s=Vn(mfe(s.rgb),s.a))),s}}const gfe=(n,e)=>new uG(Hn(n),cG,e),AR=(n,e)=>new uG(Hn(n),e,cG),SVe=(n,e,t)=>new uG(Hn(n),e,t);Ut("workingToColorSpace",gfe);Ut("colorSpaceToWorking",AR);let TVe=class extends Ey{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}generateNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),i=this.getNodeType();return e.format(t,r,i)}};class Afe extends cr{static get type(){return"ReferenceBaseNode"}constructor(e,t,r=null,i=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=i,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.updateType=Tr.OBJECT}setGroup(e){return this.group=e,this}element(e){return new TVe(this,Hn(e))}setNodeType(e){const t=Qn(null,e);this.group!==null&&t.setGroup(this.group),this.node=t}generateNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let i=1;i<t.length;i++)r=r[t[i]];return r}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const EVe=(n,e,t)=>new Afe(n,e,t);class CVe extends Afe{static get type(){return"RendererReferenceNode"}constructor(e,t,r=null){super(e,t,r),this.renderer=r,this.setGroup(lr)}updateReference(e){return this.reference=this.renderer!==null?this.renderer:e.renderer,this.reference}}const xfe=(n,e,t=null)=>new CVe(n,e,t);class NVe extends za{static get type(){return"ToneMappingNode"}constructor(e,t=yfe,r=null){super("vec3"),this._toneMapping=e,this.exposureNode=t,this.colorNode=r}customCacheKey(){return x4(this._toneMapping)}setToneMapping(e){return this._toneMapping=e,this}getToneMapping(){return this._toneMapping}setup(e){const t=this.colorNode||e.context.color,r=this._toneMapping;if(r===Il)return t;let i=null;const s=e.renderer.library.getToneMappingFunction(r);return s!==null?i=Vn(s(t.rgb,this.exposureNode),t.a):(sn("ToneMappingNode: Unsupported Tone Mapping configuration.",r),i=t),i}}const vfe=(n,e,t)=>new NVe(n,Hn(e),Hn(t)),yfe=xfe("toneMappingExposure","float");Ut("toneMapping",(n,e,t)=>vfe(e,t,n));const qZ=new WeakMap;function $Z(n,e){let t=qZ.get(n);return t===void 0&&(t=new XV(n,e),qZ.set(n,t)),t}class iA extends Mz{static get type(){return"BufferAttributeNode"}constructor(e,t=null,r=0,i=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=r,this.bufferOffset=i,this.usage=Vw,this.instanced=!1,this.attribute=null,this.global=!0,e&&e.isBufferAttribute===!0&&e.itemSize<=4&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){let t;if(this.bufferStride===0&&this.bufferOffset===0){let r=e.globalCache.getData(this.value);r===void 0&&(r={node:this},e.globalCache.setData(this.value,r)),t=r.node.id}else t=this.id;return String(t)}generateNodeType(e){return this.bufferType===null&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(this.attribute!==null)return;const t=this.getNodeType(e),r=e.getTypeLength(t),i=this.value,s=this.bufferStride||r,a=this.bufferOffset;let o;i.isInterleavedBuffer===!0?o=i:i.isBufferAttribute===!0?o=$Z(i.array,s):o=$Z(i,s);const l=new l0(o,r,a);o.setUsage(this.usage),this.attribute=l,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),r=e.context.nodeName;r!==void 0&&delete e.context.nodeName;const i=e.getBufferAttributeFromNode(this,t,r),s=e.getPropertyName(i);let a=null;if(e.shaderStage==="vertex"||e.shaderStage==="compute")this.name=s,a=s;else{let o;r&&(o=r+"Varying"),a=X1(this,o).build(e,t)}return a}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&this.attribute.isBufferAttribute===!0&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}function xR(n,e=null,t=0,r=0,i=Vw,s=!1){return e==="mat3"||e===null&&n.itemSize===9?gl(new iA(n,"vec3",9,0).setUsage(i).setInstanced(s),new iA(n,"vec3",9,3).setUsage(i).setInstanced(s),new iA(n,"vec3",9,6).setUsage(i).setInstanced(s)):e==="mat4"||e===null&&n.itemSize===16?f1(new iA(n,"vec4",16,0).setUsage(i).setInstanced(s),new iA(n,"vec4",16,4).setUsage(i).setInstanced(s),new iA(n,"vec4",16,8).setUsage(i).setInstanced(s),new iA(n,"vec4",16,12).setUsage(i).setInstanced(s)):new iA(n,e,t,r).setUsage(i)}const dG=(n,e=null,t=0,r=0)=>xR(n,e,t,r),MVe=(n,e=null,t=0,r=0)=>xR(n,e,t,r,ST),vR=(n,e=null,t=0,r=0)=>xR(n,e,t,r,Vw,!0),hG=(n,e=null,t=0,r=0)=>xR(n,e,t,r,ST,!0);Ut("toAttribute",n=>dG(n.value));class fa extends cr{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),r=this.scope;let i;if(r===fa.VERTEX)i=e.getVertexIndex();else if(r===fa.INSTANCE)i=e.getInstanceIndex();else if(r===fa.DRAW)i=e.getDrawIndex();else if(r===fa.INVOCATION_LOCAL)i=e.getInvocationLocalIndex();
4301else if(r===fa.INVOCATION_SUBGROUP)i=e.getInvocationSubgroupIndex();else if(r===fa.SUBGROUP)i=e.getSubgroupIndex();else throw new Error("THREE.IndexNode: Unknown scope: "+r);let s;return e.shaderStage==="vertex"||e.shaderStage==="compute"?s=i:s=X1(this).build(e,t),s}}fa.VERTEX="vertex";fa.INSTANCE="instance";fa.SUBGROUP="subgroup";fa.INVOCATION_LOCAL="invocationLocal";fa.INVOCATION_SUBGROUP="invocationSubgroup";fa.DRAW="draw";const bfe=Pn(fa,fa.VERTEX),Zf=Pn(fa,fa.INSTANCE),kVe=Pn(fa,fa.SUBGROUP),RVe=Pn(fa,fa.INVOCATION_SUBGROUP),PVe=Pn(fa,fa.INVOCATION_LOCAL),wfe=Pn(fa,fa.DRAW);class LVe extends cr{static get type(){return"ComputeNode"}constructor(e,t){super("void"),this.isComputeNode=!0,this.computeNode=e,this.workgroupSize=t,this.count=null,this.dispatchSize=null,this.version=1,this.name="",this.updateBeforeType=Tr.OBJECT,this.onInitFunction=null,this.countNode=null}dispose(){this.dispatchEvent({type:"dispose"})}setName(e){return this.name=e,this}label(e){return an('TSL: "label()" has been deprecated. Use "setName()" instead.',new ho),this.setName(e)}onInit(e){return this.onInitFunction=e,this}updateBefore({renderer:e}){e.compute(this)}setup(e){this.count!==null&&this.countNode===null&&(this.countNode=Qn(this.count,"uint").onObjectUpdate(()=>this.count));const t=this.computeNode.build(e);if(t){const r=e.getNodeProperties(this);r.outputComputeNode=t.outputNode,t.outputNode=null}return t}generate(e,t){const{shaderStage:r}=e;if(r==="compute"){const i=this.computeNode.build(e,"void");if(i!==""&&e.addLineFlowCode(i,this),this.count!==null&&e.allowEarlyReturns===!0){const s=this.countNode.build(e,"uint"),a=Zf.build(e,"uint");e.flow.code=`${e.tab}if ( ${a} >= ${s} ) { return; } 4302 4303${e.flow.code}`}}else{const s=e.getNodeProperties(this).outputComputeNode;if(s)return s.build(e,t)}}}const fG=(n,e=[64])=>{(e.length===0||e.length>3)&&sn("TSL: compute() workgroupSize must have 1, 2, or 3 elements",new ho);for(let t=0;t<e.length;t++){const r=e[t];(typeof r!="number"||r<=0||!Number.isInteger(r))&&sn(`TSL: compute() workgroupSize element at index [ ${t} ] must be a positive integer`,new ho)}for(;e.length<3;)e.push(1);return new LVe(Hn(n),e)},_fe=(n,e,t)=>{const r=fG(n,t);return typeof e=="number"?r.count=e:r.dispatchSize=e,r};Ut("compute",_fe);Ut("computeKernel",fG);class OVe extends cr{static get type(){return"IsolateNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isIsolateNode=!0}generateNodeType(e){const t=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const i=this.node.getNodeType(e);return e.setCache(t),i}build(e,...t){const r=e.getCache(),i=e.getCacheFromNode(this,this.parent);e.setCache(i);const s=this.node.build(e,...t);return e.setCache(r),s}setParent(e){return this.parent=e,this}getParent(){return this.parent}}const Fb=n=>new OVe(Hn(n));function Sfe(n,e=!0){return an('TSL: "cache()" has been deprecated. Use "isolate()" instead.'),Fb(n).setParent(e)}Ut("cache",Sfe);Ut("isolate",Fb);class DVe extends cr{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}generateNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return t!==""&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}const Tfe=ri(DVe).setParameterLength(2);Ut("bypass",Tfe);const pG=ut(([n,e,t,r=Ie(0),i=Ie(1),s=th(!1)])=>{let a=n.sub(e).div(t.sub(e));return Kw(s)&&(a=a.clamp()),a.mul(i.sub(r)).add(r)});function Efe(n,e,t,r=Ie(0),i=Ie(1)){return pG(n,e,t,r,i,!0)}Ut("remap",pG);Ut("remapClamp",Efe);class E6 extends cr{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const r=this.getNodeType(e),i=this.snippet;if(r==="void")e.addLineFlowCode(i,this);else return e.format(i,r,t)}}const zd=ri(E6).setParameterLength(1,2),Cfe=n=>(n?yc(n,zd("discard")):zd("discard")).toStack(),jVe=()=>zd("return").toStack();Ut("discard",Cfe);const mG=ut(([n])=>Vn(n.rgb.mul(n.a),n.a),{color:"vec4",return:"vec4"}),Nfe=ut(([n])=>n.a.equal(0).select(Vn(0),Vn(n.rgb.div(n.a),n.a)),{color:"vec4",return:"vec4"});
4303class IVe extends za{static get type(){return"RenderOutputNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this._toneMapping=t,this.outputColorSpace=r,this.isRenderOutputNode=!0}setToneMapping(e){return this._toneMapping=e,this}getToneMapping(){return this._toneMapping}setup({context:e}){let t=this.colorNode||e.color;t=Vn(t.rgb,t.a.clamp(0,1)),t=Nfe(t);const r=(this._toneMapping!==null?this._toneMapping:e.toneMapping)||Il,i=(this.outputColorSpace!==null?this.outputColorSpace:e.outputColorSpace)||Iu;return r!==Il&&(t=t.toneMapping(r)),i!==Iu&&i!==_r.workingColorSpace&&(t=t.workingToColorSpace(i)),t=mG(t),t}}const gG=(n,e=null,t=null)=>new IVe(Hn(n),e,t);Ut("renderOutput",gG);class FVe extends za{static get type(){return"DebugNode"}constructor(e,t=null){super(),this.node=e,this.callback=t}generateNodeType(e){return this.node.getNodeType(e)}setup(e){return this.node.build(e)}analyze(e){return this.node.build(e)}generate(e){const t=this.callback,r=this.node.build(e);if(t!==null)t(e,r);else{const i="--- TSL debug - "+e.shaderStage+" shader ---",s="-".repeat(i.length);let a="";a+="// #"+i+`# 4304`,a+=e.flow.code.replace(/^\t/mg,"")+` 4305`,a+="/* ... */ "+r+` /* ... */ 4306`,a+="// #"+s+`# 4307`,w5(a)}return r}}const Mfe=(n,e=null)=>new FVe(Hn(n),e).toStack();Ut("debug",Mfe);class kfe extends ef{constructor(){super(),this._renderer=null,this.currentFrame=null}get nodeFrame(){return this._renderer._nodes.nodeFrame}setRenderer(e){return this._renderer=e,this}getRenderer(){return this._renderer}init(){}begin(){}finish(){}inspect(){}computeAsync(){}beginCompute(){}finishCompute(){}beginRender(){}finishRender(){}copyTextureToTexture(){}copyFramebufferToTexture(){}}class UVe extends cr{static get type(){return"InspectorNode"}constructor(e,t="",r=null){super(),this.node=e,this.name=t,this.callback=r,this.updateType=Tr.FRAME,this.isInspectorNode=!0}getName(){return this.name||this.node.name}update(e){e.renderer.inspector.inspect(this)}generateNodeType(e){return this.node.getNodeType(e)}setup(e){let t=this.node;return e.context.inspector===!0&&this.callback!==null&&(t=this.callback(t)),e.renderer.backend.isWebGPUBackend!==!0&&e.renderer.inspector.constructor!==kfe&&_i('TSL: ".toInspector()" is only available with WebGPU.'),t}}function Rfe(n,e="",t=null){return n=Hn(n),n.before(new UVe(n,e,t))}Ut("toInspector",Rfe);function BVe(n){an("TSL: AddNodeElement has been removed in favor of tree-shaking. Trying add",n)}class Pfe extends cr{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}generateNodeType(e){let t=this.nodeType;if(t===null){const r=this.getAttributeName(e);if(e.hasGeometryAttribute(r)){const i=e.geometry.getAttribute(r);t=e.getTypeFromAttribute(i)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),r=this.getNodeType(e);if(e.hasGeometryAttribute(t)===!0){const s=e.geometry.getAttribute(t),a=e.getTypeFromAttribute(s),o=e.getAttribute(t,a);return e.shaderStage==="vertex"?e.format(o.name,a,r):X1(this).build(e,r)}else return an(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(r)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const $d=(n,e=null)=>new Pfe(n,e),ws=(n=0)=>$d("uv"+(n>0?n:""),"vec2");class VVe extends cr{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const r=this.textureNode.build(e,"property"),i=this.levelNode===null?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${r}, ${i} )`,this.getNodeType(e),t)}}const ly=ri(VVe).setParameterLength(1,2);class zVe extends RT{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=Tr.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,r=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(r&&r.width!==void 0){const{width:i,height:s}=r;this.value=Math.log2(Math.max(i,s))}}}const AG=ri(zVe).setParameterLength(1);
4307class Lfe extends Error{constructor(e,t=null){super(e),this.name="NodeError",this.stackTrace=t}}const xG=new ko;class L0 extends RT{static get type(){return"TextureNode"}constructor(e=xG,t=null,r=null,i=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=r,this.biasNode=i,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.gatherNode=null,this.offsetNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=Tr.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this._flipYUniform=null,this.setUpdateMatrix(t===null)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}generateNodeType(){return this.value.isDepthTexture===!0?this.gatherNode===null?"float":"vec4":this.value.type===ts?"uvec4":this.value.type===oo?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return ws(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return this._matrixUniform===null&&(this._matrixUniform=Qn(this.value.matrix)),this._matrixUniform.mul(ct(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this}setupUV(e,t){return e.isFlipY()&&(this._flipYUniform===null&&(this._flipYUniform=Qn(!1)),t=t.toVar(),this.sampler?t=this._flipYUniform.select(t.flipY(),t):t=this._flipYUniform.select(t.setY(st(ly(this,this.levelNode).y).sub(t.y).sub(1)),t)),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const r=this.value;if(!r||r.isTexture!==!0)throw new Lfe("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().",this.stackTrace);const i=ut(()=>{let l=this.uvNode;return(l===null||e.context.forceUVContext===!0)&&e.context.getUV&&(l=e.context.getUV(this,e)),l||(l=this.getDefaultUV()),this.updateMatrix===!0&&(l=this.getTransformedUV(l)),l=this.setupUV(e,l),this.updateType=this._matrixUniform!==null||this._flipYUniform!==null?Tr.OBJECT:Tr.NONE,l})();let s=this.levelNode;s===null&&e.context.getTextureLevel&&(s=e.context.getTextureLevel(this));let a=null,o=null;if(this.compareNode!==null)if(e.renderer.hasCompatibility(_y.TEXTURE_COMPARE))a=this.compareNode;else{const l=r.compareFunction;l===null||l===W8||l===$1||l===y5||l===eg?o=this.compareNode:(a=this.compareNode,_i('TSL: Only "LessCompare", "LessEqualCompare", "GreaterCompare" and "GreaterEqualCompare" are supported for depth texture comparison fallback.'))}t.uvNode=i,t.levelNode=s,t.biasNode=this.biasNode,t.compareNode=a,t.compareStepNode=o,t.gradNode=this.gradNode,t.gatherNode=this.gatherNode,t.depthNode=this.depthNode,t.offsetNode=this.offsetNode}generateUV(e,t){return t.build(e,this.sampler===!0?"vec2":"ivec2")}generateOffset(e,t){return t.build(e,"ivec2")}generateSnippet(e,t,r,i,s,a,o,l,u,d,h){const f=this.value;let p;return s?p=e.generateTextureBias(f,t,r,s,a,d):l?p=e.generateTextureGrad(f,t,r,l,a,d):u?o?p=e.generateTextureGatherCompare(f,t,r,o,a,d,h):p=e.generateTextureGather(f,t,r,u,a,d,h):o?p=e.generateTextureCompare(f,t,r,o,a,d):this.sampler===!1?p=e.generateTextureLoad(f,t,r,i,a,d):i?p=e.generateTextureLevel(f,t,r,i,a,d):p=e.generateTexture(f,t,r,a,d),p}generate(e,t){const r=this.value,i=e.getNodeProperties(this),s=super.generate(e,"property");if(/^sampler/.test(t))return s+"_sampler";if(e.isReference(t))return s;{const a=e.getDataFromNode(this);let o=this.getNodeType(e),l=a.propertyName;if(l===void 0){const{uvNode:d,levelNode:h,biasNode:f,compareNode:p,compareStepNode:g,depthNode:A,gradNode:x,gatherNode:b,offsetNode:_}=i,M=this.generateUV(e,d),T=h?h.build(e,"float"):null,L=f?f.build(e,"float"):null,D=A?A.build(e,"int"):null,P=p?p.build(e,"float"):null,O=g?g.build(e,"float"):null,F=x?[x[0].build(e,"vec2"),x[1].build(e,"vec2")]:null,U=b?b.build(e,"int"):null,B=_?this.generateOffset(e,_):null,z=this._flipYUniform?this._flipYUniform.build(e,"bool"):null;U&&(o="vec4");let H=D;H===null&&r.isArrayTexture&&this.isTexture3DNode!==!0&&(H="0");const X=e.getVarFromNode(this);l=e.getPropertyName(X);let W=this.generateSnippet(e,s,M,T,L,H,P,F,U,B,z);if(O!==null){const J=r.compareFunction;J===y5||J===eg?W=oy(zd(W,o),zd(O,"float")).build(e,o):W=oy(zd(O,"float"),zd(W,o)).build(e,o)}e.addLineFlowCode(`${l} = ${W}`,this),a.snippet=W,a.propertyName=l}let u=l;return e.needsToWorkingColorSpace(r)&&(u=AR(zd(u,o),r.colorSpace).setup(e).build(e,o)),e.format(u,o,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}sample(e){const t=this.clone();return t.uvNode=Hn(e),t.referenceNode=this.getBase(),Hn(t)}load(e){return this.sample(e).setSampler(!1)}blur(e){const t=this.clone();t.biasNode=Hn(e).mul(AG(t)),t.referenceNode=this.getBase();const r=t.value;return t.generateMipmaps===!1&&(r&&r.generateMipmaps===!1||r.minFilter===cs||r.magFilter===cs)&&(an("TSL: texture().blur() requires mipmaps and sampling. Use .generateMipmaps=true and .minFilter/.magFilter=THREE.LinearFilter in the Texture."),t.biasNode=null),Hn(t)}level(e){const t=this.clone();return t.levelNode=Hn(e),t.referenceNode=this.getBase(),Hn(t)}size(e){return ly(this,e)}bias(e){const t=this.clone();return t.biasNode=Hn(e),t.referenceNode=this.getBase(),Hn(t)}getBase(){return this.referenceNode?this.referenceNode.getBase():this}compare(e){const t=this.clone();return t.compareNode=Hn(e),t.referenceNode=this.getBase(),Hn(t)}grad(e,t){const r=this.clone();return r.gradNode=[Hn(e),Hn(t)],r.referenceNode=this.getBase(),Hn(r)}gather(e=0){const t=this.clone();return t.gatherNode=Hn(e),t.referenceNode=this.getBase(),Hn(t)}depth(e){const t=this.clone();return t.depthNode=Hn(e),t.referenceNode=this.getBase(),Hn(t)}offset(e){const t=this.clone();return t.offsetNode=Hn(e),t.referenceNode=this.getBase(),Hn(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;t!==null&&(t.value=e.matrix),e.matrixAutoUpdate===!0&&e.updateMatrix();const r=this._flipYUniform;r!==null&&(r.value=e.image instanceof ImageBitmap&&e.flipY===!0||e.isRenderTargetTexture===!0||e.isFramebufferTexture===!0||e.isDepthTexture===!0)}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e.gatherNode=this.gatherNode,e.offsetNode=this.offsetNode,e}}const GVe=ri(L0).setParameterLength(1,4).setName("texture"),Pi=(n=xG,e=null,t=null,r=null)=>{let i;return n&&n.isTextureNode===!0?(i=Hn(n.clone()),i.referenceNode=n.getBase(),e!==null&&(i.uvNode=Hn(e)),t!==null&&(i.levelNode=Hn(t)),r!==null&&(i.biasNode=Hn(r))):i=GVe(n,e,t,r),i},qVe=(n=xG)=>Pi(n),Ya=(...n)=>Pi(...n).setSampler(!1),$Ve=(n,e,t)=>Pi(n,e).level(t),HVe=n=>(n.isNode===!0?n:Pi(n)).convert("sampler"),WVe=n=>(n.isNode===!0?n:Pi(n)).convert("samplerComparison");class vG extends RT{static get type(){return"BufferNode"}constructor(e,t,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=r,this.updateRanges=[]}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const C_=(n,e,t)=>new vG(n,e,t);
4307class XVe extends Ey{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),r=this.getNodeType(e),i=this.node.getPaddedType();return e.format(t,i,r)}}class YVe extends vG{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=t===null?QA(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=Tr.RENDER,this.isArrayBufferNode=!0}generateNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return e==="mat2"?t="mat2":/mat/.test(e)===!0?t="mat4":e.charAt(0)==="i"?t="ivec4":e.charAt(0)==="u"&&(t="uvec4"),t}update(){const{array:e,value:t}=this,r=this.elementType;if(r==="float"||r==="int"||r==="uint")for(let i=0;i<e.length;i++){const s=i*4;t[s]=e[i]}else if(r==="color")for(let i=0;i<e.length;i++){const s=i*4,a=e[i];t[s]=a.r,t[s+1]=a.g,t[s+2]=a.b||0}else if(r==="mat2")for(let i=0;i<e.length;i++){const s=i*4,a=e[i];t[s]=a.elements[0],t[s+1]=a.elements[1],t[s+2]=a.elements[2],t[s+3]=a.elements[3]}else if(r==="mat3")for(let i=0;i<e.length;i++){const s=i*16,a=e[i];t[s]=a.elements[0],t[s+1]=a.elements[1],t[s+2]=a.elements[2],t[s+4]=a.elements[3],t[s+5]=a.elements[4],t[s+6]=a.elements[5],t[s+8]=a.elements[6],t[s+9]=a.elements[7],t[s+10]=a.elements[8],t[s+15]=1}else if(r==="mat4")for(let i=0;i<e.length;i++){const s=i*16,a=e[i];for(let o=0;o<a.elements.length;o++)t[s+o]=a.elements[o]}else for(let i=0;i<e.length;i++){const s=i*4,a=e[i];t[s]=a.x,t[s+1]=a.y,t[s+2]=a.z||0,t[s+3]=a.w||0}}setup(e){const t=this.array.length,r=this.elementType;let i=Float32Array;const s=this.paddedType,a=e.getTypeLength(s);return r.charAt(0)==="i"&&(i=Int32Array),r.charAt(0)==="u"&&(i=Uint32Array),this.value=new i(t*a),this.bufferCount=t,this.bufferType=s,this.update(),super.setup(e)}element(e){return new XVe(this,Hn(e))}}const Dl=(n,e)=>new YVe(n,e);class QVe extends cr{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}const mg=ri(QVe).setParameterLength(1);let j3,I3;class Hs extends cr{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this._output=null,this.isViewportNode=!0}generateNodeType(){return this.scope===Hs.DPR?"float":this.scope===Hs.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=Tr.NONE;return(this.scope===Hs.SIZE||this.scope===Hs.VIEWPORT||this.scope===Hs.DPR)&&(e=Tr.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===Hs.VIEWPORT?t!==null?I3.copy(t.viewport):(e.getViewport(I3),I3.multiplyScalar(e.getPixelRatio())):this.scope===Hs.DPR?this._output.value=e.getPixelRatio():t!==null?(j3.width=t.width,j3.height=t.height):e.getDrawingBufferSize(j3)}setup(){const e=this.scope;let t=null;return e===Hs.SIZE?t=Qn(j3||(j3=new Jt)):e===Hs.VIEWPORT?t=Qn(I3||(I3=new Rr)):e===Hs.DPR?t=Qn(1):t=Cn(My.div(cy)),this._output=t,t}generate(e){if(this.scope===Hs.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const r=e.getNodeProperties(cy).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${r}.y - ${t}.y )`}return t}return super.generate(e)}}Hs.COORDINATE="coordinate";Hs.VIEWPORT="viewport";Hs.SIZE="size";Hs.UV="uv";Hs.DPR="dpr";const yG=Pn(Hs,Hs.DPR),Yf=Pn(Hs,Hs.UV),cy=Pn(Hs,Hs.SIZE),My=Pn(Hs,Hs.COORDINATE),Ub=Pn(Hs,Hs.VIEWPORT),bG=Ub.zw,Ofe=My.sub(Ub.xy),KVe=Ofe.div(bG),ZVe=ut(()=>(an('TSL: "viewportResolution" is deprecated. Use "screenSize" instead.',new ho),cy),"vec2").once()();let uL=null,IC=null,dL=null,FC=null,hL=null,UC=null,fL=null,BC=null,pL=null,VC=null,mL=null,zC=null,gL=null,GC=null;const Y1=Qn(0,"uint").setName("u_cameraIndex").setGroup(dR("cameraIndex")).toVarying("v_cameraIndex"),MA=Qn("float").setName("cameraNear").setGroup(lr).onRenderUpdate(({camera:n})=>n.near),kA=Qn("float").setName("cameraFar").setGroup(lr).onRenderUpdate(({camera:n})=>n.far),pu=ut(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const r of n.cameras)t.push(r.projectionMatrix);IC===null?IC=Dl(t).setGroup(lr).setName("cameraProjectionMatrices"):IC.array=t,e=IC.element
4307(n.isMultiViewCamera?mg("gl_ViewID_OVR"):Y1)}else uL===null&&(uL=Qn(n.projectionMatrix).setName("cameraProjectionMatrix").setGroup(lr).onRenderUpdate(({camera:t})=>t.projectionMatrix)),e=uL;return e}).once()(),Dfe=ut(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const r of n.cameras)t.push(r.projectionMatrixInverse);FC===null?FC=Dl(t).setGroup(lr).setName("cameraProjectionMatricesInverse"):FC.array=t,e=FC.element(n.isMultiViewCamera?mg("gl_ViewID_OVR"):Y1)}else dL===null&&(dL=Qn(n.projectionMatrixInverse).setName("cameraProjectionMatrixInverse").setGroup(lr).onRenderUpdate(({camera:t})=>t.projectionMatrixInverse)),e=dL;return e}).once()(),Q1=ut(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const r of n.cameras)t.push(r.matrixWorldInverse);UC===null?UC=Dl(t).setGroup(lr).setName("cameraViewMatrices"):UC.array=t,e=UC.element(n.isMultiViewCamera?mg("gl_ViewID_OVR"):Y1)}else hL===null&&(hL=Qn(n.matrixWorldInverse).setName("cameraViewMatrix").setGroup(lr).onRenderUpdate(({camera:t})=>t.matrixWorldInverse)),e=hL;return e}).once()(),PT=ut(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const r of n.cameras)t.push(r.matrixWorld);BC===null?BC=Dl(t).setGroup(lr).setName("cameraWorldMatrices"):BC.array=t,e=BC.element(n.isMultiViewCamera?mg("gl_ViewID_OVR"):Y1)}else fL===null&&(fL=Qn(n.matrixWorld).setName("cameraWorldMatrix").setGroup(lr).onRenderUpdate(({camera:t})=>t.matrixWorld)),e=fL;return e}).once()(),JVe=ut(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const r of n.cameras)t.push(r.normalMatrix);VC===null?VC=Dl(t).setGroup(lr).setName("cameraNormalMatrices"):VC.array=t,e=VC.element(n.isMultiViewCamera?mg("gl_ViewID_OVR"):Y1)}else pL===null&&(pL=Qn(n.normalMatrix).setName("cameraNormalMatrix").setGroup(lr).onRenderUpdate(({camera:t})=>t.normalMatrix)),e=pL;return e}).once()(),jfe=ut(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(let r=0,i=n.cameras.length;r<i;r++)t.push(new Ve);zC===null?zC=Dl(t).setGroup(lr).setName("cameraPositions").onRenderUpdate(({camera:r},i)=>{const s=r.cameras,a=i.array;for(let o=0,l=s.length;o<l;o++)a[o].setFromMatrixPosition(s[o].matrixWorld)}
4307):zC.array=t,e=zC.element(n.isMultiViewCamera?mg("gl_ViewID_OVR"):Y1)}else mL===null&&(mL=Qn(new Ve).setName("cameraPosition").setGroup(lr).onRenderUpdate(({camera:t},r)=>r.value.setFromMatrixPosition(t.matrixWorld))),e=mL;return e}).once()(),eze=ut(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const r of n.cameras)t.push(r.viewport);GC===null?GC=Dl(t,"vec4").setGroup(lr).setName("cameraViewports"):GC.array=t,e=GC.element(Y1)}else gL===null&&(gL=Vn(0,0,cy.x,cy.y).toConst("cameraViewport")),e=gL;return e}).once()(),HZ=new H1;class yi extends cr{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=Tr.OBJECT,this.uniformNode=new RT(null)}generateNodeType(){const e=this.scope;if(e===yi.WORLD_MATRIX)return"mat4";if(e===yi.POSITION||e===yi.VIEW_POSITION||e===yi.DIRECTION||e===yi.SCALE)return"vec3";if(e===yi.RADIUS)return"float"}update(e){const t=this.object3d,r=this.uniformNode,i=this.scope;if(i===yi.WORLD_MATRIX)r.value=t.matrixWorld;else if(i===yi.POSITION)r.value=r.value||new Ve,r.value.setFromMatrixPosition(t.matrixWorld);else if(i===yi.SCALE)r.value=r.value||new Ve,r.value.setFromMatrixScale(t.matrixWorld);else if(i===yi.DIRECTION)r.value=r.value||new Ve,t.getWorldDirection(r.value);else if(i===yi.VIEW_POSITION){const s=e.camera;r.value=r.value||new Ve,r.value.setFromMatrixPosition(t.matrixWorld),r.value.applyMatrix4(s.matrixWorldInverse)}else if(i===yi.RADIUS){const s=e.object.geometry;s.boundingSphere===null&&s.computeBoundingSphere(),HZ.copy(s.boundingSphere).applyMatrix4(t.matrixWorld),r.value=HZ.radius}}generate(e){const t=this.scope;return t===yi.WORLD_MATRIX?this.uniformNode.nodeType="mat4":t===yi.POSITION||t===yi.VIEW_POSITION||t===yi.DIRECTION||t===yi.SCALE?this.uniformNode.nodeType="vec3":t===yi.RADIUS&&(this.uniformNode.nodeType="float"),this.uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}yi.WORLD_MATRIX="worldMatrix";yi.POSITION="position";yi.SCALE="scale";yi.VIEW_POSITION="viewPosition";yi.DIRECTION="direction";yi.RADIUS="radius";const tze=ri(yi,yi.DIRECTION).setParameterLength(1),nze=ri(yi,yi.WORLD_MATRIX).setParameterLength(1),rze=ri(yi,yi.POSITION).setParameterLength(1),ize=ri(yi,yi.SCALE).setParameterLength(1),sze=ri(yi,yi.VIEW_POSITION).setParameterLength(1),aze=ri(yi,yi.RADIUS).setParameterLength(1);class Xh extends yi{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const oze=Pn(Xh,Xh.DIRECTION),Fh=Pn(Xh,Xh.WORLD_MATRIX),lze=Pn(Xh,Xh.POSITION),cze=Pn(Xh,Xh.SCALE),uze=Pn(Xh,Xh.VIEW_POSITION),dze=Pn(Xh,Xh.RADIUS),Ife=Qn(new Gr).onObjectUpdate(({object:n},e)=>e.value.getNormalMatrix(n.matrixWorld)),hze=Qn(new kr).onObjectUpdate(({object:n},e)=>e.value.copy(n.matrixWorld).invert()),O0=ut(n=>n.context.modelViewMatrix||Ffe).once()().toVar("modelViewMatrix"),Ffe=Q1.mul(Fh),VF=ut(n=>(n.context.isHighPrecisionModelViewMatrix=!0,Qn("mat4").onObjectUpdate(({object:e,camera:t})=>e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld)))).once()().toVar("highpModelViewMatrix"),zF=ut(n=>{const e=n.context.isHighPrecisionModelViewMatrix;return Qn("mat3").onObjectUpdate(({object:t,camera:r})=>(e!==!0&&t.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix)))}).once()().toVar("highpModelNormalViewMatrix"),Ufe=ut(n=>n.shaderStage!=="fragment"?(_i("TSL: `clipSpace` is only available in fragment stage."),Vn()):n.context.clipSpace.toVarying("v_clipSpace")).once()(),uc=$d("position","vec3"),pa=uc.toVarying("positionLocal"),uy=uc.toVarying("positionPrevious"),_0=ut(n=>Fh.mul(pa).xyz.toVarying(n.getSubBuildProperty("v_positionWorld")),"vec3").once(["POSITION"])(),wG=ut(()=>pa.transformDirection(Fh).toVarying("v_positionWorldDirection").normalize().toVar("positionWorldDirection"),"vec3").once(["POSITION"])(),Ja=ut(n=>{if(n.shaderStage==="fragment"&&n.material.vertexNode){const e=Dfe.mul(Ufe);return e.xyz.div(e.w).toVar("positionView")}return n.context.setupPositionView().toVarying("v_positionView")},"vec3").once(["POSITION","VERTEX"])(),Os=ut(n=>{let e;return n.camera.isOrthographicCamera?e=ct(0,0,1):e=Ja.negate().toVarying("v_positionViewDirection").normalize(),e.toVar("positionViewDirection")},"vec3").once(["POSITION"])();class fze extends cr{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){if(e.shaderStage!=="fragment")return"true";const{material:t}=e;return t.side===us?"false":e.getFrontFacing()}}const Bfe=Pn(fze),_G=Ie(Bfe).mul(2).sub(1),ky=ut(([n],{material:e})=>{const t=e.side;return t===us?n=n.mul(-1):t===Fa&&(n=n.mul(_G)),n}),pze=n=>(_i('TSL: "directionToFaceDirection()" has been renamed to "negateOnBackSide()".'),ky(n)),yR=$d("normal","vec3"),kc=ut(n=>n.geometry.hasAttribute("normal")===!1?(an('TSL: Vertex attribute "normal" not found on geometry.'),ct(0,1,0)):yR,"vec3").once()().toVar("normalLocal"),Vfe=Ja.dFdx().cross(Ja.dFdy()).normalize().toVar("normalFlat"),Jw=ut(n=>{let e;return n.isFlatShading()?e=Vfe:e=TG(kc).toVarying("v_normalViewGeometry").normalize(),e},"vec3").once()().toVar("normalViewGeometry"),zfe=ut(n=>{let e=Jw.transformNormalByInverseViewMatrix(Q1);return n.isFlatShading()!==!0&&(e=e.toVarying("v_normalWorldGeometry")),e.normalize().toVar("normalWorldGeometry")},"vec3").once()(),Ri=ut(n=>{let e;return n.subBuildFn==="NORMAL"||n.subBuildFn==="VERTEX"?(e=Jw,n.isFlatShading()!==!0&&(e=ky(e))):e=n.context.setupNormal().context({getUV:null,getTextureLevel:null}),e},"vec3").once(["NORMAL","VERTEX"])().toVar("normalView"),K1=Ri.transformNormalByInverseViewMatrix(Q1).toVar("normalWorld"),RA=ut(({subBuildFn:n,context:e})=>{let t;return n==="NORMAL"||n==="VERTEX"?t=Ri:t=e.setupClearcoatNormal().context({getUV:null,getTextureLevel:null}),t},"vec3").once(["NORMAL","VERTEX"])().toVar("clearcoatNormalView"),SG=ut(([n,e=Fh])=>gl(e).inverse().transpose().mul(n).normalize());Ut("transformNormal",SG);const TG=ut(([n],e)=>{const t=e.context.modelNormalViewMatrix;return t?n.transformNormalByViewMatrix(t):Ife.mul(n).transformNormalByViewMatrix(Q1)}),mze=ut(()=>(an('TSL: "transformedNormalView" is deprecated. Use "normalView" instead.'),Ri)).once(["NORMAL","VERTEX"])(),gze=ut(()=>(an('TSL: "transformedNormalWorld" is deprecated. Use "normalWorld" instead.'),K1)).once(["NORMAL","VERTEX"])(),Aze=ut(()=>(an('TSL: "transformedClearcoatNormalView" is deprecated. Use "clearcoatNormalView" instead.'),RA)).once(["NORMAL","VERTEX"])(),AL=new kr,Gfe=Qn(0).onReference(({material:n})=>n).onObjectUpdate(({material:n})=>n.refractionRatio),C6=Qn(1).onReference(({material:n})=>n).onObjectUpdate(function({material:n,scene:e}){return n.envMap?n.envMapIntensity:e.environmentIntensity}),Pk=Qn(new kr).onReference(function(n){return n.material}).onObjectUpdate(function({material:n,scene:e}){const r=(e.environment!==null||e.environmentNode&&e.environmentNode.isNode)&&n.envMap===null?e.environmentRotation:n.envMapRotation;return r?AL.makeRotationFromEuler(r).transpose():AL.identity(),AL}),qfe=Os.negate().reflect(Ri),$fe=Os.negate().refract(Ri,Gfe),Hfe=qfe.transformDirection(PT).toVar("reflectVector"),Wfe=$fe.transformDirection(PT).toVar("refractVector"),Xfe=new __;class xze extends L0{static get type(){return"CubeTextureNode"}
4307constructor(e,t=null,r=null,i=null){super(e,t,r,i),this.isCubeTextureNode=!0}getInputType(){return this.value.isDepthTexture===!0?"cubeDepthTexture":"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===np?Hfe:e.mapping===R0?Wfe:(sn('CubeTextureNode: Mapping "%s" not supported.',e.mapping),ct(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return r.isDepthTexture===!0?e.renderer.coordinateSystem===qh?ct(t.x,t.y.negate(),t.z):t:(t=Pk.mul(t),(e.renderer.coordinateSystem===qh||!r.isRenderTargetTexture)&&(t=ct(t.x.negate(),t.yz)),t)}generateUV(e,t){return t.build(e,this.sampler===!0?"vec3":"ivec3")}}const EG=ri(xze).setParameterLength(1,4).setName("cubeTexture"),du=(n=Xfe,e=null,t=null,r=null)=>{let i;return n&&n.isCubeTextureNode===!0?(i=Hn(n.clone()),i.referenceNode=n,e!==null&&(i.uvNode=Hn(e)),t!==null&&(i.levelNode=Hn(t)),r!==null&&(i.biasNode=Hn(r))):i=EG(n,e,t,r),i},vze=(n=Xfe)=>EG(n);class yze extends Ey{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}generateNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(e),i=this.getNodeType(e);return e.format(t,r,i)}}class bR extends cr{static get type(){return"ReferenceNode"}constructor(e,t,r=null,i=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=i,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.name=null,this.updateType=Tr.OBJECT}element(e){return new yze(this,Hn(e))}setGroup(e){return this.group=e,this}setName(e){return this.name=e,this}label(e){return an('TSL: "label()" has been deprecated. Use "setName()" instead.'),this.setName(e)}setNodeType(e){let t=null;this.count!==null?t=C_(null,e,this.count):Array.isArray(this.getValueFromReference())?(t=Dl(null,e),t.updateType=Tr.OBJECT):e==="texture"?t=Pi(null):e==="cubeTexture"?t=du(null):t=Qn(null,e),this.group!==null&&t.setGroup(this.group),this.name!==null&&t.setName(this.name),this.node=t}generateNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let i=1;i<t.length;i++)r=r[t[i]];return r}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const Ws=(n,e,t)=>new bR(n,e,t),Yfe=(n,e,t,r)=>new bR(n,e,r,t);class bze extends bR{static get type(){return"MaterialReferenceNode"}constructor(e,t,r=null){super(e,t,r),this.material=r,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=this.material!==null?this.material:e.material,this.reference}}const Om=(n,e,t=null)=>new bze(n,e,t),Qfe=ws(),wze=Ja.dFdx(),_ze=Ja.dFdy(),Kfe=Qfe.dFdx(),Zfe=Qfe.dFdy(),Jfe=Ri,epe=_ze.cross(Jfe),tpe=Jfe.cross(wze),GF=epe.mul(Kfe.x).add(tpe.mul(Zfe.x)),qF=epe.mul(Kfe.y).add(tpe.mul(Zfe.y)),WZ=GF.dot(GF).max(qF.dot(qF)),npe=WZ.equal(0).select(0,WZ.inverseSqrt()),Sze=GF.mul(npe).toVar("tangentViewFrame"),Tze=qF.mul(npe).toVar("bitangentViewFrame"),wR=$d("tangent","vec4"),P1=wR.xyz.toVar("tangentLocal"),_R=ut(n=>{let e;return n.subBuildFn==="VERTEX"||n.geometry.hasAttribute("tangent")?e=O0.mul(Vn(P1,0)).xyz.toVarying("v_tangentView").normalize():e=Sze,n.isFlatShading()!==!0&&(e=ky(e)),e},"vec3").once(["NORMAL","VERTEX"])().toVar("tangentView"),rpe=_R.transformDirection(PT).toVarying("v_tangentWorld").normalize().toVar("tangentWorld"),SR=ut(([n,e],t)=>{let r=n.mul(wR.w).xyz;return t.subBuildFn==="NORMAL"&&t.isFlatShading()!==!0&&(r=r.toVarying(e)),r}).once(["NORMAL"]),Eze=SR(yR.cross(wR),"v_bitangentGeometry").normalize().toVar("bitangentGeometry"),Cze=SR(kc.cross(P1),"v_bitangentLocal").normalize().toVar("bitangentLocal"),ipe=ut(n=>{let e;return n.subBuildFn==="VERTEX"||n.geometry.hasAttribute("tangent")?e=SR(Ri.cross(_R),"v_bitangentView").normalize():e=Tze,n.isFlatShading()!==!0&&(e=ky(e)),e},"vec3").once(["NORMAL","VERTEX"])().toVar("bitangentView"),Nze=SR(K1.cross(rpe),"v_bitangentWorld").normalize().toVar("bitangentWorld"),Av=gl(_R,ipe,Ri).toVar("TBNViewMatrix"),spe=Os.mul(Av),Mze=(n,e)=>n.sub(spe.mul(e)),ape=ut(()=>{let n=Fv.cross(Os);return n=n.cross(Fv).normalize(),n=ui(n,Ri,_A.mul(e0.oneMinus()).oneMinus().pow2().pow2()).normalize(),n}).once()(),CG=n=>Hn(n).mul(.5).add(.5),ope=n=>Hn(n).mul(2).sub(1),$F=n=>ct(n,gu(gR(Ie(1).sub(Wh(n,n))))),kze=n=>(_i('TSL: "directionToColor()" has been renamed to "packNormalToRGB()".'),CG(n)),Rze=n=>(_i('TSL: "colorToDirection()" has been renamed to "unpackRGBToNormal()".'),ope(n));class Pze extends za{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=Qf,this.unpackNormalMode=m9}setup(e){const{normalMapType:t,scaleNode:r,unpackNormalMode:i}=this;let s=this.node.mul(2).sub(1);if(t===Qf?i===zce?s=$F(s.xy):i===mMe?s=$F(s.yw):i!==m9&&sn(`THREE.NodeMaterial: Unexpected unpack normal mode: ${i}`):i!==m9&&sn(`THREE.NodeMaterial: Normal map type '${t}' is not compatible with unpack normal mode '${i}'`),r!==null){let o=r;e.isFlatShading()===!0&&(o=ky(o)),s=ct(s.xy.mul(o),s.z)}let a=null;return t===Vce?a=TG(s):t===Qf?a=Av.mul(s).normalize():(sn(`NodeMaterial: Unsupported normal map type: ${t}`),a=Ri),a}}const HF=ri(Pze).setParameterLength(1,2),Lze=ut(({textureNode:n,bumpScale:e})=>{const t=i=>n.isolate().context({getUV:s=>i(s.uvNode||ws()),forceUVContext:!0}),r=Ie(t(i=>i));return Cn(Ie(t(i=>i.add(i.dFdx()))).sub(r),Ie(t(i=>i.add(i.dFdy()))).sub(r)).mul(e)}
4307),Oze=ut(n=>{const{surf_pos:e,surf_norm:t,dHdxy:r}=n,i=e.dFdx().normalize(),s=e.dFdy().normalize(),a=t,o=s.cross(a),l=a.cross(i),u=i.dot(o).mul(_G),d=u.sign().mul(r.x.mul(o).add(r.y.mul(l)));return u.abs().mul(t).sub(d).normalize()});class Dze extends za{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(e){if(e.material.wireframe===!0)return Ri;const t=this.scaleNode!==null?this.scaleNode:1,r=Lze({textureNode:this.textureNode,bumpScale:t});return Oze({surf_pos:Ja,surf_norm:Ri,dHdxy:r})}}const NG=ri(Dze).setParameterLength(1,2),XZ=new Map;class Yt extends cr{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let r=XZ.get(e);return r===void 0&&(r=Om(e,t),XZ.set(e,r)),r}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache(e==="map"?"map":e+"Map","texture")}setup(e){const t=e.context.material,r=this.scope;let i=null;if(r===Yt.COLOR){const s=t.color!==void 0?this.getColor(r):ct();t.map&&t.map.isTexture===!0?i=s.mul(this.getTexture("map")):i=s}else if(r===Yt.OPACITY){const s=this.getFloat(r);t.alphaMap&&t.alphaMap.isTexture===!0?i=s.mul(this.getTexture("alpha")):i=s}else if(r===Yt.SPECULAR_STRENGTH)t.specularMap&&t.specularMap.isTexture===!0?i=this.getTexture("specular").r:i=Ie(1);else if(r===Yt.SPECULAR_INTENSITY){const s=this.getFloat(r);t.specularIntensityMap&&t.specularIntensityMap.isTexture===!0?i=s.mul(this.getTexture(r).a):i=s}else if(r===Yt.SPECULAR_COLOR){const s=this.getColor(r);t.specularColorMap&&t.specularColorMap.isTexture===!0?i=s.mul(this.getTexture(r).rgb):i=s}else if(r===Yt.ROUGHNESS){const s=this.getFloat(r);t.roughnessMap&&t.roughnessMap.isTexture===!0?i=s.mul(this.getTexture(r).g):i=s}else if(r===Yt.METALNESS){const s=this.getFloat(r);t.metalnessMap&&t.metalnessMap.isTexture===!0?i=s.mul(this.getTexture(r).b):i=s}else if(r===Yt.EMISSIVE){const s=this.getFloat("emissiveIntensity"),a=this.getColor(r).mul(s);t.emissiveMap&&t.emissiveMap.isTexture===!0?i=a.mul(this.getTexture(r)):i=a}else if(r===Yt.NORMAL)t.normalMap?(i=HF(this.getTexture("normal"),this.getCache("normalScale","vec2")),i.normalMapType=t.normalMapType,(t.normalMap.format==fl||t.normalMap.format==N1||t.normalMap.format==C1)&&(i.unpackNormalMode=zce)):t.bumpMap?i=NG(this.getTexture("bump").r,this.getFloat("bumpScale")):i=Ri;else if(r===Yt.CLEARCOAT){const s=this.getFloat(r);t.clearcoatMap&&t.clearcoatMap.isTexture===!0?i=s.mul(this.getTexture(r).r):i=s}else if(r===Yt.CLEARCOAT_ROUGHNESS){const s=this.getFloat(r);t.clearcoatRoughnessMap&&t.clearcoatRoughnessMap.isTexture===!0?i=s.mul(this.getTexture(r).r):i=s}else if(r===Yt.CLEARCOAT_NORMAL)t.clearcoatNormalMap?i=HF(this.getTexture(r),this.getCache(r+"Scale","vec2")):i=Ri;else if(r===Yt.SHEEN){const s=this.getColor("sheenColor").mul(this.getFloat("sheen"));t.sheenColorMap&&t.sheenColorMap.isTexture===!0?i=s.mul(this.getTexture("sheenColor").rgb):i=s}else if(r===Yt.SHEEN_ROUGHNESS){const s=this.getFloat(r);t.sheenRoughnessMap&&t.sheenRoughnessMap.isTexture===!0?i=s.mul(this.getTexture(r).a):i=s,i=i.clamp(1e-4,1)}else if(r===Yt.ANISOTROPY)if(t.anisotropyMap&&t.anisotropyMap.isTexture===!0){const s=this.getTexture(r);i=cR(rb.x,rb.y,rb.y.negate(),rb.x).mul(s.rg.mul(2).sub(Cn(1)).normalize().mul(s.b))}else i=rb;else if(r===Yt.IRIDESCENCE_THICKNESS){const s=Ws("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const a=Ws("0","float",t.iridescenceThicknessRange);i=s.sub(a).mul(this.getTexture(r).g).add(a)}else i=s}else if(r===Yt.TRANSMISSION){const s=this.getFloat(r);t.transmissionMap?i=s.mul(this.getTexture(r).r):i=s}else if(r===Yt.THICKNESS){const s=this.getFloat(r);t.thicknessMap?i=s.mul(this.getTexture(r).g):i=s}else if(r===Yt.IOR)i=this.getFloat(r);else if(r===Yt.LIGHT_MAP)t.lightMap?i=this.getTexture(r).rgb.mul(this.getFloat("lightMapIntensity")):i=ct(0);else if(r===Yt.AO)t.aoMap?i=this.getTexture(r).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1):i=Ie(1);else if(r===Yt.LINE_DASH_OFFSET)i=t.dashOffset?this.getFloat(r):Ie(0);else{const s=this.getNodeType(e);i=this.getCache(r,s)}return i}}Yt.ALPHA_TEST="alphaTest";Yt.COLOR="color";Yt.OPACITY="opacity";Yt.SHININESS="shininess";Yt.SPECULAR="specular";Yt.SPECULAR_STRENGTH="specularStrength";Yt.SPECULAR_INTENSITY="specularIntensity";Yt.SPECULAR_COLOR="specularColor";Yt.REFLECTIVITY="reflectivity";Yt.ROUGHNESS="roughness";Yt.METALNESS="metalness";Yt.NORMAL="normal";Yt.CLEARCOAT="clearcoat";Yt.CLEARCOAT_ROUGHNESS="clearcoatRoughness";Yt.CLEARCOAT_NORMAL="clearcoatNormal";Yt.EMISSIVE="emissive";Yt.ROTATION="rotation";Yt.SHEEN="sheen";Yt.SHEEN_ROUGHNESS="sheenRoughness";Yt.ANISOTROPY="anisotropy";Yt.IRIDESCENCE="iridescence";Yt.IRIDESCENCE_IOR="iridescenceIOR";Yt.IRIDESCENCE_THICKNESS="iridescenceThickness";Yt.IOR="ior";Yt.TRANSMISSION="transmission";Yt.THICKNESS="thickness";Yt.ATTENUATION_DISTANCE="attenuationDistance";Yt.ATTENUATION_COLOR="attenuationColor";Yt.LINE_SCALE="scale";Yt.LINE_DASH_SIZE="dashSize";Yt.LINE_GAP_SIZE="gapSize";Yt.LINE_WIDTH="linewidth";Yt.LINE_DASH_OFFSET="dashOffset";Yt.POINT_SIZE="size";Yt.DISPERSION="dispersion";Yt.LIGHT_MAP="light";Yt.AO="ao";const lpe=Pn(Yt,Yt.ALPHA_TEST),cpe=Pn(Yt,Yt.COLOR),upe=Pn(Yt,Yt.SHININESS),dpe=Pn(Yt,Yt.EMISSIVE),MG=Pn(Yt,Yt.OPACITY),hpe=Pn(Yt,Yt.SPECULAR),WF=Pn(Yt,Yt.SPECULAR_INTENSITY),fpe=Pn(Yt,Yt.SPECULAR_COLOR),w4=Pn(Yt,Yt.SPECULAR_STRENGTH),N6=Pn(Yt,Yt.REFLECTIVITY),ppe=Pn(Yt,Yt.ROUGHNESS),mpe=Pn(Yt,Yt.METALNESS),gpe=Pn(Yt,Yt.NORMAL),Ape=Pn(Yt,Yt.CLEARCOAT),xpe=Pn(Yt,Yt.CLEARCOAT_ROUGHNESS),vpe
4307=Pn(Yt,Yt.CLEARCOAT_NORMAL),ype=Pn(Yt,Yt.ROTATION),bpe=Pn(Yt,Yt.SHEEN),wpe=Pn(Yt,Yt.SHEEN_ROUGHNESS),_pe=Pn(Yt,Yt.ANISOTROPY),Spe=Pn(Yt,Yt.IRIDESCENCE),Tpe=Pn(Yt,Yt.IRIDESCENCE_IOR),Epe=Pn(Yt,Yt.IRIDESCENCE_THICKNESS),Cpe=Pn(Yt,Yt.TRANSMISSION),Npe=Pn(Yt,Yt.THICKNESS),Mpe=Pn(Yt,Yt.IOR),kpe=Pn(Yt,Yt.ATTENUATION_DISTANCE),Rpe=Pn(Yt,Yt.ATTENUATION_COLOR),kG=Pn(Yt,Yt.LINE_SCALE),RG=Pn(Yt,Yt.LINE_DASH_SIZE),PG=Pn(Yt,Yt.LINE_GAP_SIZE),Lk=Pn(Yt,Yt.LINE_WIDTH),LG=Pn(Yt,Yt.LINE_DASH_OFFSET),Ppe=Pn(Yt,Yt.POINT_SIZE),Lpe=Pn(Yt,Yt.DISPERSION),OG=Pn(Yt,Yt.LIGHT_MAP),Ope=Pn(Yt,Yt.AO),rb=Qn(new Jt).onReference(function(n){return n.material}).onRenderUpdate(function({material:n}){this.value.set(n.anisotropy*Math.cos(n.anisotropyRotation),n.anisotropy*Math.sin(n.anisotropyRotation))}),Dpe=ut(n=>n.context.setupModelViewProjection(),"vec4").once()().toVarying("v_modelViewProjection");class Eo extends cr{static get type(){return"EventNode"}constructor(e,t){super("void"),this.eventType=e,this.callback=t,e===Eo.OBJECT?this.updateType=Tr.OBJECT:e===Eo.MATERIAL?this.updateType=Tr.RENDER:e===Eo.FRAME?this.updateType=Tr.FRAME:e===Eo.BEFORE_OBJECT?this.updateBeforeType=Tr.OBJECT:e===Eo.BEFORE_MATERIAL?this.updateBeforeType=Tr.RENDER:e===Eo.BEFORE_FRAME&&(this.updateBeforeType=Tr.FRAME)}update(e){this.callback(e)}updateBefore(e){this.callback(e)}}Eo.OBJECT="object";Eo.MATERIAL="material";Eo.FRAME="frame";Eo.BEFORE_OBJECT="beforeObject";Eo.BEFORE_MATERIAL="beforeMaterial";Eo.BEFORE_FRAME="beforeFrame";const N_=(n,e)=>new Eo(n,e).toStack(),LT=n=>N_(Eo.OBJECT,n),jze=n=>N_(Eo.MATERIAL,n),jpe=n=>N_(Eo.FRAME,n),Ize=n=>N_(Eo.BEFORE_OBJECT,n),Fze=n=>N_(Eo.BEFORE_MATERIAL,n),Uze=n=>N_(Eo.BEFORE_FRAME,n);class Bze extends Ey{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}getMemberType(e,t){const r=this.storageBufferNode.structTypeNode;return r?r.getMemberType(e,t):"void"}setup(e){return e.isAvailable("storageBuffer")===!1&&this.node.isPBO===!0&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let r;const i=e.isContextAssign();if(e.isAvailable("storageBuffer")===!1?this.node.isPBO===!0&&i!==!0&&(this.node.value.isInstancedBufferAttribute||e.shaderStage!=="compute")?r=e.generatePBO(this):r=this.node.build(e):r=super.generate(e),i!==!0){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}const Vze=ri(Bze).setParameterLength(2);class zze extends vG{static get type(){return"StorageBufferNode"}constructor(e,t=null,r=0){let i,s=null;t&&t.isStructTypeNode?(i="struct",s=t,(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)&&(r=e.count)):t===null&&(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)?(i=Gde(e.itemSize),r=e.count):i=t,super(e,i,r),this.isStorageBufferNode=!0,this.structTypeNode=s,this.access=Fl.READ_WRITE,this.isAtomic=!1,this.isPBO=!1,this._attribute=null,this._varying=null,this.global=!0,e.isStorageBufferAttribute!==!0&&e.isStorageInstancedBufferAttribute!==!0&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){let t;if(this.bufferCount===0){let r=e.globalCache.getData(this.value);r===void 0&&(r={node:this},e.globalCache.setData(this.value,r)),t=r.node.id}else t=this.id;return String(t)}getInputType(){return this.value.isIndirectStorageBufferAttribute?"indirectStorageBuffer":"storageBuffer"}element(e){return Vze(this,e)}setPBO(e){return this.isPBO=e,this}getPBO(){return this.isPBO}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(Fl.READ_ONLY)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}getAttributeData(){return this._attribute===null&&(this._attribute=dG(this.value),this._varying=X1(this._attribute)),{attribute:this._attribute,varying:this._varying}}generateNodeType(e){if(this.structTypeNode!==null)return this.structTypeNode.getNodeType(e);if(e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generateNodeType(e);const{attribute:t}=this.getAttributeData();return t.getNodeType(e)}getMemberType(e,t){return this.structTypeNode!==null?this.structTypeNode.getMemberType(e,t):"void"}generate(e){if(this.structTypeNode!==null&&this.structTypeNode.build(e),e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generate(e);const{attribute:t,varying:r}=this.getAttributeData(),i=r.build(e);return e.registerTransform(i,t),i}}const p1=(n,e=null,t=0)=>new zze(n,e,t),XF=new WeakMap,YZ=new WeakMap,YF=new WeakMap;function Ipe(n,e){let t;const r=Math.max(e.count,1);if(e.isStorageInstancedBufferAttribute===!0)t=p1(e,"mat4",r).element
4307(Zf);else if(r*16*4<=n.getUniformBufferLimit())t=C_(e.array,"mat4",r).element(Zf);else{let a=XF.get(e);a||(a=new UM(e.array,16,1),XF.set(e,a));const o=e.usage===ST?hG:vR,l=[o(a,"vec4",16,0),o(a,"vec4",16,4),o(a,"vec4",16,8),o(a,"vec4",16,12)];t=f1(...l)}return t}function Gze(n,e,t){let r=YF.get(n);if(r===void 0){const i=e.clone();r={previousInstanceMatrix:i,node:Ipe(t,i)},YF.set(n,r)}return r.node}const DG=Ny("vec3","vInstanceColor"),Fpe=ut(([n,e=null],t)=>{const r=n.isStorageInstancedBufferAttribute===!0,i=e&&e.isStorageInstancedBufferAttribute===!0,s=Ipe(t,n);let a=null;r||Math.max(n.count,1)*16*4>t.getUniformBufferLimit()&&(a=XF.get(n));let o=null,l=null;if(e)if(i)o=p1(e,"vec3",Math.max(e.count,1)).element(Zf);else{let d=YZ.get(e);d||(d=new h1(e.array,3),YZ.set(e,d)),l=d;const h=e.usage===ST?hG:vR;o=ct(h(d,"vec3",3,0))}(a!==null||l!==null)&&jpe(()=>{a!==null&&(a.clearUpdateRanges(),a.updateRanges.push(...n.updateRanges),n.version!==a.version&&(a.version=n.version)),e&&l!==null&&(l.clearUpdateRanges(),l.updateRanges.push(...e.updateRanges),e.version!==l.version&&(l.version=e.version))});const u=s.mul(pa).xyz;if(pa.assign(u),t.needsPreviousData()){const d=t.object;LT(({object:f})=>{YF.get(f).previousInstanceMatrix.array.set(n.array)});const h=Gze(d,n,t);uy.assign(h.mul(uy).xyz)}if(t.hasGeometryAttribute("normal")){const d=SG(kc,s);kc.assign(d)}o!==null&&DG.assign(o)},"void"),Upe=ut(([n])=>{const{instanceMatrix:e,instanceColor:t}=n;Fpe(e,t)},"void"),qze=ut(([n,e])=>{const t=st(ly(Ya(n),0).x).toConst(),r=st(e),i=r.mod(t).toConst(),s=r.div(t).toConst();return Ya(n,_a(i,s))}),$ze=ut(([n,e])=>{const t=st(ly(Ya(n),0).x).toConst(),r=st(e).mod(t).toConst(),i=st(e).div(t).toConst();return Ya(n,_a(r,i)).x}),jG=Ny("vec4","vBatchColor"),Bpe=ut(([n],e)=>{const t=e.getDrawIndex()===null?Zf:wfe,r=$ze(n._indirectTexture,st(t)),i=n._matricesTexture,s=st(ly(Ya(i),0).x).toConst(),a=Ie(r).mul(4).toInt().toConst(),o=a.mod(s).toConst(),l=a.div(s).toConst(),u=f1(Ya(i,_a(o,l)),Ya(i,_a(o.add(1),l)),Ya(i,_a(o.add(2),l)),Ya(i,_a(o.add(3),l))),d=n._colorsTexture;if(d!==null){const g=qze(d,r);jG.assign(g)}const h=gl(u);pa.assign(u.mul(pa));const f=kc.div(ct(h[0].dot(h[0]),h[1].dot(h[1]),h[2].dot(h[2]))),p=h.mul(f).xyz;kc.assign(p),e.hasGeometryAttribute("tangent")&&P1.mulAssign(h)},"void"),Ok=new WeakMap,Dk=new WeakMap;function IG(n,e,t,r,i,s){const a=n.element(i.x),o=n.element(i.y),l=n.element(i.z),u=n.element(i.w),d=t.mul(e),h=fo(a.mul(s.x).mul(d),o.mul(s.y).mul(d),l.mul(s.z).mul(d),u.mul(s.w).mul(d));return r.mul(h).xyz}function Vpe(n,e,t,r,i,s,a){const o=n.element(s.x),l=n.element(s.y),u=n.element(s.z),d=n.element(s.w);let h=fo(a.x.mul(o),a.y.mul(l),a.z.mul(u),a.w.mul(d));h=i.mul(h).mul(r);const f=h.transformDirection(e).xyz,p=h.transformDirection(t).xyz;return{skinNormal:f,skinTangent:p}}function zpe(n,e,t,r,i){const s=n.skeleton;let a=Dk.get(s);if(a===void 0){s.update();const o=new Float32Array(s.boneMatrices);a={previousBoneMatrices:o,node:C_(o,"mat4",s.bones.length)},Dk.set(s,a)}return IG(a.node,uy,e,t,r,i)}const Gpe=ut(([n],e)=>{const t=$d("skinIndex","uvec4"),r=$d("skinWeight","vec4"),i=Ws("bindMatrix","mat4"),s=Ws("bindMatrixInverse","mat4"),a=Yfe("skeleton.boneMatrices","mat4",n.skeleton.bones.length);if(LT(({object:l,frameId:u})=>{const d=l.skeleton;if(Ok.get(d)!==u){Ok.set(d,u);const h=Dk.get(d);h!==void 0&&h.previousBoneMatrices.set(d.boneMatrices),d.update()}}),e.needsPreviousData()){const l=zpe(n,i,s,t,r);uy.assign(l)}const o=IG(a,pa,i,s,t,r);if(pa.assign(o),e.hasGeometryAttribute("normal")){const{skinNormal:l,skinTangent:u}=Vpe(a,kc,P1,i,s,t,r);kc.assign(l),e.hasGeometryAttribute("tangent")&&P1.assign(u)}},"void"),Hze=ut(([n,e=null],t)=>{const r=p1(new h1(n.geometry.getAttribute("position").array,3),"vec3").setPBO(!0).toReadOnly().element(Zf).toVar(),i=p1(new h1(new Uint32Array(n.geometry.getAttribute("skinIndex").array),4),"uvec4").setPBO(!0).toReadOnly().element(Zf).toVar(),s=p1(new h1(n.geometry.getAttribute("skinWeight").array,4),"vec4").setPBO(!0).toReadOnly().element(Zf).toVar(),a=Qn(n.bindMatrix,"mat4"),o=Qn(n.bindMatrixInverse,"mat4"),l=C_(n.skeleton.boneMatrices,"mat4",n.skeleton.bones.length),u=n.skeleton;if(LT(({frameId:h})=>{if(Ok.get(u)!==h){Ok.set(u,h);const f=Dk.get(u);f!==void 0&&f.previousBoneMatrices.set(u.boneMatrices),u.update(
4307)}}),t.needsPreviousData()){const h=zpe(n,a,o,i,s);uy.assign(h)}const d=IG(l,r,a,o,i,s);if(e!==null&&e.assign(d),t.hasGeometryAttribute("normal")){const{skinNormal:h,skinTangent:f}=Vpe(l,kc,P1,a,o,i,s);kc.assign(h),t.hasGeometryAttribute("tangent")&&P1.assign(f)}return d});class Wze extends cr{static get type(){return"LoopNode"}constructor(e=[]){super("void"),this.params=e}getVarName(e){return String.fromCharCode(105+e)}getProperties(e){const t=e.getNodeProperties(this);if(t.stackNode!==void 0)return t;const r={};for(let o=0,l=this.params.length-1;o<l;o++){const u=this.params[o],d=u.isNode!==!0&&u.name||this.getVarName(o),h=u.isNode!==!0&&u.type||"int";r[d]=zd(d,h)}const i=e.addStack(),s=this.params[this.params.length-1](r);t.returnsNode=s.context({nodeLoop:s}),t.stackNode=i;const a=this.params[0];if(a.isNode!==!0&&typeof a.update=="function"){const o=ut(this.params[0].update)(r);t.updateNode=o.context({nodeLoop:o})}return e.removeStack(),t}setup(e){if(this.getProperties(e),e.fnCall){const t=e.getDataFromNode(e.fnCall.shaderNode);t.hasLoop=!0}}generate(e){const t=this.getProperties(e),r=this.params,i=t.stackNode;for(let a=0,o=r.length-1;a<o;a++){const l=r[a];let u=!1,d=null,h=null,f=null,p=null,g=null,A=null;l.isNode?l.getNodeType(e)==="bool"?(u=!0,p="bool",h=l.build(e,p)):(p="int",f=this.getVarName(a),d="0",h=l.build(e,p),g="<"):(p=l.type||"int",f=l.name||this.getVarName(a),d=l.start,h=l.end,g=l.condition,A=l.update,typeof d=="number"?d=e.generateConst(p,d):d&&d.isNode&&(d=d.build(e,p)),typeof h=="number"?h=e.generateConst(p,h):h&&h.isNode&&(h=h.build(e,p)),d!==void 0&&h===void 0?(d=d+" - 1",h="0",g=">="):h!==void 0&&d===void 0&&(d="0",g="<"),g===void 0&&(Number(d)>Number(h)?g=">=":g="<"));let x;if(u)x=`while ( ${h} )`;else{const b={start:d,end:h},_=b.start,M=b.end;let T;const L=()=>g.includes("<")?"+=":"-=";if(A!=null)switch(typeof A){case"function":T=e.flowStagesNode(t.updateNode,"void").code.replace(/\t|;/g,"");break;case"number":T=f+" "+L()+" "+e.generateConst(p,A);break;case"string":T=f+" "+A;break;default:A.isNode?T=f+" "+L()+" "+A.build(e):(sn("TSL: 'Loop( { update: ... } )' is not a function, string or number.",this.stackTrace),T="break /* invalid update */")}else p==="int"||p==="uint"?A=g.includes("<")?"++":"--":A=L()+" 1.",T=f+" "+A;const D=e.getVar(p,f)+" = "+_,P=f+" "+g+" "+M;x=`for ( ${D}; ${P}; ${T} )`}e.addFlowCode((a===0?` 4308`:"")+e.tab+x+` { 4309 4310`).addFlowTab()}const s=i.build(e,"void");t.returnsNode.build(e,"void"),e.removeFlowTab().addFlowCode(` 4311`+e.tab+s);for(let a=0,o=this.params.length-1;a<o;a++)e.addFlowCode((a===0?"":e.tab)+`} 4312 4313`).removeFlowTab();e.addFlowTab()}}const ys=(...n)=>new Wze(Iv(n,"int")).toStack(),Xze=()=>zd("continue").toStack(),qpe=()=>zd("break").toStack(),xL=new WeakMap,wd=new Rr,QZ=new WeakMap,KZ=ut(({bufferMap:n,influence:e,stride:t,width:r,depth:i,offset:s})=>{const a=st(bfe).mul(t).add(s),o=a.div(r),l=a.sub(o.mul(r));return Ya(n,_a(l,o)).depth(i).xyz.mul(e)});function Yze(n){const e=n.morphAttributes.position!==void 0,t=n.morphAttributes.normal!==void 0,r=n.morphAttributes.color!==void 0,i=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,s=i!==void 0?i.length:0;let a=xL.get(n);if(a===void 0||a.count!==s){let _=function(){x.dispose(),xL.delete(n),n.removeEventListener("dispose",_)};var o=_;a!==void 0&&a.texture.dispose();const l=n.morphAttributes.position||[],u=n.morphAttributes.normal||[],d=n.morphAttributes.color||[];let h=0;e===!0&&(h=1),t===!0&&(h=2),r===!0&&(h=3);let f=n.attributes.position.count*h,p=1;const g=4096;f>g&&(p=Math.ceil(f/g),f=g);const A=new Float32Array(f*p*4*s),x=new GV(A,f,p,s);x.type=ia,x.needsUpdate=!0;const b=h*4;for(let M=0;M<s;M++){const T=l[M],L=u[M],D=d[M],P=f*p*4*M;for(let O=0;O<T.count;O++){const F=O*b;e===!0&&(wd.fromBufferAttribute(T,O),A[P+F+0]=wd.x,A[P+F+1]=wd.y,A[P+F+2]=wd.z,A[P+F+3]=0),t===!0&&(wd.fromBufferAttribute(L,O),A[P+F+4]=wd.x,A[P+F+5]=wd.y,A[P+F+6]=wd.z,A[P+F+7]=0),r===!0&&(wd.fromBufferAttribute(D,O),A[P+F+8]=wd.x,A[P+F+9]=wd.y,A[P+F+10]=wd.z,A[P+F+11]=D.itemSize===4?wd.w:1)}}a={count:s,texture:x,stride:h,size:new Jt(f,p)},xL.set(n,a),n.addEventListener("dispose",_)}return a}const $pe=ut(([n])=>{const{geometry:e}=n,t=e.morphAttributes.position!==void 0,r=e.hasAttribute("normal")&&e.morphAttributes.normal!==void 0,i=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,s=i!==void 0?i.length:0;if(s===0)return;let a=QZ.get(n);(a===void 0||a.count!==s)&&(a={base:Qn(1),influences:n.morphTargetInfluences?Dl(n.morphTargetInfluences,"float"):null,count:s},QZ.set(n,a));const{base:o,influences:l}=a,{texture:u,stride:d,size:h}=Yze(e);t===!0&&pa.mulAssign(o),r===!0&&kc.mulAssign(o);const f=st(h.width);ys(s,({i:p})=>{const g=Ie(0).toVar();n.count>1&&n.morphTexture!==null&&n.morphTexture!==void 0?g.assign(Ya(n.morphTexture,_a(st(p).add(1),st(Zf))).r):g.assign(l.element(p).toVar()),nr(g.notEqual(0),()=>{t===!0&&pa.addAssign(KZ({bufferMap:u,influence:g,stride:d,width:f,depth:p,offset:st(0)})),r===!0&&kc.addAssign(KZ({bufferMap:u,influence:g,stride:d,width:f,depth:p,offset:st(1)}))})}),LT(({object:p})=>{const{base:g,influences:A}=a;p.geometry.morphTargetsRelative?g.value=1:g.value=1-p.morphTargetInfluences.reduce((x,b)=>
vendor: 5,659 bytes, line 4313
4313x+b,0),A&&(A.array=p.morphTargetInfluences,A.update())})},"void");class M_ extends cr{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}}class Qze extends M_{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}class Kze extends aG{static get type(){return"LightingContextNode"}constructor(e,t=null,r=[],i=null,s=null){super(e),this.lightingModel=t,this.materialLightings=r,this.backdropNode=i,this.backdropAlphaNode=s,this._value=null}getContext(){const{materialLightings:e,backdropNode:t,backdropAlphaNode:r}=this,i=ct().toVar("directDiffuse"),s=ct().toVar("directSpecular"),a=ct().toVar("indirectDiffuse"),o=ct().toVar("indirectSpecular"),l={directDiffuse:i,directSpecular:s,indirectDiffuse:a,indirectSpecular:o};return{radiance:ct().toVar("radiance"),irradiance:ct().toVar("irradiance"),iblIrradiance:ct().toVar("iblIrradiance"),ambientOcclusion:Ie(1).toVar("ambientOcclusion"),reflectedLight:l,materialLightings:e,backdrop:t,backdropAlpha:r}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}}const Hpe=ri(Kze);class Zze extends M_{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}setup(e){e.context.irradiance.addAssign(this.node)}}const Px=new Jt;class TR extends L0{static get type(){return"ViewportTextureNode"}constructor(e=Yf,t=null,r=null){let i=null;r===null?(i=new ZV,i.minFilter=hu,r=i):i=r,super(r,e,t),this.generateMipmaps=!1,this.defaultFramebuffer=i,this.isOutputTextureNode=!0,this.updateBeforeType=Tr.RENDER,this._cacheTextures=new WeakMap}getTextureForReference(e=null){let t,r;if(this.referenceNode?(t=this.referenceNode.defaultFramebuffer,r=this.referenceNode._cacheTextures):(t=this.defaultFramebuffer,r=this._cacheTextures),e===null)return t;if(r.has(e)===!1){const i=t.clone();r.set(e,i)}return r.get(e)}updateReference(e){const t=e.renderer,r=t.getRenderTarget(),i=t.getCanvasTarget(),s=r||i;return this.value=this.getTextureForReference(s),this.value}updateBefore(e){const t=e.renderer,r=t.getRenderTarget(),i=t.getCanvasTarget(),s=r||i;s===null?t.getDrawingBufferSize(Px):s.getDrawingBufferSize?s.getDrawingBufferSize(Px):Px.set(s.width,s.height);const a=this.getTextureForReference(s);(a.image.width!==Px.width||a.image.height!==Px.height)&&(a.image.width=Px.width,a.image.height=Px.height,a.needsUpdate=!0);const o=a.generateMipmaps;a.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(a),a.generateMipmaps=o}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const Jze=ri(TR).setParameterLength(0,3),FG=ri(TR,null,null,{generateMipmaps:!0}).setParameterLength(0,3),eGe=FG(),Wpe=(n=Yf,e=null)=>eGe.sample(n,e);let vL=null;class tGe extends TR{static get type(){return"ViewportDepthTextureNode"}constructor(e=Yf,t=null,r=null){r===null&&(vL===null&&(vL=new Bl),r=vL),super(e,t,r)}}const UG=ri(tGe).setParameterLength(0,3);class Gu extends cr{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===Gu.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,r=this.valueNode;let i=null;if(t===Gu.DEPTH_BASE)r!==null&&(i=Qpe().assign(r));else if(t===Gu.DEPTH)e.isPerspectiveCamera?i=BG(Ja.z,MA,kA):i=Vv(Ja.z,MA,kA);else if(t===Gu.LINEAR_DEPTH)if(r!==null)if(e.isPerspectiveCamera){const s=ER(r,MA,kA);i=Vv(s,MA,kA)}else i=r;else i=Vv(Ja.z,MA,kA);return i}}Gu.DEPTH_BASE="depthBase";Gu.DEPTH="depth";Gu.LINEAR_DEPTH="linearDepth";const Vv=(n,e,t)=>n.add(e).div(e.sub(t)),nGe=(n,e,t)=>n.add(t).div(t.sub(e)),Xpe=ut(([n,e,t],r)=>r.renderer.reversedDepthBuffer===!0?t.sub(e).mul(n).sub(t):e.sub(t).mul(n).sub(e)),BG=(n,e,t)=>e.add(n).mul(t).div(t.sub(e).mul(n)),Ype=(n,e,t)=>e.mul(n.add(t)).div(n.mul(e.sub(t))),ER=ut(([n,e,t],r)=>r.renderer.reversedDepthBuffer===!0?e.mul(t).div(e.sub(t).mul(n).sub(e)):e.mul(t).div(t.sub(e).mul(n).sub(t))),CR=(n,e,t)=>{e=e.max(1e-6).toVar();const r=y0(n.negate().div(e)),i=y0(t.div(e));return r.div(i)},rGe=(n,e,t)=>{const r=n.mul(pR(t.div(e)));return Ie(Math.E).pow(r).mul(e).negate()},Qpe=ri(Gu,Gu.DEPTH_BASE),VG=Pn(Gu,Gu.DEPTH),jk=ri(Gu,Gu.LINEAR_DEPTH).setParameterLength(0,1),iGe=jk(UG());VG.assign=n=>Qpe(n);class zh extends cr{static get type(){return"ClippingNode"}constructor(e=zh.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:r,unionPlanes:i}=t;return this.hardwareClipping=e.hardwareClipping,this.scope===zh.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(r,i):this.scope===zh.HARDWARE?this.setupHardwareClipping(i,e):this.setupDefault(r,i)}setupAlphaToCoverage(e,t){return ut(()=>{const r=Ie().toVar("distanceToPlane"),i=Ie().toVar("distanceToGradient"),s=Ie(1).toVar("clipOpacity"),a=t.length;if(this.hardwareClipping===!1&&a>0){const l=Dl(t).setGroup(lr);ys(a,({i:u})=>{const d=l.element(u);r.assign(Ja.dot(d.xyz).negate().add(d.w)),i.assign(r.fwidth().div(2)),s.mulAssign(rh(i.negate(),i,r))})}const o=e.length;if(o>0){const l=Dl(e).setGroup(lr),u=Ie(1).toVar("intersectionClipOpacity");ys(o,({i:d})=>{const h=l.element(d);r.assign(Ja.dot(h.xyz).negate().add(h.w)),i.assign(r.fwidth().div(2)),u.mulAssign(rh(i.negate(),i,r).oneMinus())}),s.mulAssign(u.oneMinus())}As.a.mulAssign(s),As.a.equal(0).discard()})()}setupDefault(e,t){return ut(()=>{const r=t.length;if(this.hardwareClipping===!1&&r>0){const s=Dl(t).setGroup(lr);ys(r,({i:a})=>
4313{const o=s.element(a);Ja.dot(o.xyz).greaterThan(o.w).discard()})}const i=e.length;if(i>0){const s=Dl(e).setGroup(lr),a=th(!0).toVar("clipped");ys(i,({i:o})=>{const l=s.element(o);a.assign(Ja.dot(l.xyz).greaterThan(l.w).and(a))}),a.discard()}})()}setupHardwareClipping(e,t){const r=e.length;return t.enableHardwareClipping(r),ut(()=>{const i=Dl(e).setGroup(lr),s=mg(t.getClipDistance());ys(r,({i:a})=>{const o=i.element(a),l=Ja.dot(o.xyz).sub(o.w).negate();s.element(a).assign(l)})})()}}zh.ALPHA_TO_COVERAGE="alphaToCoverage";zh.DEFAULT="default";zh.HARDWARE="hardware";const sGe=()=>new zh,aGe=()=>new zh(zh.ALPHA_TO_COVERAGE),oGe=()=>new zh(zh.HARDWARE),lGe=.05,ZZ=ut(([n])=>rp(Pr(1e4,ou(Pr(17,n.x).add(Pr(.1,n.y)))).mul(fo(.1,zs(ou(Pr(13,n.y).add(n.x))))))),JZ=ut(([n])=>ZZ(Cn(ZZ(n.xy),n.z))),cGe=ut(([n])=>{const e=Na(w0(Kz(n.xyz)),w0(Zz(n.xyz))),t=Ie(1).div(Ie(lGe).mul(e)).toVar("pixScale"),r=Cn(Zw(b0(y0(t))),Zw(mR(y0(t)))),i=Cn(JZ(b0(r.x.mul(n.xyz))),JZ(b0(r.y.mul(n.xyz)))),s=rp(y0(t)),a=fo(Pr(s.oneMinus(),i.x),Pr(s,i.y)),o=td(s,s.oneMinus()),l=ct(a.mul(a).div(Pr(2,o).mul(Ei(1,o))),a.sub(Pr(.5,o)).div(Ei(1,o)),Ei(1,Ei(1,a).mul(Ei(1,a)).div(Pr(2,o).mul(Ei(1,o))))),u=a.lessThan(o.oneMinus()).select(a.lessThan(o).select(l.x,l.y),l.z);return ip(u,1e-6,1)}).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class uGe extends Pfe{static get type(){return"VertexColorNode"}constructor(e){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e),r=e.hasGeometryAttribute(t);let i;return r===!0?i=super.generate(e):i=e.generateConst(this.nodeType,new Rr(1,1,1,1)),i}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const Kpe=(n=0)=>new uGe(n);class Va extends Cc{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.fog=!0,this.lights=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.maskNode=null,this.maskShadowNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.receivedShadowPositionNode=null,this.castShadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null,this.contextNode=null}_getNodeChildren(){const e=[];for(const t of Object.getOwnPropertyNames(this)){if(t.startsWith("_")===!0)continue;const r=this[t];r&&r.isNode===!0&&e.push({property:t,childNode:r})}return e}customProgramCacheKey(){const e=[];for(const{property:t,childNode:r}of this._getNodeChildren())e.push(E_(t.slice(0,-4)),r.getCacheKey());return this.type+kT(e)}build(e){this.setup(e)}setupObserver(e){return new kBe(e)}setup(e){e.context.setupNormal=()=>Bv(this.setupNormal(e),"NORMAL","vec3"),e.context.setupPositionView=()=>this.setupPositionView(e),e.context.setupModelViewProjection=()=>this.setupModelViewProjection(e);const t=e.renderer,r=t.getRenderTarget();e.addStack();const i=this.setupVertex(e),s=Bv(this.vertexNode||i,"VERTEX");e.context.clipSpace=s,e.stack.outputNode=s,this.setupHardwareClipping(e),this.geometryNode!==null&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();let a;const o=this.setupClipping(e);if((this.depthWrite===!0||this.depthTest===!0)&&(r!==null?r.depthBuffer===!0&&this.setupDepth(e):t.depth===!0&&this.setupDepth(e)),this.fragmentNode===null){this.setupDiffuseColor(e),this.setupAmbientOcclusion(e),this.setupVariants(e);const l=this.setupLighting(e);o!==null&&e.stack.addToStack(o);const u=Vn(l,As.a).max(0);a=this.setupOutput(e,u),Ib.assign(a);const d=this.outputNode!==null;if(d&&(a=this.outputNode),e.context.getOutput&&(a=e.context.getOutput(a,e)),r!==null){const h=t.getMRT(),f=this.mrtNode;h!==null?(d&&Ib.assign(a),a=h,f!==null&&(a=h.merge(f))):f!==null&&(a=f)}}else{let l=this.fragmentNode;l.isOutputStructNode!==!0&&(l=l.convert(e.getOutputType())),a=this.setupOutput(e,l)}e.stack.outputNode=a,e.addFlow("fragment",e.removeStack()),e.observer=this.setupObserver(e)}setupClipping(e){if(e.clippingContext===null)return null;const{unionPlanes:t,intersectionPlanes:r}=e.clippingContext;let i=null;if(t.length>0||r.length>0){const s=e.renderer.currentSamples;this.alphaToCoverage&&s>1?i=aGe():e.stack.addToStack(sGe())}return i}setupHardwareClipping(e){if(e.hardwareClipping=!1,e.clippingContext===null)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.addToStack(oGe()),e.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:r}=e;let i=this.depthNode;if(i===null){const s=t.getMRT();s&&s.has("depth")?i=s.get("depth"):t.logarithmicDepthBuffer===!0&&(r.isPerspectiveCamera?i=CR(Ja.z,MA,kA):i=Vv(Ja.z,MA,kA))}i!==null&&VG.assign(i).toStack()}setupPositionView(){return O0.mul(pa).xyz}setupModelViewProjection(){return pu.mul(Ja)}setupVertex(e){return e.addStack(),this.setupPosition(e),e.context.position=e.removeStack(),Dpe}setupPosition(e){const{object:t,geometry:r}=e;if((r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color)&&$pe(t),t.isSkinnedMesh===!0&&Gpe(t),this.displacementMap){const i=Om("displacementMap","texture"),s=Om("displacementScale","float"),a=Om("displacementBias","float");pa.addAssign(kc.normalize().mul(i.x.mul(s).add(a)))}return t.isBatchedMesh&&Bpe(t),t.isInstancedMesh&&t.instanceMatrix&&t.instanceMatrix.isInstancedBufferAttribute===!0&&Upe(t),this.positionNode!==null&&pa.assign(Bv(this.positionNode,"POSITION","vec3")),pa}setupDiffuseColor(e){const{object:t,geometry:r}=e;this.maskNode!==null&&th(this.maskNode).not().discard();let i=this.colorNode?Vn(this.colorNode):cpe;this.vertexColors===!0&&r.hasAttribute("color")&&(i=i.mul(Kpe())),t.instanceColor&&(i=DG.mul(i)),t.isBatchedMesh&&t._
4313colorsTexture&&(i=jG.mul(i)),As.assign(i);const s=this.opacityNode?Ie(this.opacityNode):MG;As.a.assign(As.a.mul(s));let a=null;(this.alphaTestNode!==null||this.alphaTest>0)&&(a=this.alphaTestNode!==null?Ie(this.alphaTestNode):lpe,this.alphaToCoverage===!0?(As.a=rh(a,a.add(eG(As.a)),As.a),As.a.lessThanEqual(0).discard()):As.a.lessThanEqual(a).discard()),this.alphaHash===!0&&As.a.lessThan(cGe(pa)).discard(),e.isOpaque()&&As.a.assign(1)}setupVariants(){}setupOutgoingLight(){return this.lights===!0?ct(0):As.rgb}setupNormal(){return this.normalNode?ct(this.normalNode):gpe}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?Om("envMap","cubeTexture"):Om("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new Zze(OG)),t}setupMaterialLightings(e){const t=[];if(e.renderer.lighting.enabled===!1)return t;const r=this.setupEnvironment(e);r&&r.isLightingNode&&t.push(r);const i=this.setupLightMap(e);return i&&i.isLightingNode&&t.push(i),e.context.ambientOcclusion&&t.push(new Qze(e.context.ambientOcclusion)),t}setupAmbientOcclusion(e){let t=this.aoNode;t===null&&e.material.aoMap&&(t=Ope),e.context.getAO&&(t=e.context.getAO(t,e)),t!==null&&(BF.assign(t),e.context.ambientOcclusion=BF)}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:r,backdropAlphaNode:i,emissiveNode:s}=this,a=this.lights===!0||this.lightsNode!==null,o=this.lights===!0?this.setupMaterialLightings(e):[],l=a?this.lightsNode||e.lightsNode:null;let u=this.setupOutgoingLight(e);if(l&&(o.length>0||l.getScope().hasLights)){const d=this.setupLightingModel(e)||null;u=Hpe(l,d,o,r,i)}else r!==null&&(u=ct(i!==null?ui(u,r,i):r));return(s&&s.isNode===!0||t.emissive&&t.emissive.isColor===!0)&&(UF.assign(ct(s||dpe)),u=u.add(UF)),u}setupFog(e,t){const r=e.fogNode;return r&&(Ib.assign(t),t=Vn(r.toVar())),t}setupPremultipliedAlpha(e,t){return mG(t)}setupOutput(e,t){return this.fog===!0&&(t=this.setupFog(e,t)),this.premultipliedAlpha===!0&&(t=this.setupPremultipliedAlpha(e,t)),t}setDefaultValues(e){for(const r in e){const i=e[r];this[r]===void 0&&(this[r]=i,i&&i.clone&&(this[r]=i.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const r in t)Object.getOwnPropertyDescriptor(this.constructor.prototype,r)===void 0&&t[r].get!==void 0&&Object.defineProperty(this.constructor.prototype,r,t[r])}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{},nodes:{}});const r=Cc.prototype.toJSON.call(this,e);r.inputNodes={};for(const{property:s,childNode:a}of this._getNodeChildren())r.inputNodes[s]=a.toJSON(e).uuid;function i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images),o=i(e.nodes);s.length>0&&(r.textures=s),a.length>0&&(r.images=a),o.length>0&&(r.nodes=o)}return r}copy(e){const t=Object.getOwnPropertyDescriptors(this.constructor.prototype);for(const r in t)if(t[r].set!==void 0&&e[r]!==void 0){const i=e[r];this[r]&&this[r].copy!==void 0?this[r].copy(i):this[r]=i}for(const r in this)if(!/^(?:is[A-Z]|_)|^(?:id|uuid|version|type|userData|clippingPlanes)$/.test(r)&&this[r]!==void 0&&e[r]!==void 0){const i=e[r];this[r]&&this[r].copy!==void 0?this[r].copy(i):this[r]=i}return this.clippingPlanes=e.clippingPlanes?e.clippingPlanes.map(r=>r.clone()):null,this.userData=JSON.parse(JSON.stringify(e.userData)),this}}const dGe=new w_;class hGe extends Va{static get type(){return"LineBasicNodeMaterial"}constructor(e){super(),this.isLineBasicNodeMaterial=!0,this.setDefaultValues(dGe),this.setValues(e)}}const fGe=new a8e;class pGe extends Va{static get type(){return"LineDashedNodeMaterial"}constructor(e){super(),this.isLineDashedNodeMaterial=!0,this.setDefaultValues(fGe),this.dashOffset=0,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(e)}setupVariants(){const e=this.offsetNode?Ie(this.offsetNode):LG,t=this.dashScaleNode?Ie(this.dashScaleNode):kG,r=this.dashSizeNode?Ie(this.dashSizeNode):RG,i=this.gapSizeNode?Ie(this.gapSizeNode):PG;Uv.assign(r),U5.assign(i);const s=X1($d("lineDistance").mul(t));(e?s.add(e):s).mod(Uv.add(U5)).greaterThan(Uv).discard()}}const M6=Ny("vec3","worldStart"),QF=Ny("vec3","worldEnd"),Zpe=Ny("float","lineDistance"),$x=Ny("vec4","worldPos"),eJ=ut(({start:n,end:e})=>
vendor: 10,941 bytes, line 4313
4313{const t=pu.element(2).element(2),r=pu.element(3).element(2);return t.greaterThan(0).select(r.negate().div(t.add(1)),r.mul(-.5).div(t)).sub(n.z).div(e.z.sub(n.z))},{start:"vec4",end:"vec4",return:"float"}),mGe=ut(({p1:n,p2:e,p3:t,p4:r})=>{const i=n.sub(t),s=r.sub(t),a=e.sub(n),o=i.dot(s),l=s.dot(a),u=i.dot(a),d=s.dot(s),f=a.dot(a).mul(d).sub(l.mul(l)),g=o.mul(l).sub(u.mul(d)).div(f).clamp(),A=o.add(l.mul(g)).div(d).clamp();return Cn(g,A)},{p1:"vec3",p2:"vec3",p3:"vec3",p4:"vec3",return:"vec2"});ut(({material:n})=>{const e=n._useDash,t=n._useWorldUnits,r=$d("instanceStart"),i=$d("instanceEnd"),s=Vn(O0.mul(Vn(r,1))).toVar("start"),a=Vn(O0.mul(Vn(i,1))).toVar("end");let o,l;e&&(o=Ie($d("instanceDistanceStart")).toVar("distanceStart"),l=Ie($d("instanceDistanceEnd")).toVar("distanceEnd")),t&&(M6.assign(s.xyz),QF.assign(a.xyz));const u=Ub.z.div(Ub.w),d=pu.element(2).element(3).equal(-1);if(nr(d,()=>{nr(s.z.lessThan(0).and(a.z.greaterThan(0)),()=>{const b=eJ({start:s,end:a});a.assign(Vn(ui(s.xyz,a.xyz,b),a.w)),e&&l.assign(ui(o,l,b))}).ElseIf(a.z.lessThan(0).and(s.z.greaterThanEqual(0)),()=>{const b=eJ({start:a,end:s});s.assign(Vn(ui(a.xyz,s.xyz,b),s.w)),e&&o.assign(ui(l,o,b))})}),e){const b=n.dashScaleNode?Ie(n.dashScaleNode):kG,_=n.offsetNode?Ie(n.offsetNode):LG;let M=uc.y.lessThan(.5).select(b.mul(o),b.mul(l));M=M.add(_),Zpe.assign(M)}const h=pu.mul(s),f=pu.mul(a),p=h.xyz.div(h.w),g=f.xyz.div(f.w),A=g.xy.sub(p.xy).toVar();A.x.assign(A.x.mul(u)),A.assign(A.normalize());const x=Vn().toVar();if(t){const b=a.xyz.sub(s.xyz).normalize(),_=ui(s.xyz,a.xyz,.5).normalize(),M=b.cross(_).normalize(),T=b.cross(M);$x.assign(uc.y.lessThan(.5).select(s,a));const L=Lk.mul(.5);$x.addAssign(Vn(uc.x.lessThan(0).select(M.mul(L),M.mul(L).negate()),0)),e||($x.addAssign(Vn(uc.y.lessThan(.5).select(b.mul(L).negate(),b.mul(L)),0)),$x.addAssign(Vn(T.mul(L),0)),nr(uc.y.greaterThan(1).or(uc.y.lessThan(0)),()=>{$x.subAssign(Vn(T.mul(2).mul(L),0))})),x.assign(pu.mul($x));const D=ct().toVar();D.assign(uc.y.lessThan(.5).select(p,g)),x.z.assign(D.z.mul(x.w))}else{const b=Cn(A.y,A.x.negate()).toVar("offset");A.x.assign(A.x.div(u)),b.x.assign(b.x.div(u)),b.assign(uc.x.lessThan(0).select(b.negate(),b)),nr(uc.y.lessThan(0),()=>{b.assign(b.sub(A))}).ElseIf(uc.y.greaterThan(1),()=>{b.assign(b.add(A))}),b.assign(b.mul(Lk)),b.assign(b.div(Ub.w.div(yG))),x.assign(uc.y.lessThan(.5).select(h,f)),b.assign(b.mul(x.w)),x.assign(x.add(Vn(b,0,0)))}return x})();ut(({material:n,renderer:e})=>{const t=n._useAlphaToCoverage,r=n._useDash,i=n._useWorldUnits,s=ws();if(r){const o=n.dashSizeNode?Ie(n.dashSizeNode):RG,l=n.gapSizeNode?Ie(n.gapSizeNode):PG;Uv.assign(o),U5.assign(l),s.y.lessThan(-1).or(s.y.greaterThan(1)).discard(),Zpe.mod(Uv.add(U5)).greaterThan(Uv).discard()}const a=Ie(1).toVar("alpha");if(i){const o=$x.xyz.normalize().mul(1e5),l=QF.sub(M6),u=mGe({p1:M6,p2:QF,p3:ct(0,0,0),p4:o}),d=M6.add(l.mul(u.x)),h=o.mul(u.y),g=d.sub(h).length().div(Lk);if(!r)if(t&&e.currentSamples>0){const A=g.fwidth();a.assign(rh(A.negate().add(.5),A.add(.5),g).oneMinus())}else g.greaterThan(.5).discard()}else if(t&&e.currentSamples>0){const o=s.x,l=s.y.greaterThan(0).select(s.y.sub(1),s.y.add(1)),u=o.mul(o).add(l.mul(l)),d=Ie(u.fwidth()).toVar("dlen");nr(s.y.abs().greaterThan(1),()=>{a.assign(rh(d.oneMinus(),d.add(1),u).oneMinus())})}else nr(s.y.abs().greaterThan(1),()=>{const o=s.x,l=s.y.greaterThan(0).select(s.y.sub(1),s.y.add(1));o.mul(o).add(l.mul(l)).greaterThan(1).discard()});return a})();const gGe=new n8e;class AGe extends Va{static get type(){return"MeshNormalNodeMaterial"}constructor(e){super(),this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(gGe),this.setValues(e)}setupDiffuseColor(){const e=this.opacityNode?Ie(this.opacityNode):MG;As.assign(AR(Vn(CG(Ri),e),Pl))}}const zG=ut(([n=wG])=>{const e=n.z.atan(n.x).mul(1/(Math.PI*2)).add(.5),t=n.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return Cn(e,t)}),KF=ut(([n=ws()])=>{const e=n.x.sub(.5).mul(Math.PI*2),t=n.y.sub(.5).mul(Math.PI),r=t.cos(),i=r.mul(e.cos()),s=t.sin(),a=r.mul(e.sin());return ct(i,s,a)});class Jpe extends cp{constructor(e=1,t={}){super(e,e,t),this.isCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new __(i),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){const r=t.minFilter,i=t.generateMipmaps;t.generateMipmaps=!0,this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const s=new W1(5,5,5),a=zG(wG),o=new Va;o.colorNode=Pi(t,a,0),o.side=us,o.blending=qo;const l=new ns(s,o),u=new $V;u.add(l),t.minFilter===hu&&(t.minFilter=bs);const d=new fue(1,10,this),h=e.getMRT();return e.setMRT(null),d.update(e,u),e.setMRT(h),t.minFilter=r,t.generateMipmaps=i,l.geometry.dispose(),l.material.dispose(),this}clear(e,t=!0,r=!0,i=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,r,i);e.setRenderTarget(s)}}const _4=new WeakMap;class xGe extends za{static get type(){return"CubeMapNode"}constructor(e){super("vec3"),this.envNode=e,this._cubeTexture=null,this._cubeTextureNode=du(null);const t=new __;t.isRenderTargetTexture=!0,this._defaultTexture=t,this.updateBeforeType=Tr.RENDER}updateBefore(e){const{renderer:t,material:r}=e,i=this.envNode;if(i.isTextureNode||i.isMaterialReferenceNode){const s=i.isTextureNode?i.value:r[i.property];if(s&&s.isTexture){const a=s.mapping;if(a===Mb||a===kb){if(_4.has(s)){const o=_4.get(s);tJ(o,s.mapping),this._cubeTexture=o}else{const o=s.image;if(vGe(o)){const l=new Jpe(o.height);l.fromEquirectangularTexture(t,s),tJ(l.texture,s.mapping),this._cubeTexture=l.texture,_4.set(s,l.texture),s.addEventListener("dispose",e0e)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(e){return this.updateBefore(e),this._cubeTextureNode}}function vGe(n){return n==null?!1:n.height>0}function e0e(n){const e=n.target;e.removeEventListener("dispose",e0e);const t=_4.get(e);t!==void 0&&(_4.delete(e),t.dispose())}function tJ(n,e){e===Mb?n.mapping=np:e===kb&&(n.mapping=R0)}const t0e=ri(xGe).setParameterLength(1);class GG extends M_{static get type(){return"BasicEnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){e.context.environment=t0e(this.envNode)}}class yGe extends M_{static get type(){return"BasicLightMapNode"}constructor(e=null){super(),this.lightMapNode=e}setup(e){const t=Ie(1/Math.PI);e.context.irradianceLightMap=this.lightMapNode.mul(t)}}class NR{start(e){e.lightsNode.setupLights(e,e.lightsNode.getLightNodes(e)),this.indirect(e)}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class n0e extends NR{constructor(){super()}indirect({context:e}){const t=e.ambientOcclusion,r=e.reflectedLight,i=e.irradianceLightMap;r.indirectDiffuse.assign(Vn(0)),i?r.indirectDiffuse.addAssign(i):r.indirectDiffuse.addAssign(Vn(1,1,1,0)),r.indirectDiffuse.mulAssign(t),r.indirectDiffuse.mulAssign(As.rgb)}finish(e){const{material:t,context:r}=e,i=r.outgoingLight,s=e.context.environment;if(s)switch(t.combine){case vT:i.rgb.assign(ui(i.rgb,i.rgb.mul(s.rgb),w4.mul(N6)));break;case Fce:i.rgb.assign(ui(i.rgb,s.rgb,w4.mul(N6)));break;case Uce:i.rgb.addAssign(s.rgb.mul(w4.mul(N6)));break;default:an("BasicLightingModel: Unsupported .combine value:",t.combine);break}}}const bGe=new Lh;class wGe extends Va{static get type(){return"MeshBasicNodeMaterial"}constructor(e){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(bGe),this.setValues(e)}setupNormal(){return ky(Jw)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new GG(t):null}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new yGe(OG)),t}setupOutgoingLight(){return As.rgb}setupLightingModel(){return new n0e}}const e_=ut(({f0:n,f90:e,dotVH:t})=>{const r=t.mul(-5.55473).sub(6.98316).mul(t).exp2();return n.mul(r.oneMinus()).add(e.mul(r))}),dy=ut(n=>n.diffuseColor.mul(1/Math.PI)),_Ge=()=>Ie(.25),SGe=ut(({dotNH:n})=>Mk.mul(Ie(.5)).add(1).mul(Ie(1/Math.PI)).mul(n.pow(Mk))),TGe=ut(({lightDirection:n})=>{const e=n.add(Os).normalize(),t=Ri.dot(e).clamp(),r=Os.dot(e).clamp(),i=e_({f0:R1,f90:1,dotVH:r}),s=_Ge(),a=SGe({dotNH:t});return i.mul(s).mul(a)});class r0e extends n0e{constructor(e=!0){super(),this.specular=e}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ri.dot(e).clamp().mul(t);r.directDiffuse.addAssign(s.mul(dy({diffuseColor:As.rgb}))),this.specular===!0&&r.directSpecular.addAssign(s.mul(TGe({lightDirection:e})).mul(w4))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:i}=e.context;i.indirectDiffuse.addAssign(r.mul(dy({diffuseColor:As}))),i.indirectDiffuse.mulAssign(t)}}const EGe=new hg;class CGe extends Va{static get type(){return"MeshLambertNodeMaterial"}constructor(e){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(EGe),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new GG(t):null}setupLightingModel(){return new r0e(!1)}}const NGe=new uue;class MGe extends Va{static get type(){return"MeshPhongNodeMaterial"}constructor(e){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(NGe),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new GG(t):null}setupLightingModel(){return new r0e}setupVariants(){const e=(this.shininessNode?Ie(this.shininessNode):upe).max(1e-4);Mk.assign(e);const t=this.specularNode||hpe;R1.assign(t)}}const i0e=ut(n=>{if(n.geometry.hasAttribute("normal")===!1)return Ie(0);const e=Jw.dFdx().abs().max(Jw.dFdy().abs());return e.x.max(e.y).max(e.z)}),qG=ut(n=>{const{roughness:e}=n,t=i0e();let r=e.max(.0525);return r=r.add(t),r=r.min(1),r}),s0e=ut(({alpha:n,dotNL:e,dotNV:t})=>{const r=n.pow2(),i=e.mul(r.add(r.oneMinus().mul(t.pow2())).sqrt()),s=t.mul(r.add(r.oneMinus().mul(e.pow2())).sqrt());return nh(.5,i.add(s).max(fR))}).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),kGe=ut(({alphaT:n,alphaB:e,dotTV:t,dotBV:r,dotTL:i,dotBL:s,dotNV:a,dotNL:o})=>{const l=o.mul(ct(n.mul(t),e.mul(r),a).length()),u=a.mul(ct(n.mul(i),e.mul(s),o).length());return nh(.5,l.add(u).max(fR))}).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),a0e=ut(({alpha:n,dotNH:e})=>{const t=n.pow2(),r=e.pow2().mul(t.oneMinus()).oneMinus();return t.div(r.pow2()).mul(1/Math.PI)}
vendor: 2,207 bytes, line 4313
4313).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),RGe=Ie(1/Math.PI),PGe=ut(({alphaT:n,alphaB:e,dotNH:t,dotTH:r,dotBH:i})=>{const s=n.mul(e),a=ct(e.mul(r),n.mul(i),s.mul(t)),o=a.dot(a),l=s.div(o);return RGe.mul(s.mul(l.pow2()))}).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),$G=ut(({lightDirection:n,f0:e,f90:t,roughness:r,f:i,normalView:s=Ri,USE_IRIDESCENCE:a,USE_ANISOTROPY:o})=>{const l=r.pow2(),u=n.add(Os).normalize(),d=s.dot(n).clamp(),h=s.dot(Os).clamp(),f=s.dot(u).clamp(),p=Os.dot(u).clamp();let g=e_({f0:e,f90:t,dotVH:p}),A,x;if(Kw(a)&&(g=uR.mix(g,i)),Kw(o)){const b=y4.dot(n),_=y4.dot(Os),M=y4.dot(u),T=Fv.dot(n),L=Fv.dot(Os),D=Fv.dot(u);A=kGe({alphaT:Nk,alphaB:l,dotTV:_,dotBV:L,dotTL:b,dotBL:T,dotNV:h,dotNL:d}),x=PGe({alphaT:Nk,alphaB:l,dotNH:f,dotTH:M,dotBH:D})}else A=s0e({alpha:l,dotNL:d,dotNV:h}),x=a0e({alpha:l,dotNH:f});return g.mul(A).mul(x)}),LGe=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: 3,217 bytes, line 4313
431314942,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 Lp=null;const B5=ut(({roughness:n,dotNV:e})=>{Lp===null&&(Lp=new YV(LGe,16,16,fl,Js),Lp.name="DFG_LUT",Lp.minFilter=bs,Lp.magFilter=bs,Lp.wrapS=Uu,Lp.wrapT=Uu,Lp.generateMipmaps=!1,Lp.needsUpdate=!0);const t=Cn(n,e);return Pi(Lp,t).rg}),OGe=ut(({lightDirection:n,f0:e,f90:t,roughness:r,f:i,USE_IRIDESCENCE:s,USE_ANISOTROPY:a})=>{const o=$G({lightDirection:n,f0:e,f90:t,roughness:r,f:i,USE_IRIDESCENCE:s,USE_ANISOTROPY:a}),l=Ri.dot(n).clamp(),u=Ri.dot(Os).clamp(),d=B5({roughness:r,dotNV:u}),h=B5({roughness:r,dotNV:l}),f=e.mul(d.x).add(t.mul(d.y)),p=e.mul(h.x).add(t.mul(h.y)),g=d.x.add(d.y),A=h.x.add(h.y),x=Ie(1).sub(g),b=Ie(1).sub(A),_=e.add(e.oneMinus().mul(.047619)),M=f.mul(p).mul(_).div(Ie(1).sub(x.mul(b).mul(_).mul(_)).add(fR)),T=x.mul(b),L=M.mul(T);return o.add(L)}),o0e=ut(n=>{const{dotNV:e,specularColor:t,specularF90:r,roughness:i}=n,s=B5({dotNV:e,roughness:i});return t.mul(s.x).add(r.mul(s.y))}),ZF=ut(({f:n,f90:e,dotVH:t})=>{const r=t.oneMinus().saturate(),i=r.mul(r),s=r.mul(i,i).clamp(0,.9999);return n.sub(ct(e).mul(s)).div(s.oneMinus())}).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),DGe=ut(({roughness:n,dotNH:e})=>{const t=n.pow2(),r=Ie(1).div(t),s=e.pow2().oneMinus().max(.0078125);return Ie(2).add(r).mul(s.pow(r.mul(.5))).div(2*Math.PI)}
vendor: 4,301 bytes, line 4313
4313).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),jGe=ut(({dotNV:n,dotNL:e})=>Ie(1).div(Ie(4).mul(e.add(n).sub(e.mul(n))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),IGe=ut(({lightDirection:n})=>{const e=n.add(Os).normalize(),t=Ri.dot(n).clamp(),r=Ri.dot(Os).clamp(),i=Ri.dot(e).clamp(),s=DGe({roughness:NA,dotNH:i}),a=jGe({dotNV:r,dotNL:t});return Cd.mul(s).mul(a)}),nJ=ut(({N:n,V:e,roughness:t})=>{const s=.0078125,a=n.dot(e).saturate(),o=Cn(t,a.oneMinus().sqrt());return o.assign(o.mul(.984375).add(s)),o}).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),FGe=ut(({f:n})=>{const e=n.length();return Na(e.mul(e).add(n.z).div(e.add(1)),0)}).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),qC=ut(({v1:n,v2:e})=>{const t=n.dot(e),r=t.abs().toVar(),i=r.mul(.0145206).add(.4965155).mul(r).add(.8543985).toVar(),s=r.add(4.1616724).mul(r).add(3.417594).toVar(),a=i.div(s),o=t.greaterThan(0).select(a,Na(t.mul(t).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return n.cross(e).mul(o)}).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),yL=ut(({N:n,V:e,P:t,mInv:r,p0:i,p1:s,p2:a,p3:o})=>{const l=s.sub(i).toVar(),u=o.sub(i).toVar(),d=l.cross(u),h=ct().toVar();return nr(d.dot(t.sub(i)).greaterThanEqual(0),()=>{const f=e.sub(n.mul(e.dot(n))).normalize(),p=n.cross(f).negate(),g=r.mul(gl(f,p,n).transpose()).toVar(),A=g.mul(i.sub(t)).normalize().toVar(),x=g.mul(s.sub(t)).normalize().toVar(),b=g.mul(a.sub(t)).normalize().toVar(),_=g.mul(o.sub(t)).normalize().toVar(),M=ct(0).toVar();M.addAssign(qC({v1:A,v2:x})),M.addAssign(qC({v1:x,v2:b})),M.addAssign(qC({v1:b,v2:_})),M.addAssign(qC({v1:_,v2:A})),h.assign(ct(FGe({f:M})))}),h}).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),MR=1/6,l0e=n=>Pr(MR,Pr(n,Pr(n,n.negate().add(3)).sub(3)).add(1)),JF=n=>Pr(MR,Pr(n,Pr(n,Pr(3,n).sub(6))).add(4)),c0e=n=>Pr(MR,Pr(n,Pr(n,Pr(-3,n).add(3)).add(3)).add(1)),eU=n=>Pr(MR,Ih(n,3)),rJ=n=>l0e(n).add(JF(n)),iJ=n=>c0e(n).add(eU(n)),sJ=n=>fo(-1,JF(n).div(l0e(n).add(JF(n)))),aJ=n=>fo(1,eU(n).div(c0e(n).add(eU(n)))),oJ=(n,e,t)=>{const r=n.uvNode,i=Pr(r,e.zw).add(.5),s=b0(i),a=rp(i),o=rJ(a.x),l=iJ(a.x),u=sJ(a.x),d=aJ(a.x),h=sJ(a.y),f=aJ(a.y),p=Cn(s.x.add(u),s.y.add(h)).sub(.5).mul(e.xy),g=Cn(s.x.add(d),s.y.add(h)).sub(.5).mul(e.xy),A=Cn(s.x.add(u),s.y.add(f)).sub(.5).mul(e.xy),x=Cn(s.x.add(d),s.y.add(f)).sub(.5).mul(e.xy),b=rJ(a.y).mul(fo(o.mul(n.sample(p).level(t)),l.mul(n.sample(g).level(t)))),_=iJ(a.y).mul(fo(o.mul(n.sample(A).level(t)),l.mul(n.sample(x).level(t))));return b.add(_)},HG=ut(([n,e])=>{const t=Cn(n.size(st(e))),r=Cn(n.size(st(e.add(1)))),i=nh(1,t),s=nh(1,r),a=oJ(n,Vn(i,t),b0(e)),o=oJ(n,Vn(s,r),mR(e));return rp(e).mix(a,o)}),UGe=ut(([n,e])=>{const t=e.mul(AG(n));return HG(n,t)}),lJ=ut(([n,e,t,r,i])=>{const s=ct(iG(e.negate(),_c(n),nh(1,r))),a=ct(w0(i[0].xyz),w0(i[1].xyz),w0(i[2].xyz));return _c(s).mul(t.mul(a))}).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),BGe=ut(([n,e])=>n.mul(ip(e.mul(2).sub(2),0,1))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),VGe=FG(),zGe=Wpe(),cJ=ut(([n,e,t],{material:r})=>{const s=(r.side===us?VGe:zGe).sample(n),a=y0(cy.x).mul(BGe(e,t));return HG(s,a)}),uJ=ut(([n,e,t])=>(nr(t.notEqual(0),()=>{const r=pR(e).negate().div(t);return $z(r.negate().mul(n))}),ct(1))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),GGe=ut(([n,e,t,r,i,s,a,o,l,u,d,h,f,p,g])=>{let A,x;if(g){A=Vn().toVar(),x=ct().toVar();const L=d.sub(1).mul(g.mul(.025)),D=ct(d.sub(L),d,d.add(L));ys({start:0,end:3},({i:P})=>
vendor: 1,998 bytes, line 4313
4313{const O=D.element(P),F=lJ(n,e,h,O,o),U=a.add(F),B=u.mul(l.mul(Vn(U,1))),z=Cn(B.xy.div(B.w)).toVar();z.addAssign(1),z.divAssign(2),z.assign(Cn(z.x,z.y.oneMinus()));const H=cJ(z,t,O);A.element(P).assign(H.element(P)),A.a.addAssign(H.a),x.element(P).assign(r.element(P).mul(uJ(w0(F),f,p).element(P)))}),A.a.divAssign(3)}else{const L=lJ(n,e,h,d,o),D=a.add(L),P=u.mul(l.mul(Vn(D,1))),O=Cn(P.xy.div(P.w)).toVar();O.addAssign(1),O.divAssign(2),O.assign(Cn(O.x,O.y.oneMinus())),A=cJ(O,t,d),x=r.mul(uJ(w0(L),f,p))}const b=x.rgb.mul(A.rgb),_=n.dot(e).clamp(),M=ct(o0e({dotNV:_,specularColor:i,specularF90:s,roughness:t})),T=x.r.add(x.g,x.b).div(3);return Vn(M.oneMinus().mul(b),A.a.oneMinus().mul(T).oneMinus())}),qGe=gl(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),$Ge=n=>{const e=n.sqrt();return ct(1).add(e).div(ct(1).sub(e))},dJ=(n,e)=>n.sub(e).div(n.add(e)).pow2(),HGe=(n,e)=>{const t=n.mul(2*Math.PI*1e-9),r=ct(54856e-17,44201e-17,52481e-17),i=ct(1681e3,1795300,2208400),s=ct(43278e5,93046e5,66121e5),a=Ie(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(t.mul(2239900).add(e.x).cos()).mul(t.pow2().mul(-45282e5).exp());let o=r.mul(s.mul(2*Math.PI).sqrt()).mul(i.mul(t).add(e).cos()).mul(t.pow2().negate().mul(s).exp());return o=ct(o.x.add(a),o.y,o.z).div(10685e-11),qGe.mul(o)},hJ=ut(({outsideIOR:n,eta2:e,cosTheta1:t,thinFilmThickness:r,baseF0:i})=>{const s=ui(n,e,rh(0,.03,r)),o=n.div(s).pow2().mul(t.pow2().oneMinus()).oneMinus();nr(o.lessThan(0),()=>ct(1));const l=o.sqrt(),u=dJ(s,n),d=e_({f0:u,f90:1,dotVH:t}),h=d.oneMinus(),f=s.lessThan(n).select(Math.PI,0),p=Ie(Math.PI).sub(f),g=$Ge(i.clamp(0,.9999)),A=dJ(g,s.toVec3()),x=e_({f0:A,f90:1,dotVH:l}),b=ct(g.x.lessThan(s).select(Math.PI,0),g.y.lessThan(s).select(Math.PI,0),g.z.lessThan(s).select(Math.PI,0)),_=s.mul(r,l,2),M=ct(p).add(b),T=d.mul(x).clamp(1e-5,.9999),L=T.sqrt(),D=h.pow2().mul(x).div(ct(1).sub(T)),O=d.add(D).toVar(),F=D.sub(h).toVar();return ys({start:1,end:2,condition:"<=",name:"m"},({m:U}
vendor: 11,110 bytes, line 4313
4313)=>{F.mulAssign(L);const B=HGe(Ie(U).mul(_),Ie(U).mul(M)).mul(2);O.addAssign(F.mul(B))}),O.max(ct(0))}).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),F3=ut(({normal:n,viewDir:e,roughness:t})=>{const r=n.dot(e).saturate(),i=t.mul(t),s=t.add(.1).reciprocal(),a=Ie(-1.9362).add(t.mul(1.0678)).add(i.mul(.4573)).sub(s.mul(.8469)),o=Ie(-.6014).add(t.mul(.5538)).sub(i.mul(.467)).sub(s.mul(.1255));return a.mul(r).add(o).exp().saturate()}),U3=ct(.04),$C=Ie(1);class u0e extends NR{constructor(e=!1,t=!1,r=!1,i=!1,s=!1,a=!1){super(),this.clearcoat=e,this.sheen=t,this.iridescence=r,this.anisotropy=i,this.transmission=s,this.dispersion=a,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null,this.iridescenceF0Dielectric=null,this.iridescenceF0Metallic=null}start(e){if(this.clearcoat===!0&&(this.clearcoatRadiance=ct().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=ct().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=ct().toVar("clearcoatSpecularIndirect")),this.sheen===!0&&(this.sheenSpecularDirect=ct().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=ct().toVar("sheenSpecularIndirect")),this.iridescence===!0){const t=Ri.dot(Os).clamp(),r=hJ({outsideIOR:Ie(1),eta2:Ek,cosTheta1:t,thinFilmThickness:Ck,baseF0:R1}),i=hJ({outsideIOR:Ie(1),eta2:Ek,cosTheta1:t,thinFilmThickness:Ck,baseF0:As.rgb});this.iridescenceFresnel=ui(r,i,Fm),this.iridescenceF0Dielectric=ZF({f:r,f90:1,dotVH:t}),this.iridescenceF0Metallic=ZF({f:i,f90:1,dotVH:t}),this.iridescenceF0=ui(this.iridescenceF0Dielectric,this.iridescenceF0Metallic,Fm)}if(this.transmission===!0){const t=_0,r=jfe.sub(_0).normalize(),i=K1,s=e.context;s.backdrop=GGe(i,r,e0,Jx,mv,gv,t,Fh,Q1,pu,b4,Bz,zz,Vz,this.dispersion?Gz:null),s.backdropAlpha=kk,As.a.mulAssign(ui(1,s.backdrop.a,kk))}super.start(e)}computeMultiscattering(e,t,r,i,s=null){const a=Ri.dot(Os).clamp(),o=B5({roughness:e0,dotNV:a}),l=s?uR.mix(i,s):i,u=l.mul(o.x).add(r.mul(o.y)),h=o.x.add(o.y).oneMinus(),f=l.add(l.oneMinus().mul(.047619)),p=u.mul(f).div(h.mul(f).oneMinus());e.addAssign(u),t.addAssign(p.mul(h))}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ri.dot(e).clamp().mul(t).toVar();if(this.sheen===!0){this.sheenSpecularDirect.addAssign(s.mul(IGe({lightDirection:e})));const a=F3({normal:Ri,viewDir:Os,roughness:NA}),o=F3({normal:Ri,viewDir:e,roughness:NA}),l=Cd.r.max(Cd.g).max(Cd.b).mul(a.max(o)).oneMinus();s.mulAssign(l)}if(this.clearcoat===!0){const o=RA.dot(e).clamp().mul(t);this.clearcoatSpecularDirect.addAssign(o.mul($G({lightDirection:e,f0:U3,f90:$C,roughness:jb,normalView:RA})))}r.directDiffuse.addAssign(s.mul(dy({diffuseColor:Jx}))),r.directSpecular.addAssign(s.mul(OGe({lightDirection:e,f0:mv,f90:1,roughness:e0,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:i,reflectedLight:s,ltc_1:a,ltc_2:o}){const l=t.add(r).sub(i),u=t.sub(r).sub(i),d=t.sub(r).add(i),h=t.add(r).add(i),f=Ri,p=Os,g=Ja.toVar(),A=nJ({N:f,V:p,roughness:e0}),x=a.sample(A).toVar(),b=o.sample(A).toVar(),_=gl(ct(x.x,0,x.y),ct(0,1,0),ct(x.z,0,x.w)).toVar(),M=mv.mul(b.x).add(gv.sub(mv).mul(b.y)).toVar();if(s.directSpecular.addAssign(e.mul(M).mul(yL({N:f,V:p,P:g,mInv:_,p0:l,p1:u,p2:d,p3:h}))),s.directDiffuse.addAssign(e.mul(Jx).mul(yL({N:f,V:p,P:g,mInv:gl(1,0,0,0,1,0,0,0,1),p0:l,p1:u,p2:d,p3:h}))),this.clearcoat===!0){const T=RA,L=nJ({N:T,V:p,roughness:jb}),D=a.sample(L),P=o.sample(L),O=gl(ct(D.x,0,D.y),ct(0,1,0),ct(D.z,0,D.w)),F=U3.mul(P.x).add($C.sub(U3).mul(P.y));this.clearcoatSpecularDirect.addAssign(e.mul(F).mul(yL({N:T,V:p,P:g,mInv:O,p0:l,p1:u,p2:d,p3:h})))}}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e),this.ambientOcclusion(e)}indirectDiffuse(e){const{irradiance:t,reflectedLight:r}=e.context,i=t.mul(dy({diffuseColor:Jx})).toVar();if(this.sheen===!0){const s=F3({normal:Ri,viewDir:Os,roughness:NA}),a=Cd.r.max(Cd.g).max(Cd.b).mul(s).oneMinus();i.mulAssign(a)}r.indirectDiffuse.addAssign(i)}indirectSpecular(e){const{radiance:t,iblIrradiance:r,reflectedLight:i}=e.context;if(this.sheen===!0&&this.sheenSpecularIndirect.addAssign(r.mul(Cd,F3({normal:Ri,viewDir:Os,roughness:NA}))),this.clearcoat===!0){const x=RA.dot(Os).clamp(),b=o0e({dotNV:x,specularColor:U3,specularF90:$C,roughness:jb});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(b))}const s=ct().toVar("singleScatteringDielectric"),a=ct().toVar("multiScatteringDielectric"),o=ct().toVar("singleScatteringMetallic"),l=ct().toVar("multiScatteringMetallic");this.computeMultiscattering(s,a,gv,R1,this.iridescenceF0Dielectric),this.computeMultiscattering(o,l,gv,As.rgb,this.iridescenceF0Metallic);const u=ui(s,o,Fm),d=ui(a,l,Fm),h=s.add(a),f=Jx.mul(h.oneMinus()),p=r.mul(1/Math.PI),g=t.mul(u).add(d.mul(p)).toVar(),A=f.mul(p).toVar();if(this.sheen===!0){const x=F3({normal:Ri,viewDir:Os,roughness:NA}),b=Cd.r.max(Cd.g).max(Cd.b).mul(x).oneMinus();g.mulAssign(b),A.mulAssign(b)}i.indirectSpecular.addAssign(g),i.indirectDiffuse.addAssign(A)}ambientOcclusion(e){const{ambientOcclusion:t,reflectedLight:r}=e.context,s=Ri.dot(Os).clamp().add(t),a=e0.mul(-16).oneMinus().negate().exp2(),o=t.sub(s.pow(a).oneMinus()).clamp();this.clearcoat===!0&&this.clearcoatSpecularIndirect.mulAssign(t),this.sheen===!0&&this.sheenSpecularIndirect.mulAssign(t),r.indirectDiffuse.mulAssign(t),r.indirectSpecular.mulAssign(o)}finish({context:e}){const{outgoingLight:t}=e;if(this.clearcoat===!0){const r=RA.dot(Os).clamp(),i=e_({dotVH:r,f0:U3,f90:$C}),s=t.mul(Tk.mul(i).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(Tk));t.assign(s)}if(this.sheen===!0){const r=t.add(this.sheenSpecularDirect,this.sheenSpecularIndirect.mul(1/Math.PI));t.assign(r)}}}const fJ=Ie(1),tU=Ie(-2),HC=Ie(.8),bL=Ie(-1),WC=Ie(.4),wL=Ie(2),XC=Ie(.305),_L=Ie(3),pJ=Ie(.21),WGe=Ie(4),mJ=Ie(4),XGe=Ie(16),YGe=ut(([n])=>{const e=ct(zs(n)).toVar(),t=Ie(-1).toVar();return nr(e.x.greaterThan(e.z),()=>{nr(e.x.greaterThan(e.y),()=>{t.assign(yc(n.x.greaterThan(0),0,3))}).Else(()=>{t.assign(yc(n.y.greaterThan(0),1,4))})}).Else(()=>{nr(e.z.greaterThan(e.y),()=>{t.assign(yc(n.z.greaterThan(0),2,5))}).Else(()=>{t.assign(yc(n.y.greaterThan(0),1,4))})}),t}).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),QGe=ut(([n,e])=>{const t=Cn().toVar();return nr(e.equal(0),()=>{t.assign(Cn(n.z,n.y).div(zs(n.x)))}).ElseIf(e.equal(1),()=>{t.assign(Cn(n.x.negate(),n.z.negate()).div(zs(n.y)))}).ElseIf(e.equal(2),()=>{t.assign(Cn(n.x.negate(),n.y).div(zs(n.z)))}).ElseIf(e.equal(3),()=>{t.assign(Cn(n.z.negate(),n.y).div(zs(n.x)))}).ElseIf(e.equal(4),()=>{t.assign(Cn(n.x.negate(),n.z).div(zs(n.y)))}).Else(()=>{t.assign(Cn(n.x,n.y).div(zs(n.z)))}),Pr(.5,t.add(1))}).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),KGe=ut(([n])=>{const e=Ie(0).toVar();return nr(n.greaterThanEqual(HC),()=>{e.assign(fJ.sub(n).mul(bL.sub(tU)).div(fJ.sub(HC)).add(tU))}).ElseIf(n.greaterThanEqual(WC),()=>{e.assign(HC.sub(n).mul(wL.sub(bL)).div(HC.sub(WC)).add(bL))}).ElseIf(n.greaterThanEqual(XC),()=>{e.assign(WC.sub(n).mul(_L.sub(wL)).div(WC.sub(XC)).add(wL))}).ElseIf(n.greaterThanEqual(pJ),()=>{e.assign(XC.sub(n).mul(WGe.sub(_L)).div(XC.sub(pJ)).add(_L))}).Else(()=>{e.assign(Ie(-2).mul(y0(Pr(1.16,n))))}),e}).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),d0e=ut(([n,e])=>{const t=n.toVar();t.assign(Pr(2,t).sub(1));const r=ct(t,1).toVar();return nr(e.equal(0),()=>{r.assign(r.zyx)}).ElseIf(e.equal(1),()=>{r.assign(r.xzy),r.xz.mulAssign(-1)}).ElseIf(e.equal(2),()=>{r.x.mulAssign(-1)}).ElseIf(e.equal(3),()=>{r.assign(r.zyx),r.xz.mulAssign(-1)}).ElseIf(e.equal(4),()=>{r.assign(r.xzy),r.xy.mulAssign(-1)}).ElseIf(e.equal(5),()=>{r.z.mulAssign(-1)}),r}).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),h0e=ut(([n,e,t,r,i,s])=>{const a=Ie(t),o=ct(e),l=ip(KGe(a),tU,s),u=rp(l),d=b0(l),h=ct(V5(n,o,d,r,i,s)).toVar();return nr(u.notEqual(0),()=>{const f=ct(V5(n,o,d.add(1),r,i,s)).toVar();h.assign(ui(h,f,u))}),h}),V5=ut(([n,e,t,r,i,s])=>{const a=Ie(t).toVar(),o=ct(e),l=Ie(YGe(o)).toVar(),u=Ie(Na(mJ.sub(a),0)).toVar();a.assign(Na(a,mJ));const d=Ie(Zw(a)).toVar(),h=Cn(QGe(o,l).mul(d.sub(2)).add(1)).toVar();return nr(l.greaterThan(2),()=>{h.y.addAssign(d),l.subAssign(3)}),h.x.addAssign(l.mul(d)),h.x.addAssign(u.mul(Pr(3,XGe))),h.y.addAssign(Pr(4,Zw(s).sub(d))),h.x.mulAssign(r),h.y.mulAssign(i),n.sample(h).grad(Cn(),Cn())}),SL=ut(({envMap:n,mipInt:e,outputDirection:t,theta:r,axis:i,CUBEUV_TEXEL_WIDTH:s,CUBEUV_TEXEL_HEIGHT:a,CUBEUV_MAX_MIP:o})=>{const l=If(r),u=t.mul(l).add(i.cross(t).mul(ou(r))).add(i.mul(i.dot(t).mul(l.oneMinus())));return V5(n,u,e,s,a,o)}),f0e=ut(({n,latitudinal:e,poleAxis:t,outputDirection:r,weights:i,samples:s,dTheta:a,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:h})=>{const f=ct(yc(e,t,ag(t,r))).toVar();nr(f.equal(ct(0)),()=>{f.assign(ct(r.z,0,r.x.negate()))}),f.assign(_c(f));const p=ct().toVar();return p.addAssign(i.element(0).mul(SL({theta:0,axis:f,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:h}))),ys({start:st(1),end:n},({i:g})=>{nr(g.greaterThanEqual(s),()=>{qpe()});const A=Ie(a.mul(Ie(g))).toVar();p.addAssign(i.element(g).mul(SL({theta:A.mul(-1),axis:f,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:h}))),p.addAssign(i.element(g).mul(SL({theta:A,axis:f,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:h})))}),Vn(p,1)}),ZGe=ut(([n])=>{const e=un(n).toVar();return e.assign(e.shiftLeft(un(16)).bitOr(e.shiftRight(un(16)))),e.assign(e.bitAnd(un(1431655765)).shiftLeft(un(1)).bitOr(e.bitAnd(un(2863311530)).shiftRight(un(1)))),e.assign(e.bitAnd(un(858993459)).shiftLeft(un(2)).bitOr(e.bitAnd(un(3435973836)).shiftRight(un(2)))),e.assign(e.bitAnd(un(252645135)).shiftLeft(un(4)).bitOr(e.bitAnd(un(4042322160)).shiftRight(un(4)))),e.assign(e.bitAnd(un(16711935)).shiftLeft(un(8)).bitOr(e.bitAnd(un(4278255360)).shiftRight(un(8)))),Ie(e).mul(23283064365386963e-26)}),JGe=ut(([n,e])=>Cn(Ie(n).div(Ie(e)),ZGe(n))),eqe=ut(([n,e,t])=>{const r=t.mul(t).toConst(),i=ct(1,0,0).toConst(),s=ag(e,i).toConst(),a=gu(n.x).toConst(),o=Pr(2,3.14159265359).mul(n.y).toConst(),l=a.mul(If(o)).toConst(),u=a.mul(ou(o)).toVar(),d=Pr(.5,e.z.add(1)).toConst();u.assign(d.oneMinus().mul(gu(l.mul(l).oneMinus())).add(d.mul(u)));const h=i.mul(l).add(s.mul(u)).add(e.mul(gu(Na(0,l.mul(l).add(u.mul(u)).oneMinus()))));return _c(ct(r.mul(h.x),r.mul(h.y),Na(0,h.z)))}),p0e=ut(({roughness:n,mipInt:e,envMap:t,N_immutable:r,GGX_SAMPLES:i,CUBEUV_TEXEL_WIDTH:s,CUBEUV_TEXEL_HEIGHT:a,
vendor: 5,101 bytes, line 4313
4313CUBEUV_MAX_MIP:o})=>{const l=ct(r).toVar(),u=ct(0).toVar(),d=Ie(0).toVar();return nr(n.lessThan(.001),()=>{u.assign(V5(t,l,e,s,a,o))}).Else(()=>{const h=yc(zs(l.z).lessThan(.999),ct(0,0,1),ct(1,0,0)),f=_c(ag(h,l)).toVar(),p=ag(l,f).toVar();ys({start:un(0),end:i},({i:g})=>{const A=JGe(g,i),x=eqe(A,ct(0,0,1),n),b=_c(f.mul(x.x).add(p.mul(x.y)).add(l.mul(x.z))),_=_c(b.mul(Wh(l,b).mul(2)).sub(l)),M=Na(Wh(l,_),0);nr(M.greaterThan(0),()=>{const T=V5(t,_,e,s,a,o);u.addAssign(T.mul(M)),d.addAssign(M)})}),nr(d.greaterThan(0),()=>{u.assign(u.div(d))})}),Vn(u,1)}),KA=4,gJ=[.125,.215,.35,.446,.526,.582],ev=20,tqe=512,B3=new S_(-1,1,1,-1,0,1),nqe=new ul(90,1),AJ=new tr;let TL=null,EL=0,CL=0;const rqe=new Ve,Ik=new WeakMap,iqe=[3,1,5,0,4,2],NL=d0e(ws(),$d("faceIndex")).normalize(),kR=ct(NL.x,NL.y,NL.z);class sqe{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._ggxMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}get _hasInitialized(){return this._renderer.hasInitialized()}fromScene(e,t=0,r=.1,i=100,s={}){const{size:a=256,position:o=rqe,renderTarget:l=null}=s;if(this._setSize(a),this._hasInitialized===!1)throw new Error('THREE.PMREMGenerator: .fromScene() called before the backend is initialized. Use "await renderer.init();" before using this method.');TL=this._renderer.getRenderTarget(),EL=this._renderer.getActiveCubeFace(),CL=this._renderer.getActiveMipmapLevel();const u=l||this._allocateTarget(!0);return this._init(u),this._sceneToCubeUV(e,r,i,u,o),t>0&&this._blur(u,0,0,t),this._applyPMREM(u),this._cleanup(u),u}async fromSceneAsync(e,t=0,r=.1,i=100,s={}){return _i('PMREMGenerator: ".fromSceneAsync()" is deprecated. Use "await renderer.init()" instead.'),await this._renderer.init(),this.fromScene(e,t,r,i,s)}fromEquirectangular(e,t=null){if(this._hasInitialized===!1)throw new Error('THREE.PMREMGenerator: .fromEquirectangular() called before the backend is initialized. Use "await renderer.init();" before using this method.');return this._fromTexture(e,t)}async fromEquirectangularAsync(e,t=null){return _i('PMREMGenerator: ".fromEquirectangularAsync()" is deprecated. Use "await renderer.init()" instead.'),await this._renderer.init(),this._fromTexture(e,t)}fromCubemap(e,t=null){if(this._hasInitialized===!1)throw new Error('THREE.PMREMGenerator: .fromCubemap() called before the backend is initialized. Use "await renderer.init();" before using this method.');return this._fromTexture(e,t)}async fromCubemapAsync(e,t=null){return _i('PMREMGenerator: ".fromCubemapAsync()" is deprecated. Use "await renderer.init()" instead.'),await this._renderer.init(),this._fromTexture(e,t)}async compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=vJ(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=yJ(),await 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())}_setSizeFromTexture(e){e.mapping===np||e.mapping===R0?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4)}_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(TL,EL,CL),e.scissorTest=!1,this._setViewport(e,0,0,e.width,e.height)}_fromTexture(e,t){this._setSizeFromTexture(e),TL=this._renderer.getRenderTarget(),EL=this._renderer.getActiveCubeFace(),CL=this._renderer.getActiveMipmapLevel();const r=t||this._allocateTarget(!1);return this._init(r),this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTarget(e){const t=3*Math.max(this._cubeSize,112),r=4*this._cubeSize;return xJ(t,r,e)}_init(e){if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e.width||this._pingPongRenderTarget.height!==e.height){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=xJ(e.width,e.height);const{_lodMax:t}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=aqe(t)),this._blurMaterial=oqe(t,e.width,e.height),this._ggxMaterial=lqe(t,e.width,e.height)}}async _compileMaterial(e){const t=new ns(new ds,e);await this._renderer.compile(t,B3)}_sceneToCubeUV(e,t,r,i,s){const a=nqe;a.near=t,a.far=r;const o=[1,1,1,1,-1,1],l=[1,-1,1,-1,1,-1],u=this._renderer,d=u.autoClear;u.getClearColor(AJ),u.autoClear=!1,this._backgroundBox===null&&(this._backgroundBox=new ns(new W1,new Lh({name:"PMREM.Backgroun
4313d",side:us,depthWrite:!1,depthTest:!1})));const h=this._backgroundBox,f=h.material;let p=!1;const g=e.background;g?g.isColor&&(f.color.copy(g),e.background=null,p=!0):(f.color.copy(AJ),p=!0),u.setRenderTarget(i),u.clear(),p&&u.render(h,a);for(let A=0;A<6;A++){const x=A%3;x===0?(a.up.set(0,o[A],0),a.position.set(s.x,s.y,s.z),a.lookAt(s.x+l[A],s.y,s.z)):x===1?(a.up.set(0,0,o[A]),a.position.set(s.x,s.y,s.z),a.lookAt(s.x,s.y+l[A],s.z)):(a.up.set(0,o[A],0),a.position.set(s.x,s.y,s.z),a.lookAt(s.x,s.y,s.z+l[A]));const b=this._cubeSize;this._setViewport(i,x*b,A>2?b:0,b,b),u.render(e,a)}u.autoClear=d,e.background=g}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===np||e.mapping===R0;i?this._cubemapMaterial===null&&(this._cubemapMaterial=vJ(e)):this._equirectMaterial===null&&(this._equirectMaterial=yJ(e));const s=i?this._cubemapMaterial:this._equirectMaterial;s.fragmentNode.value=e;const a=this._lodMeshes[0];a.material=s;const o=this._cubeSize;this._setViewport(t,0,0,3*o,2*o),r.setRenderTarget(t),r.render(a,B3)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const i=this._lodMeshes.length;for(let s=1;s<i;s++)this._applyGGXFilter(e,s-1,s);t.autoClear=r}_applyGGXFilter(e,t,r){const i=this._renderer,s=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[r];o.material=a;const l=Ik.get(a),u=r/(this._lodMeshes.length-1),d=t/(this._lodMeshes.length-1),h=Math.sqrt(u*u-d*d),f=0+u*1.25,p=h*f,{_lodMax:g}=this,A=this._sizeLods[r],x=3*A*(r>g-KA?r-g+KA:0),b=4*(this._cubeSize-A);e.texture.frame=(e.texture.frame||0)+1,l.envMap.value=e.texture,l.roughness.value=p,l.mipInt.value=g-t,this._setViewport(s,x,b,3*A,2*A),i.setRenderTarget(s),i.render(o,B3),s.texture.frame=(s.texture.frame||0)+1,l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-r,this._setViewport(e,x,b,3*A,2*A),i.setRenderTarget(e),i.render(o,B3)}_blur(e,t,r,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,r,i,"latitudinal",s),this._halfBlur(a,e,r,r,i,"longitudinal",s)}_halfBlur(e,t,r,i,s,a,o){const l=this._renderer,u=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&sn("blur direction must be either latitudinal or longitudinal!");const d=3,h=this._lodMeshes[i];h.material=u;const f=Ik.get(u),p=this._sizeLods[r]-1,g=isFinite(s)?Math.PI/(2*p):2*Math.PI/(2*ev-1),A=s/g,x=isFinite(s)?1+Math.floor(d*A):ev;x>ev&&an(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${ev}`);const b=[];let _=0;for(let P=0;P<ev;++P){const O=P/A,F=Math.exp(-O*O/2);b.push(F),P===0?_+=F:P<x&&(_+=2*F)}for(let P=0;P<b.length;P++)b[P]=b[P]/_;e.texture.frame=(e.texture.frame||0)+1,f.envMap.value=e.texture,f.samples.value=x,f.weights.array=b,f.latitudinal.value=a==="latitudinal"?1:0,o&&(f.poleAxis.value=o);const{_lodMax:M}=this;f.dTheta.value=g,f.mipInt.value=M-r;const T=this._sizeLods[i],L=3*T*(i>M-KA?i-M+KA:0),D=4*(this._cubeSize-T);this._setViewport(t,L,D,3*T,2*T),l.setRenderTarget(t),l.render(h,B3)}_setViewport(e,t,r,i,s){this._renderer.isWebGLRenderer?(e.viewport.set(t,e.height-s-r,i,s),e.scissor.set(t,e.height-s-r,i,s)):(e.viewport.set(t,r,i,s),e.scissor.set(t,r,i,s))}}function aqe(n){const e=[],t=[],r=[];let i=n;const s=n-KA+1+gJ.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);e.push(o);let l=1/o;a>n-KA?l=gJ[a-n+KA-1]:a===0&&(l=0),t.push(l);const u=1/(o-2),d=-u,h=1+u,f=[d,d,h,d,h,h,d,d,h,h,d,h],p=6,g=6,A=3,x=2,b=1,_=new Float32Array(A*g*p),M=new Float32Array(x*g*p),T=new Float32Array(b*g*p);for(let D=0;D<p;D++){const P=D%3*2/3-1,O=D>2?0:-1,F=[P,O,0,P+2/3,O,0,P+2/3,O+1,0,P,O,0,P+2/3,O+1,0,P,O+1,0],U=iqe[D];_.set(F,A*g*U),M.set(f,x*g*U);const B=[U,U,U,U,U,U];T.set(B,b*g*U)}const L=new ds;L.setAttribute("position",new Ea(_,A)),L.setAttribute("uv",new Ea(M,x)),L.setAttribute("faceIndex",new Ea(T,b)),r.push(new ns(L,null)),i>KA&&i--}return{lodMeshes:r,sizeLods:e,sigmas:t}}function xJ(n,e,t){const r={magFilter:bs,minFilter:bs,generateMipmaps:!1,type:Js,format:to,colorSpace:Uw,depthBuffer:t},i=new cp(n,e,r);return i.texture.mapping=E1,i.texture.name="PMREM.cubeUv",i.texture.isPMREMTexture=!0,i.scissorTest=!0,i}function RR(n){const e=new Va;return e.depthTest=!1,e.depthWrite=!1,e.blending=qo,e.name=`PMREM_${n}`,e}function oqe(n,e,t){const r=Dl(new Array(ev).fill(0)),i=Qn(new Ve(0,1,0)),s=Qn(0),a=Ie(ev),o=Qn(0),l=Qn(1),u=Pi(),d=Qn(0),h=Ie(1/e),f=Ie(1/t),p=Ie(n),g={n:a,latitudinal:o,weights:r,poleAxis:i,outputDirection:kR,dTheta:s,samples:l,envMap:u,mipInt:d,CUBEUV_TEXEL_WIDTH:h,CUBEUV_TEXEL_HEIGHT:f,CUBEUV_MAX_MIP:p},A=RR("blur");return A.fragmentNode=f0e({...g,latitudinal:o.equal(1)}),Ik.set(A,g),A}function lqe(n,e,t){const r=Pi(),i=Qn(0),s=Qn(0),a=Ie(1/e),o=Ie(1/t),l=Ie(n),u={envMap:r,roughness:i,mipInt:s,CUBEUV_TEXEL_WIDTH:a,CUBEUV_TEXEL_HEIGHT:o,CUBEUV_MAX_MIP:l},d=RR("ggx");return d.fragmentNode=p0e({...u,N_immutable:kR,GGX_SAMPLES:un(tqe)}),Ik.set(d,u),d}function vJ(n){const e=RR("cubemap");return e.fragmentNode=du(n,kR),e}function yJ(n){const e=RR("equirect");return e.fragmentNode=Pi(n,zG(kR),0),e}const bJ=new WeakMap;function cqe(n){const e=Math.log2(n)-2,t=1/n;return{texelWidth:1/(3*Math.max(Math.pow(2,e),112)),texelHeight:t,maxMip:e}}function uqe(n,e,t){const r=dqe(e);let i=r.get(n);if((i!==void 0?i.pmremVersion:-1)!==n.pmremVersion){const a=n.image;if(n.isCubeTexture)if(fqe(a))i=t.fromCubemap(n,i);else return null;
4313else if(pqe(a))i=t.fromEquirectangular(n,i);else return null;if(i.pmremVersion=n.pmremVersion,r.has(n)===!1){const o=()=>{n.removeEventListener("dispose",o);const l=r.get(n);l!==void 0&&(l.dispose(),r.delete(n))};n.addEventListener("dispose",o)}r.set(n,i)}return i.texture}function dqe(n){let e=bJ.get(n);return e===void 0&&(e=new WeakMap,bJ.set(n,e)),e}class hqe extends za{static get type(){return"PMREMNode"}constructor(e,t=null,r=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=r,this._generator=null;const i=new ko;i.isRenderTargetTexture=!0,this._texture=Pi(i),this._width=Qn(0),this._height=Qn(0),this._maxMip=Qn(0),this.updateBeforeType=Tr.RENDER}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=cqe(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(e){let t=this._pmrem;const r=t?t.pmremVersion:-1,i=this._value;r!==i.pmremVersion&&(i.isPMREMTexture===!0||i.mapping===E1?t=i:t=uqe(i,e.renderer,this._generator),t!==null&&(this._pmrem=t,this.updateFromTexture(t)))}setup(e){this._generator===null&&(this._generator=new sqe(e.renderer)),this.updateBefore(e);let t=this.uvNode;t===null&&e.context.getUV&&(t=e.context.getUV(this,e)),t=this._pmrem.isRenderTargetTexture?Pk.mul(ct(t.x,t.y.negate(),t.z)):Pk.mul(t);let r=this.levelNode;return r===null&&e.context.getTextureLevel&&(r=e.context.getTextureLevel(this)),h0e(this._texture,t,r,this._width,this._height,this._maxMip)}dispose(){super.dispose(),this._generator!==null&&this._generator.dispose()}}function fqe(n){if(n==null)return!1;let e=0;const t=6;for(let r=0;r<t;r++)n[r]!==void 0&&e++;return e===t}function pqe(n){return n==null?!1:n.height>0}const WG=ri(hqe).setParameterLength(1,3),wJ=new WeakMap;class mqe extends M_{static get type(){return"EnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){const{material:t}=e;let r=this.envNode;if(r.isTextureNode||r.isMaterialReferenceNode){const h=r.isTextureNode?r.value:t[r.property],f=this._getPMREMNodeCache(e.renderer);let p=f.get(h);p===void 0&&(p=WG(h),f.set(h,p)),r=p}const s=t.useAnisotropy===!0||t.anisotropy>0?ape:Ri,a=r.context(_J(e0,s)).mul(C6),o=r.context(gqe(K1)).mul(Math.PI).mul(C6),l=Fb(a),u=Fb(o);e.context.radiance.addAssign(l),e.context.iblIrradiance.addAssign(u);const d=e.context.lightingModel.clearcoatRadiance;if(d){const h=r.context(_J(jb,RA)).mul(C6),f=Fb(h);d.addAssign(f)}}_getPMREMNodeCache(e){let t=wJ.get(e);return t===void 0&&(t=new WeakMap,wJ.set(e,t)),t}}const _J=(n,e)=>{let t=null;return{getUV:()=>(t===null&&(t=Os.negate().reflect(e),t=nG(n).mix(t,e).normalize(),t=t.transformDirection(PT)),t),getTextureLevel:()=>n}},gqe=n=>({getUV:()=>n,getTextureLevel:()=>Ie(1)}),Aqe=new cue;class m0e extends Va{static get type(){return"MeshStandardNodeMaterial"}constructor(e){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(Aqe),this.setValues(e)}setupEnvironment(e){let t=super.setupEnvironment(e);return t===null&&e.environmentNode&&(t=e.environmentNode),t?new mqe(t):null}setupLightingModel(){return new u0e}setupSpecular(){const e=ui(ct(.04),As.rgb,Fm);R1.assign(ct(.04)),mv.assign(e),gv.assign(1)}setupVariants(){const e=this.metalnessNode?Ie(this.metalnessNode):mpe;Fm.assign(e);let t=this.roughnessNode?Ie(this.roughnessNode):ppe;t=qG({roughness:t}),e0.assign(t),this.setupSpecular(),Jx.assign(As.rgb.mul(e.oneMinus()))}}const xqe=new e8e;class vqe extends m0e{static get type(){return"MeshPhysicalNodeMaterial"}constructor(e){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(xqe),this.setValues(e)}get useClearcoat(){return this.clearcoat>0||this.clearcoatNode!==null}get useIridescence(){return this.iridescence>0||this.iridescenceNode!==null}get useSheen(){return this.sheen>0||this.sheenNode!==null}get useAnisotropy(){return this.anisotropy>0||this.anisotropyNode!==null}get useTransmission(){return this.transmission>0||this.transmissionNode!==null}get useDispersion(){return this.dispersion>0||this.dispersionNode!==null}setupSpecular(){const e=this.iorNode?Ie(this.iorNode):Mpe;b4.assign(e),R1.assign(td(tG(b4.sub(1).div(b4.add(1))).mul(fpe),ct(1)).mul(WF)),mv.assign(ui(R1,As.rgb,Fm)),gv.assign(ui(WF,1,Fm))}setupLightingModel(){return new u0e(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(e){if(super.setupVariants(e),this.useClearcoat){const t=this.clearcoatNode?Ie(this.clearcoatNode):Ape,r=this.clearcoatRoughnessNode?Ie(this.clearcoatRoughnessNode):xpe;Tk.assign(t),jb.assign(qG({roughness:r}))}if(this.useSheen){const t=this.sheenNode?ct(this.sheenNode):bpe,r=this.sheenRoughnessNode?Ie(this.sheenRoughnessNode):wpe;Cd.assign(t),NA.assign(r)}if(this.useIridescence){const t=this.iridescenceNode?Ie(this.iridescenceNode):Spe,r=this.iridescenceIORNode?Ie(this.iridescenceIORNode):Tpe,i=this.iridescenceThicknessNode?Ie(this.iridescenceThicknessNode):Epe;uR.assign(t),Ek.assign(r),Ck.assign(i)}if(this.useAnisotropy){const t=(this.anisotropyNode?Cn(this.anisotropyNode):_pe).toVar();_A.assign(t.length()),nr(_A.equal(0),()=>{t.assign(Cn(1,0))}).Else(()=>{t.divAssign(Cn(_A)),_A.assign(_A.saturate())}),Nk.assign(_A.pow2().mix(e0.pow2(),1)),y4.assign(Av[0].mul(t.x).add(Av[1].mul(t.y))),Fv.assign(Av[1].mul(t.x).sub(Av[0].mul(t.y)))}if(this.useTransmission){const t=this.transmissionNode?Ie(this.transmissionNode):Cpe,r=this.thicknessNode?Ie(this.thicknessNode):Npe,i=this.attenuationDistanceNode?Ie(this.attenuationDistanceNode):kpe,s=this.attenuationColorNode?ct(this.attenuationColorNode):Rpe;if(kk.assign(t),Bz.assign(r),Vz.assign(i),zz.assign(s),this.useDispersion){const a=this.dispersionNode?Ie(this.dispersionNode):Lpe;Gz.assign(a)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?ct(this.clearcoatNormalNode):vpe}setup(e){e.context.setupClearcoatNormal=()=>Bv(this.setupClearcoatNormal(e),"NORMAL","vec3"),super.setup(e)}}const yqe=ut(({normal:n,lightDirection:e,builder:t})=>
vendor: 4,237 bytes, line 4313
4313{const r=n.dot(e),i=Cn(r.mul(.5).add(.5),0);if(t.material.gradientMap){const s=Om("gradientMap","texture").context({getUV:()=>i});return ct(s.r)}else{const s=i.fwidth().mul(.5);return ui(ct(.7),ct(1),rh(Ie(.7).sub(s.x),Ie(.7).add(s.x),i.x))}});class bqe extends NR{direct({lightDirection:e,lightColor:t,reflectedLight:r},i){const s=yqe({normal:yR,lightDirection:e,builder:i}).mul(t);r.directDiffuse.addAssign(s.mul(dy({diffuseColor:As.rgb})))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:i}=e.context;i.indirectDiffuse.addAssign(r.mul(dy({diffuseColor:As}))),i.indirectDiffuse.mulAssign(t)}}const wqe=new t8e;class _qe extends Va{static get type(){return"MeshToonNodeMaterial"}constructor(e){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(wqe),this.setValues(e)}setupLightingModel(){return new bqe}}const g0e=ut(()=>{const n=ct(Os.z,0,Os.x.negate()).normalize(),e=Os.cross(n);return Cn(n.dot(Ri),e.dot(Ri)).mul(.495).add(.5)}).once(["NORMAL","VERTEX"])().toVar("matcapUV"),Sqe=new s8e;class Tqe extends Va{static get type(){return"MeshMatcapNodeMaterial"}constructor(e){super(),this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(Sqe),this.setValues(e)}setupVariants(e){const t=g0e;let r;e.material.matcap?r=Om("matcap","texture").context({getUV:()=>t}):r=ct(ui(.2,.8,t.y)),As.rgb.mulAssign(r.rgb)}}class Eqe extends za{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}generateNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:r}=this;if(this.getNodeType(e)==="vec2"){const s=t.cos(),a=t.sin();return cR(s,a,a.negate(),s).mul(r)}else{const s=t,a=f1(Vn(1,0,0,0),Vn(0,If(s.x),ou(s.x).negate(),0),Vn(0,ou(s.x),If(s.x),0),Vn(0,0,0,1)),o=f1(Vn(If(s.y),0,ou(s.y),0),Vn(0,1,0,0),Vn(ou(s.y).negate(),0,If(s.y),0),Vn(0,0,0,1)),l=f1(Vn(If(s.z),ou(s.z).negate(),0,0),Vn(ou(s.z),If(s.z),0,0),Vn(0,0,1,0),Vn(0,0,0,1));return a.mul(o).mul(l).mul(Vn(r,1)).xyz}}}const OT=ri(Eqe).setParameterLength(2),Cqe=new dke;class A0e extends Va{static get type(){return"SpriteNodeMaterial"}constructor(e){super(),this.isSpriteNodeMaterial=!0,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.transparent=!0,this.setDefaultValues(Cqe),this.setValues(e)}setupPositionView(e){const{object:t,camera:r}=e,{positionNode:i,rotationNode:s,scaleNode:a,sizeAttenuation:o}=this,l=O0.mul(ct(i||0));let u=Cn(Fh[0].xyz.length(),Fh[1].xyz.length());a!==null&&(u=u.mul(Cn(a))),r.isPerspectiveCamera&&o===!1&&(u=u.mul(l.z.negate()));let d=uc.xy;if(t.center&&t.center.isVector2===!0){const p=EVe("center","vec2",t);d=d.sub(p.sub(.5))}d=d.mul(u);const h=Ie(s||ype),f=OT(d,h);return Vn(l.xy.add(f),l.zw)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(e){this._useSizeAttenuation!==e&&(this._useSizeAttenuation=e,this.needsUpdate=!0)}}const Nqe=new KV,Mqe=new Jt;class kqe extends A0e{static get type(){return"PointsNodeMaterial"}constructor(e){super(),this.sizeNode=null,this.isPointsNodeMaterial=!0,this.setDefaultValues(Nqe),this.setValues(e)}setupPositionView(){const{positionNode:e}=this;return O0.mul(ct(e||pa)).xyz}setupVertexSprite(e){const{material:t,camera:r}=e,{rotationNode:i,scaleNode:s,sizeNode:a,sizeAttenuation:o}=this;let l=super.setupVertex(e);if(t.isNodeMaterial!==!0)return l;let u=a!==null?Cn(a):Ppe;u=u.mul(yG),r.isPerspectiveCamera&&o===!0&&(u=u.mul(Rqe.div(Ja.z.negate()))),s&&s.isNode&&(u=u.mul(Cn(s)));let d=uc.xy;if(i&&i.isNode){const h=Ie(i);d=OT(d,h)}return d=d.mul(u),d=d.div(bG.div(2)),d=d.mul(l.w),l=l.add(Vn(d,0,0)),l}setupVertex(e){return e.object.isPoints?super.setupVertex(e):this.setupVertexSprite(e)}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}const Rqe=Qn(1).onFrameUpdate(function({renderer:n}){const e=n.getSize(Mqe);this.value=.5*e.y});class Pqe extends NR{constructor(){super(),this.shadowNode=Ie(1).toVar("shadowMask")}direct({lightNode:e}){e.shadowNode!==null&&this.shadowNode.mulAssign(e.shadowNode)}finish({context:e}){As.a.mulAssign(this.shadowNode.oneMinus()),e.outgoingLight.rgb.assign(As.rgb)}}
4313const Lqe=new Yke;class Oqe extends Va{static get type(){return"ShadowNodeMaterial"}constructor(e){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.transparent=!0,this.setDefaultValues(Lqe),this.setValues(e)}setupLightingModel(){return new Pqe}}fg("vec3");fg("vec3");fg("vec3");class Dqe{constructor(e,t,r){this.renderer=e,this.nodes=t,this.info=r,this._context=typeof self<"u"?self:null,this._animationLoop=null,this._requestId=null}start(){const e=(t,r)=>{this._requestId=this._context.requestAnimationFrame(e),this.info.autoReset===!0&&this.info.reset(),this.nodes.nodeFrame.update(),this.info.frame=this.nodes.nodeFrame.frameId,this.renderer._inspector.begin(),this._animationLoop!==null&&this._animationLoop(t,r),this.renderer._inspector.finish()};e()}stop(){this._context!==null&&this._context.cancelAnimationFrame(this._requestId),this._requestId=null}getAnimationLoop(){return this._animationLoop}setAnimationLoop(e){this._animationLoop=e}getContext(){return this._context}setContext(e){this._context=e}dispose(){this.stop()}}class L1{constructor(){this.weakMaps={}}_getWeakMap(e){const t=e.length;let r=this.weakMaps[t];return r===void 0&&(r=new WeakMap,this.weakMaps[t]=r),r}get(e){let t=this._getWeakMap(e);for(let r=0;r<e.length-1;r++)if(t=t.get(e[r]),t===void 0)return;return t.get(e[e.length-1])}set(e,t){let r=this._getWeakMap(e);for(let i=0;i<e.length-1;i++){const s=e[i];r.has(s)===!1&&r.set(s,new WeakMap),r=r.get(s)}return r.set(e[e.length-1],t),this}delete(e){let t=this._getWeakMap(e);for(let r=0;r<e.length-1;r++)if(t=t.get(e[r]),t===void 0)return!1;return t.delete(e[e.length-1])}}let jqe=0;const SJ=new WeakMap;function Iqe(n){const e=Object.keys(n);let t=SJ.get(n.constructor);if(t===void 0){t=[];let r=Object.getPrototypeOf(n);for(;r;){const i=Object.getOwnPropertyDescriptors(r);for(const s in i){const a=i[s];a&&typeof a.get=="function"&&t.push(s)}r=Object.getPrototypeOf(r)}SJ.set(n.constructor,t)}for(let r=0;r<t.length;r++)e.push(t[r]);return e}class Fqe{constructor(e,t,r,i,s,a,o,l,u,d){this.id=jqe++,this._nodes=e,this._geometries=t,this.renderer=r,this.object=i,this.material=s,this.scene=a,this.camera=o,this.lightsNode=l,this.context=u,this.geometry=i.geometry,this.version=s.version,this.drawRange=null,this.attributes=null,this.attributesId=null,this.pipeline=null,this.group=null,this.vertexBuffers=null,this.drawParams=null,this.bundle=null,this.clippingContext=d,this.clippingContextCacheKey=d!==null?d.cacheKey:"",this.initialNodesCacheKey=this.getDynamicCacheKey(),this.initialCacheKey=this.getCacheKey(),this._nodeBuilderState=null,this._bindings=null,this._monitor=null,this._sourceMaterial=r._currentSourceMaterial,this.onDispose=null,this.isRenderObject=!0,this.onMaterialDispose=()=>{this.dispose()},this.onGeometryDispose=()=>{this.attributes=null,this.attributesId=null},this.material.addEventListener("dispose",this.onMaterialDispose),this.geometry.addEventListener("dispose",this.onGeometryDispose),this._sourceMaterial!==null&&this._sourceMaterial.addEventListener("dispose",this.onMaterialDispose)}updateClipping(e){this.clippingContext=e}get clippingNeedsUpdate(){return this.clippingContext===null||this.clippingContext.cacheKey===this.clippingContextCacheKey?!1:(this.clippingContextCacheKey=this.clippingContext.cacheKey,!0)}get hardwareClippingPlanes(){return this.getNodeBuilderState().hardwareClipping===!0?this.clippingContext.unionClippingCount:0}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().observer)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getBindingGroup(e){for(const t of this.getBindings())if(t.name===e)return t}getIndex(){return this._geometries.getIndex(this)}getIndirect(){return this._geometries.getIndirect(this)}getIndirectOffset(){return this._geometries.getIndirectOffset(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}setGeometry(e){this.geometry=e,this.attributes=null,this.attributesId=null}getAttributes(){if(this.attributes!==null)return this.attributes;const e=this.getNodeBuilderState().nodeAttributes,t=this.geometry,r=[],i=new Set,s={};for(const a of e){let o;if(a.node&&a.node.attribute?o=a.node.attribute:(o=t.getAttribute(a.name),o!==void 0&&(o.isInterleavedBufferAttribute?s[a.name]=o.data.uuid:s[a.name]=o.id)),o===void 0)continue;r.push(o);const l=o.isInterleavedBufferAttribute?o.data:o;i.add(l)}return this.attributes=r,this.attributesId=s,this.vertexBuffers=Array.from(i.values()),r}getVertexBuffers(){return this.vertexBuffers===null&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:e,material:t,geometry:r,group:i,drawRange:s}=this,a=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),o=this.getIndex(),l=o!==null;let u=1;if(r.isInstancedBufferGeometry===!0?u=r.instanceCount:e.count!==void 0&&(u=Math.max(0,e.count)),u===0)return null;if(a.instanceCount=u,e.isBatchedMesh===!0)return a;let d=1;t.wireframe===!0&&!e.isPoints&&!e.isLineSegments&&!e.isLine&&!e.isLineLoop&&(d=2);let h=s.start*d,f=(s.start+s.count)*d;i!==null&&(h=Math.max(h,i.start*d),f=Math.min(f,(i.start+i.count)*d));const p=r.attributes.position;let g=1/0;l?g=o.count:p!=null&&(g=p.count),h=Math.max(h,0),f=Math.min(f,g);const A=f-h;
4313return A<0||A===1/0?null:(a.vertexCount=A,a.firstVertex=h,a)}getGeometryCacheKey(){const{geometry:e}=this;let t="";for(const r of Object.keys(e.attributes).sort()){const i=e.attributes[r];t+=r+",",i.data&&(t+=i.data.stride+","),i.offset&&(t+=i.offset+","),i.itemSize&&(t+=i.itemSize+","),i.normalized&&(t+="n,")}for(const r of Object.keys(e.morphAttributes).sort()){const i=e.morphAttributes[r];t+="morph-"+r+",";for(let s=0,a=i.length;s<a;s++){const o=i[s];t+=o.id+","}}return e.index&&(t+="index,"),t}getMaterialCacheKey(){const{object:e,material:t,renderer:r}=this;let i=t.customProgramCacheKey();for(const s of Iqe(t)){if(/^(is[A-Z]|_)|^(visible|version|uuid|name|opacity|userData)$/.test(s))continue;const a=t[s];let o;if(a!==null){const l=typeof a;l==="number"?s==="side"?o=String(a):o=a!==0?"1":"0":l==="object"?(o="{",a.isTexture&&(o+=a.mapping,r.backend.isWebGPUBackend===!0&&(o+=a.magFilter,o+=a.minFilter,o+=a.wrapS,o+=a.wrapT,o+=a.wrapR)),o+="}"):o=String(a)}else o=String(a);i+=o+","}return i+=this.clippingContextCacheKey+",",e.geometry&&(i+=this.getGeometryCacheKey()),e.skeleton&&(i+=e.skeleton.bones.length+","),e.isBatchedMesh&&(i+=e._matricesTexture.uuid+",",e._colorsTexture!==null&&(i+=e._colorsTexture.uuid+",")),(e.isInstancedMesh||e.count>1)&&(i+=e.uuid+","),i+=this.context.id+",",i+=e.receiveShadow+",",E_(i)}get needsGeometryUpdate(){if(this.geometry.id!==this.object.geometry.id)return!0;if(this.attributes!==null){const e=this.attributesId;for(const t in e){const r=this.geometry.getAttribute(t);if(r===void 0)return!0;const i=r.isInterleavedBufferAttribute?r.data.uuid:r.id;if(e[t]!==i)return!0}}return!1}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let e=0;return this.material.isShadowPassMaterial!==!0&&(e=this._nodes.getCacheKey(this.scene,this.lightsNode)),this.camera.isArrayCamera&&(e=x4(e,this.camera.cameras.length)),this.object.receiveShadow&&(e=x4(e,1)),e=x4(e,this.renderer.contextNode.id,this.renderer.contextNode.version),e}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.geometry.removeEventListener("dispose",this.onGeometryDispose),this._sourceMaterial!==null&&this._sourceMaterial.removeEventListener("dispose",this.onMaterialDispose),this.onDispose()}}const Op=[];class Uqe{constructor(e,t,r,i,s,a){this.renderer=e,this.nodes=t,this.geometries=r,this.pipelines=i,this.bindings=s,this.info=a,this.chainMaps={}}get(e,t,r,i,s,a,o,l){const u=this.getChainMap(l);Op[0]=e,Op[1]=t,Op[2]=a,Op[3]=s;let d=u.get(Op);return d===void 0?(d=this.createRenderObject(this.nodes,this.geometries,this.renderer,e,t,r,i,s,a,o,l),u.set(Op,d)):(d.camera=i,d.updateClipping(o),d.needsGeometryUpdate&&d.setGeometry(e.geometry),(d.version!==t.version||d.needsUpdate)&&(d.initialCacheKey!==d.getCacheKey()?(d.dispose(),d=this.get(e,t,r,i,s,a,o,l)):d.version=t.version)),Op[0]=null,Op[1]=null,Op[2]=null,Op[3]=null,d}getChainMap(e="default"){return this.chainMaps[e]||(this.chainMaps[e]=new L1)}dispose(){this.chainMaps={}}createRenderObject(e,t,r,i,s,a,o,l,u,d,h){const f=this.getChainMap(h),p=new Fqe(e,t,r,i,s,a,o,l,u,d);return p.onDispose=()=>{this.pipelines.delete(p),this.bindings.deleteForRender(p),this.nodes.delete(p),f.delete(p.getChainArray())},p}}class Z1{constructor(){this.data=new WeakMap}get(e){let t=this.data.get(e);return t===void 0&&(t={},this.data.set(e,t)),t}delete(e){let t=null;return this.data.has(e)&&(t=this.data.get(e),this.data.delete(e)),t}has(e){return this.data.has(e)}dispose(){this.data=new WeakMap}}const Uh={VERTEX:1,INDEX:2,STORAGE:3,INDIRECT:4},PA=16,Bqe=211,Vqe=212;class zqe extends Z1{constructor(e,t){super(),this.backend=e,this.info=t}delete(e){const t=super.delete(e);return t!==null&&(this.backend.destroyAttribute(e),this.info.destroyAttribute(e)),t}update(e,t){const r=this.get(e);if(r.version===void 0)t===Uh.VERTEX?(this.backend.createAttribute(e),this.info.createAttribute(e)):t===Uh.INDEX?(this.backend.createIndexAttribute(e),this.info.createIndexAttribute(e)):t===Uh.STORAGE?(this.backend.createStorageAttribute(e),this.info.createStorageAttribute(e)):t===Uh.INDIRECT&&(this.backend.createIndirectStorageAttribute(e),this.info.createIndirectStorageAttribute(e)),r.version=this._getBufferAttribute(e).version;else{const i=this._getBufferAttribute(e);(r.version<i.version||i.usage===ST)&&(this.backend.updateAttribute(e),r.version=i.version)}}_getBufferAttribute(e){return e.isInterleavedBufferAttribute&&(e=e.data),e}}function x0e(n){return n.index!==null?n.index.version:n.attributes.position.version}function v0e(n){return n.index!==null?n.index.id:n.attributes.position.id}function TJ(n){const e=[],t=n.index,r=n.attributes.position;if(t!==null){const s=t.array;for(let a=0,o=s.length;a<o;a+=3){const l=s[a+0],u=s[a+1],d=s[a+2];e.push(l,u,u,d,d,l)}}else{const s=r.array;for(let a=0,o=s.length/3-1;a<o;a+=3){const l=a+0,u=a+1,d=a+2;e.push(l,u,u,d,d,l)}}const i=new(r.count>=65535?WV:HV)(e,1);return i.version=x0e(n),i.__id=v0e(n),i}class Gqe extends Z1{constructor(e,t){super(),this.attributes=e,this.info=t,this.wireframes=new WeakMap,this.attributeCall=new WeakMap,this._geometryDisposeListeners=new Map}has(e){const t=e.geometry;return super.has(t)&&this.get(t).initialized===!0}updateForRender(e){this.has(e)===!1&&this.initGeometry(e),this.updateAttributes(e)}initGeometry(e){const t=e.geometry,r=this.get(t);r.initialized=!0,this.info.memory.geometries++;const i=()=>{this.info.memory.geometries--;const s=t.index,a=e.getAttributes();s!==null&&this.attributes.delete(s);for(const l of a)this.attributes.delete(l);const o=this.wireframes.get(t);o!==void 0&&this.attributes.delete(o),t.removeEventListener("dispose",i),this._geometryDisposeListeners.delete(t)};t.addEventListener("dispose",i),this._geometryDisposeListeners.set(t,i)}updateAttributes(e){const t=e.getAttributes();for(const s of t)s.isStorageBufferAttribute||s.isStorageInstancedBufferAttribute?this.updateAttribute(s,Uh.STORAGE):this.updateAttribute(s,Uh.VERTEX);const r=this.getIndex(e);r!==null&&this.updateAttribute(r,Uh.INDEX);const i=e.geometry.indirect;i!==null&&this.updateAttribute(i,Uh.INDIRECT)}updateAttribute(e,t){const r=this.info.render.calls;e.isInterleavedBufferAttribute?this.attributeCall.get(e)===void 0?(this.attributes.update(e,t),this.attributeCall.set(e,r)):this.attributeCall.get(e.data)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e.data,r),this.attributeCall.set(e,r)):this.attributeCall.get(e)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e,r))}getIndirect(e){return e.geometry.indirect}getIndirectOffset(e){return e.geometry.indirectOffset}getIndex(e){const{geometry:t,material:r}=e;let i=t.index;if(r.wireframe===!0){const s=this.wireframes;let a=s.get(t);a===void 0?(a=TJ(t),s.set(t,a)):(a.version!==x0e(t)||a.__id!==v0e(t))&&(this.attributes.delete(a),a=TJ(t),s.set(t,a)),i=a}return i}dispose(){for(const[e,t]of this._geometryDisposeListeners.entries())e.removeEventListener("dispose",t);this._geometryDisposeListeners.clear()}}class qqe{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0},this.compute={calls:0,frameCalls:0,timestamp:0},this.memory={attributes:0,attributesSize:0,geometries:0,indexAttributes:0,indexAttributesSize:0,indirectStorageAttributes:0,indirectStorageAttributesSize:0,programs:0,programsSize:0,readbackBuffers:0,readbackBuffersSize:0,renderTargets:0,storageAttributes:0,storageAttributesSize:0,textures:0,texturesSize:0,uniformBuffers:0,uniformBuffersSize:0,total:0},this.memoryMap=new Map}update(e,t,r){this.render.drawCalls++,e.isMesh||e.isSprite?this.render.triangles+=r*(t/3):e.isPoints?this.render.points+=r*t:e.isLineSegments?this.render.lines+=r*(t/2):e.isLine?this.render.lines+=r*(t-1):sn("WebGPUInfo: Unknown object type.")}reset(){this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0;for(const e in this.memory)this.memory[e]=0;this.memoryMap.clear()}createTexture(e){const t=this._getTextureMemorySize(e);this.memoryMap.set(e,t),this.memory.textures++,this.memory.total+=t,this.memory.texturesSize+=t}destroyTexture(e){const t=this.memoryMap.get(e)||0;this.memoryMap.delete(e),this.memory.textures--,this.memory.total-=t,this.memory.texturesSize-=t}_createAttribute(e,t){const r=this._getAttributeMemorySize(e);this.memoryMap.set(e,{size:r,type:t}),this.memory[t]++,this.memory.total+=r,this.memory[t+"Size"]+=r}createAttribute(e){this._createAttribute(e,"attributes")}createIndexAttribute(e){this._createAttribute(e,"indexAttributes")}createStorageAttribute(e){this._createAttribute(e,"storageAttributes")}createIndirectStorageAttribute(e){this._createAttribute(e,"indirectStorageAttributes")}destroyAttribute(e){const t=this.memoryMap.get(e);t&&(this.memoryMap.delete(e),this.memory[t.type]--,this.memory.total-=t.size,this.memory[t.type+"Size"]-=t.size)}createReadbackBuffer(e){const t=e.maxByteLength;this.memoryMap.set(e,{size:t,type:"readbackBuffers"}),this.memory.readbackBuffers++,this.memory.total+=t,this.memory.readbackBuffersSize+=t}destroyReadbackBuffer(e){const{size:t}=this.memoryMap.get(e);this.memoryMap.delete(e),this.memory.readbackBuffers--,this.memory.total-=t,this.memory.readbackBuffersSize-=t}createUniformBuffer(e){const t=e.byteLength;this.memoryMap.set(e,{size:t,type:"uniformBuffers"}),this.memory.uniformBuffers++,this.memory.total+=t,this.memory.uniformBuffersSize+=t}destroyUniformBuffer(e){const t=this.memoryMap.get(e);t&&(this.memoryMap.delete(e),this.memory.uniformBuffers--,this.memory.total-=t.size,this.memory.uniformBuffersSize-=t.size)}createProgram(e){const t=e.code.length;this.memoryMap.set(e,t),this.memory.programs++,this.memory.total+=t,this.memory.programsSize+=t}destroyProgram(e){const t=this.memoryMap.get(e)||0;this.memoryMap.delete(e),this.memory.programs--,this.memory.total-=t,this.memory.programsSize-=t}_getTextureMemorySize(e){if(e.isCompressedTexture)return 1;let t=1;e.type===a1||e.type===Zs?t=1:e.type===o1||e.type===jh||e.type===Js?t=2:(e.type===oo||e.type===ts||e.type===ia)&&(t=4);let r=4;e.format===H8||e.format===wy||e.format===G1||e.format===ml||e.format===vc?r=1:e.format===fl||e.format===q1?r=2:(e.format===by||e.format===DV)&&(r=3);let i=t*r;e.type===yT||e.type===bT?i=2:(e.type===Ku||e.type===wT||e.type===_T)&&(i=4);const s=e.width||1,a=e.height||1,o=e.isCubeTexture?6:e.depth||1;let l=s*a*o*i;const u=e.mipmaps;if(u&&u.length>0){let d=0;for(let h=0;h<u.length;h++){const f=u[h];if(f.data)d+=f.data.byteLength;else{const p=f.width||Math.max(1,s>>h),g=f.height||Math.max(1,a>>h);d+=p*g*o*i}}l+=d}else e.generateMipmaps&&(l=l*1.333);return Math.round(l)}_getAttributeMemorySize(e){return e.isInterleavedBufferAttribute&&(e=e.data),e.array?e.array.byteLength:e.count&&e.itemSize?e.count*e.itemSize*4:0}}class y0e{constructor(e){this.cacheKey=e,this.usedTimes=0}}class $qe extends y0e{constructor(e,t,r){super(e),this.vertexProgram=t,this.fragmentProgram=r}}class Hqe extends y0e{constructor(e,t){super(e),this.computeProgram=t,this.isComputePipeline=!0}}let Wqe=0;
4313class ML{constructor(e,t,r,i=null,s=null){this.id=Wqe++,this.code=e,this.stage=t,this.name=r,this.transforms=i,this.attributes=s,this.usedTimes=0}}class Xqe extends Z1{constructor(e,t,r){super(),this.backend=e,this.nodes=t,this.info=r,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(e,t){const{backend:r}=this,i=this.get(e);if(this._needsComputeUpdate(e)){const s=i.pipeline;s&&(s.usedTimes--,s.computeProgram.usedTimes--);const a=this.nodes.getForCompute(e);let o=this.programs.compute.get(a.computeShader);o===void 0&&(s&&s.computeProgram.usedTimes===0&&this._releaseProgram(s.computeProgram),o=new ML(a.computeShader,"compute",e.name,a.transforms,a.nodeAttributes),this.programs.compute.set(a.computeShader,o),r.createProgram(o),this.info.createProgram(o));const l=this._getComputeCacheKey(e,o);let u=this.caches.get(l);u===void 0&&(s&&s.usedTimes===0&&this._releasePipeline(s),u=this._getComputePipeline(e,o,l,t)),u.usedTimes++,o.usedTimes++,i.version=e.version,i.pipeline=u}return i.pipeline}getForRender(e,t=null){const{backend:r}=this,i=this.get(e);if(this._needsRenderUpdate(e)){const s=i.pipeline;s&&(s.usedTimes--,s.vertexProgram.usedTimes--,s.fragmentProgram.usedTimes--);const a=e.getNodeBuilderState(),o=e.material?e.material.name:"";let l=this.programs.vertex.get(a.vertexShader);l===void 0&&(s&&s.vertexProgram.usedTimes===0&&this._releaseProgram(s.vertexProgram),l=new ML(a.vertexShader,"vertex",o),this.programs.vertex.set(a.vertexShader,l),r.createProgram(l),this.info.createProgram(l));let u=this.programs.fragment.get(a.fragmentShader);u===void 0&&(s&&s.fragmentProgram.usedTimes===0&&this._releaseProgram(s.fragmentProgram),u=new ML(a.fragmentShader,"fragment",o),this.programs.fragment.set(a.fragmentShader,u),r.createProgram(u),this.info.createProgram(u));const d=this._getRenderCacheKey(e,l,u);let h=this.caches.get(d);h===void 0?(s&&s.usedTimes===0&&this._releasePipeline(s),h=this._getRenderPipeline(e,l,u,d,t)):e.pipeline=h,h.usedTimes++,l.usedTimes++,u.usedTimes++,i.pipeline=h}return i.pipeline}isReady(e){const r=this.get(e).pipeline;if(r===void 0)return!1;const i=this.backend.get(r);return i.pipeline!==void 0&&i.pipeline!==null}delete(e){const t=this.get(e).pipeline;return t&&(t.usedTimes--,t.usedTimes===0&&this._releasePipeline(t),t.isComputePipeline?(t.computeProgram.usedTimes--,t.computeProgram.usedTimes===0&&this._releaseProgram(t.computeProgram)):(t.fragmentProgram.usedTimes--,t.vertexProgram.usedTimes--,t.vertexProgram.usedTimes===0&&this._releaseProgram(t.vertexProgram),t.fragmentProgram.usedTimes===0&&this._releaseProgram(t.fragmentProgram))),super.delete(e)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(e){this.getForRender(e)}_getComputePipeline(e,t,r,i){r=r||this._getComputeCacheKey(e,t);let s=this.caches.get(r);return s===void 0&&(s=new Hqe(r,t),this.caches.set(r,s),this.backend.createComputePipeline(s,i)),s}_getRenderPipeline(e,t,r,i,s){i=i||this._getRenderCacheKey(e,t,r);let a=this.caches.get(i);return a===void 0&&(a=new $qe(i,t,r),this.caches.set(i,a),e.pipeline=a,this.backend.createRenderPipeline(e,s)),a}_getComputeCacheKey(e,t){return e.id+","+t.id}_getRenderCacheKey(e,t,r){return t.id+","+r.id+","+this.backend.getRenderCacheKey(e)}_releasePipeline(e){this.caches.delete(e.cacheKey)}_releaseProgram(e){const t=e.code,r=e.stage;this.programs[r].delete(t),this.info.destroyProgram(e)}_needsComputeUpdate(e){const t=this.get(e);return t.pipeline===void 0||t.version!==e.version}_needsRenderUpdate(e){return this.get(e).pipeline===void 0||this.backend.needsRenderUpdate(e)}}class Yqe extends Z1{constructor(e,t,r,i,s,a){super(),this.backend=e,this.textures=r,this.pipelines=s,this.attributes=i,this.nodes=t,this.info=a,this.pipelines.bindings=this}getForRender(e){const t=e.getBindings(),r=this.get(e);return r.initialized!==!0&&(this._createBindings(t),r.initialized=!0),t}getForCompute(e){const t=this.nodes.getForCompute(e).bindings,r=this.get(e);return(r.initialized!==!0||r.bindings!==t)&&(r.bindings!==void 0&&this._destroyBindings(r.bindings),this._createBindings(t),r.initialized=!0,r.bindings=t),t}updateForCompute(e){this._updateBindings(this.getForCompute(e))}updateForRender(e){this._updateBindings(this.getForRender(e))}deleteForCompute(e){const r=this.get(e).bindings||this.nodes.getForCompute(e).bindings;this._destroyBindings(r),this.delete(e)}deleteForRender(e){const t=e.getBindings();this._destroyBindings(t),this.delete(e)}_createBindings(e){for(const t of e){const r=this.get(t);if(r.bindGroup===void 0){for(const i of t.bindings)if(i.isUniformBuffer)this.backend.createUniformBuffer(i),this.info.createUniformBuffer(i);else if(i.isSampledTexture)this.textures.updateTexture(i.texture);else if(i.isSampler)this.textures.updateSampler(i);else if(i.isStorageBuffer){const s=i.attribute,a=s.isIndirectStorageBufferAttribute?Uh.INDIRECT:Uh.STORAGE;this.attributes.update(s,a)}this.backend.createBindings(t,e,0),r.bindGroup=t,r.usedTimes=1}else r.usedTimes++}
4313}_destroyBindings(e){for(const t of e){const r=this.get(t);if(r.usedTimes--,r.usedTimes===0){for(const i of t.bindings)i.isUniformBuffer?(this.backend.destroyUniformBuffer(i),this.info.destroyUniformBuffer(i),i.release()):i.isSampler&&(i.isSampledTexture!==!0&&this.backend.destroySampler(i),i.release());this.backend.deleteBindGroupData(t),this.delete(t)}}}_updateBindings(e){for(const t of e)this._update(t,e)}_update(e,t){const{backend:r}=this;let i=!1,s=!0,a=0,o=0;for(const l of e.bindings)if(this.nodes.updateGroup(l)!==!1){if(l.isStorageBuffer){const d=l.attribute,h=d.isIndirectStorageBufferAttribute?Uh.INDIRECT:Uh.STORAGE,f=r.get(l);this.attributes.update(d,h),f.attribute!==d&&(f.attribute=d,i=!0)}if(l.isUniformBuffer)l.update()&&r.updateBinding(l);else if(l.isSampledTexture){const d=l.update(),h=l.texture,f=this.textures.get(h);if(d&&(this.textures.updateTexture(h),l.generation!==f.generation&&(l.generation=f.generation,i=!0),f.bindGroups.add(e)),r.get(h).externalTexture!==void 0||f.isDefaultTexture?s=!1:(a=a*10+h.id,o+=h.version),h.isStorageTexture===!0&&h.mipmapsAutoUpdate===!0){const g=this.get(h);l.store===!0?g.needsMipmap=!0:this.textures.needsMipmaps(h)&&g.needsMipmap===!0&&(this.backend.generateMipmaps(h),g.needsMipmap=!1)}}else if(l.isSampler&&l.update()){const h=this.textures.updateSampler(l);l.samplerKey!==h&&(l.samplerKey=h,i=!0)}l.isBuffer&&l.updateRanges.length>0&&l.clearUpdateRanges()}i===!0&&this.backend.updateBindings(e,t,s?a:0,o)}}const Qqe=Object.freeze([]);function Kqe(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?n.z-e.z:n.id-e.id}function EJ(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function CJ(n){return(n.transmission>0||n.transmissionNode&&n.transmissionNode.isNode)&&n.side===Fa&&n.forceSinglePass===!1}class Zqe{constructor(e,t,r){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparentDoublePass=[],this.transparent=[],this.bundles=[],this.lighting=e,this.lightsNode=e.getNode(t),this.lightsArray=[],this.scene=t,this.camera=r,this.occlusionQueryCount=0,this._lastOcclusionObject=null}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparentDoublePass.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(e,t,r,i,s,a,o){let l=this.renderItems[this.renderItemsIndex];return l===void 0?(l={id:e.id,object:e,geometry:t,material:r,groupOrder:i,renderOrder:e.renderOrder,z:s,group:a,clippingContext:o},this.renderItems[this.renderItemsIndex]=l):(l.id=e.id,l.object=e,l.geometry=t,l.material=r,l.groupOrder=i,l.renderOrder=e.renderOrder,l.z=s,l.group=a,l.clippingContext=o),this.renderItemsIndex++,l}push(e,t,r,i,s,a,o){const l=this.getNextRenderItem(e,t,r,i,s,a,o);e.occlusionTest===!0&&this._lastOcclusionObject!==e&&(this.occlusionQueryCount++,this._lastOcclusionObject=e),r.transparent===!0||r.transmission>0||r.transmissionNode&&r.transmissionNode.isNode||r.backdropNode&&r.backdropNode.isNode?(CJ(r)&&this.transparentDoublePass.push(l),this.transparent.push(l)):this.opaque.push(l)}unshift(e,t,r,i,s,a,o){const l=this.getNextRenderItem(e,t,r,i,s,a,o);r.transparent===!0||r.transmission>0||r.transmissionNode&&r.transmissionNode.isNode||r.backdropNode&&r.backdropNode.isNode?(CJ(r)&&this.transparentDoublePass.unshift(l),this.transparent.unshift(l)):this.opaque.unshift(l)}pushBundle(e){this.bundles.push(e)}pushLight(e){this.lightsArray.push(e)}sort(e,t,r){this.opaque.length>1&&this.opaque.sort(e||Kqe),this.transparentDoublePass.length>1&&this.transparentDoublePass.sort(t||EJ),this.transparent.length>1&&this.transparent.sort(t||EJ),r&&(this.opaque.reverse(),this.transparentDoublePass.reverse(),this.transparent.reverse())}finish(){this.lightsNode.setLights(this.lighting.enabled?this.lightsArray:Qqe);for(let e=this.renderItemsIndex,t=this.renderItems.length;e<t;e++){const r=this.renderItems[e];if(r.id===null)break;r.id=null,r.object=null,r.geometry=null,r.material=null,r.groupOrder=null,r.renderOrder=null,r.z=null,r.group=null,r.clippingContext=null}this._lastOcclusionObject=null}}const C2=[];class Jqe{constructor(e){this.lighting=e,this.lists=new L1}get(e,t){const r=this.lists;C2[0]=e,C2[1]=t;let i=r.get(C2);return i===void 0&&(i=new Zqe(this.lighting,e,t),r.set(C2,i)),C2[0]=null,C2[1]=null,i}dispose(){this.lists=new L1}}let e$e=0;class t$e{constructor(){this.id=e$e++,this.mrt=null,this.color=!0,this.clearColor=!0,this.clearColorValue={r:0,g:0,b:0,a:1},this.depth=!0,this.clearDepth=!0,this.clearDepthValue=1,this.stencil=!1,this.clearStencil=!0,this.clearStencilValue=1,this.viewport=!1,this.viewportValue=new Rr,this.scissor=!1,this.scissorValue=new Rr,this.renderTarget=null,this.textures=null,this.depthTexture=null,this.activeCubeFace=0,this.activeMipmapLevel=0,this.sampleCount=1,this.width=0,this.height=0,this.occlusionQueryCount=0,this.clippingContext=null,this.camera=null,this.isRenderContext=!0}getCacheKey(){return b0e(this)}}function b0e(n){const{textures:e,activeCubeFace:t,activeMipmapLevel:r}=n,i=[t,r];for(const s of e)i.push(s.id);return kT(i)}class n$e{constructor(e){this.renderer=e,this._renderContexts={}}get(e=null,t=null,r=0){let i;if(e===null)i="default";else{const l=e.texture.format,u=e.texture.type;i=`${e.textures.length}:${l}:${u}:${e.samples}:${e.depthBuffer}:${e.stencilBuffer}`}const s=t!==null?t.id:"default",a=i+"-"+s+"-"+r;let o=this._renderContexts[a];return o===void 0&&(o=new t$e,o.mrt=t,this._renderContexts[a]=o),e!==null&&(o.sampleCount=e.samples===0?1:e.samples),o.clearDepthValue=this.renderer.getClearDepth(),o.clearStencilValue=this.renderer.getClearStencil(),o}dispose(){this._renderContexts={}}}const r$e=new Ve;class i$e extends Z1{constructor(e,t,r){super(),this.renderer=e,this.backend=t,this.info=r,this._htmlTextures=new Set}updateRenderTarget(e,t=0){const r=this.get(e),i=e.samples===0?1:e.samples,s=r.depthTextureMips||(r.depthTextureMips={}),a=e.textures,o=this.getSize(a[0]),l=o.width>>t,u=o.height>>t;let d=e.depthTexture||s[t];const h=e.depthBuffer===!0||e.stencilBuffer===!0;let f=!1;const p=d!==void 0&&d.image!==void 0&&d.image.depth>1,g=o.depth>1&&(e.useArrayDepthTexture||e.multiview||p);d===void 0&&h&&(d=new Bl,d.format=e.stencilBuffer?vc:ml,d.type=e.stencilBuffer?Ku:ts,d.image.width=l,d.image.height=u,d.image.depth=o.depth,d.renderTarget=e,s[t]=d),d&&(d.isArrayTexture=g),(r.width!==o.width||o.height!==r.height)&&(f=!0,d&&(d.needsUpdate=!0,d.image.width=l,d.image.height=u,d.image.depth=g?o.depth:1)),r.width=o.width,r.height=o.height,r.textures=a,r.depthTexture=d||null,r.depth=e.depthBuffer,r.stencil=e.stencilBuffer,r.renderTarget=e,r.sampleC
4313ount!==i&&(f=!0,d&&(d.needsUpdate=!0),r.sampleCount=i);const A={sampleCount:i};if(e.isXRRenderTarget!==!0){for(let x=0;x<a.length;x++){const b=a[x];f&&(b.needsUpdate=!0),this.updateTexture(b,A)}d&&this.updateTexture(d,A)}r.initialized!==!0&&(r.initialized=!0,this.info.memory.renderTargets++,r.onDispose=()=>{this._destroyRenderTarget(e)},e.addEventListener("dispose",r.onDispose))}updateTexture(e,t={}){const r=this.get(e);if(r.initialized===!0&&r.version===e.version)return;const i=e.isRenderTargetTexture||e.isDepthTexture||e.isFramebufferTexture,s=this.backend;if(i&&r.initialized===!0&&s.destroyTexture(e),e.isFramebufferTexture){const u=this.renderer.getRenderTarget();u?e.type=u.texture.type:e.type=Zs}if(e.isHTMLTexture&&e.image){const u=this.renderer.domElement;if("requestPaint"in u){if(u.hasAttribute("layoutsubtree")||u.setAttribute("layoutsubtree","true"),e.image.parentNode!==u&&u.appendChild(e.image),this._htmlTextures.size===0){const d=this._htmlTextures;u.onpaint=h=>{const f=h&&h.changedElements;for(const p of d)(!f||f.includes(p.image))&&(p.needsUpdate=!0)}}this._htmlTextures.add(e)}}const{width:a,height:o,depth:l}=this.getSize(e);if(t.width=a,t.height=o,t.depth=l,t.needsMipmaps=this.needsMipmaps(e),t.levels=t.needsMipmaps?this.getMipLevels(e,a,o):1,e.isCubeTexture&&e.mipmaps.length>0&&t.levels++,i||e.isStorageTexture===!0||e.isExternalTexture===!0)s.createTexture(e,t),r.generation=e.version;else if(e.version>0){const u=e.image;if(u===void 0)an("Renderer: Texture marked for update but image is undefined.");else if(u.complete===!1)an("Renderer: Texture marked for update but image is incomplete.");else{if(e.images){const h=[];for(const f of e.images)h.push(f);t.images=h}else t.image=u;(r.isDefaultTexture===void 0||r.isDefaultTexture===!0)&&(s.createTexture(e,t),r.isDefaultTexture=!1,r.generation=e.version),e.source.dataReady===!0&&s.updateTexture(e,t);const d=e.isStorageTexture===!0&&e.mipmapsAutoUpdate===!1;t.needsMipmaps&&e.mipmaps.length===0&&!d&&s.generateMipmaps(e),e.onUpdate&&e.onUpdate(e)}}else s.createDefaultTexture(e),r.isDefaultTexture=!0,r.generation=e.version;r.initialized!==!0&&(r.initialized=!0,r.generation=e.version,r.bindGroups=new Set,this.info.createTexture(e),e.isVideoTexture&&_r.enabled===!0&&_r.getTransfer(e.colorSpace)!==$n&&an("WebGPURenderer: Video textures must use a color space with a sRGB transfer function, e.g. SRGBColorSpace."),r.onDispose=()=>{this._destroyTexture(e)},e.addEventListener("dispose",r.onDispose)),r.version=e.version}updateSampler(e){return this.backend.updateSampler(e)}getSize(e,t=r$e){let r=e.images?e.images[0]:e.image;return r?(r.image!==void 0&&(r=r.image),e.isHTMLTexture?(t.width=r.offsetWidth||1,t.height=r.offsetHeight||1,t.depth=1):typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement?(t.width=r.videoWidth||1,t.height=r.videoHeight||1,t.depth=1):typeof VideoFrame<"u"&&r instanceof VideoFrame?(t.width=r.displayWidth||1,t.height=r.displayHeight||1,t.depth=1):(t.width=r.width||1,t.height=r.height||1,t.depth=e.isCubeTexture?6:r.depth||1)):t.width=t.height=t.depth=1,t}getMipLevels(e,t,r){let i;return e.mipmaps.length>0?i=e.mipmaps.length:e.isCompressedTexture===!0?i=1:i=Math.floor(Math.log2(Math.max(t,r)))+1,i}needsMipmaps(e){return e.generateMipmaps===!0||e.mipmaps.length>0}_destroyRenderTarget(e){if(this.has(e)===!0){const t=this.get(e),r=t.textures,i=t.depthTexture;e.removeEventListener("dispose",t.onDispose);for(let s=0;s<r.length;s++)this._destroyTexture(r[s]);i&&this._destroyTexture(i),this.delete(e),this.backend.delete(e),this.info.memory.renderTargets--}}_destroyTexture(e){if(this.has(e)===!0){const t=this.get(e);e.removeEventListener("dispose",t.onDispose);const r=t.isDefaultTexture;if(this.backend.destroyTexture(e,r),t.bindGroups)for(const i of t.bindGroups){const s=this.backend.get(i);s.groups=void 0,s.versions=void 0;for(const a of i.bindings)a.isSampler&&a.texture===e&&(a.isSampledTexture!==!0&&this.backend.destroySampler(a),a.reset(),a.release())}this._htmlTextures.delete(e),this.delete(e),this.info.destroyTexture(e)}}}class XG extends tr{constructor(e,t,r,i=1){super(e,t,r),this.a=i}set(e,t,r,i=1){return this.a=i,super.set(e,t,r)}copy(e){return e.a!==void 0&&(this.a=e.a),super.copy(e)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}class w0e extends aG{static get type(){return"OverrideContextNode"}constructor(e,t=null){super(t,{overrideNodes:e}),this.isOverrideContextNode=!0}getFlowContextData(){const e=[];this.traverse(i=>{i.isOverrideContextNode===!0&&e.push(i.value.overrideNodes)});const t=new Map(e.flatMap(i=>Array.from(i.entries()))),r=super.getFlowContextData();return r.overrideNodes=t,r}}function _0e(n,e=null,t=null){if(e&&e.isNode){const r=e;e=()=>r}return new w0e(new Map([[n,e]]),t)}Ut("overrideNode",(n,e,t)=>_0e(e,t,n));function S0e(n,e=null){const t=new Map;for(const[r,i]of n){const s=i!==null?typeof i=="function"?i:()=>i:null;t.set(r,s)}return new w0e(t,e)}Ut("overrideNodes",(n,e)=>S0e(e,n));class T0e extends Xi{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getMemberType(e,t){const r=this.getNodeType(e),i=e.getStructTypeNode(r);let s;return i!==null?s=i.getMemberType(e,t):(sn(`TSL: Member "${t}" not found in struct "${r}".`,new ho),s="float"),s}
4313getHash(){return String(this.id)}generate(){return this.name}}const s$e=(n,e)=>new T0e(n,e);class a$e extends cr{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this._expressionNode=null,this._currentNode=null,this._nodeDataLibrary=new Map,this.isStackNode=!0}getElementType(e){return this.outputNode?this.outputNode.getElementType(e):"void"}generateNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}getMemberType(e,t){return this.outputNode?this.outputNode.getMemberType(e,t):"void"}addToStack(e,t=-1){if(e.isNode!==!0)return sn("TSL: Invalid node added to stack.",new ho),this;if(t===-1)if(this._currentNode){let r=this._nodeDataLibrary.get(this._currentNode);r===void 0&&(r={delta:0},this._nodeDataLibrary.set(this._currentNode,r)),r.delta++,t=this.nodes.indexOf(this._currentNode)+r.delta}else t=this.nodes.length;return this.nodes.splice(t,0,e),this}addToStackBefore(e){const t=this._currentNode?this.nodes.indexOf(this._currentNode):0;return this.addToStack(e,t)}If(e,t){const r=new xb(t);return this._currentCond=yc(e,r),this.addToStack(this._currentCond)}ElseIf(e,t){const r=new xb(t),i=yc(e,r);return this._currentCond.elseNode=i,this._currentCond=i,this}Else(e){return this._currentCond.elseNode=new xb(e),this}Switch(e){return this._expressionNode=Hn(e),this}Case(...e){const t=[];if(e.length>=2)for(let o=0;o<e.length-1;o++)t.push(this._expressionNode.equal(Hn(e[o])));else sn("TSL: Invalid parameter length. Case() requires at least two parameters.",new ho);const r=e[e.length-1],i=new xb(r);let s=t[0];for(let o=1;o<t.length;o++)s=s.or(t[o]);const a=yc(s,i);return this._currentCond===null?(this._currentCond=a,this.addToStack(this._currentCond)):(this._currentCond.elseNode=a,this._currentCond=a,this)}Default(e){return this.Else(e),this}setup(e){const t=e.getNodeProperties(this);let r=0;for(const i of this.getChildren())i.isVarNode&&i.isIntent(e)&&i.isAssign(e)!==!0||(t["node"+r++]=i);return t.outputNode||null}build(e,...t){const r=Oz(),i=e.buildStage;F5(this),e.setActiveStack(this);for(let a=0;a<this.nodes.length;a++){const o=this.nodes[a],l=this._currentNode;if(this._currentNode=o,!(o.isVarNode&&o.isIntent(e)&&o.isAssign(e)!==!0)){if(i==="setup")o.build(e);else if(i==="analyze")o.build(e,this);else if(i==="generate"){const u=e.getDataFromNode(o,"any").stages,d=u&&u[e.shaderStage];if(o.isVarNode&&d&&d.length===1&&d[0]&&d[0].isStackNode)continue;o.build(e,"void")}this._currentNode=l}}let s;if(this.outputNode){const a=this.outputNode.build(e,...t);(e.buildStage!=="generate"||this.outputNode.getNodeType(e)!=="void")&&(s=a)}else s=super.build(e,...t);return F5(r),e.removeActiveStack(this),s}}const k6=ri(a$e).setParameterLength(0,1);function o$e(n){return Object.entries(n).map(([e,t])=>typeof t=="string"?{name:e,type:t,atomic:!1}:{name:e,type:t.type,atomic:t.atomic||!1})}class l$e extends cr{static get type(){return"StructTypeNode"}constructor(e,t=null){super("struct"),this.membersLayout=o$e(e),this.name=t,this.isStructTypeNode=!0}getLength(){let e=1,t=0;for(const r of this.membersLayout){const i=r.type,s=OBe(i),a=DBe(i);e=Math.max(e,a);const l=t%e%a;l!==0&&(t+=a-l),t+=s}return Math.ceil(t/e)*e}getMemberType(e,t){const r=this.membersLayout.find(i=>i.name===t);return r?r.type:"void"}generateNodeType(e){return e.getStructTypeFromNode(this,this.membersLayout,this.name).name}setup(e){e.getStructTypeFromNode(this,this.membersLayout,this.name),e.addInclude(this)}generate(e){return this.getNodeType(e)}}class c$e extends cr{static get type(){return"StructNode"}constructor(e,t){super("vec3"),this.structTypeNode=e,this.values=t,this.isStructNode=!0}generateNodeType(e){return this.structTypeNode.getNodeType(e)}getMemberType(e,t){return this.structTypeNode.getMemberType(e,t)}_getChildren(){const e=super._getChildren(),t=e.find(r=>r.childNode===this.structTypeNode);return e.splice(e.indexOf(t),1),e.push(t),e}generate(e){const t=e.getVarFromNode(this),r=t.type,i=e.getPropertyName(t);return e.addLineFlowCode(`${i} = ${e.generateStruct(r,this.structTypeNode.membersLayout,this.values)}`,this),t.name}}const u$e=(n,e=null)=>{const t=new l$e(n,e);return Lz((...i)=>{let s=null;if(i.length>0)if(i[0].isNode){s={};const a=Object.keys(n);for(let o=0;o<i.length;o++)s[a[o]]=i[o]}else s=i[0];return new c$e(t,s)},t)};class E0e extends cr{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}generateNodeType(){return"OutputType"}generate(e){const t=e.getDataFromNode(this);if(t.membersLayout===void 0){const a=this.members,o=[];for(let l=0;l<a.length;l++){const u="m"+l,d=a[l].getNodeType(e);o.push({name:u,type:d,index:l})}t.membersLayout=o,t.structType=e.getOutputStructTypeFromNode(this,t.membersLayout)}const r=e.getOutputStructName(),i=this.members,s=r!==""?r+".":"";for(let a=0;a<i.length;a++){const o=i[a].build(e,t.membersLayout[a].type);e.addLineFlowCode(`${s}m${a} = ${o}`,this)}return r}}const d$e=ri(E0e);class C0e{constructor(e=dl){this.blending=e,this.blendSrc=dw,this.blendDst=hw,this.blendEquation=Ol,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.premultiplyAlpha=!1}copy(e){return this.blending=e.blending,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.premultiplyAlpha=e.premultiplyAlpha,this}clone(){return new this.constructor().copy(this)}}const h$e=new C0e(qo),f$e=new C0e(gV);function N0e(n,e){for(let t=0;t<n.length;t++)if(n[t].name===e)return t;return-1}
4313class p$e extends E0e{static get type(){return"MRTNode"}constructor(e){super(),this.outputNodes=e,this.blendModes={output:f$e},this.isMRTNode=!0}setBlendMode(e,t){return this.blendModes[e]=t,this}getBlendMode(e){return this.blendModes[e]||h$e}has(e){return this.outputNodes[e]!==void 0}get(e){return this.outputNodes[e]}merge(e){const t={...this.outputNodes,...e.outputNodes},r={...this.blendModes,...e.blendModes},i=M0e(t);return i.blendings=r,i}setup(e){const t=this.outputNodes,r=e.renderer.getRenderTarget(),i=[],s=r.textures;for(const a in t){const o=N0e(s,a);if(o===-1)continue;const l=e.getOutputType(o);i[o]=t[a].convert(l)}return this.members=i,super.setup(e)}}const M0e=ri(p$e);class DT extends za{static get type(){return"BitcastNode"}constructor(e,t,r=null){super(),this.valueNode=e,this.conversionType=t,this.inputType=r,this.isBitcastNode=!0}generateNodeType(e){if(this.inputType!==null){const t=this.valueNode.getNodeType(e),r=e.getTypeLength(t);return e.getTypeFromLength(r,this.conversionType)}return this.conversionType}generate(e){const t=this.getNodeType(e);let r="";if(this.inputType!==null){const i=this.valueNode.getNodeType(e);r=e.getTypeLength(i)===1?this.inputType:e.changeComponentType(i,this.inputType)}else r=this.valueNode.getNodeType(e);return`${e.getBitcastMethod(t,r)}( ${this.valueNode.build(e,r)} )`}}const k0e=mn(DT).setParameterLength(2),m$e=n=>new DT(n,"int","float"),R0e=n=>new DT(n,"uint","float"),g$e=n=>new DT(n,"float","int"),A$e=n=>new DT(n,"float","uint"),YC={};class Wd extends _t{static get type(){return"BitcountNode"}constructor(e,t){super(e,t),this.isBitcountNode=!0}_resolveElementType(e,t,r){r==="int"?t.assign(k0e(e,"uint")):t.assign(e)}_returnDataNode(e){switch(e){case"uint":return un;case"int":return st;case"uvec2":return Dz;case"uvec3":return Cy;case"uvec4":return Uz;case"ivec2":return _a;case"ivec3":return jz;case"ivec4":return Fz}}_createTrailingZerosBaseLayout(e,t){const r=this._returnDataNode(t);return ut(([s])=>{const a=un(0);this._resolveElementType(s,a,t);const o=Ie(a.bitAnd(Qz(a))),u=R0e(o).shiftRight(23).sub(127);return r(u)}).setLayout({name:e,type:t,inputs:[{name:"value",type:t}]})}_createLeadingZerosBaseLayout(e,t){const r=this._returnDataNode(t);return ut(([s])=>{nr(s.equal(un(0)),()=>un(32));const a=un(0),o=un(0);return this._resolveElementType(s,a,t),nr(a.shiftRight(16).equal(0),()=>{o.addAssign(16),a.shiftLeftAssign(16)}),nr(a.shiftRight(24).equal(0),()=>{o.addAssign(8),a.shiftLeftAssign(8)}),nr(a.shiftRight(28).equal(0),()=>{o.addAssign(4),a.shiftLeftAssign(4)}),nr(a.shiftRight(30).equal(0),()=>{o.addAssign(2),a.shiftLeftAssign(2)}),nr(a.shiftRight(31).equal(0),()=>{o.addAssign(1)}),r(o)}).setLayout({name:e,type:t,inputs:[{name:"value",type:t}]})}_createOneBitsBaseLayout(e,t){const r=this._returnDataNode(t);return ut(([s])=>{const a=un(0);this._resolveElementType(s,a,t),a.assign(a.sub(a.shiftRight(un(1)).bitAnd(un(1431655765)))),a.assign(a.bitAnd(un(858993459)).add(a.shiftRight(un(2)).bitAnd(un(858993459))));const o=a.add(a.shiftRight(un(4))).bitAnd(un(252645135)).mul(un(16843009)).shiftRight(un(24));return r(o)}).setLayout({name:e,type:t,inputs:[{name:"value",type:t}]})}_createMainLayout(e,t,r,i){const s=this._returnDataNode(t);return ut(([o])=>{if(r===1)return s(i(o));{const l=s(0),u=["x","y","z","w"];for(let d=0;d<r;d++){const h=u[d];l[h].assign(i(o[h]))}return l}}).setLayout({name:e,type:t,inputs:[{name:"value",type:t}]})}setup(e){const{method:t,aNode:r}=this,{renderer:i}=e;if(i.backend.isWebGPUBackend)return super.setup(e);const s=this.getInputType(e),a=e.getElementType(s),o=e.getTypeLength(s),l=`${t}_base_${a}`,u=`${t}_${s}`;let d=YC[l];if(d===void 0){switch(t){case Wd.COUNT_LEADING_ZEROS:{d=this._createLeadingZerosBaseLayout(l,a);break}case Wd.COUNT_TRAILING_ZEROS:{d=this._createTrailingZerosBaseLayout(l,a);break}case Wd.COUNT_ONE_BITS:{d=this._createOneBitsBaseLayout(l,a);break}}YC[l]=d}let h=YC[u];return h===void 0&&(h=this._createMainLayout(u,s,o,d),YC[u]=h),ut(()=>h(r))()}}Wd.COUNT_TRAILING_ZEROS="countTrailingZeros";Wd.COUNT_LEADING_ZEROS="countLeadingZeros";Wd.COUNT_ONE_BITS="countOneBits";const x$e=mn(Wd,Wd.COUNT_TRAILING_ZEROS).setParameterLength(1),v$e=mn(Wd,Wd.COUNT_LEADING_ZEROS).setParameterLength(1),y$e=mn(Wd,Wd.COUNT_ONE_BITS).setParameterLength(1),b$e=ut(([n])=>{const e=n.toUint().mul(747796405).add(2891336453),t=e.shiftRight(e.shiftRight(28).add(4)).bitXor(e).mul(277803737);
vendor: 1,843 bytes, line 4313
4313return t.shiftRight(22).bitXor(t).toFloat().mul(1/2**32)}),nU=(n,e)=>Ih(Pr(4,n.mul(Ei(1,n))),e),w$e=(n,e)=>n.lessThan(.5)?nU(n.mul(2),e).div(2):Ei(1,nU(Pr(Ei(1,n),2),e).div(2)),_$e=(n,e,t)=>Ih(nh(Ih(n,e),fo(Ih(n,e),Ih(Ei(1,n),t))),1/e),S$e=(n,e)=>ou(Rk.mul(e.mul(n).sub(1))).div(Rk.mul(e.mul(n).sub(1)));class YG extends za{static get type(){return"PackFloatNode"}constructor(e,t){super(),this.vectorNode=t,this.encoding=e,this.isPackFloatNode=!0}generateNodeType(){return"uint"}generate(e){const t=this.vectorNode.getNodeType(e);return`${e.getFloatPackingMethod(this.encoding)}(${this.vectorNode.build(e,t)})`}}const T$e=mn(YG,"snorm").setParameterLength(1),E$e=mn(YG,"unorm").setParameterLength(1),C$e=mn(YG,"float16").setParameterLength(1);class QG extends za{static get type(){return"UnpackFloatNode"}constructor(e,t){super(),this.uintNode=t,this.encoding=e,this.isUnpackFloatNode=!0}generateNodeType(){return"vec2"}generate(e){const t=this.uintNode.getNodeType(e);return`${e.getFloatUnpackingMethod(this.encoding)}(${this.uintNode.build(e,t)})`}}const N$e=mn(QG,"snorm").setParameterLength(1),M$e=mn(QG,"unorm").setParameterLength(1),k$e=mn(QG,"float16").setParameterLength(1),Rm=ut(([n])=>n.fract().sub(.5).abs()).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),R$e=ut(([n])=>ct(Rm(n.z.add(Rm(n.y.mul(1)))),Rm(n.z.add(Rm(n.x.mul(1)))),Rm(n.y.add(Rm(n.x.mul(1)))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),P$e=ut(([n,e,t])=>{const r=ct(n).toVar(),i=Ie(1.4).toVar(),s=Ie(0).toVar(),a=ct(r).toVar();return ys({start:Ie(0),end:Ie(3),type:"float",condition:"<="},()=>{const o=ct(R$e(a.mul(2))).toVar();r.addAssign(o.add(t.mul(Ie(.1).mul(e)))),a.mulAssign(1.8),i.mulAssign(1.5),r.mulAssign(1.2);const l=Ie(Rm(r.z.add(Rm(r.x.add(Rm(r.y)))))).toVar();s.addAssign(l.div(i)),a.addAssign(.14)}),s}
4313).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"position",type:"vec3"},{name:"speed",type:"float"},{name:"time",type:"float"}]});class L$e extends cr{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFn=null,this.global=!0}generateNodeType(e){return this.getCandidateFn(e).shaderNode.layout.type}getCandidateFn(e){const t=this.parametersNodes;let r=this._candidateFn;if(r===null){let i=null,s=-1;for(const a of this.functionNodes){const l=a.shaderNode.layout;if(l===null)throw new Error("THREE.FunctionOverloadingNode: FunctionNode must be a layout.");const u=l.inputs;if(t.length===u.length){let d=0;for(let h=0;h<t.length;h++){const f=t[h],p=u[h];f.getNodeType(e)===p.type&&d++}d>s&&(i=a,s=d)}}this._candidateFn=r=i}return r}setup(e){return this.getCandidateFn(e)(...this.parametersNodes)}}const O$e=ri(L$e),Gl=n=>(...e)=>O$e(n,...e),k_=Qn(0).setGroup(lr).onRenderUpdate(n=>n.time),D$e=Qn(0).setGroup(lr).onRenderUpdate(n=>n.deltaTime),P0e=Qn(0,"uint").setGroup(lr).onRenderUpdate(n=>n.frameId),j$e=(n=k_)=>n.add(.75).mul(Math.PI*2).sin().mul(.5).add(.5),I$e=(n=k_)=>n.fract().round(),F$e=(n=k_)=>n.add(.5).fract().mul(2).sub(1).abs(),U$e=(n=k_)=>n.fract();function B$e(n,e=null){return pg(e,{getUV:typeof n=="function"?n:()=>n})}const V$e=ut(([n,e,t=Cn(.5)])=>OT(n.sub(t),e).add(t)),z$e=ut(([n,e,t=Cn(.5)])=>{const r=n.sub(t),i=r.dot(r),a=i.mul(i).mul(e);return n.add(r.mul(a))}),G$e=ut(({position:n=null,horizontal:e=!0,vertical:t=!1})=>{let r;n!==null?(r=Fh.toVar(),r[3][0]=n.x,r[3][1]=n.y,r[3][2]=n.z):r=Fh;const i=Q1.mul(r);return Kw(e)&&(i[0][0]=Fh[0].length(),i[0][1]=0,i[0][2]=0),Kw(t)&&(i[1][0]=0,i[1][1]=Fh[1].length(),i[1][2]=0),i[2][0]=0,i[2][1]=0,i[2][2]=1,pu.mul(i).mul(pa)}),q$e=ut(([n=null])=>{const e=jk();return jk(UG(n)).sub(e).lessThan(0).select(Yf,n)}),$$e=ut(([n,e=ws(),t=Ie(0)])=>{const r=n.x,i=n.y,s=t.mod(r.mul(i)).floor(),a=s.mod(r),o=i.sub(s.add(1).div(r).ceil()),l=n.reciprocal(),u=Cn(a,o);return e.add(u).mul(l)}),L0e=ut(([n,e=null,t=null,r=Ie(1),i=pa,s=kc])=>{let a=s.abs().normalize();a=a.div(a.dot(ct(1)));const o=i.yz.mul(r),l=i.zx.mul(r),u=i.xy.mul(r),d=n.value,h=e!==null?e.value:d,f=t!==null?t.value:d,p=Pi(d,o).mul(a.x),g=Pi(h,l).mul(a.y),A=Pi(f,u).mul(a.z);return fo(p,g,A)}),H$e=(...n)=>L0e(...n),N2=new Xp,Lx=new Ve,M2=new Ve,kL=new Ve,V3=new kr,QC=new Ve(0,0,-1),Dp=new Rr,z3=new Ve,KC=new Ve,G3=new Rr,ZC=new Jt,Fk=new cp,W$e=Yf.flipX();Fk.depthTexture=new Bl(1,1);let JC=!1;class KG extends L0{static get type(){return"ReflectorNode"}constructor(e={}){super(e.defaultTexture||Fk.texture,W$e),this._reflectorBaseNode=e.reflector||new X$e(this,e),this._depthNode=null,this.setUpdateMatrix(!1)}get reflector(){return this._reflectorBaseNode}get target(){return this._reflectorBaseNode.target}getDepthNode(){if(this._depthNode===null){if(this._reflectorBaseNode.depth!==!0)throw new Error("THREE.ReflectorNode: Depth node can only be requested when the reflector is created with { depth: true }. ");this._depthNode=new KG({defaultTexture:Fk.depthTexture,reflector:this._reflectorBaseNode})}return this._depthNode}setup(e){return e.object.isQuadMesh||this._reflectorBaseNode.build(e),super.setup(e)}clone(){const e=new this.constructor(this.reflectorNode);return e.uvNode=this.uvNode,e.levelNode=this.levelNode,e.biasNode=this.biasNode,e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e.gatherNode=this.gatherNode,e.offsetNode=this.offsetNode,e._reflectorBaseNode=this._reflectorBaseNode,e}dispose(){super.dispose(),this._reflectorBaseNode.dispose()}}class X$e extends cr{static get type(){return"ReflectorBaseNode"}constructor(e,t={}){super();const{target:r=new ga,resolutionScale:i=1,generateMipmaps:s=!1,bounces:a=!0,depth:o=!1,samples:l=0}=t;this.textureNode=e,this.target=r,this.resolutionScale=i,t.resolution!==void 0&&(_i('ReflectorNode: The "resolution" parameter has been renamed to "resolutionScale".'),this.resolutionScale=t.resolution),this.generateMipmaps=s,this.bounces=a,this.depth=o,this.samples=l,this.updateBeforeType=a?Tr.RENDER:Tr.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new Map,this.forceUpdate=!1,this.hasOutput=!1}_updateResolution(e,t){const r=this.resolutionScale;t.getDrawingBufferSize(ZC),e.setSize(Math.round(ZC.width*r),Math.round(ZC.height*r))}setup(e){return this._updateResolution(Fk,e.renderer),super.setup(e)}dispose(){super.dispose();
vendor: 6,222 bytes, line 4313
4313for(const e of this.renderTargets.values())e.dispose()}getVirtualCamera(e){let t=this.virtualCameras.get(e);return t===void 0&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return t===void 0&&(t=new cp(0,0,{type:Js,samples:this.samples}),this.generateMipmaps===!0&&(t.texture.minFilter=dMe,t.texture.generateMipmaps=!0),this.depth===!0&&(t.depthTexture=new Bl),this.renderTargets.set(e,t)),t}updateBefore(e){if(this.bounces===!1&&JC)return!1;JC=!0;const{scene:t,camera:r,renderer:i,material:s}=e,{target:a}=this,o=this.getVirtualCamera(r),l=this.getRenderTarget(o);i.getDrawingBufferSize(ZC),this._updateResolution(l,i),M2.setFromMatrixPosition(a.matrixWorld),kL.setFromMatrixPosition(r.matrixWorld),V3.extractRotation(a.matrixWorld),Lx.set(0,0,1),Lx.applyMatrix4(V3),z3.subVectors(M2,kL);const u=z3.dot(Lx)>0;let d=!1;if(u===!0&&this.forceUpdate===!1){if(this.hasOutput===!1){JC=!1;return}d=!0}z3.reflect(Lx).negate(),z3.add(M2),V3.extractRotation(r.matrixWorld),QC.set(0,0,-1),QC.applyMatrix4(V3),QC.add(kL),KC.subVectors(M2,QC),KC.reflect(Lx).negate(),KC.add(M2),o.coordinateSystem=r.coordinateSystem,o.position.copy(z3),o.up.set(0,1,0),o.up.applyMatrix4(V3),o.up.reflect(Lx),o.lookAt(KC),o.near=r.near,o.far=r.far,o.updateMatrixWorld(),o.projectionMatrix.copy(r.projectionMatrix),N2.setFromNormalAndCoplanarPoint(Lx,M2),N2.applyMatrix4(o.matrixWorldInverse),Dp.set(N2.normal.x,N2.normal.y,N2.normal.z,N2.constant);const h=o.projectionMatrix;G3.x=(Math.sign(Dp.x)+h.elements[8])/h.elements[0],G3.y=(Math.sign(Dp.y)+h.elements[9])/h.elements[5],G3.z=-1,G3.w=(1+h.elements[10])/h.elements[14],Dp.multiplyScalar(1/Dp.dot(G3));const f=0;h.elements[2]=Dp.x,h.elements[6]=Dp.y,h.elements[10]=i.coordinateSystem===qh?Dp.z-f:Dp.z+1-f,h.elements[14]=Dp.w,this.textureNode.value=l.texture,this.depth===!0&&(this.textureNode.getDepthNode().value=l.depthTexture),s.visible=!1;const p=i.getRenderTarget(),g=i.getMRT(),A=i.autoClear;i.setMRT(null),i.setRenderTarget(l),i.autoClear=!0;const x=t.name;t.name=(t.name||"Scene")+" [ Reflector ]",d?(i.clear(),this.hasOutput=!1):(i.render(t,o),this.hasOutput=!0),t.name=x,i.setMRT(g),i.setRenderTarget(p),i.autoClear=A,s.visible=!0,JC=!1,this.forceUpdate=!1}get resolution(){return _i('ReflectorNode: The "resolution" property has been renamed to "resolutionScale".'),this.resolutionScale}set resolution(e){_i('ReflectorNode: The "resolution" property has been renamed to "resolutionScale".'),this.resolutionScale=e}}const Y$e=n=>new KG(n),RL=new S_(-1,1,1,-1,0,1);class Q$e extends ds{constructor(e=!1){super();const t=e===!1?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Bi([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Bi(t,2))}}const K$e=new Q$e;class ZG extends ns{constructor(e=null){super(K$e,e),this.camera=RL,this.isQuadMesh=!0}async renderAsync(e){_i('QuadMesh: "renderAsync()" has been deprecated. Use "render()" and "await renderer.init();" when creating the renderer.'),await e.init(),e.render(this,RL)}render(e){e.render(this,RL)}}const Z$e=new Jt;class J$e extends L0{static get type(){return"RTTNode"}constructor(e,t=null,r=null,i={type:Js}){const s=new cp(t,r,i);super(s.texture,ws()),this.isRTTNode=!0,this.node=e,this.width=t,this.height=r,this.renderTarget=s,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this._resolutionScale=1,this._rttNode=null,this._quadMesh=new ZG(new Va),this.updateBeforeType=Tr.RENDER}get autoResize(){return this.width===null}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){const r=Math.floor(e*this._resolutionScale),i=Math.floor(t*this._resolutionScale);this.renderTarget.setSize(r,i),this.textureNeedsUpdate=!0}setResolutionScale(e){return this._resolutionScale=e,this.autoResize===!1&&this.setSize(this.width,this.height),this}getResolutionScale(){return this._resolutionScale}updateBefore({renderer:e}){if(this.textureNeedsUpdate===!1&&this.autoUpdate===!1)return;this.textureNeedsUpdate=!1;const t=e.getRenderTarget();if(this.autoResize===!0){const i=e.getDrawingBufferSize(Z$e),s=Math.floor(i.width*this._resolutionScale),a=Math.floor(i.height*this._resolutionScale);(s!==this.renderTarget.width||a!==this.renderTarget.height)&&(this.renderTarget.setSize(s,a),this.textureNeedsUpdate=!0)}let r="RTT";this.node.name&&(r=this.node.name+" [ "+r+" ]"),this._quadMesh.material.fragmentNode=this._rttNode,this._quadMesh.name=r,e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new L0(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const O0e=(n,...e)=>new J$e(Hn(n),...e),eHe=(n,...e)=>n.isSampleNode||n.isTextureNode?n:n.isPassNode?n.getTextureNode():O0e(n,...e),ib=ut(([n,e,t],r)=>{let i;r.renderer.coordinateSystem===qh?(n=Cn(n.x,n.y.oneMinus()).mul(2).sub(1),i=Vn(ct(n,e),1)):i=Vn(ct(n.x,n.y.oneMinus(),e).mul(2).sub(1),1);const s=Vn(t.mul(i));return s.xyz.div(s.w)}),tHe=ut(([n,e])=>{const t=e.mul(Vn(n,1)),r=t.xy.div(t.w).mul(.5).add(.5).toVar();return Cn(r.x,r.y.oneMinus())}),nHe=ut(([n,e,t])=>{const r=ly(Ya(e)),i=_a(n.mul(r)).toVar(),s=Ya(e,i).toVar(),a=Ya(e,i.sub(_a(2,0))).toVar(),o=Ya(e,i.sub(_a(1,0))).toVar(),l=Ya(e,i.add(_a(1,0))).toVar(),u=Ya(e,i.add(_a(2,0))).toVar(),d=Ya(e,i.add(_a(0,2))).toVar(),h=Ya(e,i.add(_a(0,1))).toVar(),f=Ya(e,i.sub(_a(0,1))).toVar(),p=Ya(e,i.sub(_a(0,2))).toVar(),g=zs(Ei(Ie(2).mul(o).sub(a),s)).toVar(),A=zs(Ei(Ie(2).mul(l).sub(u),s)).toVar(),x=zs(Ei(Ie(2).mul(h).sub(d),s)).toVar(),b=zs(Ei(Ie(2).mul(f).sub(p),s)).toVar(),_=ib(n,s,t).toVar(),M=g.lessThan(A).select(_.sub(ib(n.sub(Cn(Ie(1).div(r.x),0)),o,t)),_.negate().add(ib(n.add(Cn(Ie(1).div(r.x),0)),l,t))),T=x.lessThan(b).select(_.sub(ib(n.add(Cn(0,Ie(1).div(r.y))),h,t)),_.negate().add(ib(n.sub(Cn(0,Ie(1).div(r.y))),f,t)));return _c(ag(M,T))}),JG=ut(([n])=>rp(Ie(52.9829189).mul(rp(Wh(n,Cn(.06711056,.00583715)))))).setLayout({name:"interleavedGradientNoise",type:"float",inputs:[{name:"position",type:"vec2"}]}),qf=ut(([n,e,t])=>{const r=Ie(2.399963229728653),i=gu(Ie(n).add(.5).div(Ie(e))),s=Ie(n).mul(r).add(t);return Cn(If(s),ou(s)).mul(i)}
4313).setLayout({name:"vogelDiskSample",type:"vec2",inputs:[{name:"sampleIndex",type:"int"},{name:"samplesCount",type:"int"},{name:"phi",type:"float"}]});class rHe extends cr{static get type(){return"SampleNode"}constructor(e,t=null){super(),this.callback=e,this.uvNode=t,this.isSampleNode=!0}setup(){return this.sample(ws())}sample(e){return this.callback(e)}}const iHe=(n,e=null)=>new rHe(n,Hn(e));class R6 extends h1{constructor(e,t,r=Float32Array){const i=ArrayBuffer.isView(e)?e:new r(e*t);super(i,t),this.isStorageInstancedBufferAttribute=!0}}class sHe extends Ea{constructor(e,t,r=Float32Array){const i=ArrayBuffer.isView(e)?e:new r(e*t);super(i,t),this.isStorageBufferAttribute=!0}}const aHe=(n,e="float")=>{let t,r;e.isStructTypeNode===!0?(t=e.getLength(),r=Sk("float")):(t=qde(e),r=Sk(e));const i=new sHe(n,t,r);return p1(i,e,n)},oHe=(n,e="float")=>{let t,r;e.isStructTypeNode===!0?(t=e.getLength(),r=Sk("float")):(t=qde(e),r=Sk(e));const i=new R6(n,t,r);return p1(i,e,i.count)};class lHe extends cr{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const cHe=Pn(lHe),PL=new kr,D0e=Qn(0).setGroup(lr).onRenderUpdate(({scene:n})=>n.backgroundBlurriness),rU=Qn(1).setGroup(lr).onRenderUpdate(({scene:n})=>n.backgroundIntensity),j0e=Qn(new kr).setGroup(lr).onRenderUpdate(({scene:n})=>{const e=n.background;return e!==null&&e.isTexture&&e.mapping!==LV||n.backgroundNode&&n.backgroundNode.isNode?PL.makeRotationFromEuler(n.backgroundRotation).transpose():PL.identity(),PL});class I0e extends L0{static get type(){return"StorageTextureNode"}constructor(e,t,r=null){super(e,t),this.storeNode=r,this.mipLevel=0,this.isStorageTextureNode=!0,this.access=Fl.WRITE_ONLY}getInputType(){return"storageTexture"}getTransformedUV(e){return e}setup(e){super.setup(e);const t=e.getNodeProperties(this);return t.storeNode=this.storeNode,t}setAccess(e){return this.access=e,this}
4313setMipLevel(e){return this.mipLevel=e,this}generate(e,t){return this.storeNode!==null?(this.generateStore(e),""):super.generate(e,t)}generateSnippet(e,t,r,i,s,a,o,l,u){const d=this.value;return e.generateStorageTextureLoad(d,t,r,i,a,u)}toReadWrite(){return this.setAccess(Fl.READ_WRITE)}toReadOnly(){return this.setAccess(Fl.READ_ONLY)}toWriteOnly(){return this.setAccess(Fl.WRITE_ONLY)}store(e,t){const r=this.clone();return r.referenceNode=this.getBase(),r.uvNode=e,r.storeNode=t,t!==null&&r.toStack(),r}generateStore(e){const t=e.getNodeProperties(this),{uvNode:r,storeNode:i,depthNode:s}=t,a=super.generate(e,"property"),o=r.build(e,this.value.is3DTexture===!0?"uvec3":"uvec2"),l=i.build(e,"vec4"),u=s?s.build(e,"int"):null,d=e.generateTextureStore(this.value,a,o,u,l);e.addLineFlowCode(d,this)}clone(){const e=super.clone();return e.storeNode=this.storeNode,e.mipLevel=this.mipLevel,e.access=this.access,e}}const F0e=ri(I0e).setParameterLength(1,3),uHe=(n,e,t)=>{let r;return n.isStorageTextureNode===!0?r=n.store(e,t):(r=F0e(n,e,t),t!==null&&r.toStack()),r};class dHe extends I0e{static get type(){return"StorageTexture3DNode"}constructor(e,t,r=null){super(e,t,r),this.isStorageTexture3DNode=!0}getDefaultUV(){return ct(.5,.5,.5)}setUpdateMatrix(){}generateUV(e,t){return t.build(e,this.sampler===!0?"vec3":"ivec3")}generateOffset(e,t){return t.build(e,"ivec3")}}const hHe=ri(dHe).setParameterLength(1,3),fHe=ut(({texture:n,uv:e})=>{const r=ct().toVar();return nr(e.x.lessThan(1e-4),()=>{r.assign(ct(1,0,0))}).ElseIf(e.y.lessThan(1e-4),()=>{r.assign(ct(0,1,0))}).ElseIf(e.z.lessThan(1e-4),()=>{r.assign(ct(0,0,1))}).ElseIf(e.x.greaterThan(1-1e-4),()=>{r.assign(ct(-1,0,0))}).ElseIf(e.y.greaterThan(1-1e-4),()=>{r.assign(ct(0,-1,0))}).ElseIf(e.z.greaterThan(1-1e-4),()=>{r.assign(ct(0,0,-1))}).Else(()=>{const s=n.sample(e.add(ct(-.01,0,0))).r.sub(n.sample(e.add(ct(.01,0,0))).r),a=n.sample(e.add(ct(0,-.01,0))).r.sub(n.sample(e.add(ct(0,.01,0))).r),o=n.sample(e.add(ct(0,0,-.01))).r.sub(n.sample(e.add(ct(0,0,.01))).r);r.assign(ct(s,a,o))}),r.normalize()});class pHe extends L0{static get type(){return"Texture3DNode"}constructor(e,t=null,r=null){super(e,t,r),this.isTexture3DNode=!0}getInputType(){return"texture3D"}getDefaultUV(){return ct(.5,.5,.5)}setUpdateMatrix(){}generateUV(e,t){return t.build(e,this.sampler===!0?"vec3":"ivec3")}generateOffset(e,t){return t.build(e,"ivec3")}normal(e){return fHe({texture:this,uv:e})}}const eq=ri(pHe).setParameterLength(1,3),mHe=(...n)=>eq(...n).setSampler(!1),gHe=(n,e,t)=>eq(n,e).level(t);class AHe extends bR{static get type(){return"UserDataNode"}constructor(e,t,r=null){super(e,t,r),this.userData=r}updateReference(e){return this.reference=this.userData!==null?this.userData:e.object.userData,this.reference}}const xHe=(n,e,t)=>new AHe(n,e,t),NJ=new WeakMap;class vHe extends za{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.projectionMatrix=null,this.updateType=Tr.OBJECT,this.updateAfterType=Tr.OBJECT,this.previousModelWorldMatrix=Qn(new kr),this.previousProjectionMatrix=Qn(new kr).setGroup(lr),this.previousCameraViewMatrix=Qn(new kr)}setProjectionMatrix(e){this.projectionMatrix=e}update({frameId:e,camera:t,object:r}){const i=MJ(r);this.previousModelWorldMatrix.value.copy(i);const s=U0e(t);s.frameId!==e&&(s.frameId=e,s.previousProjectionMatrix===void 0?(s.previousProjectionMatrix=new kr,s.previousCameraViewMatrix=new kr,s.currentProjectionMatrix=new kr,s.currentCameraViewMatrix=new kr,s.previousProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),s.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(s.previousProjectionMatrix.copy(s.currentProjectionMatrix),s.previousCameraViewMatrix.copy(s.currentCameraViewMatrix)),s.currentProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),s.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(s.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(s.previousCameraViewMatrix))}updateAfter({object:e}){MJ(e).copy(e.matrixWorld)}setup(){const e=this.projectionMatrix===null?pu:Qn(this.projectionMatrix),t=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),r=e.mul(O0).mul(pa),i=this.previousProjectionMatrix.mul(t).mul(uy),s=r.xy.div(r.w),a=i.xy.div(i.w);return Ei(s,a)}}function U0e(n){let e=NJ.get(n);return e===void 0&&(e={},NJ.set(n,e)),e}function MJ(n,e=0){const t=U0e(n);let r=t[e];return r===void 0&&(t[e]=r=new kr,t[e].copy(n.matrixWorld)),r}const yHe=Pn(vHe),bHe=ut(([n,e])=>td(1,n.oneMinus().div(e)).oneMinus()).setLayout({name:"blendBurn",type:"vec3",input
vendor: 6,368 bytes, line 4313
4313s:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),wHe=ut(([n,e])=>td(n.div(e.oneMinus()),1)).setLayout({name:"blendDodge",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),_He=ut(([n,e])=>n.oneMinus().mul(e.oneMinus()).oneMinus()).setLayout({name:"blendScreen",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),SHe=ut(([n,e])=>ui(n.mul(2).mul(e),n.oneMinus().mul(2).mul(e.oneMinus()).oneMinus(),oy(.5,n))).setLayout({name:"blendOverlay",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),THe=ut(([n,e])=>{const t=e.a.add(n.a.mul(e.a.oneMinus()));return Vn(e.rgb.mul(e.a).add(n.rgb.mul(n.a).mul(e.a.oneMinus())).div(t),t)}).setLayout({name:"blendColor",type:"vec4",inputs:[{name:"base",type:"vec4"},{name:"blend",type:"vec4"}]}),EHe=ut(([n])=>tq(n.rgb)),CHe=ut(([n,e=Ie(1)])=>e.mix(tq(n.rgb),n.rgb).max(0)),NHe=ut(([n,e=Ie(0)])=>{const t=fo(n.r,n.g,n.b).div(3),r=n.r.max(n.g.max(n.b)),i=r.sub(t).mul(e).mul(-3);return ui(n.rgb,r,i).max(0)}),MHe=ut(([n,e=Ie(1)])=>{const t=ct(.57735,.57735,.57735),r=e.cos();return ct(n.rgb.mul(r).add(t.cross(n.rgb).mul(e.sin()).add(t.mul(Wh(t,n.rgb).mul(r.oneMinus()))))).max(0)}),tq=(n,e=ct(_r.getLuminanceCoefficients(new Ve)))=>Wh(n,e),kHe=ut(([n,e=ct(1),t=ct(0),r=ct(1),i=Ie(1),s=ct(_r.getLuminanceCoefficients(new Ve,Uw))])=>{const a=n.rgb.dot(ct(s)),o=Na(n.rgb.mul(e).add(t),0),l=o.pow(r);return nr(o.r.greaterThan(0),()=>{o.r.assign(l.r)}),nr(o.g.greaterThan(0),()=>{o.g.assign(l.g)}),nr(o.b.greaterThan(0),()=>{o.b.assign(l.b)}),o.assign(a.add(o.sub(a).mul(i)).max(0)),Vn(o.rgb,n.a)}),RHe=ut(([n,e])=>n.mul(e).floor().div(e));let eN=null;class PHe extends TR{static get type(){return"ViewportSharedTextureNode"}constructor(e=Yf,t=null){eN===null&&(eN=new ZV),super(e,t,eN)}getTextureForReference(){return eN}updateReference(){return this}}const LHe=ri(PHe).setParameterLength(0,2),tN=new Jt;class B0e extends L0{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.isPassTextureNode=!0,this.setUpdateMatrix(!1)}setup(e){const t=e.getNodeProperties(this);return t.passNode=this.passNode,super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class kJ extends B0e{static get type(){return"PassMultipleTextureNode"}constructor(e,t,r=!1){super(e,null),this.textureName=t,this.previousTexture=r,this.isPassMultipleTextureNode=!0}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){const e=new this.constructor(this.passNode,this.textureName,this.previousTexture);return e.uvNode=this.uvNode,e.levelNode=this.levelNode,e.biasNode=this.biasNode,e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e.gatherNode=this.gatherNode,e.offsetNode=this.offsetNode,e}}class sp extends za{static get type(){return"PassNode"}constructor(e,t,r,i={}){super("vec4"),this.scope=e,this.scene=t,this.camera=r,this.options=i,this._width=1,this._height=1;const s=new cp(this._width,this._height,{type:Js,...i});s.texture.name="output";let a=null;(this.scope===sp.DEPTH||i.depthBuffer!==!1)&&(a=new Bl,a.isRenderTargetTexture=!0,a.name="depth",s.depthTexture=a),this.renderTarget=s,this.overrideMaterial=null,this.transparent=!0,this.opaque=!0,this.contextNode=null,this._contextNodeCache=null,this._textures={output:s.texture},a!==null&&(this._textures.depth=a),this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=Qn(0),this._cameraFar=Qn(0),this._mrt=null,this._layers=null,this._resolutionScale=1,this._viewport=null,this._scissor=null,this.isPassNode=!0,this.updateBeforeType=Tr.FRAME,this.global=!0}setResolutionScale(e){return this._resolutionScale=e,this}getResolutionScale(){return this._resolutionScale}setResolution(e){return an("PassNode: .setResolution() is deprecated. Use .setResolutionScale() instead."),this.setResolutionScale(e)}getResolution(){return an("PassNode: .getResolution() is deprecated. Use .getResolutionScale() instead."),this.getResolutionScale()}setLayers(e){return this._layers=e,this}getLayers(){return this._layers}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getTexture(e){let t=this._textures[e];if(t===void 0){if(e==="depth")throw new Error("THREE.PassNode: Depth texture is not available for this pass.");t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)}return t}getPreviousTexture(e){let t=this._previousTextures[e];return t===void 0&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(t!==void 0){const r=this._textures[e],i=this.renderTarget.textures.indexOf(r);this.renderTarget.textures[i]=t,this._textures[e]=t,this._previousTextures[e]=r,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return t===void 0&&(t=new kJ(this,e),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return t===void 0&&(this._textureNodes[e]===void 0&&this.getTextureNode(e),t=new kJ(this,e,!0),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(t===void 0){const r=this._cameraNear,i=this._cameraFar;this._viewZNodes[e]=t=ER(this.getTextureNode(e),r,i)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(t===void 0){const r=this._cameraNear,i=this._cameraFar,s=this.getViewZNode(e);this._linearDepthNodes[e]=t=Vv(s,r,i)}return t}async compileAsync(e){const t=e.getRenderTarget(),r=e.getMRT();e.setRenderTarget(this.renderTarget),e.setMRT(this._mrt),await e.compileAsync(this.scene,this.camera),e.setRenderTarget(t),e.setMRT(r)}setup({renderer:e}){return this.renderTarget.samples=this.options.samples===void 0?e.samples:this.options.samples,this.renderTarget.texture.type=e.getOutputBufferType(),e.reversedDepthBuffer===!0&&this.renderTarget.depthTexture!==null&&(this.renderTarget.depthTexture.type=ia),this.scope===sp.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:r}=this;let i;
4313const s=t.getOutputRenderTarget();s&&s.isXRRenderTarget===!0?(i=t.xr.getCamera(),t.xr.updateCamera(i),tN.set(s.width,s.height)):(i=this.camera,t.getDrawingBufferSize(tN)),this.setSize(tN.width,tN.height);const a=t.getRenderTarget(),o=t.getMRT(),l=t.autoClear,u=t.transparent,d=t.opaque,h=i.layers.mask,f=t.contextNode,p=r.overrideMaterial;this._cameraNear.value=i.near,this._cameraFar.value=i.far,this._layers!==null&&(i.layers.mask=this._layers.mask);for(const A in this._previousTextures)this.toggleTexture(A);this.overrideMaterial!==null&&(r.overrideMaterial=this.overrideMaterial),t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.autoClear=!0,t.transparent=this.transparent,t.opaque=this.opaque,this.contextNode!==null&&((this._contextNodeCache===null||this._contextNodeCache.version!==this.version)&&(this._contextNodeCache={version:this.version,context:pg({...t.contextNode.getFlowContextData(),...this.contextNode.getFlowContextData()})}),t.contextNode=this._contextNodeCache.context);const g=r.name;r.name=this.name?this.name:r.name,t.render(r,i),r.name=g,r.overrideMaterial=p,t.setRenderTarget(a),t.setMRT(o),t.autoClear=l,t.transparent=u,t.opaque=d,t.contextNode=f,i.layers.mask=h}setSize(e,t){this._width=e,this._height=t;const r=Math.floor(this._width*this._resolutionScale),i=Math.floor(this._height*this._resolutionScale);this.renderTarget.setSize(r,i),this._scissor!==null?(this.renderTarget.scissor.copy(this._scissor).multiplyScalar(this._resolutionScale).floor(),this.renderTarget.scissorTest=!0):this.renderTarget.scissorTest=!1,this._viewport!==null&&this.renderTarget.viewport.copy(this._viewport).multiplyScalar(this._resolutionScale).floor()}setScissor(e,t,r,i){e===null?this._scissor=null:(this._scissor===null&&(this._scissor=new Rr),e.isVector4?this._scissor.copy(e):this._scissor.set(e,t,r,i))}setViewport(e,t,r,i){e===null?this._viewport=null:(this._viewport===null&&(this._viewport=new Rr),e.isVector4?this._viewport.copy(e):this._viewport.set(e,t,r,i))}dispose(){this.renderTarget.dispose()}}sp.COLOR="color";sp.DEPTH="depth";const OHe=(n,e,t)=>new sp(sp.COLOR,n,e,t),DHe=(n,e)=>new B0e(n,e),jHe=(n,e,t)=>new sp(sp.DEPTH,n,e,t);class IHe extends sp{static get type(){return"ToonOutlinePassNode"}constructor(e,t,r,i,s){super(sp.COLOR,e,t),this.colorNode=r,this.thicknessNode=i,this.alphaNode=s,this._materialCache=new WeakMap,this.name="Outline Pass"}updateBefore(e){const{renderer:t}=e,r=t.getRenderObjectFunction();t.setRenderObjectFunction((i,s,a,o,l,u,d,h)=>{if((l.isMeshToonMaterial||l.isMeshToonNodeMaterial)&&l.wireframe===!1){const f=this._getOutlineMaterial(l);t.renderObject(i,s,a,o,f,u,d,h)}t.renderObject(i,s,a,o,l,u,d,h)}),super.updateBefore(e),t.setRenderObjectFunction(r)}_createMaterial(){const e=new Va;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=us;const t=kc.negate(),r=pu.mul(O0),i=Ie(1),s=r.mul(Vn(pa,1)),a=r.mul(Vn(pa.add(t),1)),o=_c(s.sub(a));return e.vertexNode=s.add(o.mul(this.thicknessNode).mul(s.w).mul(i)),e.colorNode=Vn(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return t===void 0&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const FHe=(n,e,t=new tr(0,0,0),r=.003,i=1)=>new IHe(n,e,Hn(t),Hn(r),Hn(i)),V0e=ut(([n,e])=>n.mul(e).clamp()).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),z0e=ut(([n,e])=>(n=n.mul(e),n.div(n.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),G0e=ut(([n,e])=>{n=n.mul(e),n=n.sub(.004).max(0);const t=n.mul(n.mul(6.2).add(.5)),r=n.mul(n.mul(6.2).add(1.7)).add(.06);return t.div(r).pow(2.2)}).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),UHe=ut(([n])=>{const e=n.mul(n.add(.0245786)).sub(90537e-9),t=n.mul(n.add(.432951).mul(.983729)).add(.238081);return e.div(t)}),q0e=ut(([n,e])=>{const t=gl(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),r=gl(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return n=n.mul(e).div(.6),n=t.mul(n),n=UHe(n),n=r.mul(n),n.clamp()}
vendor: 4,982 bytes, lines 4313-4314
4313).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),BHe=gl(ct(1.6605,-.1246,-.0182),ct(-.5876,1.1329,-.1006),ct(-.0728,-.0083,1.1187)),VHe=gl(ct(.6274,.0691,.0164),ct(.3293,.9195,.088),ct(.0433,.0113,.8956)),zHe=ut(([n])=>{const e=ct(n).toVar(),t=ct(e.mul(e)).toVar(),r=ct(t.mul(t)).toVar();return Ie(15.5).mul(r.mul(t)).sub(Pr(40.14,r.mul(e))).add(Pr(31.96,r).sub(Pr(6.868,t.mul(e))).add(Pr(.4298,t).add(Pr(.1191,e).sub(.00232))))}),$0e=ut(([n,e])=>{const t=ct(n).toVar(),r=gl(ct(.856627153315983,.137318972929847,.11189821299995),ct(.0951212405381588,.761241990602591,.0767994186031903),ct(.0482516061458583,.101439036467562,.811302368396859)),i=gl(ct(1.1271005818144368,-.1413297634984383,-.14132976349843826),ct(-.11060664309660323,1.157823702216272,-.11060664309660294),ct(-.016493938717834573,-.016493938717834257,1.2519364065950405)),s=Ie(-12.47393),a=Ie(4.026069);return t.mulAssign(e),t.assign(VHe.mul(t)),t.assign(r.mul(t)),t.assign(Na(t,1e-10)),t.assign(y0(t)),t.assign(t.sub(s).div(a.sub(s))),t.assign(ip(t,0,1)),t.assign(zHe(t)),t.assign(i.mul(t)),t.assign(Ih(Na(ct(0),t),ct(2.2))),t.assign(BHe.mul(t)),t.assign(ip(t,0,1)),t}).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),H0e=ut(([n,e])=>{const t=Ie(.76),r=Ie(.15);n=n.mul(e);const i=td(n.r,td(n.g,n.b)),s=yc(i.lessThan(.08),i.sub(Pr(6.25,i.mul(i))),.04);n.subAssign(s);const a=Na(n.r,Na(n.g,n.b));nr(a.lessThan(t),()=>n);const o=Ei(1,t),l=Ei(1,o.mul(o).div(a.add(o.sub(t))));n.mulAssign(l.div(a));const u=Ei(1,nh(1,r.mul(a.sub(l)).add(1)));return ui(n,ct(l),u)}).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class ra extends cr{static get type(){return"CodeNode"}constructor(e="",t=[],r=""){super("code"),this.isCodeNode=!0,this.global=!0,this.code=e,this.includes=t,this.language=r}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const i of t)i.build(e);const r=e.getCodeFromNode(this,this.getNodeType(e));return r.code=this.code,r.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}const PR=ri(ra).setParameterLength(1,3),GHe=(n,e)=>PR(n,e,"js"),qHe=(n,e)=>PR(n,e,"wgsl"),$He=(n,e)=>PR(n,e,"glsl");class W0e extends ra{static get type(){return"FunctionNode"}constructor(e="",t=[],r=""){super(e,t,r)}generateNodeType(e){return this.getNodeFunction(e).type}getMemberType(e,t){const r=this.getNodeType(e);return e.getStructTypeNode(r).getMemberType(e,t)}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let r=t.nodeFunction;return r===void 0&&(r=e.parser.parseFunction(this.code),t.nodeFunction=r),r}generate(e,t){super.generate(e);const r=this.getNodeFunction(e),i=r.name,s=r.type,a=e.getCodeFromNode(this,s);i!==""&&(a.name=i);const o=e.getPropertyName(a),l=this.getNodeFunction(e).getCode(o);return a.code=l+` 4314`,t==="property"?o:e.format(`${o}()`,s,t)}}const X0e=(n,e=[],t="")=>{const r=new W0e(n,e,t);return Lz((...s)=>r.call(...s),r)},HHe=(n,e)=>X0e(n,e,"glsl"),WHe=(n,e)=>X0e(n,e,"wgsl");function nq(n){let e;const t=n.context.getViewZ;return t!==void 0&&(e=t(this)),(e||Ja.z).negate()}const Y0e=ut(([n,e],t)=>{const r=nq(t);return rh(n,e,r)}),Q0e=ut(([n],e)=>{const t=nq(e);return n.mul(n,t,t).negate().exp().oneMinus()}),XHe=ut(([n,e],t)=>{const r=nq(t),s=e.sub(_0.y).max(0).toConst().mul(r).toConst();return n.mul(n,s,s).negate().exp().oneMinus()}),iU=ut(([n,e])=>Vn(e.toFloat().mix(Ib.rgb,n.toVec3()),Ib.a));let Ox=null,Dx=null;class YHe extends cr{static get type(){return"RangeNode"}constructor(e=Ie(),t=Ie()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=this.getConstNode(this.minNode),r=this.getConstNode(this.maxNode),i=e.getTypeLength(QA(t.value)),s=e.getTypeLength(QA(r.value));return i>s?i:s}generateNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}getConstNode(e){let t=null;if(e.traverse(r=>{r.isConstNode===!0&&(t=r)}),t===null)throw new Lfe('THREE.TSL: No "ConstNode" found in node graph.',this.stackTrace);return t}setup(e){const t=e.object;let r=null;if(t.count>1){const i=this.getConstNode(this.minNode),s=this.getConstNode(this.maxNode),a=i.value,o=s.value,l=e.getTypeLength(QA(a)),u=e.getTypeLength(QA(o));Ox=Ox||new Rr,Dx=Dx||new Rr,Ox.setScalar(0),Dx.setScalar(0),l===1?Ox.setScalar(a):a.isColor?Ox.set(a.r,a.g,a.b,1):Ox.set(a.x,a.y,a.z||0,a.w||0),u===1?Dx.setScalar(o):o.isColor?Dx.set(o.r,o.g,o.b,1):Dx.set(o.x,o.y,o.z||0,o.w||0);const d=4,h=d*t.count,f=new Float32Array(h);for(let A=0;A<h;A++){const x=A%d,b=Ox.getComponent(x),_=Dx.getComponent(x);f[A]=zw.lerp(b,_,Math.random())}const p=this.getNodeType(e);if(t.count*4*4<=e.getUniformBufferLimit())r=C_(f,"vec4",t.count).element
4314(Zf).convert(p);else{const A=new h1(f,4);e.geometry.setAttribute("__range"+this.id,A),r=vR(A).convert(p)}}else r=Ie(0);return r}}const QHe=ri(YHe).setParameterLength(2);class KHe extends cr{static get type(){return"ComputeBuiltinNode"}constructor(e,t){super(t),this._builtinName=e}getHash(e){return this.getBuiltinName(e)}generateNodeType(){return this.nodeType}setBuiltinName(e){return this._builtinName=e,this}getBuiltinName(){return this._builtinName}hasBuiltin(e){return e.hasBuiltin(this._builtinName)}generate(e,t){const r=this.getBuiltinName(e),i=this.getNodeType(e);return e.shaderStage==="compute"?e.format(r,i,t):(an(`ComputeBuiltinNode: Compute built-in value ${r} can not be accessed in the ${e.shaderStage} stage`),e.generateConst(i))}serialize(e){super.serialize(e),e.global=this.global,e._builtinName=this._builtinName}deserialize(e){super.deserialize(e),this.global=e.global,this._builtinName=e._builtinName}}const jT=(n,e)=>new KHe(n,e),ZHe=jT("numWorkgroups","uvec3"),JHe=jT("workgroupId","uvec3"),eWe=jT("globalId","uvec3"),tWe=jT("localId","uvec3"),nWe=jT("subgroupSize","uint");class rWe extends cr{constructor(e){super(),this.scope=e,this.isBarrierNode=!0}setup(e){e.allowEarlyReturns=!1,e.allowGlobalVariables=!1}generate(e){const{scope:t}=this,{renderer:r}=e;r.backend.isWebGLBackend===!0?e.addFlowCode(` // ${t}Barrier 4315`):e.addLineFlowCode(`${t}Barrier()`,this)}}const rq=ri(rWe),iWe=()=>rq("workgroup").toStack(),sWe=()=>rq("storage").toStack(),aWe=()=>rq("texture").toStack();class oWe extends Ey{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let r;const i=e.isContextAssign();if(r=super.generate(e),i!==!0){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}class lWe extends cr{constructor(e,t,r=0){super(t),this.bufferType=t,this.bufferCount=r,this.isWorkgroupInfoNode=!0,this.elementType=t,this.scope=e,this.name=""}setName(e){return this.name=e,this}label(e){return an('TSL: "label()" has been deprecated. Use "setName()" instead.',new ho),this.setName(e)}setScope(e){return this.scope=e,this}getElementType(){return this.elementType}getInputType(){return`${this.scope}Array`}element(e){return new oWe(this,e)}generate(e){const t=this.name!==""?this.name:`${this.scope}Array_${this.id}`;return e.getScopedArray(t,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const cWe=(n,e)=>new lWe("Workgroup",n,e);class Xo extends cr{static get type(){return"AtomicFunctionNode"}constructor(e,t,r){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=r,this.parents=!0}getInputType(e){return this.pointerNode.getNodeType(e)}generateNodeType(e){return this.getInputType(e)}generate(e){const t=e.getNodeProperties(this),r=t.parents,i=this.method,s=this.getNodeType(e),a=this.getInputType(e),o=this.pointerNode,l=this.valueNode,u=[];u.push(`&${o.build(e,a)}`),l!==null&&u.push(l.build(e,a));const d=`${e.getMethod(i,s)}( ${u.join(", ")} )`;if(r?r.length===1&&r[0].isStackNode===!0:!1)e.addLineFlowCode(d,this);else return t.constNode===void 0&&(t.constNode=zd(d,s).toConst()),t.constNode.build(e)}}Xo.ATOMIC_LOAD="atomicLoad";Xo.ATOMIC_STORE="atomicStore";Xo.ATOMIC_ADD="atomicAdd";Xo.ATOMIC_SUB="atomicSub";Xo.ATOMIC_MAX="atomicMax";Xo.ATOMIC_MIN="atomicMin";Xo.ATOMIC_AND="atomicAnd";Xo.ATOMIC_OR="atomicOr";Xo.ATOMIC_XOR="atomicXor";const uWe=ri(Xo),B0=(n,e,t)=>uWe(n,e,t).toStack(),dWe=n=>B0(Xo.ATOMIC_LOAD,n,null),hWe=(n,e)=>B0(Xo.ATOMIC_STORE,n,e),fWe=(n,e)=>B0(Xo.ATOMIC_ADD,n,e),pWe=(n,e)=>B0(Xo.ATOMIC_SUB,n,e),mWe=(n,e)=>B0(Xo.ATOMIC_MAX,n,e),gWe=(n,e)=>B0(Xo.ATOMIC_MIN,n,e),AWe=(n,e)=>B0(Xo.ATOMIC_AND,n,e),xWe=(n,e)=>B0(Xo.ATOMIC_OR,n,e),vWe=(n,e)=>B0(Xo.ATOMIC_XOR,n,e);class In extends za{static get type(){return"SubgroupFunctionNode"}constructor(e,t=null,r=null){super(),this.method=e,this.aNode=t,this.bNode=r}getInputType(e){const t=this.aNode?this.aNode.getNodeType(e):null,r=this.bNode?this.bNode.getNodeType(e):null,i=e.isMatrix(t)?0:e.getTypeLength(t),s=e.isMatrix(r)?0:e.getTypeLength(r);return i>s?t:r}generateNodeType(e){const t=this.method;return t===In.SUBGROUP_ELECT?"bool":t===In.SUBGROUP_BALLOT?"uvec4":this.getInputType(e)}generate(e,t){const r=this.method,i=this.getNodeType(e),s=this.getInputType(e),a=this.aNode,o=this.bNode,l=[];if(r===In.SUBGROUP_BROADCAST||r===In.SUBGROUP_SHUFFLE||r===In.QUAD_BROADCAST){const d=o.getNodeType(e);l.push(a.build(e,i),o.build(e,d==="float"?"int":i))}else r===In.SUBGROUP_SHUFFLE_XOR||r===In.SUBGROUP_SHUFFLE_DOWN||r===In.SUBGROUP_SHUFFLE_UP?l.push(a.build(e,i),o.build(e,"uint")):(a!==null&&l.push(a.build(e,s)),o!==null&&l.push(o.build(e,s)));const u=l.length===0?"()":`( ${l.join(", ")} )`;return e.format(`${e.getMethod(r,i)}${u}`,i,t)}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}In.SUBGROUP_ELECT="subgroupElect";In.SUBGROUP_BALLOT="subgroupBallot";In.SUBGROUP_ADD="subgroupAdd";In.SUBGROUP_INCLUSIVE_ADD="subgroupInclusiveAdd";In.SUBGROUP_EXCLUSIVE_AND="subgroupExclusiveAdd";In.SUBGROUP_MUL="subgroupMul";In.SUBGROUP_INCLUSIVE_MUL="subgroupInclusiveMul";In.SUBGROUP_EXCLUSIVE_MUL="subgroupExclusiveMul";In.SUBGROUP_AND="subgroupAnd";In.SUBGROUP_OR="subgroupOr";In.SUBGROUP_XOR="subgroupXor";In.SUBGROUP_MIN="subgroupMin";In.SUBGROUP_MAX="subgroupMax";In.SUBGROUP_ALL="subgroupAll";In.SUBGROUP_ANY="subgroupAny";In.SUBGROUP_BROADCAST_FIRST="subgroupBroadcastFirst";In.QUAD_SWAP_X="quadSwapX";In.QUAD_SWAP_Y="quadSwapY";In.QUAD_SWAP_DIAGONAL="quadSwapDiagonal";In.SUBGROUP_BROADCAST="subgroupBroadcast";In.SUBGROUP_SHUFFLE="subgroupShuffle";In.SUBGROUP_SHUFFLE_XOR="subgroupShuffleXor";In.SUBGROUP_SHUFFLE_UP="subgroupShuffleUp";In.SUBGROUP_SHUFFLE_DOWN="subgroupShuffleDown";In.QUAD_BROADCAST="quadBroadcast";const yWe=mn(In,In.SUBGROUP_ELECT).setParameterLength(0),bWe=mn(In,In.SUBGROUP_BALLOT).setParameterLength(1),wWe=mn(In,In.SUBGROUP_ADD).setParameterLength(1),_We=mn(In,In.SUBGROUP_INCLUSIVE_ADD).setParameterLength(1),SWe=mn(In,In.SUBGROUP_EXCLUSIVE_AND).setParameterLength(1),TWe=mn(In,In.SUBGROUP_MUL).setParameterLength(1),EWe=mn(In,In.SUBGROUP_INCLUSIVE_MUL).setParameterLength(1),CWe=mn(In,In.SUBGROUP_EXCLUSIVE_MUL).setParameterLength(1),NWe=mn(In,In.SUBGROUP_AND).setParameterLength(1),MWe=mn(In,In.SUBGROUP_OR).setParameterLength(1),kWe=mn(In,In.SUBGROUP_XOR).setParameterLength(1),RWe=mn(In,In.SUBGROUP_MIN).setParameterLength(1),PWe=mn(In,In.SUBGROUP_MAX).setParameterLength(1),LWe=mn(In,In.SUBGROUP_ALL).setParameterLength(0),OWe=mn(In,In.SUBGROUP_ANY).setParameterLength(0),DWe=mn(In,In.SUBGROUP_BROADCAST_FIRST).setParameterLength(2),jWe=mn(In,In.QUAD_SWAP_X).setParameterLength(1),IWe=mn(In,In.QUAD_SWAP_Y).setParameterLength(1),FWe=mn(In,In.QUAD_SWAP_DIAGONAL).setParameterLength(1),UWe=mn(In,In.SUBGROUP_BROADCAST).setParameterLength(2),BWe=mn(In,In.SUBGROUP_SHUFFLE).setParameterLength(2),VWe=mn(In,In.SUBGROUP_SHUFFLE_XOR).setParameterLength(2),zWe=mn(In,In.SUBGROUP_SHUFFLE_UP).setParameterLength(2),GWe=mn(In,In.SUBGROUP_SHUFFLE_DOWN).setParameterLength(2),qWe=mn(In,In.QUAD_BROADCAST).setParameterLength(1);let nN;function LR(n){nN=nN||new WeakMap;let e=nN.get(n);return e===void 0&&nN.set(n,e={}),e}function OR(n){const e=LR(n);return e.shadowMatrix||(e.shadowMatrix=Qn("mat4").setGroup(lr).onRenderUpd
4315ate(t=>((n.castShadow!==!0||t.renderer.shadowMap.enabled===!1)&&(n.shadow.camera.coordinateSystem!==t.camera.coordinateSystem&&(n.shadow.camera.coordinateSystem=t.camera.coordinateSystem,n.shadow.camera.updateProjectionMatrix()),n.shadow.updateMatrices(n)),n.shadow.matrix)))}function K0e(n,e=_0){const t=OR(n).mul(e);return t.xyz.div(t.w)}function iq(n){const e=LR(n);return e.position||(e.position=Qn(new Ve).setGroup(lr).onRenderUpdate((t,r)=>r.value.setFromMatrixPosition(n.matrixWorld)))}function Z0e(n){const e=LR(n);return e.targetPosition||(e.targetPosition=Qn(new Ve).setGroup(lr).onRenderUpdate((t,r)=>r.value.setFromMatrixPosition(n.target.matrixWorld)))}function sq(n){const e=LR(n);return e.viewPosition||(e.viewPosition=Qn(new Ve).setGroup(lr).onRenderUpdate(({camera:t},r)=>{r.value=r.value||new Ve,r.value.setFromMatrixPosition(n.matrixWorld),r.value.applyMatrix4(t.matrixWorldInverse)}))}const aq=n=>Q1.transformDirection(iq(n).sub(Z0e(n))),$We=fg("vec3","totalDiffuse"),HWe=fg("vec3","totalSpecular"),WWe=fg("vec3","outgoingLight"),XWe=n=>n.sort((e,t)=>e.id-t.id),YWe=(n,e)=>{for(const t of e)if(t.isAnalyticLightNode&&t.light.id===n)return t;return null},LL=new WeakMap,q3=[];class oq extends cr{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=$We,this.totalSpecularNode=HWe,this.outgoingLightNode=WWe,this._lights=[],this.global=!0}customCacheKey(){const e=this._lights;for(let r=0;r<e.length;r++){const i=e[r];if(q3.push(i.id),q3.push(i.castShadow?1:0),i.isSpotLight===!0){const s=i.map!==null?i.map.id:-1,a=i.colorNode?i.colorNode.getCacheKey():-1;q3.push(s,a)}}const t=kT(q3);return q3.length=0,t}getHash(e){const t=e.getDataFromNode(this);if(t.lightNodesHash===void 0){const r=this.setupLightsNode(e);t.lightNodes=r;const i=[];for(const s of r)i.push(s.getHash());t.lightNodesHash="lights-"+i.join(",")}return t.lightNodesHash}analyze(e){const t=e.getNodeProperties(this);for(const r of t.nodes)r.build(e);t.outputNode.build(e)}setupLightsNode(e){const t=e.getDataFromNode(this),r=[],i=t.lightNodes||null,s=e.context.materialLightings,a=XWe([...s,...this._lights]),o=e.renderer.library;for(const l of a)if(l.isNode)r.push(l);else{let u=null;if(i!==null&&(u=YWe(l.id,i)),u===null){const d=o.getLightNodeClass(l.constructor);if(d===null){an(`LightsNode.setupNodeLights: Light node not found for ${l.constructor.name}`);continue}LL.has(l)===!1&&LL.set(l,new d(l)),u=LL.get(l)}r.push(u)}return r}setupDirectLight(e,t,r){const{lightingModel:i,reflectedLight:s}=e.context;i.direct({...r,lightNode:t,reflectedLight:s},e)}setupDirectRectAreaLight(e,t,r){const{lightingModel:i,reflectedLight:s}=e.context;i.directRectArea({...r,lightNode:t,reflectedLight:s},e)}setupLights(e,t){for(const r of t)r.build(e)}getLightNodes(e){const t=e.getDataFromNode(this);return t.lightNodes===void 0&&(t.lightNodes=this.setupLightsNode(e)),t.lightNodes}setup(e){const t=e.lightsNode;e.lightsNode=this;let r=this.outgoingLightNode;const i=e.context,s=i.lightingModel,a=e.getNodeProperties(this);if(s){const{totalDiffuseNode:o,totalSpecularNode:l}=this;i.outgoingLight=r;const u=e.addStack();a.nodes=u.nodes,s.start(e);const{backdrop:d,backdropAlpha:h}=i,{directDiffuse:f,directSpecular:p,indirectDiffuse:g,indirectSpecular:A}=i.reflectedLight;let x=f.add(g);d!==null&&(h!==null?x=ct(h.mix(x,d)):x=ct(d)),o.assign(x),l.assign(p.add(A)),r.assign(o.add(l)),s.finish(e),r=r.bypass(e.removeStack())}else a.nodes=[];return e.lightsNode=t,r}setLights(e){return this._lights=e,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}const QWe=(n=[])=>new oq().setLights(n);class KWe extends cr{static get type(){return"ShadowBaseNode"}constructor(e){super(),this.light=e,this.updateBeforeType=Tr.RENDER,this.isShadowBaseNode=!0}setupShadowPosition({context:e,material:t}){lq.assign(t.receivedShadowPositionNode||e.shadowPositionWorld||_0)}}const lq=fg("vec3","shadowPositionWorld");function ZWe(n,e={}){return e.toneMapping=n.toneMapping,e.toneMappingExposure=n.toneMappingExposure,e.outputColorSpace=n.outputColorSpace,e.renderTarget=n.getRenderTarget(),e.activeCubeFace=n.getActiveCubeFace(),e.activeMipmapLevel=n.getActiveMipmapLevel(),e.renderObjectFunction=n.getRenderObjectFunction(),e.pixelRatio=n.getPixelRatio(),e.mrt=n.getMRT(),e.clearColor=n.getClearColor(e.clearColor||new tr),e.clearAlpha=n.getClearAlpha(),e.autoClear=n.autoClear,e.scissorTest=n.getScissorTest(),e}function JWe(n,e){return e=ZWe(n,e),n.setMRT(null),n.setRenderObjectFunction(null),n.setClearColor(0,1),n.autoClear=!0,e}function eXe(n,e){n.toneMapping=e.toneMapping,n.toneMappingExposure=e.toneMappingExposure,n.outputColorSpace
vendor: 7,794 bytes, line 4315
4315=e.outputColorSpace,n.setRenderTarget(e.renderTarget,e.activeCubeFace,e.activeMipmapLevel),n.setRenderObjectFunction(e.renderObjectFunction),n.setPixelRatio(e.pixelRatio),n.setMRT(e.mrt),n.setClearColor(e.clearColor,e.clearAlpha),n.autoClear=e.autoClear,n.setScissorTest(e.scissorTest)}function tXe(n,e={}){return e.background=n.background,e.backgroundNode=n.backgroundNode,e.overrideMaterial=n.overrideMaterial,e}function nXe(n,e){return e=tXe(n,e),n.background=null,n.backgroundNode=null,n.overrideMaterial=null,e}function rXe(n,e){n.background=e.background,n.backgroundNode=e.backgroundNode,n.overrideMaterial=e.overrideMaterial}function iXe(n,e,t){return t=JWe(n,t),t=nXe(e,t),t}function sXe(n,e,t){eXe(n,t),rXe(e,t)}const Uk=new WeakMap,J0e=ut(({depthTexture:n,shadowCoord:e,depthLayer:t})=>{let r=Pi(n,e.xy).setName("t_basic");return n.isArrayTexture&&(r=r.depth(t)),r.compare(e.z)}),eme=ut(({depthTexture:n,shadowCoord:e,shadow:t,depthLayer:r})=>{const i=(d,h)=>{let f=Pi(n,d);return n.isArrayTexture&&(f=f.depth(r)),f.compare(h)},s=Ws("mapSize","vec2",t).setGroup(lr),a=Ws("radius","float",t).setGroup(lr),o=Cn(1).div(s),l=a.mul(o.x),u=JG(My.xy).mul(6.28318530718);return fo(i(e.xy.add(qf(0,5,u).mul(l)),e.z),i(e.xy.add(qf(1,5,u).mul(l)),e.z),i(e.xy.add(qf(2,5,u).mul(l)),e.z),i(e.xy.add(qf(3,5,u).mul(l)),e.z),i(e.xy.add(qf(4,5,u).mul(l)),e.z)).mul(1/5)}),tme=ut(({depthTexture:n,shadowCoord:e,shadow:t,depthLayer:r})=>{const i=Ws("mapSize","vec2",t).setGroup(lr),s=Cn(1).div(i),a=e.xy,o=rp(a.mul(i).add(.5)).toConst();a.subAssign(o.sub(.5).mul(s));const l=p=>{let g=Pi(n,a).offset(p).gather();return n.isArrayTexture&&(g=g.depth(r)),g.compare(e.z)},u=l(_a(-1,1)).toConst(),d=l(_a(1,1)).toConst(),h=l(_a(-1,-1)).toConst(),f=l(_a(1,-1)).toConst();return fo(ui(u.x,d.y,o.x).add(u.y).add(d.x).mul(o.y),ui(u.w,d.z,o.x).add(u.z).add(d.w),ui(h.x,f.y,o.x).add(h.y).add(f.x),ui(h.w,f.z,o.x).add(h.z).add(f.w).mul(o.y.oneMinus())).mul(1/9)}),nme=ut(({depthTexture:n,shadowCoord:e,depthLayer:t},r)=>{let i=Pi(n).sample(e.xy);n.isArrayTexture&&(i=i.depth(t)),i=i.rg;const s=i.x,a=Na(1e-7,i.y.mul(i.y)),o=r.renderer.reversedDepthBuffer?oy(s,e.z):oy(e.z,s),l=Ie(1).toVar();return nr(o.notEqual(1),()=>{const u=e.z.sub(s);let d=a.div(a.add(u.mul(u)));d=ip(Ei(d,.3).div(.65)),l.assign(Na(o,d))}),l}),rme=n=>{let e=Uk.get(n);return e===void 0&&(e=new Va,e.colorNode=Vn(0,0,0,1),e.isShadowPassMaterial=!0,e.name="ShadowMaterial",e.blending=qo,e.fog=!1,Uk.set(n,e)),e},ime=n=>{const e=Uk.get(n);e!==void 0&&(e.dispose(),Uk.delete(n))},RJ=new L1,k2=[],sme=(n,e,t,r)=>{k2[0]=n,k2[1]=e;let i=RJ.get(k2);return(i===void 0||i.shadowType!==t||i.useVelocity!==r)&&(i=(s,a,o,l,u,d,h,f,p)=>{(s.castShadow===!0||s.receiveShadow&&t===s0)&&(r&&($de(s).useVelocity=!0),s.onBeforeShadow(n,s,o,e.camera,l,a.overrideMaterial,d),n.renderObject(s,a,o,l,u,d,h,f,p),s.onAfterShadow(n,s,o,e.camera,l,a.overrideMaterial,d))},i.shadowType=t,i.useVelocity=r,RJ.set(k2,i)),k2[0]=null,k2[1]=null,i},aXe=ut(({samples:n,radius:e,size:t,shadowPass:r,depthLayer:i})=>{const s=Ie(0).toVar("meanVertical"),a=Ie(0).toVar("squareMeanVertical"),o=n.lessThanEqual(Ie(1)).select(Ie(0),Ie(2).div(n.sub(1))),l=n.lessThanEqual(Ie(1)).select(Ie(0),Ie(-1));ys({start:st(0),end:st(n),type:"int",condition:"<"},({i:d})=>{const h=l.add(Ie(d).mul(o));let f=r.sample(fo(My.xy,Cn(0,h).mul(e)).div(t));r.value.isArrayTexture&&(f=f.depth(i)),f=f.x,s.addAssign(f),a.addAssign(f.mul(f))}),s.divAssign(n),a.divAssign(n);const u=gu(a.sub(s.mul(s)).max(0));return Cn(s,u)}),oXe=ut(({samples:n,radius:e,size:t,shadowPass:r,depthLayer:i})=>{const s=Ie(0).toVar("meanHorizontal"),a=Ie(0).toVar("squareMeanHorizontal"),o=n.lessThanEqual(Ie(1)).select(Ie(0),Ie(2).div(n.sub(1))),l=n.lessThanEqual(Ie(1)).select(Ie(0),Ie(-1));ys({start:st(0),end:st(n),type:"int",condition:"<"},({i:d})=>{const h=l.add(Ie(d).mul(o));let f=r.sample(fo(My.xy,Cn(h,0).mul(e)).div(t));r.value.isArrayTexture&&(f=f.depth(i)),s.addAssign(f.x),a.addAssign(fo(f.y.mul(f.y),f.x.mul(f.x)))}),s.divAssign(n),a.divAssign(n);const u=gu(a.sub(s.mul(s)).max(0));return Cn(s,u)}),lXe=[J0e,eme,tme,nme];let OL;const rN=new ZG;class ame extends KWe{static get type(){return"ShadowNode"}constructor(e,t=null){super(e),this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this._node=null,this._currentShadowType=null,this._cameraFrameId=new WeakMap,this.isShadowNode=!0,this.depthLayer=0}setupShadowFilter(e,{filterFn:t,depthTexture:r,shadowCoord:i,shadow:s,depthLayer:a}){const o=i.x.greaterThanEqual(0).and(i.x.lessThanEqual(1)).and(i.y.greaterThanEqual(0)).and(i.y.lessThanEqual(1)).and(i.z.lessThanEqual(1)),l=t({depthTexture:r,shadowCoord:i,shadow:s,depthLayer:a});return o.select(l,Ie(1))}setupShadowCoord(e,t){const{shadow:r}=this,{renderer:i}=e,s=r.biasNode||Ws("bias","float",r).setGroup(lr);let a=t,o;if(r.camera.isOrthographicCamera||i.logarithmicDepthBuffer!==!0)a=a.xyz.div(a.w),o=a.z;else{const l=a.w;a=a.xy.div(l);const u=Ws("near","float",r.camera).setGroup(lr),d=Ws("far","float",r.camera).setGroup(lr);o=CR(l.negate(),u,d)}return a=ct(a.x,a.y.oneMinus(),i.reversedDepthBuffer?o.sub(s):o.add(s)),a}getShadowFilterFn(e){return lXe[e]}setupRenderTarget(e,t){const r=new Bl(e.mapSize.width,e.mapSize.height);r.name="ShadowDepthTexture",r.compareFunction=t.renderer.reversedDepthBuffer?eg:$1;const i=t.createRenderTarget(e.mapSize.width,e.mapSize.height);return i.texture.name="ShadowMap",i.texture.type=e.mapType,i.depthTexture=r,{shadowMap:i,depthTexture:r}}setupShadow(e){const{renderer:t,camera:r}=e,{light:i,shadow:s}=this,{depthTexture:a,shadowMap:o}=this.setupRenderTarget(s,e),l=t.shadowMap.type,u=t.hasCompatibility(_y.TEXTURE_COMPARE);if((l===Nb||l===Dce)&&u?(a.minFilter=bs,a.magFilter=bs):(a.minFilter=cs,a.magFilter=cs),s.camera.coordinateSystem=r.coordinateSystem,s.camera.updateProjectionMatrix(),l===s0&&s.isPointLightShadow!==!0){a.compareFunction=null,o.depth>1?(o._vsmShadowMapVertical||(o._vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:fl,type:Js,depth:o.depth,depthBuffer:!1}),o._vsmShadowMapVertical.texture.name="VSMVertical"),this.vsmShadowMapVertical=o._vsmShadowMapVertical,o._vsmShadowMapHorizontal||(o._vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:fl,type:Js,depth:o.depth,depthBuffer:!1}),o._vsmShadowMapHorizontal.texture.name="VSMHorizontal"),this.vsmShadowMapHorizontal=o._vsmShadowMapHorizontal):(this.vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:fl,type:Js,depthBuffer:!1}),this.vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:fl,type:Js,depthBuffer:!1}));let D=Pi(a);a.isArrayTexture&&(D=D.depth(this.depthLayer));let P=Pi(this.vsmShadowMapVertical.texture);a.isArrayTexture&&(P=P.depth(this.depthLayer));const O=Ws("blurSamples","float",s).setGroup(lr),F=Ws("radius","float",s).setGroup(lr),U=Ws("mapSize","vec2",s).setGroup(lr);let B=this.vsmMaterialVertical||(this.vsmMaterialVertical=new Va);B.fragmentNode=aXe({samples:O,radius:F,size:U,shadowPass:D,depthLayer:this.depthLayer}).context(e.getSharedContext()),B.name="VSMVertical",B=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new Va),B.fragmentNode=oXe({samples:O,radius:F,size:U,shadowPass:P,depthLayer:this.depthLayer}).context(e.getSharedContext()),B.name="VSMHorizontal"}const d=Ws("intensity","float",s).setGroup(lr),h=Ws("normalBias","float",s).setGroup(lr),f=OR(i),p=K1.mul(h);let g;!t.highPrecision||e.material.receivedShadowPositionNode||e.context.shadowPositionWorld?g=f.mul(lq.add(p)):g=Qn("mat4").onObjectUpdate(({object:P},O)=>O.value.multiplyMatrices(f.value,P.matrixWorld)).mul(pa).add(f.mul(Vn(p,0)));
4315const A=this.setupShadowCoord(e,g),x=s.filterNode||this.getShadowFilterFn(t.shadowMap.type)||null;if(x===null)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const b=l===s0&&s.isPointLightShadow!==!0?this.vsmShadowMapHorizontal.texture:a,_=this.setupShadowFilter(e,{filterFn:x,shadowTexture:o.texture,depthTexture:b,shadowCoord:A,shadow:s,depthLayer:this.depthLayer});let M;t.shadowMap.transmitted===!0&&(o.texture.isCubeTexture?M=du(o.texture,A.xyz):(M=Pi(o.texture,A),a.isArrayTexture&&(M=M.depth(this.depthLayer))));let T;M?T=ui(1,_.rgb.mix(M,1),d.mul(M.a)).toVar():T=ui(1,_,d).toVar(),this.shadowMap=o,this.shadow.map=o;const L=`${this.light.type} Shadow [ ${this.light.name||"ID: "+this.light.id} ]`;return M&&T.toInspector(`${L} / Color`,()=>this.shadowMap.texture.isCubeTexture?du(this.shadowMap.texture,KF()):Pi(this.shadowMap.texture)),T.toInspector(`${L} / Depth`,()=>{const D=Ws("near","float",this.shadow.camera),P=Ws("far","float",this.shadow.camera);let O;this.shadowMap.texture.isCubeTexture?O=du(this.shadowMap.depthTexture,KF()).r:O=Pi(this.shadowMap.depthTexture).r;let F;return this.shadow.camera.isPerspectiveCamera?F=ER(O,D,P):F=Xpe(O,D,P),F=Vv(F,D,P),F.oneMinus()})}setup(e){if(e.renderer.shadowMap.enabled!==!1)return ut(()=>{const t=e.renderer.shadowMap.type;this._currentShadowType!==t&&(this._reset(),this._node=null);let r=this._node;return this.setupShadowPosition(e),r===null&&(this._node=r=this.setupShadow(e),this._currentShadowType=t),e.material.receivedShadowNode&&(r=e.material.receivedShadowNode(r)),r})()}renderShadow(e){const{shadow:t,shadowMap:r,light:i}=this,{renderer:s,scene:a}=e;t.updateMatrices(i),r.setSize(t.mapSize.width,t.mapSize.height,r.depth);const o=a.name;a.name=`Shadow Map [ ${i.name||"ID: "+i.id} ]`,s.render(a,t.camera),a.name=o}updateShadow(e){const{shadowMap:t,light:r,shadow:i}=this,{renderer:s,scene:a,camera:o}=e,l=s.shadowMap.type,u=t.depthTexture.version;this._depthVersionCached=u;const d=i.camera.layers.mask;(i.camera.layers.mask&4294967294)===0&&(i.camera.layers.mask=o.layers.mask);const h=s.getRenderObjectFunction(),f=s.getMRT(),p=f?f.has("velocity"):!1;OL=iXe(s,a,OL),a.overrideMaterial=rme(r),s.setRenderObjectFunction(sme(s,i,l,p)),s.setClearColor(0,0),s.setRenderTarget(t),this.renderShadow(e),s.setRenderObjectFunction(h),l===s0&&i.isPointLightShadow!==!0&&this.vsmPass(s),i.camera.layers.mask=d,sXe(s,a,OL)}vsmPass(e){const{shadow:t}=this,r=this.shadowMap.depth;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height,r),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height,r),e.setRenderTarget(this.vsmShadowMapVertical),rN.material=this.vsmMaterialVertical,rN.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),rN.material=this.vsmMaterialHorizontal,rN.render(e)}dispose(){this._reset(),super.dispose()}_reset(){this._currentShadowType=null,ime(this.light),this.shadowMap&&(this.shadowMap.dispose(),this.shadowMap=null),this.vsmShadowMapVertical!==null&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),this.vsmShadowMapHorizontal!==null&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null)}updateBefore(e){const{shadow:t}=this;let r=t.needsUpdate||t.autoUpdate;r&&(this._cameraFrameId[e.camera]===e.frameId&&(r=!1),this._cameraFrameId[e.camera]=e.frameId),r&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}const ome=(n,e)=>new ame(n,e),cXe=new tr,PJ=new kr,$3=new Ve,DL=new Ve,uXe=[new Ve(1,0,0),new Ve(-1,0,0),new Ve(0,-1,0),new Ve(0,1,0),new Ve(0,0,1),new Ve(0,0,-1)],dXe=[new Ve(0,-1,0),new Ve(0,-1,0),new Ve(0,0,-1),new Ve(0,0,1),new Ve(0,-1,0),new Ve(0,-1,0)],hXe=[new Ve(1,0,0),new Ve(-1,0,0),new Ve(0,1,0),new Ve(0,-1,0),new Ve(0,0,1),new Ve(0,0,-1)],fXe=[new Ve(0,-1,0),new Ve(0,-1,0),new Ve(0,0,1),new Ve(0,0,-1),new Ve(0,-1,0),new Ve(0,-1,0)],lme=ut(({depthTexture:n,bd3D:e,dp:t})=>du(n,e).compare(t)),cme=ut(({depthTexture:n,bd3D:e,dp:t,shadow:r})=>{const i=Ws("radius","float",r).setGroup(lr),s=Ws("mapSize","vec2",r).setGroup(lr),a=i.div(s.x),o=zs(e),l=_c(ag(e,o.x.greaterThan(o.z).select(ct(0,1,0),ct(1,0,0)))),u=ag(e,l),d=JG(My.xy).mul(6.28318530718),h=qf(0,5,d),f=qf(1,5,d),p=qf(2,5,d),g=qf(3,5,d),A=qf(4,5,d);return du(n,e.add(l.mul(h.x).add(u.mul(h.y)).mul(a))).compare(t).add(du(n,e.add(l.mul(f.x).add(u.mul(f.y)).mul(a))).compare(t)).add(du(n,e.add(l.mul(p.x).add(u.mul(p.y)).mul(a))).compare(t)).add(du(n,e.add(l.mul(g.x).add(u.mul(g.y)).mul(a))).compare(t)).add(du(n,e.add(l.mul(A.x).add(u.mul(A.y)).mul(a))).compare(t)).mul(1/5)}),pXe=ut(({filterFn:n,depthTexture:e,shadowCoord:t,shadow:r},i)=>{const s=t.xyz.toConst(),a=s.abs().toConst(),o=a.x.max(a.y).max(a.z),l=Qn("float").setGroup(lr).onRenderUpd
vendor: 23,082 bytes, line 4315
4315ate(()=>r.camera.near),u=Qn("float").setGroup(lr).onRenderUpdate(()=>r.camera.far),d=Ws("bias","float",r).setGroup(lr),h=Ie(1).toVar();return nr(o.sub(u).lessThanEqual(0).and(o.sub(l).greaterThanEqual(0)),()=>{let f;i.renderer.reversedDepthBuffer?(f=Ype(o.negate(),l,u),f.subAssign(d)):i.renderer.logarithmicDepthBuffer?(f=CR(o.negate(),l,u),f.addAssign(d)):(f=BG(o.negate(),l,u),f.addAssign(d));const p=s.normalize();h.assign(n({depthTexture:e,bd3D:p,dp:f,shadow:r}))}),h});class mXe extends ame{static get type(){return"PointShadowNode"}constructor(e,t=null){super(e,t)}getShadowFilterFn(e){return e===aMe?lme:cme}setupShadowCoord(e,t){return t}setupShadowFilter(e,{filterFn:t,depthTexture:r,shadowCoord:i,shadow:s}){return pXe({filterFn:t,depthTexture:r,shadowCoord:i,shadow:s})}setupRenderTarget(e,t){const r=new Yce(e.mapSize.width);r.name="PointShadowDepthTexture",r.compareFunction=t.renderer.reversedDepthBuffer?eg:$1;const i=t.createCubeRenderTarget(e.mapSize.width);return i.texture.name="PointShadowMap",i.depthTexture=r,{shadowMap:i,depthTexture:r}}renderShadow(e){const{shadow:t,shadowMap:r,light:i}=this,{renderer:s,scene:a}=e,o=t.camera,l=t.matrix,u=s.coordinateSystem===qh,d=u?uXe:hXe,h=u?dXe:fXe;r.setSize(t.mapSize.width,t.mapSize.width);const f=s.autoClear,p=s.getClearColor(cXe),g=s.getClearAlpha();s.autoClear=!1,s.setClearColor(t.clearColor,t.clearAlpha);for(let A=0;A<6;A++){s.setRenderTarget(r,A),s.clear();const x=i.distance||o.far;x!==o.far&&(o.far=x,o.updateProjectionMatrix()),$3.setFromMatrixPosition(i.matrixWorld),o.position.copy($3),DL.copy(o.position),DL.add(d[A]),o.up.copy(h[A]),o.lookAt(DL),o.updateMatrixWorld(),l.makeTranslation(-$3.x,-$3.y,-$3.z),PJ.multiplyMatrices(o.projectionMatrix,o.matrixWorldInverse),t._frustum.setFromProjectionMatrix(PJ,o.coordinateSystem,o.reversedDepth);const b=a.name;a.name=`Point Light Shadow [ ${i.name||"ID: "+i.id} ] - Face ${A+1}`,s.render(a,o),a.name=b}s.autoClear=f,s.setClearColor(p,g)}}const ume=(n,e)=>new mXe(n,e);class Ry extends M_{static get type(){return"AnalyticLightNode"}constructor(e=null){super(),this.light=e,this.color=new tr,this.colorNode=e&&e.colorNode||Qn(this.color).setGroup(lr),this.baseColorNode=null,this.shadowNode=null,this.shadowColorNode=null,this.isAnalyticLightNode=!0,this.updateType=Tr.FRAME,e&&e.shadow&&(this._shadowDisposeListener=()=>{this.disposeShadow()},e.addEventListener("dispose",this._shadowDisposeListener))}dispose(){this._shadowDisposeListener&&this.light.removeEventListener("dispose",this._shadowDisposeListener),super.dispose()}disposeShadow(){this.shadowNode!==null&&(this.shadowNode.dispose(),this.shadowNode=null),this.shadowColorNode=null,this.baseColorNode!==null&&(this.colorNode=this.baseColorNode,this.baseColorNode=null)}getHash(){return this.light.uuid}getLightVector(e){return sq(this.light).sub(e.context.positionView||Ja)}setupDirect(){}setupDirectRectArea(){}setupShadowNode(){return ome(this.light)}setupShadow(e){const{renderer:t}=e;if(t.shadowMap.enabled===!1)return;let r=this.shadowColorNode;if(r===null){const i=this.light.shadow.shadowNode;let s;i!==void 0?s=Hn(i):s=this.setupShadowNode(),this.shadowNode=s,this.shadowColorNode=r=this.colorNode.mul(s),this.baseColorNode=this.colorNode}e.context.getShadow&&(r=e.context.getShadow(this,e)),this.colorNode=r}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):this.shadowNode!==null&&(this.shadowNode.dispose(),this.shadowNode=null,this.shadowColorNode=null);const t=this.setupDirect(e),r=this.setupDirectRectArea(e);t&&e.lightsNode.setupDirectLight(e,this,t),r&&e.lightsNode.setupDirectRectAreaLight(e,this,r)}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const cq=ut(({lightDistance:n,cutoffDistance:e,decayExponent:t})=>{const r=n.pow(t).max(.01).reciprocal();return e.greaterThan(0).select(r.mul(n.div(e).pow4().oneMinus().clamp().pow2()),r)}),dme=({color:n,lightVector:e,cutoffDistance:t,decayExponent:r})=>{const i=e.normalize(),s=e.length(),a=cq({lightDistance:s,cutoffDistance:t,decayExponent:r}),o=n.mul(a);return{lightDirection:i,lightColor:o}};class gXe extends Ry{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=Qn(0).setGroup(lr),this.decayExponentNode=Qn(2).setGroup(lr)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setupShadowNode(){return ume(this.light)}setupDirect(e){return dme({color:this.colorNode,lightVector:this.getLightVector(e),cutoffDistance:this.cutoffDistanceNode,decayExponent:this.decayExponentNode})}}const AXe=ut(([n=ws()])=>{const e=n.mul(2),t=e.x.floor(),r=e.y.floor();return t.add(r).mod(2).sign()}),xXe=ut(([n=ws()],{renderer:e,material:t})=>{const r=rG(n.mul(2).sub(1));let i;if(t.alphaToCoverage&&e.currentSamples>0){const s=Ie(r.fwidth()).toVar();i=rh(s.oneMinus(),s.add(1),r).oneMinus()}else i=yc(r.greaterThan(1),0,1);return i}),S4=ut(([n,e,t])=>{const r=Ie(t).toVar(),i=Ie(e).toVar(),s=th(n).toVar();return yc(s,i,r).uniformFlow()}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),Bk=ut(([n,e])=>{const t=th(e).toVar(),r=Ie(n).toVar();return yc(t,r.negate(),r).uniformFlow()}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),uo=ut(([n])=>{const e=Ie(n).toVar();return st(b0(e))}).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),Aa=ut(([n,e])=>{const t=Ie(n).toVar();return e.assign(uo(t)),t.sub(Ie(e))}),vXe=ut(([n,e,t,r,i,s])=>{const a=Ie(s).toVar(),o=Ie(i).toVar(),l=Ie(r).toVar(),u=Ie(t).toVar(),d=Ie(e).toVar(),h=Ie(n).toVar(),f=Ie(Ei(1,o)).toVar();return Ei(1,a).mul(h.mul(f).add(d.mul(o))).add(a.mul(u.mul(f).add(l.mul(o))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),yXe=ut(([n,e,t,r,i,s])=>{const a=Ie(s).toVar(),o=Ie(i).toVar(),l=ct(r).toVar(),u=ct(t).toVar(),d=ct(e).toVar(),h=ct(n).toVar(),f=Ie(Ei(1,o)).toVar();return Ei(1,a).mul(h.mul(f).add(d.mul(o))).add(a.mul(u.mul(f).add(l.mul(o))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),hme=Gl([vXe,yXe]),bXe=ut(([n,e,t,r,i,s,a,o,l,u,d])=>{const h=Ie(d).toVar(),f=Ie(u).toVar(),p=Ie(l).toVar(),g=Ie(o).toVar(),A=Ie(a).toVar(),x=Ie(s).toVar(),b=Ie(i).toVar(),_=Ie(r).toVar(),M=Ie(t).toVar(),T=Ie(e).toVar(),L=Ie(n).toVar(),D=Ie(Ei(1,p)).toVar(),P=Ie(Ei(1,f)).toVar();return Ie(Ei(1,h)).toVar().mul(P.mul(L.mul(D).add(T.mul(p))).add(f.mul(M.mul(D).add(_.mul(p))))).add(h.mul(P.mul(b.mul(D).add(x.mul(p))).add(f.mul(A.mul(D).add(g.mul(p))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),wXe=ut(([n,e,t,r,i,s,a,o,l,u,d])=>{const h=Ie(d).toVar(),f=Ie(u).toVar(),p=Ie(l).toVar(),g=ct(o).toVar(),A=ct(a).toVar(),x=ct(s).toVar(),b=ct(i).toVar(),_=ct(r).toVar(),M=ct(t).toVar(),T=ct(e).toVar(),L=ct(n).toVar(),D=Ie(Ei(1,p)).toVar(),P=Ie(Ei(1,f)).toVar();return Ie(Ei(1,h)).toVar().mul(P.mul(L.mul(D).add(T.mul(p))).add(f.mul(M.mul(D).add(_.mul(p))))).add(h.mul(P.mul(b.mul(D).add(x.mul(p))).add(f.mul(A.mul(D).add(g.mul(p))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),fme=Gl([bXe,wXe]),_Xe=ut(([n,e,t])=>{const r=Ie(t).toVar(),i=Ie(e).toVar(),s=un(n).toVar(),a=un(s.bitAnd(un(7))).toVar(),o=Ie(S4(a.lessThan(un(4)),i,r)).toVar(),l=Ie(Pr(2,S4(a.lessThan(un(4)),r,i))).toVar();return Bk(o,th(a.bitAnd(un(1)))).add(Bk(l,th(a.bitAnd(un(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),SXe=ut(([n,e,t,r])=>{const i=Ie(r).toVar(),s=Ie(t).toVar(),a=Ie(e).toVar(),o=un(n).toVar(),l=un(o.bitAnd(un(15))).toVar(),u=Ie(S4(l.lessThan(un(8)),a,s)).toVar(),d=Ie(S4(l.lessThan(un(4)),s,S4(l.equal(un(12)).or(l.equal(un(14))),a,i))).toVar();return Bk(u,th(l.bitAnd(un(1)))).add(Bk(d,th(l.bitAnd(un(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),ll=Gl([_Xe,SXe]),TXe=ut(([n,e,t])=>{const r=Ie(t).toVar(),i=Ie(e).toVar(),s=Cy(n).toVar();return ct(ll(s.x,i,r),ll(s.y,i,r),ll(s.z,i,r))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),EXe=ut(([n,e,t,r])=>{const i=Ie(r).toVar(),s=Ie(t).toVar(),a=Ie(e).toVar(),o=Cy(n).toVar();return ct(ll(o.x,a,s,i),ll(o.y,a,s,i),ll(o.z,a,s,i))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),Mh=Gl([TXe,EXe]),CXe=ut(([n])=>{const e=Ie(n).toVar();return Pr(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),NXe=ut(([n])=>{const e=Ie(n).toVar();return Pr(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),MXe=ut(([n])=>{const e=ct(n).toVar();return Pr(.6616,e)}).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),pme=Gl([CXe,MXe]),kXe=ut(([n])=>{const e=ct(n).toVar();return Pr(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),mme=Gl([NXe,kXe]),Id=ut(([n,e])=>{const t=st(e).toVar(),r=un(n).toVar();return r.shiftLeft(t).bitOr(r.shiftRight(st(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),gme=ut(([n,e,t])=>{n.subAssign(t),n.bitXorAssign(Id(t,st(4))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(Id(n,st(6))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(Id(e,st(8))),e.addAssign(n),n.subAssign(t),n.bitXorAssign(Id(t,st(16))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(Id(n,st(19))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(Id(e,st(4))),e.addAssign(n)}),IT=ut(([n,e,t])=>{const r=un(t).toVar(),i=un(e).toVar(),s=un(n).toVar();return r.bitXorAssign(i),r.subAssign(Id(i,st(14))),s.bitXorAssign(r),s.subAssign(Id(r,st(11))),i.bitXorAssign(s),i.subAssign(Id(s,st(25))),r.bitXorAssign(i),r.subAssign(Id(i,st(16))),s.bitXorAssign(r),s.subAssign(Id(r,st(4))),i.bitXorAssign(s),i.subAssign(Id(s,st(14))),r.bitXorAssign(i),r.subAssign(Id(i,st(24))),r}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),Sc=ut(([n])=>{const e=un(n).toVar();return Ie(e).div(Ie(un(st(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),S0=ut(([n])=>{const e=Ie(n).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),RXe=ut(([n])=>{const e=st(n).toVar(),t=un(un(1)).toVar(),r=un(un(st(3735928559)).add(t.shiftLeft(un(2))).add(un(13))).toVar();return IT(r.add(un(e)),r,r)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),PXe=ut(([n,e])=>{const t=st(e).toVar(),r=st(n).toVar(),i=un(un(2)).toVar(),s=un().toVar(),a=un().toVar(),o=un().toVar();return s.assign(a.assign(o.assign(un(st(3735928559)).add(i.shiftLeft(un(2))).add(un(13))))),s.addAssign(un(r)),a.addAssign(un(t)),IT(s,a,o)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),LXe=ut(([n,e,t])=>{const r=st(t).toVar(),i=st(e).toVar(),s=st(n).toVar(),a=un(un(3)).toVar(),o=un().toVar(),l=un().toVar(),u=un().toVar();return o.assign(l.assign(u.assign(un(st(3735928559)).add(a.shiftLeft(un(2))).add(un(13))))),o.addAssign(un(s)),l.addAssign(un(i)),u.addAssign(un(r)),IT(o,l,u)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),OXe=ut(([n,e,t,r])=>{const i=st(r).toVar(),s=st(t).toVar(),a=st(e).toVar(),o=st(n).toVar(),l=un(un(4)).toVar(),u=un().toVar(),d=un().toVar(),h=un().toVar();return u.assign(d.assign(h.assign(un(st(3735928559)).add(l.shiftLeft(un(2))).add(un(13))))),u.addAssign(un(o)),d.addAssign(un(a)),h.addAssign(un(s)),gme(u,d,h),u.addAssign(un(i)),IT(u,d,h)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),DXe=ut(([n,e,t,r,i])=>{const s=st(i).toVar(),a=st(r).toVar(),o=st(t).toVar(),l=st(e).toVar(),u=st(n).toVar(),d=un(un(5)).toVar(),h=un().toVar(),f=un().toVar(),p=un().toVar();return h.assign(f.assign(p.assign(un(st(3735928559)).add(d.shiftLeft(un(2))).add(un(13))))),h.addAssign(un(u)),f.addAssign(un(l)),p.addAssign(un(o)),gme(h,f,p),h.addAssign(un(a)),f.addAssign(un(s)),IT(h,f,p)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),Ms=Gl([RXe,PXe,LXe,OXe,DXe]),jXe=ut(([n,e])=>{const t=st(e).toVar(),r=st(n).toVar(),i=un(Ms(r,t)).toVar(),s=Cy().toVar();return s.x.assign(i.bitAnd(st(255))),s.y.assign(i.shiftRight(st(8)).bitAnd(st(255))),s.z.assign(i.shiftRight(st(16)).bitAnd(st(255))),s}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),IXe=ut(([n,e,t])=>{const r=st(t).toVar(),i=st(e).toVar(),s=st(n).toVar(),a=un(Ms(s,i,r)).toVar(),o=Cy().toVar();return o.x.assign(a.bitAnd(st(255))),o.y.assign(a.shiftRight(st(8)).bitAnd(st(255))),o.z.assign(a.shiftRight(st(16)).bitAnd(st(255))),o}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),kh=Gl([jXe,IXe]),FXe=ut(([n])=>{const e=Cn(n).toVar(),t=st().toVar(),r=st().toVar(),i=Ie(Aa(e.x,t)).toVar(),s=Ie(Aa(e.y,r)).toVar(),a=Ie(S0(i)).toVar(),o=Ie(S0(s)).toVar(),l=Ie(hme(ll(Ms(t,r),i,s),ll(Ms(t.add(st(1)),r),i.sub(1),s),ll(Ms(t,r.add(st(1))),i,s.sub(1)),ll(Ms(t.add(st(1)),r.add(st(1))),i.sub(1),s.sub(1)),a,o)).toVar();return pme(l)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),UXe=ut(([n])=>{const e=ct(n).toVar(),t=st().toVar(),r=st().toVar(),i=st().toVar(),s=Ie(Aa(e.x,t)).toVar(),a=Ie(Aa(e.y,r)).toVar(),o=Ie(Aa(e.z,i)).toVar(),l=Ie(S0(s)).toVar(),u=Ie(S0(a)).toVar(),d=Ie(S0(o)).toVar(),h=Ie(fme(ll(Ms(t,r,i),s,a,o),ll(Ms(t.add(st(1)),r,i),s.sub(1),a,o),ll(Ms(t,r.add(st(1)),i),s,a.sub(1),o),ll(Ms(t.add(st(1)),r.add(st(1)),i),s.sub(1),a.sub(1),o),ll(Ms(t,r,i.add(st(1))),s,a,o.sub(1)),ll(Ms(t.add(st(1)),r,i.add(st(1))),s.sub(1),a,o.sub(1)),ll(Ms(t,r.add(st(1)),i.add(st(1))),s,a.sub(1),o.sub(1)),ll(Ms(t.add(st(1)),r.add(st(1)),i.add(st(1))),s.sub(1),a.sub(1),o.sub(1)),l,u,d)).toVar();return mme(h)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),uq=Gl([FXe,UXe]),BXe=ut(([n])=>{const e=Cn(n).toVar(),t=st().toVar(),r=st().toVar(),i=Ie(Aa(e.x,t)).toVar(),s=Ie(Aa(e.y,r)).toVar(),a=Ie(S0(i)).toVar(),o=Ie(S0(s)).toVar(),l=ct(hme(Mh(kh(t,r),i,s),Mh(kh(t.add(st(1)),r),i.sub(1),s),Mh(kh(t,r.add(st(1))),i,s.sub(1)),Mh(kh(t.add(st(1)),r.add(st(1))),i.sub(1),s.sub(1)),a,o)).toVar();return pme(l)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),VXe=ut(([n])=>{const e=ct(n).toVar(),t=st().toVar(),r=st().toVar(),i=st().toVar(),s=Ie(Aa(e.x,t)).toVar(),a=Ie(Aa(e.y,r)).toVar(),o=Ie(Aa(e.z,i)).toVar(),l=Ie(S0(s)).toVar(),u=Ie(S0(a)).toVar(),d=Ie(S0(o)).toVar(),h=ct(fme(Mh(kh(t,r,i),s,a,o),Mh(kh(t.add(st(1)),r,i),s.sub(1),a,o),Mh(kh(t,r.add(st(1)),i),s,a.sub(1),o),Mh(kh(t.add(st(1)),r.add(st(1)),i),s.sub(1),a.sub(1),o),Mh(kh(t,r,i.add(st(1))),s,a,o.sub(1)),Mh(kh(t.add(st(1)),r,i.add(st(1))),s.sub(1),a,o.sub(1)),Mh(kh(t,r.add(st(1)),i.add(st(1))),s,a.sub(1),o.sub(1)),Mh(kh(t.add(st(1)),r.add(st(1)),i.add(st(1))),s.sub(1),a.sub(1),o.sub(1)),l,u,d)).toVar();return mme(h)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),FT=Gl([BXe,VXe]),zXe=ut(([n])=>{const e=Ie(n).toVar(),t=st(uo(e)).toVar();return Sc(Ms(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),GXe=ut(([n])=>{const e=Cn(n).toVar(),t=st(uo(e.x)).toVar(),r=st(uo(e.y)).toVar();return Sc(Ms(t,r))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),qXe=ut(([n])=>{const e=ct(n).toVar(),t=st(uo(e.x)).toVar(),r=st(uo(e.y)).toVar(),i=st(uo(e.z)).toVar();return Sc(Ms(t,r,i))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),$Xe=ut(([n])=>{const e=Vn(n).toVar(),t=st(uo(e.x)).toVar(),r=st(uo(e.y)).toVar(),i=st(uo(e.z)).toVar(),s=st(uo(e.w)).toVar();return Sc(Ms(t,r,i,s))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),HXe=Gl([zXe,GXe,qXe,$Xe]),WXe=ut(([n])=>{const e=Ie(n).toVar(),t=st(uo(e)).toVar();return ct(Sc(Ms(t,st(0))),Sc(Ms(t,st(1))),Sc(Ms(t,st(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),XXe=ut(([n])=>{const e=Cn(n).toVar(),t=st(uo(e.x)).toVar(),r=st(uo(e.y)).toVar();return ct(Sc(Ms(t,r,st(0))),Sc(Ms(t,r,st(1))),Sc(Ms(t,r,st(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),YXe=ut(([n])=>{const e=ct(n).toVar(),t=st(uo(e.x)).toVar(),r=st(uo(e.y)).toVar(),i=st(uo(e.z)).toVar();return ct(Sc(Ms(t,r,i,st(0))),Sc(Ms(t,r,i,st(1))),Sc(Ms(t,r,i,st(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),QXe=ut(([n])=>{const e=Vn(n).toVar(),t=st(uo(e.x)).toVar(),r=st(uo(e.y)).toVar(),i=st(uo(e.z)).toVar(),s=st(uo(e.w)).toVar();return ct(Sc(Ms(t,r,i,s,st(0))),Sc(Ms(t,r,i,s,st(1))),Sc(Ms(t,r,i,s,st(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),DR=Gl([WXe,XXe,YXe,QXe]),Vk=ut(([n,e,t,r])=>{const i=Ie(r).toVar(),s=Ie(t).toVar(),a=st(e).toVar(),o=ct(n).toVar(),l=Ie(0).toVar(),u=Ie(1).toVar();return ys(a,()=>{l.addAssign(u.mul(uq(o))),u.mulAssign(i),o.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),jR=ut(([n,e,t,r])=>{const i=Ie(r).toVar(),s=Ie(t).toVar(),a=st(e).toVar(),o=ct(n).toVar(),l=ct(0).toVar(),u=Ie(1).toVar();return ys(a,()=>{l.addAssign(u.mul(FT(o))),u.mulAssign(i),o.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),KXe=ut(([n,e,t,r])=>{const i=Ie(r).toVar(),s=Ie(t).toVar(),a=st(e).toVar(),o=ct(n).toVar();return Cn(Vk(o,a,s,i),Vk(o.add(ct(st(19),st(193),st(17))),a,s,i))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),ZXe=ut(([n,e,t,r])=>{const i=Ie(r).toVar(),s=Ie(t).toVar(),a=st(e).toVar(),o=ct(n).toVar(),l=ct(jR(o,a,s,i)).toVar(),u=Ie(Vk(o.add(ct(st(19),st(193),st(17))),a,s,i)).toVar();return Vn(l,u)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),JXe=ut(([n,e,t,r,i,s,a])=>{const o=st(a).toVar(),l=Ie(s).toVar(),u=st(i).toVar(),d=st(r).toVar(),h=st(t).toVar(),f=st(e).toVar(),p=Cn(n).toVar(),g=ct(DR(Cn(f.add(d),h.add(u)))).toVar(),A=Cn(g.x,g.y).toVar();A.subAssign(.5),A.mulAssign(l),A.addAssign(.5);const x=Cn(Cn(Ie(f),Ie(h)).add(A)).toVar(),b=Cn(x.sub(p)).toVar();return nr(o.equal(st(2)),()=>zs(b.x).add(zs(b.y))),nr(o.equal(st(3)),()=>Na(zs(b.x),zs(b.y))),Wh(b,b)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),eYe=ut(([n,e,t,r,i,s,a,o,l])=>{const u=st(l).toVar(),d=Ie(o).toVar(),h=st(a).toVar(),f=st(s).toVar(),p=st(i).toVar(),g=st(r).toVar(),A=st(t).toVar(),x=st(e).toVar(),b=ct(n).toVar(),_=ct(DR(ct(x.add(p),A.add(f),g.add(h)))).toVar();_.subAssign(.5),_.mulAssign(d),_.addAssign(.5);const M=ct(ct(Ie(x),Ie(A),Ie(g)).add(_)).toVar(),T=ct(M.sub(b)).toVar();return nr(u.equal(st(2)),()=>zs(T.x).add(zs(T.y)).add(zs(T.z))),nr(u.equal(st(3)),()=>Na(zs(T.x),zs(T.y),zs(T.z))),Wh(T,T)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),R_=Gl([JXe,eYe]),tYe=ut(([n,e,t])=>{const r=st(t).toVar(),i=Ie(e).toVar(),s=Cn(n).toVar(),a=st().toVar(),o=st().toVar(),l=Cn(Aa(s.x,a),Aa(s.y,o)).toVar(),u=Ie(1e6).toVar();return ys({start:-1,end:st(1),name:"x",condition:"<="},({x:d})=>{ys({start:-1,end:st(1),name:"y",condition:"<="},({y:h})=>{const f=Ie(R_(l,d,h,a,o,i,r)).toVar();u.assign(td(u,f))})}),nr(r.equal(st(0)),()=>{u.assign(gu(u))}),u}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),nYe=ut(([n,e,t])=>{const r=st(t).toVar(),i=Ie(e).toVar(),s=Cn(n).toVar(),a=st().toVar(),o=st().toVar(),l=Cn(Aa(s.x,a),Aa(s.y,o)).toVar(),u=Cn(1e6,1e6).toVar();return ys({start:-1,end:st(1),name:"x",condition:"<="},({x:d})=>{ys({start:-1,end:st(1),name:"y",condition:"<="},({y:h})=>{const f=Ie(R_(l,d,h,a,o,i,r)).toVar();nr(f.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.y.assign(f)})})}),nr(r.equal(st(0)),()=>{u.assign(gu(u))}),u}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),rYe=ut(([n,e,t])=>{const r=st(t).toVar(),i=Ie(e).toVar(),s=Cn(n).toVar(),a=st().toVar(),o=st().toVar(),l=Cn(Aa(s.x,a),Aa(s.y,o)).toVar(),u=ct(1e6,1e6,1e6).toVar();return ys({start:-1,end:st(1),name:"x",condition:"<="},({x:d})=>{ys({start:-1,end:st(1),name:"y",condition:"<="},({y:h})=>{const f=Ie(R_(l,d,h,a,o,i,r)).toVar();nr(f.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(f)}).ElseIf(f.lessThan(u.z),()=>{u.z.assign(f)})})}),nr(r.equal(st(0)),()=>{u.assign(gu(u))}),u}
vendor: 4,638 bytes, line 4315
4315).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),iYe=ut(([n,e,t])=>{const r=st(t).toVar(),i=Ie(e).toVar(),s=ct(n).toVar(),a=st().toVar(),o=st().toVar(),l=st().toVar(),u=ct(Aa(s.x,a),Aa(s.y,o),Aa(s.z,l)).toVar(),d=Ie(1e6).toVar();return ys({start:-1,end:st(1),name:"x",condition:"<="},({x:h})=>{ys({start:-1,end:st(1),name:"y",condition:"<="},({y:f})=>{ys({start:-1,end:st(1),name:"z",condition:"<="},({z:p})=>{const g=Ie(R_(u,h,f,p,a,o,l,i,r)).toVar();d.assign(td(d,g))})})}),nr(r.equal(st(0)),()=>{d.assign(gu(d))}),d}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),sYe=Gl([tYe,iYe]),aYe=ut(([n,e,t])=>{const r=st(t).toVar(),i=Ie(e).toVar(),s=ct(n).toVar(),a=st().toVar(),o=st().toVar(),l=st().toVar(),u=ct(Aa(s.x,a),Aa(s.y,o),Aa(s.z,l)).toVar(),d=Cn(1e6,1e6).toVar();return ys({start:-1,end:st(1),name:"x",condition:"<="},({x:h})=>{ys({start:-1,end:st(1),name:"y",condition:"<="},({y:f})=>{ys({start:-1,end:st(1),name:"z",condition:"<="},({z:p})=>{const g=Ie(R_(u,h,f,p,a,o,l,i,r)).toVar();nr(g.lessThan(d.x),()=>{d.y.assign(d.x),d.x.assign(g)}).ElseIf(g.lessThan(d.y),()=>{d.y.assign(g)})})})}),nr(r.equal(st(0)),()=>{d.assign(gu(d))}),d}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),oYe=Gl([nYe,aYe]),lYe=ut(([n,e,t])=>{const r=st(t).toVar(),i=Ie(e).toVar(),s=ct(n).toVar(),a=st().toVar(),o=st().toVar(),l=st().toVar(),u=ct(Aa(s.x,a),Aa(s.y,o),Aa(s.z,l)).toVar(),d=ct(1e6,1e6,1e6).toVar();return ys({start:-1,end:st(1),name:"x",condition:"<="},({x:h})=>{ys({start:-1,end:st(1),name:"y",condition:"<="},({y:f})=>{ys({start:-1,end:st(1),name:"z",condition:"<="},({z:p})=>{const g=Ie(R_(u,h,f,p,a,o,l,i,r)).toVar();nr(g.lessThan(d.x),()=>{d.z.assign(d.y),d.y.assign(d.x),d.x.assign(g)}).ElseIf(g.lessThan(d.y),()=>{d.z.assign(d.y),d.y.assign(g)}).ElseIf(g.lessThan(d.z),()=>{d.z.assign(g)})})})}),nr(r.equal(st(0)),()=>{d.assign(gu(d))}),d}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),dq=Gl([rYe,lYe]),cYe=ut(([n,e,t,r,i,s,a,o,l,u,d])=>{const h=st(n).toVar(),f=Cn(e).toVar(),p=Cn(t).toVar(),g=Cn(r).toVar(),A=Ie(i).toVar(),x=Ie(s).toVar(),b=Ie(a).toVar(),_=th(o).toVar(),M=st(l).toVar(),T=Ie(u).toVar(),L=Ie(d).toVar(),D=f.mul(p).add(g),P=Ie(0).toVar();return nr(h.equal(st(0)),()=>{P.assign(FT(D))}),nr(h.equal(st(1)),()=>{P.assign(DR(D))}),nr(h.equal(st(2)),()=>{P.assign(dq(D,A,st(0)))}),nr(h.equal(st(3)),()=>{P.assign(jR(ct(D,0),M,T,L))}),P.assign(P.mul(b.sub(x)).add(x)),nr(_,()=>{P.assign(ip(P,x,b))}),P}).setLayout({name:"mx_unifiednoise2d",type:"float",inputs:[{name:"noiseType",type:"int"},{name:"texcoord",type:"vec2"},{name:"freq",type:"vec2"},{name:"offset",type:"vec2"},{name:"jitter",type:"float"},{name:"outmin",type:"float"},{name:"outmax",type:"float"},{name:"clampoutput",type:"bool"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),uYe=ut(([n,e,t,r,i,s,a,o,l,u,d])=>{const h=st(n).toVar(),f=ct(e).toVar(),p=ct(t).toVar(),g=ct(r).toVar(),A=Ie(i).toVar(),x=Ie(s).toVar(),b=Ie(a).toVar(),_=th(o).toVar(),M=st(l).toVar(),T=Ie(u).toVar(),L=Ie(d).toVar(),D=f.mul(p).add(g),P=Ie(0).toVar();return nr(h.equal(st(0)),()=>{P.assign(FT(D))}),nr(h.equal(st(1)),()=>{P.assign(DR(D))}),nr(h.equal(st(2)),()=>{P.assign(dq(D,A,st(0)))}),nr(h.equal(st(3)),()=>{P.assign(jR(D,M,T,L))}),P.assign(P.mul(b.sub(x)).add(x)),nr(_,()=>{P.assign(ip(P,x,b))}),P}).setLayout({name:"mx_unifiednoise3d",type:"float",inputs:[{name:"noiseType",type:"int"},{name:"position",type:"vec3"},{name:"freq",type:"vec3"},{name:"offset",type:"vec3"},{name:"jitter",type:"float"},{name:"outmin",type:"float"},{name:"outmax",type:"float"},{name:"clampoutput",type:"bool"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),dYe=ut(([n])=>{const e=n.y,t=n.z,r=ct().toVar();return nr(e.lessThan(1e-4),()=>{r.assign(ct(t,t,t))}).Else(()=>{let i=n.x;i=i.sub(b0(i)).mul(6).toVar();const s=st(Jz(i)),a=i.sub(Ie(s)),o=t.mul(e.oneMinus()),l=t.mul(e.mul(a).oneMinus()),u=t.mul(e.mul(a.oneMinus()).oneMinus());nr(s.equal(st(0)),()=>{r.assign(ct(t,u,o))}).ElseIf(s.equal(st(1)),()=>{r.assign(ct(l,t,o))}).ElseIf(s.equal(st(2)),()=>{r.assign(ct(o,t,u))}).ElseIf(s.equal(st(3)),()=>{r.assign(ct(o,l,t))}).ElseIf(s.equal(st(4)),()=>{r.assign(ct(u,o,t))}).Else(()=>{r.assign(ct(t,o,l))})}),r}
vendor: 2,934 bytes, line 4315
4315).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),hYe=ut(([n])=>{const e=ct(n).toVar(),t=Ie(e.x).toVar(),r=Ie(e.y).toVar(),i=Ie(e.z).toVar(),s=Ie(td(t,td(r,i))).toVar(),a=Ie(Na(t,Na(r,i))).toVar(),o=Ie(a.sub(s)).toVar(),l=Ie().toVar(),u=Ie().toVar(),d=Ie().toVar();return d.assign(a),nr(a.greaterThan(0),()=>{u.assign(o.div(a))}).Else(()=>{u.assign(0)}),nr(u.lessThanEqual(0),()=>{l.assign(0)}).Else(()=>{nr(t.greaterThanEqual(a),()=>{l.assign(r.sub(i).div(o))}).ElseIf(r.greaterThanEqual(a),()=>{l.assign(fo(2,i.sub(t).div(o)))}).Else(()=>{l.assign(fo(4,t.sub(r).div(o)))}),l.mulAssign(1/6),nr(l.lessThan(0),()=>{l.addAssign(1)})}),ct(l,u,d)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),fYe=ut(([n])=>{const e=ct(n).toVar(),t=Iz(qz(e,ct(.04045))).toVar(),r=ct(e.div(12.92)).toVar(),i=ct(Ih(Na(e.add(ct(.055)),ct(0)).div(1.055),ct(2.4))).toVar();return ui(r,i,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Ame=(n,e)=>{n=Ie(n),e=Ie(e);const t=Cn(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return rh(n.sub(t),n.add(t),e)},xme=(n,e,t,r)=>ui(n,e,t[r].clamp()),pYe=(n,e,t=ws())=>xme(n,e,t,"x"),mYe=(n,e,t=ws())=>xme(n,e,t,"y"),gYe=(n,e,t,r,i=ws())=>{const s=i.x.clamp(),a=i.y.clamp(),o=ui(n,e,s),l=ui(t,r,s);return ui(o,l,a)},vme=(n,e,t,r,i)=>ui(n,e,Ame(t,r[i])),AYe=(n,e,t,r=ws())=>vme(n,e,t,r,"x"),xYe=(n,e,t,r=ws())=>vme(n,e,t,r,"y"),vYe=(n=1,e=0,t=ws())=>t.mul(n).add(e),yYe=(n,e=1)=>(n=Ie(n),n.abs().pow(e).mul(n.sign())),bYe=(n,e=1,t=.5)=>Ie(n).sub(t).mul(e).add(t),wYe=(n=ws(),e=1,t=0)=>uq(n.convert("vec2|vec3")).mul(e).add(t),_Ye=(n=ws(),e=1,t=0)=>FT(n.convert("vec2|vec3")).mul(e).add(t),SYe=(n=ws(),e=1,t=0)=>(n=n.convert("vec2|vec3"),Vn(FT(n),uq(n.add(Cn(19,73)))).mul(e).add(t)),TYe=(n,e=ws(),t=Cn(1,1),r=Cn(0,0),i=1,s=0,a=1,o=!1,l=1,u=2,d=.5)=>cYe(n,e.convert("vec2|vec3"),t,r,i,s,a,o,l,u,d),EYe=(n,e=ws(),t=Cn(1,1),r=Cn(0,0),i=1,s=0,a=1,o=!1,l=1,u=2,d=.5)=>uYe(n,e.convert("vec2|vec3"),t,r,i,s,a,o,l,u,d),CYe=(n=ws(),e=1)=>sYe(n.convert("vec2|vec3"),e,st(1)),NYe=(n=ws(),e=1)=>oYe(n.convert("vec2|vec3"),e,st(1)),MYe=(n=ws(),e=1)=>dq(n.convert("vec2|vec3"),e,st(1)),kYe=(n=ws())=>HXe(n.convert("vec2|vec3")),RYe=(n=ws(),e=3,t=2,r=.5,i=1)=>Vk(n,st(e),t,r).mul(i),PYe=(n=ws(),e=3,t=2,r=.5,i=1)=>KXe(n,st(e),t,r).mul(i),LYe=(n=ws(),e=3,t=2,r=.5,i=1)=>jR(n,st(e),t,r).mul(i),OYe=(n=ws(),e=3,t=2,r=.5,i=1)=>ZXe(n,st(e),t,r).mul(i),DYe=(n,e=Ie(0))=>fo(n,e),jYe=(n,e=Ie(0))=>Ei(n,e),IYe=(n,e=Ie(1))=>Pr(n,e),FYe=(n,e=Ie(1))=>nh(n,e),UYe=(n,e=Ie(1))=>hR(n,e),BYe=(n,e=Ie(1))=>Ih(n,e),VYe=(n=Ie(0),e=Ie(1))=>Xz(n,e),zYe=()=>k_,GYe=()=>P0e,qYe=(n,e=Ie(1))=>Ei(e,n),$Ye=(n,e,t,r)=>n.greaterThan(e).mix(t,r),HYe=(n,e,t,r)=>n.greaterThanEqual(e).mix(t,r),WYe=(n,e,t,r)=>n.equal(e).mix(t,r),XYe=(n,e=null)=>{if(typeof e=="string"){const t={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3},r=e.replace(/^out/,"").toLowerCase();
4315if(t[r]!==void 0)return n.element(t[r])}if(typeof e=="number")return n.element(e);if(typeof e=="string"&&e.length===1){const t={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};if(t[e]!==void 0)return n.element(t[e])}return n},YYe=(n,e=Cn(.5,.5),t=Cn(1,1),r=Ie(0),i=Cn(0,0))=>{let s=n;if(e&&(s=s.sub(e)),t&&(s=s.mul(t)),r){const a=r.mul(Math.PI/180),o=a.cos(),l=a.sin();s=Cn(s.x.mul(o).sub(s.y.mul(l)),s.x.mul(l).add(s.y.mul(o)))}return e&&(s=s.add(e)),i&&(s=s.add(i)),s},QYe=(n,e)=>{n=Cn(n),e=Ie(e);const t=e.mul(Math.PI/180);return OT(n,t)},KYe=(n,e,t)=>{n=ct(n),e=Ie(e),t=ct(t);const r=e.mul(Math.PI/180),i=t.normalize(),s=r.cos(),a=r.sin(),o=Ie(1).sub(s);return n.mul(s).add(i.cross(n).mul(a)).add(i.mul(i.dot(n)).mul(o))},ZYe=(n,e)=>(n=ct(n),e=Ie(e),NG(n,e)),JYe=ut(([n,e,t])=>{const r=_c(n).toVar(),i=Ei(Ie(.5).mul(e.sub(t)),_0).div(r).toVar(),s=Ei(Ie(-.5).mul(e.sub(t)),_0).div(r).toVar(),a=ct().toVar();a.x=r.x.greaterThan(Ie(0)).select(i.x,s.x),a.y=r.y.greaterThan(Ie(0)).select(i.y,s.y),a.z=r.z.greaterThan(Ie(0)).select(i.z,s.z);const o=td(a.x,a.y,a.z).toVar();return _0.add(r.mul(o)).toVar().sub(t)}),yme=ut(([n,e])=>{const t=n.x,r=n.y,i=n.z;let s=e.element(0).mul(.886227);return s=s.add(e.element(1).mul(2*.511664).mul(r)),s=s.add(e.element(2).mul(2*.511664).mul(i)),s=s.add(e.element(3).mul(2*.511664).mul(t)),s=s.add(e.element(4).mul(2*.429043).mul(t).mul(r)),s=s.add(e.element(5).mul(2*.429043).mul(r).mul(i)),s=s.add(e.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),s=s.add(e.element(7).mul(2*.429043).mul(t).mul(i)),s=s.add(e.element(8).mul(.429043).mul(Pr(t,t).sub(Pr(r,r)))),s});var ne=Object.freeze({__proto__:null,BRDF_GGX:$G,BRDF_Lambert:dy,BasicPointShadowFilter:lme,BasicShadowFilter:J0e,Break:qpe,Const:dfe,Continue:Xze,DFGLUT:B5,D_GGX:a0e,Discard:Cfe,EPSILON:fR,F_Schlick:e_,Fn:ut,HALF_PI:AVe,INFINITY:pVe,If:nr,Loop:ys,NodeAccess:Fl,NodeShaderStage:nb,NodeType:FBe,NodeUpdateType:Tr,OnBeforeFrameUpdate:Uze,OnBeforeMaterialUpdate:Fze,OnBeforeObjectUpdate:Ize,OnFrameUpdate:jpe,OnMaterialUpdate:jze,OnObjectUpdate:LT,PCFShadowFilter:eme,PCFSoftShadowFilter:tme,PI:Rk,PI2:mVe,PointShadowFilter:cme,Return:jVe,Schlick_to_F0:ZF,ShaderNode:xb,Stack:lR,Switch:aVe,TBNViewMatrix:Av,TWO_PI:gVe,VSMShadowFilter:nme,V_GGX_SmithCorrelated:s0e,Var:ufe,VarIntent:hfe,abs:zs,acesFilmicToneMapping:q0e,acos:Wz,acosh:Bhe,add:fo,addMethodChaining:Ut,addNodeElement:BVe,agxToneMapping:$0e,all:khe,alphaT:Nk,ambientOcclusion:BF,and:ghe,anisotropy:_A,anisotropyB:Fv,anisotropyT:y4,any:Rhe,append:lVe,array:lhe,asin:Fhe,asinh:Uhe,assign:che,atan:Xz,atanh:Vhe,atomicAdd:fWe,atomicAnd:AWe,atomicFunc:B0,atomicLoad:dWe,atomicMax:mWe,atomicMin:gWe,atomicOr:xWe,atomicStore:hWe,atomicSub:pWe,atomicXor:vWe,attenuationColor:zz,attenuationDistance:Vz,attribute:$d,attributeArray:aHe,backgroundBlurriness:D0e,backgroundIntensity:rU,backgroundRotation:j0e,batch:Bpe,batchColor:jG,bentNormalView:ape,billboarding:G$e,bitAnd:yhe,bitNot:bhe,bitOr:whe,bitXor:_he,bitangentGeometry:Eze,bitangentLocal:Cze,bitangentView:ipe,bitangentWorld:Nze,bitcast:k0e,blendBurn:bHe,blendColor:THe,blendDodge:wHe,blendOverlay:SHe,blendScreen:_He,blur:f0e,bool:th,buffer:C_,bufferAttribute:dG,builtin:mg,builtinAOContext:lfe,builtinShadowContext:ofe,bumpMap:NG,bvec2:the,bvec3:Iz,bvec4:nhe,bypass:Tfe,cache:Sfe,call:uhe,cameraFar:kA,cameraIndex:Y1,cameraNear:MA,cameraNormalMatrix:JVe,cameraPosition:jfe,cameraProjectionMatrix:pu,cameraProjectionMatrixInverse:Dfe,cameraViewMatrix:Q1,cameraViewport:eze,cameraWorldMatrix:PT,cbrt:tfe,cdl:kHe,ceil:mR,checker:AXe,cineonToneMapping:G0e,clamp:ip,clearcoat:Tk,clearcoatNormalView:RA,clearcoatRoughness:jb,clipSpace:Ufe,code:PR,color:ehe,colorSpaceToWorking:AR,colorToDirection:Rze,compute:_fe,computeKernel:fG,computeSkinning:Hze,context:pg,convert:ihe,convertColorSpace:SVe,convertToTexture:eHe,cos:If,cosh:Dhe,countLeadingZeros:v$e,countOneBits:y$e,countTrailingZeros:x$e,cross:ag,cubeTexture:du,cubeTextureBase:EG,dFdx:Kz,dFdy:Zz,dashSize:Uv,debug:Mfe,decrement:Mhe,decrementBefore:Che,defaultBuildStages:_6,defaultShaderStages:Hde,defined:Kw,degrees:Lhe,deltaTime:D$e,densityFogFactor:Q0e,depth:VG,depthPass:jHe,determinant:Hhe,difference:Qhe,diffuseColor:As,diffuseContribution:Jx,directPointLight:dme,directionToColor:kze,directionToFaceDirection:pze,dispersion:Gz,disposeShadowMaterial:ime,distance:Yhe,div:nh,dot:Wh,drawIndex:wfe,dynamicBufferAttribute:MVe,element:rhe,emissive:UF,equal:dhe,equirectDirection:KF,equirectUV:zG,exp:$z,exp2:Zw,exponentialHeightFogFactor:XHe,expression:zd,faceDirection:_G,faceForward:sG,faceforward:xVe,float:Ie,floatBitsToInt:m$e,floatBitsToUint:R0e,floor:b0,fog:iU,fract:rp,frameGroup:uVe,frameId:P0e,frontFacing:Bfe,fwidth:eG,gain:w$e,gapSize:U5,getConstNodeType:Jde,getCurrentStack:Oz,getDirection:d0e,getDistanceAttenuation:cq,getGeometryRoughness:i0e,getNormalFromDepth:nHe,getParallaxCorrectNormal:JYe,getRoughness:qG,getScreenPosition:tHe,getShIrradianceAt:yme,getShadowMaterial:rme,getShadowRenderObjectFunction:sme,getTextureIndex:N0e,getViewPosition:ib,ggxConvolution:p0e,globalId:eWe,glsl:$He,glslFn:HHe,grayscale:EHe,greaterThan:qz,greaterThanEqual:mhe,hash:b$e,highpModelNormalViewMatrix:zF,highpModelViewMatrix:VF,hue:MHe,increment:Nhe,incrementBefore:Ehe,inspector:Rfe,instance:Fpe,instanceColor:DG,instanceIndex:Zf,instancedArray:oHe,instancedBufferAttribute:vR,instancedDynamicBufferAttribute:hG,instancedMesh:Upe,int:st,intBitsToFloat:g$e,interleavedGradientNoise:JG,inverse:Whe,inverseSqrt:Hz,inversesqrt:vVe,invocationLocalIndex:PVe,invocationSubgroupIndex:RVe,i
4315or:b4,iridescence:uR,iridescenceIOR:Ek,iridescenceThickness:Ck,isolate:Fb,ivec2:_a,ivec3:jz,ivec4:Fz,js:GHe,label:cfe,length:w0,lengthSq:rG,lessThan:fhe,lessThanEqual:phe,lightPosition:iq,lightProjectionUV:K0e,lightShadowMatrix:OR,lightTargetDirection:aq,lightTargetPosition:Z0e,lightViewPosition:sq,lightingContext:Hpe,lights:QWe,linearDepth:jk,linearToneMapping:V0e,localId:tWe,log:pR,log2:y0,logarithmicDepthToViewZ:rGe,luminance:tq,mat2:cR,mat3:gl,mat4:f1,matcapUV:g0e,materialAO:Ope,materialAlphaTest:lpe,materialAnisotropy:_pe,materialAnisotropyVector:rb,materialAttenuationColor:Rpe,materialAttenuationDistance:kpe,materialClearcoat:Ape,materialClearcoatNormal:vpe,materialClearcoatRoughness:xpe,materialColor:cpe,materialDispersion:Lpe,materialEmissive:dpe,materialEnvIntensity:C6,materialEnvRotation:Pk,materialIOR:Mpe,materialIridescence:Spe,materialIridescenceIOR:Tpe,materialIridescenceThickness:Epe,materialLightMap:OG,materialLineDashOffset:LG,materialLineDashSize:RG,materialLineGapSize:PG,materialLineScale:kG,materialLineWidth:Lk,materialMetalness:mpe,materialNormal:gpe,materialOpacity:MG,materialPointSize:Ppe,materialReference:Om,materialReflectivity:N6,materialRefractionRatio:Gfe,materialRotation:ype,materialRoughness:ppe,materialSheen:bpe,materialSheenRoughness:wpe,materialShininess:upe,materialSpecular:hpe,materialSpecularColor:fpe,materialSpecularIntensity:WF,materialSpecularStrength:w4,materialThickness:Npe,materialTransmission:Cpe,max:Na,maxMipLevel:AG,mediumpModelViewMatrix:Ffe,metalness:Fm,min:td,mix:ui,mixElement:rfe,mod:hR,modelDirection:oze,modelNormalMatrix:Ife,modelPosition:lze,modelRadius:dze,modelScale:cze,modelViewMatrix:O0,modelViewPosition:uze,modelViewProjection:Dpe,modelWorldMatrix:Fh,modelWorldMatrixInverse:hze,morphReference:$pe,mrt:M0e,mul:Pr,mx_aastep:Ame,mx_add:DYe,mx_atan2:VYe,mx_cell_noise_float:kYe,mx_contrast:bYe,mx_divide:FYe,mx_fractal_noise_float:RYe,mx_fractal_noise_vec2:PYe,mx_fractal_noise_vec3:LYe,mx_fractal_noise_vec4:OYe,mx_frame:GYe,mx_heighttonormal:ZYe,mx_hsvtorgb:dYe,mx_ifequal:WYe,mx_ifgreater:$Ye,mx_ifgreatereq:HYe,mx_invert:qYe,mx_modulo:UYe,mx_multiply:IYe,mx_noise_float:wYe,mx_noise_vec3:_Ye,mx_noise_vec4:SYe,mx_place2d:YYe,mx_power:BYe,mx_ramp4:gYe,mx_ramplr:pYe,mx_ramptb:mYe,mx_rgbtohsv:hYe,mx_rotate2d:QYe,mx_rotate3d:KYe,mx_safepower:yYe,mx_separate:XYe,mx_splitlr:AYe,mx_splittb:xYe,mx_srgb_texture_to_lin_rec709:fYe,mx_subtract:jYe,mx_timer:zYe,mx_transform_uv:vYe,mx_unifiednoise2d:TYe,mx_unifiednoise3d:EYe,mx_worley_noise_float:CYe,mx_worley_noise_vec2:NYe,mx_worley_noise_vec3:MYe,negate:Qz,negateOnBackSide:ky,neutralToneMapping:H0e,nodeArray:Iv,nodeImmutable:Pn,nodeObject:Hn,nodeObjectIntent:FS,nodeObjects:oR,nodeProxy:ri,nodeProxyConstructor:Lz,nodeProxyIntent:mn,normalFlat:Vfe,normalGeometry:yR,normalLocal:kc,normalMap:HF,normalView:Ri,normalViewGeometry:Jw,normalWorld:K1,normalWorldGeometry:zfe,normalize:_c,not:xhe,notEqual:hhe,numWorkgroups:ZHe,objectDirection:tze,objectGroup:ohe,objectPosition:rze,objectRadius:aze,objectScale:ize,objectViewPosition:sze,objectWorldMatrix:nze,oneMinus:zhe,or:Ahe,orthographicDepthToViewZ:Xpe,oscSawtooth:U$e,oscSine:j$e,oscSquare:I$e,oscTriangle:F$e,output:Ib,outputStruct:d$e,overloadingFn:Gl,overrideNode:_0e,overrideNodes:S0e,packHalf2x16:C$e,packNormalToRGB:CG,packSnorm2x16:T$e,packUnorm2x16:E$e,parabola:nU,parallaxDirection:spe,parallaxUV:Mze,parameter:s$e,pass:OHe,passTexture:DHe,pcurve:_$e,perspectiveDepthToViewZ:ER,pmremTexture:WG,pointShadow:ume,pointUV:cHe,pointWidth:cVe,positionGeometry:uc,positionLocal:pa,positionPrevious:uy,positionView:Ja,positionViewDirection:Os,positionWorld:_0,positionWorldDirection:wG,posterize:RHe,pow:Ih,pow2:tG,pow3:Khe,pow4:nG,premultiplyAlpha:mG,property:fg,quadBroadcast:qWe,quadSwapDiagonal:FWe,quadSwapX:jWe,quadSwapY:IWe,radians:Phe,rand:nfe,range:QHe,rangeFogFactor:Y0e,reciprocal:qhe,reference:Ws,referenceBuffer:Yfe,reflect:Xhe,reflectVector:Hfe,reflectView:qfe,reflector:Y$e,refract:iG,refractVector:Wfe,refractView:$fe,reinhardToneMapping:z0e,remap:pG,remapClamp:Efe,renderGroup:lr,renderOutput:gG,rendererReference:xfe,replaceDefaultUV:B$e,rotate:OT,rotateUV:V$e,roughness:e0,round:Ghe,rtt:O0e,sRGBTransferEOTF:pfe,
4315sRGBTransferOETF:mfe,sample:iHe,sampler:HVe,samplerComparison:WVe,saturate:gR,saturation:CHe,screenCoordinate:My,screenDPR:yG,screenSize:cy,screenUV:Yf,select:yc,setCurrentStack:F5,setName:oG,shaderStages:S6,shadow:ome,shadowPositionWorld:lq,shapeCircle:xXe,sharedUniformGroup:dR,sheen:Cd,sheenRoughness:NA,shiftLeft:She,shiftRight:The,shininess:Mk,sign:Yz,sin:ou,sinc:S$e,sinh:Ohe,skinning:Gpe,smoothstep:rh,smoothstepElement:ife,specularColor:R1,specularColorBlended:mv,specularF90:gv,spherizeUV:z$e,split:oVe,spritesheetUV:$$e,sqrt:gu,stack:k6,step:oy,stepElement:sfe,storage:p1,storageBarrier:sWe,storageTexture:F0e,storageTexture3D:hHe,struct:u$e,sub:Ei,subBuild:Bv,subgroupAdd:wWe,subgroupAll:LWe,subgroupAnd:NWe,subgroupAny:OWe,subgroupBallot:bWe,subgroupBroadcast:UWe,subgroupBroadcastFirst:DWe,subgroupElect:yWe,subgroupExclusiveAdd:SWe,subgroupExclusiveMul:CWe,subgroupInclusiveAdd:_We,subgroupInclusiveMul:EWe,subgroupIndex:kVe,subgroupMax:PWe,subgroupMin:RWe,subgroupMul:TWe,subgroupOr:MWe,subgroupShuffle:BWe,subgroupShuffleDown:GWe,subgroupShuffleUp:zWe,subgroupShuffleXor:VWe,subgroupSize:nWe,subgroupXor:kWe,tan:jhe,tangentGeometry:wR,tangentLocal:P1,tangentView:_R,tangentWorld:rpe,tanh:Ihe,texture:Pi,texture3D:eq,texture3DLevel:gHe,texture3DLoad:mHe,textureBarrier:aWe,textureBicubic:UGe,textureBicubicLevel:HG,textureCubeUV:h0e,textureLevel:$Ve,textureLoad:Ya,textureSize:ly,textureStore:uHe,thickness:Bz,time:k_,toneMapping:vfe,toneMappingExposure:yfe,toonOutlinePass:FHe,transformDirection:Zhe,transformNormal:SG,transformNormalByInverseViewMatrix:efe,transformNormalByViewMatrix:Jhe,transformNormalToView:TG,transformedClearcoatNormalView:Aze,transformedNormalView:mze,transformedNormalWorld:gze,transmission:kk,transpose:$he,triNoise3D:P$e,triplanarTexture:H$e,triplanarTextures:L0e,trunc:Jz,uint:un,uintBitsToFloat:A$e,uniform:Qn,uniformArray:Dl,uniformCubeTexture:vze,uniformFlow:afe,uniformGroup:ahe,uniformTexture:qVe,unpackHalf2x16:k$e,unpackNormal:$F,unpackRGBToNormal:ope,unpackSnorm2x16:N$e,unpackUnorm2x16:M$e,unpremultiplyAlpha:Nfe,userData:xHe,uv:ws,uvec2:Dz,uvec3:Cy,uvec4:Uz,varying:X1,varyingProperty:Ny,vec2:Cn,vec3:ct,vec4:Vn,vectorComponents:Ty,velocity:yHe,vertexColor:Kpe,vertexIndex:bfe,vertexStage:ffe,vibrance:NHe,viewZToLogarithmicDepth:CR,viewZToOrthographicDepth:Vv,viewZToPerspectiveDepth:BG,viewZToReversedOrthographicDepth:nGe,viewZToReversedPerspectiveDepth:Ype,viewport:Ub,viewportCoordinate:Ofe,viewportDepthTexture:UG,viewportLinearDepth:iGe,viewportMipTexture:FG,viewportOpaqueMipTexture:Wpe,viewportResolution:ZVe,viewportSafeUV:q$e,viewportSharedTexture:LHe,viewportSize:bG,viewportTexture:Jze,viewportUV:KVe,vogelDiskSample:qf,wgsl:qHe,wgslFn:WHe,workgroupArray:cWe,workgroupBarrier:iWe,workgroupId:JHe,workingToColorSpace:gfe,xor:vhe});const wf=new XG;class eQe extends Z1{constructor(e,t){super(),this.renderer=e,this.nodes=t}update(e,t,r){const i=this.renderer,s=this.nodes.getBackgroundNode(e)||e.background;let a=!1;if(s===null)i._clearColor.getRGB(wf),wf.a=i._clearColor.a;else if(s.isColor===!0)s.getRGB(wf),wf.a=1,a=!0;else if(s.isNode===!0){const u=this.get(e),d=s;wf.copy(i._clearColor);let h=u.backgroundMesh;if(h===void 0){let T=function(){s.removeEventListener("dispose",T),h.material.dispose(),h.geometry.dispose()};var l=T;const p=Vn(d).mul(rU).context({getUV:()=>j0e.mul(zfe),getTextureLevel:()=>D0e}),g=pu.element(3).element(3).equal(1),A=nh(1,pu.element(1).element(1)).mul(3),x=g.select(pa.mul(A),pa),b=O0.mul(Vn(x,0));let _=pu.mul(Vn(b.xyz,1));_=_.setZ(_.w);const M=new Va;M.name="Background.material",M.side=us,M.depthTest=!1,M.depthWrite=!1,M.allowOverride=!1,M.fog=!1,M.lights=!1,M.vertexNode=_,M.colorNode=p,u.backgroundMeshNode=p,u.backgroundMesh=h=new ns(new F0(1,32,32),M),h.frustumCulled=!1,h.name="Background.mesh",s.addEventListener("dispose",T)}const f=d.getCacheKey();u.backgroundCacheKey!==f&&(u.backgroundMeshNode.node=Vn(d).mul(rU),u.backgroundMeshNode.needsUpdate=!0,h.material.needsUpdate=!0,u.backgroundCacheKey=f),t.unshift(h,h.geometry,h.material,0,0,null,null)}else sn("Renderer: Unsupported background configuration.",s);const o=i.xr.getEnvironmentBlendMode();if(o==="additive"?wf.set(0,0,0,1):o==="alpha-blend"&&wf.set(0,0,0,0),i.autoClear===!0||a===!0){const u=r.clearColorValue;u.r=wf.r,u.g=wf.g,u.b=wf.b,u.a=wf.a,(i.backend.isWebGLBackend===!0||i.alpha===!0)&&(u.r*=u.a,u.g*=u.a,u.b*=u.a),r.depthClearValue=i.getClearDepth(),r.stencilClearValue=i.getClearStencil(),r.clearColor=i.autoClearColor===!0,r.clearDepth=i.autoClearDepth===!0,r.clearStencil=i.autoClearStencil===!0}else r.clearColor=!1,r.clearDepth=!1,r.clearStencil=!1}}let tQe=0;class sU{constructor(e="",t=[]){this.name=e,this.bindings=t,this.id=tQe++}}class nQe{constructor(e,t,r,i,s,a,o,l,u,d,h=[]){this.vertexShader=e,this.fragmentShader=t,this.computeShader=r,this.transforms=h,this.nodeAttributes=i,this.bindings=s,this.updateNodes=a,this.updateBeforeNodes=o,this.updateAfterNodes=l,this.observer=u,this.hardwareClipping=d,this.usedTimes=0}createBindings(){const e=[];for(const t of this.bindings)if(t.bindings[0].groupNode.shared!==!0){const i=new sU(t.name,[]);e.push(i);for(const s of t.bindings)i.bindings.push(s.clone())}else e.push(t);return e}}class LJ{constructor(e,t,r=null){this.isNodeAttribute=!0,this.name=e,this.type=t,this.node=r}}class rQe{constructor(e,t,r){this.isNodeUniform=!0,this.name=e,this.type=t,this.node=r}get value(){return this.node.value}set value(e){this.node.value=e}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}
vendor: 3,282 bytes, line 4315
4315class bme{constructor(e,t,r=!1,i=null){this.isNodeVar=!0,this.name=e,this.type=t,this.readOnly=r,this.count=i}}class iQe extends bme{constructor(e,t,r=null,i=null){super(e,t),this.needsInterpolation=!1,this.isNodeVarying=!0,this.interpolationType=r,this.interpolationSampling=i}}class sQe{constructor(e,t,r=""){this.name=e,this.type=t,this.code=r,Object.defineProperty(this,"isNodeCode",{value:!0})}}let aQe=0;class jL{constructor(e=null){this.id=aQe++,this.nodesData=new WeakMap,this.parent=e}getData(e){let t=this.nodesData.get(e);return t===void 0&&this.parent!==null&&(t=this.parent.getData(e)),t}setData(e,t){this.nodesData.set(e,t)}}class oQe{constructor(e,t){this.name=e,this.members=t,this.output=!1}}class J1{constructor(e,t){this.name=e,this.value=t,this.boundary=0,this.itemSize=0,this.offset=0,this.index=-1}setValue(e){this.value=e}getValue(){return this.value}}class lQe extends J1{constructor(e,t=0){super(e,t),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class cQe extends J1{constructor(e,t=new Jt){super(e,t),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class uQe extends J1{constructor(e,t=new Ve){super(e,t),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class dQe extends J1{constructor(e,t=new Rr){super(e,t),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class hQe extends J1{constructor(e,t=new tr){super(e,t),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class fQe extends J1{constructor(e,t=new BM){super(e,t),this.isMatrix2Uniform=!0,this.boundary=8,this.itemSize=4}}class pQe extends J1{constructor(e,t=new Gr){super(e,t),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class mQe extends J1{constructor(e,t=new kr){super(e,t),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class gQe extends lQe{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class AQe extends cQe{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class xQe extends uQe{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class vQe extends dQe{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class yQe extends hQe{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class bQe extends fQe{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class wQe extends pQe{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class _Qe extends mQe{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}let SQe=0;const OJ=new WeakMap,DJ=new WeakMap,TQe=new WeakMap,EQe=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),iN=n=>
4315/e/g.test(n)?String(n).replace(/\+/g,""):(n=Number(n),n+(n%1?"":".0")),wme=n=>{if(n.writeUsageCount>0)return!0;if(n.subBuildsCache!==void 0){for(const e in n.subBuildsCache)if(wme(n.subBuildsCache[e]))return!0}return!1};class _me{constructor(e,t,r){this.object=e,this.material=e&&e.material||null,this.geometry=e&&e.geometry||null,this.renderer=t,this.parser=r,this.scene=null,this.camera=null,this.nodes=new Set,this.sequentialNodes=new Set,this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.observer=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.hardwareClipping=!1,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.types={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.declarations={},this.flow={code:""},this.chaining=[],this.stack=k6(),this.stacks=[],this.tab=" ",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new jL,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null,this.subBuildLayers=[],this.activeStacks=[],this.subBuildFn=null,this.fnCall=null,Object.defineProperty(this,"id",{value:SQe++})}isFlatShading(){return this.material.flatShading===!0||this.geometry.hasAttribute("normal")===!1}isOpaque(){const e=this.material;return e.transparent===!1&&e.blending===dl&&e.alphaToCoverage===!1}createRenderTarget(e,t,r){return new cp(e,t,r)}createCubeRenderTarget(e,t){return new Jpe(e,t)}includes(e){return this.nodes.has(e)}getOutputType(e=0){let t="vec4";const r=this.renderer.getRenderTarget();if(r!==null){const i=r.textures[e].type,s=r.textures[e].format;let a="vec";i===oo?a="ivec":i===ts&&(a="uvec"),s===wy||s===G1?i===oo?t="int":i===ts?t="uint":t="float":s===fl||s===q1?t=`${a}2`:s===by||s===DV?t=`${a}3`:t=`${a}4`}return t}getOutputStructName(){}_getBindGroup(e,t){const r=t[0].groupNode;let i=r.shared;if(i)for(let a=1;a<t.length;a++)r!==t[a].groupNode&&(i=!1);let s;if(i){let a="";for(const d of t)if(d.isNodeUniformsGroup){d.uniforms.sort((h,f)=>h.nodeUniform.node.id-f.nodeUniform.node.id);for(const h of d.uniforms)a+=h.nodeUniform.node.id}else a+=d.nodeUniform.id;const o=this.renderer._currentRenderContext||this.renderer;let l=OJ.get(o);l===void 0&&(l=new Map,OJ.set(o,l));const u=E_(a);s=l.get(u),s===void 0&&(s=new sU(e,t),l.set(u,s))}else s=new sU(e,t);return s}getBindGroupArray(e,t){const r=this.bindings[t];let i=r[e];return i===void 0&&(this.bindingsIndexes[e]===void 0&&(this.bindingsIndexes[e]={binding:0,group:Object.keys(this.bindingsIndexes).length}),r[e]=i=[]),i}getBindings(){let e=this.bindGroups;if(e===null){const t={},r=this.bindings;for(const i of S6)for(const s in r[i]){const a=r[i][s],o=t[s]||(t[s]=[]);for(const l of a)o.includes(l)===!1&&o.push(l)}e=[];for(const i in t){const s=t[i],a=this._getBindGroup(i,s);e.push(a)}this.bindGroups=e}return e}sortBindingGroups(){const e=this.getBindings();e.sort((t,r)=>t.bindings[0].groupNode.order-r.bindings[0].groupNode.order);for(let t=0;t<e.length;t++){const r=e[t];this.bindingsIndexes[r.name].group=t}}setHashNode(e,t){this.hashNodes[t]=e}addNode(e){this.nodes.has(e)===!1&&(this.nodes.add(e),this.setHashNode(e,e.getHash(this)))}addSequentialNode(e){const t=e.getUpdateBeforeType(),r=e.getUpdateAfterType();(t!==Tr.NONE||r!==Tr.NONE)&&this.sequentialNodes.add(e)}buildUpdateNodes(){for(const e of this.nodes)e.getUpdateType()!==Tr.NONE&&this.updateNodes.push(e);for(const e of this.sequentialNodes){const t=e.getUpdateBeforeType(),r=e.getUpdateAfterType();t!==Tr.NONE&&this.updateBeforeNodes.push(e),r!==Tr.NONE&&this.updateAfterNodes.push(e)}}get currentNode(){return this.chaining[this.chaining.length-1]}isFilteredTexture(e){return e.magFilter===bs||e.magFilter===Rb||e.magFilter===a0||e.magFilter===hu||e.minFilter===bs||e.minFilter===Rb||e.minFilter===a0||e.minFilter===hu}getUniformBufferLimit(){return this.renderer.backend.capabilities.getUniformBufferLimit()}addChain(e){this.chaining.push(e)}removeChain(e){if(this.chaining.pop()!==e)throw new Error("THREE.NodeBuilder: Invalid node chaining!")}getMethod(e){return e}getTernary(){return null}getNodeFromHash(e){return this.hashNodes[e]}addFlow(e,t){return this.flowNodes[e].push(t),t}setContext(e){this.context=e}getContext(){return this.context}addContext(e){const t=this.getContext();return this.setContext({...this.context,...e}),t}getSharedContext(){const e={...this.context};return delete e.material,delete e.getUV,delete e.getOutput,delete e.getTextureLevel,delete e.getAO,delete e.getShadow,e}setCache(e){this.cache=e}getCache(){return this.cache}getCacheFromNode(e,t=!0){const r=this.getDataFromNode(e);return r.cache===void 0&&(r.cache=new jL(t?this.getCache():null)),r.cache}isAvailable(){return!1}getVertexIndex(){an("Abstract function.")}getInstanceIndex(){an("Abstract function.")}getDrawIndex(){an("Abstract function.")}getFrontFacing(){an("Abstract function.")}getFragCoord(){an("Abstract function.")}isFlipY(){return!1}isContextAssign(){return this.context.assign===!0}increaseUsage(e){const t=this.getDataFromNode(e);return t.usageCount=t.usageCount===void 0?1:t.usageCount+1,this.isContextAssign()?t.writeUsageCount=t.writeUsageCount===void 0?1:t.writeUsageCount+1:t.readUsageCount=t.readUsageCount===void 0?1:t.readUsageCount+1,t.usageCount}hasWriteUsage(e){const t=e.getShared(this),i=(t.isGlobal(this)?this.globalCache:this.cache).getData(t);
4315if(i!==void 0){for(const s in i)if(wme(i[s]))return!0}return!1}generateTexture(){an("Abstract function.")}generateTextureLod(){an("Abstract function.")}generateArrayDeclaration(e,t){return this.getType(e)+"[ "+t+" ]"}generateArray(e,t,r=null){let i=this.generateArrayDeclaration(e,t)+"( ";for(let s=0;s<t;s++){const a=r?r[s]:null;a!==null?i+=a.build(this,e):i+=this.generateConst(e),s<t-1&&(i+=", ")}return i+=" )",i}generateStruct(e,t,r=null){const i=[];for(const s of t){const{name:a,type:o}=s;r&&r[a]&&r[a].isNode?i.push(r[a].build(this,o)):i.push(this.generateConst(o))}return e+"( "+i.join(", ")+" )"}generateConst(e,t=null){if(t===null&&(e==="float"||e==="int"||e==="uint"?t=0:e==="bool"?t=!1:e==="color"?t=new tr:e==="vec2"||e==="uvec2"||e==="ivec2"?t=new Jt:e==="vec3"||e==="uvec3"||e==="ivec3"?t=new Ve:(e==="vec4"||e==="uvec4"||e==="ivec4")&&(t=new Rr)),e==="float")return iN(t);if(e==="int")return`${Math.round(t)}`;if(e==="uint")return t>=0?`${Math.round(t)}u`:"0u";if(e==="bool")return t?"true":"false";if(e==="color")return`${this.getType("vec3")}( ${iN(t.r)}, ${iN(t.g)}, ${iN(t.b)} )`;const r=this.getTypeLength(e),i=this.getComponentType(e),s=a=>this.generateConst(i,a);if(r===2)return`${this.getType(e)}( ${s(t.x)}, ${s(t.y)} )`;if(r===3)return`${this.getType(e)}( ${s(t.x)}, ${s(t.y)}, ${s(t.z)} )`;if(r===4&&e!=="mat2")return`${this.getType(e)}( ${s(t.x)}, ${s(t.y)}, ${s(t.z)}, ${s(t.w)} )`;if(r>=4&&t&&(t.isMatrix2||t.isMatrix3||t.isMatrix4))return`${this.getType(e)}( ${t.elements.map(s).join(", ")} )`;if(r>4)return`${this.getType(e)}()`;throw new Error(`THREE.NodeBuilder: Type '${e}' not found in generate constant attempt.`)}getType(e){return e==="color"?"vec3":e}hasGeometryAttribute(e){return this.geometry&&this.geometry.getAttribute(e)!==void 0}getAttribute(e,t){const r=this.attributes;for(const s of r)if(s.name===e)return s;const i=new LJ(e,t);return this.registerDeclaration(i),r.push(i),i}getPropertyName(e){return e.name}isVector(e){return/vec\d/.test(e)}isMatrix(e){return/mat\d/.test(e)}isReference(e){return e==="void"||e==="property"||e==="sampler"||e==="samplerComparison"||e==="texture"||e==="cubeTexture"||e==="storageTexture"||e==="depthTexture"||e==="texture3D"}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(e){const t=e.type;return e.isDepthTexture===!0?"float":t===oo?"int":t===ts?"uint":"float"}getElementType(e){return e==="mat2"?"vec2":e==="mat3"?"vec3":e==="mat4"?"vec4":this.getComponentType(e)}getComponentType(e){if(e=this.getVectorType(e),e==="float"||e==="bool"||e==="int"||e==="uint")return e;const t=/(b|i|u|)(vec|mat)([2-4])/.exec(e);return t===null?null:t[1]==="b"?"bool":t[1]==="i"?"int":t[1]==="u"?"uint":"float"}getVectorType(e){return e==="color"?"vec3":e==="texture"||e==="cubeTexture"||e==="storageTexture"||e==="texture3D"?"vec4":e}getTypeFromLength(e,t="float"){if(e===1)return t;let r=Gde(e);const i=t==="float"?"":t[0];return/mat2/.test(t)===!0&&(r=r.replace("vec","mat")),i+r}getTypeFromArray(e){return EQe.get(e.constructor)}isInteger(e){return/int|uint|(i|u)vec/.test(e)}getTypeFromAttribute(e){let t=e;e.isInterleavedBufferAttribute&&(t=e.data);const r=t.array,i=e.itemSize,s=e.normalized;let a;return!(e instanceof Wce)&&s!==!0&&(a=this.getTypeFromArray(r)),this.getTypeFromLength(i,a)}getTypeLength(e){const t=this.getVectorType(e),r=/vec([2-4])/.exec(t);return r!==null?Number(r[1]):t==="float"||t==="bool"||t==="int"||t==="uint"?1:/mat2/.test(e)===!0?4:/mat3/.test(e)===!0?9:/mat4/.test(e)===!0?16:0}getVectorFromMatrix(e){return e.replace("mat","vec")}changeComponentType(e,t){return this.getTypeFromLength(this.getTypeLength(e),t)}getIntegerType(e){const t=this.getComponentType(e);return t==="int"||t==="uint"?e:this.changeComponentType(e,"int")}setActiveStack(e){this.activeStacks.push(e)}removeActiveStack(e){if(this.activeStacks[this.activeStacks.length-1]===e)this.activeStacks.pop();else throw new Error("THREE.NodeBuilder: Invalid active stack removal.")}getActiveStack(){return this.activeStacks[this.activeStacks.length-1]}getBaseStack(){return this.activeStacks[0]}addStack(){this.stack=k6(this.stack);const e=Oz();return this.stacks.push(e),F5(this.stack),this.stack}removeStack(){const e=this.stack;for(const t of e.nodes){const r=this.getDataFromNode(t);r.stack=e}return this.stack=e.parent,F5(this.stacks.pop()),e}getDataFromNode(e,t=this.shaderStage,r=null){r=r===null?e.isGlobal(this)?this.globalCache:this.cache:r;let i=r.getData(e);i===void 0&&(i={},r.setData(e,i)),i[t]===void 0&&(i[t]={});let s=i[t];if(this.subBuildLayers.length===0)return s;const a=i.any?i.any.subBuilds:null,o=this.getClosestSubBuild(a);return o&&(s.subBuildsCache===void 0&&(s.subBuildsCache={}),s=s.subBuildsCache[o]||(s.subBuildsCache[o]={}),s.subBuilds=a),s}getNodeProperties(e,t="any"){const r=this.getDataFromNode(e,t);return r.properties||(r.properties={outputNode:null})}getBufferAttributeFromNode(e,t,r=null){const i=this.getDataFromNode(e,"vertex");let s=i.bufferAttribute;if(s===void 0){const a=this.uniforms.index++;r===null&&(r="nodeAttribute"+a),s=new LJ(r,t,e),this.bufferAttributes.push(s),i.bufferAttribute=s}return s}getStructTypeNode(e,t=this.shaderStage){return this.types[t][e]||null}getStructTypeFromNode(e,t,r=null,i=this.shaderStage){const s=this.getDataFromNode(e,i,this.globalCache);let a=s.structType;if(a===void 0){const o=this.structs.index++;r===null&&(r="StructType"+o),a=new oQe(r,t),this.structs[i].push(a),this.types[i][r]=e,s.structType=a}return a}getOutputStructTypeFromNode(e,t){const r=this.getStructTypeFromNode(e,t,"OutputType","fragment");return r.output=!0,r}getUniformFromNode(e,t,r=this.shaderStage,i=null){const s=this.getDataFromNode(e,r,this.globalCache);let a=s.uniform;if(a===void 0){const o=this.uniforms.index++;a=new rQe(i||"nodeUniform"+o,t,e),this.uniforms[r].push(a),this.registerDeclaration(a),s.uniform=a}return a}getVarFromNode(e,t=null,r=e.getNodeType(this),i=this.shaderStage,s=!1){const a=this.getDataFromNode(e,i),o=this.getSubBuildProperty("variable",a.subBuilds);let l=a[o];if(l===void 0){const u=s?"_const":"_var",d=this.vars[i]||(this.vars[i]=[]),h=this.vars[u]||(this.vars[u]=0);t===null&&(t=(s?"nodeConst":"nodeVar")+h,this.vars[u]++),o!=="variable"&&(t=this.getSubBuildProperty(t,a.subBuilds));const f=e.getArrayCount(this);l=new bme(t,r,s,f),s||d.push(l),this.registerDeclaration(l),a[o]=l}return l}isDeterministic(e){if(e.isMathNode)return this.isDeterministic(e.aNode)&&(e.bNode?this.isDeterministic(e.bNode):!0)&&(e.cNode?this.isDeterministic(e.cNode):!0);if(e.isOperatorNode)return this.isDeterministic(e.aNode)&&(e.bNode?this.isDeterministic(e.bNode):!0);if(e.isArrayNode){if(e.values!==null){for(const t of e.values)if(!this.isDeterministic(t))return!1}return!0}else if(e.isConstNode)return!0;return!1}getVaryingFromNode(e,t=null,r=e.getNodeType(this),i=null,s=null){const a=this.getDataFromNode(e,"any"),o=this.getSubBuildProperty("varying",a.subBuilds);let l=a[o];if(l===void 0){const u=this.varyings,d=u.length;t===null&&(t="nodeVarying"+d),o!=="varying"&&(t=this.getSubBuildProperty(t,a.subBuilds)),l=new iQe(t,r,i,s),u.push(l),this.registerDeclaration(l),a[o]=l}return l}registerDeclaration(e){const t=this.shaderStage,r=this.declarations[t]||(this.declarations[t]={}),i=e.name;let s=i,a=this.getPropertyName(e),o=1;for(;r[a]!==void 0;)s=i+"_"+o++,e.name=s,a=this.getPropertyName(e);s!==i&&an(`TSL: Declaration name '${i}' of '${e.type}' already in use. Renamed to '${s}'.`),r[a]=e}getCodeFromNode(e,t,r=this.shaderStage){const i=this.getDataFromNode(e);let s=i.code;if(s===void 0){const a=this.codes[r]||(this.codes[r]=[]),o=a.length;s=new sQe("nodeCode"+o,t),a.push(s),i.code=s}return s}addFlowCodeHierarchy(e,t){const{flowCodes:r,flowCodeBlock:i}=this.getDataFromNode(e);let s=!0,a=t;for(;a;){if(i.get(a)===!0){s=!1;break}a=this.getDataFromNode(a).parentNodeBlock}if(s)for(const o of r)this.addLineFlowCode(o)}addLineFlowCodeBlock(e,t,r){const i=this.getDataFromNode(e),s=i.flowCodes||(i.flowCodes=[]),a=i.flowCodeBlock||(i.flowCodeBlock=new WeakMap);s.push(t),a.set(r,!0)}addLineFlowCode(e,t=null){return e===""?this:(t!==null&&this.context.nodeBlock&&this.addLineFlowCodeBlock(t,e,this.context.nodeBlock),e=this.tab+e,/;\s*$/.test(e)||(e=e+`; 4316`),this.flow.code+=e,this)}addFlowCode(e){return this.flow.code+=e,this}addFlowTab(){return this.tab+=" ",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(e){return this.flowsData.get(e)}flowNode(e){const t=e.getNodeType(this),r=this.flowChildNode(e,t);return this.flowsData.set(e,r),r}addInclude(e){this.currentFunctionNode!==null&&this.currentFunctionNode.includes.push(e)}buildFunctionNode(e){const t=this.renderer.backend;let r=DJ.get(t);r===void 0&&(r=new WeakMap,DJ.set(t,r));let i=r.get(e);if(i===void 0){i=new W0e;const s=this.currentFunctionNode;this.currentFunctionNode=i,i.code=this.buildFunctionCode(e),this.currentFunctionNode=s,r.set(e,i)}return i}flowShaderNode(e){const t=e.layout,r={[Symbol.iterator](){let a=0;const o=Object.values(this);return{next:()=>({value:o[a],done:a++>=o.length})}}};
4316for(const a of t.inputs)r[a.name]=new T0e(a.type,a.name);e.layout=null;const i=e.call(r),s=this.flowStagesNode(i,t.type);return e.layout=t,s}flowBuildStage(e,t,r=null){const i=this.getBuildStage();this.setBuildStage(t);const s=e.build(this,r);return this.setBuildStage(i),s}flowStagesNode(e,t=null){const r=this.flow,i=this.vars,s=this.declarations,a=this.cache,o=this.buildStage,l=this.stack,u={code:""};this.flow=u,this.vars={},this.declarations={},this.cache=new jL,this.stack=k6();for(const d of _6)this.setBuildStage(d),u.result=e.build(this,t);return u.vars=this.getVars(this.shaderStage),this.flow=r,this.vars=i,this.declarations=s,this.cache=a,this.stack=l,this.setBuildStage(o),u}getFunctionOperator(){return null}buildFunctionCode(){an("Abstract function.")}flowChildNode(e,t=null){const r=this.flow,i={code:""};return this.flow=i,i.result=e.build(this,t),this.flow=r,i}flowNodeFromShaderStage(e,t,r=null,i=null){const s=this.tab,a=this.cache,o=this.shaderStage,l=this.context;this.setShaderStage(e);const u={...this.context};delete u.nodeBlock,this.cache=this.globalCache,this.tab=" ",this.context=u;let d=null;if(this.buildStage==="generate"){const h=this.flowChildNode(t,r);i!==null&&(h.code+=`${this.tab+i} = ${h.result}; 4317`),this.flowCode[e]=this.flowCode[e]+h.code,d=h}else d=t.build(this);return this.setShaderStage(o),this.cache=a,this.tab=s,this.context=l,d}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){an("Abstract function.")}getVaryings(){an("Abstract function.")}getVar(e,t,r=null){return`${r!==null?this.generateArrayDeclaration(e,r):this.getType(e)} ${t}`}getVars(e,t=!1){const r=[],i=this.vars[e];if(i!==void 0)for(const s of i)r.push(`${this.getVar(s.type,s.name,s.count)};`);return r.join(t?` 4318`:` 4319 `)}getUniforms(){an("Abstract function.")}getCodes(e){const t=this.codes[e];let r="";if(t!==void 0)for(const i of t)r+=i.code+` 4320`;return r}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(e){this.shaderStage=e}getShaderStage(){return this.shaderStage}setBuildStage(e){this.buildStage=e}getBuildStage(){return this.buildStage}buildCode(){an("Abstract function.")}get subBuild(){return this.subBuildLayers[this.subBuildLayers.length-1]||null}addSubBuild(e){this.subBuildLayers.push(e)}removeSubBuild(){return this.subBuildLayers.pop()}getClosestSubBuild(e){let t;if(e&&e.isNode?e.isShaderCallNodeInternal?t=e.shaderNode.subBuilds:e.isStackNode?t=[e.subBuild]:t=this.getDataFromNode(e,"any").subBuilds:e instanceof Set?t=[...e]:t=e,!t)return null;const r=this.subBuildLayers;for(let i=t.length-1;i>=0;i--){const s=t[i];if(r.includes(s))return s}return null}getSubBuildOutput(e){return this.getSubBuildProperty("outputNode",e)}getSubBuildProperty(e="",t=null){let r;t!==null?r=this.getClosestSubBuild(t):r=this.subBuildFn;let i;return r?i=e?r+"_"+e:r:i=e,i}prebuild(){const{object:e,renderer:t,material:r}=this;if(t.contextNode.isContextNode===!0?this.context={...this.context,...t.contextNode.getFlowContextData()}:sn('NodeBuilder: "renderer.contextNode" must be an instance of `context()`.'),r&&r.contextNode&&(r.contextNode.isContextNode===!0?this.context={...this.context,...r.contextNode.getFlowContextData()}:sn('NodeBuilder: "material.contextNode" must be an instance of `context()`.')),r!==null){let i=t.library.fromMaterial(r);i===null&&(sn(`NodeBuilder: Material "${r.type}" is not compatible.`),i=new Va),i.build(this)}else this.addFlow("compute",e)}build(){this.prebuild();for(const e of _6){this.setBuildStage(e),this.context.position&&this.context.position.isNode&&this.flowNodeFromShaderStage("vertex",this.context.position);for(const t of S6){this.setShaderStage(t);const r=this.flowNodes[t];for(const i of r)e==="generate"?this.flowNode(i):i.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}async buildAsync(){this.prebuild();for(const e of _6){this.setBuildStage(e),this.context.position&&this.context.position.isNode&&this.flowNodeFromShaderStage("vertex",this.context.position);for(const t of S6){this.setShaderStage(t);const r=this.flowNodes[t];for(const i of r)e==="generate"?this.flowNode(i):i.build(this);await $ce()}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUp
4320dateNodes(),this}getSharedDataFromNode(e){let t=TQe.get(e);return t===void 0&&(t={}),t}getNodeUniform(e,t){const r=this.getSharedDataFromNode(e);let i=r.cache;if(i===void 0){if(t==="float"||t==="int"||t==="uint")i=new gQe(e);else if(t==="vec2"||t==="ivec2"||t==="uvec2")i=new AQe(e);else if(t==="vec3"||t==="ivec3"||t==="uvec3")i=new xQe(e);else if(t==="vec4"||t==="ivec4"||t==="uvec4")i=new vQe(e);else if(t==="color")i=new yQe(e);else if(t==="mat2")i=new bQe(e);else if(t==="mat3")i=new wQe(e);else if(t==="mat4")i=new _Qe(e);else throw new Error(`THREE.NodeBuilder: Uniform "${t}" not implemented.`);r.cache=i}return i}format(e,t,r){if(t=this.getVectorType(t),r=this.getVectorType(r),t===r||r===null||this.isReference(r))return e;const i=this.getTypeLength(t),s=this.getTypeLength(r);return i===16&&s===9?`${this.getType(r)}( ${e}[ 0 ].xyz, ${e}[ 1 ].xyz, ${e}[ 2 ].xyz )`:i===9&&s===4?`${this.getType(r)}( ${e}[ 0 ].xy, ${e}[ 1 ].xy )`:i>4||s>4||s===0?e:i===s?`${this.getType(r)}( ${e} )`:i>s?(e=r==="bool"?`all( ${e} )`:`${e}.${"xyz".slice(0,s)}`,this.format(e,this.getTypeFromLength(s,this.getComponentType(t)),r)):s===4&&i>1?`${this.getType(r)}( ${this.format(e,t,"vec3")}, 1.0 )`:i===2?`${this.getType(r)}( ${this.format(e,t,"vec2")}, 0.0 )`:(i===1&&s>1&&t!==this.getComponentType(r)&&(e=`${this.getType(this.getComponentType(r))}( ${e} )`),`${this.getType(r)}( ${e} )`)}getSignature(){return`// Three.js r${yy} - Node System 4321`}needsPreviousData(){const e=this.renderer.getMRT();return e&&e.has("velocity")||$de(this.object).useVelocity===!0}}class jJ{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let r=e.get(t);return r===void 0&&(r={renderId:0,frameId:0},e.set(t,r)),r}updateBeforeNode(e){const t=e.getUpdateBeforeType(),r=e.updateReference(this);if(t===Tr.FRAME){const i=this._getMaps(this.updateBeforeMap,r);if(i.frameId!==this.frameId){const s=i.frameId;i.frameId=this.frameId,e.updateBefore(this)===!1&&(i.frameId=s)}}else if(t===Tr.RENDER){const i=this._getMaps(this.updateBeforeMap,r);if(i.renderId!==this.renderId){const s=i.renderId;i.renderId=this.renderId,e.updateBefore(this)===!1&&(i.renderId=s)}}else t===Tr.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),r=e.updateReference(this);if(t===Tr.FRAME){const i=this._getMaps(this.updateAfterMap,r);i.frameId!==this.frameId&&e.updateAfter(this)!==!1&&(i.frameId=this.frameId)}else if(t===Tr.RENDER){const i=this._getMaps(this.updateAfterMap,r);i.renderId!==this.renderId&&e.updateAfter(this)!==!1&&(i.renderId=this.renderId)}else t===Tr.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),r=e.updateReference(this);if(t===Tr.FRAME){const i=this._getMaps(this.updateMap,r);i.frameId!==this.frameId&&e.update(this)!==!1&&(i.frameId=this.frameId)}else if(t===Tr.RENDER){const i=this._getMaps(this.updateMap,r);i.renderId!==this.renderId&&e.update(this)!==!1&&(i.renderId=this.renderId)}else t===Tr.OBJECT&&e.update(this)}update(){this.frameId++,this.lastTime===void 0&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class hq{constructor(e,t,r=null,i="",s=!1){this.type=e,this.name=t,this.count=r,this.qualifier=i,this.isConst=s}}hq.isNodeFunctionInput=!0;class CQe extends Ry{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class NQe extends Ry{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setupDirect(){const e=this.colorNode;return{lightDirection:aq(this.light),lightColor:e}}}class MQe extends Ry{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=iq(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=Qn(new tr).setGroup(lr)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:r,lightDirectionNode:i}=this,a=K1.dot(i).mul(.5).add(.5),o=ui(r,t,a);
4321e.context.irradiance.addAssign(o)}}class fq extends Ry{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=Qn(0).setGroup(lr),this.penumbraCosNode=Qn(0).setGroup(lr),this.cutoffDistanceNode=Qn(0).setGroup(lr),this.decayExponentNode=Qn(0).setGroup(lr),this.colorNode=Qn(this.color).setGroup(lr)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e,t){const{coneCosNode:r,penumbraCosNode:i}=this;return rh(r,i,t)}getLightCoord(e){const t=e.getNodeProperties(this);let r=t.projectionUV;return r===void 0&&(r=K0e(this.light,e.context.positionWorld),t.projectionUV=r),r}setupDirect(e){const{colorNode:t,cutoffDistanceNode:r,decayExponentNode:i,light:s}=this,a=this.getLightVector(e),o=a.normalize(),l=o.dot(aq(s)),u=this.getSpotAttenuation(e,l),d=a.length(),h=cq({lightDistance:d,cutoffDistance:r,decayExponent:i});let f=t.mul(u).mul(h),p,g;return s.colorNode?(g=this.getLightCoord(e),p=s.colorNode(g)):s.map&&(g=this.getLightCoord(e),p=Pi(s.map,g.xy).onRenderUpdate(()=>s.map)),p&&(f=g.mul(2).sub(1).abs().lessThan(1).all().select(f.mul(p),f)),{lightColor:f,lightDirection:o}}}class kQe extends fq{static get type(){return"IESSpotLightNode"}constructor(e=null){super(e),this._iesTextureNode=null}getSpotAttenuation(e,t){const r=this.light.iesMap;let i=null;if(r&&r.isTexture===!0){const s=t.acos().mul(1/Math.PI);this._iesTextureNode=Pi(r,Cn(s,0),0),i=this._iesTextureNode.r}else i=super.getSpotAttenuation(e,t);return i}update(e){super.update(e),this._iesTextureNode!==null&&this.light.iesMap&&(this._iesTextureNode.value=this.light.iesMap)}}class RQe extends Ry{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let r=0;r<9;r++)t.push(new Ve);this.lightProbe=Dl(t)}update(e){const{light:t}=this;super.update(e);for(let r=0;r<9;r++)this.lightProbe.array[r].copy(t.sh.coefficients[r]).multiplyScalar(t.intensity)}setup(e){const t=yme(K1,this.lightProbe);e.context.irradiance.addAssign(t)}}const PQe=ut(([n,e])=>{const t=n.abs().sub(e);return w0(Na(t,0)).add(td(Na(t.x,t.y),0))});class LQe extends fq{static get type(){return"ProjectorLightNode"}update(e){super.update(e);const t=this.light;if(this.penumbraCosNode.value=Math.min(Math.cos(t.angle*(1-t.penumbra)),.99999),t.aspect===null){let r=1;t.map!==null&&(r=t.map.width/t.map.height),t.shadow.aspect=r}else t.shadow.aspect=t.aspect}getSpotAttenuation(e){const t=Ie(0),r=this.penumbraCosNode,i=OR(this.light).mul(e.context.positionWorld||_0);return nr(i.w.greaterThan(0),()=>{const s=i.xyz.div(i.w),a=PQe(s.xy.sub(Cn(.5)),Cn(.5)),o=nh(-1,Ei(1,Wz(r)).sub(1));t.assign(gR(a.mul(-2).mul(o)))}),t}}const IL=new kr,sN=new kr;let H3=null;class OQe extends Ry{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=Qn(new Ve).setGroup(lr),this.halfWidth=Qn(new Ve).setGroup(lr),this.updateType=Tr.RENDER}update(e){super.update(e);const{light:t}=this,r=e.camera.matrixWorldInverse;sN.identity(),IL.copy(t.matrixWorld),IL.premultiply(r),sN.extractRotation(IL),this.halfWidth.value.set(t.width*.5,0,0),this.halfHeight.value.set(0,t.height*.5,0),this.halfWidth.value.applyMatrix4(sN),this.halfHeight.value.applyMatrix4(sN)}setupDirectRectArea(e){let t,r;e.isAvailable("float32Filterable")?(t=Pi(H3.LTC_FLOAT_1),r=Pi(H3.LTC_FLOAT_2)):(t=Pi(H3.LTC_HALF_1),r=Pi(H3.LTC_HALF_2));const{colorNode:i,light:s}=this,a=sq(s);return{lightColor:i,lightPosition:a,halfWidth:this.halfWidth,halfHeight:this.halfHeight,ltc_1:t,ltc_2:r}}static setLTC(e){H3=e}}class Sme{parseFunction(){an("Abstract function.")}}class pq{constructor(e,t,r="",i=""){this.type=e,this.inputs=t,this.name=r,this.precision=i}getCode(){an("Abstract function.")}}pq.isNodeFunction=!0;const DQe=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,jQe=/[a-z_0-9]+/ig,IJ="#pragma main",IQe=n=>{n=n.trim();const e=n.indexOf(IJ),t=e!==-1?n.slice(e+IJ.length):n,r=t.match(DQe);if(r!==null&&r.length===5){const i=r[4],s=[];let a=null;for(;(a=jQe.exec(i))!==null;)s.push(a);const o=[];let l=0;for(;l<s.length;){const g=s[l][0]==="const";g===!0&&l++;let A=s[l][0];A==="in"||A==="out"||A==="inout"?l++:A="";
4321const x=s[l++][0];let b=Number.parseInt(s[l][0]);Number.isNaN(b)===!1?l++:b=null;const _=s[l++][0];o.push(new hq(x,_,b,A,g))}const u=t.substring(r[0].length),d=r[3]!==void 0?r[3]:"",h=r[2],f=r[1]!==void 0?r[1]:"",p=e!==-1?n.slice(0,e):"";return{type:h,inputs:o,name:d,precision:f,inputsCode:i,blockCode:u,headerCode:p}}else throw new Error("THREE.FunctionNode: Function is not a GLSL code.")};class FQe extends pq{constructor(e){const{type:t,inputs:r,name:i,precision:s,inputsCode:a,blockCode:o,headerCode:l}=IQe(e);super(t,r,i,s),this.inputsCode=a,this.blockCode=o,this.headerCode=l}getCode(e=this.name){let t;const r=this.blockCode;if(r!==""){const{type:i,inputsCode:s,headerCode:a,precision:o}=this;let l=`${i} ${e} ( ${s.trim()} )`;o!==""&&(l=`${o} ${l}`),t=a+l+r}else t="";return t}}class UQe extends Sme{parseFunction(e){return new FQe(e)}}const wh=[],vm=[],FJ=Qn(0,"int").setGroup(lr);class BQe extends Z1{constructor(e,t){super(),this.renderer=e,this.backend=t,this.nodeFrame=new jJ,this.nodeBuilderCache=new Map,this.callHashCache=new L1,this.groupsData=new L1,this._buildQueue=[],this._buildInProgress=!1,this.cacheLib={}}updateGroup(e){const t=e.groupNode;if(t.updateType===Tr.OBJECT)return!0;wh[0]=t,wh[1]=e;let r=this.groupsData.get(wh);return r===void 0&&this.groupsData.set(wh,r={}),wh[0]=null,wh[1]=null,r.version!==t.version?(r.version=t.version,!0):!1}getForRenderCacheKey(e){return e.initialCacheKey}_createNodeBuilder(e,t){const r=this.backend.createNodeBuilder(e.object,this.renderer);return r.scene=e.scene,r.material=t,r.camera=e.camera,r.context.material=t,r.lightsNode=e.lightsNode,r.environmentNode=this.getEnvironmentNode(e.scene),r.fogNode=this.getFogNode(e.scene),r.clippingContext=e.clippingContext,this.renderer.getOutputRenderTarget()&&this.renderer.getOutputRenderTarget().multiview&&r.enableMultiview(),r}getForRender(e,t=!1){const r=this.get(e);let i=r.nodeBuilderState;if(i===void 0){const{nodeBuilderCache:s}=this,a=this.getForRenderCacheKey(e);if(i=s.get(a),i===void 0){const o=async()=>{let l=this._createNodeBuilder(e,e.material);try{t?await l.buildAsync():l.build()}catch(u){l=this._createNodeBuilder(e,new Va),t?await l.buildAsync():l.build(),sn("TSL: "+u)}return l};if(t)return o().then(l=>(i=this._createNodeBuilderState(l),s.set(a,i),i.usedTimes++,r.nodeBuilderState=i,i));{let l=this._createNodeBuilder(e,e.material);try{l.build()}catch(u){l=this._createNodeBuilder(e,new Va),l.build();let d=u.stackTrace;!d&&u.stack&&(d=new ho(u.stack)),sn("TSL: "+u,d)}i=this._createNodeBuilderState(l),s.set(a,i)}}i.usedTimes++,r.nodeBuilderState=i}return i}getForRenderAsync(e){const t=this.getForRender(e,!0);return t.then?t:Promise.resolve(t)}getForRenderDeferred(e){const t=this.get(e);if(t.nodeBuilderState!==void 0)return t.nodeBuilderState;const r=this.getForRenderCacheKey(e),i=this.nodeBuilderCache.get(r);return i!==void 0?(i.usedTimes++,t.nodeBuilderState=i,i):(t.pendingBuild!==!0&&(t.pendingBuild=!0,this._buildQueue.push(()=>this.getForRenderAsync(e).then(()=>{t.pendingBuild=!1})),this._processBuildQueue()),null)}_processBuildQueue(){if(this._buildInProgress||this._buildQueue.length===0)return;this._buildInProgress=!0,this._buildQueue.shift()().then(()=>{this._buildInProgress=!1,this._processBuildQueue()})}delete(e){if(e.isRenderObject){const t=this.get(e).nodeBuilderState;t!==void 0&&(t.usedTimes--,t.usedTimes===0&&this.nodeBuilderCache.delete(this.getForRenderCacheKey(e)))}return super.delete(e)}getForCompute(e){const t=this.get(e);let r=t.nodeBuilderState;if(r===void 0||t.version!==e.version){const i=this.backend.createNodeBuilder(e,this.renderer);i.build(),r=this._createNodeBuilderState(i),t.nodeBuilderState=r,t.version=e.version}return r}_createNodeBuilderState(e){return new nQe(e.vertexShader,e.fragmentShader,e.computeShader,e.getAttributesArray(),e.getBindings(),e.updateNodes,e.updateBeforeNodes,e.updateAfterNodes,e.observer,e.hardwareClipping,e.transforms)}getEnvironmentNode(e){if(this.renderer.lighting.enabled===!1)return null;this.updateEnvironment(e);let t=null;if(e.environmentNode&&e.environmentNode.isNode)t=e.environmentNode;else{const r=this.get(e);r.environmentNode&&(t=r.environmentNode)}return t}
4321getBackgroundNode(e){this.updateBackground(e);let t=null;if(e.backgroundNode&&e.backgroundNode.isNode)t=e.backgroundNode;else{const r=this.get(e);r.backgroundNode&&(t=r.backgroundNode)}return t}getFogNode(e){return this.updateFog(e),e.fogNode||this.get(e).fogNode||null}getCacheKey(e,t){wh[0]=e,wh[1]=t;const r=this.renderer.info.calls,i=this.callHashCache.get(wh)||{};if(i.callId!==r){if(vm.push(this.renderer.getOutputRenderTarget()&&this.renderer.getOutputRenderTarget().multiview?1:0),vm.push(this.renderer.lighting.enabled?1:0),this.renderer.lighting.enabled){vm.push(t.getCacheKey(!0)),vm.push(this.renderer.shadowMap.enabled?1:0),vm.push(this.renderer.shadowMap.type);const a=this.getEnvironmentNode(e);a&&vm.push(a.getCacheKey())}const s=this.getFogNode(e);s&&vm.push(s.getCacheKey()),i.callId=r,i.cacheKey=kT(vm),this.callHashCache.set(wh,i),vm.length=0}return wh[0]=null,wh[1]=null,i.cacheKey}get isToneMappingState(){return!this.renderer.getRenderTarget()}updateBackground(e){const t=this.get(e),r=e.background;if(r){const i=e.backgroundBlurriness===0&&t.backgroundBlurriness>0||e.backgroundBlurriness>0&&t.backgroundBlurriness===0;if(t.background!==r||i){const s=this.getCacheNode("background",r,()=>{if(r.isCubeTexture===!0||r.mapping===Mb||r.mapping===kb||r.mapping===E1){if(e.backgroundBlurriness>0||r.mapping===E1)return WG(r);{let a;return r.isCubeTexture===!0?a=du(r):a=Pi(r),t0e(a)}}else{if(r.isTexture===!0)return Pi(r,Yf.flipY()).setUpdateMatrix(!0);r.isColor!==!0&&sn("WebGPUNodes: Unsupported background configuration.",r)}},i);t.backgroundNode=s,t.background=r,t.backgroundBlurriness=e.backgroundBlurriness}}else t.backgroundNode&&(delete t.backgroundNode,delete t.background)}getCacheNode(e,t,r,i=!1){const s=this.cacheLib[e]||(this.cacheLib[e]=new WeakMap);let a=s.get(t);return(a===void 0||i)&&(a=r(),s.set(t,a)),a}updateFog(e){const t=this.get(e),r=e.fog;if(r){if(t.fog!==r){const i=this.getCacheNode("fog",r,()=>{if(r.isFogExp2){const s=Ws("color","color",r).setGroup(lr),a=Ws("density","float",r).setGroup(lr);return iU(s,Q0e(a))}else if(r.isFog){const s=Ws("color","color",r).setGroup(lr),a=Ws("near","float",r).setGroup(lr),o=Ws("far","float",r).setGroup(lr);return iU(s,Y0e(a,o))}else sn("Renderer: Unsupported fog configuration.",r)});t.fogNode=i,t.fog=r}}else delete t.fogNode,delete t.fog}updateEnvironment(e){const t=this.get(e),r=e.environment;if(r){if(t.environment!==r){const i=this.getCacheNode("environment",r,()=>{if(r.isCubeTexture===!0)return du(r);if(r.isTexture===!0)return Pi(r);sn("Nodes: Unsupported environment configuration.",r)});t.environmentNode=i,t.environment=r}}else t.environmentNode&&(delete t.environmentNode,delete t.environment)}getNodeFrame(e=this.renderer,t=null,r=null,i=null,s=null){const a=this.nodeFrame;return a.renderer=e,a.scene=t,a.object=r,a.camera=i,a.material=s,a}getNodeFrameForRender(e){return this.getNodeFrame(e.renderer,e.scene,e.object,e.camera,e.material)}getOutputCacheKey(){const e=this.renderer;return e.toneMapping+","+e.currentColorSpace+","+e.xr.isPresenting}getOutputNode(e){const t=this.renderer;let r;return e.isArrayTexture?this.backend.isWebGLBackend?r=Pi(e,Yf).depth(mg("gl_ViewID_OVR")).renderOutput(t.toneMapping,t.currentColorSpace):r=Pi(e,Yf).depth(FJ).renderOutput(t.toneMapping,t.currentColorSpace):r=Pi(e,Yf).renderOutput(t.toneMapping,t.currentColorSpace),r}setOutputLayerIndex(e){FJ.value=e}updateBefore(e){const t=e.getNodeBuilderState();for(const r of t.updateBeforeNodes)this.getNodeFrameForRender(e).updateBeforeNode(r)}updateAfter(e){const t=e.getNodeBuilderState();for(const r of t.updateAfterNodes)this.getNodeFrameForRender(e).updateAfterNode(r)}updateForCompute(e){const t=this.getNodeFrame(),r=this.getForCompute(e);for(const i of r.updateNodes)t.updateNode(i)}updateForRender(e){const t=this.getNodeFrameForRender(e),r=e.getNodeBuilderState();for(const i of r.updateNodes)t.updateNode(i)}needsRefresh(e){const t=this.getNodeFrameForRender(e);return e.getMonitor().needsRefresh(e,t)}dispose(){super.dispose(),this.nodeFrame=new jJ,this.nodeBuilderCache=new Map,this.cacheLib={}}}const FL=new Xp;class zk{constructor(e=null){this.version=0,this.clipIntersection=null,this.cacheKey="",this.shadowPass=!1,this.viewMatrix=new kr,this.viewNormalMatrix=new Gr,this.clippingGroupContexts=new WeakMap,this.intersectionPlanes=[],this.unionPlanes=[],this.parentVersion=null,e!==null&&(this.viewMatrix=e.viewMatrix,this.viewNormalMatrix=e.viewNormalMatrix,this.clippingGroupContexts=e.clippingGroupContexts,this.shadowPass=e.shadowPass)}projectPlanes(e,t,r){const i=e.length;for(let s=0;s<i;s++){FL.copy(e[s]).applyMatrix4(this.viewMatrix,this.viewNormalMatrix);const a=t[r+s],o=FL.normal;a.x=-o.x,a.y=-o.y,a.z=-o.z,a.w=FL.constant}}updateGlobal(e,t){this.shadowPass=e.overrideMaterial!==null&&e.overrideMaterial.isShadowPassMaterial,this.viewMatrix.copy(t.matrixWorldInverse),this.viewNormalMatrix.getNormalMatrix(this.viewMatrix)}update(e,t){let r=!1;e.version!==this.parentVersion&&(this.intersectionPlanes=Array.from(e.intersectionPlanes),this.unionPlanes=Array.from(e.unionPlanes),this.parentVersion=e.version),this.clipIntersection!==t.clipIntersection&&(this.clipIntersection=t.clipIntersection,this.clipIntersection?this.unionPlanes.length=e.unionPlanes.length:this.intersectionPlanes.length=e.intersectionPlanes.length);const i=t.clippingPlanes,s=i.length;let a,o;if(this.clipIntersection?(a=this.intersectionPlanes,o=e.intersectionPlanes.length):(a=this.unionPlanes,o=e.unionPlanes.length),a.length!==o+s){a.length=o+s;for(let l=0;l<s;l++)a[o+l]=new Rr;
4321r=!0}this.projectPlanes(i,a,o),r&&(this.version++,this.cacheKey=`${this.intersectionPlanes.length}:${this.unionPlanes.length}`)}getGroupContext(e){if(this.shadowPass&&!e.clipShadows)return this;let t=this.clippingGroupContexts.get(e);return t===void 0&&(t=new zk(this),this.clippingGroupContexts.set(e,t)),t.update(this,e),t}get unionClippingCount(){return this.unionPlanes.length}}class VQe{constructor(e,t,r){this.bundleGroup=e,this.camera=t,this.renderContext=r}}const sA=[];class zQe{constructor(){this.bundles=new L1}get(e,t,r){const i=this.bundles;sA[0]=e,sA[1]=t,sA[2]=r;let s=i.get(sA);return s===void 0&&(s=new VQe(e,t,r),i.set(sA,s)),sA[0]=null,sA[1]=null,sA[2]=null,s}dispose(){this.bundles=new L1}}class Tme{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const r=this.getMaterialNodeClass(e.type);if(r!==null){t=new r;for(const i in e)t[i]=e[i]}return t}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,r){if(r.has(t)){an(`Redefinition of node ${t}`);return}if(typeof e!="function")throw new Error(`THREE.NodeLibrary: Node class ${e.name} is not a class.`);if(typeof t=="function"||typeof t=="object")throw new Error(`THREE.NodeLibrary: Base class ${t} is not a class.`);r.set(t,e)}addClass(e,t,r){if(r.has(t)){an(`Redefinition of node ${t.name}`);return}if(typeof e!="function")throw new Error(`THREE.NodeLibrary: Node class ${e.name} is not a class.`);if(typeof t!="function")throw new Error(`THREE.NodeLibrary: Base class ${t.name} is not a class.`);r.set(t,e)}}const GQe=new oq,UJ=new WeakMap;class qQe{constructor(){this.enabled=!0,this._cache=[]}createNode(e=[]){return new oq().setLights(e)}getNode(e){if(e.isScene!==!0&&e.isGroup!==!0)return GQe;let t=UJ.get(e);return t===void 0&&(t=this.createNode(),UJ.set(e,t)),t}beginRender(e){this._cache.push(this.getNode(e).getLights())}finishRender(e){this.getNode(e).setLights(this._cache.pop())}}class US extends cp{constructor(e=1,t=1,r={}){super(e,t,r),this.isXRRenderTarget=!0,this._hasExternalTextures=!1,this._autoAllocateDepthBuffer=!0,this._isOpaqueFramebuffer=!1}copy(e){return super.copy(e),this._hasExternalTextures=e._hasExternalTextures,this._autoAllocateDepthBuffer=e._autoAllocateDepthBuffer,this._isOpaqueFramebuffer=e._isOpaqueFramebuffer,this}}const BJ=new Ve,VJ=new Ve,zJ=new WeakMap;class $Qe extends ef{constructor(e,t=!1){super(),this.enabled=!1,this.isPresenting=!1,this.cameraAutoUpdate=!0,this._renderer=e,this._cameraL=new ul,this._cameraL.viewport=new Rr,this._cameraL.matrixWorldAutoUpdate=!1,this._cameraR=new ul,this._cameraR.viewport=new Rr,this._cameraR.matrixWorldAutoUpdate=!1,this._cameras=[this._cameraL,this._cameraR],this._cameraXR=new pue,this._currentDepthNear=null,this._currentDepthFar=null,this._controllers=[],this._controllerInputSources=[],this._xrRenderTarget=null,this._layers=[],this._sessionUsesLayers=!1,this._supportsGlBinding=typeof XRWebGLBinding<"u",this._supportsWebGPUBinding=typeof globalThis.XRGPUBinding<"u",this._createXRLayer=KQe.bind(this),this._gl=null,this._currentAnimationContext=null,this._currentAnimationLoop=null,this._currentPixelRatio=null,this._currentSamples=null,this._currentSize=new Jt,this._onSessionEvent=XQe.bind(this),this._onSessionEnd=YQe.bind(this),this._onInputSourcesChange=QQe.bind(this),this._onAnimationFrame=ZQe.bind(this),this._referenceSpace=null,this._referenceSpaceType="local-floor",this._customReferenceSpace=null,this._framebufferScaleFactor=1,this._foveation=1,this._session=null,this._glBaseLayer=null,this._glBinding=null,this._webgpuBinding=null,this._glProjLayer=null,this._xrFrame=null,this._supportsLayers=this._supportsGlBinding&&"createProjectionLayer"in XRWebGLBinding.prototype,this._useMultiviewIfPossible=t,this._useMultiview=!1}getController(e){return this._getController(e).getTargetRaySpace()}getControllerGrip(e){return this._getController(e).getGripSpace()}getHand(e){return this._getController(e).getHandSpace()}getFoveation(){return this._foveation}setFoveation(e){this._foveation=e,this._glProjLayer!==null&&(this._glProjLayer.fixedFoveation=e),this._glBaseLayer!==null&&this._glBaseLayer.fixedFoveation!==void 0&&(this._glBaseLayer.fixedFoveation=e)}getFramebufferScaleFactor(){return this._framebufferScaleFactor}setFramebufferScaleFactor(e){this._framebufferScaleFactor=e,this.isPresenting===!0&&an("XRManager: Cannot change framebuffer scale while presenting.")}getReferenceSpaceType(){return this._referenceSpaceType}setReferenceSpaceType(e){this._referenceSpaceType=e,this.isPresenting===!0&&an("XRManager: Cannot change reference space type while presenting.")}getReferenceSpace(){return this._customReferenceSpace||this._referenceSpace}setReferenceSpace(e){this._customReferenceSpace=e}getCamera(){return this._cameraXR}getEnvironmentBlendMode(){if(this._session!==null)return this._session.environmentBlendMode}getBaseLayer(){return this._glProjLayer!==null?this._glProjLayer:this._glBaseLayer}getBinding(){return this._glBinding===null&&this._supportsGlBinding&&(this._glBinding=new XRWebGLBinding(this._session,this._gl)),this._glBinding}foveateBoundTexture(e){if(e.isPostProcessingRenderTarget!==!0||this.isPresenting!==!0||this._glProjLayer===null)return;const t=this._renderer.backend;if(t===void 0||t.isWebGLBackend!==!0||t.state===null)return;
4321const r=this._renderer.getOutputRenderTarget();if(r===null||r.isXRRenderTarget!==!0)return;const i=this.getBinding();if(i===null||typeof i.foveateBoundTexture!="function")return;this._renderer._textures.updateRenderTarget(e);const{textureGPU:s,glTextureType:a}=t.get(e.texture);if(!(s===void 0||a===void 0)&&e._xrFoveationTextureGPU!==s){e._xrFoveationTextureGPU=s,t.state.bindTexture(a,s);try{i.foveateBoundTexture(a,this.getFoveation())}catch(o){_i(`XRManager: Unable to foveate bound XR post-processing texture. ${o.name}: ${o.message}`)}finally{t.state.unbindTexture()}}}getWebGPUBinding(){return this._webgpuBinding===null&&this._supportsWebGPUBinding&&(this._webgpuBinding=new globalThis.XRGPUBinding(this._session,this._renderer.backend.device)),this._webgpuBinding}_isWebGPUSession(){return this._renderer.backend.isWebGPUBackend===!0&&this._session!==null&&this._session.enabledFeatures.includes("webgpu")}_validateWebGPUSession(){const e=this._renderer;if(e.backend.isWebGPUBackend===!0){if(this._session.enabledFeatures.includes("webgpu")===!1)throw new Error('THREE.XRManager: WebGPU XR sessions require the "webgpu" session feature. Use VRButtonGPU/XRButton with "webgpu" enabled or use a WebGL backend.');e.samples>0&&(_i("THREE.XRManager: WebGPU XR does not support MSAA yet. Disabling MSAA for this XR session."),this._currentSamples===null&&(this._currentSamples=e.samples),e._samples=0)}}async _initWebGPUSession(e){const t=this.getWebGPUBinding(),r=t.createProjectionLayer({colorFormat:t.getPreferredColorFormat(),depthStencilFormat:"depth24plus"});this._glProjLayer=r,e.updateRenderState({layers:[r]}),this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType()),this._xrRenderTarget=new cp(r.textureWidth,r.textureHeight,{depth:2,minFilter:bs,magFilter:bs,depthBuffer:!0,multiview:!1,useArrayDepthTexture:!0,samples:0}),this._xrRenderTarget.texture.isArrayTexture=!0,this._useMultiviewIfPossible===!0&&_i("THREE.XRManager: WebGPU XR does not support multiview yet. Disabling multiview for this XR session."),this._useMultiview=!1}
4321_disposeWebGPUSession(){const e=this._renderer,t=this._xrRenderTarget;if(t===null||e.backend.isWebGPUBackend!==!0)return;const r=e.backend,i=e._textures,s=r.get?r.get(t):null;s&&(s.descriptors=void 0);const a=o=>{o!=null&&(r.delete&&r.delete(o),i.delete&&i.delete(o))};for(let o=0;o<t.textures.length;o++)a(t.textures[o]);a(t.depthTexture),a(t),e._renderContexts&&e._renderContexts.dispose&&e._renderContexts.dispose(),t.dispose()}_getWebGPUViewData(e){const t=this.getWebGPUBinding(),r={colorTexture:null,viewDescriptors:[],viewports:[]};for(let i=0;i<e.length;i++){const s=t.getViewSubImage(this._glProjLayer,e[i]);r.colorTexture===null&&(r.colorTexture=s.colorTexture),r.viewports.push(s.viewport),s.getViewDescriptor&&r.viewDescriptors.push(s.getViewDescriptor())}return r}getFrame(){return this._xrFrame}useMultiview(){return this._useMultiview}createQuadLayer(e,t,r,i,s,a,o,l={}){const u=new ET(e,t),d=new US(s,a,{format:to,type:Zs,depthTexture:new Bl(s,a,l.stencil?Ku:ts,void 0,void 0,void 0,void 0,void 0,void 0,l.stencil?vc:ml),stencilBuffer:l.stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1});d._autoAllocateDepthBuffer=!0;const h=new Lh({color:16777215,side:mu});h.map=d.texture,h.map.offset.y=1,h.map.repeat.y=-1;const f=new ns(u,h);f.position.copy(r),f.quaternion.copy(i);const p={type:"quad",width:e,height:t,translation:r,quaternion:i,pixelwidth:s,pixelheight:a,plane:f,material:h,rendercall:o,renderTarget:d};if(this._layers.push(p),this._session!==null){p.plane.material=new Lh({color:16777215,side:mu}),p.plane.material.blending=Dv,p.plane.material.blendEquation=Ol,p.plane.material.blendSrc=Mm,p.plane.material.blendDst=Mm,p.xrlayer=this._createXRLayer(p);const g=this._session.renderState.layers;g.unshift(p.xrlayer),this._session.updateRenderState({layers:g})}else d.isXRRenderTarget=!1;return f}createCylinderLayer(e,t,r,i,s,a,o,l,u={}){const d=new Q8(e,e,e*t/r,64,64,!0,Math.PI-t/2,t),h=new US(a,o,{format:to,type:Zs,depthTexture:new Bl(a,o,u.stencil?Ku:ts,void 0,void 0,void 0,void 0,void 0,void 0,u.stencil?vc:ml),stencilBuffer:u.stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1});h._autoAllocateDepthBuffer=!0;const f=new Lh({color:16777215,side:us});f.map=h.texture,f.map.offset.y=1,f.map.repeat.y=-1;const p=new ns(d,f);p.position.copy(i),p.quaternion.copy(s);const g={type:"cylinder",radius:e,centralAngle:t,aspectratio:r,translation:i,quaternion:s,pixelwidth:a,pixelheight:o,plane:p,material:f,rendercall:l,renderTarget:h};if(this._layers.push(g),this._session!==null){g.plane.material=new Lh({color:16777215,side:us}),g.plane.material.blending=Dv,g.plane.material.blendEquation=Ol,g.plane.material.blendSrc=Mm,g.plane.material.blendDst=Mm,g.xrlayer=this._createXRLayer(g);const A=this._session.renderState.layers;A.unshift(g.xrlayer),this._session.updateRenderState({layers:A})}else h.isXRRenderTarget=!1;return p}renderLayers(){const e=new Ve,t=new $h,r=this._renderer,i=this.isPresenting;this.isPresenting=!1;const s=new Jt;r.getSize(s);const a=r.getRenderTarget();for(const o of this._layers){o.renderTarget.isXRRenderTarget=this._session!==null,o.renderTarget._hasExternalTextures=o.renderTarget.isXRRenderTarget;const l=r.contextNode;let u;if(o.renderTarget.isXRRenderTarget&&this._sessionUsesLayers){o.xrlayer.transform=new XRRigidTransform(o.plane.getWorldPosition(e),o.plane.getWorldQuaternion(t));const d=this._glBinding.getSubImage(o.xrlayer,this._xrFrame);r.backend.setXRRenderTargetTextures(o.renderTarget,d.colorTexture,void 0),r._setXRLayerSize(o.renderTarget.width,o.renderTarget.height),u=zJ.get(l),u===void 0&&(u=l.context({getOutput:h=>gG(h,r.toneMapping,r.outputColorSpace)}),zJ.set(l,u))}else u=l;r.contextNode=u,r.setRenderTarget(o.renderTarget),o.rendercall(),r.contextNode=l}r.setRenderTarget(a),r._setXRLayerSize(s.x,s.y),this.isPresenting=i}getSession(){return this._session}async setSession(e){const t=this._renderer;t.initialized===!1&&await t.init(),this._gl=t.getContext();const r=this._gl;if(this._session=e,e!==null){if(e.addEventListener("select",this._onSessionEvent),e.addEventListener("selectstart",this._onSessionEvent),e.addEventListener("selectend",this._onSessionEvent),e.addEventListener("squeeze",this._onSessionEvent),e.addEventListener("squeezestart",this._onSessionEvent),e.addEventListener("squeezeend",this._onSessionEvent),e.addEventListener("end",this._onSessionEnd),e.addEventListener("inputsourceschange",this._onInputSourcesChange),this._val
4321idateWebGPUSession(),this._currentPixelRatio=t.getPixelRatio(),t.getSize(this._currentSize),this._currentAnimationContext=t._animation.getContext(),this._currentAnimationLoop=t._animation.getAnimationLoop(),t._animation.stop(),this._isWebGPUSession())await this._initWebGPUSession(e);else if(this._supportsLayers===!0){let i=null,s=null,a=null;const o=r.getContextAttributes();await t.backend.makeXRCompatible(),this.setFoveation(this.getFoveation()),t.depth&&(a=t.stencil?r.DEPTH24_STENCIL8:r.DEPTH_COMPONENT24,i=t.stencil?vc:ml,s=t.stencil?Ku:ts);const l={colorFormat:r.RGBA8,depthFormat:a,scaleFactor:this._framebufferScaleFactor,clearOnAccess:!1};this._useMultiviewIfPossible&&t.hasFeature("OVR_multiview2")&&(l.textureType="texture-array",this._useMultiview=!0),this._glBinding=this.getBinding();const u=this._glBinding.createProjectionLayer(l),d=[u];this._glProjLayer=u,t.setPixelRatio(1),t._setXRLayerSize(u.textureWidth,u.textureHeight);const h=this._useMultiview?2:1,f=new Bl(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,i,h);if(this._xrRenderTarget=new US(u.textureWidth,u.textureHeight,{format:to,type:Zs,colorSpace:t.outputColorSpace,depthTexture:f,stencilBuffer:t.stencil,samples:o.antialias?4:0,resolveDepthBuffer:u.ignoreDepthValues===!1,resolveStencilBuffer:u.ignoreDepthValues===!1,depth:this._useMultiview?2:1,multiview:this._useMultiview}),this._xrRenderTarget._hasExternalTextures=!0,this._xrRenderTarget.depth=this._useMultiview?2:1,this._sessionUsesLayers=e.enabledFeatures.includes("layers"),this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType()),this._sessionUsesLayers)for(const p of this._layers)p.plane.material=new Lh({color:16777215,side:p.type==="cylinder"?us:mu}),p.plane.material.blending=Dv,p.plane.material.blendEquation=Ol,p.plane.material.blendSrc=Mm,p.plane.material.blendDst=Mm,p.xrlayer=this._createXRLayer(p),d.unshift(p.xrlayer);e.updateRenderState({layers:d})}else{await t.backend.makeXRCompatible(),this.setFoveation(this.getFoveation());const i={antialias:t.currentSamples>0,alpha:!0,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:this.getFramebufferScaleFactor()},s=new XRWebGLLayer(e,r,i);this._glBaseLayer=s,e.updateRenderState({baseLayer:s}),t.setPixelRatio(1),t._setXRLayerSize(s.framebufferWidth,s.framebufferHeight),this._xrRenderTarget=new US(s.framebufferWidth,s.framebufferHeight,{format:to,type:Zs,colorSpace:t.outputColorSpace,stencilBuffer:t.stencil,resolveDepthBuffer:s.ignoreDepthValues===!1,resolveStencilBuffer:s.ignoreDepthValues===!1}),this._xrRenderTarget._isOpaqueFramebuffer=!0,this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType())}t._animation.setAnimationLoop(this._onAnimationFrame),t._animation.setContext(e),t._animation.start(),this.isPresenting=!0,this.dispatchEvent({type:"sessionstart"})}}updateCamera(e){const t=this._session;if(t===null)return;const r=e.near,i=e.far,s=this._cameraXR,a=this._cameraL,o=this._cameraR;s.near=o.near=a.near=r,s.far=o.far=a.far=i,s.isMultiViewCamera=this._useMultiview,(this._currentDepthNear!==s.near||this._currentDepthFar!==s.far)&&(t.updateRenderState({depthNear:s.near,depthFar:s.far}),this._currentDepthNear=s.near,this._currentDepthFar=s.far),s.layers.mask=e.layers.mask|6,a.layers.mask=s.layers.mask&-5,o.layers.mask=s.layers.mask&-3;const l=e.parent,u=s.cameras;GJ(s,l);for(let d=0;d<u.length;d++)GJ(u[d],l);u.length===2?HQe(s,a,o):s.projectionMatrix.copy(a.projectionMatrix),WQe(e,s,l)}_getController(e){let t=this._controllers[e];return t===void 0&&(t=new p6,this._controllers[e]=t),t}}function HQe(n,e,t){BJ.setFromMatrixPosition(e.matrixWorld),VJ.setFromMatrixPosition(t.matrixWorld);const r=BJ.distanceTo(VJ),i=e.projectionMatrix.elements,s=t.projectionMatrix.elements,a=i[14]/(i[10]-1),o=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],d=(i[8]-1)/i[0],h=(s[8]+1)/s[0],f=a*d,p=a*h,g=r/(-d+h),A=g*-d;if(e.matrixWorld.decompose(n.position,n.quaternion,n.scale),n.translateX(A),n.translateZ(g),n.matrixWorld.compose(n.position,n.quaternion,n.scale),n.matrixWorldInverse.copy(n.matrixWorld).invert(),i[10]===-1)n.projectionMatrix.copy(e.projectionMatrix),n.projectionMatrixInverse.copy(e.projectionMatrixInverse);
4321else{const x=a+g,b=o+g,_=f-A,M=p+(r-A),T=l*o/b*x,L=u*o/b*x;n.projectionMatrix.makePerspective(_,M,T,L,x,b),n.projectionMatrixInverse.copy(n.projectionMatrix).invert()}}function GJ(n,e){e===null?n.matrixWorld.copy(n.matrix):n.matrixWorld.multiplyMatrices(e.matrixWorld,n.matrix),n.matrixWorldInverse.copy(n.matrixWorld).invert()}function WQe(n,e,t){t===null?n.matrix.copy(e.matrixWorld):(n.matrix.copy(t.matrixWorld),n.matrix.invert(),n.matrix.multiply(e.matrixWorld)),n.matrix.decompose(n.position,n.quaternion,n.scale),n.updateMatrixWorld(!0),n.projectionMatrix.copy(e.projectionMatrix),n.projectionMatrixInverse.copy(e.projectionMatrixInverse),n.isPerspectiveCamera&&(n.fov=ty*2*Math.atan(1/n.projectionMatrix.elements[5]),n.zoom=1)}function XQe(n){const e=this._controllerInputSources.indexOf(n.inputSource);if(e===-1)return;const t=this._controllers[e];if(t!==void 0){const r=this.getReferenceSpace();t.update(n.inputSource,n.frame,r),t.dispatchEvent({type:n.type,data:n.inputSource})}}function YQe(){const n=this._session,e=this._renderer;n.removeEventListener("select",this._onSessionEvent),n.removeEventListener("selectstart",this._onSessionEvent),n.removeEventListener("selectend",this._onSessionEvent),n.removeEventListener("squeeze",this._onSessionEvent),n.removeEventListener("squeezestart",this._onSessionEvent),n.removeEventListener("squeezeend",this._onSessionEvent),n.removeEventListener("end",this._onSessionEnd),n.removeEventListener("inputsourceschange",this._onInputSourcesChange);for(let t=0;t<this._controllers.length;t++){const r=this._controllerInputSources[t];r!==null&&(this._controllerInputSources[t]=null,this._controllers[t].disconnect(r))}if(this._currentDepthNear=null,this._currentDepthFar=null,this._currentSamples!==null&&(e._samples=this._currentSamples,this._currentSamples=null),e._resetXRState(),this._disposeWebGPUSession(),this._session=null,this._xrRenderTarget=null,this._glBinding=null,this._webgpuBinding=null,this._glBaseLayer=null,this._glProjLayer=null,this._sessionUsesLayers===!0)for(const t of this._layers)t.renderTarget=new US(t.pixelwidth,t.pixelheight,{format:to,type:Zs,depthTexture:new Bl(t.pixelwidth,t.pixelheight,t.stencilBuffer?Ku:ts,void 0,void 0,void 0,void 0,void 0,void 0,t.stencilBuffer?vc:ml),stencilBuffer:t.stencilBuffer,resolveDepthBuffer:!1,resolveStencilBuffer:!1}),t.renderTarget.isXRRenderTarget=!1,t.plane.material=t.material,t.material.map=t.renderTarget.texture,t.material.map.offset.y=1,t.material.map.repeat.y=-1,delete t.xrlayer;this.isPresenting=!1,this._useMultiview=!1,e._animation.stop(),e._animation.setAnimationLoop(this._currentAnimationLoop),e._animation.setContext(this._currentAnimationContext),e._animation.start(),e.setPixelRatio(this._currentPixelRatio),e.setSize(this._currentSize.width,this._currentSize.height,!1),this.dispatchEvent({type:"sessionend"})}function QQe(n){const e=this._controllers,t=this._controllerInputSources;for(let r=0;r<n.removed.length;r++){const i=n.removed[r],s=t.indexOf(i);s>=0&&(t[s]=null,e[s].disconnect(i))}for(let r=0;r<n.added.length;r++){const i=n.added[r];let s=t.indexOf(i);if(s===-1){for(let o=0;o<e.length;o++)if(o>=t.length){t.push(i),s=o;break}else if(t[o]===null){t[o]=i,s=o;break}if(s===-1)break}const a=e[s];a&&a.connect(i)}}function KQe(n){return n.type==="quad"?this._glBinding.createQuadLayer({transform:new XRRigidTransform(n.translation,n.quaternion),width:n.width/2,height:n.height/2,space:this._referenceSpace,viewPixelWidth:n.pixelwidth,viewPixelHeight:n.pixelheight,clearOnAccess:!1}):this._glBinding.createCylinderLayer({transform:new XRRigidTransform(n.translation,n.quaternion),radius:n.radius,centralAngle:n.centralAngle,aspectRatio:n.aspectRatio,space:this._referenceSpace,viewPixelWidth:n.pixelwidth,viewPixelHeight:n.pixelheight,clearOnAccess:!1})}function ZQe(n,e){if(e===void 0)return;const t=this._cameraXR,r=this._renderer,i=r.backend,s=this._glBaseLayer,a=this.getReferenceSpace(),o=e.getViewerPose(a);if(this._xrFrame=e,o!==null){const l=o.views,u=this._isWebGPUSession()?this._getWebGPUViewData(l):null;this._glBaseLayer!==null&&u===null&&i.setXRTarget(s.framebuffer);let d=!1;l.length!==t.cameras.length&&(t.cameras.length=0,d=!0);for(let f=0;f<l.length;f++){const p=l[f];let g;if(u!==null)g=u.viewports[f];else if(this._supportsLayers===!0){const x=this._glBinding.getViewSubImage(this._glProjLayer,p);g=x.viewport,f===0&&i.setXRRenderTargetTextures(this._xrRenderTarget,x.colorTexture,this._glProjLayer.ignoreDepthValues&&!this._useMultiview?void 0:x.depthStencilTexture)}else g=s.getViewport(p);let A=this._cameras[f];A===void 0&&(A=new ul,A.layers.enable(f),A.viewport=new Rr,A.matrixWorldAutoUpdate=!1,this._cameras[f]=A),A.matrix.fromArray(p.transform.matrix),A.matrix.decompose(A.position,A.quaternion,A.scale),A.projectionMatrix.fromArray(p.projectionMatrix),A.projectionMatrixInverse.copy(A.projectionMatrix).invert(),A.viewport.set(g.x,g.y,g.width,g.height),f===0&&(t.matrix.copy(A.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale)),d===!0&&t.cameras.push(A)}u!==null&&u.colorTexture!==null&&i.setXRRenderTargetTextures(this._xrRenderTarget,u.colorTexture,u.viewDescriptors),r.setOutputRe
vendor: 4,247 bytes, line 4321
4321nderTarget(this._xrRenderTarget);const h=r._getFrameBufferTarget();r.xr.foveateBoundTexture(h)}for(let l=0;l<this._controllers.length;l++){const u=this._controllerInputSources[l],d=this._controllers[l];u!==null&&d!==void 0&&d.update(u,e,a)}this._currentAnimationLoop&&this._currentAnimationLoop(n,e),e.detectedPlanes&&this.dispatchEvent({type:"planesdetected",data:e}),this._xrFrame=null}class JQe extends ef{constructor(e){super(),this.domElement=e,this._pixelRatio=1,this._width=this.domElement.width,this._height=this.domElement.height,this._viewport=new Rr(0,0,this._width,this._height),this._scissor=new Rr(0,0,this._width,this._height),this._scissorTest=!1,this.colorTexture=new ZV,this.depthTexture=new Bl}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(e){return e.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(e){return e.set(this._width,this._height)}setPixelRatio(e=1){this._pixelRatio!==e&&(this._pixelRatio=e,this.setSize(this._width,this._height,!1))}setDrawingBufferSize(e,t,r){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this._pixelRatio=r,this.domElement.width=Math.floor(e*r),this.domElement.height=Math.floor(t*r),this.setViewport(0,0,e,t),this._dispatchResize())}setSize(e,t,r=!0){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this.domElement.width=Math.floor(e*this._pixelRatio),this.domElement.height=Math.floor(t*this._pixelRatio),r===!0&&(this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"),this.setViewport(0,0,e,t),this._dispatchResize())}getScissor(e){const t=this._scissor;return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e}setScissor(e,t,r,i){const s=this._scissor;e.isVector4?s.copy(e):s.set(e,t,r,i)}getScissorTest(){return this._scissorTest}setScissorTest(e){this._scissorTest=e}getViewport(e){return e.copy(this._viewport)}setViewport(e,t,r,i,s=0,a=1){const o=this._viewport;e.isVector4?o.copy(e):o.set(e,t,r,i),o.minDepth=s,o.maxDepth=a}_dispatchResize(){this.dispatchEvent({type:"resize"})}dispose(){this.dispatchEvent({type:"dispose"})}}const qJ=new $V,R2=new Jt,UL=new Rr,aN=new ny,oN=new QV,P2=new kr,ym=new Rr,eKe={[mu]:us,[us]:mu,[Fa]:Fa};class tKe{constructor(e,t={}){this.isRenderer=!0;const{logarithmicDepthBuffer:r=!1,reversedDepthBuffer:i=!1,alpha:s=!0,depth:a=!0,stencil:o=!1,antialias:l=!1,samples:u=0,getFallback:d=null,outputBufferType:h=Js,multiview:f=!1}=t;this.backend=e,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.alpha=s,this.logarithmicDepthBuffer=r,this.reversedDepthBuffer=i,this.outputColorSpace=Pl,this.toneMapping=Il,this.toneMappingExposure=1,this.sortObjects=!0,this.depth=a,this.stencil=o,this.info=new qqe,this.contextNode=pg(),this.library=new Tme,this.lighting=new qQe,this._samples=u||l===!0?4:0,this._onCanvasTargetResize=this._onCanvasTargetResize.bind(this),this._canvasTarget=new JQe(e.getDomElement()),this._canvasTarget.addEventListener("resize",this._onCanvasTargetResize),this._canvasTarget.isDefaultCanvasTarget=!0,this._inspector=new kfe,this._inspector.setRenderer(this),this._getFallback=d,this._attributes=null,this._geometries=null,this._nodes=null,this._animation=null,this._bindings=null,this._objects=null,this._pipelines=null,this._bundles=null,this._renderLists=null,this._renderContexts=null,this._textures=null,this._background=null,this._quadCache=new Map,this._currentRenderContext=null,this._opaqueSort=null,this._transparentSort=null,this._frameBufferTargets=new Map;const p=this.alpha===!0?0:1;this._clearColor=new XG(0,0,0,p),this._clearDepth=1,this._clearStencil=0,this._renderTarget=null,this._activeCubeFace=0,this._activeMipmapLevel=0,this._outputRenderTarget=null,this._mrt=null,this._renderObjectFunction=null,this._currentRenderObjectFunction=null,this._currentRenderBundle=null,this._handleObjectFunction=this._renderObjectDirect,this._isDeviceLost=!1,this.onDeviceLost=this._onDeviceLost,this.onError=this._onError,this._outputBufferType=h,this._cacheShadowNodes=new WeakMap,this._initialized=!1,this._callDepth=-1,this._initPromise=null,this._compilationPromises=null,this._currentSourceMaterial=null,this.transparent=!0,this.opaque=!0,this.shadowMap={enabled:!1,transmitted:!1,type:Nb}
4321,this.xr=new $Qe(this,f),this.debug={checkShaderErrors:!0,onShaderError:null,getShaderAsync:async(g,A,x)=>{await this.compileAsync(x,A,g);const _=this.needsFrameBufferTarget&&this._renderTarget===null?this._getFrameBufferTarget():this._renderTarget||this._outputRenderTarget,M=this._renderLists.get(g,A),T=this._renderContexts.get(_,this._mrt),L=g.overrideMaterial||x.material,D=this._objects.get(x,L,g,A,M.lightsNode,T,T.clippingContext),{fragmentShader:P,vertexShader:O}=D.getNodeBuilderState();return{fragmentShader:P,vertexShader:O}}}}async init(){return this._initPromise!==null?this._initPromise:(this._initPromise=new Promise(async(e,t)=>{let r=this.backend;try{await r.init(this)}catch(i){if(this._getFallback!==null)try{this.backend=r=this._getFallback(i),await r.init(this)}catch(s){t(s);return}else{t(i);return}}this._nodes=new BQe(this,r),this._animation=new Dqe(this,this._nodes,this.info),this._attributes=new zqe(r,this.info),this._background=new eQe(this,this._nodes),this._geometries=new Gqe(this._attributes,this.info),this._textures=new i$e(this,r,this.info),this._pipelines=new Xqe(r,this._nodes,this.info),this._bindings=new Yqe(r,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new Uqe(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new Jqe(this.lighting),this._bundles=new zQe,this._renderContexts=new n$e(this),this._animation.start(),this._initialized=!0,this._inspector.init(),e(this)}),this._initPromise)}get domElement(){return this._canvasTarget.domElement}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(e,t,r=null){if(this._isDeviceLost===!0)return;this._initialized===!1&&await this.init();const i=this._nodes.nodeFrame,s=i.renderId,a=this._currentRenderContext,o=this._currentRenderObjectFunction,l=this._handleObjectFunction,u=this._compilationPromises;r===null&&(r=e);const d=e.isScene===!0?e:r.isScene===!0?r:qJ,f=this.needsFrameBufferTarget&&this._renderTarget===null?this._getFrameBufferTarget():this._renderTarget||this._outputRenderTarget,p=this._renderContexts.get(f,this._mrt),g=this._activeMipmapLevel,A=[];this._currentRenderContext=p,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=A,i.renderId++,i.update(),p.depth=this.depth,p.stencil=this.stencil,p.clippingContext||(p.clippingContext=new zk),p.clippingContext.updateGlobal(d,t),e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t=this._updateCamera(t),d.onBeforeRender(this,e,t,f);const x=t.isArrayCamera?oN:aN;t.isArrayCamera?x.setFromArrayCamera(t):(P2.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),x.setFromProjectionMatrix(P2,t.coordinateSystem,t.reversedDepth));const b=this._renderLists.get(d,t);if(b.begin(),this._projectObject(e,t,0,b,p.clippingContext),r!==e&&r.traverseVisible(function(D){D.isLight&&D.layers.test(t.layers)&&b.pushLight(D)}),b.finish(),f!==null){this._textures.updateRenderTarget(f,g);const D=this._textures.get(f);p.textures=D.textures,p.depthTexture=D.depthTexture}else p.textures=null,p.depthTexture=null;r!==e?this._background.update(r,b,p):this._background.update(d,b,p);const _=b.opaque,M=b.transparent,T=b.transparentDoublePass,L=b.lightsNode;this.opaque===!0&&_.length>0&&this._renderObjects(_,t,d,L),this.transparent===!0&&M.length>0&&this._renderTransparents(M,T,t,d,L),i.renderId=s,this._currentRenderContext=a,this._currentRenderObjectFunction=o,this._handleObjectFunction=l,this._compilationPromises=u;for(const D of A){const P=this._objects.get(D.object,D.material,D.scene,D.camera,D.lightsNode,D.renderContext,D.clippingContext,D.passId);P.drawRange=D.object.geometry.drawRange,P.group=D.group,await this._nodes.getForRenderAsync(P),this._nodes.updateBefore(P),this._geometries.updateForRender(P),this._nodes.updateForRender(P),this._bindings.updateForRender(P);const O=[];this._pipelines.getForRender(P,O),O.length>0&&await Promise.all(O),this._nodes.updateAfter(P),await $ce()}}async renderAsync(e,t){_i('Renderer: "renderAsync()" has been deprecated. Use "render()" and "await renderer.init();" when creating the renderer.'),await this.init(),this.render(e,t)}async waitForGPU(){sn("Renderer: waitForGPU() has been removed. Read https://github.com/mrdoob/three.js/issues/32012 for more information.")}set inspector(e){this._inspector!==null&&this._inspector.setRenderer(null),this._inspector=e,this._inspector.setRenderer(this)}get inspector(){return this._inspector}set highPrecision(e){const t=this.contextNode.value;e===!0?(t.modelViewMatrix=VF,t.modelNormalViewMatrix=zF):this.highPrecision&&(delete t.modelViewMatrix,delete t.modelNormalViewMatrix)}get highPrecision(){const e=this.contextNode.value;return e.modelViewMatrix===VF&&e.modelNormalViewMatrix===zF}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getOutputBufferType(){return this._outputBufferType}getColorBufferType(){return _i('Renderer: ".getColorBufferType()" has been renamed to ".getOutputBufferType()".'),this.getOutputBufferType()}_onDeviceLost(e){let t=`THREE.WebGPURenderer: ${e.api} Device Lost: 4322 4323Message: ${e.message}`;e.reason&&(t+=` 4324Reason: ${e.reason}`),sn(t),this._isDeviceLost=!0}_onError(e){let t=`WebGPURenderer: Uncaptured ${e.api} ${e.type}`;e.message&&(t+=`: ${e.message}`),sn(t)}_bundleNeedsUpdate(e,t){return t.bundleGPU===void 0||e.version!==t.version}_renderBundle(e,t,r){const{bundleGroup:i,camera:s,renderList:a}=e,o=this._currentRenderContext,l=this._bundles.get(i,s,o),u=this.backend.get(l);if(this._bundleNeedsUpdate(i,u)){this.backend.beginBundle(o),this._currentRenderBundle=l;const{transparentDoublePass:h,transparent:f,opaque:p}=a;this.opaque===!0&&p.length>0&&this._renderObjects(p,s,t,r),this.transparent===!0&&f.length>0&&this._renderTransparents(f,h,s,t,r),this._currentRenderBundle=null,this.backend.finishBundle(o,l),u.ver
4324sion=i.version}else{const{renderObjects:h}=u;for(let f=0,p=h.length;f<p;f++){const g=h[f];this._nodes.needsRefresh(g)&&(this._nodes.updateBefore(g),this._geometries.updateForRender(g),this._nodes.updateForRender(g),this._bindings.updateForRender(g),this._nodes.updateAfter(g))}}this.backend.addBundle(o,l)}render(e,t){if(this._initialized===!1)throw new Error('THREE.Renderer: .render() called before the backend is initialized. Use "await renderer.init();" before rendering.');this._renderScene(e,t)}get initialized(){return this._initialized}_renderOutputLayers(e,t){if(t.texture.isArrayTexture!==!0||t.texture.image.depth<=1){this._renderScene(e,e.camera,!1);return}const r=this._activeCubeFace;try{for(let i=0;i<t.texture.image.depth;i++)this._nodes.setOutputLayerIndex(i),this._activeCubeFace=i,this._renderScene(e,e.camera,!1)}finally{this._nodes.setOutputLayerIndex(0),this._activeCubeFace=r}}_getFrameBufferTarget(){const{currentToneMapping:e,currentColorSpace:t}=this,r=e!==Il,i=t!==_r.workingColorSpace;if(r===!1&&i===!1)return null;const{width:s,height:a}=this.getDrawingBufferSize(R2),{depth:o,stencil:l}=this,u=this._outputRenderTarget||this._canvasTarget;let d=this._frameBufferTargets.get(u);if(d===void 0){d=new cp(s,a,{depthBuffer:o,stencilBuffer:l,type:this._outputBufferType,format:to,colorSpace:_r.workingColorSpace,generateMipmaps:!1,minFilter:bs,magFilter:bs,samples:this.samples}),d.isPostProcessingRenderTarget=!0;const x=()=>{u.removeEventListener("dispose",x),d.dispose(),this._frameBufferTargets.delete(u)};u.addEventListener("dispose",x),this._frameBufferTargets.set(u,d)}const h=this.getOutputRenderTarget();d.depthBuffer=o,d.stencilBuffer=l,h!==null?d.setSize(h.width,h.height,h.depth):d.setSize(s,a,1);const f=this._outputRenderTarget?this._outputRenderTarget.viewport:u._viewport,p=this._outputRenderTarget?this._outputRenderTarget.scissor:u._scissor,g=this._outputRenderTarget?1:u._pixelRatio,A=this._outputRenderTarget?this._outputRenderTarget.scissorTest:u._scissorTest;return d.viewport.copy(f),d.scissor.copy(p),d.viewport.multiplyScalar(g),d.scissor.multiplyScalar(g),d.scissorTest=A,d.multiview=h!==null?h.multiview:!1,d.useArrayDepthTexture=h!==null?h.useArrayDepthTexture:!1,d.resolveDepthBuffer=h!==null?h.resolveDepthBuffer:!0,d._autoAllocateDepthBuffer=h!==null?h._autoAllocateDepthBuffer:!1,d}_renderScene(e,t,r=!0){if(this._isDeviceLost===!0)return;
4324const i=r?this._getFrameBufferTarget():null,s=this._nodes.nodeFrame,a=s.renderId,o=this._currentRenderContext,l=this._currentRenderObjectFunction,u=this._handleObjectFunction;this.lighting.beginRender(e),this._callDepth++;const d=e.isScene===!0?e:qJ,h=this._renderTarget||this._outputRenderTarget,f=this._activeCubeFace,p=this._activeMipmapLevel;let g;if(i!==null?(g=i,this.setRenderTarget(g)):g=h,g!==null&&g.depthBuffer===!0){const H=this._textures.get(g);H.depthInitialized!==!0&&((this.autoClear===!1||this.autoClear===!0&&this.autoClearDepth===!1)&&this.clearDepth(),H.depthInitialized=!0)}const A=this._renderContexts.get(g,this._mrt,this._callDepth);this._currentRenderContext=A,this._currentRenderObjectFunction=this._renderObjectFunction||this.renderObject,this._handleObjectFunction=this._renderObjectDirect,this.info.calls++,this.info.render.calls++,this.info.render.frameCalls++,s.renderId=this.info.calls,this.backend.updateTimeStampUID(A),this.inspector.beginRender(this.backend.getTimestampUID(A),e,t,g),e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t=this._updateCamera(t);const x=this._canvasTarget;let b=x._viewport,_=x._scissor,M=x._pixelRatio;g!==null&&(b=g.viewport,_=g.scissor,M=1),this.getDrawingBufferSize(R2),UL.set(0,0,R2.width,R2.height);const T=b.minDepth===void 0?0:b.minDepth,L=b.maxDepth===void 0?1:b.maxDepth;A.viewportValue.copy(b).multiplyScalar(M).floor(),A.viewportValue.width>>=p,A.viewportValue.height>>=p,A.viewportValue.minDepth=T,A.viewportValue.maxDepth=L,A.viewport=A.viewportValue.equals(UL)===!1,A.scissorValue.copy(_).multiplyScalar(M).floor(),A.scissor=x._scissorTest&&A.scissorValue.equals(UL)===!1,A.scissorValue.width>>=p,A.scissorValue.height>>=p,A.clippingContext||(A.clippingContext=new zk),A.clippingContext.updateGlobal(d,t),d.onBeforeRender(this,e,t,g);const D=t.isArrayCamera?oN:aN;t.isArrayCamera?D.setFromArrayCamera(t):(P2.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),D.setFromProjectionMatrix(P2,t.coordinateSystem,t.reversedDepth));const P=this._renderLists.get(e,t);if(P.begin(),this._projectObject(e,t,0,P,A.clippingContext),P.finish(),this.sortObjects===!0&&P.sort(this._opaqueSort,this._transparentSort,t.reversedDepth),g!==null){this._textures.updateRenderTarget(g,p);const H=this._textures.get(g);A.textures=H.textures,A.depthTexture=H.depthTexture,A.width=H.width,A.height=H.height,A.renderTarget=g,A.depth=g.depthBuffer,A.stencil=g.stencilBuffer}else A.textures=null,A.depthTexture=null,A.width=R2.width,A.height=R2.height,A.depth=this.depth,A.stencil=this.stencil;A.width>>=p,A.height>>=p,A.activeCubeFace=f,A.activeMipmapLevel=p,A.occlusionQueryCount=P.occlusionQueryCount,A.scissorValue.max(ym.set(0,0,0,0)),A.scissorValue.x+A.scissorValue.width>A.width&&(A.scissorValue.width=Math.max(A.width-A.scissorValue.x,0)),A.scissorValue.y+A.scissorValue.height>A.height&&(A.scissorValue.height=Math.max(A.height-A.scissorValue.y,0)),this._background.update(d,P,A),A.camera=t,this.backend.beginRender(A);const{bundles:O,lightsNode:F,transparentDoublePass:U,transparent:B,opaque:z}=P;return O.length>0&&this._renderBundles(O,d,F),this.opaque===!0&&z.length>0&&this._renderObjects(z,t,d,F),this.transparent===!0&&B.length>0&&this._renderTransparents(B,U,t,d,F),this.backend.finishRender(A),s.renderId=a,this._currentRenderContext=o,this._currentRenderObjectFunction=l,this._handleObjectFunction=u,this.lighting.finishRender(e),this._callDepth--,i!==null&&(this.setRenderTarget(h,f,p),this._renderOutput(g)),d.onAfterRender(this,e,t,g),this.inspector.finishRender(this.backend.getTimestampUID(A)),A}_setXRLayerSize(e,t){this._canvasTarget._width=e,this._canvasTarget._height=t,this.setViewport(0,0,e,t)}_renderOutput(e){const t=this._nodes.getOutputCacheKey();let r=this._quadCache.get(e.texture),i;if(r===void 0){i=new ZG(new Va),i.name="Output Color Transform",i.material.name="outputColorTransform",i.material.fragmentNode=this._nodes.getOutputNode(e.texture),r={quad:i,cacheKey:t},this._quadCache.set(e.texture,r);const o=()=>{i.material.dispose(),this._quadCache.delete(e.texture),e.texture.removeEventListener("dispose",o)};e.texture.addEventListener("dispose",o)}else i=r.quad,r.cacheKey!==t&&(i.material.fragmentNode=this._nodes.getOutputNode(e.texture),i.material.needsUpdate=!0,r.cacheKey=t);const s=this.autoClear,a=this.xr.enabled;this.autoClear=!1,this.xr.enabled=!1,this._renderOutputLayers(i,e),this.autoClear=s,this.xr.enabled=a}getMaxAnisotropy(){return this.backend.capabilities.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(e){this._initialized===!1&&await this.init(),this._animation.setAnimationLoop(e)}getAnimationLoop(){return this._animation.getAnimationLoop()}async getArrayBufferAsync(e,t=null,r=0,i=-1){if(t!==null&&t.isReadbackBuffer&&this.info.memoryMap.has(t)===!1){this.info.createReadbackBuffer(t);const s=()=>{t.removeEventListener("dispose",s),this.info.destroyReadbackBuffer(t)};t.addEventListener("dispose",s)}if(r%4!==0||i>0&&i%4!==0)throw new Error('THREE.Renderer: "getArrayBufferAsync()" offset and count must be a multiple of 4.');return await this.backend.getArrayBufferAsync(e,t,r,i)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._canvasTarget.getPixelRatio()}getDrawingBufferSize(e){return this._canvasTarget.getDrawingBufferSize(e)}getSize(e){return this._canvasTarget.getSize(e)}setPixelRatio(e=1){this._canvasTarget.setPixelRatio(e)}setDrawingBufferSize(e,t,r){this.xr&&this.xr.isPresenting||this._canvasTarget.setDrawingBufferSize(e,t,r)}setSize(e,t,r=!0){this.xr&&this.xr.isPresenting||this._canvasTarget.setSize(e,t,r)}setOpaqueSort(e){this._opaqueSort=e}setTransparentSort(e){this._transparentSort=e}getScissor(e){return this._canvasTarget.getScissor(e)}
4324setScissor(e,t,r,i){this._canvasTarget.setScissor(e,t,r,i)}getScissorTest(){return this._canvasTarget.getScissorTest()}setScissorTest(e){this._canvasTarget.setScissorTest(e),this.backend.setScissorTest(e)}getViewport(e){return this._canvasTarget.getViewport(e)}setViewport(e,t,r,i,s=0,a=1){this._canvasTarget.setViewport(e,t,r,i,s,a)}getClearColor(e){return e.copy(this._clearColor)}setClearColor(e,t=1){this._clearColor.set(e),this._clearColor.a=t}getClearAlpha(){return this._clearColor.a}setClearAlpha(e){this._clearColor.a=e}getClearDepth(){return this.reversedDepthBuffer===!0?1-this._clearDepth:this._clearDepth}setClearDepth(e){this._clearDepth=e}getClearStencil(){return this._clearStencil}setClearStencil(e){this._clearStencil=e}isOccluded(e){const t=this._currentRenderContext;return t&&this.backend.isOccluded(t,e)}clear(e=!0,t=!0,r=!0){if(this._initialized===!1)throw new Error('THREE.Renderer: .clear() called before the backend is initialized. Use "await renderer.init();" before using this method.');const i=this._renderTarget||this._getFrameBufferTarget();let s=null;if(i!==null){this._textures.updateRenderTarget(i);const a=this._textures.get(i);s=this._renderContexts.get(i,null,-1),s.textures=a.textures,s.depthTexture=a.depthTexture,s.width=a.width,s.height=a.height,s.renderTarget=i,s.depth=i.depthBuffer,s.stencil=i.stencilBuffer;const o=this.backend.getClearColor();s.clearColorValue.r=o.r,s.clearColorValue.g=o.g,s.clearColorValue.b=o.b,s.clearColorValue.a=o.a,s.clearDepthValue=this.getClearDepth(),s.clearStencilValue=this.getClearStencil(),s.activeCubeFace=this.getActiveCubeFace(),s.activeMipmapLevel=this.getActiveMipmapLevel(),i.depthBuffer===!0&&(a.depthInitialized=!0)}this.backend.clear(e,t,r,s),i!==null&&this._renderTarget===null&&this._renderOutput(i)}clearColor(){this.clear(!0,!1,!1)}clearDepth(){this.clear(!1,!0,!1)}clearStencil(){this.clear(!1,!1,!0)}async clearAsync(e=!0,t=!0,r=!0){_i('Renderer: "clearAsync()" has been deprecated. Use "clear()" and "await renderer.init();" when creating the renderer.'),await this.init(),this.clear(e,t,r)}async clearColorAsync(){_i('Renderer: "clearColorAsync()" has been deprecated. Use "clearColor()" and "await renderer.init();" when creating the renderer.'),this.clear(!0,!1,!1)}async clearDepthAsync(){_i('Renderer: "clearDepthAsync()" has been deprecated. Use "clearDepth()" and "await renderer.init();" when creating the renderer.'),this.clear(!1,!0,!1)}async clearStencilAsync(){_i('Renderer: "clearStencilAsync()" has been deprecated. Use "clearStencil()" and "await renderer.init();" when creating the renderer.'),this.clear(!1,!1,!0)}get needsFrameBufferTarget(){const e=this.currentToneMapping!==Il,t=this.currentColorSpace!==_r.workingColorSpace;return e||t}get samples(){return this._samples}get currentSamples(){let e=this._samples;return this._renderTarget!==null?e=this._renderTarget.samples:this.needsFrameBufferTarget&&(e=0),e}get currentToneMapping(){return this.isOutputTarget?this.toneMapping:Il}get currentColorSpace(){return this.isOutputTarget?this.outputColorSpace:_r.workingColorSpace}get isOutputTarget(){return this._renderTarget===this._outputRenderTarget||this._renderTarget===null}dispose(){if(this._initialized===!0){this.info.dispose(),this.backend.dispose(),this._animation.dispose(),this._objects.dispose(),this._geometries.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose();for(const e of this._frameBufferTargets.keys())e.dispose();Object.values(this.backend.timestampQueryPool).forEach(e=>{e!==null&&e.dispose()})}this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(e,t=0,r=0){this._renderTarget=e,this._activeCubeFace=t,this._activeMipmapLevel=r}getRenderTarget(){return this._renderTarget}setOutputRenderTarget(e){this._outputRenderTarget=e}getOutputRenderTarget(){return this._outputRenderTarget}setCanvasTarget(e){this._canvasTarget.removeEventListener("resize",this._onCanvasTargetResize),this._canvasTarget=e,this._canvasTarget.addEventListener("resize",this._onCanvasTargetResize)}getCanvasTarget(){return this._canvasTarget}
4324_resetXRState(){this.backend.setXRTarget(null),this.setOutputRenderTarget(null),this.setRenderTarget(null);for(const e of this._frameBufferTargets.keys())e.dispose()}setRenderObjectFunction(e){this._renderObjectFunction=e}getRenderObjectFunction(){return this._renderObjectFunction}compute(e,t=null){if(this._isDeviceLost===!0)return;if(this._initialized===!1)return an("Renderer: .compute() called before the backend is initialized. Try using .computeAsync() instead."),this.computeAsync(e,t);const r=this._nodes.nodeFrame,i=r.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,r.renderId=this.info.calls,this.backend.updateTimeStampUID(e),this.inspector.beginCompute(this.backend.getTimestampUID(e),e);const s=this.backend,a=this._pipelines,o=this._bindings,l=this._nodes,u=Array.isArray(e)?e:[e];if(u[0]===void 0||u[0].isComputeNode!==!0)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");s.beginCompute(e);for(const d of u){if(a.has(d)===!1){const p=()=>{d.removeEventListener("dispose",p),a.delete(d),o.deleteForCompute(d),l.delete(d)};d.addEventListener("dispose",p);const g=d.onInitFunction;g!==null&&g.call(d,{renderer:this})}l.updateForCompute(d),o.updateForCompute(d);const h=o.getForCompute(d),f=a.getForCompute(d,h);s.compute(e,d,h,f,t)}s.finishCompute(e),r.renderId=i,this.inspector.finishCompute(this.backend.getTimestampUID(e))}async computeAsync(e,t=null){this._initialized===!1&&await this.init(),this.compute(e,t)}async hasFeatureAsync(e){return _i('Renderer: "hasFeatureAsync()" has been deprecated. Use "hasFeature()" and "await renderer.init();" when creating the renderer.'),await this.init(),this.hasFeature(e)}async resolveTimestampsAsync(e="render"){return this._initialized===!1&&await this.init(),this.backend.resolveTimestampsAsync(e)}hasFeature(e){if(this._initialized===!1)throw new Error('THREE.Renderer: .hasFeature() called before the backend is initialized. Use "await renderer.init();" before using this method.');return this.backend.hasFeature(e)}hasInitialized(){return this._initialized}async initTextureAsync(e){_i('Renderer: "initTextureAsync()" has been deprecated. Use "initTexture()" and "await renderer.init();" when creating the renderer.'),await this.init(),this.initTexture(e)}initTexture(e){if(this._initialized===!1)throw new Error('THREE.Renderer: .initTexture() called before the backend is initialized. Use "await renderer.init();" before using this method.');this._textures.updateTexture(e)}initRenderTarget(e){if(this._initialized===!1)throw new Error('THREE.Renderer: .initRenderTarget() called before the backend is initialized. Use "await renderer.init();" before using this method.');this._textures.updateRenderTarget(e);const t=this._textures.get(e),r=this._renderContexts.get(e);r.textures=t.textures,r.depthTexture=t.depthTexture,r.width=t.width,r.height=t.height,r.renderTarget=e,r.depth=e.depthBuffer,r.stencil=e.stencilBuffer,this.backend.initRenderTarget(r)}copyFramebufferToTexture(e,t=null){if(t!==null)if(t.isVector2)t=ym.set(t.x,t.y,e.image.width,e.image.height).floor();else if(t.isVector4)t=ym.copy(t).floor();else{sn("Renderer.copyFramebufferToTexture: Invalid rectangle.");return}else t=ym.set(0,0,e.image.width,e.image.height);let r=this._currentRenderContext,i;r!==null?i=r.renderTarget:(i=this._renderTarget||this._getFrameBufferTarget(),i!==null&&(this._textures.updateRenderTarget(i),r=this._textures.get(i))),this._textures.updateTexture(e,{renderTarget:i}),this.backend.copyFramebufferToTexture(e,r,t),this._inspector.copyFramebufferToTexture(e)}copyTextureToTexture(e,t,r=null,i=null,s=0,a=0){this._textures.updateTexture(e),this._textures.updateTexture(t),this.backend.copyTextureToTexture(e,t,r,i,s,a),this._inspector.copyTextureToTexture(e,t)}async readRenderTargetPixelsAsync(e,t,r,i,s,a=0,o=0){return this.backend.copyTextureToBuffer(e.textures[a],t,r,i,s,o)}_projectObject(e,t,r,i,s){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)r=e.renderOrder,e.isClippingGroup&&e.enabled&&(s=s.getGroupContext(e));else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)i.pushLight(e);else if(e.isSprite){const l=t.isArrayCamera?oN:aN;if(!e.frustumCulled||l.intersectsSprite(e)){this.sortObjects===!0&&ym.setFromMatrixPosition(e.matrixWorld).applyMatrix4(P2);const{geometry:u,material:d}=e;d.visible&&i.push(e,u,d,r,ym.z,null,s)}}else if(e.isLineLoop)sn("Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if(e.isMesh||e.isLine||e.isPoints){const l=t.isArrayCamera?oN:aN;if(!e.frustumCulled||l.intersectsObject(e)){const{geometry:u,material:d}=e;if(this.sortObjects===!0&&(u.boundingSphere===null&&u.computeBoundingSphere(),ym.copy(u.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(P2)),Array.isArray(d)){const h=u.groups;for(let f=0,p=h.length;f<p;f++){const g=h[f],A=d[g.materialIndex];A&&A.visible&&i.push(e,u,A,r,ym.z,g,s)}}else d.visible&&i.push(e,u,d,r,ym.z,null,s)}}}if(e.isBundleGroup===!0&&this.backend.beginBundle!==void 0){const l=i;i=this._renderLists.get(e,t);const u=this._bundles.get(e,t,this._currentRenderContext),d=this.backend.get(u);if(this._bundleNeedsUpdate(e,d)){i.begin(),d.renderObjects===void 0?d.renderObjects=[]:d.renderObjects.length=0;const f=e.children;for(let p=0,g=f.length;p<g;p++)this._projectObject(f[p],t,r,i,s);i.finish()}
4324l.pushBundle({bundleGroup:e,camera:t,renderList:i});return}const o=e.children;for(let l=0,u=o.length;l<u;l++)this._projectObject(o[l],t,r,i,s)}_renderBundles(e,t,r){for(const i of e)this._renderBundle(i,t,r)}_renderTransparents(e,t,r,i,s){if(t.length>0){for(const{material:a}of t)a.side=us;this._renderObjects(t,r,i,s,"backSide");for(const{material:a}of t)a.side=mu;this._renderObjects(e,r,i,s);for(const{material:a}of t)a.side=Fa}else this._renderObjects(e,r,i,s)}_renderObjects(e,t,r,i,s=null){for(let a=0,o=e.length;a<o;a++){const{object:l,geometry:u,material:d,group:h,clippingContext:f}=e[a];this._currentRenderObjectFunction(l,r,t,u,d,h,i,f,s)}}_getShadowNodes(e){const t=e.version;let r=this._cacheShadowNodes.get(e);if(r===void 0||r.version!==t){const i=e.map&&e.map.isTexture,s=e.colorNode&&e.colorNode.isNode,a=e.castShadowNode&&e.castShadowNode.isNode,o=e.maskShadowNode&&e.maskShadowNode.isNode||e.maskNode&&e.maskNode.isNode;let l=null,u=null,d=null;if(i||s||a||o){let h,f;if(a?(h=e.castShadowNode.rgb,f=e.castShadowNode.a,this.shadowMap.transmitted!==!0&&_i("Renderer: `shadowMap.transmitted` needs to be set to `true` when using `material.castShadowNode`.")):(h=ct(0),f=Ie(1)),i&&(f=f.mul(Ws("map","texture",e).a)),s&&(f=f.mul(e.colorNode.a)),u=Vn(h,f),o){const p=e.maskShadowNode||e.maskNode;u=ut(([g])=>(p.not().discard(),g))(u)}}e.depthNode&&e.depthNode.isNode&&(d=e.depthNode),e.castShadowPositionNode&&e.castShadowPositionNode.isNode?l=e.castShadowPositionNode:e.positionNode&&e.positionNode.isNode&&(l=e.positionNode),r={version:t,colorNode:u,depthNode:d,positionNode:l},this._cacheShadowNodes.set(e,r)}return r}_updateCamera(e){const t=this.xr;if(t.isPresenting===!1){let r=!1;if(this.reversedDepthBuffer===!0&&e.reversedDepth!==!0){if(e._reversedDepth=!0,e.isArrayCamera)for(const s of e.cameras)s._reversedDepth=!0;r=!0}const i=this.coordinateSystem;if(e.coordinateSystem!==i){if(e.coordinateSystem=i,e.isArrayCamera)for(const s of e.cameras)s.coordinateSystem=i;r=!0}if(r===!0&&(e.updateProjectionMatrix(),e.isArrayCamera))for(const s of e.cameras)s.updateProjectionMatrix()}return e.parent===null&&e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.enabled===!0&&t.isPresenting===!0&&(t.cameraAutoUpdate===!0&&t.updateCamera(e),e=t.getCamera()),e}renderObject(e,t,r,i,s,a,o,l=null,u=null){let d=!1,h,f,p,g,A,x,b;const _=this._currentSourceMaterial;if(e.onBeforeRender(this,t,r,i,s,a),s.allowOverride===!0&&t.overrideMaterial!==null){this._currentSourceMaterial=s;const M=t.overrideMaterial;if(d=!0,h=M.isNodeMaterial?M.colorNode:null,f=M.isNodeMaterial?M.depthNode:null,p=M.isNodeMaterial?M.positionNode:null,g=t.overrideMaterial.side,A=M.displacementMap,x=M.displacementScale,b=M.displacementBias,s.positionNode&&s.positionNode.isNode&&(M.positionNode=s.positionNode),M.alphaTest=s.alphaTest,M.alphaMap=s.alphaMap,M.displacementMap=s.displacementMap,M.displacementScale=s.displacementScale,M.displacementBias=s.displacementBias,M.transparent=s.transparent||s.transmission>0||s.transmissionNode&&s.transmissionNode.isNode||s.backdropNode&&s.backdropNode.isNode,M.isShadowPassMaterial){const{colorNode:T,depthNode:L,positionNode:D}=this._getShadowNodes(s);this.shadowMap.type===s0?M.side=s.shadowSide!==null?s.shadowSide:s.side:M.side=s.shadowSide!==null?s.shadowSide:eKe[s.side],T!==null&&(M.colorNode=T),L!==null&&(M.depthNode=L),D!==null&&(M.positionNode=D)}s=M}s.transparent===!0&&s.side===Fa&&s.forceSinglePass===!1?(s.side=us,this._handleObjectFunction(e,s,t,r,o,a,l,"backSide"),s.side=mu,this._handleObjectFunction(e,s,t,r,o,a,l,u),s.side=Fa):this._handleObjectFunction(e,s,t,r,o,a,l,u),d&&(t.overrideMaterial.colorNode=h,t.overrideMaterial.depthNode=f,t.overrideMaterial.positionNode=p,t.overrideMaterial.side=g,t.overrideMaterial.displacementMap=A,t.overrideMaterial.displacementScale=x,t.overrideMaterial.displacementBias=b),this._currentSourceMaterial=_,e.onAfterRender(this,t,r,i,s,a)}hasCompatibility(e){if(this._initialized===!1)throw new Error('THREE.Renderer: .hasCompatibility() called before the backend is initialized. Use "await renderer.init();" before using this method.');return this.backend.hasCompatibility(e)}_renderObjectDirect(e,t,r,i,s,a,o,l){const u=this._objects.get(e,t,r,i,s,this._currentRenderContext,o,l);u.drawRange=e.geometry.drawRange,u.group=a,this._currentRenderBundle!==null&&(this.backend.get(this._currentRenderBundle).renderObjects.push(u),u.bundle=this._currentRenderBundle.bundleGroup);const d=this._nodes.needsRefresh(u);d&&(this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u)),this._pipelines.updateForRender(u),this._pipelines.isReady(u)&&(this.backend.draw(u,this.info),d&&this._nodes.updateAfter(u))}_createObjectPipeline(e,t,r,i,s,a,o,l){if(this._compilationPromises!==null){this._compilationPromises.push({object:e,material:t,scene:r,camera:i,lightsNode:s,group:a,clippingContext:o,passId:l,renderContext:this._currentRenderContext});return}const u=this._objects.get(e,t,r,i,s,this._currentRenderContext,o,l);u.drawRange=e.geometry.drawRange,u.group=a,this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u),this._pipelines.getForRender(u,this._compilationPromises),this._nodes.updateAfter(u)}_onCanvasTargetResize(){this._initialized&&this.backend.updateSize()}get compile(){return this.compileAsync}}class Eme{constructor(e=""){this.name=e,this.visibility=0}setVisibility(e){this.visibility|=e}getVisibility(){return this.visibility}clone(){return Object.assign(new this.constructor,this)}}function Cme(n){return n+(PA-n%PA)%PA}
4324let Nme=class extends Eme{constructor(e,t=null){super(e),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=t,this._updateRanges=[]}get updateRanges(){return this._updateRanges}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}get byteLength(){return Cme(this._buffer.byteLength)}get buffer(){return this._buffer}update(){return!0}release(){this._buffer=null}};class Mme extends Nme{constructor(e,t=null){super(e,t),this.isUniformBuffer=!0}}let nKe=0;class kme extends Mme{constructor(e,t){super("UniformBuffer_"+nKe++,e?e.value:null),this.nodeUniform=e,this.groupNode=t,this.isNodeUniformBuffer=!0}set updateRanges(e){this.nodeUniform.updateRanges=e}get updateRanges(){return this.nodeUniform.updateRanges}addUpdateRange(e,t){this.nodeUniform.addUpdateRange(e,t)}clearUpdateRanges(){this.nodeUniform.clearUpdateRanges()}get byteLength(){return Cme(this.buffer.byteLength)}get buffer(){return this.nodeUniform.value}}class rKe extends Mme{constructor(e){super(e),this.isUniformsGroup=!0,this._values=null,this.uniforms=[],this._updateRangeCache=new Map,this._addedIndices=new Set}addUniformUpdateRange(e){const t=e.index;if(this._addedIndices.has(t))return;let r=this._updateRangeCache.get(t);r===void 0&&(r={start:0,count:0},this._updateRangeCache.set(t,r)),r.start=e.offset,r.count=e.itemSize,this._addedIndices.add(t),this.updateRanges.push(r)}clearUpdateRanges(){this._addedIndices.clear(),super.clearUpdateRanges()}addUniform(e){return this.uniforms.push(e),this}removeUniform(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}get values(){return this._values===null&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let e=this._buffer;if(e===null){const t=this.byteLength;e=new Float32Array(new ArrayBuffer(t)),this._buffer=e}return e}get byteLength(){const e=this.bytesPerElement;let t=0;for(let r=0,i=this.uniforms.length;r<i;r++){const s=this.uniforms[r],a=s.boundary,o=s.itemSize*e,l=t%PA,u=l%a,d=l+u;t+=u,d!==0&&PA-d<o&&(t+=PA-d),s.offset=t/e,s.index=r,t+=o}return Math.ceil(t/PA)*PA}update(){let e=!1;for(const t of this.uniforms)this.updateByType(t)===!0&&(e=!0);return e}release(){super.release(),this._values=null}updateByType(e){if(e.isNumberUniform)return this.updateNumber(e);if(e.isVector2Uniform)return this.updateVector2(e);if(e.isVector3Uniform)return this.updateVector3(e);if(e.isVector4Uniform)return this.updateVector4(e);if(e.isColorUniform)return this.updateColor(e);if(e.isMatrix3Uniform)return this.updateMatrix3(e);if(e.isMatrix4Uniform)return this.updateMatrix4(e);sn("WebGPUUniformsGroup: Unsupported uniform type.",e)}updateNumber(e){let t=!1;const r=this.values,i=e.getValue(),s=e.offset,a=e.getType();if(r[s]!==i){const o=this._getBufferForType(a);o[s]=r[s]=i,t=!0,this.addUniformUpdateRange(e)}return t}updateVector2(e){let t=!1;const r=this.values,i=e.getValue(),s=e.offset,a=e.getType();if(r[s+0]!==i.x||r[s+1]!==i.y){const o=this._getBufferForType(a);o[s+0]=r[s+0]=i.x,o[s+1]=r[s+1]=i.y,t=!0,this.addUniformUpdateRange(e)}return t}updateVector3(e){let t=!1;const r=this.values,i=e.getValue(),s=e.offset,a=e.getType();if(r[s+0]!==i.x||r[s+1]!==i.y||r[s+2]!==i.z){const o=this._getBufferForType(a);o[s+0]=r[s+0]=i.x,o[s+1]=r[s+1]=i.y,o[s+2]=r[s+2]=i.z,t=!0,this.addUniformUpdateRange(e)}return t}updateVector4(e){let t=!1;const r=this.values,i=e.getValue(),s=e.offset,a=e.getType();if(r[s+0]!==i.x||r[s+1]!==i.y||r[s+2]!==i.z||r[s+3]!==i.w){const o=this._getBufferForType(a);o[s+0]=r[s+0]=i.x,o[s+1]=r[s+1]=i.y,o[s+2]=r[s+2]=i.z,o[s+3]=r[s+3]=i.w,t=!0,this.addUniformUpdateRange(e)}return t}updateColor(e){let t=!1;const r=this.values,i=e.getValue(),s=e.offset;if(r[s+0]!==i.r||r[s+1]!==i.g||r[s+2]!==i.b){const a=this.buffer;a[s+0]=r[s+0]=i.r,a[s+1]=r[s+1]=i.g,a[s+2]=r[s+2]=i.b,t=!0,this.addUniformUpdateRange(e)}return t}updateMatrix3(e){let t=!1;const r=this.values,i=e.getValue().elements,s=e.offset;if(r[s+0]!==i[0]||r[s+1]!==i[1]||r[s+2]!==i[2]||r[s+4]!==i[3]||r[s+5]!==i[4]||r[s+6]!==i[5]||r[s+8]!==i[6]||r[s+9]!==i[7]||r[s+10]!==i[8]){const a=this.buffer;a[s+0]=r[s+0]=i[0],a[s+1]=r[s+1]=i[1],a[s+2]=r[s+2]=i[2],a[s+4]=r[s+4]=i[3],a[s+5]=r[s+5]=i[4],a[s+6]=r[s+6]=i[5],a[s+8]=r[s+8]=i[6],a[s+9]=r[s+9]=i[7],a[s+10]=r[s+10]=i[8],t=!0,this.addUniformUpdateRange(e)}return t}updateMatrix4(e){let t=!1;const r=this.values,i=e.getValue().elements,s=e.offset;return sKe(r,i,s)===!1&&(this.buffer.set(i,s),iKe(r,i,s),t=!0,this.addUniformUpdateRange(e)),t}_getBufferForType(e){return e==="int"||e==="ivec2"||e==="ivec3"||e==="ivec4"?new Int32Array(this.buffer.buffer):e==="uint"||e==="uvec2"||e==="uvec3"||e==="uvec4"?new Uint32Array(this.buffer.buffer):this.buffer}}function iKe(n,e,t){for(let r=0,i=e.length;r<i;r++)n[t+r]=e[r]}function sKe(n,e,t){for(let r=0,i=e.length;r<i;r++)if(n[t+r]!==e[r])return!1;return!0}let aKe=0;class Rme extends rKe{constructor(e,t){super(e),this.id=aKe++,this.groupNode=t,this.isNodeUniformsGroup=!0}}
vendor: 5,417 bytes, lines 4324-4401
4324class Pme extends Eme{constructor(e,t){super(e),this._texture=t,this.version=-1,this.generation=null,this.samplerKey="",this.isSampler=!0}set texture(e){this._texture!==e&&(this._texture=e,this.reset())}get texture(){return this._texture}update(){const{texture:e,version:t}=this;return t!==e.version?(this.version=e.version,!0):!1}reset(){this.generation=null,this.version=-1}release(){this._texture=null}}let oKe=0;class lKe extends Pme{constructor(e,t){super(e,t),this.id=oKe++,this.store=!1,this.mipLevel=0,this.isSampledTexture=!0}}class IR extends lKe{constructor(e,t,r,i=null){super(e,t?t.value:null),this.textureNode=t,this.groupNode=r,this.access=i}update(){const{textureNode:e}=this;return this.texture!==e.value?(this.texture=e.value,!0):super.update()}}class Lme extends IR{constructor(e,t,r,i=null){super(e,t,r,i),this.isSampledCubeTexture=!0}}class aU extends IR{constructor(e,t,r,i=null){super(e,t,r,i),this.isSampledTexture3D=!0}}const $J={bitcast_int_uint:new ra("uint tsl_bitcast_int_to_uint ( int x ) { return floatBitsToUint( intBitsToFloat ( x ) ); }"),bitcast_uint_int:new ra("uint tsl_bitcast_uint_to_int ( uint x ) { return floatBitsToInt( uintBitsToFloat ( x ) ); }"),textureGather:new ra(` 4325vec4 tsl_textureGather( const int comp, sampler2D map, vec2 coord, ivec2 offset, bool flipY ) { 4326 if ( flipY ) offset.y = - offset.y; 4327 vec2 size = vec2( textureSize( map, 0 ) ); 4328 vec2 st = floor( coord * size + vec2( offset ) - 0.5 ); 4329 vec4 ij = vec4( st + 0.5, st + 1.5 ) / size.xyxy; 4330 vec4 ret = vec4( 4331 textureLod( map, ij.xw, 0.0 )[ comp ], 4332 textureLod( map, ij.zw, 0.0 )[ comp ], 4333 textureLod( map, ij.zy, 0.0 )[ comp ], 4334 textureLod( map, ij.xy, 0.0 )[ comp ] 4335 ); 4336 return flipY ? ret.wzyx : ret; 4337} 4338`),textureGatherArray:new ra(` 4339vec4 tsl_textureGather_array( const int comp, sampler2DArray map, vec3 coord, ivec2 offset, bool flipY ) { 4340 if ( flipY ) offset.y = - offset.y; 4341 vec2 size = vec2( textureSize( map, 0 ).xy ); 4342 vec2 st = floor( coord.xy * size + vec2( offset ) - 0.5 ); 4343 vec4 ij = vec4( st + 0.5, st + 1.5 ) / size.xyxy; 4344 vec4 ret = vec4( 4345 textureLod( map, vec3( ij.xw, coord.z ), 0.0 )[ comp ], 4346 textureLod( map, vec3( ij.zw, coord.z ), 0.0 )[ comp ], 4347 textureLod( map, vec3( ij.zy, coord.z ), 0.0 )[ comp ], 4348 textureLod( map, vec3( ij.xy, coord.z ), 0.0 )[ comp ] 4349 ); 4350 return flipY ? ret.wzyx : ret; 4351} 4352`),textureGatherCompare:new ra(` 4353vec4 tsl_textureGatherCompare( sampler2DShadow map, vec2 coord, ivec2 offset, float ref, bool flipY ) { 4354 if ( flipY ) offset.y = - offset.y; 4355 vec2 size = vec2( textureSize( map, 0 ) ); 4356 vec2 st = floor( coord * size + vec2( offset ) - 0.5 ); 4357 vec4 ij = vec4( st + 0.5, st + 1.5 ) / size.xyxy; 4358 vec4 ret = vec4( 4359 textureLod( map, vec3( ij.xw, ref ), 0.0 ), 4360 textureLod( map, vec3( ij.zw, ref ), 0.0 ), 4361 textureLod( map, vec3( ij.zy, ref ), 0.0 ), 4362 textureLod( map, vec3( ij.xy, ref ), 0.0 ) 4363 ); 4364 return flipY ? ret.wzyx : ret; 4365} 4366`),textureGatherCompareArray:new ra(` 4367vec4 tsl_textureGatherCompare_array( sampler2DArrayShadow map, vec3 coord, ivec2 offset, float ref, bool flipY ) { 4368 if ( flipY ) offset.y = - offset.y; 4369 vec2 size = vec2( textureSize( map, 0 ).xy ); 4370 vec2 st = floor( coord.xy * size + vec2( offset ) - 0.5 ); 4371 vec4 ij = vec4( st + 0.5, st + 1.5 ) / size.xyxy; 4372 vec4 ret = vec4( 4373 texture( map, vec4( ij.xw, coord.z, ref ) ), 4374 texture( map, vec4( ij.zw, coord.z, ref ) ), 4375 texture( map, vec4( ij.zy, coord.z, ref ) ), 4376 texture( map, vec4( ij.xy, coord.z, ref ) ) 4377 ); 4378 return flipY ? ret.wzyx : ret; 4379} 4380`)},cKe={textureDimensions:"textureSize",equals:"equal",bitcast_float_int:"floatBitsToInt",bitcast_int_float:"intBitsToFloat",bitcast_uint_float:"uintBitsToFloat",bitcast_float_uint:"floatBitsToUint",bitcast_uint_int:"tsl_bitcast_uint_to_int",bitcast_int_uint:"tsl_bitcast_int_to_uint",floatpack_snorm_2x16:"packSnorm2x16",floatpack_unorm_2x16:"packUnorm2x16",floatpack_float16_2x16:"packHalf2x16",floatunpack_snorm_2x16:"unpackSnorm2x16",floatunpack_unorm_2x16:"unpackUnorm2x16",floatunpack_float16_2x16:"unpackHalf2x16"},HJ={low:"lowp",medium:"mediump",high:"highp"},WJ={swizzleAssign:!0,storageBuffer:!1},XJ={perspective:"smooth",linear:"noperspective"},YJ={centroid:"centroid"},QJ=` 4381precision highp float; 4382precision highp int; 4383precision highp sampler2D; 4384precision highp sampler3D; 4385precision highp samplerCube; 4386precision highp sampler2DArray; 4387 4388precision highp usampler2D; 4389precision highp usampler3D; 4390precision highp usamplerCube; 4391precision highp usampler2DArray; 4392 4393precision highp isampler2D; 4394precision highp isampler3D; 4395precision highp isamplerCube; 4396precision highp isampler2DArray; 4397 4398precision highp sampler2DShadow; 4399precision highp sampler2DArrayShadow; 4400precision highp samplerCubeShadow; 4401`;class uKe extends _me{constructor(e,t){super(e,t,new UQe),this.uniformGroups={},this.transforms=[],this.extensions={},this.builtins={vertex:[],fragment:[],compute:[]}}needsToWorkingColorSpace(e){return e.isVideoTexture===!0&&e.colorSpace!==Iu}_include(e){const t=$J[e];return t.build(this),this.addInclude(t),t}getMethod(e){return $J[e]!==void 0&&this._include(e),cKe[e]||e}getBitcastMethod(e,t){return this.getMethod(`bitcast_${t}_${e}`)}getFloatPackingMethod(e){return this.getMethod(`floatpack_${e}_2x16`)}getFloatUnpackingMethod(e){return this.getMethod(`floatunpack_${e}_2x16`)}getTernary(e,t,r){return`${e} ? ${t} : ${r}`}getOutputStructName(){return""}buildFunctionCode(e){const t=e.layout,r=this.flowShaderNode(e),i=[];
4401for(const a of t.inputs)i.push(this.getType(a.type)+" "+a.name);return`${this.getType(t.type)} ${t.name}( ${i.join(", ")} ) { 4402 4403 ${r.vars} 4404 4405${r.code} 4406 return ${r.result}; 4407 4408}`}setupPBO(e){const t=e.value;if(t.pbo===void 0){const r=t.array,i=t.count*t.itemSize,{itemSize:s}=t,a=t.array.constructor.name.toLowerCase().includes("int");let o=a?G1:wy;s===2?o=a?q1:fl:s===3?o=a?DV:by:s===4&&(o=a?b_:to);const l={Float32Array:ia,Uint8Array:Zs,Uint16Array:jh,Uint32Array:ts,Int8Array:a1,Int16Array:o1,Int32Array:oo,Uint8ClampedArray:Zs},u=Math.pow(2,Math.ceil(Math.log2(Math.sqrt(i/s))));let d=Math.ceil(i/s/u);u*d*s<i&&d++;const h=u*d*s,f=new r.constructor(h);f.set(r,0),t.array=f;const p=new YV(t.array,u,d,o,l[t.array.constructor.name]||ia);p.needsUpdate=!0,p.isPBOTexture=!0;const g=new L0(p,null,null);g.setPrecision("high"),t.pboNode=g,t.pbo=g.value,this.getUniformFromNode(t.pboNode,"texture",this.shaderStage,this.context.nodeName)}}getPropertyName(e,t=this.shaderStage){return e.isNodeUniform&&e.node.isTextureNode!==!0&&e.node.isBufferNode!==!0?e.name:super.getPropertyName(e,t)}generatePBO(e){const{node:t,indexNode:r}=e,i=t.value;if(this.renderer.backend.has(i)){const d=this.renderer.backend.get(i);d.pbo=i.pbo}const s=this.getUniformFromNode(i.pboNode,"texture",this.shaderStage,this.context.nodeName),a=this.getPropertyName(s);this.increaseUsage(r);const o=r.build(this,"uint"),l=this.getDataFromNode(e);let u=l.propertyName;if(u===void 0){const d=this.getVarFromNode(e);u=this.getPropertyName(d);const h=this.getDataFromNode(t);let f=h.propertySizeName;f===void 0&&(f=u+"Size",this.getVarFromNode(t,f,"uint"),this.addLineFlowCode(`${f} = uint( textureSize( ${a}, 0 ).x )`,e),h.propertySizeName=f);const{itemSize:p}=i,g="."+Ty.join("").slice(0,p),A=`ivec2(${o} % ${f}, ${o} / ${f})`,x=this.generateTextureLoad(null,a,A,"0",null,null);let b="vec4";i.pbo.type===ts?b="uvec4":i.pbo.type===oo&&(b="ivec4"),this.addLineFlowCode(`${u} = ${b}(${x})${g}`,e),l.propertyName=u}return u}generateTextureLoad(e,t,r,i,s,a){i===null&&(i="0");let o;return s?a?o=`texelFetchOffset( ${t}, ivec3( ${r}, ${s} ), int( ${i} ), ${a} )`:o=`texelFetch( ${t}, ivec3( ${r}, ${s} ), int( ${i} ) )`:a?o=`texelFetchOffset( ${t}, ${r}, int( ${i} ), ${a} )`:o=`texelFetch( ${t}, ${r}, int( ${i} ) )`,e!==null&&e.isDepthTexture&&(o+=".x"),o}generateTexture(e,t,r,i,s){return i&&(r=`vec3( ${r}, ${i} )`),e.isDepthTexture?s?`textureOffset( ${t}, ${r}, ${s} ).x`:`texture( ${t}, ${r} ).x`:s?`textureOffset( ${t}, ${r}, ${s} )`:`texture( ${t}, ${r} )`}generateTextureLevel(e,t,r,i,s,a){return s&&(r=`vec3( ${r}, ${s} )`),a?`textureLodOffset( ${t}, ${r}, ${i}, ${a} )`:`textureLod( ${t}, ${r}, ${i} )`}generateTextureBias(e,t,r,i,s,a){return s&&(r=`vec3( ${r}, ${s} )`),a?`textureOffset( ${t}, ${r}, ${a}, ${i} )`:`texture( ${t}, ${r}, ${i} )`}generateTextureGrad(e,t,r,i,s,a){return s&&(r=`vec3( ${r}, ${s} )`),a?`textureGradOffset( ${t}, ${r}, ${i[0]}, ${i[1]}, ${a} )`:`textureGrad( ${t}, ${r}, ${i[0]}, ${i[1]} )`}generateTextureCompare(e,t,r,i,s,a,o=this.shaderStage){if(o==="fragment")return e.isCubeTexture?`texture( ${t}, vec4( ${r}, ${i} ) )`:s?a?`textureOffset( ${t}, vec4( ${r}, ${s}, ${i} ), ${a} )`:`texture( ${t}, vec4( ${r}, ${s}, ${i} ) )`:a?`textureOffset( ${t}, vec3( ${r}, ${i} ), ${a} )`:`texture( ${t}, vec3( ${r}, ${i} ) )`;sn(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${o} shader.`)}generateTextureGather(e,t,r,i,s,a,o){return e.isDepthTexture&&(i="0"),a===null&&(a="ivec2( 0 )"),o===null&&(o="false"),s?(this._include("textureGatherArray"),`tsl_textureGather_array( ${i}, ${t}, vec3( ${r}, ${s} ), ${a}, ${o} )`):(this._include("textureGather"),`tsl_textureGather( ${i}, ${t}, ${r}, ${a}, ${o} )`)}generateTextureGatherCompare(e,t,r,i,s,a,o){return a===null&&(a="ivec2( 0 )"),o===null&&(o="false"),s?(this._include("textureGatherCompareArray"),`tsl_textureGatherCompare_array( ${t}, vec3( ${r}, ${s} ), ${a}, ${i}, ${o} )`):(this._include("textureGatherCompare"),`tsl_textureGatherCompare( ${t}, ${r}, ${a}, ${i}, ${o} )`)}getUniforms(e){const t=this.uniforms[e],r=[],i={};for(const a of t){let o=null,l=!1;if(a.type==="texture"||a.type==="texture3D"){const u=a.node,d=u.value;let h="";(d.isDataTexture===!0||d.isData3DTexture===!0)&&(d.type===ts?h="u":d.type===oo&&(h="i")),a.type==="texture3D"&&d.isArrayTexture===!1?o=`${h}sampler3D ${a.name};`:d.compareFunction&&u.compareNode!==null?d.isArrayTexture===!0?o=`sampler2DArrayShadow ${a.name};`:o=`sampler2DShadow ${a.name};`:d.isArrayTexture===!0||d.isDataArrayTexture===!0||d.isCompressedArrayTexture===!0?o=`${h}sampler2DArray ${a.name};`:o=`${h}sampler2D ${a.name};`}else if(a.type==="cubeTexture")o=`samplerCube ${a.name};`;else if(a.type==="cubeDepthTexture")a.node.value.compareFunction?o=`samplerCubeShadow ${a.name};`:o=`samplerCube ${a.name};`;else if(a.type==="buffer"){const u=a.node,d=this.getType(u.bufferType),h=u.bufferCount,f=h>0?h:"";o=`${u.name} { 4409 ${d} ${a.name}[${f}]; 4410}; 4411`}else{const u=a.groupNode.name;if(i[u]===void 0){const d=this.uniformGroups[u];if(d!==void 0){const h=[];for(const f of d.uniforms){const p=f.getType(),g=this.getVectorType(p),A=f.nodeUniform.node.precision;let x=`${g} ${f.name};`;A!==null&&(x=HJ[A]+" "+x),h.push(" "+x)}i[u]=h}}l=!0}if(!l){const u=a.node.precision;u!==null&&(o=HJ[u]+" "+o),o="uniform "+o,r.push(o)}}let s="";for(const a in i){const o=i[a];s+=this._getGLSLUniformStruct(a,o.join(` 4412`))+` 4413`}return s+=r.join(` 4414`),s}getTypeFromAttribute(e){let t=super.getTypeFromAttribute(e);
4414if(/^[iu]/.test(t)&&e.gpuType!==oo){let r=e;e.isInterleavedBufferAttribute&&(r=e.data);const i=r.array;i instanceof Uint32Array||i instanceof Int32Array||(t=t.slice(1))}return t}getAttributes(e){let t="";if(e==="vertex"||e==="compute"){const r=this.getAttributesArray();let i=0;for(const s of r)t+=`layout( location = ${i++} ) in ${s.type} ${s.name}; 4415`}return t}getStructMembers(e){const t=[];for(const r of e.members)t.push(` ${r.type} ${r.name};`);return t.join(` 4416`)}getStructs(e){const t=[],r=this.structs[e],i=[];for(const s of r)if(s.output)for(const a of s.members)i.push(`layout( location = ${a.index} ) out ${a.type} ${a.name};`);else{let a="struct "+s.name+` { 4417`;a+=this.getStructMembers(s),a+=` 4418}; 4419`,t.push(a)}return e==="fragment"&&i.length===0&&i.push(`layout( location = 0 ) out ${this.getOutputType()} fragColor;`),` 4420`+i.join(` 4421`)+` 4422 4423`+t.join(` 4424`)}getVaryings(e){let t="";const r=this.varyings;if(e==="vertex"||e==="compute")for(const i of r){e==="compute"&&(i.needsInterpolation=!0);const s=this.getType(i.type);if(i.needsInterpolation)if(i.interpolationType){const a=XJ[i.interpolationType]||i.interpolationType,o=YJ[i.interpolationSampling]||"";t+=`${a} ${o} out ${s} ${i.name}; 4425`}else{const a=s.includes("int")||s.includes("uv")||s.includes("iv")?"flat ":"";t+=`${a}out ${s} ${i.name}; 4426`}else t+=`${s} ${i.name}; 4427`}else if(e==="fragment"){for(const i of r)if(i.needsInterpolation){const s=this.getType(i.type);if(i.interpolationType){const a=XJ[i.interpolationType]||i.interpolationType,o=YJ[i.interpolationSampling]||"";t+=`${a} ${o} in ${s} ${i.name}; 4428`}else{const a=s.includes("int")||s.includes("uv")||s.includes("iv")?"flat ":"";t+=`${a}in ${s} ${i.name}; 4429`}}}for(const i of this.builtins[e])t+=`${i}; 4430`;return t}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce((r,i)=>r*i,1)}u`}getSubgroupSize(){sn("GLSLNodeBuilder: WebGLBackend does not support the subgroupSize node")}getInvocationSubgroupIndex(){sn("GLSLNodeBuilder: WebGLBackend does not support the invocationSubgroupIndex node")}getSubgroupIndex(){sn("GLSLNodeBuilder: WebGLBackend does not support the subgroupIndex node")}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":"nodeUniformDrawId"}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(e,t,r=this.shaderStage){const i=this.extensions[r]||(this.extensions[r]=new Map);i.has(e)===!1&&i.set(e,{name:e,behavior:t})}getExtensions(e){const t=[];if(e==="vertex"){const i=this.renderer.backend.extensions;this.object.isBatchedMesh&&i.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",e)}const r=this.extensions[e];if(r!==void 0)for(const{name:i,behavior:s}of r.values())t.push(`#extension ${i} : ${s}`);return t.join(` 4431`)}getClipDistance(){return"gl_ClipDistance"}isAvailable(e){let t=WJ[e];if(t===void 0){let r;switch(t=!1,e){case"float32Filterable":r="OES_texture_float_linear";break;case"clipDistance":r="WEBGL_clip_cull_distance";break}if(r!==void 0){const i=this.renderer.backend.extensions;i.has(r)&&(i.get(r),t=!0)}WJ[e]=t}return t}isFlipY(){return!0}enableHardwareClipping(e){this.enableExtension("GL_ANGLE_clip_cull_distance","require"),this.builtins.vertex.push(`out float gl_ClipDistance[ ${e} ]`)}
4431enableMultiview(){this.enableExtension("GL_OVR_multiview2","require","fragment"),this.enableExtension("GL_OVR_multiview2","require","vertex"),this.builtins.vertex.push("layout(num_views = 2) in")}registerTransform(e,t){this.transforms.push({varyingName:e,attributeNode:t})}getTransforms(){const e=this.transforms;let t="";for(let r=0;r<e.length;r++){const i=e[r],s=this.getPropertyName(i.attributeNode);s&&(t+=`${i.varyingName} = ${s}; 4432 `)}return t}_getGLSLUniformStruct(e,t){return` 4433layout( std140 ) uniform ${e} { 4434${t} 4435};`}_getGLSLVertexCode(e){return`#version 300 es 4436 4437${this.getSignature()} 4438 4439// extensions 4440${e.extensions} 4441 4442// precision 4443${QJ} 4444 4445// structs 4446${e.structs} 4447 4448// uniforms 4449${e.uniforms} 4450 4451// varyings 4452${e.varyings} 4453 4454// attributes 4455${e.attributes} 4456 4457// vars 4458${e.vars} 4459 4460// codes 4461${e.codes} 4462 4463void main() { 4464 4465 // transforms 4466 ${e.transforms} 4467 4468 // flow 4469 ${e.flow} 4470 4471 gl_PointSize = 1.0; 4472 4473} 4474`}_getGLSLFragmentCode(e){return`#version 300 es 4475 4476${this.getSignature()} 4477 4478// extensions 4479${e.extensions} 4480 4481// precision 4482${QJ} 4483 4484// structs 4485${e.structs} 4486 4487// uniforms 4488${e.uniforms} 4489 4490// varyings 4491${e.varyings} 4492 4493// vars 4494${e.vars} 4495 4496// codes 4497${e.codes} 4498 4499void main() { 4500 4501 // flow 4502 ${e.flow} 4503 4504} 4505`}buildCode(){const e=this.material!==null?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){let r=`// code 4506 4507`;r+=this.flowCode[t];const i=this.flowNodes[t],s=i[i.length-1];for(const o of i){const l=this.getFlowData(o),u=o.name;u&&(r.length>0&&(r+=` 4508`),r+=` // flow -> ${u} 4509 `),r+=`${l.code} 4510 `,o===s&&t!=="compute"&&(r+=`// result 4511 `,t==="vertex"?(r+="gl_Position = ",r+=`${this.format(l.result,s.getNodeType(this),"vec4")};`):t==="fragment"&&(o.outputNode.isOutputStructNode||(r+="fragColor = ",r+=`${this.format(l.result,s.getNodeType(this),this.getOutputType())};`)))}const a=e[t];if(a.extensions=this.getExtensions(t),a.uniforms=this.getUniforms(t),a.attributes=this.getAttributes(t),a.varyings=this.getVaryings(t),a.vars=this.getVars(t,!0),a.structs=this.getStructs(t),a.codes=this.getCodes(t),a.transforms=this.getTransforms(t),a.flow=r,t==="vertex"){const o=this.renderer.backend.extensions;this.object.isBatchedMesh&&o.has("WEBGL_multi_draw")===!1&&(a.uniforms+=` 4512uniform uint nodeUniformDrawId; 4513`)}}this.material!==null?(this.vertexShader=this._getGLSLVertexCode(e.vertex),this.fragmentShader=this._getGLSLFragmentCode(e.fragment)):this.computeShader=this._getGLSLVertexCode(e.compute)}getUniformFromNode(e,t,r,i=null){const s=super.getUniformFromNode(e,t,r,i),a=this.getDataFromNode(e,r,this.globalCache);let o=a.uniformGPU;if(o===void 0){const l=e.groupNode,u=l.name,d=this.getBindGroupArray(u,r);if(t==="texture")o=new IR(s.name,s.node,l),d.push(o);else if(t==="cubeTexture"||t==="cubeDepthTexture")o=new Lme(s.name,s.node,l),d.push(o);else if(t==="texture3D")o=new aU(s.name,s.node,l),d.push(o);else if(t==="buffer"){s.name=`buffer${e.id}`;const h=this.getSharedDataFromNode(e);let f=h.buffer;f===void 0&&(e.name=`NodeBuffer_${e.id}`,f=new kme(e,l),f.name=e.name,h.buffer=f),d.push(f),o=f}else{let h=this.uniformGroups[u];h===void 0?(h=new Rme(u,l),this.uniformGroups[u]=h,d.push(h)):d.indexOf(h)===-1&&d.push(h),o=this.getNodeUniform(s,t);const f=o.name;h.uniforms.some(g=>g.name===f)||h.addUniform(o)}a.uniformGPU=o}return s}}let BL=null,L2=null;class Ome{constructor(e={}){this.parameters=Object.assign({},e),this.data=new WeakMap,this.renderer=null,this.domElement=null,this.timestampQueryPool={[o0.RENDER]:null,[o0.COMPUTE]:null},this.trackTimestamp=e.trackTimestamp===!0}async init(e){this.renderer=e}get coordinateSystem(){}beginRender(){}finishRender(){}setXRTarget(){}beginCompute(){}finishCompute(){}draw(){}compute(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}updateBinding(){}createRenderPipeline(){}createComputePipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}updateSampler(){}destroySampler(){}createDefaultTexture(){}createTexture(){}updateTexture(){}generateMipmaps(){}destroyTexture(){}async copyTextureToBuffer(){}copyTextureToTexture(){}copyFramebufferToTexture(){}createAttribute(){}createIndexAttribute(){}createStorageAttribute(){}createUniformBuffer(){}destroyUniformBuffer(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}updateViewport(){}updateTimeStampUID(e){const t=this.get(e),r=this.renderer.info.frame;let i;e.isComputeNode===!0?i="c:"+this.renderer.info.compute.frameCalls:i="r:"+this.renderer.info.render.frameCalls,t.timestampUID=i+":"+e.id+":f"+r}getTimestampUID(e){return this.get(e).timestampUID}getTimestampFrames(e){const t=this.timestampQueryPool[e];return t?t.getTimestampFrames():[]}_getQueryPool(e){const t=e.startsWith("c:")?o0.COMPUTE:o0.RENDER;return this.timestampQueryPool[t]}getTimestamp(e){return this._getQueryPool(e).getTimestamp(e)}get hasTimestamp(){return!1}hasTimestampQuery(e){return this._getQueryPool(e).hasTimestampQuery(e)}isOccluded(){}async resolveTimestampsAsync(e="render"){if(!this.trackTimestamp){_i("WebGPURenderer: Timestamp tracking is disabled.");return}const t=this.timestampQueryPool[e];if(!t)return;const r=await t.resolveQueriesAsync();return this.renderer.info[e].timestamp=r,r}async getArrayBufferAsync(){}async hasFeatureAsync(){}hasFeature(){}getDrawingBufferSize(){return BL=BL||new Jt,this.renderer.getDrawingBufferSize(BL)}setScissorTest(){}getClearColor(){const e=this.renderer;return L2=L2||new XG,e.getClearColor(L2),L2.getRGB(L2),L2}getDomElement(){let e=this.domElement;return e===null&&(e=this.parameters.canvas!==void 0?this.parameters.canvas:Gce(),"setAttribute"in e&&e.setAttribute("data-engine",`three.js r${yy} webgpu`),this.domElement=e),e}hasCompatibility(){return!1}initRenderTarget(){}set(e,t){this.data.set(e,t)}get(e){let t=this.data.get(e);return t===void 0&&(t={},this.data.set(e,t)),t}has(e){return this.data.has(e)}delete(e){this.data.delete(e)}deleteBindGroupData(){}dispose(){}}let dKe=0;class hKe{constructor(e,t){this.buffers=[e.bufferGPU,t],this.type=e.type,this.bufferType=e.bufferType,this.pbo=e.pbo,this.byteLength=e.byteLength,this.bytesPerElement=e.BYTES_PER_ELEMENT,this.version=e.version,this.isInteger=e.isInteger,this.activeBufferIndex=0,this.baseId=e.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[this.activeBufferIndex^1]}switchBuffers(){this.activeBufferIndex^=1}}class fKe{constructor(e){this.backend=e}createAttribute(e,t){const r=this.backend,{gl:i}=r,s=e.array,a=e.usage||i.STATIC_DRAW,o=e.isInterleavedBufferAttribute?e.data:e,l=r.get(o);let u=l.bufferGPU;u===void 0&&(u=this._createBuffer(i,t,s,a),l.bufferGPU=u,l.bufferType=t,l.version=o.version);let d;if(s instanceof Float32Array)d=i.FLOAT;else if(typeof Float16Array<"u"&&s instanceof Float16Array)d=i.HALF_FLOAT;else if(s instanceof Uint16Array)e.isFloat16BufferAttribute?d=i.HALF_FLOAT:d=i.UNSIGNED_SHORT;else if(s instanceof Int16Array)d=i.SHORT;else if(s instanceof Uint32Array)d=i.UNSIGNED_INT;else if(s instanceof Int32Array)d=i.INT;else if(s instanceof Int8Array)d=i.BYTE;else if(s instanceof Uint8Array)d=i.UNSIGNED_BYTE;else if(s instanceof Uint8ClampedArray)d=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+s);let h={bufferGPU:u,bufferType:t,type:d,byteLength:s.byteLength,bytesPerElement:s.BYTES_PER_ELEMENT,version:e.version,pbo:e.pbo,isInteger:
4513d===i.INT||d===i.UNSIGNED_INT||e.gpuType===oo,id:dKe++};if(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute){const f=this._createBuffer(i,t,s,a);h=new hKe(h,f)}r.set(e,h)}updateAttribute(e){const t=this.backend,{gl:r}=t,i=e.array,s=e.isInterleavedBufferAttribute?e.data:e,a=t.get(s),o=a.bufferType,l=e.isInterleavedBufferAttribute?e.data.updateRanges:e.updateRanges;if(r.bindBuffer(o,a.bufferGPU),l.length===0)r.bufferSubData(o,0,i);else{for(let u=0,d=l.length;u<d;u++){const h=l[u];r.bufferSubData(o,h.start*i.BYTES_PER_ELEMENT,i,h.start,h.count)}s.clearUpdateRanges()}r.bindBuffer(o,null),a.version=s.version}destroyAttribute(e){const t=this.backend,{gl:r}=t;e.isInterleavedBufferAttribute&&t.delete(e.data);const i=t.get(e);r.deleteBuffer(i.bufferGPU),t.delete(e)}async getArrayBufferAsync(e,t=null,r=0,i=-1){const s=this.backend,{gl:a}=s,o=e.isInterleavedBufferAttribute?e.data:e,l=s.get(o),{bufferGPU:u}=l,d=i===-1?l.byteLength-r:i;let h;if(t===null)h=new Uint8Array(new ArrayBuffer(d));else if(t.isReadbackBuffer){if(t._mapped===!0)throw new Error("THREE.WebGPURenderer: ReadbackBuffer must be released before being used again.");const f=()=>{t.buffer=null,t._mapped=!1,t.removeEventListener("release",f),t.removeEventListener("dispose",f)};t.addEventListener("release",f),t.addEventListener("dispose",f),h=new Uint8Array(new ArrayBuffer(d)),t.buffer=h.buffer}else h=new Uint8Array(t);return a.bindBuffer(a.COPY_READ_BUFFER,u),a.getBufferSubData(a.COPY_READ_BUFFER,r,h),a.bindBuffer(a.COPY_READ_BUFFER,null),a.bindBuffer(a.COPY_WRITE_BUFFER,null),t&&t.isReadbackBuffer?t:h.buffer}_createBuffer(e,t,r,i){const s=e.createBuffer();return e.bindBuffer(t,s),e.bufferData(t,r,i),e.bindBuffer(t,null),s}}let W3,bm;class pKe{constructor(e){this.backend=e,this.gl=this.backend.gl,this.enabled={},this.parameters={},this.currentFlipSided=null,this.currentCullFace=null,this.currentProgram=null,this.currentBlendingEnabled=!1,this.currentBlending=null,this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentPremultipledAlpha=null,this.currentPolygonOffsetFactor=null,this.currentPolygonOffsetUnits=null,this.currentColorMask=null,this.currentDepthReversed=!1,this.currentDepthFunc=null,this.currentDepthMask=null,this.currentStencilFunc=null,this.currentStencilRef=null,this.currentStencilFuncMask=null,this.currentStencilFail=null,this.currentStencilZFail=null,this.currentStencilZPass=null,this.currentStencilMask=null,this.currentLineWidth=null,this.currentClippingPlanes=0,this.currentVAO=null,this.currentIndex=null,this.currentBoundFramebuffers={},this.currentDrawbuffers=new WeakMap,this.maxTextures=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),this.currentTextureSlot=null,this.currentBoundTextures={},this.currentBoundBufferBases={},this._init()}_init(){const e=this.gl;W3={[Ol]:e.FUNC_ADD,[AV]:e.FUNC_SUBTRACT,[xV]:e.FUNC_REVERSE_SUBTRACT},bm={[Mm]:e.ZERO,[vV]:e.ONE,[yV]:e.SRC_COLOR,[dw]:e.SRC_ALPHA,[EV]:e.SRC_ALPHA_SATURATE,[SV]:e.DST_COLOR,[wV]:e.DST_ALPHA,[bV]:e.ONE_MINUS_SRC_COLOR,[hw]:e.ONE_MINUS_SRC_ALPHA,[TV]:e.ONE_MINUS_DST_COLOR,[_V]:e.ONE_MINUS_DST_ALPHA};const t=e.getParameter(e.SCISSOR_BOX),r=e.getParameter(e.VIEWPORT);this.currentScissor=new Rr().fromArray(t),this.currentViewport=new Rr().fromArray(r),this._tempVec4=new Rr}enable(e){const{enabled:t}=this;t[e]!==!0&&(this.gl.enable(e),t[e]=!0)}disable(e){const{enabled:t}=this;t[e]!==!1&&(this.gl.disable(e),t[e]=!1)}setFlipSided(e){if(this.currentFlipSided!==e){const{gl:t}=this;e?t.frontFace(t.CW):t.frontFace(t.CCW),this.currentFlipSided=e}}setCullFace(e){const{gl:t}=this;e!==Lce?(this.enable(t.CULL_FACE),e!==this.currentCullFace&&(e===FI?t.cullFace(t.BACK):e===Oce?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):this.disable(t.CULL_FACE),this.currentCullFace=e}setLineWidth(e){const{currentLineWidth:t,gl:r}=this;e!==t&&(r.lineWidth(e),this.currentLineWidth=e)}setMRTBlending(e,t,r){const i=this.gl,s=this.backend.drawBuffersIndexedExt;if(!s){_i("WebGPURenderer: Multiple Render Targets (MRT) blending configuration is not fully supported in compatibility mode. The material blending will be used for all render targets.");return}for(let a=0;a<e.length;a++){const o=e[a];let l=null;
4513if(t!==null){const u=t.getBlendMode(o.name);u.blending===gV?l=r:u.blending!==qo&&(l=u)}else l=r;l!==null?this._setMRTBlendingIndex(a,l):s.blendFuncSeparateiOES(a,i.ONE,i.ZERO,i.ONE,i.ZERO)}}_setMRTBlendingIndex(e,t){const{gl:r}=this,i=this.backend.drawBuffersIndexedExt,s=t.blending,a=t.blendSrc,o=t.blendDst,l=t.blendEquation,u=t.premultipliedAlpha;if(s===Dv){const d=t.blendSrcAlpha!==null?t.blendSrcAlpha:a,h=t.blendDstAlpha!==null?t.blendDstAlpha:o,f=t.blendEquationAlpha!==null?t.blendEquationAlpha:l;i.blendEquationSeparateiOES(e,W3[l],W3[f]),i.blendFuncSeparateiOES(e,bm[a],bm[o],bm[d],bm[h])}else if(i.blendEquationSeparateiOES(e,r.FUNC_ADD,r.FUNC_ADD),u)switch(s){case dl:i.blendFuncSeparateiOES(e,r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case HA:i.blendFuncSeparateiOES(e,r.ONE,r.ONE,r.ONE,r.ONE);break;case WA:i.blendFuncSeparateiOES(e,r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case XA:i.blendFuncSeparateiOES(e,r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ZERO,r.ONE);break;default:i.blendFuncSeparateiOES(e,r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break}else switch(s){case dl:i.blendFuncSeparateiOES(e,r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case HA:i.blendFuncSeparateiOES(e,r.SRC_ALPHA,r.ONE,r.ONE,r.ONE);break;case WA:i.blendFuncSeparateiOES(e,r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case XA:i.blendFuncSeparateiOES(e,r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ZERO,r.ONE);break;default:i.blendFuncSeparateiOES(e,r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break}}setBlending(e,t,r,i,s,a,o,l){const{gl:u}=this;if(e===qo){this.currentBlendingEnabled===!0&&(this.disable(u.BLEND),this.currentBlendingEnabled=!1);return}if(this.currentBlendingEnabled===!1&&(this.enable(u.BLEND),this.currentBlendingEnabled=!0),e!==Dv){if(e!==this.currentBlending||l!==this.currentPremultipledAlpha){if((this.currentBlendEquation!==Ol||this.currentBlendEquationAlpha!==Ol)&&(u.blendEquation(u.FUNC_ADD),this.currentBlendEquation=Ol,this.currentBlendEquationAlpha=Ol),l)switch(e){case dl:u.blendFuncSeparate(u.ONE,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA);break;case HA:u.blendFunc(u.ONE,u.ONE);break;case WA:u.blendFuncSeparate(u.ZERO,u.ONE_MINUS_SRC_COLOR,u.ZERO,u.ONE);break;case XA:u.blendFuncSeparate(u.DST_COLOR,u.ONE_MINUS_SRC_ALPHA,u.ZERO,u.ONE);break;default:sn("WebGLState: Invalid blending: ",e);break}else switch(e){case dl:u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA);break;case HA:u.blendFuncSeparate(u.SRC_ALPHA,u.ONE,u.ONE,u.ONE);break;case WA:sn("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case XA:sn("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:sn("WebGLState: Invalid blending: ",e);break}this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentBlending=e,this.currentPremultipledAlpha=l}return}s=s||t,a=a||r,o=o||i,(t!==this.currentBlendEquation||s!==this.currentBlendEquationAlpha)&&(u.blendEquationSeparate(W3[t],W3[s]),this.currentBlendEquation=t,this.currentBlendEquationAlpha=s),(r!==this.currentBlendSrc||i!==this.currentBlendDst||a!==this.currentBlendSrcAlpha||o!==this.currentBlendDstAlpha)&&(u.blendFuncSeparate(bm[r],bm[i],bm[a],bm[o]),this.currentBlendSrc=r,this.currentBlendDst=i,this.currentBlendSrcAlpha=a,this.currentBlendDstAlpha=o),this.currentBlending=e,this.currentPremultipledAlpha=!1}setColorMask(e){this.currentColorMask!==e&&(this.gl.colorMask(e,e,e,e),this.currentColorMask=e)}setDepthTest(e){const{gl:t}=this;e?this.enable(t.DEPTH_TEST):this.disable(t.DEPTH_TEST)}setReversedDepth(e){if(this.currentDepthReversed!==e){const t=this.backend.extensions.get("EXT_clip_control");e?t.clipControlEXT(t.LOWER_LEFT_EXT,t.ZERO_TO_ONE_EXT):t.clipControlEXT(t.LOWER_LEFT_EXT,t.NEGATIVE_ONE_TO_ONE_EXT),this.currentDepthReversed=e}}setDepthMask(e){this.currentDepthMask!==e&&(this.gl.depthMask(e),this.currentDepthMask=e)}setDepthFunc(e){if(this.currentDepthReversed&&(e=BV[e]),this.currentDepthFunc!==e){const{gl:t}=this;switch(e){case c5:t.depthFunc(t.NEVER);break;case u5:t.depthFunc(t.ALWAYS);break;case d5:t.depthFunc(t.LESS);break;case T1:t.depthFunc(t.LEQUAL);break;case h5:t.depthFunc(t.EQUAL);break;case f5:t.depthFunc(t.GEQUAL);break;case p5:t.depthFunc(t.GREATER);break;case m5:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}this.currentDepthFunc=e}}
4513scissor(e,t,r,i){const s=this._tempVec4.set(e,t,r,i);if(this.currentScissor.equals(s)===!1){const{gl:a}=this;a.scissor(s.x,s.y,s.z,s.w),this.currentScissor.copy(s)}}viewport(e,t,r,i){const s=this._tempVec4.set(e,t,r,i);if(this.currentViewport.equals(s)===!1){const{gl:a}=this;a.viewport(s.x,s.y,s.z,s.w),this.currentViewport.copy(s)}}setScissorTest(e){const t=this.gl;e?this.enable(t.SCISSOR_TEST):this.disable(t.SCISSOR_TEST)}setStencilTest(e){const{gl:t}=this;e?this.enable(t.STENCIL_TEST):this.disable(t.STENCIL_TEST)}setStencilMask(e){this.currentStencilMask!==e&&(this.gl.stencilMask(e),this.currentStencilMask=e)}setStencilFunc(e,t,r){(this.currentStencilFunc!==e||this.currentStencilRef!==t||this.currentStencilFuncMask!==r)&&(this.gl.stencilFunc(e,t,r),this.currentStencilFunc=e,this.currentStencilRef=t,this.currentStencilFuncMask=r)}setStencilOp(e,t,r){(this.currentStencilFail!==e||this.currentStencilZFail!==t||this.currentStencilZPass!==r)&&(this.gl.stencilOp(e,t,r),this.currentStencilFail=e,this.currentStencilZFail=t,this.currentStencilZPass=r)}setMaterial(e,t,r){const{gl:i}=this;e.side===Fa?this.disable(i.CULL_FACE):this.enable(i.CULL_FACE);let s=e.side===us;t&&(s=!s),this.setFlipSided(s),e.blending===dl&&e.transparent===!1?this.setBlending(qo):this.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),this.setDepthFunc(e.depthFunc),this.setDepthTest(e.depthTest),this.setDepthMask(e.depthWrite),this.setColorMask(e.colorWrite);const a=e.stencilWrite;if(this.setStencilTest(a),a&&(this.setStencilMask(e.stencilWriteMask),this.setStencilFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),this.setStencilOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),this.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),e.alphaToCoverage===!0&&this.backend.renderer.currentSamples>0?this.enable(i.SAMPLE_ALPHA_TO_COVERAGE):this.disable(i.SAMPLE_ALPHA_TO_COVERAGE),r>0&&this.currentClippingPlanes!==r)for(let l=0;l<8;l++)l<r?this.enable(12288+l):this.disable(12288+l)}setPolygonOffset(e,t,r){const{gl:i}=this;e?(this.enable(i.POLYGON_OFFSET_FILL),(this.currentPolygonOffsetFactor!==t||this.currentPolygonOffsetUnits!==r)&&(i.polygonOffset(t,r),this.currentPolygonOffsetFactor=t,this.currentPolygonOffsetUnits=r)):this.disable(i.POLYGON_OFFSET_FILL)}useProgram(e){return this.currentProgram!==e?(this.gl.useProgram(e),this.currentProgram=e,!0):!1}setVertexState(e,t=null){const r=this.gl;return this.currentVAO!==e||this.currentIndex!==t?(r.bindVertexArray(e),t!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t),this.currentVAO=e,this.currentIndex=t,!0):!1}resetVertexState(){const e=this.gl;e.bindVertexArray(null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),this.currentVAO=null,this.currentIndex=null}bindFramebuffer(e,t){const{gl:r,currentBoundFramebuffers:i}=this;return i[e]!==t?(r.bindFramebuffer(e,t),i[e]=t,e===r.DRAW_FRAMEBUFFER&&(i[r.FRAMEBUFFER]=t),e===r.FRAMEBUFFER&&(i[r.DRAW_FRAMEBUFFER]=t),!0):!1}drawBuffers(e,t){const{gl:r}=this;let i=[],s=!1;if(e.textures!==null){i=this.currentDrawbuffers.get(t),i===void 0&&(i=[],this.currentDrawbuffers.set(t,i));const a=e.textures;if(i.length!==a.length||i[0]!==r.COLOR_ATTACHMENT0){for(let o=0,l=a.length;o<l;o++)i[o]=r.COLOR_ATTACHMENT0+o;i.length=a.length,s=!0}}else i[0]!==r.BACK&&(i[0]=r.BACK,s=!0);s&&r.drawBuffers(i)}activeTexture(e){const{gl:t,currentTextureSlot:r,maxTextures:i}=this;e===void 0&&(e=t.TEXTURE0+i-1),r!==e&&(t.activeTexture(e),this.currentTextureSlot=e)}bindTexture(e,t,r){const{gl:i,currentTextureSlot:s,currentBoundTextures:a,maxTextures:o}=this;r===void 0&&(s===null?r=i.TEXTURE0+o-1:r=s);let l=a[r];l===void 0&&(l={type:void 0,texture:void 0},a[r]=l),(l.type!==e||l.texture!==t)&&(s!==r&&(i.activeTexture(r),this.currentTextureSlot=r),i.bindTexture(e,t),l.type=e,l.texture=t)}bindBufferBase(e,t,r){const{gl:i}=this,s=`${e}-${t}`;return this.currentBoundBufferBases[s]!==r?(i.bindBufferBase(e,t,r),this.currentBoundBufferBases[s]=r,!0):!1}unbindTexture(){const{gl:e,currentTextureSlot:t,currentBoundTextures:r}=this,i=r[t];i!==void 0&&i.type!==void 0&&(e.bindTexture(i.type,null),i.type=void 0,i.texture=void 0)}getParameter(e){const{gl:t,parameters:r}=this;return r[e]!==void 0?r[e]:t.getParameter(e)}pixelStorei(e,t){const{gl:r,parameters:i}=this;i[e]!==t&&(r.pixelStorei(e,t),i[e]=t)}}class mKe{constructor(e){this.backend=e,this.gl=this.backend.gl,this.extensions=e.extensions}convert(e,t=Iu){const{gl:r,extensions:i}=this;let s;const a=_r.getTransfer(t);if(e===Zs)return r.UNSIGNED_BYTE;if(e===yT)return r.UNSIGNED_SHORT_4_4_4_4;if(e===bT)return r.UNSIGNED_SHORT_5_5_5_1;if(e===wT)return r.UNSIGNED_INT_5_9_9_9_REV;if(e===_T)return r.UNSIGNED_INT_10F_11F_11F_REV;if(e===a1)return r.BYTE;if(e===o1)return r.SHORT;if(e===jh)return r.UNSIGNED_SHORT;if(e===oo)return r.INT;if(e===ts)return r.UNSIGNED_INT;if(e===ia)return r.FLOAT;if(e===Js)return r.HALF_FLOAT;if(e===H8)return r.ALPHA;if(e===by)return r.RGB;if(e===to)return r.RGBA;if(e===ml)return r.DEPTH_COMPONENT;if(e===vc)return r.DEPTH_STENCIL;if(e===wy)return r.RED;if(e===G1)return r.RED_INTEGER;if(e===fl)return r.RG;if(e===q1)return r.RG_INTEGER;if(e===b_)return r.RGBA_INTEGER;if(e===l1||e===c1||e===u1||e===d1)if(a===$n)if(s=i.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(e===l1)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(e===c1)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(e===u1)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(e===d1)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=i.get("WEBGL_compressed_texture_s3tc"),s!==null){if(e===l1)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===c1)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===u1)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===d1)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(e===g5||e===A5||e===x5||e===v5)if(s=i.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(e===g5)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===A5)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===x5)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===v5)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(e===fw||e===pw||e===mw||e===gw||e===Aw||e===C1||e===xw)if(s=i.get("WEBGL_compressed_texture_etc"),s!==null){if(e===fw||e===pw)return a===$n?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(e===mw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;
4513if(e===gw)return s.COMPRESSED_R11_EAC;if(e===Aw)return s.COMPRESSED_SIGNED_R11_EAC;if(e===C1)return s.COMPRESSED_RG11_EAC;if(e===xw)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(e===vw||e===yw||e===bw||e===ww||e===_w||e===Sw||e===Tw||e===Ew||e===Cw||e===Nw||e===Mw||e===kw||e===Rw||e===Pw)if(s=i.get("WEBGL_compressed_texture_astc"),s!==null){if(e===vw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(e===yw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(e===bw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(e===ww)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(e===_w)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(e===Sw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(e===Tw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(e===Ew)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(e===Cw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(e===Nw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(e===Mw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(e===kw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(e===Rw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(e===Pw)return a===$n?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(e===Lw||e===Ow||e===Dw)if(s=i.get("EXT_texture_compression_bptc"),s!==null){if(e===Lw)return a===$n?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(e===Ow)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(e===Dw)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(e===jw||e===Iw||e===N1||e===Fw)if(s=i.get("EXT_texture_compression_rgtc"),s!==null){if(e===jw)return s.COMPRESSED_RED_RGTC1_EXT;if(e===Iw)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(e===N1)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(e===Fw)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return e===Ku?r.UNSIGNED_INT_24_8:r[e]!==void 0?r[e]:null}_clientWaitAsync(){const{gl:e}=this,t=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),new Promise((r,i)=>{function s(){const a=e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0);if(a===e.WAIT_FAILED){e.deleteSync(t),i();return}if(a===e.TIMEOUT_EXPIRED){requestAnimationFrame(s);return}e.deleteSync(t),r()}s()})}}let KJ=!1,lN,VL,ZJ;class gKe{constructor(e){this.backend=e,this.gl=e.gl,this.extensions=e.extensions,this.defaultTextures={},this._srcFramebuffer=null,this._dstFramebuffer=null,KJ===!1&&(this._init(),KJ=!0)}_init(){const e=this.gl;lN={[Jv]:e.REPEAT,[Uu]:e.CLAMP_TO_EDGE,[ey]:e.MIRRORED_REPEAT},VL={[cs]:e.NEAREST,[OV]:e.NEAREST_MIPMAP_NEAREST,[a0]:e.NEAREST_MIPMAP_LINEAR,[bs]:e.LINEAR,[Rb]:e.LINEAR_MIPMAP_NEAREST,[hu]:e.LINEAR_MIPMAP_LINEAR},ZJ={[jV]:e.NEVER,[UV]:e.ALWAYS,[W8]:e.LESS,[$1]:e.LEQUAL,[IV]:e.EQUAL,[eg]:e.GEQUAL,[y5]:e.GREATER,[FV]:e.NOTEQUAL}}getGLTextureType(e){const{gl:t}=this;let r;return e.isCubeTexture===!0?r=t.TEXTURE_CUBE_MAP:e.isArrayTexture===!0||e.isDataArrayTexture===!0||e.isCompressedArrayTexture===!0?r=t.TEXTURE_2D_ARRAY:e.isData3DTexture===!0?r=t.TEXTURE_3D:r=t.TEXTURE_2D,r}getInternalFormat(e,t,r,i,s,a=!1){const{gl:o,extensions:l}=this;if(e!==null){if(o[e]!==void 0)return o[e];an("WebGLBackend: Attempt to use non-existing WebGL internal format '"+e+"'")}let u=null;i&&(u=l.get("EXT_texture_norm16"),u||an("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let d=t;if(t===o.RED&&(r===o.FLOAT&&(d=o.R32F),r===o.HALF_FLOAT&&(d=o.R16F),r===o.UNSIGNED_BYTE&&(d=o.R8),r===o.BYTE&&(d=o.R8_SNORM),r===o.UNSIGNED_SHORT&&u&&(d=u.R16_EXT),r===o.SHORT&&u&&(d=u.R16_SNORM_EXT)),t===o.RED_INTEGER&&(r===o.UNSIGNED_BYTE&&(d=o.R8UI),r===o.UNSIGNED_SHORT&&(d=o.R16UI),r===o.UNSIGNED_INT&&(d=o.R32UI),r===o.BYTE&&(d=o.R8I),r===o.SHORT&&(d=o.R16I),r===o.INT&&(d=o.R32I)),t===o.RG&&(r===o.FLOAT&&(d=o.RG32F),r===o.HALF_FLOAT&&(d=o.RG16F),r===o.UNSIGNED_BYTE&&(d=o.RG8),r===o.BYTE&&(d=o.RG8_SNORM),r===o.UNSIGNED_SHORT&&u&&(d=u.RG16_EXT),r===o.SHORT&&u&&(d=u.RG16_SNORM_EXT)),t===o.RG_INTEGER&&(r===o.UNSIGNED_BYTE&&(d=o.RG8UI),r===o.UNSIGNED_SHORT&&(d=o.RG16UI),r
4513===o.UNSIGNED_INT&&(d=o.RG32UI),r===o.BYTE&&(d=o.RG8I),r===o.SHORT&&(d=o.RG16I),r===o.INT&&(d=o.RG32I)),t===o.RGB){const h=a?Bw:_r.getTransfer(s);r===o.FLOAT&&(d=o.RGB32F),r===o.HALF_FLOAT&&(d=o.RGB16F),r===o.UNSIGNED_BYTE&&(d=h===$n?o.SRGB8:o.RGB8),r===o.BYTE&&(d=o.RGB8_SNORM),r===o.UNSIGNED_SHORT&&u&&(d=u.RGB16_EXT),r===o.SHORT&&u&&(d=u.RGB16_SNORM_EXT),r===o.UNSIGNED_SHORT_5_6_5&&(d=o.RGB565),r===o.UNSIGNED_SHORT_5_5_5_1&&(d=o.RGB5_A1),r===o.UNSIGNED_SHORT_4_4_4_4&&(d=o.RGB4),r===o.UNSIGNED_INT_5_9_9_9_REV&&(d=o.RGB9_E5),r===o.UNSIGNED_INT_10F_11F_11F_REV&&(d=o.R11F_G11F_B10F)}if(t===o.RGB_INTEGER&&(r===o.UNSIGNED_BYTE&&(d=o.RGB8UI),r===o.UNSIGNED_SHORT&&(d=o.RGB16UI),r===o.UNSIGNED_INT&&(d=o.RGB32UI),r===o.BYTE&&(d=o.RGB8I),r===o.SHORT&&(d=o.RGB16I),r===o.INT&&(d=o.RGB32I)),t===o.RGBA){const h=a?Bw:_r.getTransfer(s);r===o.FLOAT&&(d=o.RGBA32F),r===o.HALF_FLOAT&&(d=o.RGBA16F),r===o.UNSIGNED_BYTE&&(d=h===$n?o.SRGB8_ALPHA8:o.RGBA8),r===o.BYTE&&(d=o.RGBA8_SNORM),r===o.UNSIGNED_SHORT&&u&&(d=u.RGBA16_EXT),r===o.SHORT&&u&&(d=u.RGBA16_SNORM_EXT),r===o.UNSIGNED_SHORT_4_4_4_4&&(d=o.RGBA4),r===o.UNSIGNED_SHORT_5_5_5_1&&(d=o.RGB5_A1)}return t===o.RGBA_INTEGER&&(r===o.UNSIGNED_BYTE&&(d=o.RGBA8UI),r===o.UNSIGNED_SHORT&&(d=o.RGBA16UI),r===o.UNSIGNED_INT&&(d=o.RGBA32UI),r===o.BYTE&&(d=o.RGBA8I),r===o.SHORT&&(d=o.RGBA16I),r===o.INT&&(d=o.RGBA32I)),t===o.DEPTH_COMPONENT&&(r===o.UNSIGNED_SHORT&&(d=o.DEPTH_COMPONENT16),r===o.UNSIGNED_INT&&(d=o.DEPTH_COMPONENT24),r===o.FLOAT&&(d=o.DEPTH_COMPONENT32F)),t===o.DEPTH_STENCIL&&r===o.UNSIGNED_INT_24_8&&(d=o.DEPTH24_STENCIL8),(d===o.R16F||d===o.R32F||d===o.RG16F||d===o.RG32F||d===o.RGBA16F||d===o.RGBA32F)&&l.get("EXT_color_buffer_float"),d}setTextureParameters(e,t){const{gl:r,extensions:i,backend:s}=this,{state:a}=this.backend,o=_r.getPrimaries(_r.workingColorSpace),l=t.colorSpace===Iu?null:_r.getPrimaries(t.colorSpace),u=t.colorSpace===Iu||o===l?r.NONE:r.BROWSER_DEFAULT_WEBGL;a.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,t.flipY),a.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),a.pixelStorei(r.UNPACK_ALIGNMENT,t.unpackAlignment),a.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,u),r.texParameteri(e,r.TEXTURE_WRAP_S,lN[t.wrapS]),r.texParameteri(e,r.TEXTURE_WRAP_T,lN[t.wrapT]),(e===r.TEXTURE_3D||e===r.TEXTURE_2D_ARRAY)&&(t.isArrayTexture||r.texParameteri(e,r.TEXTURE_WRAP_R,lN[t.wrapR])),r.texParameteri(e,r.TEXTURE_MAG_FILTER,VL[t.magFilter]);const d=t.mipmaps!==void 0&&t.mipmaps.length>0,h=t.minFilter===bs&&d?hu:t.minFilter;if(r.texParameteri(e,r.TEXTURE_MIN_FILTER,VL[h]),t.compareFunction&&(r.texParameteri(e,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(e,r.TEXTURE_COMPARE_FUNC,ZJ[t.compareFunction])),i.has("EXT_texture_filter_anisotropic")===!0){if(t.magFilter===cs||t.minFilter!==a0&&t.minFilter!==hu||t.type===ia&&i.has("OES_texture_float_linear")===!1)return;if(t.anisotropy>1){const f=i.get("EXT_texture_filter_anisotropic");r.texParameterf(e,f.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,s.capabilities.getMaxAnisotropy()))}}}createDefaultTexture(e){const{gl:t,backend:r,defaultTextures:i}=this,s=this.getGLTextureType(e);let a=i[s];a===void 0&&(a=t.createTexture(),r.state.bindTexture(s,a),t.texParameteri(s,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(s,t.TEXTURE_MAG_FILTER,t.NEAREST),i[s]=a),r.set(e,{textureGPU:a,glTextureType:s})}createTexture(e,t){const{gl:r,backend:i}=this;let s,a,o,l,u;if(e.isExternalTexture===!0)s=e.sourceTexture,a=this.getGLTextureType(e);else{const{levels:d,width:h,height:f,depth:p}=t;o=i.utils.convert(e.format,e.colorSpace),l=i.utils.convert(e.type),u=this.getInternalFormat(e.internalFormat,o,l,e.normalized,e.colorSpace,e.isVideoTexture),s=r.createTexture(),a=this.getGLTextureType(e),i.state.bindTexture(a,s),this.setTextureParameters(a,e),e.isArrayTexture||e.isDataArrayTexture||e.isCompressedArrayTexture?r.texStorage3D(r.TEXTURE_2D_ARRAY,d,u,h,f,p):e.isData3DTexture?r.texStorage3D(r.TEXTURE_3D,d,u,h,f,p):e.isVideoTexture||r.texStorage2D(a,d,u,h,f)}i.set(e,{textureGPU:s,glTextureType:a,glFormat:o,glType:l,glInternalFormat:u})}copyBufferToTexture(e,t){const{gl:r,backend:i}=this,{state:s}=i,{textureGPU:a,glTextureType:o,glFormat:l,glType:u}=i.get(t),{width:d,height:h}=t.source.data;r.bindBuffer(r.PIXEL_UNPACK_BUFFER,e),i.state.bindTexture(o,a),s.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),s.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texSubImage2D(o,0,0,0,d,h,l,u,0),r.bindBuffer(r.PIXEL_UNPACK_BUFFER,null),i.state.unbindTexture()}updateTexture(e,t){const{gl:r}=this,{width:i,height:s}=t,{textureGPU:a,glTextureType:o,glFormat:l,glType:u,glInternalFormat:d}=this.backend.get(e);if(!(e.isRenderTargetTexture||a===void 0))if(this.backend.state.bindTexture(o,a),this.setTextureParameters(o,e),e.isCompressedTexture){const h=e.mipmaps,f=t.image;for(let p=0;p<h.length;p++){const g=h[p];e.isCompressedArrayTexture?e.format!==r.RGBA?l!==null?r.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,p,0,0,0,g.width,g.height,f.depth,l,g.data):an("WebGLBackend: Attempt to load unsupported compressed texture format in .uploadTexture()"):r.texSubImage3D(r.TEXTURE_2D_ARRAY,p,0,0,0,g.width,g.height,f.depth,l,u,g.data):l!==null?r.compressedTexSubImage2D(r.TEXTURE_2D,p,0,0,g.width,g.height,l,g.data):an("WebGLBackend: Unsupported compressed texture format")}}else if(e.isCubeTexture){const h=t.images,f=e.mipmaps;for(let p=0;p<6;p++){const g=cN(h[p]);r.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,0,0,i,s,l,u,g);for(let A=0;A<f.length;A++){const x=f[A],b=cN(x.images[p]);r.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+p,A+1,0,0,b.width,b.height,l,u,b)}}}else if(e.isDataArrayTexture||e.isArrayTexture){const h=t.image;if(e.layerUpdates.size>0){const f=qI(h.width,h.height,e.format,e.type);for(const p of e.layerUpdates){const g=h.data.subarray(p*f/h.data.BYTES_PER_ELEMENT,(p+1)*f/h.data.BYTES_PER_ELEMENT);r.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,p,h.width,h.height,1,l,u,g)}e.clearLayerUpdates()}else r.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,h.width,h.height,h.depth,l,u,h.data)}else if(e.isData3DTexture){const h=t.image;r.texSubImage3D(r.TEXTURE_3D,0,0,0,0,h.width,h.height,h.depth,l,u,h.data)}
vendor: 8,136 bytes, line 4513
4513else if(e.isVideoTexture)e.update(),r.texImage2D(o,0,d,l,u,t.image);else if(e.isHTMLTexture)typeof r.texElementImage2D=="function"&&(r.texElementImage2D.length===3?r.texElementImage2D(r.TEXTURE_2D,r.RGBA8,t.image):r.texElementImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image));else{const h=e.mipmaps;if(h.length>0)for(let f=0,p=h.length;f<p;f++){const g=h[f],A=cN(g);r.texSubImage2D(o,f,0,0,g.width,g.height,l,u,A)}else{const f=cN(t.image);r.texSubImage2D(o,0,0,0,i,s,l,u,f)}}}generateMipmaps(e){const{gl:t,backend:r}=this,{textureGPU:i,glTextureType:s}=r.get(e);r.state.bindTexture(s,i),t.generateMipmap(s)}deallocateRenderBuffers(e){const{gl:t,backend:r}=this;if(e){const i=r.get(e);if(i.renderBufferStorageSetup=void 0,i.framebuffers){for(const s in i.framebuffers)t.deleteFramebuffer(i.framebuffers[s]);delete i.framebuffers}if(i.depthRenderbuffer&&(t.deleteRenderbuffer(i.depthRenderbuffer),delete i.depthRenderbuffer),i.stencilRenderbuffer&&(t.deleteRenderbuffer(i.stencilRenderbuffer),delete i.stencilRenderbuffer),i.msaaFrameBuffer&&(t.deleteFramebuffer(i.msaaFrameBuffer),delete i.msaaFrameBuffer),i.msaaRenderbuffers){for(let s=0;s<i.msaaRenderbuffers.length;s++)t.deleteRenderbuffer(i.msaaRenderbuffers[s]);delete i.msaaRenderbuffers}}}destroyTexture(e,t=!1){const{gl:r,backend:i}=this,{textureGPU:s,renderTarget:a}=i.get(e);this.deallocateRenderBuffers(a),t===!1&&e.isExternalTexture!==!0&&r.deleteTexture(s),i.delete(e)}copyTextureToTexture(e,t,r=null,i=null,s=0,a=0){const{gl:o,backend:l}=this,{state:u}=this.backend,{textureGPU:d,glTextureType:h,glType:f,glFormat:p}=l.get(t);u.bindTexture(h,d);let g,A,x,b,_,M,T,L,D;const P=e.isCompressedTexture?e.mipmaps[a]:e.image;if(r!==null)g=r.max.x-r.min.x,A=r.max.y-r.min.y,x=r.isBox3?r.max.z-r.min.z:1,b=r.min.x,_=r.min.y,M=r.isBox3?r.min.z:0;else{const W=Math.pow(2,-s);g=Math.floor(P.width*W),A=Math.floor(P.height*W),e.isDataArrayTexture||e.isArrayTexture?x=P.depth:e.isData3DTexture?x=Math.floor(P.depth*W):x=1,b=0,_=0,M=0}i!==null?(T=i.x,L=i.y,D=i.z):(T=0,L=0,D=0),u.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,t.flipY),u.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),u.pixelStorei(o.UNPACK_ALIGNMENT,t.unpackAlignment);const O=u.getParameter(o.UNPACK_ROW_LENGTH),F=u.getParameter(o.UNPACK_IMAGE_HEIGHT),U=u.getParameter(o.UNPACK_SKIP_PIXELS),B=u.getParameter(o.UNPACK_SKIP_ROWS),z=u.getParameter(o.UNPACK_SKIP_IMAGES);u.pixelStorei(o.UNPACK_ROW_LENGTH,P.width),u.pixelStorei(o.UNPACK_IMAGE_HEIGHT,P.height),u.pixelStorei(o.UNPACK_SKIP_PIXELS,b),u.pixelStorei(o.UNPACK_SKIP_ROWS,_),u.pixelStorei(o.UNPACK_SKIP_IMAGES,M);const H=e.isDataArrayTexture||e.isData3DTexture||t.isArrayTexture,X=t.isDataArrayTexture||t.isData3DTexture||t.isArrayTexture;if(e.isDepthTexture){const W=l.get(e),J=l.get(t),ee=l.get(W.renderTarget),ae=l.get(J.renderTarget),le=ee.framebuffers[W.cacheKey],Z=ae.framebuffers[J.cacheKey],Y=u.currentBoundFramebuffers[o.READ_FRAMEBUFFER]??null,re=u.currentBoundFramebuffers[o.DRAW_FRAMEBUFFER]??null;u.bindFramebuffer(o.READ_FRAMEBUFFER,le),u.bindFramebuffer(o.DRAW_FRAMEBUFFER,Z);for(let _e=0;_e<x;_e++)H&&(o.framebufferTextureLayer(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,W.textureGPU,s,M+_e),o.framebufferTextureLayer(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0,d,a,D+_e)),o.blitFramebuffer(b,_,g,A,T,L,g,A,o.DEPTH_BUFFER_BIT,o.NEAREST);u.bindFramebuffer(o.READ_FRAMEBUFFER,Y),u.bindFramebuffer(o.DRAW_FRAMEBUFFER,re)}else if(s!==0||e.isRenderTargetTexture||l.has(e)){const W=l.get(e);this._srcFramebuffer===null&&(this._srcFramebuffer=o.createFramebuffer()),this._dstFramebuffer===null&&(this._dstFramebuffer=o.createFramebuffer());const J=u.currentBoundFramebuffers[o.READ_FRAMEBUFFER]??null,ee=u.currentBoundFramebuffers[o.DRAW_FRAMEBUFFER]??null;u.bindFramebuffer(o.READ_FRAMEBUFFER,this._srcFramebuffer),u.bindFramebuffer(o.DRAW_FRAMEBUFFER,this._dstFramebuffer);for(let ae=0;ae<x;ae++)H?o.framebufferTextureLayer(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,W.textureGPU,s,M+ae):o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,W.textureGPU,s),X?o.framebufferTextureLayer(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0,d,a,D+ae):o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,d,a),s!==0?o.blitFramebuffer(b,_,g,A,T,L,g,A,o.COLOR_BUFFER_BIT,o.NEAREST):X?o.copyTexSubImage3D(h,a,T,L,D+ae,b,_,g,A):o.copyTexSubImage2D(h,a,T,L,b,_,g,A);u.bindFramebuffer(o.READ_FRAMEBUFFER,J),u.bindFramebuffer(o.DRAW_FRAMEBUFFER,ee)}else X?e.isDataTexture||e.isData3DTexture?o.texSubImage3D(h,a,T,L,D,g,A,x,p,f,P.data):t.isCompressedArrayTexture?o.compressedTexSubImage3D(h,a,T,L,D,g,A,x,p,P.data):o.texSubImage3D(h,a,T,L,D,g,A,x,p,f,P):e.isDataTexture?o.texSubImage2D(o.TEXTURE_2D,a,T,L,g,A,p,f,P.data):e.isCompressedTexture?o.compressedTexSubImage2D(o.TEXTURE_2D,a,T,L,P.width,P.height,p,P.data):o.texSubImage2D(o.TEXTURE_2D,a,T,L,g,A,p,f,P);u.pixelStorei(o.UNPACK_ROW_LENGTH,O),u.pixelStorei(o.UNPACK_IMAGE_HEIGHT,F),u.pixelStorei(o.UNPACK_SKIP_PIXELS,U),u.pixelStorei(o.UNPACK_SKIP_ROWS,B),u.pixelStorei(o.UNPACK_SKIP_IMAGES,z),a===0&&t.generateMipmaps&&o.generateMipmap(h),u.unbindTexture()}copyFramebufferToTexture(e,t,r){const{gl:i}=this,{state:s}=this.backend,{textureGPU:a}=this.backend.get(e),{x:o,y:l,z:u,w:d}=r,h=e.isDepthTexture===!0||t.renderTarget&&t.renderTarget.samples>0,f=t.renderTarget?t.renderTarget.height:this.backend.getDrawingBufferSize().y;if(h){const p=o!==0||l!==0;let g,A;if(e.isDepthTexture===!0?(g=i.DEPTH_BUFFER_BIT,A=i.DEPTH_ATTACHMENT,t.stencil&&(g|=i.STENCIL_BUFFER_BIT)):(g=i.COLOR_BUFFER_BIT,A=i.COLOR_ATTACHMENT0),p){const x=this.backend.get(t.renderTarget),b=x.framebuffers[t.getCacheKey()],_=x.msaaFrameBuffer;s.bindFramebuffer(i.DRAW_FRAMEBUFFER,b),s.bindFramebuffer(i.READ_FRAMEBUFFER,_);const M=f-l-d;i.blitFramebuffer(o,M,o+u,M+d,o,M,o+u,M+d,g,i.NEAREST),s.bindFramebuffer(i.READ_FRAMEBUFFER,b),s.bindTexture(i.TEXTURE_2D,a),i.copyTexSubImage2D(i.TEXTURE_2D,0,0,0,o,M,u,d),s.unbindTexture()}else{const x=i.createFramebuffer();s.bindFramebuffer(i.DRAW_FRAMEBUFFER,x),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,A,i.TEXTURE_2D,a,0),i.blitFramebuffer(0,0,u,d,0,0,u,d,g,i.NEAREST),i.deleteFramebuffer(x)}}else s.bindTexture(i.TEXTURE_2D,a),i.copyTexSubImage2D(i.TEXTURE_2D,0,0,0,o,f-d-l,u,d),s.unbindTexture();e.generateMipmaps&&this.generateMipmaps(e),this.backend._setFramebuffer(t)}setupRenderBufferStorage(e,t,r,i=!1){const{gl:s}=this,a=t.renderTarget,{depthTexture:o,depthBuffer:l,stencilBuffer:u,width:d,height:h}=a;if(s.bindRenderbuffer(s.RENDERBUFFER,e),l&&!u){let f=s.DEPTH_COMPONENT24;i===!0?this.extensions.get("WEBGL_multisampled_render_to_texture").renderbufferStorageMultisampleEXT(s.RENDERBUFFER,a.samples,f,d,h):r>0?(o&&o.isDepthTexture&&o.type===s.FLOAT&&(f=s.DEPTH_COMPONENT32F),s.renderbufferStorageMultisample(s.RENDERBUFFER,r,f,d,h)):s.renderbufferStorage(s.RENDERBUFFER,f,d,h),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,e)}else l&&u&&(r>0?s.renderbufferStorageMultisample(s.RENDERBUFFER,r,s.DEPTH24_STENCIL8,d,h):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,d,h),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,e));s.bindRenderbuffer(s.RENDERBUFFER,null)}async copyTextureToBuffer(e,t,r,i,s,a){const{backend:o,gl:l}=this,{textureGPU:u,glFormat:d,glType:h}=this.backend.get(e),f=l.createFramebuffer();o.state.bindFramebuffer(l.READ_FRAMEBUFFER,f);const p=e.isCubeTexture?l.TEXTURE_CUBE_MAP_POSITIVE_X+a:l.TEXTURE_2D;l.framebufferTexture2D(l.READ_FRAMEBUFFER,l.COLOR_ATTACHMENT0,p,u,0);const g=this._getTypedArrayType(h),A=this._getBytesPerTexel(h,d),b=i*s*A,_=l.createBuffer();l.bindBuffer(l.PIXEL_PACK_BUFFER,_),l.bufferData(l.PIXEL_PACK_BUFFER,b,l.STREAM_READ),l.readPixels(t,r,i,s,d,h,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),await o.utils._clientWaitAsync();const M=new g(b/g.BYTES_PER_ELEMENT);return l.bindBuffer(l.PIXEL_PACK_BUFFER,_),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,M),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),o.state.bindFramebuffer(l.READ_FRAMEBUFFER,null),l.deleteFramebuffer(f),M}_getTypedArrayType(e){const{gl:t}=this;if(e===t.UNSIGNED_BYTE)return Uint8Array;
4513if(e===t.UNSIGNED_SHORT_4_4_4_4||e===t.UNSIGNED_SHORT_5_5_5_1||e===t.UNSIGNED_SHORT_5_6_5||e===t.UNSIGNED_SHORT)return Uint16Array;if(e===t.UNSIGNED_INT)return Uint32Array;if(e===t.HALF_FLOAT)return Uint16Array;if(e===t.FLOAT)return Float32Array;throw new Error(`THREE.WebGLTextureUtils: Unsupported WebGL type: ${e}`)}_getBytesPerTexel(e,t){const{gl:r}=this;let i=0;if(e===r.UNSIGNED_BYTE&&(i=1),(e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5||e===r.UNSIGNED_SHORT||e===r.HALF_FLOAT)&&(i=2),(e===r.UNSIGNED_INT||e===r.FLOAT)&&(i=4),t===r.RGBA)return i*4;if(t===r.RGB)return i*3;if(t===r.ALPHA)return i}dispose(){const{gl:e}=this;this._srcFramebuffer!==null&&e.deleteFramebuffer(this._srcFramebuffer),this._dstFramebuffer!==null&&e.deleteFramebuffer(this._dstFramebuffer)}}function cN(n){return n.isDataTexture?n.image.data:typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?n:n.data}class AKe{constructor(e){this.backend=e,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(e){let t=this.extensions[e];return t===void 0&&(t=this.gl.getExtension(e),this.extensions[e]=t),t}has(e){return this.availableExtensions.includes(e)}}class xKe{constructor(e){this.backend=e,this.maxAnisotropy=null,this.maxUniformBlockSize=null}getMaxAnisotropy(){if(this.maxAnisotropy!==null)return this.maxAnisotropy;const e=this.backend.gl,t=this.backend.extensions;if(t.has("EXT_texture_filter_anisotropic")===!0){const r=t.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}getUniformBufferLimit(){if(this.maxUniformBlockSize!==null)return this.maxUniformBlockSize;const e=this.backend.gl;return this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.maxUniformBlockSize}}const JJ={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-s3tc",EXT_texture_compression_bptc:"texture-compression-bc",EXT_disjoint_timer_query_webgl2:"timestamp-query",OVR_multiview2:"OVR_multiview2"};class vKe{constructor(e){this.gl=e.gl,this.extensions=e.extensions,this.info=e.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(e,t){const{gl:r,mode:i,object:s,type:a,info:o,index:l}=this;l!==0?r.drawElements(i,t,a,e):r.drawArrays(i,e,t),o.update(s,t,1)}renderInstances(e,t,r){const{gl:i,mode:s,type:a,index:o,object:l,info:u}=this;r!==0&&(o!==0?i.drawElementsInstanced(s,t,a,e,r):i.drawArraysInstanced(s,e,t,r),u.update(l,t,r))}renderMultiDraw(e,t,r){const{extensions:i,mode:s,object:a,info:o}=this;if(r===0)return;const l=i.get("WEBGL_multi_draw");if(l===null)for(let u=0;u<r;u++)this.render(e[u],t[u]);else{this.index!==0?l.multiDrawElementsWEBGL(s,t,0,this.type,e,0,r):l.multiDrawArraysWEBGL(s,e,0,t,0,r);let u=0;for(let d=0;d<r;d++)u+=t[d];o.update(a,u,1)}}}class Dme{constructor(e=256){this.trackTimestamp=!0,this.maxQueries=e,this.currentQueryIndex=0,this.queryOffsets=new Map,this.isDisposed=!1,this.lastValue=0,this.frames=[],this.pendingResolve=!1,this.timestamps=new Map}getTimestampFrames(){return this.frames}getTimestamp(e){let t=this.timestamps.get(e);return t===void 0&&(an(`TimestampQueryPool: No timestamp available for uid ${e}.`),t=0),t}hasTimestampQuery(e){return this.timestamps.has(e)}allocateQueriesForContext(){}async resolveQueriesAsync(){}dispose(){}}class yKe extends Dme{constructor(e,t,r=2048){if(super(r),this.gl=e,this.type=t,this.ext=e.getExtension("EXT_disjoint_timer_query_webgl2")||e.getExtension("EXT_disjoint_timer_query"),!this.ext){an("EXT_disjoint_timer_query not supported; timestamps will be disabled."),this.trackTimestamp=!1;return}this.queries=[];for(let i=0;i<this.maxQueries;i++)this.queries.push(e.createQuery());this.activeQuery=null,this.queryStates=new Map}allocateQueriesForContext(e){if(!this.trackTimestamp)return null;if(this.currentQueryIndex+2>this.maxQueries)return _i(`WebGLTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryStates.set(t,"inactive"),this.queryOffsets.set(e,t),t}beginQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e);if(t==null||this.activeQuery!==null)return;const r=this.queries[t];
4513if(r)try{this.queryStates.get(t)==="inactive"&&(this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,r),this.activeQuery=t,this.queryStates.set(t,"started"))}catch(i){sn("Error in beginQuery:",i),this.activeQuery=null,this.queryStates.set(t,"inactive")}}endQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e);if(t!=null&&this.activeQuery===t)try{this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.queryStates.set(t,"ended"),this.activeQuery=null}catch(r){sn("Error in endQuery:",r),this.queryStates.set(t,"inactive"),this.activeQuery=null}}async resolveQueriesAsync(){if(!this.trackTimestamp||this.pendingResolve)return this.lastValue;this.pendingResolve=!0;try{const e=new Map;for(const[s,a]of this.queryOffsets)if(this.queryStates.get(a)==="ended"){const l=this.queries[a];e.set(s,this.resolveQuery(l))}if(e.size===0)return this.lastValue;const t={},r=[];for(const[s,a]of e){const o=s.match(/^(.*):f(\d+)$/),l=parseInt(o[2]);r.includes(l)===!1&&r.push(l),t[l]===void 0&&(t[l]=0);const u=await a;this.timestamps.set(s,u),t[l]+=u}const i=t[r[r.length-1]];return this.lastValue=i,this.frames=r,this.currentQueryIndex=0,this.queryOffsets.clear(),this.queryStates.clear(),this.activeQuery=null,i}catch(e){return sn("Error resolving queries:",e),this.lastValue}finally{this.pendingResolve=!1}}async resolveQuery(e){return new Promise(t=>{if(this.isDisposed){t(this.lastValue);return}let r,i=!1;const s=()=>{r&&(clearTimeout(r),r=null)},a=l=>{i||(i=!0,s(),t(l))},o=()=>{if(this.isDisposed){a(this.lastValue);return}try{if(this.gl.getParameter(this.ext.GPU_DISJOINT_EXT)){a(this.lastValue);return}if(!this.gl.getQueryParameter(e,this.gl.QUERY_RESULT_AVAILABLE)){r=setTimeout(o,1);return}const d=this.gl.getQueryParameter(e,this.gl.QUERY_RESULT);t(Number(d)/1e6)}catch(l){sn("Error checking query:",l),t(this.lastValue)}};o()})}dispose(){if(!this.isDisposed&&(this.isDisposed=!0,!!this.trackTimestamp)){for(const e of this.queries)this.gl.deleteQuery(e);this.queries=[],this.queryStates.clear(),this.queryOffsets.clear(),this.lastValue=0,this.activeQuery=null}}}class eee extends Ome{constructor(e={}){super(e),this.isWebGLBackend=!0,this.attributeUtils=null,this.extensions=null,this.capabilities=null,this.textureUtils=null,this.bufferRenderer=null,this.gl=null,this.state=null,this.utils=null,this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.disjoint=null,this.parallel=null,this._currentContext=null,this._knownBindings=new WeakSet,this._supportsInvalidateFramebuffer=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),this._xrFramebuffer=null}init(e){super.init(e);const t=this.parameters,r={antialias:e.currentSamples>0,alpha:!0,depth:e.depth,stencil:e.stencil},i=t.context!==void 0?t.context:e.domElement.getContext("webgl2",r);function s(a){a.preventDefault();const o={api:"WebGL",message:a.statusMessage||"Unknown reason",reason:null,originalEvent:a};e.onDeviceLost(o)}this._onContextLost=s,e.domElement.addEventListener("webglcontextlost",s,!1),this.gl=i,this.extensions=new AKe(this),this.capabilities=new xKe(this),this.attributeUtils=new fKe(this),this.textureUtils=new gKe(this),this.bufferRenderer=new vKe(this),this.state=new pKe(this),this.utils=new mKe(this),this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.extensions.get("OVR_multiview2"),this.extensions.get("EXT_clip_control"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile"),this.drawBuffersIndexedExt=this.extensions.get("OES_draw_buffers_indexed"),t.reversedDepthBuffer&&(this.extensions.has("EXT_clip_control")?e.reversedDepthBuffer=!0:(an("WebGPURenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer."),e.reversedDepthBuffer=!1)),e.reversedDepthBuffer&&this.state.setReversedDepth(!0)}get coordinateSystem(){return fu}get hasTimestamp(){return this.disjoint!==null}async getArrayBufferAsync(e,t=null,r=0,i=-1){return await this.attributeUtils.getArrayBufferAsync(e,t,r,i)}async makeXRCompatible(){this.gl.getContextAttributes().xrCompatible!==!0&&await this.gl.makeXRCompatible()}setXRTarget(e){this._xrFramebuffer=e}setXRRenderTargetTextures(e,t,r=null){const i=this.gl;if(this.set(e.texture,{textureGPU:t,glInternalFormat:i.RGBA8}),r!==null){const s=e.stencilBuffer?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24;this.set(e.depthTexture,{textureGPU:r,glInternalFormat:s}),this.extensions.has("WEBGL_multisampled_render_to_texture")===!0&&e._autoAllocateDepthBuffer===!0&&e.multiview===!1&&an("WebGLBackend: Render-to-texture extension was disabled because an external texture was provided"),e._autoAllocateDepthBuffer=!1}}initTimestampQuery(e,t){if(!this.disjoint||!this.trackTimestamp)return;this.timestampQueryPool[e]||(this.timestampQueryPool[e]=new yKe(this.gl,e,2048));const r=this.timestampQueryPool[e];r.allocateQueriesForContext(t)!==null&&r.beginQuery(t)}prepareTimestampBuffer(e,t){if(!this.disjoint||!this.trackTimestamp)return;this.timestampQueryPool[e].endQuery(t)}getContext(){return this.gl}beginRender(e){const{state:t}=this,r=this.get(e);if(e.viewport)this.updateViewport(e);else{const{width:s,height:a}=this.getDrawingBufferSize();t.viewport(0,0,s,a)}if(e.scissor)this.updateScissor(e);else{const{width:s,height:a}=this.getDrawingBufferSize();t.scissor(0,0,s,a)}this.initTimestampQuery(o0.RENDER,this.getTimestampUID(e)),r.previousContext=this._currentContext,this._currentContext=e,this._setFramebuffer(e),this.clear(e.clearColor,e.clearDepth,e.clearStencil,e,!1);const i=e.occlusionQueryCount;i>0&&(r.currentOcclusionQueries=r.occlusionQueries,r.currentOcclusionQueryObjects=r.occlusionQueryObjects,r.lastOcclusionObject=null,r.occlusionQueries=new Array(i),r.occlusionQueryObjects=new Array(i),r.occlusionQueryIndex=0)}finishRender(e){const{gl:t,state:r}=this,i=this.get(e),s=i.previousContext;r.resetVertexState();const a=e.occlusionQueryCount;a>0&&(a>i.occlusionQueryIndex&&t.endQuery(t.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(e));const o=e.textures;if(o!==null)for(let l=0;l<o.length;l++){const u=o[l];u.generateMipmaps&&this.generateMipmaps(u)}if(this._currentContext=s,this._resolveRenderTarget(e),s!==null){if(this._setFramebuffer(s),s.viewport)this.updateViewport(s);else{const{width:l,height:u}=this.getDrawingBufferSize();r.viewport(0,0,l,u)}if(s.scissor)this.updateScissor(s);else{const{width:l,height:u}=this.getDrawingBufferSize();r.scissor(0,0,l,u)}}this.prepareTimestampBuffer(o0.RENDER,this.getTimestampUID(e))}resolveOccludedAsync(e){const t=this.get(e),{currentOcclusionQueries:r,currentOcclusionQueryObjects:i}=t;if(r&&i){const s=new WeakSet,{gl:a}=this;t.currentOcclusionQueryObjects=null,t.currentOcclusionQueries=null;const o=()=>{let l=0;for(let u=0;u<r.length;u++){const d=r[u];d!==null&&a.getQueryParameter(d,a.QUERY_RESULT_AVAILABLE)&&(a.getQueryParameter(d,a.QUERY_RESULT)===0&&s.add(i[u]),r[u]=null,a.deleteQuery(d),l++)}l<r.length?requestAnimationFrame(o):t.occluded=s};o()}}isOccluded(e,t){const r=this.get(e);return r.occluded&&r.occluded.has(t)}updateViewport(e){const{state:t}=this,{x:r,y:i,width:s,height:a}=e.viewportValue;t.viewport(r,e.height-a-i,s,a)}updateScissor(e){const{state:t}=this,{x:r,y:i,width:s,height:a}=e.scissorValue;t.scissor(r,e.height-a-i,s,a)}setScissorTest(e){this.state.setScissorTest(e)}getClearColor(){const e=super.getClearColor();return e.r*=e.a,e.g*=e.a,e.b*=e.a,e}
4513clear(e,t,r,i=null,s=!0,a=!0){const{gl:o,renderer:l}=this;i===null&&(i={textures:null,clearColorValue:this.getClearColor()});let u=0;if(e&&(u|=o.COLOR_BUFFER_BIT),t&&(u|=o.DEPTH_BUFFER_BIT),r&&(u|=o.STENCIL_BUFFER_BIT),u!==0){let d;i.clearColorValue?d=i.clearColorValue:d=this.getClearColor();const h=l.getClearDepth(),f=l.getClearStencil();if(t&&this.state.setDepthMask(!0),i.textures===null)o.clearColor(d.r,d.g,d.b,d.a),o.clear(u);else{if(s&&this._setFramebuffer(i),e)for(let p=0;p<i.textures.length;p++)p===0?o.clearBufferfv(o.COLOR,p,[d.r,d.g,d.b,d.a]):o.clearBufferfv(o.COLOR,p,[0,0,0,1]);t&&r?o.clearBufferfi(o.DEPTH_STENCIL,0,h,f):t?o.clearBufferfv(o.DEPTH,0,[h]):r&&o.clearBufferiv(o.STENCIL,0,[f]),s&&a&&this._resolveRenderTarget(i),s&&this._currentContext!==null&&this._currentContext!==i&&this._setFramebuffer(this._currentContext)}}}beginCompute(e){const{state:t,gl:r}=this;t.bindFramebuffer(r.FRAMEBUFFER,null),this.initTimestampQuery(o0.COMPUTE,this.getTimestampUID(e))}compute(e,t,r,i,s=null){const{state:a,gl:o}=this;this.discard===!1&&(a.enable(o.RASTERIZER_DISCARD),this.discard=!0);const{programGPU:l,transformBuffers:u,attributes:d}=this.get(i),h=this._getVaoKey(d),f=this.vaoCache[h];f===void 0?this.vaoCache[h]=this._createVao(d):a.setVertexState(f),a.useProgram(l),this._bindUniforms(r);const p=this._getTransformFeedback(u);o.bindTransformFeedback(o.TRANSFORM_FEEDBACK,p),o.beginTransformFeedback(o.POINTS),s=s!==null?s:t.count,Array.isArray(s)?(_i("WebGLBackend.compute(): The count parameter must be a single number, not an array."),s=s[0]):s&&typeof s=="object"&&s.isIndirectStorageBufferAttribute&&(_i("WebGLBackend.compute(): The count parameter must be a single number, not IndirectStorageBufferAttribute"),s=t.count),d[0].isStorageInstancedBufferAttribute?o.drawArraysInstanced(o.POINTS,0,1,s):o.drawArrays(o.POINTS,0,s),o.endTransformFeedback(),o.bindTransformFeedback(o.TRANSFORM_FEEDBACK,null);for(let g=0;g<u.length;g++){const A=u[g];A.pbo&&this.has(A.pbo)&&this.textureUtils.copyBufferToTexture(A.transformBuffer,A.pbo),A.switchBuffers()}}finishCompute(e){const{state:t,gl:r}=this;this.discard=!1,t.disable(r.RASTERIZER_DISCARD),this.prepareTimestampBuffer(o0.COMPUTE,this.getTimestampUID(e)),this._currentContext&&this._setFramebuffer(this._currentContext)}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.isArrayTexture&&e.camera.isArrayCamera}_draw(e,t,r,i,s,a){if(e.isBatchedMesh)if(this.hasFeature("WEBGL_multi_draw")===!1){const{gl:o}=this,l=o.getUniformLocation(a,"nodeUniformDrawId"),u=e._multiDrawStarts,d=e._multiDrawCounts,h=e._multiDrawCount;for(let f=0;f<h;f++)o.uniform1ui(l,f),t.render(u[f],d[f])}else t.renderMultiDraw(e._multiDrawStarts,e._multiDrawCounts,e._multiDrawCount);else s>1?t.renderInstances(r,i,s):t.render(r,i)}draw(e){const{object:t,pipeline:r,material:i,context:s,hardwareClippingPlanes:a}=e,{programGPU:o}=this.get(r),{gl:l,state:u}=this,d=this.get(s),h=e.getDrawParameters();if(h===null)return;this._bindUniforms(e.getBindings());const f=t.isMesh&&t.matrixWorld.determinantAffine()<0;u.setMaterial(i,f,a),s.mrt!==null&&s.textures!==null&&u.setMRTBlending(s.textures,s.mrt,i),u.useProgram(o);const p=e.getAttributes(),g=this.get(p);let A=g.vaoGPU;if(A===void 0){const P=this._getVaoKey(p);A=this.vaoCache[P],A===void 0&&(A=this._createVao(p),this.vaoCache[P]=A,g.vaoGPU=A)}const x=e.getIndex(),b=x!==null?this.get(x).bufferGPU:null;u.setVertexState(A,b);const _=d.lastOcclusionObject;if(_!==t&&_!==void 0){if(_!==null&&_.occlusionTest===!0&&(l.endQuery(l.ANY_SAMPLES_PASSED),d.occlusionQueryIndex++),t.occlusionTest===!0){const P=l.createQuery();l.beginQuery(l.ANY_SAMPLES_PASSED,P),d.occlusionQueries[d.occlusionQueryIndex]=P,d.occlusionQueryObjects[d.occlusionQueryIndex]=t}d.lastOcclusionObject=t}const M=this.bufferRenderer;t.isPoints?M.mode=l.POINTS:t.isLineSegments?M.mode=l.LINES:t.isLine?M.mode=l.LINE_STRIP:t.isLineLoop?M.mode=l.LINE_LOOP:i.wireframe===!0?(u.setLineWidth(i.wireframeLinewidth*this.renderer.getPixelRatio()),M.mode=l.LINES):M.mode=l.TRIANGLES;const{vertexCount:T,instanceCount:L}=h;let{firstVertex:D}=h;if(M.object=t,x!==null){D*=x.array.BYTES_PER_ELEMENT;const P=this.get(x);M.index=x.count,M.type=P.type}else M.index=0;
4513if(e.camera.isArrayCamera===!0&&e.camera.cameras.length>0&&e.camera.isMultiViewCamera===!1){const P=this.get(e.camera),O=e.camera.cameras,F=e.getBindingGroup("cameraIndex").bindings[0];if(P.indexesGPU===void 0||P.indexesGPU.length!==O.length){const W=new Uint32Array([0,0,0,0]),J=[];for(let ee=0,ae=O.length;ee<ae;ee++){const le=l.createBuffer();W[0]=ee,l.bindBuffer(l.UNIFORM_BUFFER,le),l.bufferData(l.UNIFORM_BUFFER,W,l.STATIC_DRAW),J.push(le)}P.indexesGPU=J}let U=0;e:for(const W of e.getBindings())for(const J of W.bindings){if(J===F)break e;(J.isUniformsGroup||J.isUniformBuffer)&&U++}const B=this.renderer.getPixelRatio(),z=this._currentContext.renderTarget,H=this._isRenderCameraDepthArray(this._currentContext),X=this._currentContext.activeCubeFace;if(H){const W=this.get(z.depthTexture);if(W.clearedRenderId!==this.renderer._nodes.nodeFrame.renderId){W.clearedRenderId=this.renderer._nodes.nodeFrame.renderId;const{stencilBuffer:J}=z;for(let ee=0,ae=O.length;ee<ae;ee++)this.renderer._activeCubeFace=ee,this._currentContext.activeCubeFace=ee,this._setFramebuffer(this._currentContext),this.clear(!1,!0,J,this._currentContext,!1,!1);this.renderer._activeCubeFace=X,this._currentContext.activeCubeFace=X}}for(let W=0,J=O.length;W<J;W++){const ee=O[W];if(t.layers.test(ee.layers)){H&&(this.renderer._activeCubeFace=W,this._currentContext.activeCubeFace=W,this._setFramebuffer(this._currentContext));const ae=ee.viewport;if(ae!==void 0){const le=ae.x*B,Z=ae.y*B,Y=ae.width*B,re=ae.height*B;u.viewport(Math.floor(le),Math.floor(e.context.height-re-Z),Math.floor(Y),Math.floor(re))}u.bindBufferBase(l.UNIFORM_BUFFER,U,P.indexesGPU[W]),this._draw(t,M,D,T,L,o)}this._currentContext.activeCubeFace=X,this.renderer._activeCubeFace=X}}else this._draw(t,M,D,T,L,o)}needsRenderUpdate(){return!1}getRenderCacheKey(){return""}createDefaultTexture(e){this.textureUtils.createDefaultTexture(e)}createTexture(e,t){this.textureUtils.createTexture(e,t)}updateTexture(e,t){this.textureUtils.updateTexture(e,t)}generateMipmaps(e){this.textureUtils.generateMipmaps(e)}destroyTexture(e,t=!1){this.textureUtils.destroyTexture(e,t)}async copyTextureToBuffer(e,t,r,i,s,a){return this.textureUtils.copyTextureToBuffer(e,t,r,i,s,a)}updateSampler(){return""}createNodeBuilder(e,t){return new uKe(e,t)}createProgram(e){const t=this.gl,{stage:r,code:i}=e,s=r==="fragment"?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);t.shaderSource(s,i),t.compileShader(s),this.set(e,{shaderGPU:s})}destroyProgram(e){this.delete(e)}createRenderPipeline(e,t){const r=this.gl,i=e.pipeline,{fragmentProgram:s,vertexProgram:a}=i,o=r.createProgram(),l=this.get(s).shaderGPU,u=this.get(a).shaderGPU;if(r.attachShader(o,l),r.attachShader(o,u),r.linkProgram(o),this.set(i,{programGPU:o,fragmentShader:l,vertexShader:u}),t!==null&&this.parallel){const d=new Promise(h=>{const f=this.parallel,p=()=>{r.getProgramParameter(o,f.COMPLETION_STATUS_KHR)?(this._completeCompile(e,i),h()):requestAnimationFrame(p)};p()});t.push(d);return}this._completeCompile(e,i)}_handleSource(e,t){const r=e.split(` 4514`),i=[],s=Math.max(t-6,0),a=Math.min(t+6,r.length);for(let o=s;o<a;o++){const l=o+1;i.push(`${l===t?">":" "} ${l}: ${r[o]}`)}return i.join(` 4515`)}_getShaderErrors(e,t,r){const i=e.getShaderParameter(t,e.COMPILE_STATUS),a=(e.getShaderInfoLog(t)||"").trim();if(i&&a==="")return"";const o=/ERROR: 0:(\d+)/.exec(a);if(o){const l=parseInt(o[1]);return r.toUpperCase()+` 4516 4517`+a+` 4518 4519`+this._handleSource(e.getShaderSource(t),l)}else return a}_logProgramError(e,t,r){if(this.renderer.debug.checkShaderErrors){const i=this.gl,a=(i.getProgramInfoLog(e)||"").trim();if(i.getProgramParameter(e,i.LINK_STATUS)===!1)if(typeof this.renderer.debug.onShaderError=="function")this.renderer.debug.onShaderError(i,e,r,t);else{const o=this._getShaderErrors(i,r,"vertex"),l=this._getShaderErrors(i,t,"fragment");sn("WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(e,i.VALIDATE_STATUS)+` 4520 4521Program Info Log: `+a+` 4522`+o+` 4523`+l)}else a!==""&&an("WebGLProgram: Program Info Log:",a)}}_completeCompile(e,t){const{state:r,gl:i}=this,s=this.get(t),{programGPU:a,fragmentShader:o,vertexShader:l}=s;i.getProgramParameter(a,i.LINK_STATUS)===!1&&this._logProgramError(a,o,l),r.useProgram(a);const u=e.getBindings();this._setupBindings(u,a),this.set(t,{programGPU:a,pipeline:a})}createComputePipeline(e,t){const{state:r,gl:i}=this,s={stage:"fragment",code:`#version 300 es 4524precision highp float; 4525void main() {}`};this.createProgram(s);const{computeProgram:a}=e,o=i.createProgram(),l=this.get(s).shaderGPU,u=this.get(a).shaderGPU,d=a.transforms,h=[],f=[];for(let x=0;x<d.length;x++){const b=d[x];h.push(b.varyingName),f.push(b.attributeNode)}i.attachShader(o,l),i.attachShader(o,u),i.transformFeedbackVaryings(o,h,i.SEPARATE_ATTRIBS),i.linkProgram(o),i.getProgramParameter(o,i.LINK_STATUS)===!1&&this._logProgramError(o,l,u),r.useProgram(o),this._setupBindings(t,o);const p=a.attributes,g=[],A=[];for(let x=0;x<p.length;x++){const b=p[x].node.attribute;g.push(b),this.has(b)||this.attributeUtils.createAttribute(b,i.ARRAY_BUFFER)}for(let x=0;x<f.length;x++){const b=f[x].attribute;this.has(b)||this.attributeUtils.createAttribute(b,i.ARRAY_BUFFER);const _=this.get(b);A.push(_)}this.set(e,{programGPU:o,transformBuffers:A,attributes:g})}createBindings(e,t){if(this._knownBindings.has(t)===!1){this._knownBindings.add(t);let r=0,i=0;for(const s of t){this.set(s,{textures:i,uniformBuffers:r});for(const a of s.bindings)a.isUniformBuffer&&r++,a.isSampledTexture&&i++}}this.updateBindings(e,t)}updateBindings(e){const{gl:t}=this;for(const r of e.bindings){const i=this.get(r);if(r.isUniformsGroup||r.isUniformBuffer){const s=r.buffer,a=i.bufferGPU;t.bindBuffer(t.UNIFORM_BUFFER,a);const o=r.updateRanges;if(t.bindBuffer(t.UNIFORM_BUFFER,a),o.length===0)t.bufferData(t.UNIFORM_BUFFER,s,t.DYNAMIC_DRAW);else{const l=OM(s),u=l?1:s.BYTES_PER_ELEMENT;for(let d=0,h=o.length;d<h;d++){const f=o[d],p=f.start*u,g=f.count*u,A=p*(l?s.BYTES_PER_ELEMENT:1);t.bufferSubData(t.UNIFORM_BUFFER,A,s,p,g)}}this.set(r,i)}else if(r.isSampledTexture){const{textureGPU:s,glTextureType:a}=this.get(r.texture);i.textureGPU=s,i.glTextureType=a,this.set(r,i)}}}updateBinding(e){const t=this.gl;if(e.isUniformsGroup||e.isUniformBuffer){const i=this.get(e).bufferGPU,s=e.buffer,a=e.updateRanges;if(t.bindBuffer(t.UNIFORM_BUFFER,i),a.length===0)t.bufferData(t.UNIFORM_BUFFER,s,t.DYNAMIC_DRAW);else{const o=OM(s),l=o?1:s.BYTES_PER_ELEMENT;let u=a[0].start;for(let d=0,h=a.length;d<h;d++){const f=a[d],p=a[d+1],g=f.start+f.count;if(p!==void 0&&p.start===g)continue;const A=u*l,x=(g-u)*l,b=A*(o?s.BYTES_PER_ELEMENT:1);t.bufferSubData(t.UNIFORM_BUFFER,b,s,A,x),p!==void 0&&(u=p.start)}}}}createUniformBuffer(e){const t=this.get(e);if(t.bufferGPU===void 0){const r=this.gl,i=e.buffer;t.bufferGPU=r.createBuffer(),r.bindBuffer(r.UNIFORM_BUFFER,t.bufferGPU),r.bufferData(r.UNIFORM_BUFFER,i.byteLength,r.DY
vendor: 15,445 bytes, line 4525
4525NAMIC_DRAW)}}destroyUniformBuffer(e){const t=this.get(e);this.gl.deleteBuffer(t.bufferGPU),this.delete(e)}createIndexAttribute(e){const t=this.gl;this.attributeUtils.createAttribute(e,t.ELEMENT_ARRAY_BUFFER)}createAttribute(e){if(this.has(e))return;const t=this.gl;this.attributeUtils.createAttribute(e,t.ARRAY_BUFFER)}createStorageAttribute(e){if(this.has(e))return;const t=this.gl;this.attributeUtils.createAttribute(e,t.ARRAY_BUFFER)}updateAttribute(e){this.attributeUtils.updateAttribute(e)}destroyAttribute(e){this.attributeUtils.destroyAttribute(e)}hasFeature(e){const t=Object.keys(JJ).filter(i=>JJ[i]===e),r=this.extensions;for(let i=0;i<t.length;i++)if(r.has(t[i]))return!0;return!1}copyTextureToTexture(e,t,r=null,i=null,s=0,a=0){this.textureUtils.copyTextureToTexture(e,t,r,i,s,a)}copyFramebufferToTexture(e,t,r){this.textureUtils.copyFramebufferToTexture(e,t,r)}hasCompatibility(e){return e===_y.TEXTURE_COMPARE?!0:super.hasCompatibility(e)}initRenderTarget(e){const{gl:t,state:r}=this;this._setFramebuffer(e),r.bindFramebuffer(t.FRAMEBUFFER,null)}_setFramebuffer(e){const{gl:t,state:r}=this;let i=null;if(e.textures!==null){const s=e.renderTarget,a=this.get(s),{samples:o,depthBuffer:l,stencilBuffer:u}=s,d=s.isCubeRenderTarget===!0,h=s.isRenderTarget3D===!0,f=s.depth>1,p=s.isXRRenderTarget===!0,g=p===!0&&s._hasExternalTextures===!0;let A=a.msaaFrameBuffer,x=a.depthRenderbuffer;const b=this.extensions.get("WEBGL_multisampled_render_to_texture"),_=this.extensions.get("OVR_multiview2"),M=this._useMultisampledExtension(s),T=b0e(e);let L;if(d?(a.cubeFramebuffers||(a.cubeFramebuffers={}),L=a.cubeFramebuffers[T]):p&&g===!1?L=this._xrFramebuffer:(a.framebuffers||(a.framebuffers={}),L=a.framebuffers[T]),L===void 0){L=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,L);const D=e.textures,P=[];if(d){a.cubeFramebuffers[T]=L;const{textureGPU:F}=this.get(D[0]),U=this.renderer._activeCubeFace,B=this.renderer._activeMipmapLevel;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+U,F,B)}else{a.framebuffers[T]=L;for(let F=0;F<D.length;F++){const U=D[F],B=this.get(U);B.renderTarget=e.renderTarget,B.cacheKey=T;const z=t.COLOR_ATTACHMENT0+F;if(s.multiview)_.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,z,B.textureGPU,0,o,0,2);else if(h||f){const H=this.renderer._activeCubeFace,X=this.renderer._activeMipmapLevel;t.framebufferTextureLayer(t.FRAMEBUFFER,z,B.textureGPU,X,H)}else if(M)b.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,z,t.TEXTURE_2D,B.textureGPU,0,o);else{const H=this.renderer._activeMipmapLevel;t.framebufferTexture2D(t.FRAMEBUFFER,z,t.TEXTURE_2D,B.textureGPU,H)}}}const O=u?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(s._autoAllocateDepthBuffer===!0){const F=t.createRenderbuffer();this.textureUtils.setupRenderBufferStorage(F,e,0,M),a.xrDepthRenderbuffer=F,P.push(u?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT),t.bindRenderbuffer(t.RENDERBUFFER,F),t.framebufferRenderbuffer(t.FRAMEBUFFER,O,t.RENDERBUFFER,F)}else if(e.depthTexture!==null){P.push(u?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT);const F=this.get(e.depthTexture);if(F.renderTarget=e.renderTarget,F.cacheKey=T,s.multiview)_.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,O,F.textureGPU,0,o,0,2);else if(g&&M)b.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,O,t.TEXTURE_2D,F.textureGPU,0,o);else if(e.depthTexture.isArrayTexture){const U=this.renderer._activeCubeFace;t.framebufferTextureLayer(t.FRAMEBUFFER,O,F.textureGPU,0,U)}else if(e.depthTexture.isCubeTexture){const U=this.renderer._activeCubeFace;t.framebufferTexture2D(t.FRAMEBUFFER,O,t.TEXTURE_CUBE_MAP_POSITIVE_X+U,F.textureGPU,0)}else t.framebufferTexture2D(t.FRAMEBUFFER,O,t.TEXTURE_2D,F.textureGPU,0)}a.depthInvalidationArray=P}else{if(this._isRenderCameraDepthArray(e)){r.bindFramebuffer(t.FRAMEBUFFER,L);const P=this.renderer._activeCubeFace,O=this.get(e.depthTexture),F=u?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.framebufferTextureLayer(t.FRAMEBUFFER,F,O.textureGPU,0,P)}if((p||M||s.multiview)&&s._isOpaqueFramebuffer!==!0){r.bindFramebuffer(t.FRAMEBUFFER,L);const P=this.get(e.textures[0]);s.multiview?_.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,P.textureGPU,0,o,0,2):M?b.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,P.textureGPU,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,P.textureGPU,0);const O=u?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(s._autoAllocateDepthBuffer===!0){const F=a.xrDepthRenderbuffer;t.bindRenderbuffer(t.RENDERBUFFER,F),t.framebufferRenderbuffer(t.FRAMEBUFFER,O,t.RENDERBUFFER,F)}else{const F=this.get(e.depthTexture);s.multiview?_.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,O,F.textureGPU,0,o,0,2):M?b.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,O,t.TEXTURE_2D,F.textureGPU,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,O,t.TEXTURE_2D,F.textureGPU,0)}}}if(o>0&&M===!1&&!s.multiview){if(A===void 0){const D=[];A=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,A);const P=[],O=e.textures;for(let F=0;F<O.length;F++){P[F]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,P[F]),D.push(t.COLOR_ATTACHMENT0+F);const U=e.textures[F],B=this.get(U);t.renderbufferStorageMultisample(t.RENDERBUFFER,o,B.glInternalFormat,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+F,t.RENDERBUFFER,P[F])}if(t.bindRenderbuffer(t.RENDERBUFFER,null),a.msaaFrameBuffer=A,a.msaaRenderbuffers=P,l&&x===void 0){x=t.createRenderbuffer(),this.textureUtils.setupRenderBufferStorage(x,e,o),a.depthRenderbuffer=x;const F=u?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;D.push(F)}a.invalidationArray=D}i=a.msaaFrameBuffer}else i=L;r.drawBuffers(e,L)}r.bindFramebuffer(t.FRAMEBUFFER,i)}_getVaoKey(e){let t="";for(let r=0;r<e.length;r++){const i=this.get(e[r]);t+=":"+i.id}return t}_createVao(e){const{gl:t}=this,r=t.createVertexArray();t.bindVertexArray(r);for(let i=0;i<e.length;i++){const s=e[i],a=this.get(s);t.bindBuffer(t.ARRAY_BUFFER,a.bufferGPU),t.enableVertexAttribArray(i);let o,l;s.isInterleavedBufferAttribute===!0?(o=s.data.stride*a.bytesPerElement,l=s.offset*a.bytesPerElement):(o=0,l=0),a.isInteger?t.vertexAttribIPointer(i,s.itemSize,a.type,o,l):t.vertexAttribPointer(i,s.itemSize,a.type,s.normalized,o,l),s.isInstancedBufferAttribute&&!s.isInterleavedBufferAttribute?t.vertexAttribDivisor(i,s.meshPerAttribute):s.isInterleavedBufferAttribute&&s.data.isInstancedInterleavedBuffer&&t.vertexAttribDivisor(i,s.data.meshPerAttribute)}return t.bindBuffer(t.ARRAY_BUFFER,null),r}_getTransformFeedback(e){let t="";for(let s=0;s<e.length;s++)t+=":"+e[s].id;let r=this.transformFeedbackCache[t];if(r!==void 0)return r;const{gl:i}=this;r=i.createTransformFeedback(),i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,r);for(let s=0;s<e.length;s++){const a=e[s];i.bindBufferBase(i.TRANSFORM_FEEDBACK_BUFFER,s,a.transformBuffer)}return i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,null),this.transformFeedbackCache[t]=r,r}_setupBindings(e,t){const r=this.gl;let i=0,s=0;for(const a of e)for(const o of a.bindings)if(o.isUniformsGroup||o.isUniformBuffer){const l=i++,u=r.getUniformBlockIndex(t,o.name);r.uniformBlockBinding(t,u,l)}else if(o.isSampledTexture){const l=s++,u=r.getUniformLocation(t,o.name);r.uniform1i(u,l)}}_bindUniforms(e){const{gl:t,state:r}=this;let i=0,s=0;for(const a of e)for(const o of a.bindings){const l=this.get(o);if(o.isUniformsGroup||o.isUniformBuffer){const u=i++;r.bindBufferBase(t.UNIFORM_BUFFER,u,l.bufferGPU)}else if(o.isSampledTexture){const u=s++;r.bindTexture(l.glTextureType,l.textureGPU,t.TEXTURE0+u)}}}_resolveRenderTarget(e){const{gl:t,state:r}=this,i=e.renderTarget;if(e.textures!==null&&i){const s=this.get(i);if(i.samples>0&&this._useMultisampledExtension(i)===!1){const a=s.framebuffers[e.getCacheKey()];let o=t.COLOR_BUFFER_BIT;i.resolveDepthBuffer&&(i.depthBuffer&&(o|=t.DEPTH_BUFFER_BIT),i.stencilBuffer&&i.resolveStencilBuffer&&(o|=t.STENCIL_BUFFER_BIT));const l=s.msaaFrameBuffer,u=s.msaaRenderbuffers,d=e.textures,h=d.length>1;if(r.bindFramebuffer(t.READ_FRAMEBUFFER,l),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,a),h)for(let f=0;f<d.length;f++)t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0+f,t.RENDERBUFFER,null),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+f,t.TEXTURE_2D,null,0);for(let f=0;f<d.length;f++){if(h){const{textureGPU:p}=this.get(d[f]);t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u[f]),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,p,0)}if(e.scissor){const{x:p,y:g,width:A,height:x}=e.scissorValue,b=e.height-x-g;t.blitFramebuffer(p,b,p+A,b+x,p,b,p+A,b+x,o,t.NEAREST)}else t.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,o,t.NEAREST)}if(h)for(let f=0;f<d.length;f++){const{textureGPU:p}=this.get(d[f]);t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0+f,t.RENDERBUFFER,u[f]),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+f,t.TEXTURE_2D,p,0)}this._supportsInvalidateFramebuffer===!0&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,s.invalidationArray)}else if(i.resolveDepthBuffer===!1&&s.framebuffers){const a=s.framebuffers[e.getCacheKey()];r.bindFramebuffer(t.DRAW_FRAMEBUFFER,a),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,s.depthInvalidationArray)}}}_useMultisampledExtension(e){return e.multiview===!0?!0:e.samples>0&&this.extensions.has("WEBGL_multisampled_render_to_texture")===!0&&e._autoAllocateDepthBuffer!==!1}dispose(){this.textureUtils!==null&&this.textureUtils.dispose();const e=this.extensions.get("WEBGL_lose_context");e&&e.loseContext(),this.renderer.domElement.removeEventListener("webglcontextlost",this._onContextLost)}}const BS={PointList:"point-list",LineList:"line-list",LineStrip:"line-strip",TriangleList:"triangle-list"},T0=typeof self<"u"&&self.GPUShaderStage?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4},El={Never:"never",Less:"less",Equal:"equal",LessEqual:"less-equal",Greater:"greater",NotEqual:"not-equal",GreaterEqual:"greater-equal",Always:"always"},Zc={Store:"store"},fs={Load:"load",Clear:"clear"},tee={CCW:"ccw",CW:"cw"},nee={None:"none",Back:"back"},Gk={Uint16:"uint16",Uint32:"uint32"},it={R8Unorm:"r8unorm",R8Snorm:"r8snorm",R8Uint:"r8uint",R8Sint:"r8sint",R16Uint:"r16uint",R16Sint:"r16sint",R16Float:"r16float",RG8Unorm:"rg8unorm",RG8Snorm:"rg8snorm",RG8Uint:"rg8uint",RG8Sint:"rg8sint",R16Unorm:"r16unorm",R16Snorm:"r16snorm",R32Uint:"r32uint",R32Sint:"r32sint",R32Float:"r32float",RG16Uint:"rg16uint",RG16Sint:"rg16sint",RG16Float:"rg16float",RGBA8Unorm:"rgba8unorm",RGBA8UnormSRGB:"rgba8unorm-srgb",RGBA8Snorm:"rgba8snorm",RGBA8Uint:"rgba8uint",RGBA8Sint:"rgba8sint",BGRA8Unorm:"bgra8unorm",BGRA8UnormSRGB:"bgra8unorm-srgb",RG16Unorm:"rg16unorm",RG16Snorm:"rg16snorm",RGB9E5UFloat:"rgb9e5ufloat",RGB10A2Unorm:"rgb10a2unorm",RG11B10UFloat:"rg11b10ufloat",RG32Uint:"rg32uint",RG32Sint:"rg32sint",RG32Float:"rg32float",RGBA16Uint:"rgba16uint",RGBA16Sint:"rgba16sint",RGBA16Float:"rgba16float",RGBA16Unorm:"rgba16unorm",RGBA16Snorm:"rgba16snorm",RGBA32Uint:"rgba32uint",RGBA32Sint:"rgba32sint",RGBA32Float:"rgba32float",Depth16Unorm:"depth16unorm",Depth24Plus:"depth24plus",Depth24PlusStencil8:"depth24plus-stencil8",Depth32Float:"depth32float",Depth32FloatStencil8:"depth32float-stencil8",BC1RGBAUnorm:"bc1-rgba-unorm",BC1RGBAUnormSRGB:"bc1-rgba-unorm-srgb",BC2RGBAUnorm:"bc2-rgba-unorm",BC2RGBAUnormSRGB:"bc2-rgba-unorm-srgb",BC3RGBAUnorm:"bc3-rgba-unorm",BC3RGBAUnormSRGB:"bc3-rgba-unorm-srgb",BC4RUnorm:"bc4-r-unorm",BC4RSnorm:"bc4-r-snorm",BC5RGUnorm:"bc5-rg-unorm",BC5RGSnorm:"bc5-rg-snorm",BC6HRGBUFloat:"bc6h-rgb-ufloat",BC6HRGBFloat:"bc6h-rgb-float",BC7RGBAUnorm:"bc7-rgba-unorm",BC7RGBAUnormSRGB:"bc7-rgba-unorm-srgb",ETC2RGB8Unorm:"etc2-rgb8unorm",ETC2RGB8UnormSRGB:"etc2-rgb8unorm-srgb",ETC2RGB8A1Unorm:"etc2-rgb8a1unorm",ETC2RGB8A1UnormSRGB:"etc2-rgb8a1unorm-srgb",ETC2RGBA8Unorm:"etc2-rgba8unorm",ETC2RGBA8UnormSRGB:"etc2-rgba8unorm-srgb",EACR11Unorm:"eac-r11unorm",EACR11Snorm:"eac-r11snorm",EACRG11Unorm:"eac-rg11unorm",EACRG11Snorm:"eac-rg11snorm",ASTC4x4Unorm:"astc-4x4-unorm",ASTC4x4UnormSRGB:"astc-4x4-unorm-srgb",ASTC5x4Unorm:"astc-5x4-unorm",ASTC5x4UnormSRGB:"astc-5x4-unorm-srgb",ASTC5x5Unorm:"astc-5x5-unorm",ASTC5x5UnormSRGB:"astc-5x5-unorm-srgb",ASTC6x5Unorm:"astc-6x5-unorm",ASTC6x5UnormSRGB:"astc-6x5-unorm-srgb",ASTC6x6Unorm:"astc-6x6-unorm",ASTC6x6UnormSRGB:"astc-6x6-unorm-srgb",ASTC8x5Unorm:"astc-8x5-unorm",ASTC8x5UnormSRGB:"astc-8x5-unorm-srgb",ASTC8x6Unorm:"astc-8x6-unorm",ASTC8x6UnormSRGB:"astc-8x6-unorm-srgb",ASTC8x8Unorm:"astc-8x8-unorm",ASTC8x8UnormSRGB:"astc-8x8-unorm-srgb",ASTC10x5Unorm:"astc-10x5-unorm",ASTC10x5UnormSRGB:"astc-10x5-unorm-srgb",ASTC10x6Unorm:"astc-10x6-unorm",ASTC10x6UnormSRGB:"astc-10x6-unorm-srgb",ASTC10x8Unorm:"astc-10x8-unorm",ASTC10x8UnormSRGB:"astc-10x8-unorm-srgb",ASTC10x10Unorm:"astc-10x10-unorm",ASTC10x10UnormSRGB:"astc-10x10-unorm-srgb",ASTC12x10Unorm:"astc-12x10-unorm",ASTC12x10UnormSRGB:"astc-12x10-unorm-srgb",ASTC12x12Unorm:"astc-12x12-unorm",ASTC12x12UnormSRGB:"astc-12x12-unorm-srgb"},zL={ClampToEdge:"clamp-to-edge",Repeat:"repeat",MirrorRepeat:"mirror-repeat"},Eh={Linear:"linear",Nearest:"nearest"},Mi={Zero:"zero",One:"one",Src:"src",OneMinusSrc:"one-minus-src",SrcAlpha:"src-alpha",OneMinusSrcAlpha:"one-minus-src-alpha",Dst:"dst",OneMinusDst:"one-minus-dst",DstAlpha:"dst-alpha",OneMinusDstAlpha:"one-minus-dst-alpha",SrcAlphaSaturated:"src-alpha-saturated",Constant:"constant",OneMinusConstant:"one-minus-constant"},jx={Add:"add",Subtract:"subtract",ReverseSubtract:"reverse-subtract",Min:"min",Max:"max"},ree={None:0,All:15},aA={Keep:"keep",Zero:"zero",Replace:"replace",Invert:"invert",IncrementClamp:"increment-clamp",DecrementClamp:"decrement-clamp",IncrementWrap:"increment-wrap",DecrementWrap:"decrement-wrap"},GL={Storage:"storage",ReadOnlyStorage:"read-only-storage"},qL={WriteOnly:"write-only",ReadOnly:"read-only",ReadWrite:"read-write"},iee={NonFiltering:"non-filtering",Comparison:"comparison"},Ix={Float:"float",UnfilterableFloat:"unfilterable-float",Depth:"depth",SInt:"sint",UInt:"uint"},see={TwoD:"2d",ThreeD:"3d"},Rl={TwoD:"2d",TwoDArray:"2d-array",Cube:"cube",ThreeD:"3d"},bKe={All:"all"},uN={Vertex:"vertex",Instance:"instance"},qk={CoreFeaturesAndLimits:"core-features-and-limits",DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionBCSliced3D:"texture-compression-bc-sliced-3d",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TextureCompressionASTCSliced3D:"texture-compression-astc-sliced-3d",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",Float32Blendable:"float32-blendable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups",TextureFormatsTier1:"texture-formats-tier1",TextureFormatsTier2:"texture-formats-tier2"},aee={"texture-compression-s3tc":"texture-compression-bc","texture-compression-etc1":"texture-compression-etc2"};class wKe extends Pme{constructor(e,t,r){super(e,t?t.value:null),this.textureNode=t,this.groupNode=r}update(){const{textureNode:e}=this;return this.texture!==e.value?(this.texture=e.value,!0):super.update(
4525)}}class _Ke extends Nme{constructor(e,t){super(e,t?t.array:null),this._attribute=t,this.isStorageBuffer=!0}get attribute(){return this._attribute}}let SKe=0;class TKe extends _Ke{constructor(e,t){super("StorageBuffer_"+SKe++,e?e.value:null),this.nodeUniform=e,this.access=e?e.access:Fl.READ_WRITE,this.groupNode=t}get attribute(){return this.nodeUniform.value}get buffer(){return this.nodeUniform.value.array}}const $L=[null];class EKe{constructor(e){this.backend=e,this._preferredCanvasFormat=null}getCurrentDepthStencilFormat(e){let t;return e.depth&&(e.depthTexture!==null?t=this.getTextureFormatGPU(e.depthTexture):e.stencil?this.backend.renderer.reversedDepthBuffer===!0?t=it.Depth32FloatStencil8:t=it.Depth24PlusStencil8:this.backend.renderer.reversedDepthBuffer===!0?t=it.Depth32Float:t=it.Depth24Plus),t}getTextureFormatGPU(e){return this.backend.get(e).format}getTextureSampleData(e){let t;if(e.isFramebufferTexture)t=1;else if(e.isDepthTexture&&!e.renderTarget){const s=this.backend.renderer,a=s.getRenderTarget();t=a?a.samples:s.currentSamples}else e.renderTarget&&(t=e.renderTarget.samples);t=this.getSampleCount(t||1);const r=t>1&&e.renderTarget!==null&&e.isDepthTexture!==!0&&e.isFramebufferTexture!==!0;return{samples:t,primarySamples:r?1:t,isMSAA:r}}getCurrentColorFormat(e){let t;return e.textures!==null?t=this.getTextureFormatGPU(e.textures[0]):t=this.getPreferredCanvasFormat(),t}getCurrentColorFormats(e){return e.textures!==null?e.textures.map(t=>this.getTextureFormatGPU(t)):[this.getPreferredCanvasFormat()]}getCurrentColorSpace(e){return e.textures!==null?e.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(e,t){if(e.isPoints)return BS.PointList;if(e.isLineSegments||e.isMesh&&t.wireframe===!0)return BS.LineList;if(e.isLine)return BS.LineStrip;if(e.isMesh)return BS.TriangleList}getSampleCount(e){return e>=4?4:1}
vendor: 4,376 bytes, lines 4525-4564
4525getSampleCountRenderContext(e){return e.textures!==null?this.getSampleCount(e.sampleCount):this.getSampleCount(this.backend.renderer.currentSamples)}getPreferredCanvasFormat(){const t=this.backend.parameters.outputType;if(t===void 0)return this._preferredCanvasFormat===null&&(this._preferredCanvasFormat=navigator.gpu.getPreferredCanvasFormat()),this._preferredCanvasFormat;if(t===Zs)return it.BGRA8Unorm;if(t===Js)return it.RGBA16Float;throw new Error("THREE.WebGPUUtils: Unsupported output buffer type.")}}function t0(n,e){$L[0]=e,n.queue.submit($L),$L[0]=null}class jme{constructor(){this.label="",this.layout=null,this.entries=[]}reset(){this.label="",this.layout=null,this.entries.length=0}}class P_{constructor(){this.label="",this.size=0,this.usage=0,this.mappedAtCreation=!1}reset(){this.label="",this.size=0,this.usage=0,this.mappedAtCreation=!1}}class UT{constructor(){this.label=""}reset(){this.label=""}}class Ime{constructor(){this.label="",this.colorFormats=null,this.depthStencilFormat=void 0,this.sampleCount=1,this.depthReadOnly=!1,this.stencilReadOnly=!1}reset(){this.label="",this.colorFormats=null,this.depthStencilFormat=void 0,this.sampleCount=1,this.depthReadOnly=!1,this.stencilReadOnly=!1}}class T4{constructor(){this.view=null,this.depthSlice=void 0,this.resolveTarget=void 0,this.clearValue=void 0,this.loadOp=void 0,this.storeOp=void 0}reset(){this.view=null,this.depthSlice=void 0,this.resolveTarget=void 0,this.clearValue=void 0,this.loadOp=void 0,this.storeOp=void 0}}class E4{constructor(){this.label="",this.colorAttachments=[],this.depthStencilAttachment=void 0,this.occlusionQuerySet=void 0,this.timestampWrites=void 0,this.maxDrawCount=5e7}reset(){this.label="",this.colorAttachments.length=0,this.depthStencilAttachment=void 0,this.occlusionQuerySet=void 0,this.timestampWrites=void 0,this.maxDrawCount=5e7}}class Fme{constructor(){this.label="",this.layout=null,this.vertex=null,this.primitive={},this.depthStencil=void 0,this.multisample=new CKe,this.fragment=null}reset(){this.label="",this.layout=null,this.vertex=null,this.primitive={},this.depthStencil=void 0,this.multisample.reset(),this.fragment=null}}class CKe{constructor(){this.count=1,this.mask=4294967295,this.alphaToCoverageEnabled=!1}reset(){this.count=1,this.mask=4294967295,this.alphaToCoverageEnabled=!1}}class Ume{constructor(){this.label="",this.code="",this.compilationHints=[]}reset(){this.label="",this.code="",this.compilationHints.length=0}}class mq{constructor(){this.label="",this.size={width:0,height:1,depthOrArrayLayers:1},this.mipLevelCount=1,this.sampleCount=1,this.dimension="2d",this.format=void 0,this.usage=void 0,this.viewFormats=[],this.textureBindingViewDimension=void 0}reset(){this.label="",this.size.width=0,this.size.height=1,this.size.depthOrArrayLayers=1,this.mipLevelCount=1,this.sampleCount=1,this.dimension="2d",this.format=void 0,this.usage=void 0,this.viewFormats.length=0,this.textureBindingViewDimension=void 0}}class gq{constructor(){this.label="",this.format=void 0,this.dimension=void 0,this.usage=0,this.aspect="all",this.baseMipLevel=0,this.mipLevelCount=void 0,this.baseArrayLayer=0,this.arrayLayerCount=void 0,this.swizzle="rgba"}reset(){this.label="",this.format=void 0,this.dimension=void 0,this.usage=0,this.aspect="all",this.baseMipLevel=0,this.mipLevelCount=void 0,this.baseArrayLayer=0,this.arrayLayerCount=void 0,this.swizzle="rgba"}}const oA=new jme,lA=new P_,dN=new UT,HL=new Ime,WL=new E4,O2=new Fme,X3=new T4,hN=new Ume,D2=new mq,Wa=new gq;class NKe extends Z1{constructor(e){super(),this.device=e;const t=` 4526struct VarysStruct { 4527 @builtin( position ) Position: vec4f, 4528 @location( 0 ) vTex : vec2f, 4529 @location( 1 ) @interpolate(flat, either) vBaseArrayLayer: u32, 4530}; 4531 4532@group( 0 ) @binding ( 2 ) 4533var<uniform> flipY: u32; 4534 4535@vertex 4536fn mainVS( 4537 @builtin( vertex_index ) vertexIndex : u32, 4538 @builtin( instance_index ) instanceIndex : u32 ) -> VarysStruct { 4539 4540 var Varys : VarysStruct; 4541 4542 var pos = array( 4543 vec2f( -1, -1 ), 4544 vec2f( -1, 3 ), 4545 vec2f( 3, -1 ), 4546 ); 4547 4548 let p = pos[ vertexIndex ]; 4549 let mult = select( vec2f( 0.5, -0.5 ), vec2f( 0.5, 0.5 ), flipY != 0 ); 4550 Varys.vTex = p * mult + vec2f( 0.5 ); 4551 Varys.Position = vec4f( p, 0, 1 ); 4552 Varys.vBaseArrayLayer = instanceIndex; 4553 4554 return Varys; 4555 4556} 4557 4558@group( 0 ) @binding( 0 ) 4559var imgSampler : sampler; 4560 4561@group( 0 ) @binding( 1 ) 4562var img2d : texture_2d<f32>; 4563 4564@fragment
4565fn main_2d( Varys: VarysStruct ) -> @location( 0 ) vec4<f32> { 4566 4567 return textureSample( img2d, imgSampler, Varys.vTex ); 4568 4569} 4570 4571@group( 0 ) @binding( 1 ) 4572var img2dArray : texture_2d_array<f32>; 4573 4574@fragment 4575fn main_2d_array( Varys: VarysStruct ) -> @location( 0 ) vec4<f32> { 4576 4577 return textureSample( img2dArray, imgSampler, Varys.vTex, Varys.vBaseArrayLayer ); 4578 4579} 4580 4581const faceMat = array( 4582 mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1 ), // pos-x 4583 mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1 ), // neg-x 4584 mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1 ), // pos-y 4585 mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1 ), // neg-y 4586 mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1 ), // pos-z 4587 mat3x3f( -2, 0, 0, 0, -2, 0, 1, 1, -1 ), // neg-z 4588); 4589 4590@group( 0 ) @binding( 1 ) 4591var imgCube : texture_cube<f32>; 4592 4593@fragment 4594fn main_cube( Varys: VarysStruct ) -> @location( 0 ) vec4<f32> { 4595 4596 return textureSample( imgCube, imgSampler, faceMat[ Varys.vBaseArrayLayer ] * vec3f( fract( Varys.vTex ), 1 ) ); 4597 4598} 4599`;this.mipmapSampler=e.createSampler({minFilter:Eh.Linear}),this.flipYSampler=e.createSampler({minFilter:Eh.Nearest}),lA.size=4,lA.usage=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,this.flipUniformBuffer=e.createBuffer(lA),lA.reset(),e.queue.writeBuffer(this.flipUniformBuffer,0,new Uint32Array([1])),lA.size=4,lA.usage=GPUBufferUsage.UNIFORM,this.noFlipUniformBuffer=e.createBuffer(lA),lA.reset(),this.transferPipelines={},hN.label="mipmap",hN.code=t,this.mipmapShaderModule=e.createShaderModule(hN),hN.reset()}getTransferPipeline(e,t){t=t||"2d-array";const r=`${e}-${t}`;let i=this.transferPipelines[r];return i===void 0&&(O2.label=`mipmap-${e}-${t}`,O2.vertex={module:this.mipmapShaderModule},O2.fragment={module:this.mipmapShaderModule,entryPoint:`main_${t.replace("-","_")}`,targets:[{format:e}]},O2.layout="auto",i=this.device.createRenderPipeline(O2),O2.reset(),this.transferPipelines[r]=i),i}flipY(e,t,r=0){const i=t.format,{width:s,height:a}=t.size;D2.size.width=s,D2.size.height=a,D2.format=i,D2.usage=GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING;const o=this.device.createTexture(D2);D2.reset();const l=this.getTransferPipeline(i,e.textureBindingViewDimension),u=this.getTransferPipeline(i,o.textureBindingViewDimension),d=this.device.createCommandEncoder(dN),h=(f,p,g,A,x,b)=>{const _=f.getBindGroupLayout(0);Wa.dimension=p.textureBindingViewDimension||"2d-array",Wa.mipLevelCount=1;const M=p.createView(Wa);Wa.reset(),oA.layout=_,oA.entries.push({binding:0,resource:this.flipYSampler},{binding:1,resource:M},{binding:2,resource:{buffer:b?this.flipUniformBuffer:this.noFlipUniformBuffer}});const T=this.device.createBindGroup(oA);oA.reset(),Wa.dimension="2d",Wa.mipLevelCount=1,Wa.baseArrayLayer=x,Wa.arrayLayerCount=1;const L=A.createView(Wa);Wa.reset(),X3.view=L,X3.loadOp=fs.Clear,X3.storeOp=Zc.Store,WL.colorAttachments.push(X3);const D=d.beginRenderPass(WL);WL.reset(),X3.reset(),D.setPipeline(f),D.setBindGroup(0,T),D.draw(3,1,0,g),D.end()};h(l,e,r,o,0,!1),h(u,o,0,e,r,!0),t0(this.device,d.finish()),o.destroy()}generateMipmaps(e,t=null){const r=this.get(e),i=r.layers||this._mipmapCreateBundles(e);let s=t;s===null&&(dN.label="mipmapEncoder",s=this.device.createCommandEncoder(dN),dN.reset()),this._mipmapRunBundles(s,i),t===null&&t0(this.device,s.finish()),r.layers=i}_mipmapCreateBundles(e){const t=e.textureBindingViewDimension||"2d-array",r=this.getTransferPipeline(e.format,t),i=r.getBindGroupLayout(0),s=[];for(let a=1;a<e.mipLevelCount;a++)for(let o=0;o<e.depthOrArrayLayers;o++){Wa.dimension=t,Wa.baseMipLevel=a-1,Wa.mipLevelCount=1;const l=e.createView(Wa);Wa.reset(),oA.layout=i,oA.entries.push({binding:0,resource:this.mipmapSampler},{binding:1,resource:l},{binding:2,resource:{buffer:this.noFlipUniformBuffer}});const u=this.device.createBindGroup(oA);oA.reset(),Wa.dimension="2d",Wa.baseMipLevel=a,Wa.mipLevelCount=1,Wa.baseArrayLayer=o,Wa.arrayLayerCount=1;const d=e.createView(Wa);Wa.reset();const h=new T4;h.view=d,h.loadOp=fs.Clear,h.storeOp=Zc.Store;const f=new E4;f.colorAttachments.push(h),HL.colorFormats=[e.format];const p=this.device.createRenderBundleEncoder(HL);HL.reset(),p.setPipeline(r),p.setBindGroup(0,u),p.draw(3,1,0,o),s.push({renderBundles:[p.finish()],passDescriptor:f})}return s}_mipmapRunBundles(e,t){const r=t.length;for(let i=0;i<r;i++){const s=t[i],a=e.beginRenderPass(s.passDescriptor);a.executeBundles(s.renderBundles),a.end()}}}class MKe{constructor(){this.label="",this.addressModeU="clamp-to-edge",this.addressModeV="clamp-to-edge",this.addressModeW="clamp-to-edge",this.magFilter="nearest",this.minFilter="nearest",this.mipmapFilter="nearest",this.lodMinClamp=0,this.lodMaxClamp=32,this.compare=void 0,this.maxAnisotropy=1}reset(){this.label="",this.addressModeU="clamp-to-edge",this.addressModeV="clamp-to-edge",this.addressModeW="clamp-to-edge",this.magFilter="nearest",this.minFilter="nearest",this.mipmapFilter="nearest",this.lodMinClamp=0,this.lodMaxClamp=32,this.compare=void 0,this.maxAnisotropy=1}}class FR{constructor(){this.texture=null,this.mipLevel=0,this.origin={x:0,y:0,z:0},this.aspect="all"}reset(){this.texture=null,this.mipLevel=0,this.origin.x=0,this.origin.y=0,this.origin.z=0,this.aspect="all"}}class kKe{constructor(){this.buffer=null,this.offset=0,this.bytesPerRow=void 0,this.rowsPerImage=void 0}reset(){this.buffer=null,this.offset=0,this.bytesPerRow=void 0,this.rowsPerImage=void 0}}class RKe{constructor(){this.offset=0,this.bytesPerRow=void 0,this.rowsPerImage=void 0}reset(){this.offset=0,this.bytesPerRow=void 0,this.rowsPerImage=void 0}}class PKe{constructor(){this.source=null,this.origin={x:0,y:0},this.flipY=!1}reset(){this.source=null,this.origin.x=0,this.origin.y=0,this.flipY=!1}}
4599class LKe extends FR{constructor(){super(),this.colorSpace="srgb",this.premultipliedAlpha=!1}reset(){super.reset(),this.colorSpace="srgb",this.premultipliedAlpha=!1}}class Bme{constructor(){this.width=0,this.height=1,this.depthOrArrayLayers=1}reset(){this.width=0,this.height=1,this.depthOrArrayLayers=1}}const fN=new P_,OKe=new UT,sc=new MKe,dc=new FR,pN=new kKe,Dm=new RKe,mN=new PKe,j2=new LKe,cA=new mq,cc=new Bme,DKe={[jV]:"never",[W8]:"less",[IV]:"equal",[$1]:"less-equal",[y5]:"greater",[eg]:"greater-equal",[UV]:"always",[FV]:"not-equal"},jKe=[0,1,3,2,4,5];function oee(n,e,t,r,i,s,a,o,l,u){dc.texture=e,dc.mipLevel=t,dc.origin.z=r,Dm.offset=r*s,Dm.bytesPerRow=a,Dm.rowsPerImage=o,cc.width=l,cc.height=u,n.queue.writeTexture(dc,i.data,Dm,cc),dc.reset(),Dm.reset(),cc.reset()}class IKe{constructor(e){this.backend=e,this._passUtils=null,this.defaultTexture={},this.defaultCubeTexture={},this.defaultVideoFrame=null,this._samplerCache=new Map}updateSampler(e){const t=this.backend,r=e.texture,i=e.textureNode,s=r.minFilter+"-"+r.magFilter+"-"+r.wrapS+"-"+r.wrapT+"-"+(r.wrapR||"0")+"-"+r.anisotropy+"-"+(r.isDepthTexture===!0?1:0)+"-"+(r.compareFunction!==null&&i.compareNode!==null?r.compareFunction:0);let a=this._samplerCache.get(s);if(a===void 0){sc.addressModeU=this._convertAddressMode(r.wrapS),sc.addressModeV=this._convertAddressMode(r.wrapT),sc.addressModeW=this._convertAddressMode(r.wrapR),sc.magFilter=this._convertFilterMode(r.magFilter),sc.minFilter=this._convertFilterMode(r.minFilter),sc.mipmapFilter=this._convertMipmapFilterMode(r.minFilter),r.isDepthTexture&&(r.compareFunction===null||i.compareNode===null)&&(sc.magFilter=Eh.Nearest,sc.minFilter=Eh.Nearest,sc.mipmapFilter=Eh.Nearest),sc.magFilter===Eh.Linear&&sc.minFilter===Eh.Linear&&sc.mipmapFilter===Eh.Linear&&(sc.maxAnisotropy=r.anisotropy),r.isDepthTexture&&r.compareFunction!==null&&i.compareNode!==null&&t.hasCompatibility(_y.TEXTURE_COMPARE)&&(sc.compare=DKe[r.compareFunction]);const l=t.device.createSampler(sc);sc.reset(),a={sampler:l,usedTimes:0},this._samplerCache.set(s,a)}const o=t.get(e);return o.sampler!==a.sampler&&(this._releaseSampler(o),o.samplerKey=s,o.sampler=a.sampler,a.usedTimes++),s}destroySampler(e){this._releaseSampler(this.backend.get(e))}_releaseSampler(e){if(e.sampler!==void 0){const t=this._samplerCache.get(e.samplerKey);t.usedTimes--,t.usedTimes===0&&this._samplerCache.delete(e.samplerKey),e.sampler=void 0,e.samplerKey=void 0}}createDefaultTexture(e){let t;const r=oU(e,this.backend.device);e.isCubeTexture?t=this._getDefaultCubeTextureGPU(r):t=this._getDefaultTextureGPU(r),this.backend.get(e).texture=t}createTexture(e,t={}){const r=this.backend,i=r.get(e);if(i.initialized){if(i.externalTexture===!0)return;throw new Error("THREE.WebGPUTextureUtils: Texture already initialized.")}if(e.isExternalTexture){i.texture=e.sourceTexture,i.initialized=!0;return}t.needsMipmaps===void 0&&(t.needsMipmaps=!1),t.levels===void 0&&(t.levels=1),t.depth===void 0&&(t.depth=1);const{width:s,height:a,depth:o,levels:l}=t;e.isFramebufferTexture&&(t.renderTarget?t.format=this.backend.utils.getCurrentColorFormat(t.renderTarget):t.format=this.backend.utils.getPreferredCanvasFormat());const u=this._getDimension(e),d=e.internalFormat||t.format||oU(e,r.device);i.format=d;const{samples:h,primarySamples:f,isMSAA:p}=r.utils.getTextureSampleData(e);let g=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC;e.isStorageTexture===!0&&(g|=GPUTextureUsage.STORAGE_BINDING),e.isCompressedTexture!==!0&&e.isCompressedArrayTexture!==!0&&d!==it.RGB9E5UFloat&&(g|=GPUTextureUsage.RENDER_ATTACHMENT);const A=new mq;if(A.label=e.name,A.size.width=s,A.size.height=a,A.size.depthOrArrayLayers=o,A.mipLevelCount=l,A.sampleCount=f,A.dimension=u,A.format=d,A.usage=g,d===void 0){an("WebGPURenderer: Texture format not supported."),this.createDefaultTexture(e);return}e.isCubeTexture&&(A.textureBindingViewDimension=Rl.Cube);try{i.texture=r.device.createTexture(A)}catch{an("WebGPURenderer: Failed to create texture with descriptor:",A),this.createDefaultTexture(e);return}if(p){const x=Object.assign({},A);x.label=x.label+"-msaa",x.sampleCount=h,x.mipLevelCount=1,i.msaaTexture=r.device.createTexture(x)}i.initialized=!0,i.textureDescriptorGPU=A}
4599destroyTexture(e,t=!1){const r=this.backend,i=r.get(e);i.texture!==void 0&&t===!1&&e.isExternalTexture!==!0&&i.texture.destroy(),i.msaaTexture!==void 0&&i.msaaTexture.destroy(),r.delete(e)}generateMipmaps(e,t=null){const r=this.backend.get(e);this._generateMipmaps(r.texture,t)}getColorBuffer(){const e=this.backend,t=e.renderer.getCanvasTarget(),{width:r,height:i}=e.getDrawingBufferSize(),s=e.renderer.currentSamples,a=t.colorTexture,o=e.get(a);if(a.width===r&&a.height===i&&a.samples===s)return o.texture;let l=o.texture;return l&&l.destroy(),cA.label="colorBuffer",cA.size.width=r,cA.size.height=i,cA.sampleCount=e.utils.getSampleCount(e.renderer.currentSamples),cA.format=e.utils.getPreferredCanvasFormat(),cA.usage=GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,l=e.device.createTexture(cA),cA.reset(),a.source.width=r,a.source.height=i,a.samples=s,o.texture=l,l}getDepthBuffer(e=!0,t=!1){const r=this.backend,i=r.renderer.getCanvasTarget(),{width:s,height:a}=r.getDrawingBufferSize(),o=r.renderer.currentSamples,l=i.depthTexture;if(l.width===s&&l.height===a&&l.samples===o&&l.depth===e&&l.stencil===t)return r.get(l).texture;const u=r.get(l).texture;let d,h;if(t?(d=vc,h=r.renderer.reversedDepthBuffer===!0?ia:Ku):e&&(d=ml,h=r.renderer.reversedDepthBuffer===!0?ia:ts),u!==void 0){if(l.image.width===s&&l.image.height===a&&l.format===d&&l.type===h&&l.samples===o)return u;this.destroyTexture(l)}return l.name="depthBuffer",l.format=d,l.type=h,l.image.width=s,l.image.height=a,l.samples=o,this.createTexture(l,{width:s,height:a}),r.get(l).texture}updateTexture(e,t){const r=this.backend.get(e),i=e.mipmaps,{textureDescriptorGPU:s}=r;if(!(e.isRenderTargetTexture||s===void 0)){if(e.isDataTexture)if(i.length>0)for(let a=0,o=i.length;a<o;a++){const l=i[a];this._copyBufferToTexture(l,r.texture,s,0,e.flipY,0,a)}else this._copyBufferToTexture(t.image,r.texture,s,0,e.flipY);else if(e.isArrayTexture||e.isDataArrayTexture||e.isData3DTexture)if(e.layerUpdates&&e.layerUpdates.size>0){for(const a of e.layerUpdates)this._copyBufferToTexture(t.image,r.texture,s,a,e.flipY,a);e.clearLayerUpdates()}else for(let a=0;a<t.image.depth;a++)this._copyBufferToTexture(t.image,r.texture,s,a,e.flipY,a);else if(e.isCompressedTexture||e.isCompressedArrayTexture)e.isCompressedArrayTexture&&e.layerUpdates.size>0?(this._copyCompressedBufferToTexture(e.mipmaps,r.texture,s,e.layerUpdates),e.clearLayerUpdates()):this._copyCompressedBufferToTexture(e.mipmaps,r.texture,s);else if(e.isCubeTexture)this._copyCubeMapToTexture(e,r.texture,s);else if(e.isHTMLTexture){const a=this.backend.device,o=this.backend.renderer.domElement,l=e.image;if(typeof a.queue.copyElementImageToTexture!="function")return;if(!r.hasPaintCallback){r.hasPaintCallback=!0,o.requestPaint();return}const u=s.size.width,d=s.size.height;a.queue.copyElementImageToTexture.length===2?a.queue.copyElementImageToTexture({source:l},{destination:{texture:r.texture},width:u,height:d}):a.queue.copyElementImageToTexture(l,u,d,{texture:r.texture}),e.flipY&&this._flipY(r.texture,s)}else if(i.length>0)for(let a=0,o=i.length;a<o;a++){const l=i[a];this._copyImageToTexture(l,r.texture,s,0,e.flipY,e.premultiplyAlpha,a)}else this._copyImageToTexture(t.image,r.texture,s,0,e.flipY,e.premultiplyAlpha);r.version=e.version}}async copyTextureToBuffer(e,t,r,i,s,a){const o=this.backend.device,l=this.backend.get(e),u=l.texture,d=l.textureDescriptorGPU.format,h=this._getBytesPerTexel(d);let f=i*h;f=Math.ceil(f/256)*256,fN.size=(s-1)*f+i*h,fN.usage=GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ;const p=o.createBuffer(fN);fN.reset();const g=o.createCommandEncoder(OKe);dc.texture=u,dc.origin.x=t,dc.origin.y=r,dc.origin.z=a,pN.buffer=p,pN.bytesPerRow=f,cc.width=i,cc.height=s,g.copyTextureToBuffer(dc,pN,cc),dc.reset(),pN.reset(),cc.reset();const A=this._getTypedArrayType(d);t0(o,g.finish()),await p.mapAsync(GPUMapMode.READ);const x=p.getMappedRange().slice();return p.destroy(),new A(x)}dispose(){this._samplerCache.clear()}_getDefaultTextureGPU(e){let t=this.defaultTexture[e];if(t===void 0){const r=new ko;r.minFilter=cs,r.magFilter=cs,this.createTexture(r,{width:1,height:1,format:e}),this.defaultTexture[e]=t=r}return this.backend.get(t).texture}_getDefaultCubeTextureGPU(e){let t=this.defaultCubeTexture[e];if(t===void 0){const r=new __;r.minFilter=cs,r.magFilter=cs,this.createTexture(r,{width:1,height:1,depth:6}),this.defaultCubeTexture[e]=t=r}return this.backend.get(t).texture}_copyCubeMapToTexture(e,t,r){const i=e.images,s=e.mipmaps;for(let a=0;a<6;a++){const o=i[a],l=e.flipY===!0?jKe[a]:a;o.isDataTexture?this._copyBufferToTexture(o.image,t,r,l,e.flipY):this._copyImageToTexture(o,t,r,l,e.flipY,e.premultiplyAlpha);for(let u=0;u<s.length;u++){const h=s[u].images[a];h.isDataTexture?this._copyBufferToTexture(h.image,t,r,l,e.flipY,0,u+1):this._copyImageToTexture(h,t,r,l,e.flipY,e.premultiplyAlpha,u+1)}}}_copyImageToTexture(e,t,r,i,s,a,o=0){const l=this.backend.device,u=o>0?e.width:r.size.width,d=o>0?e.height:r.size.height;mN.source=e,mN.flipY=s,j2.texture=t,j2.mipLevel=o,j2.origin.z=i,j2.premultipliedAlpha=a,cc.width=u,cc.height=d;try{l.queue.copyExternalImageToTexture(mN,j2,cc)}catch{}finally{mN.reset(),j2.reset(),cc.reset()}}_getPassUtils(){let e=this._passUtils;return e===null&&(this._passUtils=e=new NKe(this.backend.device)),e}_generateMipmaps(e,t=null){this._getPassUtils().generateMipmaps(e,t)}_flipY(e,t,r=0){this._getPassUtils().flipY(e,t,r)}_copyBufferToTexture(e,t,r,i,s,a=0,o=0){const l=this.backend.device,u=e.data,d=this._getBytesPerTexel(r.format),h=e.width*d;dc.texture=t,dc.mipLevel=o,dc.origin.z=i,Dm.offset=e.width*e.height*d*a,Dm.bytesPerRow=h,cc.width=e.width,cc.height=e.height,l.queue.writeTexture(dc,u,Dm,cc),dc.reset(),Dm.reset(),cc.reset(),s===!0&&this._flipY(t,r,i)}_copyCompressedBufferToTexture(e,t,r,i=null){const s=this.backend.device,a=this._getBlockData(r.format),o=r.size.depthOrArrayLayers>1,l=i&&i.size>0?i:null;for(let u=0;u<e.length;u++){const d=e[u],h=d.width,f=d.height,p=o?r.size.depthOrArrayLayers:1,g=Math.ceil(h/a.width)*a.byteLength,A=Math.ceil(f/a.height),x=g*A,b=Math.ceil(h/a.width)*a.width,_=A*a.height;if(l!==null)for(const M of l)oee(s,t,u,M,d,x,g,A,b,_);else for(let M=0;M<p;M++)oee(s,t,u,M,d,x,g,A,b,_)}}_getBlockData(e){if(e===it.BC1RGBAUnorm||e===it.BC1RGBAUnormSRGB)return{byteLength:8,width:4,height:4};if(e===it.BC2RGBAUnorm||e===it.BC2RGBAUnormSRGB)return{byteLength:16,width:4,height:4};if(e===it.BC3RGBAUnorm||e===it.BC3RGBAUnormSRGB)return{byteLength:16,width:4,height:4};if(e===it.BC4RUnorm||e===it.BC4RSnorm)return{byteLength:8,width:4,height:4};if(e===it.BC5RGUnorm||e===it.BC5RGSnorm)return{byteLength:16,width:4,height:4};if(e===it.BC6HRGBUFloat||e===it.BC6HRGBFloat)return{byteLength:16,width:4,height:4};if(e===it.BC7RGBAUnorm||e===it.BC7RGBAUnormSRGB)return{byteLength:16,width:4,height:4};if(e===it.ETC2RGB8Unorm||e===it.ETC2RGB8UnormSRGB)return{byteLength:8,width:4,height:4};if(e===it.ETC2RGB8A1Unorm||e===it.ETC2RGB8A1UnormSRGB)return{byteLength:8,width:4,height:4};if(e===it.ETC2RGBA8Unorm||e===it.ETC2RGBA8UnormSRGB)return{byteLength:16,width:4,height:4};if(e===it.EACR11Unorm)return{byteLength:8,width:4,height:4};if(e===it.EACR11Snorm)return{byteLength:8,width:4,height:4};if(e===it.EACRG11Unorm)return{byteLength:16,width:4,height:4};if(e===it.EACRG11Snorm)return{byteLength:16,width:4,height:4};if(e===it.ASTC4x4Unorm||e===it.ASTC4x4UnormSRGB)return{byteLength:16,width:4,height:4};if(e===it.ASTC5x4Unorm||e===it.ASTC5x4UnormSRGB)return{byteLength:16,width:5,height:4};if(e===it.ASTC5x5Unorm||e===it.ASTC5x5UnormSRGB)return{byteLength:16,width:5,height:5};if(e===it.ASTC6x5Unorm||e===it.ASTC6x5UnormSRGB)return{byteLength:16,width:6,height:5};if(e===it.ASTC6x6Unorm||e===it.ASTC6x6UnormSRGB)return{byteLength:16,width:6,height:6};if(e===it.ASTC8x5Unorm||e===it.ASTC8x5UnormSRGB)return{byteLength:16,width:8,height:5};if(e===it.ASTC8x6Unorm||e===it.ASTC8x6UnormSRGB)return{byteLength:16,width:8,height:6};if(e===it.ASTC8x8Unorm||e===it.ASTC8x8UnormSRGB)return{byteLength:16,width:8,height:8};if(e===it.ASTC10x5Unorm||e===it.ASTC10x5UnormSRGB)return{byteLength:16,width:10,height:5};if(e===it.ASTC10x6Unorm||e===it.ASTC10x6UnormSRGB)return{byteLength:16,width:10,height:6};if(e===it.ASTC10x8Unorm||e===it.ASTC10x8UnormSRGB)return{byteLength:16,width:10,height:8};if(e===it.ASTC10x10Unorm||e===it.ASTC10x10UnormSRGB)return{byteLength:16,width:10,height:10};if(e===it.ASTC12x10Unorm||e===it.ASTC12x10UnormSRGB)return{byteLength:16,width:12,height:10};if(e===it.ASTC12x12Unorm||e===it.ASTC12x12UnormSRGB)return{byteLength:16,width:12,height:12}}_convertAddressMode(e){let t=zL.ClampToEdge;return e===Jv?t=zL.Repeat:e===ey&&(t=zL.MirrorRepeat),t}_convertFilterMode(e){let t=Eh.Linear;return(e===cs||e===OV||e===a0)&&(t=Eh.Nearest),t}_convertMipmapFilterMode(e){return e===a0||e===hu?Eh.Linear:Eh.Nearest}_getBytesPerTexel(e){if(e===it.R8Unorm||e===it.R8Snorm||e===it.R8Uint||e===it.R8Sint)return 1;if(e===it.R16Uint||e===it.R16Sint||e===it.R16Float||e===it.RG8Unorm||e===it.RG8Snorm||e===it.RG8Uint||e===it.RG8Sint||e===it.R16Unorm||e===it.R16Snorm)return 2;if(e===it.R32Uint||e===it.R32Sint||e===it.R32Float||e===it.RG16Uint||e===it.RG16Sint||e===it.RG16Float||e===it.RGBA8Unorm||e===it.RGBA8UnormSRGB||e===it.RGBA8Snorm||e===it.RGBA8Uint||e===it.RGBA8Sint||e===it.BGRA8Unorm||e===it.BGRA8UnormSRGB||e===it.RG16Unorm||e===it.RG16Snorm||e===it.RGB9E5UFloat||e===it.RGB10A2Unorm||e===it.RG11B10UFloat||e===it.Depth32Float||e===it.Depth24Plus||e===it.Depth24PlusStencil8||e===it.Depth32FloatStencil8)return 4;if(e===it.RG32Uint||e===it.RG32Sint||e===it.RG32Float||e===it.RGBA16Uint||e===it.RGBA16Sint||e===it.RGBA16Float||e===it.RGBA16Unorm||e===it.RGBA16Snorm)return 8;if(e===it.RGBA32Uint||e===it.RGBA32Sint||e===it.RGBA32Float)return 16}_getTypedArrayType(e){if(e===it.R8Uint)return Uint8Array;
4599if(e===it.R8Sint)return Int8Array;if(e===it.R8Unorm)return Uint8Array;if(e===it.R8Snorm)return Int8Array;if(e===it.RG8Uint)return Uint8Array;if(e===it.RG8Sint)return Int8Array;if(e===it.RG8Unorm)return Uint8Array;if(e===it.RG8Snorm)return Int8Array;if(e===it.RGBA8Uint)return Uint8Array;if(e===it.RGBA8Sint)return Int8Array;if(e===it.RGBA8Unorm||e===it.RGBA8UnormSRGB)return Uint8Array;if(e===it.RGBA8Snorm)return Int8Array;if(e===it.R16Uint)return Uint16Array;if(e===it.R16Sint)return Int16Array;if(e===it.RG16Uint)return Uint16Array;if(e===it.RG16Sint)return Int16Array;if(e===it.RGBA16Uint)return Uint16Array;if(e===it.RGBA16Sint)return Int16Array;if(e===it.R16Float||e===it.RG16Float||e===it.RGBA16Float||e===it.R16Unorm)return Uint16Array;if(e===it.R16Snorm)return Int16Array;if(e===it.RG16Unorm)return Uint16Array;if(e===it.RG16Snorm)return Int16Array;if(e===it.RGBA16Unorm)return Uint16Array;if(e===it.RGBA16Snorm)return Int16Array;if(e===it.R32Uint)return Uint32Array;if(e===it.R32Sint)return Int32Array;if(e===it.R32Float)return Float32Array;if(e===it.RG32Uint)return Uint32Array;if(e===it.RG32Sint)return Int32Array;if(e===it.RG32Float)return Float32Array;if(e===it.RGBA32Uint)return Uint32Array;if(e===it.RGBA32Sint)return Int32Array;if(e===it.RGBA32Float)return Float32Array;if(e===it.BGRA8Unorm||e===it.BGRA8UnormSRGB)return Uint8Array;
4599if(e===it.RGB10A2Unorm||e===it.RGB9E5UFloat||e===it.RG11B10UFloat)return Uint32Array;if(e===it.Depth32Float)return Float32Array;if(e===it.Depth24Plus||e===it.Depth24PlusStencil8)return Uint32Array;if(e===it.Depth32FloatStencil8)return Float32Array}_getDimension(e){let t;return e.is3DTexture||e.isData3DTexture?t=see.ThreeD:t=see.TwoD,t}}function oU(n,e){const t=n.format,r=n.type,i=n.normalized,s=n.colorSpace,a=_r.getTransfer(s);let o,l=!1;if(i&&(l=e.features.has(qk.TextureFormatsTier1),l===!1&&an("WebGPURenderer: Unable to use normalized textures without texture-formats-tier1 feature.")),n.isCompressedTexture===!0||n.isCompressedArrayTexture===!0)switch(t){case l1:case c1:o=a===$n?it.BC1RGBAUnormSRGB:it.BC1RGBAUnorm;break;case u1:o=a===$n?it.BC2RGBAUnormSRGB:it.BC2RGBAUnorm;break;case d1:o=a===$n?it.BC3RGBAUnormSRGB:it.BC3RGBAUnorm;break;case jw:o=it.BC4RUnorm;break;case Iw:o=it.BC4RSnorm;break;case N1:o=it.BC5RGUnorm;break;case Fw:o=it.BC5RGSnorm;break;case Lw:o=a===$n?it.BC7RGBAUnormSRGB:it.BC7RGBAUnorm;break;case Ow:o=it.BC6HRGBFloat;break;case Dw:o=it.BC6HRGBUFloat;break;case pw:case fw:o=a===$n?it.ETC2RGB8UnormSRGB:it.ETC2RGB8Unorm;break;case mw:o=a===$n?it.ETC2RGBA8UnormSRGB:it.ETC2RGBA8Unorm;break;case gw:o=it.EACR11Unorm;break;case Aw:o=it.EACR11Snorm;break;case C1:o=it.EACRG11Unorm;break;case xw:o=it.EACRG11Snorm;break;case vw:o=a===$n?it.ASTC4x4UnormSRGB:it.ASTC4x4Unorm;break;case yw:o=a===$n?it.ASTC5x4UnormSRGB:it.ASTC5x4Unorm;break;case bw:o=a===$n?it.ASTC5x5UnormSRGB:it.ASTC5x5Unorm;break;case ww:o=a===$n?it.ASTC6x5UnormSRGB:it.ASTC6x5Unorm;break;case _w:o=a===$n?it.ASTC6x6UnormSRGB:it.ASTC6x6Unorm;break;case Sw:o=a===$n?it.ASTC8x5UnormSRGB:it.ASTC8x5Unorm;break;case Tw:o=a===$n?it.ASTC8x6UnormSRGB:it.ASTC8x6Unorm;break;case Ew:o=a===$n?it.ASTC8x8UnormSRGB:it.ASTC8x8Unorm;break;case Cw:o=a===$n?it.ASTC10x5UnormSRGB:it.ASTC10x5Unorm;break;case Nw:o=a===$n?it.ASTC10x6UnormSRGB:it.ASTC10x6Unorm;break;case Mw:o=a===$n?it.ASTC10x8UnormSRGB:it.ASTC10x8Unorm;break;case kw:o=a===$n?it.ASTC10x10UnormSRGB:it.ASTC10x10Unorm;break;case Rw:o=a===$n?it.ASTC12x10UnormSRGB:it.ASTC12x10Unorm;break;case Pw:o=a===$n?it.ASTC12x12UnormSRGB:it.ASTC12x12Unorm;break;case to:o=a===$n?it.RGBA8UnormSRGB:it.RGBA8Unorm;break;default:sn("WebGPURenderer: Unsupported texture format.",t)}else switch(t){case to:switch(r){case a1:o=it.RGBA8Snorm;break;case o1:o=l?it.RGBA16Snorm:it.RGBA16Sint;break;case jh:o=l?it.RGBA16Unorm:it.RGBA16Uint;break;case ts:o=it.RGBA32Uint;break;case oo:o=it.RGBA32Sint;break;case Zs:o=a===$n?it.RGBA8UnormSRGB:it.RGBA8Unorm;break;case Js:o=it.RGBA16Float;break;case ia:o=it.RGBA32Float;break;default:sn("WebGPURenderer: Unsupported texture type with RGBAFormat.",r)}break;case by:switch(r){case wT:o=it.RGB9E5UFloat;break;case _T:o=it.RG11B10UFloat;break;default:sn("WebGPURenderer: Unsupported texture type with RGBFormat.",r)}break;case wy:switch(r){case a1:o=it.R8Snorm;break;case o1:o=l?it.R16Snorm:it.R16Sint;break;case jh:o=l?it.R16Unorm:it.R16Uint;break;case ts:o=it.R32Uint;break;case oo:o=it.R32Sint;break;case Zs:o=it.R8Unorm;break;case Js:o=it.R16Float;break;case ia:o=it.R32Float;break;default:sn("WebGPURenderer: Unsupported texture type with RedFormat.",r)}break;case fl:switch(r){case a1:o=it.RG8Snorm;break;case o1:o=l?it.RG16Snorm:it.RG16Sint;break;case jh:o=l?it.RG16Unorm:it.RG16Uint;break;case ts:o=it.RG32Uint;break;case oo:o=it.RG32Sint;break;case Zs:o=it.RG8Unorm;break;case Js:o=it.RG16Float;break;case ia:o=it.RG32Float;break;default:sn("WebGPURenderer: Unsupported texture type with RGFormat.",r)}break;case ml:switch(r){case jh:o=it.Depth16Unorm;break;case ts:o=it.Depth24Plus;break;case ia:o=it.Depth32Float;break;default:sn("WebGPURenderer: Unsupported texture type with DepthFormat.",r)}break;case vc:switch(r){case Ku:o=it.Depth24PlusStencil8;break;case ia:e&&e.features.has(qk.Depth32FloatStencil8)===!1&&sn('WebGPURenderer: Depth textures with DepthStencilFormat + FloatType can only be used with the "depth32float-stencil8" GPU feature.'),o=it.Depth32FloatStencil8;break;default:sn("WebGPURenderer: Unsupported texture type with DepthStencilFormat.",r)}break;case G1:switch(r){case oo:o=it.R32Sint;break;case ts:o=it.R32Uint;break;default:sn("WebGPURenderer: Unsupported texture type with RedIntegerFormat.",r)}break;case q1:switch(r){case oo:o=it.RG32Sint;break;case ts:o=it.RG32Uint;break;default:sn("WebGPURenderer: Unsupported texture type with RGIntegerFormat.",r)}break;case b_:switch(r){case oo:o=it.RGBA32Sint;break;case ts:o=it.RGBA32Uint;break;default:sn("WebGPURenderer: Unsupported texture type with RGBAIntegerFormat.",r)}break;default:sn("WebGPURenderer: Unsupported texture format.",t)}return o}const FKe=/^[fn]*\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)\s*[\-\>]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,UKe=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/ig,lee={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2<f32>":"vec2","vec2<i32>":"ivec2","vec2<u32>":"uvec2","vec2<bool>":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3<f32>":"vec3","vec3<i32>":"ivec3","vec3<u32>":"uvec3","vec3<bool>":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4<f32>":"vec4","vec4<i32>":"ivec4","vec4<u32>":"uvec4","vec4<bool>":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2<f32>":"mat2",mat2x2f:"mat2","mat3x3<f32>":"mat3",mat3x3f:"mat3","mat4x4<f32>
4599":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_depth_2d_array:"depthTexture",texture_depth_multisampled_2d:"depthTexture",texture_depth_cube:"depthTexture",texture_depth_cube_array:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"},BKe=n=>{n=n.trim();const e=n.match(FKe);if(e!==null&&e.length===4){const t=e[2],r=[];let i=null;for(;(i=UKe.exec(t))!==null;)r.push({name:i[1],type:i[2]});const s=[];for(let d=0;d<r.length;d++){const{name:h,type:f}=r[d];let p=f;p.startsWith("ptr")?p="pointer":(p.startsWith("texture")&&(p=f.split("<")[0]),p=lee[p]),s.push(new hq(p,h))}const a=n.substring(e[0].length),o=e[3]||"void",l=e[1]!==void 0?e[1]:"";return{type:lee[o]||o,inputs:s,name:l,inputsCode:t,blockCode:
4599a,outputType:o}}else throw new Error("THREE.WGSLNodeFunction: Function is not a WGSL code.")};class VKe extends pq{constructor(e){const{type:t,inputs:r,name:i,inputsCode:s,blockCode:a,outputType:o}=BKe(e);super(t,r,i),this.inputsCode=s,this.blockCode=a,this.outputType=o}getCode(e=this.name){const t=this.outputType!=="void"?"-> "+this.outputType:"";return`fn ${e} ( ${this.inputsCode.trim()} ) ${t}`+this.blockCode}}class zKe extends Sme{parseFunction(e){return new VKe(e)}}const GKe={[Fl.READ_ONLY]:"read",[Fl.WRITE_ONLY]:"write",[Fl.READ_WRITE]:"read_write"},cee={[Jv]:"repeat",[Uu]:"clamp",[ey]:"mirror"},XL={vertex:T0.VERTEX,fragment:T0.FRAGMENT,compute:T0.COMPUTE},uee={instance:!0,swizzleAssign:!1,storageBuffer:!0},qKe={"^^":"tsl_xor"},$Ke={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3<f32>",vec2:"vec2<f32>",ivec2:"vec2<i32>",uvec2:"vec2<u32>",bvec2:"vec2<bool>",vec3:"vec3<f32>",ivec3:"vec3<i32>",uvec3:"vec3<u32>",bvec3:"vec3<bool>",vec4:"vec4<f32>",ivec4:"vec4<i32>",uvec4:"vec4<u32>",bvec4:"vec4<bool>",mat2:"mat2x2<f32>",mat3:"mat3x3<f32>",mat4:"mat4x4<f32>"},dee={},Y3={tsl_xor:new ra("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new ra("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new ra("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new ra("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new ra("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new ra("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new ra("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new ra("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new ra("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new ra("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new ra("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new ra("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),inverse_mat2:new ra(` 4600fn tsl_inverse_mat2( m : mat2x2<f32> ) -> mat2x2<f32> { 4601 4602 let det = m[ 0 ][ 0 ] * m[ 1 ][ 1 ] - m[ 0 ][ 1 ] * m[ 1 ][ 0 ]; 4603 4604 return mat2x2<f32>( 4605 m[ 1 ][ 1 ], - m[ 0 ][ 1 ], 4606 - m[ 1 ][ 0 ], m[ 0 ][ 0 ] 4607 ) * ( 1.0 / det ); 4608 4609} 4610`),inverse_mat3:new ra(` 4611fn tsl_inverse_mat3( m : mat3x3<f32> ) -> mat3x3<f32> { 4612 4613 let a00 = m[ 0 ][ 0 ]; let a01 = m[ 0 ][ 1 ]; let a02 = m[ 0 ][ 2 ]; 4614 let a10 = m[ 1 ][ 0 ]; let a11 = m[ 1 ][ 1 ]; let a12 = m[ 1 ][ 2 ]; 4615 let a20 = m[ 2 ][ 0 ]; let a21 = m[ 2 ][ 1 ]; let a22 = m[ 2 ][ 2 ]; 4616 4617 let b01 = a22 * a11 - a12 * a21; 4618 let b11 = - a22 * a10 + a12 * a20; 4619 let b21 = a21 * a10 - a11 * a20; 4620 4621 let det = a00 * b01 + a01 * b11 + a02 * b21; 4622 4623 return mat3x3<f32>( 4624 b01, ( - a22 * a01 + a02 * a21 ), ( a12 * a01 - a02 * a11 ), 4625 b11, ( a22 * a00 - a02 * a20 ), ( - a12 * a00 + a02 * a10 ), 4626 b21, ( - a21 * a00 + a01 * a20 ), ( a11 * a00 - a01 * a10 ) 4627 ) * ( 1.0 / det ); 4628 4629} 4630`),inverse_mat4:new ra(` 4631fn tsl_inverse_mat4( m : mat4x4<f32> ) -> mat4x4<f32> { 4632 4633 let a00 = m[ 0 ][ 0 ]; let a01 = m[ 0 ][ 1 ]; let a02 = m[ 0 ][ 2 ]; let a03 = m[ 0 ][ 3 ]; 4634 let a10 = m[ 1 ][ 0 ]; let a11 = m[ 1 ][ 1 ]; let a12 = m[ 1 ][ 2 ]; let a13 = m[ 1 ][ 3 ]; 4635 let a20 = m[ 2 ][ 0 ]; let a21 = m[ 2 ][ 1 ]; let a22 = m[ 2 ][ 2 ]; let a23 = m[ 2 ][ 3 ]; 4636 let a30 = m[ 3 ][ 0 ]; let a31 = m[ 3 ][ 1 ]; let a32 = m[ 3 ][ 2 ]; let a33 = m[ 3 ][ 3 ]; 4637 4638 let b00 = a00 * a11 - a01 * a10; 4639 let b01 = a00 * a12 - a02 * a10; 4640 let b02 = a00 * a13 - a03 * a10; 4641 let b03 = a01 * a12 - a02 * a11; 4642 let b04 = a01 * a13 - a03 * a11; 4643 let b05 = a02 * a13 - a03 * a12; 4644 let b06 = a20 * a31 - a21 * a30; 4645 let b07 = a20 * a32 - a22 * a30; 4646 let b08 = a20 * a33 - a23 * a30; 4647 let b09 = a21 * a32 - a22 * a31; 4648 let b10 = a21 * a33 - a23 * a31; 4649 let b11 = a22 * a33 - a23 * a32; 4650 4651 let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; 4652 4653 return mat4x4<f32>( 4654 a11 * b11 - a12 * b10 + a13 * b09, 4655 a02 * b10 - a01 * b11 - a03 * b09, 4656 a31 * b05 - a32 * b04 + a33 * b03, 4657 a22 * b04 - a21 * b05 - a23 * b03, 4658 a12 * b08 - a10 * b11 - a13 * b07, 4659 a00 * b11 - a02 * b08 + a03 * b07, 4660 a32 * b02 - a30 * b05 - a33 * b01, 4661 a20 * b05 - a22 * b02 + a23 * b01, 4662 a10 * b10 - a11 * b08 + a13 * b06, 4663 a01 * b08 - a00 * b10 - a03 * b06, 4664 a30 * b04 - a31 * b02 + a33 * b00, 4665 a21 * b02 - a20 * b04 - a23 * b00, 4666 a11 * b07 - a10 * b09 - a12 * b06, 4667 a00 * b09 - a01 * b07 + a02 * b06, 4668 a31 * b01 - a30 * b03 - a32 * b00, 4669 a20 * b03 - a21 * b01 + a22 * b00 4670 ) * ( 1.0 / det ); 4671 4672} 4673`),biquadraticTexture:new ra(` 4674fn tsl_biquadraticTexture( map : texture_2d<f32>, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f { 4675 4676 let res = vec2f( iRes ); 4677 4678 let uvScaled = coord * res; 4679 let uvWrapping = ( ( uvScaled % res ) + res ) % res; 4680 4681 // https://www.shadertoy.com/view/WtyXRy 4682 4683 let uv = uvWrapping - 0.5; 4684 let iuv = floor( uv ); 4685 let f = fract( uv ); 4686 4687 let rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level ); 4688 let rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level ); 4689 let rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level ); 4690 let rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level ); 4691 4692 return mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y ); 4693 4694} 4695`),biquadraticTextureArray:new ra(` 4696fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRes : vec2u, layer : u32, level : u32 ) -> vec4f { 4697 4698 let res = vec2f( iRes ); 4699 4700 let uvScaled = coord * res; 4701 let uvWrapping = ( ( uvScaled % res ) + res ) % res; 4702 4703 // https://www.shadertoy.com/view/WtyXRy 4704 4705 let uv = uvWrapping - 0.5; 4706 let iuv = floor( uv ); 4707 let f = fract( uv ); 4708 4709 let rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, layer, level ); 4710 let rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, layer, level ); 4711 let rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, layer, level ); 4712 let rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, layer, level ); 4713 4714 return mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y ); 4715 4716} 4717`)},HKe={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inverse_mat2:"tsl_inverse_mat2",inverse_mat3:"tsl_inverse_mat3",inverse_mat4:"tsl_inverse_mat4",inversesqrt:"inverseSqrt",bitcast:"bitcast<f32>",floatpack_snorm_2x16:"pack2x16snorm",floatpack_unorm_2x16:"pack2x16unorm",floatpack_float16_2x16:"pack2x16float",floatunpack_snorm_2x16:"unpack2x16snorm",floatunpack_unorm_2x16:"unpack2x16unorm",floatunpack_float16_2x16:"unpack2x16float"};let Vme="";(typeof navigator<"u"&&/Firefox|Deno/g.test(navigator.userAgent))!==!0&&(Vme+=`diagnostic( off, derivative_uniformity ); 4718`);class WKe extends _me{constructor(e,t){super(e,t,new zKe),this.uniformGroups={},this.uniformGroupsBindings={},this.builtins={},this.directives={},this.scopedArrays=new Map,this.allowEarlyReturns=!0,this.allowGlobalVariables=!0}_generateTextureSample(e,t,r,i,s,a=this.shaderStage){return a==="fragment"?i?s?`textureSample( ${t}, ${t}_sampler, ${r}, ${i}, ${s} )`:`textureSample( ${t}, ${t}_sampler, ${r}, ${i} )`:s?`textureSample( ${t}, ${t}_sampler, ${r}, ${s} )`:`textureSample( ${t}, ${t}_sampler, ${r} )`:this.generateTextureSampleLevel(e,t,r,"0",i)}generateTextureSampleLevel(e,t,r,i,s,a){return this.isUnfilterable(e)===!1?s?a?`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${s}, ${i}, ${a} )`:`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${s}, ${i} )`:a?`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${i}, ${a} )`:`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${i} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,r,a,i,s):this.generateTextureLod(e,t,r,s,a,i)}generateWrapFunction(e){const t=`tsl_coord_${cee[e.wrapS]}S_${cee[e.wrapT]}T_${e.is3DTexture||e.isData3DTexture?"3d":"2d"}`;let r=dee[t];if(r===void 0){const i=[],s=e.is3DTexture||e.isData3DTexture?"vec3f":"vec2f";let a=`fn ${t}( coord : ${s} ) -> ${s} { 4719 4720 return ${s}( 4721`;const o=(l,u)=>{l===Jv?(i.push(Y3.repeatWrapping_float),a+=` tsl_repeatWrapping_float( coord.${u}
4721 )`):l===Uu?(i.push(Y3.clampWrapping_float),a+=` tsl_clampWrapping_float( coord.${u} )`):l===ey?(i.push(Y3.mirrorWrapping_float),a+=` tsl_mirrorWrapping_float( coord.${u} )`):(a+=` coord.${u}`,an(`WebGPURenderer: Unsupported texture wrap type "${l}" for vertex shader.`))};o(e.wrapS,"x"),a+=`, 4722`,o(e.wrapT,"y"),(e.is3DTexture||e.isData3DTexture)&&(a+=`, 4723`,o(e.wrapR,"z")),a+=` 4724 ); 4725 4726} 4727`,dee[t]=r=new ra(a,i)}return r.build(this),t}generateArrayDeclaration(e,t){return`array< ${this.getType(e)}, ${t} >`}generateTextureDimension(e,t,r){const i=this.getDataFromNode(e,this.shaderStage,this.cache);i.dimensionsSnippet===void 0&&(i.dimensionsSnippet={});let s=i.dimensionsSnippet[r];if(i.dimensionsSnippet[r]===void 0){let a,o;const{primarySamples:l}=this.renderer.backend.utils.getTextureSampleData(e),u=l>1;e.is3DTexture||e.isData3DTexture?o="vec3<u32>":o="vec2<u32>",u||e.isStorageTexture?a=t:a=`${t}${r?`, u32( ${r} )`:""}`,s=new T6(new E6(`textureDimensions( ${a} )`,o)),i.dimensionsSnippet[r]=s,(e.isArrayTexture||e.isDataArrayTexture||e.is3DTexture||e.isData3DTexture)&&(i.arrayLayerCount=new T6(new E6(`textureNumLayers(${t})`,"u32"))),e.isTextureCube&&(i.cubeFaceCount=new T6(new E6("6u","u32")))}return s.build(this)}generateFilteredTexture(e,t,r,i,s="0u",a){const o=this.generateWrapFunction(e),l=this.generateTextureDimension(e,t,s);return i&&(r=`${r} + vec2<f32>(${i}) / ${l}`),a?(this._include("biquadraticTextureArray"),`tsl_biquadraticTexture_array( ${t}, ${o}( ${r} ), ${l}, u32( ${a} ), u32( ${s} ) )`):(this._include("biquadraticTexture"),`tsl_biquadraticTexture( ${t}, ${o}( ${r} ), ${l}, u32( ${s} ) )`)}generateTextureLod(e,t,r,i,s,a="0u"){if(e.isCubeTexture===!0){s&&(r=`${r} + vec3<f32>(${s})`);const p=e.isDepthTexture?"u32":"f32";return`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${p}( ${a} ) )`}const o=this.generateWrapFunction(e),l=this.generateTextureDimension(e,t,a),u=e.is3DTexture||e.isData3DTexture?"vec3":"vec2",d=u==="vec3"?"vec3<u32>( 1, 1, 1 )":"vec2<u32>( 1, 1 )";s&&(r=`${r} + ${u}<f32>(${s}) / ${u}<f32>( ${l} )`);const h=`${u}<f32>( 0 )`,f=`${u}<f32>( ${l} - ${d} )`;return r=`${u}<u32>( clamp( floor( ${o}( ${r} ) * ${u}<f32>( ${l} ) ), ${h}, ${f} ) )`,this.generateTextureLoad(e,t,r,a,i,null)}generateStorageTextureLoad(e,t,r,i,s,a){a&&(r=`${r} + ${a}`);let o;return s?o=`textureLoad( ${t}, ${r}, ${s} )`:o=`textureLoad( ${t}, ${r} )`,o}generateTextureLoad(e,t,r,i,s,a){i===null&&(i="0u"),a&&(r=`${r} + ${a}`);let o;return s?o=`textureLoad( ${t}, ${r}, ${s}, u32( ${i} ) )`:(o=`textureLoad( ${t}, ${r}, u32( ${i} ) )`,this.renderer.backend.compatibilityMode&&e.isDepthTexture&&(o+=".x")),o}generateTextureStore(e,t,r,i,s){let a;return i?a=`textureStore( ${t}, ${r}, ${i}, ${s} )`:a=`textureStore( ${t}, ${r}, ${s} )`,a}isSampleCompare(e){return e.isDepthTexture===!0&&e.compareFunction!==null&&this.renderer.hasCompatibility(_y.TEXTURE_COMPARE)}isUnfilterable(e){return this.getComponentTypeFromTexture(e)!=="float"||!this.isAvailable("float32Filterable")&&e.type===ia||this.isSampleCompare(e)===!1&&e.minFilter===cs&&e.magFilter===cs||this.renderer.backend.utils.getTextureSampleData(e).primarySamples>1}generateTexture(e,t,r,i,s,a=this.shaderStage){let o=null;return this.isUnfilterable(e)?o=this.generateTextureLod(e,t,r,i,s,"0",a):o=this._generateTextureSample(e,t,r,i,s,a),o}generateTextureGrad(e,t,r,i,s,a,o=this.shaderStage){if(o==="fragment")return s?a?`textureSampleGrad( ${t}, ${t}_sampler, ${r}, ${s}, ${i[0]}, ${i[1]}, ${a} )`:`textureSampleGrad( ${t}, ${t}_sampler, ${r}, ${s}, ${i[0]}, ${i[1]} )`:a?`textureSampleGrad( ${t}, ${t}_sampler, ${r}, ${i[0]}, ${i[1]}, ${a} )`:`textureSampleGrad( ${t}, ${t}_sampler, ${r}, ${i[0]}, ${i[1]} )`;sn(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${o} shader.`)}generateTextureCompare(e,t,r,i,s,a,o=this.shaderStage){if(o==="fragment")return e.isDepthTexture===!0&&e.isArrayTexture===!0?a?`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${s}, ${i}, ${a} )`:`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${s}, ${i} )`:a?`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${i}, ${a} )`:`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${i} )`;sn(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${o} shader.`)}generateTextureGather(e,t,r,i,s,a){const o=e.isDepthTexture===!0?"":`${i}, `;return s?a?`textureGather( ${o}${t}, ${t}_sampler, ${r}, ${s}, ${a} )`:`textureGather( ${o}${t}, ${t}_sampler, ${r}, ${s} )`:a?`textureGather( ${o}${t}, ${t}_sampler, ${r}, ${a} )`:`textureGather( ${o}${t}, ${t}_sampler, ${r})`}generateTextureGatherCompare(e,t,r,i,s,a){return s?a?`textureGatherCompare( ${t}, ${t}_sampler, ${r}, ${s}, ${i}, ${a} )`:`textureGatherCompare( ${t}, ${t}_sampler, ${r}, ${s}, ${i})`:a?`textureGatherCompare( ${t}, ${t}_sampler, ${r}, ${i}, ${a} )`:`textureGatherCompare( ${t}, ${t}_sampler, ${r}, ${i})`}generateTextureLevel(e,t,r,i,s,a){return this.isUnfilterable(e)===!1?s?a?`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${s}, ${i}, ${a} )`:`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${s}, ${i} )`:a?`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${i}, ${a} )`:`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${i} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,r,a,i,s):this.generateTextureLod(e,t,r,s,a,i)}generateTextureBias(e,t,r,i,s,a,o=this.shaderStage){if(o==="fragment")return s?a?`textureSampleBias( ${t}, ${t}_sampler, ${r}, ${s}, ${i}, ${a} )`:`textureSampleBias( ${t}, ${t}_sampler, ${r}, ${s}, ${i} )`:a?`textureSampleBias( ${t}, ${t}_sampler, ${r}, ${i}, ${a} )`:`textureSampleBias( ${t}, ${t}_sampler, ${r}, ${i} )`;sn(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${o} shader.`)}getPropertyName(e,t=this.shaderStage){if(e.isNodeVarying===!0&&e.needsInterpolation===!0){if(t==="vertex")return`varyings.${e.name}`}else if(e.isNodeUniform===!0){const r=e.name,i=e.type;return i==="texture"||i==="cubeTexture"||i==="cubeDepthTexture"||i==="storageTexture"||i==="texture3D"?r:i==="buffer"||i==="storageBuffer"||i==="indirectStorageBuffer"?this.isCu
4727stomStruct(e)?r:r+".value":e.groupNode.name+"."+r}return super.getPropertyName(e)}getOutputStructName(){return"output"}getFunctionOperator(e){const t=qKe[e];return t!==void 0?(this._include(t),t):null}getNodeAccess(e,t){return t!=="compute"?e.isAtomic===!0?(an("WebGPURenderer: Atomic operations are only supported in compute shaders."),Fl.READ_WRITE):Fl.READ_ONLY:e.access}getStorageAccess(e,t){return GKe[this.getNodeAccess(e,t)]}getUniformFromNode(e,t,r,i=null){const s=super.getUniformFromNode(e,t,r,i),a=this.getDataFromNode(e,r,this.globalCache);if(a.uniformGPU===void 0){let o;const l=e.groupNode,u=l.name,d=this.getBindGroupArray(u,r);if(t==="texture"||t==="cubeTexture"||t==="cubeDepthTexture"||t==="storageTexture"||t==="texture3D"){let h=null;const f=this.getNodeAccess(e,r);if(t==="texture"||t==="storageTexture"?e.value.is3DTexture===!0?h=new aU(s.name,s.node,l,f):h=new IR(s.name,s.node,l,f):t==="cubeTexture"||t==="cubeDepthTexture"?h=new Lme(s.name,s.node,l,f):t==="texture3D"&&(h=new aU(s.name,s.node,l,f)),h.store=e.isStorageTextureNode===!0,h.mipLevel=h.store?e.mipLevel:0,h.setVisibility(XL[r]),e.value.isCubeTexture===!0||this.isUnfilterable(e.value)===!1&&h.store===!1||e.gatherNode!==null){const g=new wKe(`${s.name}_sampler`,s.node,l);g.setVisibility(XL[r]),d.push(g,h),o=[g,h]}else d.push(h),o=[h]}else if(t==="buffer"||t==="storageBuffer"||t==="indirectStorageBuffer"){const h=this.getSharedDataFromNode(e);let f=h.buffer;if(f===void 0){const p=t==="buffer"?kme:TKe;f=new p(e,l),h.buffer=f}f.setVisibility(f.getVisibility()|XL[r]),d.push(f),o=f,s.name=i||"NodeBuffer_"+s.id}else{let h=this.uniformGroups[u];h===void 0&&(h=new Rme(u,l),h.setVisibility(T0.VERTEX|T0.FRAGMENT|T0.COMPUTE),this.uniformGroups[u]=h),d.indexOf(h)===-1&&d.push(h),o=this.getNodeUniform(s,t);const f=o.name;h.uniforms.some(g=>g.name===f)||h.addUniform(o)}a.uniformGPU=o}return s}getBuiltin(e,t,r,i=this.shaderStage){const s=this.builtins[i]||(this.builtins[i]=new Map);return s.has(e)===!1&&s.set(e,{name:e,property:t,type:r}),t}hasBuiltin(e,t=this.shaderStage){return this.builtins[t]!==void 0&&this.builtins[t].has(e)}getVertexIndex(){return this.shaderStage==="vertex"?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(e){const t=e.layout,r=this.flowShaderNode(e),i=[];for(const a of t.inputs)i.push(a.name+" : "+this.getType(a.type));let s=`fn ${t.name}( ${i.join(", ")} ) -> ${this.getType(t.type)} { 4728${r.vars} 4729${r.code} 4730`;return r.result&&(s+=` return ${r.result}; 4731`),s+=` 4732} 4733`,s}getInstanceIndex(){return this.shaderStage==="vertex"?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4<f32>")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}getClipDistance(){return"varyings.hw_clip_distances"}isFlipY(){return!1}enableDirective(e,t=this.shaderStage){(this.directives[t]||(this.directives[t]=new Set)).add(e)}getDirectives(e){const t=[],r=this.directives[e];if(r!==void 0)for(const i of r)t.push(`enable ${i};`);return t.join(` 4734`)}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}enableHardwareClipping(e){this.enableClipDistances(),this.getBuiltin("clip_distances","hw_clip_distances",`array<f32, ${e} >`,"vertex")}getBuiltins(e){const t=[],r=this.builtins[e];if(r!==void 0)for(const{name:i,property:s,type:a}of r.values())t.push(`@builtin( ${i} ) ${s} : ${a}`);return t.join(`, 4735 `)}getScopedArray(e,t,r,i){return this.scopedArrays.has(e)===!1&&this.scopedArrays.set(e,{name:e,scope:t,bufferType:r,bufferCount:i}),e}getScopedArrays(e){if(e!=="compute")return;const t=[];for(const{name:r,scope:i,bufferType:s,bufferCount:a}of this.scopedArrays.values()){const o=this.getType(s);t.push(`var<${i}> ${r}: array< ${o}, ${a} >;`)}return t.join(` 4736`)}getAttributes(e){const t=[];if(e==="compute"&&(this.getBuiltin("global_invocation_id","globalId","vec3<u32>","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3<u32>","attribute"),this.getBuiltin("local_invocation_id","localId","vec3<u32>","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3<u32>","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",e),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),e==="vertex"||e==="compute"){const r=this.getBuiltins("attribute");r&&t.push(r);const i=this.getAttributesArray();for(let s=0,a=i.length;s<a;s++){const o=i[s],l=o.name,u=this.getType(o.type);t.push(`@location( ${s} ) ${l} : ${u}`)}}return t.join(`, 4737 `)}getStructMembers(e){const t=[];for(const r of e.members){const i=e.output?"@location( "+r.index+" ) ":"";let s=this.getType(r.type);r.atomic&&(s="atomic< "+s+" >"),t.push(` ${i+r.name} : ${s}`)}return e.output&&t.push(` ${this.getBuiltins("output")}`),t.join(`, 4738`)}getStructs(e){let t="";const r=this.structs[e];if(r.length>0){const i=[];
4738for(const s of r){let a=`struct ${s.name} { 4739`;a+=this.getStructMembers(s),a+=` 4740};`,i.push(a)}t=` 4741`+i.join(` 4742 4743`)+` 4744`}return t}getVar(e,t,r=null,i=""){let s=`var${i} ${t} : `;return r!==null?s+=this.generateArrayDeclaration(e,r):s+=this.getType(e),s}getVars(e,t=!1){let r="";t&&(r="<private>");const i=[],s=this.vars[e];if(s!==void 0)for(const a of s)i.push(`${this.getVar(a.type,a.name,a.count,r)};`);return t?i.join(` 4745`):` 4746 ${i.join(` 4747 `)} 4748`}getVaryings(e){const t=[];if(e==="vertex"&&this.getBuiltin("position","builtinClipSpace","vec4<f32>","vertex"),e==="vertex"||e==="fragment"){const s=this.varyings,a=this.vars[e];let o=0;for(let l=0;l<s.length;l++){const u=s[l];if(u.needsInterpolation){let d=`@location( ${o++} )`;if(u.interpolationType){const h=u.interpolationSampling!==null?`, ${u.interpolationSampling} )`:" )";d+=` @interpolate( ${u.interpolationType}${h}`}else/^(int|uint|ivec|uvec)/.test(u.type)&&(d+=" @interpolate(flat, either)");t.push(`${d} ${u.name} : ${this.getType(u.type)}`)}else e==="vertex"&&a.includes(u)===!1&&a.push(u)}}const r=this.getBuiltins(e);r&&t.push(r);const i=t.join(`, 4749 `);return e==="vertex"?this._getWGSLStruct("VaryingsStruct"," "+i):i}isCustomStruct(e){const t=e.value,r=e.node,i=(t.isBufferAttribute||t.isInstancedBufferAttribute)&&r.structTypeNode!==null,s=r.value&&r.value.array&&typeof r.value.itemSize=="number"&&r.value.array.length>r.value.itemSize;return i&&!s}getUniforms(e){const t=this.renderer.backend,r=this.uniforms[e],i=[],s=[],a=[],o={};for(const u of r){const d=u.groupNode.name,h=this.bindingsIndexes[d];if(u.type==="texture"||u.type==="cubeTexture"||u.type==="cubeDepthTexture"||u.type==="storageTexture"||u.type==="texture3D"){const f=u.node,p=f.value;(p.isCubeTexture===!0||this.isUnfilterable(p)===!1&&f.isStorageTextureNode!==!0||f.gatherNode!==null)&&(this.isSampleCompare(p)&&f.compareNode!==null?i.push(`@binding( ${h.binding++} ) @group( ${h.group} ) var ${u.name}_sampler : sampler_comparison;`):i.push(`@binding( ${h.binding++} ) @group( ${h.group} ) var ${u.name}_sampler : sampler;`));let A,x="";const{primarySamples:b}=t.utils.getTextureSampleData(p);if(b>1&&(x="_multisampled"),p.isCubeTexture===!0&&p.isDepthTexture===!0)A="texture_depth_cube";else if(p.isCubeTexture===!0)A="texture_cube<f32>";else if(p.isDepthTexture===!0)t.compatibilityMode&&p.compareFunction===null?A=`texture${x}_2d<f32>`:A=`texture_depth${x}_2d${p.isArrayTexture===!0?"_array":""}`;else if(u.node.isStorageTextureNode===!0){const _=oU(p,t.device),M=this.getStorageAccess(u.node,e),T=u.node.value.is3DTexture,L=u.node.value.isArrayTexture;A=`texture_storage_${T?"3d":`2d${L?"_array":""}`}<${_}, ${M}>`}else if(p.isArrayTexture===!0||p.isDataArrayTexture===!0||p.isCompressedArrayTexture===!0)A="texture_2d_array<f32>";else if(p.is3DTexture===!0||p.isData3DTexture===!0)A="texture_3d<f32>";else{const _=this.getComponentTypeFromTexture(p).charAt(0);A=`texture${x}_2d<${_}32>`}i.push(`@binding( ${h.binding++} ) @group( ${h.group} ) var ${u.name} : ${A};`)}else if(u.type==="buffer"||u.type==="storageBuffer"||u.type==="indirectStorageBuffer"){const f=u.node,p=this.getType(f.getNodeType(this)),g=f.bufferCount,A=g>0&&u.type==="buffer"?", "+g:"",x=f.isStorageBufferNode?`storage, ${this.getStorageAccess(f,e)}`:"uniform";if(this.isCustomStruct(u))s.push(`@binding( ${h.binding++} ) @group( ${h.group} ) var<${x}> ${u.name} : ${p};`);else{const _=` value : array< ${f.isAtomic?`atomic<${p}>`:`${p}`}${A} >`;s.push(this._getWGSLStructBinding(u.name,_,x,h.binding++,h.group))}}else{const f=u.groupNode.name;if(o[f]===void 0){const p=this.uniformGroups[f];if(p!==void 0){const g=[];for(const x of p.uniforms){const b=x.getType(),_=this.getType(this.getVectorType(b));g.push(` ${x.name} : ${_}`)}let A=this.uniformGroupsBindings[f];A===void 0&&(A={index:h.binding++,id:h.group},this.uniformGroupsBindings[f]=A),o[f]={index:A.index,id:A.id,snippets:g}}}}}for(const u in o){const d=o[u];a.push(this._getWGSLStructBinding(u,d.snippets.join(`, 4750`),"uniform",d.index,d.id))}return[...i,...s,...a].join(` 4751`)}buildCode(){const e=this.material!==null?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){this.shaderStage=t;const r=this.allowGlobalVariables,i=e[t];i.uniforms=this.getUniforms(t),i.attributes=this.getAttributes(t),i.varyings=this.getVaryings(t),i.structs=this.getStructs(t),i.vars=this.getVars(t,r),i.c
4751odes=this.getCodes(t),i.directives=this.getDirectives(t),i.scopedArrays=this.getScopedArrays(t);let s=`// code 4752 4753`;s+=this.flowCode[t];const a=this.flowNodes[t],o=a[a.length-1],l=o.outputNode,u=l!==void 0&&l.isOutputStructNode===!0;for(const d of a){const h=this.getFlowData(d),f=d.name;if(f&&(s.length>0&&(s+=` 4754`),s+=` // flow -> ${f} 4755`),s+=`${h.code} 4756 `,d===o&&t!=="compute"){if(s+=`// result 4757 4758 `,t==="vertex")s+=`varyings.builtinClipSpace = ${h.result};`;else if(t==="fragment")if(u)i.returnType=l.getNodeType(this),i.structs+="var<private> output : "+i.returnType+";",s+=`return ${h.result};`;else{let p=` @location( 0 ) color: ${this.getType(this.getOutputType())}`;const g=this.getBuiltins("output");g&&(p+=`, 4759 `+g),i.returnType="OutputStruct",i.structs+=this._getWGSLStruct("OutputStruct",p),i.structs+=` 4760var<private> output : OutputStruct;`,s+=`output.color = ${this.format(h.result,o.getNodeType(this),this.getOutputType())}; 4761 4762 return output;`}}}i.flow=s}if(this.shaderStage=null,this.material!==null)this.vertexShader=this._getWGSLVertexCode(e.vertex),this.fragmentShader=this._getWGSLFragmentCode(e.fragment);else{const t=this.object.workgroupSize;this.computeShader=this._getWGSLComputeCode(e.compute,t)}}getMethod(e,t=null){let r;return t!==null&&(r=this._getWGSLMethod(e+"_"+t)),r===void 0&&(r=this._getWGSLMethod(e)),r||e}getBitcastMethod(e){return`bitcast<${this.getType(e)}>`}getFloatPackingMethod(e){return this.getMethod(`floatpack_${e}_2x16`)}getFloatUnpackingMethod(e){return this.getMethod(`floatunpack_${e}_2x16`)}getTernary(e,t,r){return`select( ${r}, ${t}, ${e} )`}getType(e){return $Ke[e]||e}isAvailable(e){let t=uee[e];return t===void 0&&(e==="float32Filterable"?t=this.renderer.hasFeature("float32-filterable"):e==="clipDistance"&&(t=this.renderer.hasFeature("clip-distances")),uee[e]=t),t}_getWGSLMethod(e){return Y3[e]!==void 0&&this._include(e),HKe[e]}_include(e){const t=Y3[e];return t.build(this),this.addInclude(t),t}
4762_getWGSLVertexCode(e){return`${this.getSignature()} 4763// directives 4764${e.directives} 4765 4766// structs 4767${e.structs} 4768 4769// uniforms 4770${e.uniforms} 4771 4772// varyings 4773${e.varyings} 4774var<private> varyings : VaryingsStruct; 4775 4776// vars 4777${e.vars} 4778 4779// codes 4780${e.codes} 4781 4782@vertex 4783fn main( ${e.attributes} ) -> VaryingsStruct { 4784 4785 // flow 4786 ${e.flow} 4787 4788 return varyings; 4789 4790} 4791`}_getWGSLFragmentCode(e){return`${this.getSignature()} 4792// global 4793${Vme} 4794 4795// structs 4796${e.structs} 4797 4798// uniforms 4799${e.uniforms} 4800 4801// vars 4802${e.vars} 4803 4804// codes 4805${e.codes} 4806 4807@fragment 4808fn main( ${e.varyings} ) -> ${e.returnType} { 4809 4810 // flow 4811 ${e.flow} 4812 4813} 4814`}_getWGSLComputeCode(e,t){const[r,i,s]=t;return`${this.getSignature()} 4815// directives 4816${e.directives} 4817 4818// system 4819var<private> instanceIndex : u32; 4820 4821// locals 4822${e.scopedArrays} 4823 4824// structs 4825${e.structs} 4826 4827// uniforms 4828${e.uniforms} 4829 4830// vars 4831${this.allowGlobalVariables?e.vars:""} 4832 4833// codes 4834${e.codes} 4835 4836@compute @workgroup_size( ${r}, ${i}, ${s} ) 4837fn main( ${e.attributes} ) { 4838 4839 // local vars 4840 ${this.allowGlobalVariables?"":e.vars} 4841 4842 // system 4843 instanceIndex = globalId.x 4844 + globalId.y * ( ${r} * numWorkgroups.x ) 4845 + globalId.z * ( ${r} * numWorkgroups.x ) * ( ${i} * numWorkgroups.y ); 4846 4847 // flow 4848 ${e.flow} 4849 4850} 4851`}_getWGSLStruct(e,t){return` 4852struct ${e} { 4853${t} 4854};`}_getWGSLStructBinding(e,t,r,i=0,s=0){const a=e+"Struct";return`${this._getWGSLStruct(a,t)} 4855@binding( ${i} ) @group( ${s} ) 4856var<${r}> ${e} : ${a};`}}const ac=new P_,YL=new UT,zme=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]);typeof Float16Array<"u"&&zme.set(Float16Array,["float16"]);const XKe=new Map([[Wce,["float16"]]]),YKe=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class QKe{constructor(e){this.backend=e}createAttribute(e,t){const r=this._getBufferAttribute(e),i=this.backend,s=i.get(r);let a=s.buffer;if(a===void 0){const o=i.device;let l=r.array;if(e.normalized===!1){if(l.constructor===Int16Array||l.constructor===Int8Array)l=new Int32Array(l);else if((l.constructor===Uint16Array||l.constructor===Uint8Array)&&(l=new Uint32Array(l),t&GPUBufferUsage.INDEX))for(let f=0;f<l.length;f++)l[f]===65535&&(l[f]=4294967295)}r.array=l;let u;if((r.isStorageBufferAttribute||r.isStorageInstancedBufferAttribute)&&r.itemSize===3)u=4;else if(r.itemSize>1&&r.itemSize*l.BYTES_PER_ELEMENT%4!==0){const f=r.itemSize*l.BYTES_PER_ELEMENT;u=Math.floor((f+3)/4)*4/l.BYTES_PER_ELEMENT}if(u!==void 0){const f=r.itemSize,p=new l.constructor(r.count*u);for(let g=0;g<r.count;g++)p.set(l.subarray(g*f,g*f+f),g*u);(r.isStorageBufferAttribute||r.isStorageInstancedBufferAttribute)&&(r.itemSize=u,r.array=p),l=p,s._itemSize=f,s._paddedItemSize=u}const d=l.byteLength,h=d+(4-d%4)%4;ac.label=r.name,ac.size=h,ac.usage=t,ac.mappedAtCreation=!0,a=o.createBuffer(ac),ac.reset(),new l.constructor(a.getMappedRange()).set(l),a.unmap(),s.buffer=a}}updateAttribute(e){const t=this._getBufferAttribute(e),r=this.backend,i=r.device,s=r.get(t),a=r.get(t).buffer;let o=t.array;const l=s._itemSize,u=s._paddedItemSize;if(u!==void 0){o=new o.constructor(t.count*u);for(let h=0;h<t.count;h++)o.set(t.array.subarray(h*l,h*l+l),h*u);(t.isStorageBufferAttribute||t.isStorageInstancedBufferAttribute)&&(t.array=o)}const d=t.updateRanges;if(d.length===0)i.queue.writeBuffer(a,0,o,0);else{const h=OM(o),f=h?1:o.BYTES_PER_ELEMENT;for(let p=0,g=d.length;p<g;p++){const A=d[p];let x,b;if(u!==void 0){const M=Math.floor(A.start/l),T=Math.ceil((A.start+A.count)/l)-M;x=M*u*f,b=T*u*f}else x=A.start*f,b=A.count*f;const _=x*(h?o.BYTES_PER_ELEMENT:1);i.queue.writeBuffer(a,_,o,x,b)}t.clearUpdateRanges()}}createShaderVertexBuffers(e){const t=e.getAttributes(),r=new Map;for(let i=0;i<t.length;i++){const s=t[i],a=s.array.BYTES_PER_ELEMENT,o=this._getBufferAttribute(s);let l=r.get(o);if(l===void 0){let h,f;s.isInterleavedBufferAttribute===!0?(h=s.data.stride*a,f=s.data.isInstancedInterleavedBuffer?uN.Instance:uN.Vertex):(h=s.itemSize*a,f=s.isInstancedBufferAttribute?uN.Instance:uN.Vertex,s.itemSize>1&&h%4!==0&&(h=Math.floor((h+3)/4)*4)),s.normalized===!1&&(s.array.constructor===Int16Array||s.array.
4856constructor===Uint16Array)&&(h=4),l={arrayStride:h,attributes:[],stepMode:f},r.set(o,l)}const u=this._getVertexFormat(s),d=s.isInterleavedBufferAttribute===!0?s.offset*a:0;l.attributes.push({shaderLocation:i,offset:d,format:u})}return Array.from(r.values())}destroyAttribute(e){const t=this.backend;t.get(this._getBufferAttribute(e)).buffer.destroy(),t.delete(e)}async getArrayBufferAsync(e,t=null,r=0,i=-1){const s=this.backend,a=s.device,l=s.get(this._getBufferAttribute(e)).buffer,u=i===-1?l.size-r:i;let d;if(t!==null&&t.isReadbackBuffer){const p=s.get(t);if(t._mapped===!0)throw new Error("THREE.WebGPUAttributeUtils: ReadbackBuffer must be released before being used again.");if(t._mapped=!0,p.readBufferGPU===void 0){ac.label=`${t.name}_readback`,ac.size=t.maxByteLength,ac.usage=GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,d=a.createBuffer(ac),ac.reset();const g=()=>{t.buffer=null,t._mapped=!1,d.unmap()},A=()=>{t.buffer=null,t._mapped=!1,d.destroy(),s.delete(t),t.removeEventListener("release",g),t.removeEventListener("dispose",A)};t.addEventListener("release",g),t.addEventListener("dispose",A),p.readBufferGPU=d}else d=p.readBufferGPU}else ac.label=`${e.name}_readback`,ac.size=u,ac.usage=GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,d=a.createBuffer(ac),ac.reset();YL.label=`readback_encoder_${e.name}`;const h=a.createCommandEncoder(YL);YL.reset(),h.copyBufferToBuffer(l,r,d,0,u);const f=h.finish();if(t0(a,f),await d.mapAsync(GPUMapMode.READ,0,u),t===null){const g=d.getMappedRange(0,u).slice();return d.destroy(),g}else{if(t.isReadbackBuffer)return t.buffer=d.getMappedRange(0,u),t;{const p=d.getMappedRange(0,u);return new Uint8Array(t).set(new Uint8Array(p)),d.destroy(),t}}}_getVertexFormat(e){const{itemSize:t,normalized:r}=e,i=e.array.constructor,s=e.constructor;let a;if(t===1)a=YKe.get(i);else{const l=(XKe.get(s)||zme.get(i))[r?1:0];if(l){const u=i.BYTES_PER_ELEMENT*t,h=Math.floor((u+3)/4)*4/i.BYTES_PER_ELEMENT;if(h%1)throw new Error("THREE.WebGPUAttributeUtils: Bad vertex format item size.");a=`${l}x${h}`}}return a||sn("WebGPUAttributeUtils: Vertex format not supported yet."),a}_getBufferAttribute(e){return e.isInterleavedBufferAttribute&&(e=e.data),e}}const _d=new jme,Q3=new P_,I2=new gq;class KKe{constructor(e){this.layoutGPU=e,this.usedTimes=0}}class ZKe{constructor(e){this.backend=e,this._bindGroupLayoutCache=new Map}createBindingsLayout(e){const t=this.backend,r=t.device,i=t.get(e);if(i.layout)return i.layout.layoutGPU;const s=this._createLayoutEntries(e),a=E_(JSON.stringify(s));let o=this._bindGroupLayoutCache.get(a);return o===void 0&&(o=new KKe(r.createBindGroupLayout({entries:s})),this._bindGroupLayoutCache.set(a,o)),o.usedTimes++,i.layout=o,i.layoutKey=a,o.layoutGPU}createBindings(e,t,r,i=0){const{backend:s}=this,a=s.get(e),o=this.createBindingsLayout(e);let l;r>0&&(a.groups===void 0&&(a.groups=[],a.versions=[]),a.versions[r]===i&&(l=a.groups[r])),l===void 0&&(l=this.createBindGroup(e,o),r>0&&(a.groups[r]=l,a.versions[r]=i)),a.group=l}updateBinding(e){const t=this.backend,r=t.device,i=e.buffer,s=t.get(e).buffer,a=e.updateRanges;if(a.length===0)r.queue.writeBuffer(s,0,i,0);else{const o=OM(i),l=o?1:i.BYTES_PER_ELEMENT;let u=a[0].start;for(let d=0,h=a.length;d<h;d++){const f=a[d],p=a[d+1],g=f.start+f.count;if(p!==void 0&&p.start===g)continue;const A=u*l,x=(g-u)*l,b=A*(o?i.BYTES_PER_ELEMENT:1);r.queue.writeBuffer(s,b,i,A,x),p!==void 0&&(u=p.start)}}}createBindGroupIndex(e,t){const i=this.backend.device,s=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,a=e[0];Q3.label="bindingCameraIndex_"+a,Q3.size=16,Q3.usage=s;const o=i.createBuffer(Q3);Q3.reset(),i.queue.writeBuffer(o,0,e,0),_d.label="bindGroupCameraIndex_"+a,_d.layout=t,_d.entries.push({binding:0,resource:{buffer:o}});const l=i.createBindGroup(_d);return _d.reset(),l}createBindGroup(e,t){const r=this.backend,i=r.device;let s=0;_d.label="bindGroup_"+e.name,_d.layout=t;for(const o of e.bindings){if(o.isUniformBuffer){const l=r.get(o);_d.entries.push({binding:s,resource:{buffer:l.buffer}})}else if(o.isStorageBuffer){const l=r.get(o.attribute).buffer;_d.entries.push({binding:s,resource:{buffer:l}})}else if(o.isSampledTexture){const l=r.get(o.texture);let u;if(l.externalTexture!==void 0)u=i.importExternalTexture({source:l.externalTexture});else{const d=o.store?1:l.texture.mipLevelCount,h=o.store?o.mipLevel:0;let f=`view-${l.texture.width}-${l.texture.height}`;if(l.texture.depthOrArrayLayers>1&&(f+=`-${l.texture.depthOrArrayLayers}`),f+=`-${d}-${h}`,u=l[f],u===void 0){const p=bKe.All;let g;o.isSampledCubeTexture?g=Rl.Cube:o.texture.isArrayTexture||o.texture.isDataArrayTexture||o.texture.isCompressedArrayTexture?g=Rl.TwoDArray:o.isSampledTexture3D?g=Rl.ThreeD:g=Rl.TwoD,I2.aspect=p,I2.dimension=g,I2.mipLevelCount=d,I2.baseMipLevel=h,u=l[f]=l.texture.createView(I2),I2.reset()}}_d.entries.push({binding:s,resource:u})}else if(o.isSampler){const l=r.get(o);_d.entries.push({binding:s,resource:l.sampler})}s++}const a=i.createBindGroup(_d);return _d.reset(),a}_createLayoutEntries(e){const t=[];let r=0;
4856for(const i of e.bindings){const s=this.backend,a={binding:r,visibility:i.visibility};if(i.isUniformBuffer||i.isStorageBuffer){const o={};i.isStorageBuffer&&(i.visibility&T0.COMPUTE&&(i.access===Fl.READ_WRITE||i.access===Fl.WRITE_ONLY)?o.type=GL.Storage:o.type=GL.ReadOnlyStorage),a.buffer=o}else if(i.isSampledTexture&&i.store){const o={};o.format=this.backend.get(i.texture).texture.format;const l=i.access;l===Fl.READ_WRITE?o.access=qL.ReadWrite:l===Fl.WRITE_ONLY?o.access=qL.WriteOnly:o.access=qL.ReadOnly,i.texture.isArrayTexture?o.viewDimension=Rl.TwoDArray:i.texture.is3DTexture&&(o.viewDimension=Rl.ThreeD),a.storageTexture=o}else if(i.isSampledTexture){const o={},{primarySamples:l}=s.utils.getTextureSampleData(i.texture);if(l>1&&(o.multisampled=!0,i.texture.isDepthTexture||(o.sampleType=Ix.UnfilterableFloat)),i.texture.isDepthTexture)s.compatibilityMode&&i.texture.compareFunction===null?o.sampleType=Ix.UnfilterableFloat:o.sampleType=Ix.Depth;else{const u=i.texture.type;u===oo?o.sampleType=Ix.SInt:u===ts?o.sampleType=Ix.UInt:u===ia&&(this.backend.hasFeature("float32-filterable")?o.sampleType=Ix.Float:o.sampleType=Ix.UnfilterableFloat)}i.isSampledCubeTexture?o.viewDimension=Rl.Cube:i.texture.isArrayTexture||i.texture.isDataArrayTexture||i.texture.isCompressedArrayTexture?o.viewDimension=Rl.TwoDArray:i.isSampledTexture3D&&(o.viewDimension=Rl.ThreeD),a.texture=o}else if(i.isSampler){const o={};i.texture.isDepthTexture&&(i.texture.compareFunction!==null&&i.textureNode.compareNode!==null&&s.hasCompatibility(_y.TEXTURE_COMPARE)?o.type=iee.Comparison:o.type=iee.NonFiltering),a.sampler=o}else sn(`WebGPUBindingUtils: Unsupported binding "${i}".`);t.push(a),r++}return t}deleteBindGroupData(e){const{backend:t}=this,r=t.get(e);r.layout&&(r.layout.usedTimes--,r.layout.usedTimes===0&&this._bindGroupLayoutCache.delete(r.layoutKey),r.layout=void 0,r.layoutKey=void 0)}dispose(){this._bindGroupLayoutCache.clear()}}class JKe{constructor(e){this.backend=e}getMaxAnisotropy(){return 16}getUniformBufferLimit(){return this.backend.device.limits.maxUniformBufferBindingSize}}class eZe{constructor(){this.label="",this.layout=null,this.compute=null}reset(){this.label="",this.layout=null,this.compute=null}}class tZe{constructor(){this.label="",this.bindGroupLayouts=null}reset(){this.label="",this.bindGroupLayouts=null}}const K3=new eZe,F2=new tZe,U2=new Ime,Sd=new Fme;class nZe{constructor(e){this.backend=e}_getSampleCount(e){return this.backend.utils.getSampleCountRenderContext(e)}createRenderPipeline(e,t){const{object:r,material:i,geometry:s,pipeline:a}=e,{vertexProgram:o,fragmentProgram:l}=a,u=this.backend,d=u.device,h=u.utils,f=u.get(a),p=[];for(const W of e.getBindings()){const J=u.get(W),{layoutGPU:ee}=J.layout;p.push(ee)}const g=u.attributeUtils.createShaderVertexBuffers(e);let A;i.blending!==qo&&(i.blending!==dl||i.transparent!==!1)&&(A=this._getBlending(i));let x={};i.stencilWrite===!0&&(x={compare:this._getStencilCompare(i),failOp:this._getStencilOperation(i.stencilFail),depthFailOp:this._getStencilOperation(i.stencilZFail),passOp:this._getStencilOperation(i.stencilZPass)});const b=this._getColorWriteMask(i),_=[];if(e.context.textures!==null){const W=e.context.textures,J=e.context.mrt;for(let ee=0;ee<W.length;ee++){const ae=W[ee],le=h.getTextureFormatGPU(ae);let Z;if(J!==null)if(this.backend.compatibilityMode!==!0){const Y=J.getBlendMode(ae.name);Y.blending===gV?Z=A:Y.blending!==qo&&(Z=this._getBlending(Y))}else _i("WebGPURenderer: Multiple Render Targets (MRT) blending configuration is not fully supported in compatibility mode. The material blending will be used for all render targets."),Z=A;else Z=A;_.push({format:le,blend:Z,writeMask:b})}}else{const W=h.getCurrentColorFormat(e.context);_.push({format:W,blend:A,writeMask:b})}const M=u.get(o).module,T=u.get(l).module,L=this._getPrimitiveState(r,s,i),D=this._getDepthCompare(i),P=h.getCurrentDepthStencilFormat(e.context),O=this._getSampleCount(e.context);F2.bindGroupLayouts=p;const F=d.createPipelineLayout(F2);F2.reset(),Sd.label=`renderPipeline_${i.name||i.type}_${i.id}`,Sd.vertex=Object.assign({},M,{buffers:g}),Sd.fragment=Object.assign({},T,{targets:_}),Sd.primitive=L,Sd.multisample.count=O,Sd.multisample.alphaToCoverageEnabled=i.alphaToCoverage&&O>1,Sd.layout=F;const U={},B=e.context.depth,z=e.context.stencil;(B===!0||z===!0)&&(B===!0&&(U.format=P,U.depthWriteEnabled=i.depthWrite,U.depthCompare=D),z===!0&&(U.stencilFront=x,U.stencilBack=x,U.stencilReadMask=i.stencilFuncMask,U.stencilWriteMask=i.stencilWriteMask),i.polygonOffset===!0&&L.topology===BS.TriangleList&&(U.depthBias=i.polygonOffsetUnits,U.depthBiasSlopeScale=i.polygonOffsetFactor,U.depthBiasClamp=0),Sd.depthStencil=U),d.pushErrorScope("validation");const H=[{program:o,module:M.module},{program:l,module:T.module}],X=Sd.label;if(t===null)f.pipeline=d.createRenderPipeline(Sd),Sd.reset(),d.popErrorScope().then(W=>{W!==null&&(f.error=!0,sn(`WebGPURenderer: Render pipeline creation failed (${X}): ${W.message}`),this._reportShaderDiagnostics(H,X))});else{const W=new Promise(async J=>{try{let ee=null,ae=null;try{ae=d.createRenderPipelineAsync(Sd)}catch(Z){ee=Z}if(Sd.reset(),ae!==null)try{f.pipeline=await ae}catch(Z){ee=Z}const le=await d.popErrorScope();if(le!==null||ee!==null){f.error=!0;const Z=le&&le.message||ee&&ee.message||"unknown";sn(`WebGPURenderer: Async render pipeline creation failed (${X}): ${Z}`),await this._reportShaderDiagnostics(H,X)}}finally{J()}});t.push(W)}}createBundleEncoder(e,t="renderBundleEncoder"){const r=this.backend,{utils:i,device:s}=r,a=i.getCurrentDepthStencilFormat(e),o=i.getCurrentColorFormats(e),l=this._getSampleC
4856ount(e);U2.label=t,U2.colorFormats=o,U2.depthStencilFormat=a,U2.sampleCount=l;const u=s.createRenderBundleEncoder(U2);return U2.reset(),u}createComputePipeline(e,t){const r=this.backend,i=r.device,s=r.get(e.computeProgram).module,a=r.get(e),o=[];for(const h of t){const f=r.get(h),{layoutGPU:p}=f.layout;o.push(p)}const l=e.computeProgram,u=`computePipeline_${l.stage}${l.name?`_${l.name}`:""}`;i.pushErrorScope("validation"),F2.bindGroupLayouts=o;const d=i.createPipelineLayout(F2);F2.reset(),K3.label=u,K3.compute=s,K3.layout=d,a.pipeline=i.createComputePipeline(K3),K3.reset(),i.popErrorScope().then(h=>{h!==null&&(a.error=!0,sn(`WebGPURenderer: Compute pipeline creation failed (${u}): ${h.message}`),this._reportShaderDiagnostics([{program:l,module:s.module}],u))})}async _reportShaderDiagnostics(e,t){for(const{program:r,module:i}of e){const s=await i.getCompilationInfo();if(s.messages.length===0)continue;const a=r.code.split(` 4857`);for(const o of s.messages){const l=o.lineNum>0?` at line ${o.lineNum}${o.linePos>0?`:${o.linePos}`:""}`:"",u=`WebGPURenderer [${t} / ${r.stage} ${o.type}]${l}: ${o.message}`;let d="";o.lineNum>0&&o.lineNum<=a.length&&(d=` 4858 ${a[o.lineNum-1]}`,o.linePos>0&&(d+=` 4859 ${" ".repeat(o.linePos-1)}^`)),(o.type==="error"?sn:an)(u+d)}}}_getBlending(e){let t,r;const i=e.blending,s=e.blendSrc,a=e.blendDst,o=e.blendEquation;if(i===Dv){const l=e.blendSrcAlpha!==null?e.blendSrcAlpha:s,u=e.blendDstAlpha!==null?e.blendDstAlpha:a,d=e.blendEquationAlpha!==null?e.blendEquationAlpha:o;t={srcFactor:this._getBlendFactor(s),dstFactor:this._getBlendFactor(a),operation:this._getBlendOperation(o)},r={srcFactor:this._getBlendFactor(l),dstFactor:this._getBlendFactor(u),operation:this._getBlendOperation(d)}}else{const l=e.premultipliedAlpha,u=(d,h,f,p)=>{t={srcFactor:d,dstFactor:h,operation:jx.Add},r={srcFactor:f,dstFactor:p,operation:jx.Add}};if(l)switch(i){case dl:u(Mi.One,Mi.OneMinusSrcAlpha,Mi.One,Mi.OneMinusSrcAlpha);break;case HA:u(Mi.One,Mi.One,Mi.One,Mi.One);break;case WA:u(Mi.Zero,Mi.OneMinusSrc,Mi.Zero,Mi.One);break;case XA:u(Mi.Dst,Mi.OneMinusSrcAlpha,Mi.Zero,Mi.One);break}else switch(i){case dl:u(Mi.SrcAlpha,Mi.OneMinusSrcAlpha,Mi.One,Mi.OneMinusSrcAlpha);break;case HA:u(Mi.SrcAlpha,Mi.One,Mi.One,Mi.One);break;case WA:sn(`WebGPURenderer: "SubtractiveBlending" requires "${e.isMaterial?"material":"blendMode"}.premultipliedAlpha = true".`);break;case XA:sn(`WebGPURenderer: "MultiplyBlending" requires "${e.isMaterial?"material":"blendMode"}.premultipliedAlpha = true".`);break}}if(t!==void 0&&r!==void 0)return{color:t,alpha:r};sn("WebGPURenderer: Invalid blending: ",i)}_getBlendFactor(e){let t;switch(e){case Mm:t=Mi.Zero;break;case vV:t=Mi.One;break;case yV:t=Mi.Src;break;case bV:t=Mi.OneMinusSrc;break;case dw:t=Mi.SrcAlpha;break;case hw:t=Mi.OneMinusSrcAlpha;break;case SV:t=Mi.Dst;break;case TV:t=Mi.OneMinusDst;break;case wV:t=Mi.DstAlpha;break;case _V:t=Mi.OneMinusDstAlpha;break;case EV:t=Mi.SrcAlphaSaturated;break;case Bqe:t=Mi.Constant;break;case Vqe:t=Mi.OneMinusConstant;break;default:sn("WebGPURenderer: Blend factor not supported.",e)}return t}_getStencilCompare(e){let t;const r=e.stencilFunc;switch(r){case _Me:t=El.Never;break;case UI:t=El.Always;break;case SMe:t=El.Less;break;case EMe:t=El.LessEqual;break;case TMe:t=El.Equal;break;case MMe:t=El.GreaterEqual;break;case CMe:t=El.Greater;break;case NMe:t=El.NotEqual;break;default:sn("WebGPURenderer: Invalid stencil function.",r)}return t}_getStencilOperation(e){let t;switch(e){case Gx:t=aA.Keep;break;case gMe:t=aA.Zero;break;case AMe:t=aA.Replace;break;case wMe:t=aA.Invert;break;case xMe:t=aA.IncrementClamp;break;case vMe:t=aA.DecrementClamp;break;case yMe:t=aA.IncrementWrap;break;case bMe:t=aA.DecrementWrap;break;default:sn("WebGPURenderer: Invalid stencil operation.",t)}return t}_getBlendOperation(e){let t;switch(e){case Ol:t=jx.Add;break;case AV:t=jx.Subtract;break;case xV:t=jx.ReverseSubtract;break;case jce:t=jx.Min;break;case Ice:t=jx.Max;break;default:sn("WebGPUPipelineUtils: Blend equation not supported.",e)}return t}_getPrimitiveState(e,t,r){const i={},s=this.backend.utils;
4859i.topology=s.getPrimitiveTopology(e,r),t.index!==null&&e.isLine===!0&&e.isLineSegments!==!0&&(i.stripIndexFormat=t.index.array instanceof Uint16Array?Gk.Uint16:Gk.Uint32);let a=r.side===us;return e.isMesh&&e.matrixWorld.determinantAffine()<0&&(a=!a),i.frontFace=a===!0?tee.CW:tee.CCW,i.cullMode=r.side===Fa?nee.None:nee.Back,i}_getColorWriteMask(e){return e.colorWrite===!0?ree.All:ree.None}_getDepthCompare(e){let t;if(e.depthTest===!1)t=El.Always;else{const r=this.backend.parameters.reversedDepthBuffer?BV[e.depthFunc]:e.depthFunc;switch(r){case c5:t=El.Never;break;case u5:t=El.Always;break;case d5:t=El.Less;break;case T1:t=El.LessEqual;break;case h5:t=El.Equal;break;case f5:t=El.GreaterEqual;break;case p5:t=El.Greater;break;case m5:t=El.NotEqual;break;default:sn("WebGPUPipelineUtils: Invalid depth function.",r)}}return t}}class Gme{constructor(){this.label="",this.type=void 0,this.count=0}reset(){this.label="",this.type=void 0,this.count=0}}const jp=new P_,rZe=new UT,Z3=new Gme;class iZe extends Dme{constructor(e,t,r=2048){super(r),this.device=e,this.type=t,Z3.label=`queryset_global_timestamp_${t}`,Z3.type="timestamp",Z3.count=this.maxQueries,this.querySet=this.device.createQuerySet(Z3),Z3.reset();const i=this.maxQueries*8;jp.label=`buffer_timestamp_resolve_${t}`,jp.size=i,jp.usage=GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC,this.resolveBuffer=this.device.createBuffer(jp),jp.reset(),jp.label=`buffer_timestamp_result_${t}`,jp.size=i,jp.usage=GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,this.resultBuffer=this.device.createBuffer(jp),jp.reset()}allocateQueriesForContext(e){if(!this.trackTimestamp||this.isDisposed)return null;if(this.currentQueryIndex+2>this.maxQueries)return _i(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryOffsets.set(e,t),t}async resolveQueriesAsync(){if(!this.trackTimestamp||this.currentQueryIndex===0||this.isDisposed)return this.lastValue;if(this.pendingResolve)return this.pendingResolve;this.pendingResolve=this._resolveQueries();try{return await this.pendingResolve}finally{this.pendingResolve=null}}async _resolveQueries(){if(this.isDisposed)return this.lastValue;try{if(this.resultBuffer.mapState!=="unmapped")return this.lastValue;const e=new Map(this.queryOffsets),t=this.currentQueryIndex,r=t*8;this.currentQueryIndex=0,this.queryOffsets.clear();const i=this.device.createCommandEncoder(rZe);i.resolveQuerySet(this.querySet,0,t,this.resolveBuffer,0),i.copyBufferToBuffer(this.resolveBuffer,0,this.resultBuffer,0,r);const s=i.finish();if(t0(this.device,s),this.resultBuffer.mapState!=="unmapped")return this.lastValue;if(await this.resultBuffer.mapAsync(GPUMapMode.READ,0,r),this.isDisposed)return this.resultBuffer.mapState==="mapped"&&this.resultBuffer.unmap(),this.lastValue;const a=new BigUint64Array(this.resultBuffer.getMappedRange(0,r)),o={},l=[];for(const[d,h]of e){const f=d.match(/^(.*):f(\d+)$/),p=parseInt(f[2]);l.includes(p)===!1&&l.push(p),o[p]===void 0&&(o[p]=0);const g=a[h],A=a[h+1],x=Number(A-g)/1e6;this.timestamps.set(d,x),o[p]+=x}const u=o[l[l.length-1]];return this.resultBuffer.unmap(),this.lastValue=u,this.frames=l,u}catch(e){return sn("Error resolving queries:",e),this.resultBuffer.mapState==="mapped"&&this.resultBuffer.unmap(),this.lastValue}}async dispose(){if(!this.isDisposed){if(this.isDisposed=!0,this.pendingResolve)try{await this.pendingResolve}catch(e){sn("Error waiting for pending resolve:",e)}if(this.resultBuffer&&this.resultBuffer.mapState==="mapped")try{this.resultBuffer.unmap()}catch(e){sn("Error unmapping buffer:",e)}this.querySet&&(this.querySet.destroy(),this.querySet=null),this.resolveBuffer&&(this.resolveBuffer.destroy(),this.resolveBuffer=null),this.resultBuffer&&(this.resultBuffer.destroy(),this.resultBuffer=null),this.queryOffsets.clear(),this.pendingResolve=null}}}class sZe{constructor(){this.label="",this.timestampWrites=void 0}reset(){this.label="",this.timestampWrites=void 0}}class gN{constructor(){this.view=null,this.depthLoadOp=void 0,this.depthStoreOp=void 0,this.depthClearValue=void 0,this.depthReadOnly=!1,this.stencilLoadOp=void 0,this.stencilStoreOp=void 0,this.stencilClearValue=0,this.stencilReadOnly=!1}reset(){this.view=null,this.depthLoadOp=void 0,this.depthStoreOp=void 0,this.depthClearValue=void 0,this.depthReadOnly=!1,this.stencilLoadOp=void 0,this.stencilStoreOp=void 0,this.stencilClearValue=0,this.stencilReadOnly=!1}}class aZe{constructor(){this.querySet=null,this.beginningOfPassWriteIndex=void 0,this.endOfPassWriteIndex=void 0}reset(){this.querySet=null,this.beginningOfPassWriteIndex=void 0,this.endOfPassWriteIndex=void 0}}const _f={r:0,g:0,b:0,a:1},Td=new P_,Yc=new UT,AN=new sZe,J3=new Gme,xN=new Ume,vN=new aZe,_h=new FR,Ip=new FR,ua=new gq,wm=new Bme;class oZe extends Ome{constructor(e={}){super(e),this.isWebGPUBackend=!0,this.parameters.alpha=e.alpha===void 0?!0:e.alpha,this.parameters.requiredLimits=e.requiredLimits===void 0?{}:e.requiredLimits,this.compatibilityMode=null,this.device=null,this.defaultRenderPassdescriptor=null,this.utils=new EKe(this),this.attributeUtils=new QKe(this),this.bindingUtils=new ZKe(this),this.capabilities=new JKe(this),this.pipelineUtils=new nZe(this),this.textureUtils=new IKe(this),this.occludedResolveCache=new Map;const t=typeof navigator>"u"?!0:/Android/.test(navigator.userAgent)===!1;this._compatibility={[_y.TEXTURE_COMPARE]:t}}async init(e){await super.init(e);const t=this.parameters;let r;if(t.device===void 0){const i={powerPreference:t.powerPreference,featureLevel:"compatibility",xrCompatible:e.xr.enabled},s=typeof navigator<"u"?await navigator.gpu.requestAdapter(i):null;if(s===null)throw new Error("THREE.WebGPUBackend: Unable to create WebGPU adapter.");const a=Object.values(qk),o=[];for(const u of a)s.features.has(u)&&o.push(u);const l={requiredFeatures:o,requiredLimits:t.requiredLimits};r=await s.requestDevice(l)}else r=t.device;this.compatibilityMode=!r.features.has("core-features-and-limits"),this.compatibilityMode&&(e._samples=0),r.lost.then(i=>{if(i.reason==="destroyed")return;const s={api:"WebGPU",message:i.message||"Unknown reason",reason:i.reason||null,originalEvent:i};e.onDeviceLost(s)}),r.onuncapturederror=i=>{const s=i.error,a=s&&s.constructor?s.constructor.name:"GPUError",o=s&&s.message||"Unknown uncaptured GPU error";e.onError({api:"WebGPU",type:a,message:o,originalEvent:i})},this.device=r,this.trackTimestamp=this.trackTimestamp&&this.hasFeature(qk.TimestampQuery),this.updateSize()}setXRRenderTargetTextures(e,t,r=null){this.set(e.texture,{texture:t,format:t.format,externalTexture:!0,xrViewDescriptors:r,initialized:!0})}get context(){const e=this.renderer.getCanvasTarget(),t=this.get(e);let r=t.context;if(r===void 0){const i=this.parameters;e.isDefaultCanvasTarget===!0&&i.context!==void 0?r=i.context:r=e.domElement.getContext("webgpu"),"setAttribute"in e.domElement&&e.domElement.setAttribute("data-engine",`three.js r${yy} webgpu`);const s=i.alpha?"premultiplied":"opaque",a=i.outputType===Js?"extended":"standard";r.configure({device:this.device,format:this.utils.getPreferredCanvasF
4859ormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:s,toneMapping:{mode:a}}),t.context=r}return r}get coordinateSystem(){return qh}get hasTimestamp(){return!0}async getArrayBufferAsync(e,t=null,r=0,i=-1){return await this.attributeUtils.getArrayBufferAsync(e,t,r,i)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){const e=this.renderer,t=e.getCanvasTarget(),r=this.get(t),i=e.currentSamples;let s=r.descriptor;if(s===void 0||r.samples!==i){if(s=new E4,s.colorAttachments.push(new T4),e.depth===!0||e.stencil===!0){const l=new gN;l.view=this.textureUtils.getDepthBuffer(e.depth,e.stencil).createView(),s.depthStencilAttachment=l}const o=s.colorAttachments[0];i>0?o.view=this.textureUtils.getColorBuffer().createView():o.resolveTarget=void 0,r.descriptor=s,r.samples=i}const a=s.colorAttachments[0];return i>0?a.resolveTarget=this.context.getCurrentTexture().createView():a.view=this.context.getCurrentTexture().createView(),s}_isRenderCameraDepthArray(e){const t=e.camera;return e.depthTexture&&e.depthTexture.isArrayTexture===!0&&t!==null&&t.isArrayCamera===!0}_hasExternalTexture(e){const t=e.textures;if(t===null)return!1;for(let r=0;r<t.length;r++)if(this.get(t[r]).externalTexture===!0)return!0;return!1}_createExternalTextureViews(e,t){const r=[],i=e.camera;if(t.xrViewDescriptors&&i!==null&&i.isArrayCamera===!0)for(let s=0;s<t.xrViewDescriptors.length;s++)r.push({view:t.texture.createView(t.xrViewDescriptors[s]),resolveTarget:void 0,depthSlice:void 0});else r.push({view:t.texture.createView({dimension:Rl.TwoD,baseArrayLayer:e.activeCubeFace,arrayLayerCount:1}),resolveTarget:void 0,depthSlice:void 0});return r}_getRenderPassDescriptor(e,t={}){const r=e.renderTarget,i=this.get(r),s=this._hasExternalTexture(e);let a=i.descriptors;(a===void 0||i.width!==r.width||i.height!==r.height||i.samples!==r.samples||s)&&(a={},i.descriptors=a);const o=e.getCacheKey();let l=a[o];if(l===void 0||s){const d=e.textures,h=[];let f;const p=this._isRenderCameraDepthArray(e);for(let A=0;A<d.length;A++){const x=this.get(d[A]);if(x.externalTexture===!0){h.push(...this._createExternalTextureViews(e,x));continue}if(ua.label=`colorAttachment_${A}`,ua.baseMipLevel=e.activeMipmapLevel,ua.mipLevelCount=1,ua.baseArrayLayer=e.activeCubeFace,ua.arrayLayerCount=1,ua.dimension=Rl.TwoD,r.isRenderTarget3D)f=e.activeCubeFace,ua.baseArrayLayer=0,ua.dimension=Rl.ThreeD;else if(r.isRenderTarget&&d[A].image.depth>1)if(p===!0){const b=e.camera.cameras;for(let _=0;_<b.length;_++){ua.baseArrayLayer=_,ua.arrayLayerCount=1,ua.dimension=Rl.TwoD;const M=x.texture.createView(ua);h.push({view:M,resolveTarget:void 0,depthSlice:void 0})}}else ua.dimension=Rl.TwoDArray;if(p!==!0){const b=x.texture.createView(ua);let _,M;x.msaaTexture!==void 0?(_=x.msaaTexture.createView(),M=b):(_=b,M=void 0),h.push({view:_,resolveTarget:M,depthSlice:f})}ua.reset()}const g=[];for(let A=0;A<h.length;A++){const x=h[A],b=new T4;b.view=x.view,b.depthSlice=x.depthSlice,b.resolveTarget=x.resolveTarget,g.push(b)}if(l={textureViews:h,colorAttachments:g,descriptor:new E4},e.depth){const A=this.get(e.depthTexture);(e.depthTexture.isArrayTexture||e.depthTexture.isCubeTexture)&&(ua.dimension=Rl.TwoD,ua.arrayLayerCount=1,ua.baseArrayLayer=e.activeCubeFace);const x=new gN;x.view=A.texture.createView(ua),l.depthStencilAttachment=x,ua.reset()}a[o]=l,i.width=r.width,i.height=r.height,i.samples=r.samples,i.activeMipmapLevel=e.activeMipmapLevel,i.activeCubeFace=e.activeCubeFace}const u=l.descriptor;u.reset();for(let d=0;d<l.colorAttachments.length;d++){const h=l.colorAttachments[d];let f={r:0,g:0,b:0,a:1};d===0&&t.clearValue&&(f=t.clearValue),h.loadOp=t.loadOp||fs.Load,h.storeOp=t.storeOp||Zc.Store,h.clearValue=f,u.colorAttachments.push(h)}return l.depthStencilAttachment&&(u.depthStencilAttachment=l.depthStencilAttachment),u}beginRender(e){const t=this.get(e),r=this.device,i=e.occlusionQueryCount;let s;i>0&&(t.currentOcclusionQuerySet&&t.currentOcclusionQuerySet.destroy(),t.currentOcclusionQueryBuffer&&t.currentOcclusionQueryBuffer.destroy(),t.currentOcclusionQuerySet=t.occlusionQuerySet,t.currentOcclusionQueryBuffer=t.occlusionQueryBuffer,t.currentOcclusionQueryObjects=t.occlusionQueryObjects,J3.label=`occlusionQuerySet_${e.id}`,J3.type="occlusion",J3.count=i,s=r.createQuerySet(J3),J3.reset(),t.occlusionQuerySet=s,t.occlusionQueryIndex=0,t.occlusionQueryObjects=new Array(i),t.lastOcclusionObject=null);let a;e.textures===null?a=this._getDefaultRenderPassDescriptor():a=this._getRenderPassDescriptor(e,{loadOp:fs.Load}),this.initTimestampQuery(o0.RENDER,this.getTimestampUID(e),a),a.occlusionQuerySet=s;const o=a.depthStencilAttachment;if(e.textures!==null){const u=a.colorAttachments;for(let d=0;d<u.length;d++){const h=u[d];e.clearColor?(d===0?h.clearValue=e.clearColorValue:(_f.r=0,_f.g=0,_f.b=0,_f.a=1,h.clearValue=_f),h.loadOp=fs.Clear):h.loadOp=fs.Load,h.storeOp=Zc.Store}}else{const u=a.colorAttachments[0];e.clearColor?(u.clearValue=e.clearColorValue,u.loadOp=fs.Clear):u.loadOp=fs.Load,u.storeOp=Zc.Store}e.depth&&(e.clearDepth?(o.depthClearValue=e.clearDepthValue,o.depthLoadOp=fs.Clear):o.depthLoadOp=fs.Load,o.depthStoreOp=Zc.Store),e.stencil&&(e.clearStencil?(o.stencilClearValue=e.clearStencilValue,o.stencilLoadOp=fs.Clear):o.stencilLoadOp=fs.Load,o.stencilStoreOp=Zc.Store),Yc.label="renderContext_"+e.id;const l=r.createCommandEncoder(Yc);if(Yc.reset(),this._isRenderCameraDepthArray(e)===!0){const u=e.camera.cameras;!t.layerDescriptors||t.layerDescriptors.length!==u.length?this._createArrayCameraLayerDescriptors(e,t,a,u):this._updateArrayCameraLayerDescriptors(e,t,u),t.bundleEncoders=[],t.bundleSets=[];for(let d=0;d<u.length;d++){const h=this.pipelineUtils.createBundleEncoder(e,"renderBundleArrayCamera_"+d),f={attributes:{},bindingGroups:[],pipeline:null,index:null};t.bundleEncoders.push(h),t.bundleSets.push(f)}t.currentPass=null}else{const u=l.beginRenderPass(a);t.currentPass=u,e.viewport&&this.updateViewport(e),e.scissor&&this.updateScissor(e)}
4859t.descriptor=a,t.encoder=l,t.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.renderBundles=[]}_createArrayCameraLayerDescriptors(e,t,r,i){const s=r.depthStencilAttachment;t.layerDescriptors=[];const a=this.get(e.depthTexture);a.viewCache||(a.viewCache=[]);for(let o=0;o<i.length;o++){const l=r.colorAttachments[0],u=new T4;u.view=r.colorAttachments[o].view,u.depthSlice=l.depthSlice,u.resolveTarget=l.resolveTarget,u.loadOp=l.loadOp,u.storeOp=l.storeOp,u.clearValue=l.clearValue;const d=new E4;if(d.label=r.label,d.occlusionQuerySet=r.occlusionQuerySet,d.timestampWrites=r.timestampWrites,d.colorAttachments.push(u),r.depthStencilAttachment){const h=o;a.viewCache[h]||(ua.dimension=Rl.TwoD,ua.baseArrayLayer=o,ua.arrayLayerCount=1,a.viewCache[h]=a.texture.createView(ua),ua.reset());const f=new gN;f.view=a.viewCache[h],f.depthLoadOp=s.depthLoadOp||fs.Clear,f.depthStoreOp=s.depthStoreOp||Zc.Store,f.depthClearValue=s.depthClearValue||1,e.stencil&&(f.stencilLoadOp=s.stencilLoadOp,f.stencilStoreOp=s.stencilStoreOp,f.stencilClearValue=s.stencilClearValue),d.depthStencilAttachment=f}else{const h=new gN;h.view=s.view,h.depthLoadOp=s.depthLoadOp,h.depthStoreOp=s.depthStoreOp,h.depthClearValue=s.depthClearValue,h.depthReadOnly=s.depthReadOnly,h.stencilLoadOp=s.stencilLoadOp,h.stencilStoreOp=s.stencilStoreOp,h.stencilClearValue=s.stencilClearValue,h.stencilReadOnly=s.stencilReadOnly,d.depthStencilAttachment=h}t.layerDescriptors.push(d)}}_updateArrayCameraLayerDescriptors(e,t,r){for(let i=0;i<r.length;i++){const s=t.layerDescriptors[i];if(s.depthStencilAttachment){const a=s.depthStencilAttachment;e.depth&&(e.clearDepth?(a.depthClearValue=e.clearDepthValue,a.depthLoadOp=fs.Clear):a.depthLoadOp=fs.Load),e.stencil&&(e.clearStencil?(a.stencilClearValue=e.clearStencilValue,a.stencilLoadOp=fs.Clear):a.stencilLoadOp=fs.Load)}}}finishRender(e){const t=this.get(e),r=e.occlusionQueryCount;t.renderBundles.length>0&&t.currentPass.executeBundles(t.renderBundles),r>t.occlusionQueryIndex&&t.currentPass.endOcclusionQuery();const i=t.encoder;if(this._isRenderCameraDepthArray(e)===!0){const s=[];for(let a=0;a<t.bundleEncoders.length;a++){const o=t.bundleEncoders[a];s.push(o.finish())}for(let a=0;a<t.layerDescriptors.length;a++)if(a<s.length){const o=t.layerDescriptors[a],l=i.beginRenderPass(o);if(e.viewport){const{x:u,y:d,width:h,height:f,minDepth:p,maxDepth:g}=e.viewportValue;l.setViewport(u,d,h,f,p,g)}if(e.scissor){const{x:u,y:d,width:h,height:f}=e.scissorValue;l.setScissorRect(u,d,h,f)}l.executeBundles([s[a]]),l.end()}}else t.currentPass&&t.currentPass.end();if(r>0){const s=r*8;let a=this.occludedResolveCache.get(s);a===void 0&&(Td.size=s,Td.usage=GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC,a=this.device.createBuffer(Td),Td.reset(),this.occludedResolveCache.set(s,a)),Td.size=s,Td.usage=GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ;const o=this.device.createBuffer(Td);Td.reset(),t.encoder.resolveQuerySet(t.occlusionQuerySet,0,r,a,0),t.encoder.copyBufferToBuffer(a,0,o,0,s),t.occlusionQueryBuffer=o,this.resolveOccludedAsync(e)}if(t0(this.device,t.encoder.finish()),e.textures!==null){const s=e.textures;for(let a=0;a<s.length;a++){const o=s[a];o.generateMipmaps===!0&&this.textureUtils.generateMipmaps(o)}}}isOccluded(e,t){const r=this.get(e);return r.occluded&&r.occluded.has(t)}async resolveOccludedAsync(e){const t=this.get(e),{currentOcclusionQueryBuffer:r,currentOcclusionQueryObjects:i}=t;if(r&&i){const s=new WeakSet;t.currentOcclusionQueryObjects=null,t.currentOcclusionQueryBuffer=null,await r.mapAsync(GPUMapMode.READ);const a=r.getMappedRange(),o=new BigUint64Array(a);for(let l=0;l<i.length;l++)o[l]===BigInt(0)&&s.add(i[l]);r.destroy(),t.occluded=s}}updateViewport(e){const{currentPass:t}=this.get(e),{x:r,y:i,width:s,height:a,minDepth:o,maxDepth:l}=e.viewportValue;t.setViewport(r,i,s,a,o,l)}updateScissor(e){const{currentPass:t}=this.get(e),{x:r,y:i,width:s,height:a}=e.scissorValue;t.setScissorRect(r,i,s,a)}getClearColor(){const e=super.getClearColor();return this.renderer.alpha===!0&&(e.r*=e.a,e.g*=e.a,e.b*=e.a),e}clear(e,t,r,i=null){const s=this.device,a=this.renderer;let o=[],l,u,d;if(e){const p=this.getClearColor();_f.r=p.r,_f.g=p.g,_f.b=p.b,_f.a=p.a}if(i===null){u=a.depth,d=a.stencil;const p=this._getDefaultRenderPassDescriptor();if(e){o=p.colorAttachments;const g=o[0];g.clearValue=_f,g.loadOp=fs.Clear,g.storeOp=Zc.Store}(u||d)&&(l=p.depthStencilAttachment)}else{u=i.depth,d=i.stencil;const p={loadOp:e?fs.Clear:fs.Load,clearValue:e?_f:void 0};u&&(p.depthLoadOp=t?fs.Clear:fs.Load,p.depthClearValue=t?a.getClearDepth():void 0,p.depthStoreOp=Zc.Store),d&&(p.stencilLoadOp=r?fs.Clear:fs.Load,p.stencilClearValue=r?a.getClearStencil():void 0,p.stencilStoreOp=Zc.Store);const g=this._getRenderPassDescriptor(i,p);o=g.colorAttachments,l=g.depthStencilAttachment}u&&l&&(t?(l.depthLoadOp=fs.Clear,l.depthClearValue=a.getClearDepth(),l.depthStoreOp=Zc.Store):(l.depthLoadOp=fs.Load,l.depthStoreOp=Zc.Store)),d&&l&&(r?(l.stencilLoadOp=fs.Clear,l.stencilClearValue=a.getClearStencil(),l.stencilStoreOp=Zc.Store):(l.stencilLoadOp=fs.Load,l.stencilStoreOp=Zc.Store)),Yc.label="clear";const h=s.createCommandEncoder(Yc);Yc.reset(),h.beginRenderPass({colorAttachments:o,depthStencilAttachment:l}).end(),t0(s,h.finish())}beginCompute(e){const t=this.get(e),r="computeGroup_"+e.id;AN.label=r,Yc.label=r,this.initTimestampQuery(o0.COMPUTE,this.getTimestampUID(e),AN),t.cmdEncoderGPU=this.device.createCommandEncoder(Yc),t.passEncoderGPU=t.cmdEncoderGPU.beginComputePass(AN),t.currentPipeline=null,Yc.reset(),AN.reset()}compute(e,t,r,i,s=null){const a=this.get(t),o=this.get(e),{passEncoderGPU:l}=o,u=this.get(i).pipeline;o.currentPipeline!==u&&(l.setPipeline(u),o.currentPipeline=u);for(let d=0,h=r.length;d<h;d++){const f=r[d],p=this.get(f);l.setBindGroup(d,p.group)}if(s===null&&(s=t.dispatchSize||t.count),s&&s.isIndirectStorageBufferAttribute){const d=this.get(s).buffer;l.dispatchWorkgroupsIndirect(d,0);return}if(typeof s=="number"){const d=s;if(a.dispatchSize===void 0||a.count!==d){a.dispatchSize=[0,1,1],a.count=d;const h=t.workgroupSize;let f=h[0];for(let A=1;A<h.length;A++)f*=h[A];const p=Math.ceil(d/f),g=this.device.limits.maxComputeWorkgroupsPerDimension;s=[p,1,1],p>g&&(s[0]=Math.min(p,g),s[1]=Math.ceil(p/g)),a.dispatchSize=s}s=a.dispatchSize}l.dispatchWorkgroups(s[0],s[1]||1,s[2]||1)}finishCompute(e){const t=this.get(e);t.passEncoderGPU.end(),t0(this.device,t.cmdEncoderGPU.finish())}_draw(e,t,r,i,s,a,o,l,u){const{object:d,material:h,context:f}=e,p=e.getIndex(),g=p!==null;u.pipeline!==i&&(l.setPipeline(i),u.pipeline=i);const A=u.bindingGroups;for(let x=0,b=s.length;x<b;x++){const _=s[x];if(A[x]!==_.id){const M=this.get(_);l.setBindGroup(x,M.group),A[x]=_.id}}if(g===!0&&u.index!==p){const x=this.get(p).buffer,b=p.array instanceof Uint16Array?Gk.Uint16:Gk.Uint32;l.setIndexBuffer(x,b),u.index=p}for(let x=0,b=a.length;x<b;x++){const _=a[x];if(u.attributes[x]!==_){const M=this.get(_).buffer;l.setVertexBuffer(x,M),u.attributes[x]=_}}if(f.stencil===!0&&h.stencilWrite===!0&&r.currentStencilRef!==h.stencilRef&&(l.setStencilReference(h.stencilRef),r.currentStencilRef=h.stencilRef),d.isBatchedMesh===!0){const x=d._multiDrawStarts,b=d._multiDrawCounts,_=d._multiDrawCount;let M=g===!0?p.array.BYTES_PER_ELEMENT:1;h.wireframe&&(M=d.geometry.attributes.position.count>65535?4:2);for(let T=0;T<_;T++)g===!0?l.drawIndexed(b[T],1,x[T]/M,0,T):l.draw(b[T],1,x[T],T),t.update(d,b[T],1)}else if(g===!0){const{vertexCount:x,instanceCount:b,firstVertex:_}=o,M=e.getIndirect();if(M!==null){const T=this.get(M).buffer,L=e.getIndirectOffset(),D=Array.isArray(L)?L:[L];for(let P=0;P<D.length;P++)l.drawIndexedIndirect(T,D[P])}else l.drawIndexed(x,b,_,0,0);t.update(d,x,b)}else{const{vertexCount:x,instanceCount:b,firstVertex:_}=o,M=e.getIndirect();if(M!==null){const T=this.get(M).buffer,L=e.getIndirectOffset(),D=Array.isArray(L)?L:[L];for(let P=0;P<D.length;P++)l.drawIndirect(T,D[P])}else l.draw(x,b,_,0);t.update(d,x,b)}}draw(e,t){const{object:r,context:i,pipeline:s}=e,a=this.get(i),o=this.get(s),l=o.pipeline;if(o.error===!0)return;const u=e.getDrawParameters();if(u===null)return;const d=e.getBindings(),h=e.getVertexBuffers();if(e.camera.isArrayCamera&&e.camera.cameras.length>0){const f=this.get(e.camera),p=e.camera.cameras,g=e.getBindingGroup("cameraIndex");if(f.indexesGPU===void 0||f.indexesGPU.length!==p.length){const x=this.get(g),b=[],_=new Uint32Array([0,0,0,0]);for(let M=0,T=p.length;M<T;M++){_[0]=M;const{layoutGPU:L}=x.layout,D=this.bindingUtils.createBindGroupIndex(_,L);b.push(D)}f.indexesGPU=b}const A=this.renderer.getPixelRatio();for(let x=0,b=p.length;x<b;x++){const _=p[x];
4859if(r.layers.test(_.layers)){const M=_.viewport;let T=a.currentPass,L=a.currentSets;const D=a.bundleEncoders!==void 0;if(D){const P=a.bundleEncoders[x],O=a.bundleSets[x];T=P,L=O}if(M&&!D&&T.setViewport(Math.floor(M.x*A),Math.floor(M.y*A),Math.floor(M.width*A),Math.floor(M.height*A),i.viewportValue.minDepth,i.viewportValue.maxDepth),g&&f.indexesGPU){const P=d.indexOf(g);T.setBindGroup(P,f.indexesGPU[x]),L.bindingGroups[P]=g.id}this._draw(e,t,a,l,d,h,u,T,L)}}}else if(a.currentPass){if(a.occlusionQuerySet!==void 0){const f=a.lastOcclusionObject;f!==r&&(f!==null&&f.occlusionTest===!0&&(a.currentPass.endOcclusionQuery(),a.occlusionQueryIndex++),r.occlusionTest===!0&&(a.currentPass.beginOcclusionQuery(a.occlusionQueryIndex),a.occlusionQueryObjects[a.occlusionQueryIndex]=r),a.lastOcclusionObject=r)}this._draw(e,t,a,l,d,h,u,a.currentPass,a.currentSets)}}needsRenderUpdate(e){const t=this.get(e),{object:r,material:i}=e,s=this.utils,a=s.getSampleCountRenderContext(e.context),o=s.getCurrentColorSpace(e.context),l=s.getCurrentColorFormat(e.context),u=s.getCurrentDepthStencilFormat(e.context),d=s.getPrimitiveTopology(r,i),h=r.isMesh&&r.matrixWorld.determinantAffine()<0;let f=!1;return(t.material!==i||t.materialVersion!==i.version||t.transparent!==i.transparent||t.blending!==i.blending||t.premultipliedAlpha!==i.premultipliedAlpha||t.blendSrc!==i.blendSrc||t.blendDst!==i.blendDst||t.blendEquation!==i.blendEquation||t.blendSrcAlpha!==i.blendSrcAlpha||t.blendDstAlpha!==i.blendDstAlpha||t.blendEquationAlpha!==i.blendEquationAlpha||t.colorWrite!==i.colorWrite||t.depthWrite!==i.depthWrite||t.depthTest!==i.depthTest||t.depthFunc!==i.depthFunc||t.stencilWrite!==i.stencilWrite||t.stencilFunc!==i.stencilFunc||t.stencilFail!==i.stencilFail||t.stencilZFail!==i.stencilZFail||t.stencilZPass!==i.stencilZPass||t.stencilFuncMask!==i.stencilFuncMask||t.stencilWriteMask!==i.stencilWriteMask||t.side!==i.side||t.alphaToCoverage!==i.alphaToCoverage||t.sampleCount!==a||t.colorSpace!==o||t.colorFormat!==l||t.depthStencilFormat!==u||t.primitiveTopology!==d||t.frontFaceCW!==h||t.clippingContextCacheKey!==e.clippingContextCacheKey)&&(t.material=i,t.materialVersion=i.version,t.transparent=i.transparent,t.blending=i.blending,t.premultipliedAlpha=i.premultipliedAlpha,t.blendSrc=i.blendSrc,t.blendDst=i.blendDst,t.blendEquation=i.blendEquation,t.blendSrcAlpha=i.blendSrcAlpha,t.blendDstAlpha=i.blendDstAlpha,t.blendEquationAlpha=i.blendEquationAlpha,t.colorWrite=i.colorWrite,t.depthWrite=i.depthWrite,t.depthTest=i.depthTest,t.depthFunc=i.depthFunc,t.stencilWrite=i.stencilWrite,t.stencilFunc=i.stencilFunc,t.stencilFail=i.stencilFail,t.stencilZFail=i.stencilZFail,t.stencilZPass=i.stencilZPass,t.stencilFuncMask=i.stencilFuncMask,t.stencilWriteMask=i.stencilWriteMask,t.side=i.side,t.alphaToCoverage=i.alphaToCoverage,t.sampleCount=a,t.colorSpace=o,t.colorFormat=l,t.depthStencilFormat=u,t.primitiveTopology=d,t.frontFaceCW=h,t.clippingContextCacheKey=e.clippingContextCacheKey,f=!0),f}getRenderCacheKey(e){const{object:t,material:r}=e,i=this.utils,s=e.context,a=t.isMesh&&t.matrixWorld.determinantAffine()<0;return[r.transparent,r.blending,r.premultipliedAlpha,r.blendSrc,r.blendDst,r.blendEquation,r.blendSrcAlpha,r.blendDstAlpha,r.blendEquationAlpha,r.colorWrite,r.depthWrite,r.depthTest,r.depthFunc,r.stencilWrite,r.stencilFunc,r.stencilFail,r.stencilZFail,r.stencilZPass,r.stencilFuncMask,r.stencilWriteMask,r.side,a,i.getSampleCountRenderContext(s),i.getCurrentColorSpace(s),i.getCurrentColorFormat(s),i.getCurrentDepthStencilFormat(s),i.getPrimitiveTopology(t,r),e.getGeometryCacheKey(),e.clippingContextCacheKey].join()}updateSampler(e){return this.textureUtils.updateSampler(e)}destroySampler(e){this.textureUtils.destroySampler(e)}createDefaultTexture(e){return this.textureUtils.createDefaultTexture(e)}createTexture(e,t){this.textureUtils.createTexture(e,t)}updateTexture(e,t){this.textureUtils.updateTexture(e,t)}generateMipmaps(e){this.textureUtils.generateMipmaps(e)}destroyTexture(e,t=!1){this.textureUtils.destroyTexture(e,t)}async copyTextureToBuffer(e,t,r,i,s,a){return this.textureUtils.copyTextureToBuffer(e,t,r,i,s,a)}initTimestampQuery(e,t,r){if(!this.trackTimestamp)return;this.timestampQueryPool[e]||(this.timestampQueryPool[e]=new iZe(this.device,e,2048));const i=this.timestampQueryPool[e],s=i.allocateQueriesForContext(t);vN.querySet=i.querySet,vN.beginningOfPassWriteIndex=s,vN.endOfPassWriteIndex=s+1,r.timestampWrites=vN}createNodeBuilder(e,t){return new WKe(e,t)}createProgram(e){const t=this.get(e);xN.label=e.stage+(e.name!==""?`_${e.name}
4859`:""),xN.code=e.code,t.module={module:this.device.createShaderModule(xN),entryPoint:"main"},xN.reset()}destroyProgram(e){this.delete(e)}createRenderPipeline(e,t){this.pipelineUtils.createRenderPipeline(e,t)}createComputePipeline(e,t){this.pipelineUtils.createComputePipeline(e,t)}beginBundle(e){const t=this.get(e);t._currentPass=t.currentPass,t._currentSets=t.currentSets,t.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.currentPass=this.pipelineUtils.createBundleEncoder(e)}finishBundle(e,t){const r=this.get(e),s=r.currentPass.finish();this.get(t).bundleGPU=s,r.currentSets=r._currentSets,r.currentPass=r._currentPass}addBundle(e,t){this.get(e).renderBundles.push(this.get(t).bundleGPU)}createUniformBuffer(e){const t=this.get(e);if(t.buffer===void 0){const r=e.byteLength,i=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,s=[];e.visibility&T0.VERTEX&&s.push("vertex"),e.visibility&T0.FRAGMENT&&s.push("fragment"),e.visibility&T0.COMPUTE&&s.push("compute");const a=`(${s.join(",")})`;Td.label=`bindingBuffer${e.id}_${e.name}_${a}`,Td.size=r,Td.usage=i;const o=this.device.createBuffer(Td);Td.reset(),t.buffer=o}}destroyUniformBuffer(e){this.get(e).buffer.destroy(),this.delete(e)}createBindings(e,t,r,i){this.bindingUtils.createBindings(e,t,r,i)}updateBindings(e,t,r,i){this.bindingUtils.createBindings(e,t,r,i)}updateBinding(e){this.bindingUtils.updateBinding(e)}deleteBindGroupData(e){this.bindingUtils.deleteBindGroupData(e)}createIndexAttribute(e){let t=GPUBufferUsage.INDEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST;(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)&&(t|=GPUBufferUsage.STORAGE),this.attributeUtils.createAttribute(e,t)}createAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createStorageAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.STORAGE|GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createIndirectStorageAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.STORAGE|GPUBufferUsage.INDIRECT|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}updateAttribute(e){this.attributeUtils.updateAttribute(e)}destroyAttribute(e){this.attributeUtils.destroyAttribute(e)}updateSize(){this.delete(this.renderer.getCanvasTarget())}hasFeature(e){return aee[e]!==void 0&&(e=aee[e]),this.device.features.has(e)}copyTextureToTexture(e,t,r=null,i=null,s=0,a=0){let o=0,l=0,u=0,d=0,h=0,f=0,p=e.image.width,g=e.image.height,A=1;r!==null&&(r.isBox3===!0?(d=r.min.x,h=r.min.y,f=r.min.z,p=r.max.x-r.min.x,g=r.max.y-r.min.y,A=r.max.z-r.min.z):(d=r.min.x,h=r.min.y,p=r.max.x-r.min.x,g=r.max.y-r.min.y,A=1)),i!==null&&(o=i.x,l=i.y,u=i.z||0),Yc.label="copyTextureToTexture_"+e.id+"_"+t.id;const x=this.device.createCommandEncoder(Yc);Yc.reset();const b=this.get(e).texture,_=this.get(t).texture;_h.texture=b,_h.mipLevel=s,_h.origin.x=d,_h.origin.y=h,_h.origin.z=f,Ip.texture=_,Ip.mipLevel=a,Ip.origin.x=o,Ip.origin.y=l,Ip.origin.z=u,wm.width=p,wm.height=g,wm.depthOrArrayLayers=A,x.copyTextureToTexture(_h,Ip,wm),_h.reset(),Ip.reset(),wm.reset(),t0(this.device,x.finish()),a===0&&t.generateMipmaps&&this.textureUtils.generateMipmaps(t)}copyFramebufferToTexture(e,t,r){const i=this.get(t);let s=null;t.renderTarget?e.isDepthTexture?s=this.get(t.depthTexture).texture:s=this.get(t.textures[0]).texture:e.isDepthTexture?s=this.textureUtils.getDepthBuffer(t.depth,t.stencil):s=this.context.getCurrentTexture();const a=this.get(e).texture;if(s.format!==a.format){sn("WebGPUBackend: copyFramebufferToTexture: Source and destination formats do not match.",s.format,a.format);return}let o;if(i.currentPass?(i.currentPass.end(),o=i.encoder):(Yc.label="copyFramebufferToTexture_"+e.id,o=this.device.createCommandEncoder(Yc),Yc.reset()),_h.texture=s,_h.origin.x=r.x,_h.origin.y=r.y,Ip.texture=a,wm.width=r.z,wm.height=r.w,o.copyTextureToTexture(_h,Ip,wm),_h.reset(),Ip.reset(),wm.reset(),e.generateMipmaps&&this.textureUtils.generateMipmaps(e,o),i.currentPass){const{descriptor:l}=i;for(let u=0;u<l.colorAttachments.length;u++)l.colorAttachments[u].loadOp=fs.Load;t.depth&&(l.depthStencilAttachment.depthLoadOp=fs.Load),t.stencil&&(l.depthStencilAttachment.stencilLoadOp=fs.Load),i.currentPass=o.beginRenderPass(l),i.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.viewport&&this.updateViewport(t),t.scissor&&this.updateScissor(t)}
4859else t0(this.device,o.finish())}hasCompatibility(e){return this._compatibility[e]!==void 0?this._compatibility[e]:super.hasCompatibility(e)}dispose(){if(this.bindingUtils.dispose(),this.textureUtils.dispose(),this.occludedResolveCache){for(const e of this.occludedResolveCache.values())e.destroy();this.occludedResolveCache.clear()}if(this.timestampQueryPool)for(const e of Object.values(this.timestampQueryPool))e!==null&&e.dispose();this.parameters.device===void 0&&this.device!==null&&this.device.destroy()}}class lZe extends az{constructor(e,t,r,i,s,a){super(e,t,r,i,s,a),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class cZe extends az{constructor(e,t,r,i,s,a){super(e,t,r,i,s,a),this.aspect=null}copy(e,t){return super.copy(e,t),this.aspect=e.aspect,this}}class uZe extends Tme{constructor(){super(),this.addMaterial(MGe,"MeshPhongMaterial"),this.addMaterial(m0e,"MeshStandardMaterial"),this.addMaterial(vqe,"MeshPhysicalMaterial"),this.addMaterial(_qe,"MeshToonMaterial"),this.addMaterial(wGe,"MeshBasicMaterial"),this.addMaterial(CGe,"MeshLambertMaterial"),this.addMaterial(AGe,"MeshNormalMaterial"),this.addMaterial(Tqe,"MeshMatcapMaterial"),this.addMaterial(hGe,"LineBasicMaterial"),this.addMaterial(pGe,"LineDashedMaterial"),this.addMaterial(kqe,"PointsMaterial"),this.addMaterial(A0e,"SpriteMaterial"),this.addMaterial(Oqe,"ShadowMaterial"),this.addLight(gXe,f8e),this.addLight(NQe,due),this.addLight(OQe,m8e),this.addLight(fq,az),this.addLight(CQe,hue),this.addLight(MQe,u8e),this.addLight(RQe,A8e),this.addLight(kQe,lZe),this.addLight(LQe,cZe),this.addToneMapping(V0e,CV),this.addToneMapping(z0e,NV),this.addToneMapping(G0e,MV),this.addToneMapping(q0e,kV),this.addToneMapping($0e,RV),this.addToneMapping(H0e,PV)}}class qme extends tKe{constructor(e={}){let t;e.forceWebGL?t=eee:(t=oZe,e.getFallback=()=>(an("WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new eee(e)));const r=new t(e);super(r,e),this.library=new uZe,this.isWebGPURenderer=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}/** 4860 * @license 4861 * Copyright 2010-2026 Three.js Authors 4862 * SPDX-License-Identifier: MIT 4863 */ne.BRDF_GGX;ne.BRDF_Lambert;ne.BasicPointShadowFilter;ne.BasicShadowFilter;ne.Break;ne.Const;ne.Continue;ne.DFGLUT;ne.D_GGX;ne.Discard;ne.EPSILON;ne.F_Schlick;const dZe=ne.Fn;ne.INFINITY;const hZe=ne.If,fZe=ne.Loop;ne.NodeAccess;ne.NodeShaderStage;ne.NodeType;ne.NodeUpdateType;ne.PCFShadowFilter;ne.PCFSoftShadowFilter;ne.PI;ne.PI2;ne.TWO_PI;ne.HALF_PI;ne.PointShadowFilter;ne.Return;ne.Schlick_to_F0;ne.ShaderNode;ne.Stack;ne.Switch;ne.TBNViewMatrix;ne.VSMShadowFilter;ne.V_GGX_SmithCorrelated;ne.Var;ne.VarIntent;ne.abs;ne.acesFilmicToneMapping;ne.acos;ne.acosh;ne.add;ne.addMethodChaining;ne.addNodeElement;ne.agxToneMapping;ne.all;ne.alphaT;ne.ambientOcclusion;ne.and;ne.anisotropy;ne.anisotropyB;ne.anisotropyT;ne.any;ne.append;ne.array;const pZe=ne.asin;ne.asinh;ne.assign;ne.atan;ne.atanh;ne.atomicAdd;ne.atomicAnd;ne.atomicFunc;ne.atomicLoad;ne.atomicMax;ne.atomicMin;ne.atomicOr;ne.atomicStore;ne.atomicSub;ne.atomicXor;ne.attenuationColor;ne.attenuationDistance;ne.attribute;ne.attributeArray;ne.backgroundBlurriness;ne.backgroundIntensity;ne.backgroundRotation;ne.batch;ne.bentNormalView;ne.billboarding;ne.bitAnd;ne.bitNot;ne.bitOr;ne.bitXor;ne.bitangentGeometry;ne.bitangentLocal;ne.bitangentView;ne.bitangentWorld;ne.bitcast;ne.blendBurn;ne.blendColor;ne.blendDodge;ne.blendOverlay;ne.blendScreen;ne.blur;ne.bool;ne.buffer;ne.bufferAttribute;ne.bumpMap;ne.builtin;ne.builtinAOContext;ne.builtinShadowContext;ne.bvec2;ne.bvec3;ne.bvec4;ne.bypass;ne.cache;ne.call;ne.cameraFar;ne.cameraIndex;ne.cameraNear;ne.cameraNormalMatrix;ne.cameraPosition;ne.cameraProjectionMatrix;ne.cameraProjectionMatrixInverse;ne.cameraViewMatrix;ne.cameraViewport;ne.cameraWorldMatrix;ne.cbrt;ne.cdl;ne.ceil;ne.checker;ne.cineonToneMapping;ne.clamp;ne.clearcoat;ne.clearcoatNormalView;ne.clearcoatRoughness;ne.clipSpace;ne.code;ne.color;ne.colorSpaceToWorking;ne.colorToDirection;ne.compute;ne.computeKernel;ne.computeSkinning;ne.context;ne.convert;ne.convertColorSpace;ne.convertToTexture;ne.countLeadingZeros;ne.countOneBits;ne.countTrailingZeros;const mZe=ne.cos;ne.cosh;ne.cross;ne.cubeTexture;ne.cubeTextureBase;ne.dFdx;ne.dFdy;ne.dashSize;ne.debug;ne.decrement;ne.decrementBefore;ne.defaultBuildStages;ne.defaultShaderStages;ne.defined;ne.degrees;ne.deltaTime;ne.densityFog;ne.densityFogFactor;ne.depth;ne.depthPass;ne.determinant;ne.difference;ne.diffuseColor;ne.directPointLight;ne.directionToColor;ne.directionToFaceDirection;ne.dispersion;ne.distance;ne.div;ne.dot;ne.drawIndex;ne.dynamicBufferAttribute;ne.element;ne.emissive;ne.equal;ne.equirectDirection;ne.equirectUV;const gZe=ne.exp;ne.exp2;
4863ne.exponentialHeightFogFactor;ne.expression;ne.faceDirection;ne.faceForward;ne.faceforward;const AZe=ne.float;ne.floatBitsToInt;ne.floatBitsToUint;ne.floor;ne.fog;ne.fract;ne.frameGroup;ne.frameId;ne.frontFacing;ne.fwidth;ne.gain;ne.gapSize;ne.getConstNodeType;ne.getCurrentStack;ne.getDirection;ne.getDistanceAttenuation;ne.getGeometryRoughness;ne.getNormalFromDepth;ne.interleavedGradientNoise;ne.vogelDiskSample;ne.getParallaxCorrectNormal;ne.getRoughness;ne.getScreenPosition;ne.getShIrradianceAt;ne.getShadowMaterial;ne.getShadowRenderObjectFunction;ne.getTextureIndex;ne.getViewPosition;ne.globalId;ne.glsl;ne.glslFn;ne.grayscale;ne.greaterThan;ne.greaterThanEqual;ne.hash;ne.highpModelNormalViewMatrix;ne.highpModelViewMatrix;ne.hue;ne.increment;ne.incrementBefore;ne.instance;const xZe=ne.instanceIndex;ne.instancedArray;ne.instancedBufferAttribute;ne.instancedDynamicBufferAttribute;ne.instancedMesh;ne.int;ne.intBitsToFloat;ne.inverse;ne.inverseSqrt;ne.inversesqrt;ne.invocationLocalIndex;ne.invocationSubgroupIndex;ne.ior;ne.iridescence;ne.iridescenceIOR;ne.iridescenceThickness;ne.ivec2;ne.ivec3;ne.ivec4;ne.js;ne.label;ne.length;ne.lengthSq;ne.lessThan;ne.lessThanEqual;ne.lightPosition;ne.lightProjectionUV;ne.lightShadowMatrix;ne.lightTargetDirection;ne.lightTargetPosition;ne.lightViewPosition;ne.lightingContext;ne.lights;ne.linearDepth;ne.linearToneMapping;ne.localId;ne.log;ne.log2;ne.logarithmicDepthToViewZ;ne.luminance;ne.mat2;ne.mat3;ne.mat4;ne.matcapUV;ne.materialAO;ne.materialAlphaTest;ne.materialAnisotropy;ne.materialAnisotropyVector;ne.materialAttenuationColor;ne.materialAttenuationDistance;ne.materialClearcoat;ne.materialClearcoatNormal;ne.materialClearcoatRoughness;ne.materialColor;ne.materialDispersion;ne.materialEmissive;ne.materialEnvIntensity;ne.materialEnvRotation;ne.materialIOR;ne.materialIridescence;ne.materialIridescenceIOR;ne.materialIridescenceThickness;ne.materialLightMap;ne.materialLineDashOffset;ne.materialLineDashSize;ne.materialLineGapSize;ne.materialLineScale;ne.materialLineWidth;ne.materialMetalness;ne.materialNormal;ne.materialOpacity;ne.materialPointSize;ne.materialReference;ne.materialReflectivity;ne.materialRefractionRatio;ne.materialRotation;ne.materialRoughness;ne.materialSheen;ne.materialSheenRoughness;ne.materialShininess;ne.materialSpecular;ne.materialSpecularColor;ne.materialSpecularIntensity;ne.materialSpecularStrength;ne.materialThickness;ne.materialTransmission;ne.max;ne.maxMipLevel;ne.mediumpModelViewMatrix;ne.metalness;ne.min;ne.mix;ne.mixElement;ne.mod;ne.modelDirection;ne.modelNormalMatrix;ne.modelPosition;ne.modelRadius;ne.modelScale;ne.modelViewMatrix;ne.modelViewPosition;ne.modelViewProjection;ne.modelWorldMatrix;ne.modelWorldMatrixInverse;ne.morphReference;ne.mrt;ne.mul;ne.mx_aastep;ne.mx_add;ne.mx_atan2;ne.mx_cell_noise_float;ne.mx_contrast;ne.mx_divide;ne.mx_fractal_noise_float;ne.mx_fractal_noise_vec2;ne.mx_fractal_noise_vec3;ne.mx_fractal_noise_vec4;ne.mx_frame;ne.mx_heighttonormal;ne.mx_hsvtorgb;ne.mx_ifequal;ne.mx_ifgreater;ne.mx_ifgreatereq;ne.mx_invert;ne.mx_modulo;ne.mx_multiply;ne.mx_noise_float;ne.mx_noise_vec3;ne.mx_noise_vec4;ne.mx_place2d;ne.mx_power;ne.mx_ramp4;ne.mx_ramplr;ne.mx_ramptb;ne.mx_rgbtohsv;ne.mx_rotate2d;ne.mx_rotate3d;ne.mx_safepower;ne.mx_separate;ne.mx_splitlr;ne.mx_splittb;ne.mx_srgb_texture_to_lin_rec709;ne.mx_subtract;ne.mx_timer;ne.mx_transform_uv;ne.mx_unifiednoise2d;ne.mx_unifiednoise3d;ne.mx_worley_noise_float;ne.mx_worley_noise_vec2;ne.mx_worley_noise_vec3;const vZe=ne.negate;ne.negateOnBackSide;ne.neutralToneMapping;ne.nodeArray;ne.nodeImmutable;ne.nodeObject;ne.nodeObjectIntent;ne.nodeObjects;ne.nodeProxy;ne.nodeProxyIntent;ne.normalFlat;ne.normalGeometry;ne.normalLocal;ne.normalMap;ne.normalView;ne.normalViewGeometry;ne.normalWorld;ne.normalWorldGeometry;ne.normalize;ne.not;ne.notEqual;ne.numWorkgroups;ne.objectDirection;ne.objectGroup;ne.objectPosition;ne.objectRadius;ne.objectScale;ne.objectViewPosition;ne.objectWorldMatrix;ne.OnBeforeObjectUpdate;ne.OnBeforeMaterialUpdate;ne.OnObjectUpdate;ne.OnMaterialUpdate;ne.oneMinus;ne.or;ne.orthographicDepthToViewZ;ne.oscSawtooth;ne.oscSine;ne.oscSquare;ne.oscTriangle;ne.output;ne.outputStruct;ne.overloadingFn;ne.overrideNode;ne.overrideNodes;ne.packHalf2x16;ne.packSnorm2x16;ne.packUnorm2x16;ne.packNormalToRGB;ne.parabola;ne.parallaxDirection;ne.parallaxUV;ne.parameter;ne.pass;ne.passTexture;ne.pcurve;ne.perspectiveDepthToViewZ;ne.pmremTexture;ne.pointShadow;ne.pointUV;ne.pointWidth;ne.positionGeometry;ne.positionLocal;ne.positionPrevious;ne.positionView;ne.positionViewDirection;ne.positionWorld;ne.positionWorldDirection;ne.posterize;ne.pow;ne.pow2;ne.pow3;ne.pow4;ne.premultiplyAlpha;ne.property;ne.radians;ne.rand;ne.range;ne.rangeFog;ne.rangeFogFactor;ne.reciprocal;ne.reference;ne.referenceBuffer;ne.reflect;ne.reflectVector;ne.reflectView;ne.reflector;ne.refract;ne.refractVector;ne.refractView;ne.reinhardToneMapping;ne.remap;ne.remapClamp;ne.renderGroup;ne.renderOutput;ne.rendererReference;ne.replaceDefaultUV;ne.rotate;ne.rotateUV;ne.roughness;ne.round;ne.rtt;ne.sRGBTransferEOTF;ne.sRGBTransferOETF;ne.sample;ne.sampler;ne.samplerComparison;ne.saturate;ne.saturation;ne.screen;ne.screenCoordinate;ne.screenDPR;ne.screenSize;ne.screenUV;ne.select;ne.setCurrentStack;ne.setName;ne.shaderStages;ne.shadow;ne.shadowPositionWorld;ne.shapeCircle;ne.sharedUniformGroup;ne.sheen;ne.sheenRoughness;ne.shiftLeft;ne.shiftRight;ne.shininess;ne.sign;const yZe=ne.sin;ne.sinh;ne.sinc;ne.skinning;ne.smoothstep;ne.smoothstepElement;ne.specularColor;ne.specularF90;ne.spherizeUV;ne.split;ne.spritesheetUV;const bZe=ne.sqrt;ne.stack;ne.step;ne.stepElement;const wZe=ne.storage;ne.storageBarrier;ne.storageTexture;ne.storageTexture3D;ne.struct;ne.sub;ne.subgroupAdd;ne.subgroupAll;ne.subgroupAnd;ne.subgroupAny;ne.subgroupBallot;ne.subgroupBroadcast;ne.subgroupBroadcastFirst;ne.subBuild;ne.subgroupElect;ne.subgroupExclusiveAdd;ne.subgroupExclusiveMul;ne.subgroupInclusiveAdd;ne.subgroupInclusiveMul;ne.subgroupIndex;
4863ne.subgroupMax;ne.subgroupMin;ne.subgroupMul;ne.subgroupOr;ne.subgroupShuffle;ne.subgroupShuffleDown;ne.subgroupShuffleUp;ne.subgroupShuffleXor;ne.subgroupSize;ne.subgroupXor;ne.tan;ne.tanh;ne.tangentGeometry;ne.tangentLocal;ne.tangentView;ne.tangentWorld;ne.texture;ne.texture3D;ne.textureBarrier;ne.textureBicubic;ne.textureBicubicLevel;ne.textureCubeUV;ne.textureLoad;ne.textureSize;ne.textureLevel;ne.textureStore;ne.thickness;ne.time;ne.toneMapping;ne.toneMappingExposure;ne.toonOutlinePass;ne.transformDirection;ne.transformNormal;ne.transformNormalByInverseViewMatrix;ne.transformNormalByViewMatrix;ne.transformNormalToView;ne.transformedClearcoatNormalView;ne.transformedNormalView;ne.transformedNormalWorld;ne.transmission;ne.transpose;ne.triNoise3D;ne.triplanarTexture;ne.triplanarTextures;ne.trunc;ne.uint;ne.uintBitsToFloat;const _Ze=ne.uniform;ne.uniformArray;ne.uniformCubeTexture;ne.uniformGroup;ne.uniformFlow;ne.uniformTexture;ne.unpackHalf2x16;ne.unpackSnorm2x16;ne.unpackUnorm2x16;ne.unpackRGBToNormal;ne.unpremultiplyAlpha;ne.userData;ne.uv;ne.uvec2;ne.uvec3;ne.uvec4;ne.varying;ne.varyingProperty;ne.vec2;ne.vec3;ne.vec4;ne.vectorComponents;ne.velocity;ne.vertexColor;ne.vertexIndex;ne.vertexStage;ne.vibrance;ne.viewZToLogarithmicDepth;ne.viewZToOrthographicDepth;ne.viewZToPerspectiveDepth;ne.viewZToReversedOrthographicDepth;ne.viewZToReversedPerspectiveDepth;ne.viewport;ne.viewportCoordinate;ne.viewportDepthTexture;ne.viewportLinearDepth;ne.viewportMipTexture;ne.viewportOpaqueMipTexture;ne.viewportResolution;ne.viewportSafeUV;ne.viewportSharedTexture;ne.viewportSize;ne.viewportTexture;ne.viewportUV;ne.wgsl;ne.wgslFn;ne.workgroupArray;ne.workgroupBarrier;ne.workgroupId;ne.workingToColorSpace;ne.xor;const hee=new dg,yN=new Ve;class $me extends x8e{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new Bi(e,3)),this.setAttribute("uv",new Bi(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const r=new UM(t,6,1);return this.setAttribute("instanceStart",new l0(r,3,0)),this.setAttribute("instanceEnd",new l0(r,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const r=new UM(t,6,1);return this.setAttribute("instanceColorStart",new l0(r,3,0)),this.setAttribute("instanceColorEnd",new l0(r,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Xke(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new dg);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),hee.setFromBufferAttribute(t),this.boundingBox.union(hee))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new H1),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0;for(let s=0,a=e.count;s<a;s++)yN.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(yN)),yN.fromBufferAttribute(t,s),i=Math.max(i,r.distanceToSquared(yN));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}Bn.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Jt},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};Ou.line={uniforms:K8.merge([Bn.common,Bn.fog,Bn.line]),vertexShader:` 4864 #include <common> 4865 #include <color_pars_vertex> 4866 #include <fog_pars_vertex> 4867 #include <logdepthbuf_pars_vertex> 4868 #include <clipping_planes_pars_vertex> 4869 4870 uniform float linewidth; 4871 uniform vec2 resolution; 4872 4873 attribute vec3 instanceStart; 4874 attribute vec3 instanceEnd; 4875 4876 attribute vec3 instanceColorStart; 4877 attribute vec3 instanceColorEnd; 4878
4879 #ifdef WORLD_UNITS 4880 4881 varying vec4 worldPos; 4882 varying vec3 worldStart; 4883 varying vec3 worldEnd; 4884 4885 #ifdef USE_DASH 4886 4887 varying vec2 vUv; 4888 4889 #endif 4890 4891 #else 4892 4893 varying vec2 vUv; 4894 4895 #endif 4896 4897 #ifdef USE_DASH 4898 4899 uniform float dashScale; 4900 attribute float instanceDistanceStart; 4901 attribute float instanceDistanceEnd; 4902 varying float vLineDistance; 4903 4904 #endif 4905 4906 float trimSegmentAlpha( const in vec4 start, const in vec4 end ) { 4907 4908 // compute the interpolation factor needed to trim the segment so it terminates 4909 // between the camera plane and the near plane 4910 4911 // conservative estimate of the near plane 4912 float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column 4913 float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column 4914 4915 // we need different nearEstimate formula for reversed and default depth buffer 4916 // a is positive with a reversed depth buffer so it can be used for controlling the code flow 4917 float nearEstimate = ( a > 0.0 ) ? ( - b / ( a + 1.0 ) ) : ( - 0.5 * b / a ); 4918 4919 return ( nearEstimate - start.z ) / ( end.z - start.z ); 4920 4921 } 4922 4923 void main() { 4924 4925 #ifdef USE_COLOR 4926 4927 vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; 4928 4929 #endif 4930 4931 float aspect = resolution.x / resolution.y; 4932 4933 // camera space 4934 vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); 4935 vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); 4936 4937 #ifdef USE_DASH 4938 4939 float lineDistanceStart = dashScale * instanceDistanceStart; 4940 float lineDistanceEnd = dashScale * instanceDistanceEnd; 4941 4942 #endif 4943 4944 #ifdef WORLD_UNITS 4945 4946 worldStart = start.xyz; 4947 worldEnd = end.xyz; 4948 4949 #else 4950 4951 vUv = uv; 4952 4953 #endif 4954 4955 // special case for perspective projection, and segments that terminate either in, or behind, the camera plane 4956 // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space 4957 // but we need to perform ndc-space calculations in the shader, so we must address this issue directly 4958 // perhaps there is a more elegant solution -- WestLangley 4959 4960 bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column 4961 4962 if ( perspective ) { 4963 4964 if ( start.z < 0.0 && end.z >= 0.0 ) { 4965 4966 float alpha = trimSegmentAlpha( start, end ); 4967 end.xyz = mix( start.xyz, end.xyz, alpha ); 4968 4969 #ifdef USE_DASH 4970 4971 lineDistanceEnd = mix( lineDistanceStart, lineDistanceEnd, alpha ); 4972 4973 #endif 4974 4975 } else if ( end.z < 0.0 && start.z >= 0.0 ) { 4976 4977 float alpha = trimSegmentAlpha( end, start ); 4978 start.xyz = mix( end.xyz, start.xyz, alpha ); 4979 4980 #ifdef USE_DASH 4981 4982 lineDistanceStart = mix( lineDistanceEnd, lineDistanceStart, alpha ); 4983 4984 #endif 4985 4986 } 4987 4988 } 4989 4990 #ifdef USE_DASH 4991 4992 vLineDistance = ( position.y < 0.5 ) ? lineDistanceStart : lineDistanceEnd; 4993 vUv = uv; 4994 4995 #endif 4996 4997 // clip space 4998 vec4 clipStart = projectionMatrix * start; 4999 vec4 clipEnd = projectionMatrix * end; 5000 5001 // ndc space 5002 vec3 ndcStart = clipStart.xyz / clipStart.w; 5003 vec3 ndcEnd = clipEnd.xyz / clipEnd.w; 5004 5005 // direction 5006 vec2 dir = ndcEnd.xy - ndcStart.xy; 5007 5008 // account for clip-space aspect ratio 5009 dir.x *= aspect; 5010 dir = normalize( dir ); 5011 5012 #ifdef WORLD_UNITS 5013 5014 vec3 worldDir = normalize( end.xyz - start.xyz ); 5015 vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) ); 5016 vec3 worldUp = normalize( cross( worldDir, tmpFwd ) ); 5017 vec3 worldFwd = cross( worldDir, worldUp ); 5018 worldPos = position.y < 0.5 ? start: end; 5019 5020 // height offset 5021 float hw = linewidth * 0.5; 5022 worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp; 5023 5024 // don't extend the line if we're rendering dashes because we 5025 // won't be rendering the endcaps 5026 #ifndef USE_DASH 5027 5028 // cap extension 5029 worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir; 5030 5031 // add width to the box 5032 worldPos.xyz += worldFwd * hw; 5033 5034 // endcaps 5035 if ( position.y > 1.0 || position.y < 0.0 ) { 5036 5037 worldPos.xyz -= worldFwd * 2.0 * hw; 5038 5039 } 5040 5041 #endif 5042 5043 // project the worldpos 5044 vec4 clip = projectionMatrix * worldPos; 5045 5046 // shift the depth of the projected points so the line 5047 // segments overlap neatly 5048 vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; 5049 clip.z = clipPose.z * clip.w; 5050 5051 #else 5052 5053 vec2 offset = vec2( dir.y, - dir.x ); 5054 // undo aspect ratio adjustment 5055 dir.x /= aspect; 5056 offset.x /= aspect; 5057 5058 // sign flip 5059 if ( position.x < 0.0 ) offset *= - 1.0; 5060 5061 // endcaps 5062 if ( position.y < 0.0 ) { 5063 5064 offset += - dir; 5065 5066 } else if ( position.y > 1.0 ) { 5067 5068 offset += dir; 5069 5070 } 5071 5072 // adjust for linewidth 5073 offset *= linewidth; 5074 5075 // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... 5076 offset /= resolution.y; 5077 5078 // select end 5079 vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; 5080 5081 // back to clip space 5082 offset *= clip.w; 5083 5084 clip.xy += offset; 5085 5086 #endif 5087 5088 gl_Position = clip; 5089 5090 vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation 5091 5092 #include <logdepthbuf_vertex> 5093 #include <clipping_planes_vertex> 5094 #include <fog_vertex> 5095 5096 } 5097 `,fragmentShader:` 5098 uniform vec3 diffuse; 5099 uniform float opacity; 5100 uniform float linewidth; 5101 5102 #ifdef USE_DASH 5103 5104 uniform float dashOffset; 5105 uniform float dashSize; 5106 uniform float gapSize; 5107 5108 #endif 5109 5110 varying float vLineDistance; 5111 5112 #ifdef WORLD_UNITS 5113 5114 varying vec4 worldPos; 5115 varying vec3 worldStart; 5116 varying vec3 worldEnd; 5117 5118 #ifdef USE_DASH 5119 5120 varying vec2 vUv; 5121 5122 #endif 5123 5124 #else 5125 5126 varying vec2 vUv; 5127 5128 #endif 5129 5130 #include <common> 5131 #include <color_pars_fragment> 5132 #include <fog_pars_fragment> 5133 #include <logdepthbuf_pars_fragment> 5134 #include <clipping_planes_pars_fragment> 5135 5136 vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { 5137 5138 float mua; 5139 float mub; 5140 5141 vec3 p13 = p1 - p3; 5142 vec3 p43 = p4 - p3; 5143 5144 vec3 p21 = p2 - p1; 5145 5146 float d1343 = dot( p13, p43 );
5147 float d4321 = dot( p43, p21 ); 5148 float d1321 = dot( p13, p21 ); 5149 float d4343 = dot( p43, p43 ); 5150 float d2121 = dot( p21, p21 ); 5151 5152 float denom = d2121 * d4343 - d4321 * d4321; 5153 5154 float numer = d1343 * d4321 - d1321 * d4343; 5155 5156 mua = numer / denom; 5157 mua = clamp( mua, 0.0, 1.0 ); 5158 mub = ( d1343 + d4321 * ( mua ) ) / d4343; 5159 mub = clamp( mub, 0.0, 1.0 ); 5160 5161 return vec2( mua, mub ); 5162 5163 } 5164 5165 void main() { 5166 5167 float alpha = opacity; 5168 vec4 diffuseColor = vec4( diffuse, alpha ); 5169 5170 #include <clipping_planes_fragment> 5171 5172 #ifdef USE_DASH 5173 5174 if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps 5175 5176 if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX 5177 5178 #endif 5179 5180 #ifdef WORLD_UNITS 5181 5182 // Find the closest points on the view ray and the line segment 5183 vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; 5184 vec3 lineDir = worldEnd - worldStart; 5185 vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); 5186 5187 vec3 p1 = worldStart + lineDir * params.x; 5188 vec3 p2 = rayEnd * params.y; 5189 vec3 delta = p1 - p2; 5190 float len = length( delta ); 5191 float norm = len / linewidth; 5192 5193 #ifndef USE_DASH 5194 5195 #ifdef USE_ALPHA_TO_COVERAGE 5196 5197 float dnorm = fwidth( norm ); 5198 alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); 5199 5200 #else 5201 5202 if ( norm > 0.5 ) { 5203 5204 discard; 5205 5206 } 5207 5208 #endif 5209 5210 #endif 5211 5212 #else 5213 5214 #ifdef USE_ALPHA_TO_COVERAGE 5215 5216 // artifacts appear on some hardware if a derivative is taken within a conditional 5217 float a = vUv.x; 5218 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 5219 float len2 = a * a + b * b; 5220 float dlen = fwidth( len2 ); 5221 5222 if ( abs( vUv.y ) > 1.0 ) { 5223 5224 alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); 5225 5226 } 5227 5228 #else 5229 5230 if ( abs( vUv.y ) > 1.0 ) { 5231 5232 float a = vUv.x; 5233 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 5234 float len2 = a * a + b * b; 5235 5236 if ( len2 > 1.0 ) discard; 5237 5238 } 5239 5240 #endif 5241 5242 #endif 5243 5244 #include <logdepthbuf_fragment> 5245 #include <color_fragment> 5246 5247 gl_FragColor = vec4( diffuseColor.rgb, alpha ); 5248 5249 #include <tonemapping_fragment> 5250 #include <colorspace_fragment> 5251 #include <fog_fragment> 5252 #include <premultiplied_alpha_fragment> 5253 5254 } 5255 `};class Aq extends Nc{constructor(e){super({type:"LineMaterial",uniforms:K8.clone(Ou.line.uniforms),vertexShader:Ou.line.vertexShader,fragmentShader:Ou.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0!==this.worldUnits&&(this.needsUpdate=!0),e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}
5255const QL=new Rr,fee=new Ve,pee=new Ve,Cl=new Rr,Nl=new Rr,Fp=new Rr,KL=new Ve,ZL=new kr,kl=new S8e,mee=new Ve,bN=new dg,wN=new H1,Up=new Rr;let n0,zv;function gee(n,e,t){return Up.set(0,0,-e,1).applyMatrix4(n.projectionMatrix),Up.multiplyScalar(1/Up.w),Up.x=zv/t.width,Up.y=zv/t.height,Up.applyMatrix4(n.projectionMatrixInverse),Up.multiplyScalar(1/Up.w),Math.abs(Math.max(Up.x,Up.y))}function SZe(n,e){const t=n.matrixWorld,r=n.geometry,i=r.attributes.instanceStart,s=r.attributes.instanceEnd,a=Math.min(r.instanceCount,i.count);for(let o=0,l=a;o<l;o++){kl.start.fromBufferAttribute(i,o),kl.end.fromBufferAttribute(s,o),kl.applyMatrix4(t);const u=new Ve,d=new Ve;n0.distanceSqToSegment(kl.start,kl.end,d,u),d.distanceTo(u)<zv*.5&&e.push({point:d,pointOnLine:u,distance:n0.origin.distanceTo(d),object:n,face:null,faceIndex:o,uv:null,uv1:null})}}function TZe(n,e,t){const r=e.projectionMatrix,s=n.material.resolution,a=n.matrixWorld,o=n.geometry,l=o.attributes.instanceStart,u=o.attributes.instanceEnd,d=Math.min(o.instanceCount,l.count),h=-e.near;n0.at(1,Fp),Fp.w=1,Fp.applyMatrix4(e.matrixWorldInverse),Fp.applyMatrix4(r),Fp.multiplyScalar(1/Fp.w),Fp.x*=s.x/2,Fp.y*=s.y/2,Fp.z=0,KL.copy(Fp),ZL.multiplyMatrices(e.matrixWorldInverse,a);for(let f=0,p=d;f<p;f++){if(Cl.fromBufferAttribute(l,f),Nl.fromBufferAttribute(u,f),Cl.w=1,Nl.w=1,Cl.applyMatrix4(ZL),Nl.applyMatrix4(ZL),Cl.z>h&&Nl.z>h)continue;if(Cl.z>h){const M=Cl.z-Nl.z,T=(Cl.z-h)/M;Cl.lerp(Nl,T)}else if(Nl.z>h){const M=Nl.z-Cl.z,T=(Nl.z-h)/M;Nl.lerp(Cl,T)}Cl.applyMatrix4(r),Nl.applyMatrix4(r),Cl.multiplyScalar(1/Cl.w),Nl.multiplyScalar(1/Nl.w),Cl.x*=s.x/2,Cl.y*=s.y/2,Nl.x*=s.x/2,Nl.y*=s.y/2,kl.start.copy(Cl),kl.start.z=0,kl.end.copy(Nl),kl.end.z=0;const A=kl.closestPointToPointParameter(KL,!0);kl.at(A,mee);const x=zw.lerp(Cl.z,Nl.z,A),b=x>=-1&&x<=1,_=KL.distanceTo(mee)<zv*.5;if(b&&_){kl.start.fromBufferAttribute(l,f),kl.end.fromBufferAttribute(u,f),kl.start.applyMatrix4(a),kl.end.applyMatrix4(a);const M=new Ve,T=new Ve;n0.distanceSqToSegment(kl.start,kl.end,T,M),t.push({point:T,pointOnLine:M,distance:n0.origin.distanceTo(T),object:n,face:null,faceIndex:f,uv:null,uv1:null})}}}class EZe extends ns{constructor(e=new $me,t=new Aq({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let a=0,o=0,l=t.count;a<l;a++,o+=2)fee.fromBufferAttribute(t,a),pee.fromBufferAttribute(r,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+fee.distanceTo(pee);const s=new UM(i,2,1);return e.setAttribute("instanceDistanceStart",new l0(s,1,0)),e.setAttribute("instanceDistanceEnd",new l0(s,1,1)),this}raycast(e,t){const r=this.material.worldUnits,i=e.camera;if(i===null&&!r&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'),r===!1&&(this.material.resolution.x===0||this.material.resolution.y===0))return;const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;n0=e.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;zv=l.linewidth+s,o.boundingSphere===null&&o.computeBoundingSphere(),wN.copy(o.boundingSphere).applyMatrix4(a);let u;if(r)u=zv*.5;else{const h=Math.max(i.near,wN.distanceToPoint(n0.origin));u=gee(i,h,l.resolution)}if(wN.radius+=u,n0.intersectsSphere(wN)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),bN.copy(o.boundingBox).applyMatrix4(a);let d;if(r)d=zv*.5;else{const h=Math.max(i.near,bN.distanceToPoint(n0.origin));d=gee(i,h,l.resolution)}bN.expandByScalar(d),n0.intersectsBox(bN)!==!1&&(r?SZe(this,t):TZe(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(QL),this.material.uniforms.resolution.value.set(QL.z,QL.w))}}class Hme extends $me{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,r=new Float32Array(2*t);for(let i=0;i<t;i+=3)r[2*i]=e[i],r[2*i+1]=e[i+1],r[2*i+2]=e[i+2],r[2*i+3]=e[i+3],r[2*i+4]=e[i+4],r[2*i+5]=e[i+5];return super.setPositions(r),this}setColors(e){const t=e.length-3,r=new Float32Array(2*t);for(let i=0;i<t;i+=3)r[2*i]=e[i],r[2*i+1]=e[i+1],r[2*i+2]=e[i+2],r[2*i+3]=e[i+3],r[2*i+4]=e[i+4],r[2*i+5]=e[i+5];return super.setColors(r),this}setFromPoints(e){const t=e.length-1,r=new Float32Array(6*t);for(let i=0;i<t;i++)r[6*i]=e[i].x,r[6*i+1]=e[i].y,r[6*i+2]=e[i].z||0,r[6*i+3]=e[i+1].x,r[6*i+4]=e[i+1].y,r[6*i+5]=e[i+1].z||0;return super.setPositions(r),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}
5255class CZe extends EZe{constructor(e=new Hme,t=new Aq({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class Wme{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,r="ltr"){const i=[],s=NZe(e,t,this.data,r);for(let a=0,o=s.length;a<o;a++)i.push(...s[a].toShapes());return i}}function NZe(n,e,t,r){const i=Array.from(n),s=e/t.resolution,a=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,o=[];let l=0,u=0;(r=="rtl"||r=="tb")&&i.reverse();for(let d=0;d<i.length;d++){const h=i[d];if(h===` 5256`)l=0,u-=a;else{const f=MZe(h,s,l,u,t);r=="tb"?(l=0,u+=t.ascender*s):l+=f.offsetX,o.push(f.path)}}return o}function MZe(n,e,t,r,i){const s=i.glyphs[n]||i.glyphs["?"];if(!s){console.error('THREE.Font: character "'+n+'" does not exists in font family '+i.familyName+".");return}const a=new T8e;let o,l,u,d,h,f,p,g;if(s.o){const A=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let x=0,b=A.length;x<b;)switch(A[x++]){case"m":o=A[x++]*e+t,l=A[x++]*e+r,a.moveTo(o,l);break;case"l":o=A[x++]*e+t,l=A[x++]*e+r,a.lineTo(o,l);break;case"q":u=A[x++]*e+t,d=A[x++]*e+r,h=A[x++]*e+t,f=A[x++]*e+r,a.quadraticCurveTo(h,f,u,d);break;case"b":u=A[x++]*e+t,d=A[x++]*e+r,h=A[x++]*e+t,f=A[x++]*e+r,p=A[x++]*e+t,g=A[x++]*e+r,a.bezierCurveTo(h,f,p,g,u,d);break}}return{offsetX:s.ha*e,path:a}}class $k extends tz{constructor(e,t={}){const r=t.font;if(r===void 0)super();else{const i=r.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(i,t)}this.type="TextGeometry"}toJSON(){return super.toJSON()}static fromJSON(e){const t=e.options;return t.font=new Wme(t.font.data),new $k(t.text,t)}}function lU(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function kZe(n){if(Array.isArray(n))return n}function RZe(n){if(Array.isArray(n))return lU(n)}function Xme(n,e,t){if(typeof n=="function"?n===e:n.has(e))return arguments.length<3?e:t;throw new TypeError("Private element is not present on this object")}function PZe(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Aee(n,e,t,r,i,s,a){try{var o=n[s](a),l=o.value}catch(u){return void t(u)}o.done?e(l):Promise.resolve(l).then(r,i)}function LZe(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function a(l){Aee(s,r,i,a,o,"next",l)}function o(l){Aee(s,r,i,a,o,"throw",l)}a(void 0)})}}function UR(n,e,t){return e=t_(e),zZe(n,vq()?Reflect.construct(e,t||[],t_(n).constructor):e.apply(n,t))}function OZe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function BR(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function eS(n,e){return n.get(Xme(n,e))}function JL(n,e,t){OZe(n,e),e.set(n,t)}function eO(n,e,t){return n.set(Xme(n,e),t),t}function xq(n,e,t){if(vq())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(n.bind.apply(n,r));return i}function DZe(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Yme(r.key),r)}}function VR(n,e,t){return e&&DZe(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function xl(n,e,t){return(e=Yme(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cU(){return cU=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(n,e,t){var r=GZe(n,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?n:t):i.value}},cU.apply(null,arguments)}function t_(n){return t_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},t_(n)}function zR(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&dU(n,e)}function vq(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vq=function(){return!!n})()}function jZe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function IZe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}
5256finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function FZe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 5257In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UZe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 5258In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xee(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Es(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xee(Object(t),!0).forEach(function(r){xl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xee(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function BZe(n,e){if(n==null)return{};var t,r,i=VZe(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function VZe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function zZe(n,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PZe(n)}function uU(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var n,e,t=typeof Symbol=="function"?Symbol:{},r=t.iterator||"@@iterator",i=t.toStringTag||"@@toStringTag";function s(p,g,A,x){var b=g&&g.prototype instanceof o?g:o,_=Object.create(b.prototype);return Nd(_,"_invoke",(function(M,T,L){var D,P,O,F=0,U=L||[],B=!1,z={p:0,n:0,v:n,a:H,f:H.bind(n,4),d:function(X,W){return D=X,P=0,O=n,z.n=W,a}};function H(X,W){for(P=X,O=W,e=0;!B&&F&&!J&&e<U.length;e++){var J,ee=U[e],ae=z.p,le=ee[2];X>3?(J=le===W)&&(O=ee[(P=ee[4])?5:(P=3,3)],ee[4]=ee[5]=n):ee[0]<=ae&&((J=X<2&&ae<ee[1])?(P=0,z.v=W,z.n=ee[1]):ae<le&&(J=X<3||ee[0]>W||W>le)&&(ee[4]=X,ee[5]=W,z.n=le,P=0))}if(J||X>1)return a;throw B=!0,W}return function(X,W,J){if(F>1)throw TypeError("Generator is already running");for(B&&W===1&&H(W,J),P=W,O=J;(e=P<2?n:O)||!B;){D||(P?P<3?(P>1&&(z.n=-1),H(P,O)):z.n=O:z.v=O);try{if(F=2,D){if(P||(X="next"),e=D[X]){if(!(e=e.call(D,O)))throw TypeError("iterator result is not an object");if(!e.done)return e;O=e.value,P<2&&(P=0)}else P===1&&(e=D.return)&&e.call(D),P<2&&(O=TypeError("The iterator does not provide a '"+X+"' method"),P=1);D=n}else if((e=(B=z.n<0)?O:M.call(T,z))!==a)break}catch(ee){D=n,P=1,O=ee}finally{F=1}}return{value:e,done:B}}})(p,A,x),!0),_}var a={};function o(){}function l(){}function u(){}e=Object.getPrototypeOf;var d=[][r]?e(e([][r]())):(Nd(e={},r,function(){return this}),e),h=u.prototype=o.prototype=Object.create(d);function f(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,u):(p.__proto__=u,Nd(p,i,"GeneratorFunction")),p.prototype=Object.create(h),p}return l.prototype=u,Nd(h,"constructor",u),Nd(u,"constructor",l),l.displayName="GeneratorFunction",Nd(u,i,"GeneratorFunction"),Nd(h),Nd(h,i,"Generator"),Nd(h,r,function(){return this}),Nd(h,"toString",function(){return"[object Generator]"}),(uU=function(){return{w:s,m:f}})()}function Nd(n,e,t,r){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Nd=function(s,a,o,l){function u(d,h){Nd(s,d,function(f){return this._invoke(d,h,f)})}a?i?i(s,a,{value:o,enumerable:!l,configurable:!l,writable:!l}):s[a]=o:(u("next",0),u("throw",1),u("return",2))},Nd(n,e,t,r)}function dU(n,e){return dU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},dU(n,e)}function ma(n,e){return kZe(n)||IZe(n,e)||Qme(n,e)||FZe()}function GZe(n,e){for(;!{}.hasOwnProperty.call(n,e)&&(n=t_(n))!==null;);return n}function tO(n,e,t,r){var i=cU(t_(n.prototype),e,t);return typeof i=="function"?function(s){return i.apply(t,s)}:i}function Ds(n){return RZe(n)||jZe(n)||Qme(n)||UZe()}function qZe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Yme(n){var e=qZe(n,"string");return typeof e=="symbol"?e:e+""}function Qme(n,e){if(n){if(typeof n=="string")return lU(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lU(n,e):void 0}}var Kme=function(e){e instanceof Array?e.forEach(Kme):(e.map&&e.map.dispose(),e.dispose())},ZA=function(e){e.geometry&&e.geometry.dispose(),e.material&&Kme(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEac
vendor: 4,839 bytes, lines 5258-5301
5258h(ZA)},Ba=function(e){if(e&&e.children)for(;e.children.length;){var t=e.children[0];e.remove(t),ZA(t)}};function Au(n,e){var t=new e;return{linkProp:function(i){return{default:t[i](),onChange:function(a,o){o[n][i](a)},triggerUpdate:!1}},linkMethod:function(i){return function(s){for(var a=s[n],o=arguments.length,l=new Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];var d=a[i].apply(a,l);return d===a?this:d}}}}var sa=100;function vee(){return sa}function Yh(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=(90-n)*Math.PI/180,i=(90-e)*Math.PI/180,s=sa*(1+t),a=Math.sin(r);return{x:s*a*Math.cos(i),y:s*Math.cos(r),z:s*a*Math.sin(i)}}function Zme(n){var e=n.x,t=n.y,r=n.z,i=Math.sqrt(e*e+t*t+r*r),s=Math.acos(t/i),a=Math.atan2(r,e);return{lat:90-s*180/Math.PI,lng:90-a*180/Math.PI-(a<-Math.PI/2?360:0),altitude:i/sa-1}}function tv(n){return n*Math.PI/180}var z5=window.THREE?window.THREE:{BackSide:us,BufferAttribute:Ea,Color:tr,Mesh:ns,ShaderMaterial:Nc},$Ze=` 5259uniform float hollowRadius; 5260 5261varying vec3 vVertexWorldPosition; 5262varying vec3 vVertexNormal; 5263varying float vCameraDistanceToObjCenter; 5264varying float vVertexAngularDistanceToHollowRadius; 5265 5266void main() { 5267 vVertexNormal = normalize(normalMatrix * normal); 5268 vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz; 5269 5270 vec4 objCenterViewPosition = modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0); 5271 vCameraDistanceToObjCenter = length(objCenterViewPosition); 5272 5273 float edgeAngle = atan(hollowRadius / vCameraDistanceToObjCenter); 5274 float vertexAngle = acos(dot(normalize(modelViewMatrix * vec4(position, 1.0)), normalize(objCenterViewPosition))); 5275 vVertexAngularDistanceToHollowRadius = vertexAngle - edgeAngle; 5276 5277 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 5278}`,HZe=` 5279uniform vec3 color; 5280uniform float coefficient; 5281uniform float power; 5282uniform float hollowRadius; 5283 5284varying vec3 vVertexNormal; 5285varying vec3 vVertexWorldPosition; 5286varying float vCameraDistanceToObjCenter; 5287varying float vVertexAngularDistanceToHollowRadius; 5288 5289void main() { 5290 if (vCameraDistanceToObjCenter < hollowRadius) discard; // inside the hollowRadius 5291 if (vVertexAngularDistanceToHollowRadius < 0.0) discard; // frag position is within the hollow radius 5292 5293 vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition; 5294 vec3 viewCameraToVertex = (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz; 5295 viewCameraToVertex = normalize(viewCameraToVertex); 5296 float intensity = pow( 5297 coefficient + dot(vVertexNormal, viewCameraToVertex), 5298 power 5299 ); 5300 gl_FragColor = vec4(color, intensity); 5301}`;function WZe(n,e,t,r){return new z5.ShaderMaterial({depthWrite:!1,transparent:!0,vertexShader:$Ze,fragmentShader:HZe,uniforms:{coefficient:{value:n},color:{value:new z5.Color(e)},power:{value:t},hollowRadius:{value:r}}})}function XZe(n,e){for(var t=n.clone(),r=new Float32Array(n.attributes.position.count*3),i=0,s=r.length;i<s;i++){var a=n.attributes.normal.array[i],o=n.attributes.position.array[i];r[i]=o+a*e}return t.setAttribute("position",new z5.BufferAttribute(r,3)),t}var YZe=(function(n){function e(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.color,a=s===void 0?"gold":s,o=i.size,l=o===void 0?2:o,u=i.coefficient,d=u===void 0?.5:u,h=i.power,f=h===void 0?1:h,p=i.hollowRadius,g=p===void 0?0:p,A=i.backside,x=A===void 0?!0:A;BR(this,e),r=UR(this,e);var b=XZe(t,l),_=WZe(d,a,f,g);return x&&(_.side=z5.BackSide),r.geometry=b,r.material=_,r}return zR(e,n),VR(e)})(z5.Mesh),Bp=window.THREE?window.THREE:{Color:tr,Group:Bu,LineBasicMaterial:w_,LineSegments:Xce,Mesh:ns,MeshPhongMaterial:uue,SphereGeometry:F0,SRGBColorSpace:Pl,TextureLoader:iz},Jme=Wo({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(e,t){t.globeGroup.visible=!!e},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(e,t){t.graticulesObj.visible=!!e},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(e,t){t.atmosphereObj&&(t.atmosphereObj.visible=!!e)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},globeCurvatureResolution:{default:4},globeTileEngineUrl:{onChange:function(e,t){t.tileEngine.tileUrl=e}},globeTileEngineMaxLevel:{default:17,onChange:function(e,t){t.tileEngine.maxLevel=e},triggerUpdate:!1},updatePov:{onChange:function(e,t){t.tileEngine.updatePov(e)},triggerUpdate:!1},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(e,t){return t!==void 0?(e.globeObj.material=t||e.defaultGlobeMaterial,this):e.globeObj.material},globeTileEngineClearCache:function(e){e.tileEngine.clearTiles()},_destructor:function(e){ZA(e.globeObj),ZA(e.tileEngine),ZA(e.graticulesObj)}},stateInit:function(){var e=new Bp.MeshPhongMaterial({color:0}),t=new Bp.Mesh(void 0,e);t.rotation.y=-Math.PI/2;var r=new zje(sa),i=new Bp.Group;
5301i.__globeObjType="globe",i.add(t),i.add(r);var s=new Bp.LineSegments(new bde(aje(),sa,2),new Bp.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1}));return{globeGroup:i,globeObj:t,graticulesObj:s,defaultGlobeMaterial:e,tileEngine:r}},init:function(e,t){Ba(e),t.scene=e,t.scene.add(t.globeGroup),t.scene.add(t.graticulesObj),t.ready=!1},update:function(e,t){var r=e.globeObj.material;if(e.tileEngine.visible=!(e.globeObj.visible=!e.globeTileEngineUrl),t.hasOwnProperty("globeCurvatureResolution")){var i;(i=e.globeObj.geometry)===null||i===void 0||i.dispose();var s=Math.max(4,Math.round(360/e.globeCurvatureResolution));e.globeObj.geometry=new Bp.SphereGeometry(sa,s,s/2),e.tileEngine.curvatureResolution=e.globeCurvatureResolution}if(t.hasOwnProperty("globeImageUrl")&&(e.globeImageUrl?new Bp.TextureLoader().load(e.globeImageUrl,function(o){var l;o.colorSpace=Bp.SRGBColorSpace,(l=r.map)===null||l===void 0||l.dispose(),r.map=o,r.color=null,r.needsUpdate=!0,!e.ready&&(e.ready=!0)&&setTimeout(e.onReady)}):!r.color&&(r.color=new Bp.Color(0))),t.hasOwnProperty("bumpImageUrl")&&(e.bumpImageUrl?e.bumpImageUrl&&new Bp.TextureLoader().load(e.bumpImageUrl,function(o){var l;(l=r.bumpMap)===null||l===void 0||l.dispose(),r.bumpMap=o,r.needsUpdate=!0}):(r.bumpMap=null,r.needsUpdate=!0)),(t.hasOwnProperty("atmosphereColor")||t.hasOwnProperty("atmosphereAltitude"))&&(e.atmosphereObj&&(e.scene.remove(e.atmosphereObj),ZA(e.atmosphereObj)),e.atmosphereColor&&e.atmosphereAltitude)){var a=e.atmosphereObj=new YZe(e.globeObj.geometry,{color:e.atmosphereColor,size:sa*e.atmosphereAltitude,hollowRadius:sa,coefficient:.1,power:3.5});a.visible=!!e.showAtmosphere,a.__globeObjType="atmosphere",e.scene.add(a)}!e.ready&&(!e.globeImageUrl||e.globeTileEngineUrl)&&(e.ready=!0,e.onReady())}}),D0=function(e){return isNaN(e)?parseInt(Sr(e).toHex(),16):e},Jf=function(e){return e&&isNaN(e)?iy(e).opacity:1},O1=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i,s=1,a=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(e.trim().toLowerCase());if(a){var o=a.slice(1),l=ma(o,4),u=l[0],d=l[1],h=l[2],f=l[3];i=new tr("rgb(".concat(+u,",").concat(+d,",").concat(+h,")")),s=Math.min(+f,1)}else i=new tr(e);r&&i.convertLinearToSRGB();var p=i.toArray();return t?[].concat(Ds(p),[s]):p};function QZe(n,e,t){return n.opacity=e,n.transparent=e<1,n.depthWrite=e>=1,n}var yee=window.THREE?window.THREE:{BufferAttribute:Ea};function j0(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Float32Array;if(e===1)return new yee.BufferAttribute(new t(n),e);for(var r=new yee.BufferAttribute(new t(n.length*e),e),i=0,s=n.length;i<s;i++)r.set(n[i],i*e);return r}function KZe(n){for(var e=n.itemSize,t=[],r=0;r<n.count;r++)t.push(n.array.slice(r*e,(r+1)*e));return t}var nO=new WeakMap,_N=new WeakMap,SN=new WeakMap,rd=(function(n){function e(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.dataBindAttr,a=s===void 0?"__data":s,o=i.objBindAttr,l=o===void 0?"__threeObj":o,u=i.removeDelay,d=u===void 0?0:u;return BR(this,e),r=UR(this,e),xl(r,"scene",void 0),JL(r,nO,void 0),JL(r,_N,void 0),JL(r,SN,void 0),r.scene=t,eO(nO,r,a),eO(_N,r,l),eO(SN,r,d),r.onRemoveObj(function(){}),r}return zR(e,n),VR(e,[{key:"onCreateObj",value:function(r){var i=this;return tO(e,"onCreateObj",this)([function(s){var a=r(s);return s[eS(_N,i)]=a,a[eS(nO,i)]=s,i.scene.add(a),a}]),this}},{key:"onRemoveObj",value:function(r){var i=this;return tO(e,"onRemoveObj",this)([function(s,a){var o=tO(e,"getData",i)([s]);r(s,a);var l=function(){i.scene.remove(s),ZA(s),delete o[eS(_N,i)]};eS(SN,i)?setTimeout(l,eS(SN,i)):l()}]),this}}])})(vFe),Sf=window.THREE?window.THREE:{BufferGeometry:ds,CylinderGeometry:Q8,Matrix4:kr,Mesh:ns,MeshLambertMaterial:hg,Object3D:ga,Vector3:Ve},bee=Object.assign({},yz),wee=bee.BufferGeometryUtils||bee,ege=Wo({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i,t.dataMapper=new rd(e,{objBindAttr:"__threeObjPoint"})},update:function(e,t){var r=pn(e.pointLat),i=pn(e.pointLng),s=pn(e.pointAltitude),a=pn(e.pointRadius),o=pn(e.pointColor),l=new Sf.CylinderGeometry(1,1,1,e.pointResolution);l.applyMatrix4(new Sf.Matrix4().makeRotationX(Math.PI/2)),l.applyMatrix4(new Sf.Matrix4().makeTranslation(0,0,-.5));var u=2*Math.PI*sa/360,d={};if(!e.pointsMerge&&t.hasOwnProperty("pointsMerge")&&Ba(e.scene),e.dataMapper.scene=e.pointsMerge?new Sf.Object3D:e.scene,e.dataMapper.onCreateObj(p).onUpdateObj(g).digest(e.pointsData),e.pointsMerge){var h=e.pointsData.length?(wee.mergeGeometries||wee.mergeBufferGeometries)(e.pointsData.map(function(A){var x=e.dataMapper.getObj(A),b=x.geometry.clone();
vendor: 4,804 bytes, lines 5301-5382
5301x.updateMatrix(),b.applyMatrix4(x.matrix);var _=O1(o(A));return b.setAttribute("color",j0(Array(b.getAttribute("position").count).fill(_),4)),b})):new Sf.BufferGeometry,f=new Sf.Mesh(h,new Sf.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));f.__globeObjType="points",f.__data=e.pointsData,e.dataMapper.clear(),Ba(e.scene),e.scene.add(f)}function p(){var A=new Sf.Mesh(l);return A.__globeObjType="point",A}function g(A,x){var b=function(O){var F=A.__currentTargetD=O,U=F.r,B=F.alt,z=F.lat,H=F.lng;Object.assign(A.position,Yh(z,H));var X=e.pointsMerge?new Sf.Vector3(0,0,0):e.scene.localToWorld(new Sf.Vector3(0,0,0));A.lookAt(X),A.scale.x=A.scale.y=Math.min(30,U)*u,A.scale.z=Math.max(B*sa,.1)},_={alt:+s(x),r:+a(x),lat:+r(x),lng:+i(x)},M=A.__currentTargetD||Object.assign({},_,{alt:-.001});if(Object.keys(_).some(function(P){return M[P]!==_[P]})&&(e.pointsMerge||!e.pointsTransitionDuration||e.pointsTransitionDuration<0?b(_):e.tweenGroup.add(new Mc(M).to(_,e.pointsTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(b).onComplete(function(){e.tweenGroup.remove(this)}).start())),!e.pointsMerge){var T=o(x),L=T?Jf(T):0,D=!!L;A.visible=D,D&&(d.hasOwnProperty(T)||(d[T]=new Sf.MeshLambertMaterial({color:D0(T),transparent:L<1,opacity:L})),A.material=d[T])}}}}),tge=function(){return{uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:` 5302 `.concat(Zr.common,` 5303 `).concat(Zr.logdepthbuf_pars_vertex,` 5304 5305 uniform float dashTranslate; 5306 5307 attribute vec4 color; 5308 varying vec4 vColor; 5309 5310 attribute float relDistance; 5311 varying float vRelDistance; 5312 5313 void main() { 5314 // pass through colors and distances 5315 vColor = color; 5316 vRelDistance = relDistance + dashTranslate; 5317 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 5318 5319 `).concat(Zr.logdepthbuf_vertex,` 5320 } 5321 `),fragmentShader:` 5322 `.concat(Zr.logdepthbuf_pars_fragment,` 5323 5324 uniform float dashOffset; 5325 uniform float dashSize; 5326 uniform float gapSize; 5327 5328 varying vec4 vColor; 5329 varying float vRelDistance; 5330 5331 void main() { 5332 // ignore pixels in the gap 5333 if (vRelDistance < dashOffset) discard; 5334 if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard; 5335 5336 // set px color: [r, g, b, a], interpolated between vertices 5337 gl_FragColor = vColor; 5338 5339 `).concat(Zr.logdepthbuf_fragment,` 5340 } 5341 `)}},hU=function(e){return e.uniforms.uSurfaceRadius={type:"float",value:0},e.vertexShader=(`attribute float surfaceRadius; 5342varying float vSurfaceRadius; 5343varying vec3 vPos; 5344`+e.vertexShader).replace("void main() {",["void main() {","vSurfaceRadius = surfaceRadius;","vPos = position;"].join(` 5345`)),e.fragmentShader=(`uniform float uSurfaceRadius; 5346varying float vSurfaceRadius; 5347varying vec3 vPos; 5348`+e.fragmentShader).replace("void main() {",["void main() {","if (length(vPos) < max(uSurfaceRadius, vSurfaceRadius)) discard;"].join(` 5349`)),e},ZZe=function(e){return e.vertexShader=` 5350 attribute float r; 5351 5352 const float PI = 3.1415926535897932384626433832795; 5353 float toRad(in float a) { 5354 return a * PI / 180.0; 5355 } 5356 5357 vec3 Polar2Cartesian(in vec3 c) { // [lat, lng, r] 5358 float phi = toRad(90.0 - c.x); 5359 float theta = toRad(90.0 - c.y); 5360 float r = c.z; 5361 return vec3( // x,y,z 5362 r * sin(phi) * cos(theta), 5363 r * cos(phi), 5364 r * sin(phi) * sin(theta) 5365 ); 5366 } 5367 5368 vec2 Cartesian2Polar(in vec3 p) { 5369 float r = sqrt(p.x * p.x + p.y * p.y + p.z * p.z); 5370 float phi = acos(p.y / r); 5371 float theta = atan(p.z, p.x); 5372 return vec2( // lat,lng 5373 90.0 - phi * 180.0 / PI, 5374 90.0 - theta * 180.0 / PI - (theta < -PI / 2.0 ? 360.0 : 0.0) 5375 ); 5376 } 5377 `.concat(e.vertexShader.replace("}",` 5378 vec3 pos = Polar2Cartesian(vec3(Cartesian2Polar(position), r)); 5379 gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0); 5380 } 5381 `),` 5382 `),e},yq=function(e,t){return e.onBeforeCompile=function(r){e.userData.shader=t(r)},e},JZe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(i){return i};if(e.userData.shader)t(e.userData.shader.uniforms);else{var r=e.onBeforeCompile;e.onBeforeCompile=function(i){r(i),t(i.uniforms)}}},eJe=["stroke"],Tf=window.THREE?window.THREE:{BufferGeometry:ds,CubicBezierCurve3:Zce,Curve:up,Group:Bu,Line:X8,Mesh:ns,NormalBlending:dl,ShaderMaterial:Nc,TubeGeometry:nz,Vector3:Ve},tJe=Yw.default||Yw,nge=Wo({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcStartAltitude:{default:0},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcEndAltitude:{default:0},arcColor:{default:function(){return"#ffffaa"}}
5382,arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.pause()},resumeAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.resume()},_destructor:function(e){var t;e.sharedMaterial.dispose(),(t=e.ticker)===null||t===void 0||t.dispose()}},stateInit:function(e){var t=e.tweenGroup;return{tweenGroup:t,ticker:new tJe,sharedMaterial:new Tf.ShaderMaterial(Es(Es({},tge()),{},{transparent:!0,blending:Tf.NormalBlending}))}},init:function(e,t){Ba(e),t.scene=e,t.dataMapper=new rd(e,{objBindAttr:"__threeObjArc"}).onCreateObj(function(){var r=new Tf.Group;return r.__globeObjType="arc",r}),t.ticker.onTick.add(function(r,i){t.dataMapper.entries().map(function(s){var a=ma(s,2),o=a[1];return o}
vendor: 4,490 bytes, line 5382
5382).filter(function(s){return s.children.length&&s.children[0].material&&s.children[0].__dashAnimateStep}).forEach(function(s){var a=s.children[0],o=a.__dashAnimateStep*i,l=a.material.uniforms.dashTranslate.value%1e9;a.material.uniforms.dashTranslate.value=l+o})})},update:function(e){var t=pn(e.arcStartLat),r=pn(e.arcStartLng),i=pn(e.arcStartAltitude),s=pn(e.arcEndLat),a=pn(e.arcEndLng),o=pn(e.arcEndAltitude),l=pn(e.arcAltitude),u=pn(e.arcAltitudeAutoScale),d=pn(e.arcStroke),h=pn(e.arcColor),f=pn(e.arcDashLength),p=pn(e.arcDashGap),g=pn(e.arcDashInitialGap),A=pn(e.arcDashAnimateTime);e.dataMapper.onUpdateObj(function(M,T){var L=d(T),D=L!=null;if(!M.children.length||D!==(M.children[0].type==="Mesh")){Ba(M);var P=D?new Tf.Mesh:new Tf.Line(new Tf.BufferGeometry);P.material=e.sharedMaterial.clone(),M.add(P)}var O=M.children[0];Object.assign(O.material.uniforms,{dashSize:{value:f(T)},gapSize:{value:p(T)},dashOffset:{value:g(T)}});var F=A(T);O.__dashAnimateStep=F>0?1e3/F:0;var U=b(h(T),e.arcCurveResolution,D?e.arcCircularResolution+1:1),B=_(e.arcCurveResolution,D?e.arcCircularResolution+1:1,!0);O.geometry.setAttribute("color",U),O.geometry.setAttribute("relDistance",B);var z=function(J){var ee=M.__currentTargetD=J,ae=ee.stroke,le=BZe(ee,eJe),Z=x(le);D?(O.geometry&&O.geometry.dispose(),O.geometry=new Tf.TubeGeometry(Z,e.arcCurveResolution,ae/2,e.arcCircularResolution),O.geometry.setAttribute("color",U),O.geometry.setAttribute("relDistance",B)):O.geometry.setFromPoints(Z.getPoints(e.arcCurveResolution))},H={stroke:L,alt:l(T),altAutoScale:+u(T),startLat:+t(T),startLng:+r(T),startAlt:+i(T),endLat:+s(T),endLng:+a(T),endAlt:+o(T)},X=M.__currentTargetD||Object.assign({},H,{altAutoScale:-.001});Object.keys(H).some(function(W){return X[W]!==H[W]})&&(!e.arcsTransitionDuration||e.arcsTransitionDuration<0?z(H):e.tweenGroup.add(new Mc(X).to(H,e.arcsTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(z).onComplete(function(){e.tweenGroup.remove(this)}).start()))}).digest(e.arcsData);function x(M){var T=M.alt,L=M.altAutoScale,D=M.startLat,P=M.startLng,O=M.startAlt,F=M.endLat,U=M.endLng,B=M.endAlt,z=function(te){var ve=ma(te,3),we=ve[0],Ue=ve[1],ze=ve[2],yt=Yh(Ue,we,ze),mt=yt.x,bt=yt.y,dt=yt.z;return new Tf.Vector3(mt,bt,dt)},H=[P,D],X=[U,F],W=T;if(W==null&&(W=M1(H,X)/2*L+Math.max(O,B)),W||O||B){var J=mz(H,X),ee=function(te,ve){return ve+(ve-te)*(te<ve?.5:.25)},ae=[.25,.75].map(function(Ae){return[].concat(Ds(J(Ae)),[ee(Ae<.5?O:B,W)])}),le=ma(ae,2),Z=le[0],Y=le[1],re=xq(Tf.CubicBezierCurve3,Ds([[].concat(H,[O]),Z,Y,[].concat(X,[B])].map(z)));return re}else{var _e=.001;return Ee.apply(void 0,Ds([[].concat(H,[_e]),[].concat(X,[_e])].map(z)))}function Ee(Ae,te){var ve=Ae.angleTo(te),we=ve===0?function(){return Ae.clone()}:function(ze){return new Tf.Vector3().addVectors(Ae.clone().multiplyScalar(Math.sin((1-ze)*ve)),te.clone().multiplyScalar(Math.sin(ze*ve))).divideScalar(Math.sin(ve))},Ue=new Tf.Curve;return Ue.getPoint=we,Ue}}function b(M,T){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,D=T+1,P;if(M instanceof Array||M instanceof Function){var O=M instanceof Array?tg().domain(M.map(function(W,J){return J/(M.length-1)})).range(M):M;P=function(J){return O1(O(J),!0,!0)}}else{var F=O1(M,!0,!0);P=function(){return F}}for(var U=[],B=0,z=D;B<z;B++)for(var H=P(B/(z-1)),X=0;X<L;X++)U.push(H);return j0(U,4)}function _(M){for(var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,D=M+1,P=[],O=0,F=D;O<F;O++)for(var U=O/(F-1),B=0;B<T;B++)P.push(U);return L&&P.reverse(),j0(P,1)}}}),uA=window.THREE?window.THREE:{BufferGeometry:ds,DoubleSide:Fa,Mesh:ns,MeshLambertMaterial:hg,Object3D:ga},_ee=Object.assign({},yz),See=_ee.BufferGeometryUtils||_ee,rge=Wo({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(e){var t=e.sumWeight;return t*.01}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i,t.dataMapper=new rd(e,{objBindAttr:"__threeObjHexbin"})},update:function(e,t){var r=pn(e.hexBinPointLat),i=pn(e.hexBinPointLng),s=pn(e.hexBinPointWeight),a=pn(e.hexAltitude),o=pn(e.hexTo
5382pColor),l=pn(e.hexSideColor),u=pn(e.hexMargin),d=VUe(e.hexBinPointsData.map(function(_){return Es(Es({},_),{},{h3Idx:EBe(r(_),i(_),e.hexBinResolution)})}),"h3Idx"),h=Object.entries(d).map(function(_){var M=ma(_,2),T=M[0],L=M[1];return{h3Idx:T,points:L,sumWeight:L.reduce(function(D,P){return D+ +s(P)},0)}}),f={};if(!e.hexBinMerge&&t.hasOwnProperty("hexBinMerge")&&Ba(e.scene),e.dataMapper.scene=e.hexBinMerge?new uA.Object3D:e.scene,e.dataMapper.id(function(_){return _.h3Idx}).onCreateObj(x).onUpdateObj(b).digest(h),e.hexBinMerge){var p=h.length?(See.mergeGeometries||See.mergeBufferGeometries)(h.map(function(_){var M=e.dataMapper.getObj(_),T=M.geometry.toNonIndexed();M.updateMatrix(),T.applyMatrix4(M.matrix);var L=O1(o(_)),D=O1(l(_)),P=T.getAttribute("position").count,O=T.groups[0].count;return T.setAttribute("color",j0(Ds(new Array(P)).map(function(F,U){return U>=O?L:D}),4)),T})):new uA.BufferGeometry,g=new uA.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:uA.DoubleSide});g.onBeforeCompile=function(_){g.userData.shader=hU(_)};var A=new uA.Mesh(p,g);A.__globeObjType="hexBinPoints",A.__data=h,e.dataMapper.clear(),Ba(e.scene),e.scene.add(A)}function x(_){var M=new uA.Mesh;M.__hexCenter=Bde(_.h3Idx),M.__hexGeoJson=Vde(_.h3Idx,!0).reverse();var T=M.__hexCenter[1];return M.__hexGeoJson.forEach(function(L){var D=L[0];Math.abs(T-D)>170&&(L[0]+=T>D?360:-360)}),M.__globeObjType="hexbin",M}function b(_,M){var T=function(ee,ae,le){return ee-(ee-ae)*le},L=Math.max(0,Math.min(1,+u(M))),D=ma(_.__hexCenter,2),P=D[0],O=D[1],F=L===0?_.__hexGeoJson:_.__hexGeoJson.map(function(J){var ee=ma(J,2),ae=ee[0],le=ee[1];return[[ae,O],[le,P]].map(function(Z){var Y=ma(Z,2),re=Y[0],_e=Y[1];return T(re,_e,L)})}),U=e.hexTopCurvatureResolution;_.geometry&&_.geometry.dispose(),_.geometry=new Tz([F],0,sa,!1,!0,!0,U);var B={alt:+a(M)},z=function(ee){var ae=_.__currentTargetD=ee,le=ae.alt;_.scale.x=_.scale.y=_.scale.z=1+le;var Z=sa/(le+1);_.geometry.setAttribute("surfaceRadius",j0(Array(_.geometry.getAttribute("position").count).fill(Z),1))},H=_.__currentTargetD||Object.assign({},B,{alt:-.001});if(Object.keys(B).some(function(J){return H[J]!==B[J]})&&(e.hexBinMerge||!e.hexTransitionDuration||e.hexTransitionDuration<0?z(B):e.tweenGroup.add(new Mc(H).to(B,e.hexTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(z).onComplete(function(){e.tweenGroup.remove(this)}).start())),!e.hexBinMerge){var X=l(M),W=o(M);[X,W].forEach(function(J){if(!f.hasOwnProperty(J)){var ee=Jf(J);f[J]=yq(new uA.MeshLambertMaterial({color:D0(J),transparent:ee<1,opacity:ee,side:uA.DoubleSide}),hU)}}),_.material=[X,W].map(function(J){return f[J]})}}}}),ige=function(e){return e*e},jm=function(e){return e*Math.PI/180};function nJe(n,e){var t=Math.sqrt,r=Math.cos,i=function(d){return ige(Math.sin(d/2))},s=jm(n[1]),a=jm(e[1]),o=jm(n[0]),l=jm(e[0]);return 2*Math.asin(t(i(a-s)+r(s)*r(a)*i(l-o)))}var rJe=Math.sqrt(2*Math.PI);function iJe(n,e){return Math.exp(-ige(n/e)/2)/(e*rJe)}var sJe=function(e){var t=ma(e,2),r=t[0],i=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=a.lngAccessor,l=o===void 0?function(x){return x[0]}:o,u=a.latAccessor,d=u===void 0?function(x){return x[1]}:u,h=a.weightAccessor,f=h===void 0?function(){return 1}:h,p=a.bandwidth,g=[r,i],A=p*Math.PI/180;return jOe(s.map(function(x){var b=f(x);if(!b)return 0;var _=nJe(g,[l(x),d(x)]);return iJe(_,A)*b}))},aJe=(function(){var n=LZe(uU().m(function e(t){var r,i,s,a,o,l,u,d,h,f,p,g,A,x,b,_,M,T,L,D,P,O,F,U,B,z,H,X,W,J,ee,ae,le,Z,Y,re,_e,Ee,Ae,te,ve=arguments,we,Ue,ze;return uU().w(function(yt){for(;;)switch(yt.n){case 0:if(i=ve.length>1&&ve[1]!==void 0?ve[1]:[],s=ve.length>2&&ve[2]!==void 0?ve[2]:{},a=s.lngAccessor,o=a===void 0?function(mt){return mt[0]}:a,l=s.latAccessor,u=l===void 0?function(mt){return mt[1]}:l,d=s.weightAccessor,h=d===void 0?function(){return 1}:d,f=s.bandwidth,(r=navigator)!==null&&r!==void 0&&r.gpu){yt.n=1;break}return console.warn("WebGPU not enabled in browser. Please consider enabling it to improve performance."),yt.a(2,t.map(function(mt){return sJe(mt,i,{lngAccessor:o,latAccessor:u,weightAccessor:h,bandwidth:f})}));case 1:return p=4,g=dZe,A=hZe,x=_Ze,b=wZe,_=AZe,M=xZe,T=fZe,L=bZe,D=yZe,P=mZe,O=pZe,F=gZe,U=vZe,B=b(new R6(new Float32Array(t.flat().map(jm)),2),"vec2",t.length),z=b(new R6(new Float32Array(i.map(function(mt){return[jm(o(mt)),jm(u(mt)),h(mt)]}).flat()),3),"vec3",i.length),H=new R6(t.length,1),X=b(H,"float",t.length),W=_(Math.PI),J=L(W.mul(2)),ee=function(bt){return bt.mul(bt)},ae=function(bt){return ee(D(bt.div(2)))},le=function(bt,dt){var St=_(bt[1]),kt=_(dt[1]),Fe=_(bt[0]),Ze=_(dt[0]);return _(2).mul(O(L(ae(kt.sub(St)).add(P(St).mul(P(kt)).mul(ae(Ze.sub(Fe)))))))},Z=function(bt,dt){return F(U(ee(bt.div(dt)).div(2))).div(dt.mul(J))},Y=x(jm(f)),re=x(jm(f*p)),_e=x(i.length),Ee=g(function(){var mt=B.element
vendor: 8,475 bytes, line 5382
5382(M),bt=X.element(M);bt.assign(0),T(_e,function(dt){var St=dt.i,kt=z.element(St),Fe=kt.z;A(Fe,function(){var Ze=le(kt.xy,mt.xy);A(Ze&&Ze.lessThan(re),function(){bt.addAssign(Z(Ze,Y).mul(Fe))})})})}),Ae=Ee().compute(t.length),te=new qme,yt.n=2,te.computeAsync(Ae);case 2:return we=Array,Ue=Float32Array,yt.n=3,te.getArrayBufferAsync(H);case 3:return ze=yt.v,yt.a(2,we.from.call(we,new Ue(ze)))}},e)}));return function(t){return n.apply(this,arguments)}})(),TN=window.THREE?window.THREE:{Mesh:ns,MeshLambertMaterial:hg,SphereGeometry:F0},oJe=3.5,lJe=.1,Tee=100,cJe=function(e){var t=iy(NBe(e));return t.opacity=Math.cbrt(e),t.formatRgb()},sge=Wo({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(e){return e}},heatmapPointLat:{default:function(e){return e[0]}},heatmapPointLng:{default:function(e){return e[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:2.5},heatmapColorFn:{default:function(){return cJe}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i,t.dataMapper=new rd(e,{objBindAttr:"__threeObjHeatmap"}).onCreateObj(function(){var s=new TN.Mesh(new TN.SphereGeometry(sa),yq(new TN.MeshLambertMaterial({vertexColors:!0,transparent:!0}),ZZe));return s.__globeObjType="heatmap",s})},update:function(e){var t=pn(e.heatmapPoints),r=pn(e.heatmapPointLat),i=pn(e.heatmapPointLng),s=pn(e.heatmapPointWeight),a=pn(e.heatmapBandwidth),o=pn(e.heatmapColorFn),l=pn(e.heatmapColorSaturation),u=pn(e.heatmapBaseAltitude),d=pn(e.heatmapTopAltitude);e.dataMapper.onUpdateObj(function(h,f){var p=a(f),g=o(f),A=l(f),x=u(f),b=d(f),_=t(f).map(function(P){var O=r(P),F=i(P),U=Yh(O,F),B=U.x,z=U.y,H=U.z;return{x:B,y:z,z:H,lat:O,lng:F,weight:s(P)}}),M=Math.max(lJe,p/oJe),T=Math.ceil(360/(M||-1));h.geometry.parameters.widthSegments!==T&&(h.geometry.dispose(),h.geometry=new TN.SphereGeometry(sa,T,T/2));var L=KZe(h.geometry.getAttribute("position")),D=L.map(function(P){var O=ma(P,3),F=O[0],U=O[1],B=O[2],z=Zme({x:F,y:U,z:B}),H=z.lng,X=z.lat;return[H,X]});aJe(D,_,{latAccessor:function(O){return O.lat},lngAccessor:function(O){return O.lng},weightAccessor:function(O){return O.weight},bandwidth:p}).then(function(P){var O=Ds(new Array(Tee)).map(function(z,H){return O1(g(H/(Tee-1)))}),F=function(H){var X=h.__currentTargetD=H,W=X.kdeVals,J=X.topAlt,ee=X.saturation,ae=LOe(W.map(Math.abs))||1e-15,le=Vue([0,ae/ee],O);h.geometry.setAttribute("color",j0(W.map(function(Y){return le(Math.abs(Y))}),4));var Z=tg([0,ae],[sa*(1+x),sa*(1+(J||x))]);h.geometry.setAttribute("r",j0(W.map(Z)))},U={kdeVals:P,topAlt:b,saturation:A},B=h.__currentTargetD||Object.assign({},U,{kdeVals:P.map(function(){return 0}),topAlt:b&&x,saturation:.5});B.kdeVals.length!==P.length&&(B.kdeVals=P.slice()),Object.keys(U).some(function(z){return B[z]!==U[z]})&&(!e.heatmapsTransitionDuration||e.heatmapsTransitionDuration<0?F(U):e.tweenGroup.add(new Mc(B).to(U,e.heatmapsTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(F).onComplete(function(){e.tweenGroup.remove(this)}).start()))})}).digest(e.heatmapsData)}}),dA=window.THREE?window.THREE:{DoubleSide:Fa,Group:Bu,LineBasicMaterial:w_,LineSegments:Xce,Mesh:ns,MeshBasicMaterial:Lh},age=Wo({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i,t.dataMapper=new rd(e,{objBindAttr:"__threeObjPolygon"}).id(function(s){return s.id}).onCreateObj(function(){var s=new dA.Group;return s.__defaultSideMaterial=yq(new dA.MeshBasicMaterial({side:dA.DoubleSide,depthWrite:!0}),hU),s.__defaultCapMaterial=new dA.MeshBasicMaterial({side:dA.DoubleSide,depthWrite:!0}),s.add(new dA.Mesh(void 0,[s.__defaultSideMaterial,s.__defaultCapMaterial])),s.add(new dA.LineSegments(void 0,new dA.LineBasicMaterial)),s.__globeObjType="polygon",s})},update:function(e){var t=pn(e.polygonGeoJsonGeometry),r=pn(e.polygonAltitude),i=pn(e.polygonCapCurvatureResolution),s=pn(e.polygonCapColor),a=pn(e.polygonCapMaterial),o=pn(e.polygonSideColor),l=pn(e.polygonSideMaterial),u=pn(e.polygonStrokeColor),d=[];e.polygonsData.forEach(function(h){var f={data:h,capColor:s(h),capMaterial:a(h),sideColor:o(h),sideMaterial:l(h),strokeColor:u(h),altitude:+r(h),capCurvatureResolution:+i(h)},p=t(h),g=h.__id||"".concat(Math.round(Math.random()*1e9));h.__id=g,p.type==="Polygon"?d.push(Es({id:"".concat(g,"_0"),coords:p.coordinates},f)):p.type==="MultiPolygon"?d.push.apply(d,Ds(p.coordinates.map(function(A,x){return Es({id:"".concat(g,"_").concat(x),coords:A},f)}))):console.warn("Unsupported GeoJson geometry type: ".concat(p.type,". Skipping geometry..."))}),e.dataMapper.onUpdateObj(function(h,f){var p=f.coords,g=f.capColor,A=f.capMaterial,x=f.sideColor,b=f.sideMaterial,_=f.strokeColor,M=f.altitude,T=f.capCurvatureResolution,L=ma(h.children,2),D=L[0],P=L[1],O=!!_;P.visible=O;var F=!!(g||A),U=!!(x||b);uJe(D.geometry.parameters||{},{polygonGeoJson:p,curvatureResolution:T,closedTop:F,includeSides:U})||(D.geometry&&D.geometry.dispose(),D.geometry=new Tz(p,0,sa,!1,F,U,T)),O&&(!P.geometry.parameters||P.geometry.parameters.geoJson.coordinates!==p||P.geometry.parameters.resolution!==T)&&(P.geometry&&P.geometry.dispose(),P.geometry=new bde({type:"Polygon",coordinates:p},sa,T));var B=U?0:-1,z=F?U?1:0:-1;if(B>=0&&(D.material[B]=b||h.__defaultSideMaterial),z>=0&&(D.material[z]=A||h.__defaultCapMaterial),[[!b&&x,B],[!A&&g,z]].forEach(function(ae){var le=ma(ae,2),Z=le[0],Y=le[1];if(!(!Z||Y<0)){var re=D.material[Y],_e=Jf(Z);re.color.set(D0(Z)),re.transparent=_e<1,re.opacity=_e}}),O){var H=P.material,X=Jf(_);H.color.set(D0(_)),H.transparent=X<1,H.opacity=X}var W={alt:M},J=function(le){var Z=h.__currentTargetD=le,Y=Z.alt;D.scale.x=D.scale.y=D.scale.z=1+Y,O&&(P.scale.x=P.scale.y=P.scale.z=1+Y+1e-4),JZe(h.__defaultSideMaterial,function(re){return re.uSurfaceRadius.value=sa/(Y+1)})},ee=h.__currentTargetD||Object.assign({},W,{alt:-.001});Object.keys(W).some(function(ae){return ee[ae]!==W[ae]})&&(!e.polygonsTransitionDuration||e.polygonsTransitionDuration<0||ee.alt===W.alt?J(W):e.tweenGroup.add(new Mc(ee).to(W,e.polygonsTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(J).onComplete(function(){e.tweenGroup.remove(this)}).start()))}).digest(d)}});function uJe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return function(r,i){return r===i}};return Object.entries(e).every(function(r){var i=ma(r,2),s=i[0],a=i[1];return n.hasOwnProperty(s)&&t(s)(n[s],a)})}var B2=window.THREE?window.THREE:{BufferGeometry:ds,DoubleSide:Fa,Mesh:ns,MeshLambertMaterial:hg,Vector3:Ve},Eee=Object.assign({},yz),Cee=Eee.BufferGeometryUtils||Eee,oge=Wo({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i,t.dataMapper=new rd(e,{objBindAttr:"__threeObjHexPolygon"}).onCreateObj(function(){var s=new B2.Mesh(void 0,new B2.MeshLambertMaterial({side:B2.DoubleSide}));return s.__globeObjType="hexPolygon",s})},update:function(e){var t=pn(e.hexPolygonGeoJsonGeometry),r=pn(e.hexPolygonColor),i=pn(e.hexPolygonAltitude),s=pn(e.hexPolygonResolution),a=pn(e.hexPolygonMargin),o=pn(e.hexPolygonUseDots),l=pn(e.hexPolygonCurvatureResolution),u=pn(e.hexPolygonDotResolution);e.dataMapper.onUpdateObj(function(d,h){var f=t(h),p=s(h),g=i(h),A=Math.max(0,Math.min(1,+a(h))),x=o(h),b=l(h),_=u(h),M=r(h),T=Jf(M);d.material.color.set(D0(M)),d.material.transparent=T<1,d.material.opacity=T;var L={alt:g,margin:A,curvatureResolution:b},D={geoJson:f,h3Res:p},P=d.__currentTargetD||Object.assign({},L,{alt:-.001}),O=d.__currentMemD||D;if(Object.keys(L).some(function(z){return P[z]!==L[z]})||Object.keys(D).some(function(z){return O[z]!==D[z]})){d.__currentMemD=D;var F=[];
5382f.type==="Polygon"?DZ(f.coordinates,p,!0).forEach(function(z){return F.push(z)}):f.type==="MultiPolygon"?f.coordinates.forEach(function(z){return DZ(z,p,!0).forEach(function(H){return F.push(H)})}):console.warn("Unsupported GeoJson geometry type: ".concat(f.type,". Skipping geometry..."));var U=F.map(function(z){var H=Bde(z),X=Vde(z,!0).reverse(),W=H[1];return X.forEach(function(J){var ee=J[0];Math.abs(W-ee)>170&&(J[0]+=W>ee?360:-360)}),{h3Idx:z,hexCenter:H,hexGeoJson:X}}),B=function(H){var X=d.__currentTargetD=H,W=X.alt,J=X.margin,ee=X.curvatureResolution;d.geometry&&d.geometry.dispose(),d.geometry=U.length?(Cee.mergeGeometries||Cee.mergeBufferGeometries)(U.map(function(ae){var le=ma(ae.hexCenter,2),Z=le[0],Y=le[1];if(x){var re=Yh(Z,Y,W),_e=Yh(ae.hexGeoJson[0][1],ae.hexGeoJson[0][0],W),Ee=.85*(1-J)*new B2.Vector3(re.x,re.y,re.z).distanceTo(new B2.Vector3(_e.x,_e.y,_e.z)),Ae=new Y8(Ee,_);return Ae.rotateX(tv(-Z)),Ae.rotateY(tv(Y)),Ae.translate(re.x,re.y,re.z),Ae}else{var te=function(Ue,ze,yt){return Ue-(Ue-ze)*yt},ve=J===0?ae.hexGeoJson:ae.hexGeoJson.map(function(we){var Ue=ma(we,2),ze=Ue[0],yt=Ue[1];return[[ze,Y],[yt,Z]].map(function(mt){var bt=ma(mt,2),dt=bt[0],St=bt[1];return te(dt,St,J)})});return new Tz([ve],sa,sa*(1+W),!1,!0,!1,ee)}})):new B2.BufferGeometry};!e.hexPolygonsTransitionDuration||e.hexPolygonsTransitionDuration<0?B(L):e.tweenGroup.add(new Mc(P).to(L,e.hexPolygonsTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(B).onComplete(function(){e.tweenGroup.remove(this)}).start())}}).digest(e.hexPolygonsData)}}),dJe=window.THREE?window.THREE:{Vector3:Ve};function hJe(n,e){var t=function(a,o){var l=a[a.length-1];return[].concat(Ds(a),Ds(Array(o-a.length).fill(l)))},r=Math.max(n.length,e.length),i=ZOe.apply(void 0,Ds([n,e].map(function(s){return s.map(function(a){var o=a.x,l=a.y,u=a.z;return[o,l,u]})}).map(function(s){return t(s,r)})));return function(s){return s===0?n:s===1?e:i(s).map(function(a){var o=ma(a,3),l=o[0],u=o[1],d=o[2];return new dJe.Vector3(l,u,d)})}}var Fx=window.THREE?window.THREE:{BufferGeometry:ds,Color:tr,Group:Bu,Line:X8,NormalBlending:dl,ShaderMaterial:Nc,Vector3:Ve},fJe=Yw.default||Yw,lge=Wo({props:{pathsData:{default:[]},pathPoints:{default:function(e){return e}},pathPointLat:{default:function(e){return e[0]}},pathPointLng:{default:function(e){return e[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.pause()},resumeAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.resume()},_destructor:function(e){var t;(t=e.ticker)===null||t===void 0||t.dispose()}},stateInit:function(e){var t=e.tweenGroup;return{tweenGroup:t,ticker:new fJe,sharedMaterial:new Fx.ShaderMaterial(Es(Es({},tge()),{},{transparent:!0,blending:Fx.NormalBlending}))}},init:function(e,t){Ba(e),t.scene=e,t.dataMapper=new rd(e,{objBindAttr:"__threeObjPath"}).onCreateObj(function(){var r=new Fx.Group;return r.__globeObjType="path",r}),t.ticker.onTick.add(function(r,i){t.dataMapper.entries().map(function(s){var a=ma(s,2),o=a[1];return o}
5382).filter(function(s){return s.children.length&&s.children[0].material&&s.children[0].__dashAnimateStep}).forEach(function(s){var a=s.children[0],o=a.__dashAnimateStep*i;if(a.type==="Line"){var l=a.material.uniforms.dashTranslate.value%1e9;a.material.uniforms.dashTranslate.value=l+o}else if(a.type==="Line2"){for(var u=a.material.dashOffset-o,d=a.material.dashSize+a.material.gapSize;u<=-d;)u+=d;a.material.dashOffset=u}})})},update:function(e){var t=pn(e.pathPoints),r=pn(e.pathPointLat),i=pn(e.pathPointLng),s=pn(e.pathPointAlt),a=pn(e.pathStroke),o=pn(e.pathColor),l=pn(e.pathDashLength),u=pn(e.pathDashGap),d=pn(e.pathDashInitialGap),h=pn(e.pathDashAnimateTime);e.dataMapper.onUpdateObj(function(x,b){var _=a(b),M=_!=null;if(!x.children.length||M===(x.children[0].type==="Line")){Ba(x);var T=M?new CZe(new Hme,new Aq):new Fx.Line(new Fx.BufferGeometry,e.sharedMaterial.clone());x.add(T)}var L=x.children[0],D=p(t(b),r,i,s,e.pathResolution),P=h(b);if(L.__dashAnimateStep=P>0?1e3/P:0,M){L.material.resolution=e.rendererSize;{var U=l(b),B=u(b),z=d(b);L.material.dashed=B>0,L.material.dashed?L.material.defines.USE_DASH="":delete L.material.defines.USE_DASH,L.material.dashed&&(L.material.dashScale=1/f(D),L.material.dashSize=U,L.material.gapSize=B,L.material.dashOffset=-z)}{var H=o(b);if(H instanceof Array){var X=g(o(b),D.length-1,1,!1);L.geometry.setColors(X.array),L.material.vertexColors=!0}else{var W=H,J=Jf(W);L.material.color=new Fx.Color(D0(W)),L.material.transparent=J<1,L.material.opacity=J,L.material.vertexColors=!1}}L.material.needsUpdate=!0}else{Object.assign(L.material.uniforms,{dashSize:{value:l(b)},gapSize:{value:u(b)},dashOffset:{value:d(b)}});var O=g(o(b),D.length),F=A(D.length,1,!0);L.geometry.setAttribute("color",O),L.geometry.setAttribute("relDistance",F)}var ee=hJe(x.__currentTargetD&&x.__currentTargetD.points||[D[0]],D),ae=function(re){var _e=x.__currentTargetD=re,Ee=_e.stroke,Ae=_e.interpolK,te=x.__currentTargetD.points=ee(Ae);if(M){var ve;L.geometry.setPositions((ve=[]).concat.apply(ve,Ds(te.map(function(we){var Ue=we.x,ze=we.y,yt=we.z;return[Ue,ze,yt]})))),L.material.linewidth=Ee,L.material.dashed&&L.computeLineDistances()}else L.geometry.setFromPoints(te),L.geometry.computeBoundingSphere()},le={stroke:_,interpolK:1},Z=Object.assign({},x.__currentTargetD||le,{interpolK:0});Object.keys(le).some(function(Y){return Z[Y]!==le[Y]})&&(!e.pathTransitionDuration||e.pathTransitionDuration<0?ae(le):e.tweenGroup.add(new Mc(Z).to(le,e.pathTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(ae).onComplete(function(){e.tweenGroup.remove(this)}).start()))}).digest(e.pathsData);function f(x){var b=0,_;return x.forEach(function(M){_&&(b+=_.distanceTo(M)),_=M}),b}function p(x,b,_,M,T){var L=function(F,U,B){for(var z=[],H=1;H<=B;H++)z.push(F+(U-F)*H/(B+1));return z},D=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=[],z=null;return F.forEach(function(H){if(z){for(;Math.abs(z[1]-H[1])>180;)z[1]+=360*(z[1]<H[1]?1:-1);var X=Math.sqrt(Math.pow(H[0]-z[0],2)+Math.pow(H[1]-z[1],2));if(X>U)for(var W=Math.floor(X/U),J=L(z[0],H[0],W),ee=L(z[1],H[1],W),ae=L(z[2],H[2],W),le=0,Z=J.length;le<Z;le++)B.push([J[le],ee[le],ae[le]])}B.push(z=H)}),B},P=function(F){var U=ma(F,3),B=U[0],z=U[1],H=U[2],X=Yh(B,z,H),W=X.x,J=X.y,ee=X.z;return new Fx.Vector3(W,J,ee)};return D(x.map(function(O){return[b(O),_(O),M(O)]}),T).map(P)}function g(x,b){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,T=b+1,L;if(x instanceof Array||x instanceof Function){var D=x instanceof Array?tg().domain(x.map(function(H,X){return X/(x.length-1)})).range(x):x;L=function(X){return O1(D(X),M,!0)}}else{var P=O1(x,M,!0);L=function(){return P}}for(var O=[],F=0,U=T;F<U;F++)for(var B=L(F/(U-1)),z=0;z<_;z++)O.push(B);return j0(O,M?4:3)}function A(x){for(var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,M=x+1,T=[],L=0,D=M;L<D;L++)for(var P=L/(D-1),O=0;O<b;O++)T.push(P);return _&&T.reverse(),j0(T,1)}}}),EN=window.THREE?window.THREE:{Euler:Jd,Mesh:ns,MeshLambertMaterial:hg,SphereGeometry:F0},cge=Wo({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new EN.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i,t.dataMapper=new rd(e,{objBindAttr:"__threeObjTile"}).onCreateObj(function(){var s=new EN.Mesh;
vendor: 4,285 bytes, line 5382
5382return s.__globeObjType="tile",s})},update:function(e){var t=pn(e.tileLat),r=pn(e.tileLng),i=pn(e.tileAltitude),s=pn(e.tileWidth),a=pn(e.tileHeight),o=pn(e.tileUseGlobeProjection),l=pn(e.tileMaterial),u=pn(e.tileCurvatureResolution);e.dataMapper.onUpdateObj(function(d,h){d.material=l(h);var f=o(h),p=u(h),g=function(_){var M=d.__currentTargetD=_,T=M.lat,L=M.lng,D=M.alt,P=M.width,O=M.height,F=V2(L),U=V2(-T);d.geometry&&d.geometry.dispose(),d.geometry=new EN.SphereGeometry(sa*(1+D),Math.ceil(P/(p||-1)),Math.ceil(O/(p||-1)),V2(90-P/2)+(f?F:0),V2(P),V2(90-O/2)+(f?U:0),V2(O)),f||d.setRotationFromEuler(new EN.Euler(U,F,0,"YXZ"))},A={lat:+t(h),lng:+r(h),alt:+i(h),width:+s(h),height:+a(h)},x=d.__currentTargetD||Object.assign({},A,{width:0,height:0});Object.keys(A).some(function(b){return x[b]!==A[b]})&&(!e.tilesTransitionDuration||e.tilesTransitionDuration<0?g(A):e.tweenGroup.add(new Mc(x).to(A,e.tilesTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(g).onComplete(function(){e.tweenGroup.remove(this)}).start()))}).digest(e.tilesData)}}),V2=function(e){return e*Math.PI/180},tS=window.THREE?window.THREE:{BufferGeometry:ds,Color:tr,Points:gke,PointsMaterial:KV},uge=Wo({props:{particlesData:{default:[]},particlesList:{default:function(e){return e}},particleLat:{default:"lat"},particleLng:{default:"lng"},particleAltitude:{default:.01},particlesSize:{default:.5},particlesSizeAttenuation:{default:!0},particlesColor:{default:function(){return"white"}},particlesTexture:{}},init:function(e,t){Ba(e),t.scene=e,t.dataMapper=new rd(e,{objBindAttr:"__threeObjParticles"}).onCreateObj(function(){var r=new tS.Points(new tS.BufferGeometry,new tS.PointsMaterial);return r.__globeObjType="particles",r}).onUpdateObj(function(r,i){var s=pn(t.particlesList),a=pn(t.particleLat),o=pn(t.particleLng),l=pn(t.particleAltitude);r.geometry.setAttribute("position",j0(s(i).map(function(u){return Object.values(Yh(a(u),o(u),l(u)))}),3))})},update:function(e,t){["particlesData","particlesList","particleLat","particleLng","particleAltitude"].some(function(o){return t.hasOwnProperty(o)})&&e.dataMapper.digest(e.particlesData);var r=pn(e.particlesColor),i=pn(e.particlesSize),s=pn(e.particlesSizeAttenuation),a=pn(e.particlesTexture);e.dataMapper.entries().forEach(function(o){var l=ma(o,2),u=l[0],d=l[1];if(d.material.size=i(u),d.material.sizeAttenuation=s(u),e.particlesTexture)d.material.color=new tS.Color(16777215),d.material.transparent=!1,d.material.alphaTest=.5,d.material.map=a(u);else{var h=r(u),f=Jf(h);d.material.color=new tS.Color(D0(h)),d.material.transparent=f<1,d.material.opacity=f,d.material.alphaTest=0}})}}),pJe=window.THREE?window.THREE:{BufferGeometry:ds},mJe=(function(n){function e(){var t,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:32;BR(this,e),t=UR(this,e),t.type="CircleLineGeometry",t.parameters={radius:r,segmentCount:i};for(var s=[],a=0;a<=i;a++){var o=(a/i-.25)*Math.PI*2;s.push({x:Math.cos(o)*r,y:Math.sin(o)*r,z:0})}return t.setFromPoints(s),t}return zR(e,n),VR(e)})(pJe.BufferGeometry),z2=window.THREE?window.THREE:{Color:tr,Group:Bu,Line:X8,LineBasicMaterial:w_,Vector3:Ve},gJe=Yw.default||Yw,dge=Wo({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.pause()},resumeAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.resume()},_destructor:function(e){var t;(t=e.ticker)===null||t===void 0||t.dispose()}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i,t.dataMapper=new rd(e,{objBindAttr:"__threeObjRing",removeDelay:3e4}).onCreateObj(function(){var s=new z2.Group;return s.__globeObjType="ring",s}),t.ticker=new gJe,t.ticker.onTick.add(function(s){if(t.ringsData.length){var a=pn(t.ringColor),o=pn(t.ringAltitude),l=pn(t.ringMaxRadius),u=pn(t.ringPropagationSpeed),d=pn(t.ringRepeatPeriod);t.dataMapper.entries().filter(function(h){var f=ma(h,2),p=f[1];return p}
5382).forEach(function(h){var f=ma(h,2),p=f[0],g=f[1];if((g.__nextRingTime||0)<=s){var A=d(p)/1e3;g.__nextRingTime=s+(A<=0?1/0:A);var x=new z2.Line(new mJe(1,t.ringResolution),new z2.LineBasicMaterial),b=a(p),_=b instanceof Array||b instanceof Function,M;_?b instanceof Array?(M=tg().domain(b.map(function(B,z){return z/(b.length-1)})).range(b),x.material.transparent=b.some(function(B){return Jf(B)<1})):(M=b,x.material.transparent=!0):(x.material.color=new z2.Color(D0(b)),QZe(x.material,Jf(b)));var T=sa*(1+o(p)),L=l(p),D=L*Math.PI/180,P=u(p),O=P<=0,F=function(z){var H=z.t,X=(O?1-H:H)*D;if(x.scale.x=x.scale.y=T*Math.sin(X),x.position.z=T*(1-Math.cos(X)),_){var W=M(H);x.material.color=new z2.Color(D0(W)),x.material.transparent&&(x.material.opacity=Jf(W))}};if(P===0)F({t:0}),g.add(x);else{var U=Math.abs(L/P)*1e3;t.tweenGroup.add(new Mc({t:0}).to({t:1},U).onUpdate(F).onStart(function(){return g.add(x)}).onComplete(function(){t.tweenGroup.remove(this),g.remove(x),ZA(x)}).start())}}})}})},update:function(e){var t=pn(e.ringLat),r=pn(e.ringLng),i=pn(e.ringAltitude),s=e.scene.localToWorld(new z2.Vector3(0,0,0));e.dataMapper.onUpdateObj(function(a,o){var l=t(o),u=r(o),d=i(o);Object.assign(a.position,Yh(l,u,d)),a.lookAt(s)}).digest(e.ringsData)}}),AJe={0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},ο:{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "}
5382,"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},Τ:{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},Î :{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},Î:{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"â":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},Î:{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},Æ:{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},Ï:{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},Ï:{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "}
5382,"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"â":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},ÿ:{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},µ:{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},Î:{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},Î:{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"â":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},Î:{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},Ï:{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},Ψ:{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "}
5382,"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},ι:{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},Î:{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},ε:{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},Î:{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"â°":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"â":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},Ï:{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},Î:{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803
53821013 l 803 0 "},Î:{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"â¦":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},ν:{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},β:{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644
5382603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},Î:{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},Î:{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},Î:{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"â¢":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"Â¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},γ:{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},α:{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"Â":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},Χ:{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"â ":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},Î:{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},Ϋ:{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"â":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},Î:{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},Î:{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},Ï
:{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "}
5382,"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},Ï:{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},ί:{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},Î:{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"â¹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"â":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},δ:{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},Î:{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 43
53826 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},Ï:{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},Ï:{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},Ω:{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},Ï:{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"â¢":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},ή:{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},Î:{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 28
53820 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},Î:{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},Ï:{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},ζ:{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},θ:{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},Î:{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},Î:{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 8
538210 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},Î:{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},Î:{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},Ϊ:{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},Ρ:{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},ª:{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"Î
":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},Φ:{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"â":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},Σ:{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"âº":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},λ:{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},Ï:{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 43
53826 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},ξ:{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},Î:{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},ΰ:{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},Î¥:{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},μ:{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},Ï:{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"â":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"â":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},Ï:{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257
5382-5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},Ï:{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},ά:{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "}
5382,"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},κ:{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"â¡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},Ï:{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},η:{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},xJe="normal",vJe=1189,yJe=-100,bJe="normal",wJe={yMin:-334,xMin:-111,yMax:1189,xMax:1672},_Je=1e3,SJe={postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Îagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Îagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:`Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r 5383\r 5384Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r 5385\r 5386The above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r 5387\r 5388The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r 5389\r 5390This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r 5391\r 5392The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r 5393\r 5394THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.`,manufacturer_name:"Îagenta ltd",font_sub_family_name:"Regular"},TJe=-334,EJe="Helvetiker",CJe=1522,NJe=50,MJe={glyphs:AJe,cssFontWeight:xJe,ascender:vJe,underlinePosition:yJe,cssFontStyle:bJe,boun
vendor: 10,800 bytes, line 5394
5394dingBox:wJe,resolution:_Je,original_font_information:SJe,descender:TJe,familyName:EJe,lineHeight:CJe,underlineThickness:NJe},Ef=Es(Es({},window.THREE?window.THREE:{BoxGeometry:W1,CircleGeometry:Y8,DoubleSide:Fa,Group:Bu,Mesh:ns,MeshLambertMaterial:hg,TextGeometry:$k,Vector3:Ve}),{},{Font:Wme,TextGeometry:$k}),hge=Wo({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:.002},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:MJe,onChange:function(e,t){t.font=new Ef.Font(e)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i;var s=new Ef.CircleGeometry(1,32);t.dataMapper=new rd(e,{objBindAttr:"__threeObjLabel"}).onCreateObj(function(){var a=new Ef.MeshLambertMaterial;a.side=Fa;var o=new Ef.Group;o.add(new Ef.Mesh(s,a));var l=new Ef.Mesh(void 0,a);o.add(l);var u=new Ef.Mesh;return u.visible=!1,l.add(u),o.__globeObjType="label",o})},update:function(e){var t=pn(e.labelLat),r=pn(e.labelLng),i=pn(e.labelAltitude),s=pn(e.labelText),a=pn(e.labelSize),o=pn(e.labelRotation),l=pn(e.labelColor),u=pn(e.labelIncludeDot),d=pn(e.labelDotRadius),h=pn(e.labelDotOrientation),f=new Set(["right","top","bottom"]),p=2*Math.PI*sa/360;e.dataMapper.onUpdateObj(function(g,A){var x=ma(g.children,2),b=x[0],_=x[1],M=ma(_.children,1),T=M[0],L=l(A),D=Jf(L);_.material.color.set(D0(L)),_.material.transparent=D<1,_.material.opacity=D;var P=u(A),O=h(A);!P||!f.has(O)&&(O="bottom");var F=P?+d(A)*p:1e-12;b.scale.x=b.scale.y=F;var U=+a(A)*p;if(_.geometry&&_.geometry.dispose(),_.geometry=new Ef.TextGeometry(s(A),{font:e.font,size:U,depth:0,bevelEnabled:!0,bevelThickness:0,bevelSize:0,curveSegments:e.labelResolution}),T.geometry&&T.geometry.dispose(),_.geometry.computeBoundingBox(),T.geometry=xq(Ef.BoxGeometry,Ds(new Ef.Vector3().subVectors(_.geometry.boundingBox.max,_.geometry.boundingBox.min).clampScalar(0,1/0).toArray())),O!=="right"&&_.geometry.center(),P){var B=F+U/2;O==="right"&&(_.position.x=B),_.position.y={right:-U/2,top:B+U/2,bottom:-B-U/2}[O]}var z=function(J){var ee=g.__currentTargetD=J,ae=ee.lat,le=ee.lng,Z=ee.alt,Y=ee.rot,re=ee.scale;Object.assign(g.position,Yh(ae,le,Z)),g.lookAt(e.scene.localToWorld(new Ef.Vector3(0,0,0))),g.rotateY(Math.PI),g.rotateZ(-Y*Math.PI/180),g.scale.x=g.scale.y=g.scale.z=re},H={lat:+t(A),lng:+r(A),alt:+i(A),rot:+o(A),scale:1},X=g.__currentTargetD||Object.assign({},H,{scale:1e-12});Object.keys(H).some(function(W){return X[W]!==H[W]})&&(!e.labelsTransitionDuration||e.labelsTransitionDuration<0?z(H):e.tweenGroup.add(new Mc(X).to(H,e.labelsTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(z).onComplete(function(){e.tweenGroup.remove(this)}).start()))}).digest(e.labelsData)}}),kJe=Es(Es({},window.THREE?window.THREE:{}),{},{CSS2DObject:wLe}),fge=Wo({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlElementVisibilityModifier:{triggerUpdate:!1},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(e,t){if(e.dataMapper){var r=t?[t]:e.dataMapper.entries().map(function(i){var s=ma(i,2),a=s[1];return a}).filter(function(i){return i});r.forEach(function(i){var s=!e.isBehindGlobe||!e.isBehindGlobe(i.position);e.htmlElementVisibilityModifier?(i.visible=!0,e.htmlElementVisibilityModifier(i.element,s)):i.visible=s})}}},init:function(e,t,r){var i=r.tweenGroup;Ba(e),t.scene=e,t.tweenGroup=i,t.dataMapper=new rd(e,{objBindAttr:"__threeObjHtml"}).onCreateObj(function(s){var a=pn(t.htmlElement)(s),o=new kJe.CSS2DObject(a);return o.__globeObjType="html",o})},update:function(e,t){var r=this,i=pn(e.htmlLat),s=pn(e.htmlLng),a=pn(e.htmlAltitude);t.hasOwnProperty("htmlElement")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj(function(o,l){var u=function(f){var p=o.__currentTargetD=f,g=p.alt,A=p.lat,x=p.lng;Object.assign(o.position,Yh(A,x,g)),r.updateObjVisibility(o)},d={lat:+i(l),lng:+s(l),alt:+a(l)};!e.htmlTransitionDuration||e.htmlTransitionDuration<0||!o.__currentTargetD?u(d):e.tweenGroup.add(new Mc(o.__currentTargetD).to(d,e.htmlTransitionDuration).easing(Ro.Quadratic.InOut).onUpdate(u).onComplete(function(){e.tweenGroup.remove(this)}).start())}).digest(e.htmlElementsData)}}),CN=window.THREE?window.THREE:{Group:Bu,Mesh:ns,MeshLambertMaterial:hg,SphereGeometry:F0},pge=Wo({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new CN.Mesh(new CN.SphereGeometry(1,16,8),new CN.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(e,t){Ba(e),t.scene=e,t.dataMapper=new rd(e,{objBindAttr:"__threeObjObject"}).onCreateObj(function(r){var i=pn(t.objectThreeObject)(r);t.objectThreeObject===i&&(i=i.clone());var s=new CN.Group;return s.add(i),s.__globeObjType="object",s})},update:function(e,t){var r=pn(e.objectLat),i=pn(e.objectLng),s=pn(e.objectAltitude),a=pn(e.objectFacesSurface),o=pn(e.objectRotation);t.hasOwnProperty("objectThreeObject")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj(function(l,u){var d=+r(u),h=+i(u),f=+s(u);Object.assign(l.position,Yh(d,h,f)),a(u)?l.setRotationFromEuler(new Jd(tv(-d),tv(h),0,"YXZ")):l.rotation.set(0,0,0);var p=l.children[0],g=o(u);g&&p.setRotationFromEuler(new Jd(tv(g.x||0),tv(g.y||0),tv(g.z||0)))}).digest(e.objectsData)}}),mge=Wo({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(e,t){Ba(e),t.scene=e,t.dataMapper=new rd(e,{objBindAttr:"__threeObjCustom"}).onCreateObj(function(r){var i=pn(t.customThreeObject)(r,sa);return i&&(t.customThreeObject===i&&(i=i.clone()),i.__globeObjType="custom"),i})},update:function(e,t){e.customThreeObjectUpdate||Ba(e.scene);var r=pn(e.customThreeObjectUpdate);t.hasOwnProperty("customThreeObject")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj(function(i,s){return r(i,s,sa)}).digest(e.customLayerData)}}),NN=window.THREE?window.THREE:{Camera:Z8,Group:Bu,Vector2:Jt,Vector3:Ve},RJe=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","particlesLayer","ringsLayer","labelsLayer","htmlElementsLayer","objectsLayer","customLayer"],gge=Au("globeLayer",Jme),PJe=Object.assign.apply(Object,Ds(["globeImageUrl","bumpImageUrl","globeCurvatureResolution","globeTileEngineUrl","globeTileEngineMaxLevel","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map(function(n){return xl({},n,gge.linkProp(n))}))),LJe=Object.assign.apply(Object,Ds(["globeMaterial","globeTileEngineClearCache"].map(function(n){return xl({},n,gge.linkMethod(n))}))),OJe=Au("pointsLayer",ege),DJe=Object.assign.apply(Object,Ds(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map(function(n){return xl({},n,OJe.linkProp(n))}))),jJe=Au("arcsLayer",nge),IJe=Object.assign.apply(Object,Ds(["arcsData","arcStartLat","arcStartLng","arcStartAltitude","arcEndLat","arcEndLng","arcEndAltitude","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map(function(n){return xl({},n,jJe.linkProp(n))}))),FJe=Au("hexBinLayer",rge),UJe=Object.assign.apply(Object,Ds(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map(function(n){return xl({},n,FJe.linkProp(n))}))),BJe=Au("heatmapsLayer",sge),VJe=Object.assign.apply(Object,Ds(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map(function(n){return xl({},n,BJe.linkProp(n))}))),zJe=Au("hexedPolygonsLayer",oge),GJe=Object.assign.apply(Object,Ds(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map(function(n){return xl({},n,zJe.linkProp(n))}))),qJe=Au("polygonsLayer",age),$Je=Object.assign.apply(Object,Ds(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map(function(n){return xl({},n,qJe.linkProp(n))}))),HJe=Au("pathsLayer",lge),WJe=Object.assign.apply(Object,Ds(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map(function(n){return xl({},n,HJe.linkProp(n))}))),XJe=Au("tilesLayer",cge),YJe=Object.assign.apply(Object,Ds(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map(function(n){return xl({},n,XJe.linkProp(n))}))),QJe=Au("particlesLayer",uge),KJe=Object.assign.apply(Object,Ds(["particlesData","particlesList","particleLat","particleLng","particleAltitude","particlesSize","particlesSizeAttenuation","particlesColor","particlesTexture"].map(function(n){return xl({},n,QJe.linkProp(n))}))),ZJe=Au("ringsLayer",dge),JJe=Object.assign.apply(Object,Ds(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map(function(n){return xl({},n,ZJe.linkProp(n))}))),eet=Au("labelsLayer",hge),tet=Object.assign.apply(Object,Ds(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map(function(n){return xl({},n,eet.linkProp(n))}))),net=Au("htmlElementsLayer",fge),ret=Object.assign.apply(Object,Ds(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlElementVisibilityModifier","htmlTransitionDuration"].map(function(n){return xl({},n,net.linkProp(n))}
5394))),iet=Au("objectsLayer",pge),set=Object.assign.apply(Object,Ds(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map(function(n){return xl({},n,iet.linkProp(n))}))),aet=Au("customLayer",mge),oet=Object.assign.apply(Object,Ds(["customLayerData","customThreeObject","customThreeObjectUpdate"].map(function(n){return xl({},n,aet.linkProp(n))}))),cet=Wo({props:Es(Es(Es(Es(Es(Es(Es(Es(Es(Es(Es(Es(Es(Es(Es({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new NN.Vector2(window.innerWidth,window.innerHeight),onChange:function(e,t){t.pathsLayer.rendererSize(e)},triggerUpdate:!1}},PJe),DJe),IJe),UJe),VJe),$Je),GJe),WJe),YJe),KJe),JJe),tet),ret),set),oet),methods:Es({getGlobeRadius:vee,getCoords:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Yh.apply(void 0,r)},toGeoCoords:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Zme.apply(void 0,r)},setPointOfView:function(e,t){var r=t instanceof NN.Camera?t.position:t,i=vee(),s=void 0;if(e.scene&&r){var a,o,l,u;s=function(h){a===void 0&&(a=r.clone().applyMatrix4(e.scene.matrixWorld.clone().invert())),o===void 0&&(o=a.length()),l===void 0&&(l=Math.sqrt(Math.pow(o,2)-Math.pow(i,2))),u===void 0&&(u=Math.acos(l/o));var f=a.distanceTo(h);if(f<l)return!1;var p=h.length(),g=Math.acos((Math.pow(o,2)+Math.pow(f,2)-Math.pow(p,2))/(2*o*f));return g<u}}e.layersThatNeedUpdatePov.forEach(function(d){return d.updatePov(t)}),e.layersThatNeedBehindGlobeChecker.forEach(function(d){return d.isBehindGlobe(s)})},pauseAnimation:function(e){return e.animationFrameRequestId!==null&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),e.pausableLayers.forEach(function(t){var r;return(r=t.pauseAnimation)===null||r===void 0?void 0:r.call(t)}),this},resumeAnimation:function(e){return e.animationFrameRequestId===null&&this._animationCycle(),e.pausableLayers.forEach(function(t){var r;return(r=t.resumeAnimation)===null||r===void 0?void 0:r.call(t)}),this},_animationCycle:function(e){e.animationFrameRequestId=requestAnimationFrame(this._animationCycle),e.tweenGroup.update()},_destructor:function(e){this.pauseAnimation(),e.destructableLayers.forEach(function(t){return t._destructor()})}},LJe),stateInit:function(){var e=new tR,t={tweenGroup:e},r={globeLayer:Jme(t),pointsLayer:ege(t),arcsLayer:nge(t),hexBinLayer:rge(t),heatmapsLayer:sge(t),polygonsLayer:age(t),hexedPolygonsLayer:oge(t),pathsLayer:lge(t),tilesLayer:cge(t),particlesLayer:uge(t),ringsLayer:dge(t),labelsLayer:hge(t),htmlElementsLayer:fge(t),objectsLayer:pge(t),customLayer:mge(t)};return Es(Es({tweenGroup:e},r),{},{layersThatNeedUpdatePov:Object.values(r).filter(function(i){return i.hasOwnProperty("updatePov")}),layersThatNeedBehindGlobeChecker:Object.values(r).filter(function(i){return i.hasOwnProperty("isBehindGlobe")}),destructableLayers:Object.values(r).filter(function(i){return i.hasOwnProperty("_destructor")}),pausableLayers:Object.values(r).filter(function(i){return i.hasOwnProperty("pauseAnimation")})})},init:function(e,t,r){var i=r.animateIn,s=i===void 0?!0:i,a=r.waitForGlobeReady,o=a===void 0?!0:a;Ba(e),t.scene=e,t.scene.visible=!1,RJe.forEach(function(u){var d=new NN.Group;t.scene.add(d),t[u](d)});var l=function(){if(s){t.scene.scale.set(1e-6,1e-6,1e-6),t.tweenGroup.add(new Mc({k:1e-6}).to({k:1},600).easing(Ro.Quadratic.Out).onUpdate(function(h){var f=h.k;return t.scene.scale.set(f,f,f)}).onComplete(function(){t.tweenGroup.remove(this)}).start());var d=new NN.Vector3(0,1,0);t.tweenGroup.add(new Mc({rot:Math.PI*2}).to({rot:0},1200).easing(Ro.Quintic.Out).onUpdate(function(h){var f=h.rot;return t.scene.setRotationFromAxisAngle(d,f)}).onComplete(function(){t.tweenGroup.remove(this)}).start())}t.scene.visible=!0,t.onGlobeReady&&t.onGlobeReady()};o?t.globeLayer.onReady(l):l(),this._animationCycle()},update:function(e){}});function uet(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=(function(i){function s(){var a;BR(this,s);for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];return a=UR(this,s,[].concat(l)),a.__kapsuleInstance=xq(n,[].concat(Ds(t?[a]:[]),l)),a}return zR(s,i),VR(s)})(e);
5394return Object.keys(n()).forEach(function(i){return r.prototype[i]=function(){var s,a=(s=this.__kapsuleInstance)[i].apply(s,arguments);return a===this.__kapsuleInstance?this:a}}),r}var det=window.THREE?window.THREE:{Group:Bu},Age=uet(cet,det.Group,!0);const rO={type:"change"},bq={type:"start"},wq={type:"end"},Nee=1e-6,xs={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4},MN=new Jt,hA=new Jt,het=new Ve,kN=new Ve,iO=new Ve,G2=new $h,Mee=new Ve,RN=new Ve,sO=new Ve,PN=new Ve;class fet extends oz{constructor(e,t=null){super(e,t),this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:Vh.ROTATE,MIDDLE:Vh.DOLLY,RIGHT:Vh.PAN},this.target=new Ve,this.state=xs.NONE,this.keyState=xs.NONE,this._lastPosition=new Ve,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new Ve,this._movePrev=new Jt,this._moveCurr=new Jt,this._lastAxis=new Ve,this._zoomStart=new Jt,this._zoomEnd=new Jt,this._panStart=new Jt,this._panEnd=new Jt,this._pointers=[],this._pointerPositions={},this._onPointerMove=met.bind(this),this._onPointerDown=pet.bind(this),this._onPointerUp=get.bind(this),this._onPointerCancel=Aet.bind(this),this._onContextMenu=Tet.bind(this),this._onMouseWheel=_et.bind(this),this._onKeyDown=vet.bind(this),this._onKeyUp=xet.bind(this),this._onTouchStart=Eet.bind(this),this._onTouchMove=Cet.bind(this),this._onTouchEnd=Net.bind(this),this._onMouseDown=yet.bind(this),this._onMouseMove=bet.bind(this),this._onMouseUp=wet.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,t!==null&&(this.connect(t),this.handleResize()),this.update()}connect(e){super.connect(e),window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),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._onPointerCancel),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction=""}dispose(){this.disconnect()}handleResize(){const e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}update(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>Nee&&(this.dispatchEvent(rO),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>Nee||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(rO),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type.")}reset(){this.state=xs.NONE,this.keyState=xs.NONE,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this.object.zoom=this._zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(rO),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(hA.copy(this._panEnd).sub(this._panStart),hA.lengthSq()){if(this.object.isOrthographicCamera){const e=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,t=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;hA.x*=e,hA.y*=t}hA.multiplyScalar(this._eye.length()*this.panSpeed),kN.copy(this._eye).cross(this.object.up).setLength(hA.x),kN.add(het.copy(this.object.up).setLength(hA.y)),this.object.position.add(kN),this.target.add(kN),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(hA.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){PN.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let e=PN.length();e?(this._eye.copy(this.object.position).sub(this.target),Mee.copy(this._eye).normalize(),RN.copy(this.object.up).normalize(),sO.crossVectors(RN,Mee).normalize(),RN.setLength(this._moveCurr.y-this._movePrev.y),sO.setLength(this._moveCurr.x-this._movePrev.x),PN.copy(RN.add(sO)),iO.crossVectors(PN,this._eye).normalize(),e*=this.rotateSpeed,G2.setFromAxisAngle(iO,e),this._eye.applyQuaternion(G2),this.object.up.applyQuaternion(G2),this._lastAxis.copy(iO),this._lastAngle=e):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),G2.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(G2),this.object.up.applyQuaternion(G2)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let e;this.state===xs.TOUCH_ZOOM_PAN?(e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom=zw.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(e=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,e!==1&&e>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom=zw.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}_getMouseOnScreen(e,t){return MN.set((e-this.screen.left)/this.screen.width,(t-this.screen.top)/this.screen.height),MN}_getMouseOnCircle(e,t){return MN.set((e-this.screen.width*.5-this.screen.left)/(this.screen.width*.5),(this.screen.height+2*(this.screen.top-t))/this.screen.width),MN}_addPointer(e){this._pointers.push(e)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t].pointerId==e.pointerId){this._pointers.splice(t,1);return}}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new Jt,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[t.pointerId]}_checkDistances(){(!this.noZoom||!this.noPan)&&(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))}}function pet(n){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(n.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),this._addPointer(n),n.pointerType==="touch"?this._onTouchStart(n):this._onMouseDown(n))}function met(n){this.enabled!==!1&&(n.pointerType==="touch"?this._onTouchMove(n):this._onMouseMove(n))}function get(n){this.enabled!==!1&&(n.pointerType==="touch"?this._onTouchEnd(n):this._onMouseUp(),this._removePointer(n),this._pointers.length===0&&(this.domElement.releasePointerCapture(n.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp)))}function Aet(n){this._removePointer(n)}function xet(){this.enabled!==!1&&(this.keyState=xs.NONE,window.addEventListener("keydown",this._onKeyDown))}function vet(n){this.enabled!==!1&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===xs.NONE&&(n.code===this.keys[xs.ROTATE]&&!this.noRotate?this.keyState=xs.ROTATE:n.code===this.keys[xs.ZOOM]&&!this.noZoom?this.keyState=xs.ZOOM:n.code===this.keys[xs.PAN]&&!this.noPan&&(this.keyState=xs.PAN)))}function yet(n){let e;switch(n.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 Vh.DOLLY:this.state=xs.ZOOM;break;case Vh.ROTATE:this.state=xs.ROTATE;break;case Vh.PAN:this.state=xs.PAN;break;default:this.state=xs.NONE}const t=this.keyState!==xs.NONE?this.keyState:this.state;t===xs.ROTATE&&!this.noRotate?(this._moveCurr.copy(this._getMouseOnCircle(n.pageX,n.pageY)),this._movePrev.copy(this._moveCurr)):t===xs.ZOOM&&!this.noZoom?(this._zoomStart.copy(this._getMouseOnScreen(n.pageX,n.pageY)),this._zoomEnd.copy(this._zoomStart)):t===xs.PAN&&!this.noPan&&(this._panStart.copy(this._getMouseOnScreen(n.pageX,n.pageY)),this._panEnd.copy(this._panStart)),this.dispatchEvent(bq)}function bet(n){const e=this.keyState!==xs.NONE?this.keyState:this.state;e===xs.ROTATE&&!this.noRotate?(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(n.pageX,n.pageY))):e===xs.ZOOM&&!this.noZoom?this._zoomEnd.copy(this._getMouseOnScreen(n.pageX,n.pageY)):e===xs.PAN&&!this.noPan&&this._panEnd.copy(this._getMouseOnScreen(n.pageX,n.pageY))}function wet(){this.state=xs.NONE,this.dispatchEvent(wq)}function _et(n){if(this.enabled!==!1&&this.noZoom!==!0){switch(n.preventDefault(),n.deltaMode){case 2:this._zoomStart.y-=n.deltaY*.025;break;case 1:this._zoomStart.y-=n.deltaY*.01;break;default:this._zoomStart.y-=n.deltaY*25e-5;break}this.dispatchEvent(bq),this.dispatchEvent(wq)}}function Tet(n){this.enabled!==!1&&n.preventDefault()}function Eet(n){switch(this._trackPointer(n),this._pointers.length){case 1:this.state=xs.TOUCH_ROTATE,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);break;default:this.state=xs.TOUCH_ZOOM_PAN;const e=this._pointers[0].pageX-this._pointers[1].pageX,t=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(e*e+t*t);const r=(this._pointers[0].pageX+this._pointers[1].pageX)/2,i=(this._pointers[0].pageY+this._pointers[1].pageY)/2;
5394this._panStart.copy(this._getMouseOnScreen(r,i)),this._panEnd.copy(this._panStart);break}this.dispatchEvent(bq)}function Cet(n){switch(this._trackPointer(n),this._pointers.length){case 1:this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(n.pageX,n.pageY));break;default:const e=this._getSecondPointerPosition(n),t=n.pageX-e.x,r=n.pageY-e.y;this._touchZoomDistanceEnd=Math.sqrt(t*t+r*r);const i=(n.pageX+e.x)/2,s=(n.pageY+e.y)/2;this._panEnd.copy(this._getMouseOnScreen(i,s));break}}function Net(n){switch(this._pointers.length){case 0:this.state=xs.NONE;break;case 1:this.state=xs.TOUCH_ROTATE,this._moveCurr.copy(this._getMouseOnCircle(n.pageX,n.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=xs.TOUCH_ZOOM_PAN;for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId!==n.pointerId){const t=this._pointerPositions[this._pointers[e].pointerId];this._moveCurr.copy(this._getMouseOnCircle(t.x,t.y)),this._movePrev.copy(this._moveCurr);break}break}this.dispatchEvent(wq)}const kee={type:"change"},_q={type:"start"},xge={type:"end"},LN=new TT,Ree=new Xp,Met=Math.cos(70*zw.DEG2RAD),Fo=new Ve,ku=2*Math.PI,Vs={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},aO=1e-6;class ket extends oz{constructor(e,t=null){super(e,t),this.state=Vs.NONE,this.target=new Ve,this.cursor=new Ve,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:Vh.ROTATE,MIDDLE:Vh.DOLLY,RIGHT:Vh.PAN},this.touches={ONE:fb.ROTATE,TWO:fb.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 Ve,this._lastQuaternion=new $h,this._lastTargetPosition=new Ve,this._quat=new $h().setFromUnitVectors(e.up,new Ve(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new DQ,this._sphericalDelta=new DQ,this._scale=1,this._panOffset=new Ve,this._rotateStart=new Jt,this._rotateEnd=new Jt,this._rotateDelta=new Jt,this._panStart=new Jt,this._panEnd=new Jt,this._panDelta=new Jt,this._dollyStart=new Jt,this._dollyEnd=new Jt,this._dollyDelta=new Jt,this._dollyDirection=new Ve,this._mouse=new Jt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Pet.bind(this),this._onPointerDown=Ret.bind(this),this._onPointerUp=Let.bind(this),this._onContextMenu=Bet.bind(this),this._onMouseWheel=jet.bind(this),this._onKeyDown=Iet.bind(this),this._onTouchStart=Fet.bind(this),this._onTouchMove=Uet.bind(this),this._onMouseDown=Oet.bind(this),this._onMouseMove=Det.bind(this),this._interceptControlDown=Vet.bind(this),this._interceptControlUp=zet.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(kee),this.update(),this.state=Vs.NONE}pan(e,t){this._pan(e,t),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 t=this.object.position;Fo.copy(t).sub(this.target),Fo.applyQuaternion(this._quat),this._spherical.setFromVector3(Fo),this.autoRotate&&this.state===Vs.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 r=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(r)&&isFinite(i)&&(r<-Math.PI?r+=ku:r>Math.PI&&(r-=ku),i<-Math.PI?i+=ku:i>Math.PI&&(i-=ku),r<=i?this._spherical.theta=Math.max(r,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+i)/2?Math.max(r,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radiu
vendor: 16,384 bytes, line 5394
5394s=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(Fo.setFromSpherical(this._spherical),Fo.applyQuaternion(this._quatInverse),t.copy(this.target).add(Fo),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=Fo.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 Ve(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 Ve(this._mouse.x,this._mouse.y,0);u.unproject(this.object),this.object.position.sub(u).add(o),this.object.updateMatrixWorld(),a=Fo.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):(LN.origin.copy(this.object.position),LN.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(LN.direction))<Met?this.object.lookAt(this.target):(Ree.setFromNormalAndCoplanarPoint(this.object.up,this.target),LN.intersectPlane(Ree,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)>aO||8*(1-this._lastQuaternion.dot(this.object.quaternion))>aO||this._lastTargetPosition.distanceToSquared(this.target)>aO?(this.dispatchEvent(kee),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?ku/60*this.autoRotateSpeed*e:ku/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Fo.setFromMatrixColumn(t,0),Fo.multiplyScalar(-e),this._panOffset.add(Fo)}_panUp(e,t){this.screenSpacePanning===!0?Fo.setFromMatrixColumn(t,1):(Fo.setFromMatrixColumn(t,0),Fo.crossVectors(this.object.up,Fo)),Fo.multiplyScalar(e),this._panOffset.add(Fo)}_pan(e,t){const r=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Fo.copy(i).sub(this.target);let s=Fo.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/r.clientHeight,this.object.matrix),this._panUp(2*t*s/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),i=e-r.left,s=t-r.top,a=r.width,o=r.height;this._mouse.x=i/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 t=this.domElement;this._rotateLeft(ku*this._rotateDelta.x/t.clientHeight),this._rotateUp(ku*this._rotateDelta.y/t.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 t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ku*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ku*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ku*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ku*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._rotateStart.set(r,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panStart.set(r,i)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),r=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(r*r+i*i);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 r=this._getSecondPointerPosition(e),i=.5*(e.pageX+r.x),s=.5*(e.pageY+r.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(ku*this._rotateDelta.x/t.clientHeight),this._rotateUp(ku*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panEnd.set(r,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),r=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(r*r+i*i);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+t.x)*.5,o=(e.pageY+t.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 t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new Jt,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,r={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:r.deltaY*=16;break;case 2:r.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(r.deltaY*=10),r}}function Ret(n){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(n.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(n)&&(this._addPointer(n),n.pointerType==="touch"?this._onTouchStart(n):this._onMouseDown(n),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function Pet(n){this.enabled!==!1&&(n.pointerType==="touch"?this._onTouchMove(n):this._onMouseMove(n))}function Let(n){switch(this._removePointer(n),this._pointers.length){case 0:this.domElement.releasePointerCapture(n.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(xge),this.state=Vs.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Oet(n){let e;switch(n.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 Vh.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(n),this.state=Vs.DOLLY;break;case Vh.ROTATE:if(n.ctrlKey||n.metaKey||n.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(n),this.state=Vs.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(n),this.state=Vs.ROTATE}break;case Vh.PAN:if(n.ctrlKey||n.metaKey||n.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(n),this.state=Vs.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(n),this.state=Vs.PAN}break;default:this.state=Vs.NONE}this.state!==Vs.NONE&&this.dispatchEvent(_q)}function Det(n){switch(this.state){case Vs.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(n);break;case Vs.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(n);break;case Vs.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(n);break}}function jet(n){this.enabled===!1||this.enableZoom===!1||this.state!==Vs.NONE||(n.preventDefault(),this.dispatchEvent(_q),this._handleMouseWheel(this._customWheelEvent(n)),this.dispatchEvent(xge))}function Iet(n){this.enabled!==!1&&this._handleKeyDown(n)}function Fet(n){switch(this._trackPointer(n),this._pointers.length){case 1:switch(this.touches.ONE){case fb.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(n),this.state=Vs.TOUCH_ROTATE;break;case fb.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(n),this.state=Vs.TOUCH_PAN;break;default:this.state=Vs.NONE}break;case 2:switch(this.touches.TWO){case fb.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(n),this.state=Vs.TOUCH_DOLLY_PAN;break;case fb.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(n),this.state=Vs.TOUCH_DOLLY_ROTATE;break;default:this.state=Vs.NONE}break;default:this.state=Vs.NONE}this.state!==Vs.NONE&&this.dispatchEvent(_q)}function Uet(n){switch(this._trackPointer(n),this.state){case Vs.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(n),this.update();break;case Vs.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(n),this.update();break;case Vs.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(n),this.update();break;case Vs.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(n),this.update();break;default:this.state=Vs.NONE}}function Bet(n){this.enabled!==!1&&n.preventDefault()}function Vet(n){n.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function zet(n){n.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const Get={type:"change"},Pee=1e-6,Lee=new $h;class qet extends oz{constructor(e,t=null){super(e,t),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this._moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this._moveVector=new Ve(0,0,0),this._rotationVector=new Ve(0,0,0),this._lastQuaternion=new $h,this._lastPosition=new Ve,this._status=0,this._onKeyDown=$et.bind(this),this._onKeyUp=Het.bind(this),this._onPointerMove=Xet.bind(this),this._onPointerDown=Wet.bind(this),this._onPointerUp=Yet.bind(this),this._onPointerCancel=Qet.bind(this),this._onContextMenu=Ket.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction=""}dispose(){this.disconnect()}update(e){if(this.enabled===!1)return;const t=this.object,r=e*this.movementSpeed,i=e*this.rollSpeed;t.translateX(this._moveVector.x*r),t.translateY(this._moveVector.y*r),t.translateZ(this._moveVector.z*r),Lee.set(this._rotationVector.x*i,this._rotationVector.y*i,this._rotationVector.z*i,1).normalize(),t.quaternion.multiply(Lee),(this._lastPosition.distanceToSquared(t.position)>Pee||8*(1-this._lastQuaternion.dot(t.quaternion))>Pee)&&(this.dispatchEvent(Get),this._lastQuaternion.copy(t.quaternion),this._lastPosition.copy(t.position))}_updateMovementVector(){const e=this._moveState.forward||this.autoForward&&!this._moveState.back?1:0;this._moveVector.x=-this._moveState.left+this._move
5394State.right,this._moveVector.y=-this._moveState.down+this._moveState.up,this._moveVector.z=-e+this._moveState.back}_updateRotationVector(){this._rotationVector.x=-this._moveState.pitchDown+this._moveState.pitchUp,this._rotationVector.y=-this._moveState.yawRight+this._moveState.yawLeft,this._rotationVector.z=-this._moveState.rollRight+this._moveState.rollLeft}_getContainerDimensions(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}}}function $et(n){if(!(n.altKey||this.enabled===!1)){switch(n.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this._moveState.forward=1;break;case"KeyS":this._moveState.back=1;break;case"KeyA":this._moveState.left=1;break;case"KeyD":this._moveState.right=1;break;case"KeyR":this._moveState.up=1;break;case"KeyF":this._moveState.down=1;break;case"ArrowUp":this._moveState.pitchUp=1;break;case"ArrowDown":this._moveState.pitchDown=1;break;case"ArrowLeft":this._moveState.yawLeft=1;break;case"ArrowRight":this._moveState.yawRight=1;break;case"KeyQ":this._moveState.rollLeft=1;break;case"KeyE":this._moveState.rollRight=1;break}this._updateMovementVector(),this._updateRotationVector()}}function Het(n){if(this.enabled!==!1){switch(n.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this._moveState.forward=0;break;case"KeyS":this._moveState.back=0;break;case"KeyA":this._moveState.left=0;break;case"KeyD":this._moveState.right=0;break;case"KeyR":this._moveState.up=0;break;case"KeyF":this._moveState.down=0;break;case"ArrowUp":this._moveState.pitchUp=0;break;case"ArrowDown":this._moveState.pitchDown=0;break;case"ArrowLeft":this._moveState.yawLeft=0;break;case"ArrowRight":this._moveState.yawRight=0;break;case"KeyQ":this._moveState.rollLeft=0;break;case"KeyE":this._moveState.rollRight=0;break}this._updateMovementVector(),this._updateRotationVector()}}function Wet(n){if(this.enabled!==!1)if(this.dragToLook)this._status++;else{switch(n.button){case 0:this._moveState.forward=1;break;case 2:this._moveState.back=1;break}this._updateMovementVector()}}function Xet(n){if(this.enabled!==!1&&(!this.dragToLook||this._status>0)){const e=this._getContainerDimensions(),t=e.size[0]/2,r=e.size[1]/2;this._moveState.yawLeft=-(n.pageX-e.offset[0]-t)/t,this._moveState.pitchDown=(n.pageY-e.offset[1]-r)/r,this._updateRotationVector()}}function Yet(n){if(this.enabled!==!1){if(this.dragToLook)this._status--,this._moveState.yawLeft=this._moveState.pitchDown=0;else{switch(n.button){case 0:this._moveState.forward=0;break;case 2:this._moveState.back=0;break}this._updateMovementVector()}this._updateRotationVector()}}function Qet(){this.enabled!==!1&&(this.dragToLook?(this._status=0,this._moveState.yawLeft=this._moveState.pitchDown=0):(this._moveState.forward=0,this._moveState.back=0,this._updateMovementVector()),this._updateRotationVector())}function Ket(n){this.enabled!==!1&&n.preventDefault()}const Zet={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:` 5395 5396 varying vec2 vUv; 5397 5398 void main() { 5399 5400 vUv = uv; 5401 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 5402 5403 }`,fragmentShader:` 5404 5405 uniform float opacity; 5406 5407 uniform sampler2D tDiffuse; 5408 5409 varying vec2 vUv; 5410 5411 void main() { 5412 5413 vec4 texel = texture2D( tDiffuse, vUv ); 5414 gl_FragColor = opacity * texel; 5415 5416 5417 }`};class GR{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const Jet=new S_(-1,1,1,-1,0,1);class ett extends ds{constructor(){super(),this.setAttribute("position",new Bi([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Bi([0,2,0,0,2,0],2))}}const ttt=new ett;class ntt{constructor(e){this._mesh=new ns(ttt,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,Jet)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class rtt extends GR{constructor(e,t="tDiffuse"){super(),this.textureID=t,this.uniforms=null,this.material=null,e instanceof Nc?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=K8.clone(e.uniforms),this.material=new Nc({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this._fsQuad=new ntt(this.material)}render(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this._fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this._fsQuad.render(e))}dispose(){this.material.dispose(),this._fsQuad.dispose()}}class Oee extends GR{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,r){const i=e.getContext(),s=e.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0);let a,o;this.inverse?(a=0,o=1):(a=1,o=0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),s.buffers.stencil.setFunc(i.ALWAYS,a,4294967295),s.buffers.stencil.setClear(o),s.buffers.stencil.setLocked(!0),e.setRenderTarget(r),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.color.setMask(!0),s.buffers.depth.setMask(!0),s.buffers.stencil.setLocked(!1),s.buffers.stencil.setFunc(i.EQUAL,1,4294967295),s.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),s.buffers.stencil.setLocked(!0)}}class itt extends GR{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class stt{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const r=e.getSize(new Jt);this._width=r.width,this._height=r.height,t=new Kf(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Js}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new rtt(Zet),this.copyPass.material.blending=qo,this.timer=new mue}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}
5417render(e){this.timer.update(),e===void 0&&(e=this.timer.getDelta());const t=this.renderer.getRenderTarget();let r=!1;for(let i=0,s=this.passes.length;i<s;i++){const a=this.passes[i];if(a.enabled!==!1){if(a.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),a.render(this.renderer,this.writeBuffer,this.readBuffer,e,r),a.needsSwap){if(r){const o=this.renderer.getContext(),l=this.renderer.state.buffers.stencil;l.setFunc(o.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),l.setFunc(o.EQUAL,1,4294967295)}this.swapBuffers()}Oee!==void 0&&(a instanceof Oee?r=!0:a instanceof itt&&(r=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new Jt);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const r=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(r,i),this.renderTarget2.setSize(r,i);for(let s=0;s<this.passes.length;s++)this.passes[s].setSize(r,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class att extends GR{constructor(e,t,r=null,i=null,s=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=i,this.clearAlpha=s,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this.isRenderPass=!0,this._oldClearColor=new tr}render(e,t,r){const i=e.autoClear;e.autoClear=!1;let s,a;this.overrideMaterial!==null&&(a=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),this.clearAlpha!==null&&(s=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:r),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(s),this.overrideMaterial!==null&&(this.scene.overrideMaterial=a),e.autoClear=i}}function er(){return er=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},er.apply(null,arguments)}function Sq(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function n_(n,e){return n_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},n_(n,e)}function Tq(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n_(n,e)}function G5(n){return G5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G5(n)}function ott(n){try{return Function.toString.call(n).indexOf("[native code]")!==-1}catch{return typeof n=="function"}}function Eq(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Eq=function(){return!!n})()}function ltt(n,e,t){if(Eq())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(n.bind.apply(n,r));return t&&n_(i,t.prototype),i}function fU(n){var e=typeof Map=="function"?new Map:void 0;return fU=function(r){if(r===null||!ott(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return ltt(r,arguments,G5(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n_(i,r)},fU(n)}var c0=(function(n){Tq(e,n);function e(t){var r;return r=n.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this,Sq(r)}return e})(fU(Error));function oO(n){return Math.round(n*255)}function ctt(n,e,t){return oO(n)+","+oO(e)+","+oO(t)}function Hk(n,e,t,r){if(r===void 0&&(r=ctt),e===0)return r(t,t,t);var i=(n%360+360)%360/60,s=(1-Math.abs(2*t-1))*e,a=s*(1-Math.abs(i%2-1)),o=0,l=0,u=0;i>=0&&i<1?(o=s,l=a):i>=1&&i<2?(o=a,l=s):i>=2&&i<3?(l=s,u=a):i>=3&&i<4?(l=a,u=s):i>=4&&i<5?(o=a,u=s):i>=5&&i<6&&(o=s,u=a);var d=t-s/2,h=o+d,f=l+d,p=u+d;return r(h,f,p)}var Dee={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
54170",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function utt(n){if(typeof n!="string")return n;var e=n.toLowerCase();return Dee[e]?"#"+Dee[e]:n}var dtt=/^#[a-fA-F0-9]{6}$/,htt=/^#[a-fA-F0-9]{8}$/,ftt=/^#[a-fA-F0-9]{3}$/,ptt=/^#[a-fA-F0-9]{4}$/,lO=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,mtt=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,gtt=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Att=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function r_(n){if(typeof n!="string")throw new c0(3);var e=utt(n);if(e.match(dtt))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(htt)){var t=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alph
5417a:t}}if(e.match(ftt))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(ptt)){var r=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:r}}var i=lO.exec(e);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var s=mtt.exec(e.substring(0,50));if(s)return{red:parseInt(""+s[1],10),green:parseInt(""+s[2],10),blue:parseInt(""+s[3],10),alpha:parseFloat(""+s[4])>1?parseFloat(""+s[4])/100:parseFloat(""+s[4])};var a=gtt.exec(e);if(a){var o=parseInt(""+a[1],10),l=parseInt(""+a[2],10)/100,u=parseInt(""+a[3],10)/100,d="rgb("+Hk(o,l,u)+")",h=lO.exec(d);if(!h)throw new c0(4);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10)}}var f=Att.exec(e.substring(0,50));if(f){var p=parseInt(""+f[1],10),g=parseInt(""+f[2],10)/100,A=parseInt(""+f[3],10)/100,x="rgb("+Hk(p,g,A)+")",b=lO.exec(x);if(!b)throw new c0(4);return{red:parseInt(""+b[1],10),green:parseInt(""+b[2],10),blue:parseInt(""+b[3],10),alpha:parseFloat(""+f[4])>1?parseFloat(""+f[4])/100:parseFloat(""+f[4])}}throw new c0(5)}function xtt(n){var e=n.red/255,t=n.green/255,r=n.blue/255,i=Math.max(e,t,r),s=Math.min(e,t,r),a=(i+s)/2;if(i===s)return n.alpha!==void 0?{hue:0,saturation:0,lightness:a,alpha:n.alpha}:{hue:0,saturation:0,lightness:a};var o,l=i-s,u=a>.5?l/(2-i-s):l/(i+s);switch(i){case e:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-e)/l+2;break;default:o=(e-t)/l+4;break}return o*=60,n.alpha!==void 0?{hue:o,saturation:u,lightness:a,alpha:n.alpha}:{hue:o,saturation:u,lightness:a}}function ex(n){return xtt(r_(n))}var vtt=function(e){return e.length===7&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},pU=vtt;function Hx(n){var e=n.toString(16);return e.length===1?"0"+e:e}function cO(n){return Hx(Math.round(n*255))}function ytt(n,e,t){return pU("#"+cO(n)+cO(e)+cO(t))}function vge(n,e,t){return Hk(n,e,t,ytt)}function btt(n,e,t){if(typeof n=="object"&&e===void 0&&t===void 0)return vge(n.hue,n.saturation,n.lightness);throw new c0(1)}function wtt(n,e,t,r){if(typeof n=="object"&&e===void 0&&t===void 0&&r===void 0)return n.alpha>=1?vge(n.hue,n.saturation,n.lightness):"rgba("+Hk(n.hue,n.saturation,n.lightness)+","+n.alpha+")";throw new c0(2)}function yge(n,e,t){if(typeof n=="number"&&typeof e=="number"&&typeof t=="number")return pU("#"+Hx(n)+Hx(e)+Hx(t));if(typeof n=="object"&&e===void 0&&t===void 0)return pU("#"+Hx(n.red)+Hx(n.green)+Hx(n.blue));throw new c0(6)}function qR(n,e,t,r){if(typeof n=="object"&&e===void 0&&t===void 0&&r===void 0)return n.alpha>=1?yge(n.red,n.green,n.blue):"rgba("+n.red+","+n.green+","+n.blue+","+n.alpha+")";throw new c0(7)}var _tt=function(e){return typeof e.red=="number"&&typeof e.green=="number"&&typeof e.blue=="number"&&(typeof e.alpha!="number"||typeof e.alpha>"u")},Stt=function(e){return typeof e.red=="number"&&typeof e.green=="number"&&typeof e.blue=="number"&&typeof e.alpha=="number"},Ttt=function(e){return typeof e.hue=="number"&&typeof e.saturation=="number"&&typeof e.lightness=="number"&&(typeof e.alpha!="number"||typeof e.alpha>"u")},Ett=function(e){return typeof e.hue=="number"&&typeof e.saturation=="number"&&typeof e.lightness=="number"&&typeof e.alpha=="number"};function tx(n){if(typeof n!="object")throw new c0(8);if(Stt(n))return qR(n);if(_tt(n))return yge(n);if(Ett(n))return wtt(n);if(Ttt(n))return btt(n);throw new c0(8)}function bge(n,e,t){return function(){var i=t.concat(Array.prototype.slice.call(arguments));return i.length>=e?n.apply(this,i):bge(n,e,i)}}function sh(n){return bge(n,n.length,[])}function Ctt(n,e){if(e==="transparent")return e;var t=ex(e);return tx(er({},t,{hue:t.hue+parseFloat(n)}))}sh(Ctt);function L_(n,e,t){return Math.max(n,Math.min(e,t))}function Ntt(n,e){if(e==="transparent")return e;var t=ex(e);return tx(er({},t,{lightness:L_(0,1,t.lightness-parseFloat(n))}))}sh(Ntt);function Mtt(n,e){if(e==="transparent")return e;var t=ex(e);return tx(er({},t,{saturation:L_(0,1,t.saturation-parseFloat(n))}))}sh(Mtt);function ktt(n,e){if(e==="transparent")return e;var t=ex(e);return tx(er({},t,{lightness:L_(0,1,t.lightness+parseFloat(n))}))}sh(ktt);function Rtt(n,e,t){if(e==="transparent")return t;if(t==="transparent")return e;if(n===0)return t;var r=r_(e),i=er({},r,{alpha:typeof r.alpha=="number"?r.alpha:1}),s=r_(t),a=er({},s,{alpha:typeof s.alpha=="number"?s.alpha:1}),o=i.alpha-a.alpha,l=parseFloat(n)*2-1,u=l*o===-1?l:l+o,d=1+l*o,h=(u/d+1)/2,f=1-h,p={red:Math.floor(i.red*h+a.red*f),green:Math.floor(i.green*h+a.green*f),blue:Math.floor(i.blue*h+a.blue*f),alpha:i.alpha*parseFloat(n)+a.alpha*(1-parseFloat(n))};return qR(p)}var Ptt=sh(Rtt),wge=Ptt;function Ltt(n,e){if(e==="transparent")return e;var t=r_(e),r=typeof t.alpha=="number"?t.alpha:1,i=er({},t,{alpha:L_(0,1,(r*100+parseFloat(n)*100)/100)});return qR(i)}var Ott=sh(Ltt),Dtt=Ott;function jtt(n,e){if(e==="transparent")return e;var t=ex(e);return tx(er({},t,{saturation:L_(0,1,t.saturation+parseFloat(n))}))}sh(jtt);function Itt(n,e){return e==="transparent"?e:tx(er({},ex(e),{hue:parseFloat(n)}))}sh(Itt);function Ftt(n,e){return e==="transparent"?e:tx(er({},ex(e),{lightness:parseFloat(n)}))}sh(Ftt);function Utt(n,e){return e==="transparent"?e:tx(er({},ex(e),{saturation:parseFloat(n)}))}sh(Utt);function Btt(n,e){return e==="transparent"?e:wge(parseFloat(n),"rgb(0, 0, 0)",e)}sh(Btt);function Vtt(n,e){return e==="transparent"?e:wge(parseFloat(n),"rgb(255, 255, 255)",e)}sh(Vtt);function ztt(n,e){if(e==="transparent")return e;var t=r_(e),r=typeof t.alpha=="number"?t.alpha:1,i=er({}
vendor: 14,957 bytes, line 5417
5417,t,{alpha:L_(0,1,+(r*100-parseFloat(n)*100).toFixed(2)/100)});return qR(i)}sh(ztt);var mU="http://www.w3.org/1999/xhtml";const jee={svg:"http://www.w3.org/2000/svg",xhtml:mU,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _ge(n){var e=n+="",t=e.indexOf(":");return t>=0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),jee.hasOwnProperty(e)?{space:jee[e],local:n}:n}function Gtt(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===mU&&e.documentElement.namespaceURI===mU?e.createElement(n):e.createElementNS(t,n)}}function qtt(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Sge(n){var e=_ge(n);return(e.local?qtt:Gtt)(e)}function $tt(){}function Tge(n){return n==null?$tt:function(){return this.querySelector(n)}}function Htt(n){typeof n!="function"&&(n=Tge(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i<t;++i)for(var s=e[i],a=s.length,o=r[i]=new Array(a),l,u,d=0;d<a;++d)(l=s[d])&&(u=n.call(l,l.__data__,d,s))&&("__data__"in l&&(u.__data__=l.__data__),o[d]=u);return new Qh(r,this._parents)}function Wtt(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function Xtt(){return[]}function Ytt(n){return n==null?Xtt:function(){return this.querySelectorAll(n)}}function Qtt(n){return function(){return Wtt(n.apply(this,arguments))}}function Ktt(n){typeof n=="function"?n=Qtt(n):n=Ytt(n);for(var e=this._groups,t=e.length,r=[],i=[],s=0;s<t;++s)for(var a=e[s],o=a.length,l,u=0;u<o;++u)(l=a[u])&&(r.push(n.call(l,l.__data__,u,a)),i.push(l));return new Qh(r,i)}function Ztt(n){return function(){return this.matches(n)}}function Ege(n){return function(e){return e.matches(n)}}var Jtt=Array.prototype.find;function ent(n){return function(){return Jtt.call(this.children,n)}}function tnt(){return this.firstElementChild}function nnt(n){return this.select(n==null?tnt:ent(typeof n=="function"?n:Ege(n)))}var rnt=Array.prototype.filter;function int(){return Array.from(this.children)}function snt(n){return function(){return rnt.call(this.children,n)}}function ant(n){return this.selectAll(n==null?int:snt(typeof n=="function"?n:Ege(n)))}function ont(n){typeof n!="function"&&(n=Ztt(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i<t;++i)for(var s=e[i],a=s.length,o=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&n.call(l,l.__data__,u,s)&&o.push(l);return new Qh(r,this._parents)}function Cge(n){return new Array(n.length)}function lnt(){return new Qh(this._enter||this._groups.map(Cge),this._parents)}function Wk(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}Wk.prototype={constructor:Wk,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function cnt(n){return function(){return n}}function unt(n,e,t,r,i,s){for(var a=0,o,l=e.length,u=s.length;a<u;++a)(o=e[a])?(o.__data__=s[a],r[a]=o):t[a]=new Wk(n,s[a]);for(;a<l;++a)(o=e[a])&&(i[a]=o)}function dnt(n,e,t,r,i,s,a){var o,l,u=new Map,d=e.length,h=s.length,f=new Array(d),p;for(o=0;o<d;++o)(l=e[o])&&(f[o]=p=a.call(l,l.__data__,o,e)+"",u.has(p)?i[o]=l:u.set(p,l));for(o=0;o<h;++o)p=a.call(n,s[o],o,s)+"",(l=u.get(p))?(r[o]=l,l.__data__=s[o],u.delete(p)):t[o]=new Wk(n,s[o]);for(o=0;o<d;++o)(l=e[o])&&u.get(f[o])===l&&(i[o]=l)}function hnt(n){return n.__data__}function fnt(n,e){if(!arguments.length)return Array.from(this,hnt);var t=e?dnt:unt,r=this._parents,i=this._groups;typeof n!="function"&&(n=cnt(n));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),u=0;u<s;++u){var d=r[u],h=i[u],f=h.length,p=pnt(n.call(d,d&&d.__data__,u,r)),g=p.length,A=o[u]=new Array(g),x=a[u]=new Array(g),b=l[u]=new Array(f);t(d,h,A,x,b,p,e);for(var _=0,M=0,T,L;_<g;++_)if(T=A[_]){for(_>=M&&(M=_+1);!(L=x[M])&&++M<g;);T._next=L||null}}return a=new Qh(a,r),a._enter=o,a._exit=l,a}function pnt(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function mnt(){return new Qh(this._exit||this._groups.map(Cge),this._parents)}function gnt(n,e,t){var r=this.enter(),i=this,s=this.exit();return typeof n=="function"?(r=n(r),r&&(r=r.selection())):r=r.append(n+""),e!=null&&(i=e(i),i&&(i=i.selection())),t==null?s.remove():t(s),r&&i?r.merge(i).order():i}function Ant(n){for(var e=n.selection?n.selection():n,t=this._groups,r=e._groups,i=t.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var u=t[l],d=r[l],h=u.length,f=o[l]=new Array(h),p,g=0;g<h;++g)(p=u[g]||d[g])&&(f[g]=p);for(;l<i;++l)o[l]=t[l];return new Qh(o,this._parents)}function xnt(){for(var n=this._groups,e=-1,t=n.length;++e<t;)for(var r=n[e],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function vnt(n){n||(n=ynt);function e(h,f){return h&&f?n(h.__data__,f.__data__):!h-!f}for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s){for(var a=t[s],o=a.length,l=i[s]=new Array(o),u,d=0;d<o;++d)(u=a[d])&&(l[d]=u);l.sort(e)}return new Qh(i,this._parents).order()}function ynt(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function bnt(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function wnt(){return Array.from(this)}function _nt(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function Snt(){let n=0;for(const e of this)++n;return n}function Tnt(){return!this.node()}function Ent(n){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],s=0,a=i.length,o;s<a;++s)(o=i[s])&&n.call(o,o.__data__,s,i);return this}function Cnt(n){return function(){this.removeAttribute(n)}}function Nnt(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Mnt(n,e){return function(){this.setAttribute(n,e)}}function knt(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function Rnt(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttribute(n):this.setAttribute(n,t)}}function Pnt(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function Lnt(n,e){var t=_ge(n);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((e==null?t.local?Nnt:Cnt:typeof e=="function"?t.local?Pnt:Rnt:t.local?knt:Mnt)(t,e))}function Nge(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function Ont(n){return function(){this.style.removeProperty(n)}}function Dnt(n,e,t){return function(){this.style.setProperty(n,e,t)}}function jnt(n,e,t){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function Int(n,e,t){return arguments.length>1?this.each((e==null?Ont:typeof e=="function"?jnt:Dnt)(n,e,t??"")):Fnt(this.node(),n)}function Fnt(n,e){return n.style.getPropertyValue(e)||Nge(n).getComputedStyle(n,null).getPropertyValue(e)}function Unt(n){return function(){delete this[n]}}function Bnt(n,e){return function(){this[n]=e}}function Vnt(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function znt(n,e){return arguments.length>1?this.each((e==null?Unt:typeof e=="function"?Vnt:Bnt)(n,e)):this.node()[n]}function Mge(n){return n.trim().split(/^|\s+/)}function Cq(n){return n.classList||new kge(n)}function kge(n){this._node=n,this._names=Mge(n.getAttribute("class")||"")}kge.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function Rge(n,e){for(var t=Cq(n),r=-1,i=e.length;++r<i;)t.add(e[r])}function Pge(n,e){for(var t=Cq(n),r=-1,i=e.length;++r<i;)t.remove(e[r])}function Gnt(n){return function(){Rge(this,n)}}function qnt(n){return function(){Pge(this,n)}}function $nt(n,e){return function(){(e.apply(this,arguments)?Rge:Pge)(this,n)}}function Hnt(n,e){var t=Mge(n+"");if(arguments.length<2){for(var r=Cq(this.node()),i=-1,s=t.length;++i<s;)if(!r.contains(t[i]))return!1;return!0}return this.each((typeof e=="function"?$nt:e?Gnt:qnt)(t,e))}function Wnt(){this.textContent=""}function Xnt(n){return function(){this.textContent=n}}function Ynt(n){return function(){var e=n.apply(this,arguments);this.textContent=e??""}}function Qnt(n){return arguments.length?this.each(n==null?Wnt:(typeof n=="function"?Ynt:Xnt)(n)):this.node().textContent}function Knt(){this.innerHTML=""}function Znt(n){return function(){this.innerHTML=n}}function Jnt(n){return function(){var e=n.apply(this,arguments);this.innerHTML=e??""}}function ert(n){return arguments.length?this.each(n==null?Knt:(typeof n=="function"?Jnt:Znt)(n)):this.node().innerHTML}function trt(){this.nextSibling&&this.parentNode.appendChild(this)}function nrt(){return this.each(trt)}function rrt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function irt(){return this.each(rrt)}function srt(n){var e=typeof n=="function"?n:Sge(n);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function art(){return null}function ort(n,e){var t=typeof n=="function"?n:Sge(n),r=e==null?art:typeof e=="function"?e:Tge(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)})}function lrt(){var n=this.parentNode;n&&n.removeChild(this)}function crt(){return this.each(lrt)}function urt(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function drt(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function hrt(n){return this.select(n?drt:urt)}function frt(n){return arguments.length?this.property("__data__",n):this.node().__data__}function prt(n){return function(e){n.call(this,e,this.__data__)}}function mrt(n){return n.trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{type:e,name:t}})}function grt(n){return function(){var e=this.__on;if(e){for(var t=0,r=-1,i=e.length,s;t<i;++t)s=e[t],(!n.type||s.type===n.type)&&s.name===n.name?this.removeEventListener(s.type,s.listener,s.options):e[++r]=s;++r?e.length=r:delete this.__on}}}function Art(n,e,t){return function(){var r=this.__on,i,s=prt(e);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===n.type&&i.name===n.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=t),i.value=e;return}}this.addEventListener(n.type,s,t),i={type:n.type,name:n.name,value:e,listener:s,options:t},r?r.push(i):this.__on=[i]}}function xrt(n,e,t){var r=mrt(n+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,u=o.length,d;l<u;++l)for(i=0,d=o[l];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(o=e?Art:grt,i=0;i<s;++i)this.each(o(r[i],e,t));return this}function Lge(n,e,t){var r=Nge(n),i=r.CustomEvent;typeof i=="function"?i=new i(e,t):(i=r.document.createEvent("Event"),t?(i.initEvent(e,t.bubbles,t.cancelable),i.detail=t.detail):i.initEvent(e,!1,!1)),n.dispatchEvent(i)}function vrt(n,e){return function(){return Lge(this,n,e)}}function yrt(n,e){return function(){return Lge(this,n,e.apply(this,arguments))}}function brt(n,e){return this.each((typeof e=="function"?yrt:vrt)(n,e))}function*wrt(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var _rt=[null];function Qh(n,e){this._groups=n,this._parents=e}function Srt(){return this}Qh.prototype={constructor:Qh,select:Htt,selectAll:Ktt,selectChild:nnt,selectChildren:ant,filter:ont,data:fnt,enter:lnt,exit:mnt,join:gnt,merge:Ant,selection:Srt,order:xnt,sort:vnt,call:bnt,nodes:wnt,node:_nt,size:Snt,empty:Tnt,each:Ent,attr:Lnt,style:Int,property:znt,classed:Hnt,text:Qnt,html:ert,raise:nrt,lower:irt,append:srt,insert:ort,remove:crt,clone:hrt,datum:frt,on:xrt,dispatch:brt,[Symbol.iterator]:wrt};function Trt(n){return typeof n=="string"?new Qh([[document.querySelector(n)]],[document.documentElement]):new Qh([[n]],_rt)}function Ert(n){let e;for(;e=n.sourceEvent;)n=e;return n}function Crt(n,e){if(n=Ert(n),e===void 0&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[n.clientX-i.left-e.clientLeft,n.clientY-i.top-e.clientTop]}}return[n.pageX,n.pageY]}var BT,Ta,Oge,Dge,SA,Iee,jge,Ige,uO,P6,C4,Fge,Nq,gU,AU,Xk={},Yk=[],Nrt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$R=Array.isArray;function u0(n,e){for(var t in e)n[t]=e[t];return n}function Mq(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function Mrt(n,e,t){var r,i,s,a={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?BT.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(s in n.defaultProps)a[s]===void 0&&(a[s]=n.defaultProps[s]);return N4(n,a,r,i,null)}function N4(n,e,t,r,i){var s={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Oge,__i:-1,__u:0};return i==null&&Ta.vnode!=null&&Ta.vnode(s),s}function HR(n){return n.children}function L6(n,e){this.props=n,this.context=e}function i_(n,e){if(e==null)return n.__?i_(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?i_(n):null}function krt(n){if(n.__P&&n.__d){var e=n.__v,t=e.__e,r=[],i=[],s=u0({},e);s.__v=e.__v+1,Ta.vnode&&Ta.vnode(s),kq(n.__P,s,e,n.__n,n.__P.namespaceURI,32&e.__u?[t]:null,r,t??i_(e),!!(32&e.__u),i),s.__v=e.__v,s.__.__k[s.__i]=s,Gge(r,s,i),e.__e=e.__=null,s.__e!=t&&Uge(s)}}function Uge(n){if((n=n.__)!=null&&n.__c!=null)return n.__e=n.__c.base=null,n.__k.some(function(e){if(e!=null&&e.__e!=null)return n.__e=n.__c.base=e.__e}),Uge(n)}function Fee(n){(!n.__d&&(n.__d=!0)&&SA.push(n)&&!Qk.__r++||Iee!=Ta.debounceRendering)&&((Iee=Ta.debounceRendering)||jge)(Qk)}function Qk(){try{for(var n,e=1;SA.length;)SA.length>e&&SA.sort(Ige),n=SA.shift(),e=SA.length,krt(n)}finally{SA.length=Qk.__r=0}}function Bge(n,e,t,r,i,s,a,o,l,u,d){var h,f,p,g,A,x,b,_=r&&r.__k||Yk,M=e.length;for(l=Rrt(t,e,_,l,M),h=0;h<M;h++)(p=t.__k[h])!=null&&(f=p.__i!=-1&&_[p.__i]||Xk,p.__i=h,x=kq(n,p,f,i,s,a,o,l,u,d),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Rq(f.ref,null,p),d.push(p.ref,p.__c||g,p)),A==null&&g!=null&&(A=g),(b=!!(4&p.__u))||f.__k===p.__k?(l=Vge(p,l,n,b),b&&f.__e&&(f.__e=null)):typeof p.t
vendor: 4,502 bytes, line 5417
5417ype=="function"&&x!==void 0?l=x:g&&(l=g.nextSibling),p.__u&=-7);return t.__e=A,l}function Rrt(n,e,t,r,i){var s,a,o,l,u,d=t.length,h=d,f=0;for(n.__k=new Array(i),s=0;s<i;s++)(a=e[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=n.__k[s]=N4(null,a,null,null,null):$R(a)?a=n.__k[s]=N4(HR,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=n.__k[s]=N4(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):n.__k[s]=a,l=s+f,a.__=n,a.__b=n.__b+1,o=null,(u=a.__i=Prt(a,t,l,h))!=-1&&(h--,(o=t[u])&&(o.__u|=2)),o==null||o.__v==null?(u==-1&&(i>d?f--:i<d&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?f--:u==l+1?f++:(u>l?f--:f++,a.__u|=4))):n.__k[s]=null;if(h)for(s=0;s<d;s++)(o=t[s])!=null&&(2&o.__u)==0&&(o.__e==r&&(r=i_(o)),$ge(o,o));return r}function Vge(n,e,t,r){var i,s;if(typeof n.type=="function"){for(i=n.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=n,e=Vge(i[s],e,t,r));return e}n.__e!=e&&(r&&(e&&n.type&&!e.parentNode&&(e=i_(n)),t.insertBefore(n.__e,e||null)),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Prt(n,e,t,r){var i,s,a,o=n.key,l=n.type,u=e[t],d=u!=null&&(2&u.__u)==0;if(u===null&&o==null||d&&o==u.key&&l==u.type)return t;if(r>(d?1:0)){for(i=t-1,s=t+1;i>=0||s<e.length;)if((u=e[a=i>=0?i--:s++])!=null&&(2&u.__u)==0&&o==u.key&&l==u.type)return a}return-1}function Uee(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||Nrt.test(e)?t:t+"px"}function ON(n,e,t,r,i){var s,a;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||Uee(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||Uee(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Fge,"$1")),a=e.toLowerCase(),e=a in n||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),n.l||(n.l={}),n.l[e+s]=t,t?r?t[C4]=r[C4]:(t[C4]=Nq,n.addEventListener(e,s?AU:gU,s)):n.removeEventListener(e,s?AU:gU,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function Bee(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e[P6]==null)e[P6]=Nq++;else if(e[P6]<t[C4])return;return t(Ta.event?Ta.event(e):e)}}}function kq(n,e,t,r,i,s,a,o,l,u){var d,h,f,p,g,A,x,b,_,M,T,L,D,P,O,F,U=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),s=[o=e.__e=t.__e]),(d=Ta.__b)&&d(e);e:if(typeof U=="function"){h=a.length;try{if(_=e.props,M=U.prototype&&U.prototype.render,T=(d=U.contextType)&&r[d.__c],L=d?T?T.props.value:d.__:r,t.__c?b=(f=e.__c=t.__c).__=f.__E:(M?e.__c=f=new U(_,L):(e.__c=f=new L6(_,L),f.constructor=U,f.render=Ort),T&&T.sub(f),f.state||(f.state={}),f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),M&&f.__s==null&&(f.__s=f.state),M&&U.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=u0({},f.__s)),u0(f.__s,U.getDerivedStateFromProps(_,f.__s))),g=f.props,A=f.state,f.__v=e,p)M&&U.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),M&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(M&&U.getDerivedStateFromProps==null&&_!==g&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(_,L),e.__v==t.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(_,f.__s,L)===!1){e.__v!=t.__v&&(f.props=_,f.state=f.__s,f.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(B){B&&(B.__=e)}),Yk.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&a.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(_,f.__s,L),M&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(g,A,x)})}if(f.context=L,f.props=_,f.__P=n,f.__e=!1,D=Ta.__r,P=0,M)f.state=f.__s,f.__d=!1,D&&D(e),d=f.render(f.props,f.state,f.context),Yk.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,D&&D(e),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++P<25);f.state=f.__s,f.getChildContext!=null&&(r=u0(u0({},r),f.getChildContext())),M&&!p&&f.getSnapshotBeforeUpdate!=null&&(x=f.getSnapshotBeforeUpdate(g,A)),O=d!=null&&d.type===HR&&d.key==null?qge(d.props.children):d,o=Bge(n,$R(O)?O:[O],e,t,r,i,s,a,o,l,u),f.base=e.__e,e.__u&=-161,f.__h.length&&a.push(f),b&&(f.__E=f.__=null)}
vendor: 4,196 bytes, line 5417
5417catch(B){if(a.length=h,e.__v=null,l||s!=null){if(B.then){for(e.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;s!=null&&(s[s.indexOf(o)]=null),e.__e=o}else if(s!=null)for(F=s.length;F--;)Mq(s[F])}else e.__e=t.__e;e.__k==null&&(e.__k=t.__k||[]),B.then||zge(e),Ta.__e(B,e,t)}}else s==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):o=e.__e=Lrt(t.__e,e,t,r,i,s,a,l,u);return(d=Ta.diffed)&&d(e),128&e.__u?void 0:o}function zge(n){n&&(n.__c&&(n.__c.__e=!0),n.__k&&n.__k.some(zge))}function Gge(n,e,t){for(var r=0;r<t.length;r++)Rq(t[r],t[++r],t[++r]);Ta.__c&&Ta.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(s){s.call(i)})}catch(s){Ta.__e(s,i.__v)}})}function qge(n){return typeof n!="object"||n==null||n.__b>0?n:$R(n)?n.map(qge):n.constructor!==void 0?null:u0({},n)}function Lrt(n,e,t,r,i,s,a,o,l){var u,d,h,f,p,g,A,x=t.props||Xk,b=e.props,_=e.type;if(_=="svg"?i="http://www.w3.org/2000/svg":_=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(u=0;u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!_&&(_?p.localName==_:p.nodeType==3)){n=p,s[u]=null;break}}if(n==null){if(_==null)return document.createTextNode(b);n=document.createElementNS(i,_,b.is&&b),o&&(Ta.__m&&Ta.__m(e,s),o=!1),s=null}if(_==null)x===b||o&&n.data==b||(n.data=b);else{if(s=_=="textarea"&&b.defaultValue!=null?null:s&&BT.call(n.childNodes),!o&&s!=null)for(x={},u=0;u<n.attributes.length;u++)x[(p=n.attributes[u]).name]=p.value;for(u in x)p=x[u],u=="dangerouslySetInnerHTML"?h=p:u=="children"||u in b||u=="value"&&"defaultValue"in b||u=="checked"&&"defaultChecked"in b||ON(n,u,null,p,i);for(u in b)p=b[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?g=p:u=="checked"?A=p:o&&typeof p!="function"||x[u]===p||ON(n,u,p,x[u],i);if(d)o||h&&(d.__html==h.__html||d.__html==n.innerHTML)||(n.innerHTML=d.__html),e.__k=[];else if(h&&(n.innerHTML=""),Bge(e.type=="template"?n.content:n,$R(f)?f:[f],e,t,r,_=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:t.__k&&i_(t,0),o,l),s!=null)for(u=s.length;u--;)Mq(s[u]);o&&_!="textarea"||(u="value",_=="progress"&&g==null?n.removeAttribute("value"):g!=null&&(g!==n[u]||_=="progress"&&!g||_=="option"&&g!=x[u])&&ON(n,u,g,x[u],i),u="checked",A!=null&&A!=n[u]&&ON(n,u,A,x[u],i))}return n}function Rq(n,e,t){try{if(typeof n=="function"){var r=typeof n.__u=="function";r&&n.__u(),r&&e==null||(n.__u=n(e))}else n.current=e}catch(i){Ta.__e(i,t)}}function $ge(n,e,t){var r,i;if(Ta.unmount&&Ta.unmount(n),(r=n.ref)&&(r.current&&r.current!=n.__e||Rq(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){Ta.__e(s,e)}r.base=r.__P=r.__n=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&$ge(r[i],e,t||typeof n.type!="function");t||Mq(n.__e),n.__c=n.__=n.__e=void 0}function Ort(n,e,t){return this.constructor(n,t)}function Drt(n,e,t){var r,i,s,a;e==document&&(e=document.documentElement),Ta.__&&Ta.__(n,e),i=(r=!1)?null:e.__k,s=[],a=[],kq(e,n=e.__k=Mrt(HR,null,[n]),i||Xk,Xk,e.namespaceURI,i?null:e.firstChild?BT.call(e.childNodes):null,s,i?i.__e:e.firstChild,r,a),Gge(s,n,a),n.props.children=null}function Hge(n,e,t){var r,i,s,a,o=u0({},n.props);for(s in n.type&&n.type.defaultProps&&(a=n.type.defaultProps),e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s]===void 0&&a!=null?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?BT.call(arguments,2):t),N4(n.type,o,r||n.key,i||n.ref,null)}BT=Yk.slice,Ta={__e:function(n,e,t,r){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(n)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),a=i.__d),a)return i.__E=i}catch(o){n=o}throw n}},Oge=0,Dge=function(n){return n!=null&&n.constructor===void 0},L6.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=u0({},this.state),typeof n=="function"&&(n=n(u0({},t),this.props)),n&&u0(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),Fee(this))},L6.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),Fee(this))},L6.prototype.render=HR,SA=[],jge=typeof Promise=="function"?Promise.prototype.then.bind(Prom
5417ise.resolve()):setTimeout,Ige=function(n,e){return n.__v.__b-e.__v.__b},Qk.__r=0,uO=Math.random().toString(8),P6="__d"+uO,C4="__a"+uO,Fge=/(PointerCapture)$|Capture$/i,Nq=0,gU=Bee(!1),AU=Bee(!0);function Vee(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function jrt(n){if(Array.isArray(n))return n}function Irt(n,e,t){return(e=Grt(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Frt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Urt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 5418In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zee(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Brt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zee(Object(t),!0).forEach(function(r){Irt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zee(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Vrt(n,e){return jrt(n)||Frt(n,e)||qrt(n,e)||Urt()}function zrt(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Grt(n){var e=zrt(n,"string");return typeof e=="symbol"?e:e+""}function Kk(n){"@babel/helpers - typeof";return Kk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kk(n)}function qrt(n,e){if(n){if(typeof n=="string")return Vee(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Vee(n,e):void 0}}var xU=function(e){if(Kk(e)!=="object")return e;var t=Hge(e);if(t.props){var r;t.props=Brt({},t.props),t!=null&&(r=t.props)!==null&&r!==void 0&&r.children&&(t.props.children=Array.isArray(t.props.children)?t.props.children.map(xU):xU(t.props.children))}return t},$rt=function(e){return Dge(Hge(e))},Hrt=function(e,t){delete t.__k,Drt(xU(e),t)};function Wrt(n,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}}var Xrt=`.float-tooltip-kap { 5419 position: absolute; 5420 width: max-content; /* prevent shrinking near right edge */ 5421 max-width: max(50%, 150px); 5422 padding: 3px 5px; 5423 border-radius: 3px; 5424 font: 12px sans-serif; 5425 color: #eee; 5426 background: rgba(0,0,0,0.6); 5427 pointer-events: none; 5428} 5429`;Wrt(Xrt);var Yrt=Wo({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.style,s=i===void 0?{}:i,a=!!e&&Kk(e)==="object"&&!!e.node&&typeof e.node=="function",o=Trt(a?e.node():e);o.style("position")==="static"&&o.style("position","relative"),t.tooltipEl=o.append("div").attr("class","float-tooltip-kap"),Object.entries(s).forEach(function(u){var d=Vrt(u,2),h=d[0],f=d[1];return t.tooltipEl.style(h,f)}),t.tooltipEl.style("left","-10000px").style("display","none");var l="tooltip-".concat(Math.round(Math.random()*1e12));t.mouseInside=!1,o.on("mousemove.".concat(l),function(u){t.mouseInside=!0;var d=Crt(u),h=o.node(),f=h.offsetWidth,p=h.offsetHeight,g=[t.offsetX===null||t.offsetX===void 0?"-".concat(d[0]/f*100,"%"):typeof t.offsetX=="number"?"calc(-50% + ".concat(t.offsetX,"px)"):t.offsetX,t.offsetY===null||t.offsetY===void 0?p>130&&p-d[1]<100?"calc(-100% - 6px)":"21px":typeof t.offsetY=="number"?t.offsetY<0?"calc(-100% - ".concat(Math.abs(t.offsetY),"px)"):"".concat(t.offsetY,"px"):t.offsetY];t.tooltipEl.style("left",d[0]+"px").style("top",d[1]+"px").style("transform","translate(".concat(g.join(","),")")),t.content&&t.tooltipEl.style("display","inline")}),o.on("mouseover.".concat(l),function(){t.mouseInside=!0,t.content&&t.tooltipEl.style("display","inline")}),o.on("mouseout.".concat(l),function(){t.mouseInside=!1,t.tooltipEl.style("display","none")})},update:function(e){e.tooltipEl.style("display",e.content&&e.mouseInside?"inline":"none"),e.content?e.content instanceof HTMLElement?(e.tooltipEl.text(""),e.tooltipEl.append(function(){return e.content})):typeof e.content=="string"?e.tooltipEl.html(e.content):$rt(e.content)?(e.tooltipEl.text(""),Hrt(e.content,e.tooltipEl.node())):(e.tooltipEl.style("display","none"),console.warn("Tooltip content is invali
5429d, skipping.",e.content,e.content.toString())):e.tooltipEl.text("")}});function Qrt(n,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}}var Krt=`.scene-nav-info { 5430 position: absolute; 5431 bottom: 5px; 5432 width: 100%; 5433 text-align: center; 5434 color: slategrey; 5435 opacity: 0.7; 5436 font-size: 10px; 5437 font-family: sans-serif; 5438 pointer-events: none; 5439 user-select: none; 5440} 5441 5442.scene-container canvas:focus { 5443 outline: none; 5444}`;Qrt(Krt);function vU(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Zrt(n){if(Array.isArray(n))return n}function Jrt(n){if(Array.isArray(n))return vU(n)}function eit(n,e,t){return(e=oit(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tit(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function nit(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function rit(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 5445In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iit(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 5446In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sit(n,e){return Zrt(n)||nit(n,e)||Wge(n,e)||rit()}function Ux(n){return Jrt(n)||tit(n)||Wge(n)||iit()}function ait(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function oit(n){var e=ait(n,"string");return typeof e=="symbol"?e:e+""}function Wge(n,e){if(n){if(typeof n=="string")return vU(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vU(n,e):void 0}}var Xge=function(e){e instanceof Array?e.forEach(Xge):(e.map&&e.map.dispose(),e.dispose())},Yge=function(e){e.geometry&&e.geometry.dispose(),e.material&&Xge(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(Yge)},lit=function(e){for(;e.children.length;){var t=e.children[0];e.remove(t),Yge(t)}},ya=window.THREE?window.THREE:{WebGLRenderer:bLe,Scene:$V,PerspectiveCamera:ul,Raycaster:y8e,SRGBColorSpace:Pl,TextureLoader:iz,Vector2:Jt,Vector3:Ve,Box3:dg,Color:tr,Mesh:ns,SphereGeometry:F0,MeshBasicMaterial:Lh,BackSide:us,Timer:mue},Qge=Wo({props:{width:{default:window.innerWidth,onChange:function(e,t,r){isNaN(e)&&(t.width=r)}},height:{default:window.innerHeight,onChange:function(e,t,r){isNaN(e)&&(t.height=r)}},viewOffset:{default:[0,0]},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(e,t){t.hoverObj=null,t.tooltip&&t.tooltip.content(null)},triggerUpdate:!1},pointerRaycasterThrottleMs:{default:50,triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},pointsHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(e){if(e.initialised){e.controls.enabled&&e.controls.update&&e.controls.update(Math.min(1,e.timer.update(
vendor: 3,125 bytes, line 5446
5446).getDelta())),e.postProcessingComposer?e.postProcessingComposer.render():e.renderer.render(e.scene,e.camera),e.extraRenderers.forEach(function(a){return a.render(e.scene,e.camera)});var t=+new Date;if(e.enablePointerInteraction&&t-e.lastRaycasterCheck>=e.pointerRaycasterThrottleMs){e.lastRaycasterCheck=t;var r=null;if(e.hoverDuringDrag||!e.isPointerDragging){var i=this.intersectingObjects(e.pointerPos.x,e.pointerPos.y);e.hoverOrderComparator&&i.sort(function(a,o){return e.hoverOrderComparator(a.object,o.object)});var s=i.find(function(a){return e.hoverFilter(a.object)})||null;r=s?s.object:null,e.intersection=s||null}r!==e.hoverObj&&(e.onHover(r,e.hoverObj,e.intersection),e.tooltip.content(r&&pn(e.tooltipContent)(r,e.intersection)||null),e.hoverObj=r)}e.tweenGroup.update()}return this},getPointerPos:function(e){var t=e.pointerPos,r=t.x,i=t.y;return{x:r,y:i}},cameraPosition:function(e,t,r,i){var s=e.camera;if(t&&e.initialised){var a,o,l=t,u=r||{x:0,y:0,z:0};if((a=e.povPosTween)===null||a===void 0||a.end(),(o=e.povTgtTween)===null||o===void 0||o.end(),!i)f(l),p(u);else{var d=Object.assign({},s.position),h=g();e.tweenGroup.add(e.povPosTween=new Mc(d).to(l,i).easing(Ro.Quadratic.Out).onUpdate(f).onComplete(function(){e.povPosTween=void 0,e.tweenGroup.remove(this)}).start()),e.tweenGroup.add(e.povTgtTween=new Mc(h).to(u,i/3).easing(Ro.Quadratic.Out).onUpdate(p).onComplete(function(){e.povTgtTween=void 0,e.tweenGroup.remove(this)}).start())}return this}return Object.assign({},s.position,{lookAt:g()});function f(A){var x=A.x,b=A.y,_=A.z;x!==void 0&&(s.position.x=x),b!==void 0&&(s.position.y=b),_!==void 0&&(s.position.z=_)}function p(A){var x=new ya.Vector3(A.x,A.y,A.z);e.controls.enabled&&e.controls.target?e.controls.target=x:s.lookAt(x)}function g(){return Object.assign(new ya.Vector3(0,0,-1e3).applyQuaternion(s.quaternion).add(s.position))}},zoomToFit:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,i=arguments.length,s=new Array(i>3?i-3:0),a=3;a<i;a++)s[a-3]=arguments[a];return this.fitToBbox(this.getBbox.apply(this,s),t,r)},fitToBbox:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:10,s=e.camera;if(t){var a=new ya.Vector3(0,0,0),o=Math.max.apply(Math,Ux(Object.entries(t).map(function(p){var g=sit(p,2),A=g[0],x=g[1];return Math.max.apply(Math,Ux(x.map(function(b){return Math.abs(a[A]-b)})))})))*2,l=(1-i*2/e.height)*s.fov,u=o/Math.atan(l*Math.PI/180),d=u/s.aspect,h=Math.max(u,d);if(h>0){var f=a.clone().sub(s.position).normalize().multiplyScalar(-h);this.cameraPosition(f,a,r)}}return this},getBbox:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},r=new ya.Box3(new ya.Vector3(0,0,0),new ya.Vector3(0,0,0)),i=e.objects.filter(t);return i.length?(i.forEach(function(s){return r.expandByObject(s)}),Object.assign.apply(Object,Ux(["x","y","z"].map(function(s){return eit({},s,[r.min[s],r.max[s]])})))):null},getScreenCoords:function(e,t,r,i){var s=new ya.Vector3(t,r,i);
5446return s.project(this.camera()),{x:(s.x+1)*e.width/2,y:-(s.y-1)*e.height/2}},getSceneCoords:function(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=new ya.Vector2(t/e.width*2-1,-(r/e.height)*2+1),a=new ya.Raycaster;return a.setFromCamera(s,e.camera),Object.assign({},a.ray.at(i,new ya.Vector3))},intersectingObjects:function(e,t,r){var i=new ya.Vector2(t/e.width*2-1,-(r/e.height)*2+1),s=new ya.Raycaster;return s.params.Line.threshold=e.lineHoverPrecision,s.params.Points.threshold=e.pointsHoverPrecision,s.setFromCamera(i,e.camera),s.intersectObjects(e.objects,!0)},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},postProcessingComposer:function(e){return e.postProcessingComposer},controls:function(e){return e.controls},tbControls:function(e){return e.controls},_destructor:function(e){var t,r,i;lit(e.scene),(t=e.controls)===null||t===void 0||t.dispose(),(r=e.renderer)===null||r===void 0||r.dispose(),(i=e.postProcessingComposer)===null||i===void 0||i.dispose()}},stateInit:function(){return{scene:new ya.Scene,camera:new ya.PerspectiveCamera,timer:new ya.Timer,tweenGroup:new tR,lastRaycasterCheck:0}},init:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.controlType,s=i===void 0?"trackball":i,a=r.useWebGPU,o=a===void 0?!1:a,l=r.rendererConfig,u=l===void 0?{}:l,d=r.extraRenderers,h=d===void 0?[]:d,f=r.waitForLoadComplete,p=f===void 0?!0:f;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.className="scene-container",t.container.style.position="relative",t.container.appendChild(t.navInfo=document.createElement("div")),t.navInfo.className="scene-nav-info",t.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[s]||"",t.navInfo.style.display=t.showNavInfo?null:"none",t.tooltip=new Yrt(t.container),t.pointerPos=new ya.Vector2,t.pointerPos.x=-2,t.pointerPos.y=-2,["pointermove","pointerdown"].forEach(function(g){return t.container.addEventListener(g,function(A){if(g==="pointerdown"&&(t.isPointerPressed=!0),!t.isPointerDragging&&A.type==="pointermove"&&(A.pressure>0||t.isPointerPressed)&&(A.pointerType==="mouse"||A.movementX===void 0||[A.movementX,A.movementY].some(function(_){return Math.abs(_)>1}))&&(t.isPointerDragging=!0),t.enablePointerInteraction){var x=b(t.container);t.pointerPos.x=A.pageX-x.left,t.pointerPos.y=A.pageY-x.top}function b(_){var M=_.getBoundingClientRect(),T=window.pageXOffset||document.documentElement.scrollLeft,L=window.pageYOffset||document.documentElement.scrollTop;return{top:M.top+L,left:M.left+T}}},{passive:!0})}),t.container.addEventListener("pointerup",function(g){t.isPointerPressed&&(t.isPointerPressed=!1,!(t.isPointerDragging&&(t.isPointerDragging=!1,!t.clickAfterDrag))&&requestAnimationFrame(function(){g.button===0&&t.onClick(t.hoverObj||null,g,t.intersection),g.button===2&&t.onRightClick&&t.onRightClick(t.hoverObj||null,g,t.intersection)}))},{passive:!0,capture:!0}),t.container.addEventListener("contextmenu",function(g){t.onRightClick&&g.preventDefault()}),t.renderer=new(o?qme:ya.WebGLRenderer)(Object.assign({antialias:!0,alpha:!0},u)),t.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),t.container.appendChild(t.renderer.domElement),t.extraRenderers=h,t.extraRenderers.forEach(function(g){g.domElement.style.position="absolute",g.domElement.style.top="0px",g.domElement.style.pointerEvents="none",t.container.appendChild(g.domElement)}),t.postProcessingComposer=new stt(t.renderer),t.postProcessingComposer.addPass(new att(t.scene,t.camera)),t.controls=new{trackball:fet,orbit:ket,fly:qet}[s](t.camera,t.renderer.domElement),s==="fly"&&(t.controls.movementSpeed=300,t.controls.rollSpeed=Math.PI/6,t.controls.dragToLook=!0),(s==="trackball"||s==="orbit")&&(t.controls.minDistance=.1,t.controls.maxDistance=t.skyRadius,t.controls.addEventListener("start",function(){t.controlsEngaged=!0}),t.controls.addEventListener("change",function(){t.controlsEngaged&&(t.controlsDragging=!0)}),t.controls.addEventListener("end",function(){t.controlsEngaged=!1,t.controlsDragging=!1})),[t.renderer,t.postProcessingComposer].concat(Ux(t.extraRenderers)).forEac
5446h(function(g){return g.setSize(t.width,t.height)}),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix(),t.camera.position.z=1e3,t.scene.add(t.skysphere=new ya.Mesh),t.skysphere.visible=!1,t.loadComplete=t.scene.visible=!p,window.scene=t.scene},update:function(e,t){if(e.width&&e.height&&(t.hasOwnProperty("width")||t.hasOwnProperty("height"))){var r,i=e.width,s=e.height;e.container.style.width="".concat(i,"px"),e.container.style.height="".concat(s,"px"),[e.renderer,e.postProcessingComposer].concat(Ux(e.extraRenderers)).forEach(function(p){return p.setSize(i,s)}),e.camera.aspect=i/s;var a=e.viewOffset.slice(0,2);a.some(function(p){return p})&&(r=e.camera).setViewOffset.apply(r,[i,s].concat(Ux(a),[i,s])),e.camera.updateProjectionMatrix()}if(t.hasOwnProperty("viewOffset")){var o,l=e.width,u=e.height,d=e.viewOffset.slice(0,2);d.some(function(p){return p})?(o=e.camera).setViewOffset.apply(o,[l,u].concat(Ux(d),[l,u])):e.camera.clearViewOffset()}if(t.hasOwnProperty("skyRadius")&&e.skyRadius&&(e.controls.hasOwnProperty("maxDistance")&&t.skyRadius&&(e.controls.maxDistance=Math.min(e.controls.maxDistance,e.skyRadius)),e.camera.far=e.skyRadius*2.5,e.camera.updateProjectionMatrix(),e.skysphere.geometry=new ya.SphereGeometry(e.skyRadius)),t.hasOwnProperty("backgroundColor")){var h=r_(e.backgroundColor).alpha;h===void 0&&(h=1),e.renderer.setClearColor(new ya.Color(Dtt(1,e.backgroundColor)),h)}t.hasOwnProperty("backgroundImageUrl")&&(e.backgroundImageUrl?new ya.TextureLoader().load(e.backgroundImageUrl,function(p){p.colorSpace=ya.SRGBColorSpace,e.skysphere.material=new ya.MeshBasicMaterial({map:p,side:ya.BackSide}),e.skysphere.visible=!0,e.onBackgroundImageLoaded&&setTimeout(e.onBackgroundImageLoaded),!e.loadComplete&&f()}):(e.skysphere.visible=!1,e.skysphere.material.map=null,!e.loadComplete&&f())),t.hasOwnProperty("showNavInfo")&&(e.navInfo.style.display=e.showNavInfo?null:"none"),t.hasOwnProperty("lights")&&((t.lights||[]).forEach(function(p){return e.scene.remove(p)}),e.lights.forEach(function(p){return e.scene.add(p)})),t.hasOwnProperty("objects")&&((t.objects||[]).forEach(function(p){return e.scene.remove(p)}),e.objects.forEach(function(p){return e.scene.add(p)}));function f(){e.loadComplete=e.scene.visible=!0}}});function cit(n,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}}var uit=`.scene-container .clickable { 5447 cursor: pointer; 5448}`;cit(uit);function yU(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function dit(n){if(Array.isArray(n))return yU(n)}function VT(n,e,t){return(e=Ait(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hit(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function fit(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 5449In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gee(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function nv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gee(Object(t),!0).forEach(function(r){VT(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gee(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function pit(n,e){if(n==null)return{};var t,r,i=mit(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function mit(n,e){if(n==null)return{};var t={};for(var r in n)if({}
5449.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function WR(n){return dit(n)||hit(n)||xit(n)||fit()}function git(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ait(n){var e=git(n,"string");return typeof e=="symbol"?e:e+""}function xit(n,e){if(n){if(typeof n=="string")return yU(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?yU(n,e):void 0}}function Kge(n,e){var t=new e;return t._destructor&&t._destructor(),{linkProp:function(i){return{default:t[i](),onChange:function(a,o){o[n][i](a)},triggerUpdate:!1}},linkMethod:function(i){return function(s){for(var a=s[n],o=arguments.length,l=new Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];var d=a[i].apply(a,l);return d===a?this:d}}}}var vit=["rendererConfig","waitForGlobeReady"],nS=nv(nv({},window.THREE?window.THREE:{AmbientLight:hue,DirectionalLight:due,Vector2:Jt,REVISION:yy}),{},{CSS2DRenderer:_Le}),Zge=Kge("globe",Age),yit=Object.assign.apply(Object,WR(["globeImageUrl","bumpImageUrl","globeTileEngineUrl","globeTileEngineMaxLevel","globeCurvatureResolution","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcStartAltitude","arcEndLat","arcEndLng","arcEndAltitude","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","particlesData","particlesList","particleLat","particleLng","particleAltitude","particlesSize","particlesSizeAttenuation","particlesColor","particlesTexture","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlElementVisibilityModifier","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map(function(n){return VT({},n,Zge.linkProp(n))}))),bit=Object.assign.apply(Object,WR(["globeMaterial","globeTileEngineClearCache","getGlobeRadius","getCoords","toGeoCoords"].map(function(n){return VT({},n,Zge.linkMethod(n))}))),Jge=Kge("renderObjs",Qge),wit=Object.assign.apply(Object,WR(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map(function(n){return VT({},n,Jge.linkProp(n))}))),_it=Object.assign.apply(Object,WR(["lights","postProcessingComposer"].map(function(n){return VT({},n,Jge.linkMethod(n))}))),Sit=Wo({props:nv(nv({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},particleLabel:{default:"name",triggerUpdate:!1},onParticleClick:{triggerUpdate:!1},onParticleRightClick:{triggerUpdate:!1},onParticleHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(e,t){t.renderObjs.lineHoverPrecision(e),t.renderObjs.pointsHoverPrecision(e)}},showPointerCursor:{default:!0,triggerUpdate:!1},globeOffset:{default:[0,0],triggerUpdate:!1,onChange:function(e,t){return Array.isArray(e)&&e.length===2&&t.renderObjs.viewOffset(e.map(function(r){return-r}))}}},yit),wit),methods:nv(nv({pauseAnimation:function(e){var t;return e.animationFrameRequestId!==null&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),(t=e.globe)===null||t===void 0||t.pauseAnimation(),this},resumeAnimation:function(e){var t;return e.animationFrameRequestId===null&&this._animationCycle(),(t=e.globe)===null||t===void 0||t.resumeAnimation(),this},_animationCycle:function(e){e.renderObjs.tick(),e.tweenGroup.update(),e.animationFrameRequestId=requestAnimationFrame(this._animationCycle)}
5449,pointOfView:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=o();if(t.lat===void 0&&t.lng===void 0&&t.altitude===void 0)return i;var s,a=Object.assign({},i,t);if(["lat","lng","altitude"].forEach(function(u){return a[u]=+a[u]}),(s=e.povTween)===null||s===void 0||s.end(),!r)l(a);else{for(;i.lng-a.lng>180;)i.lng-=360;for(;i.lng-a.lng<-180;)i.lng+=360;e.tweenGroup.add(e.povTween=new Mc(i).to(a,r).easing(Ro.Cubic.InOut).onUpdate(l).onComplete(function(){e.povTween=void 0,e.tweenGroup.remove(this)}).start())}return this;function o(){return e.globe.toGeoCoords(e.renderObjs.cameraPosition())}function l(u){var d=u.lat,h=u.lng,f=u.altitude;e.renderObjs.cameraPosition(e.globe.getCoords(d,h,f)),e.globe.setPointOfView(e.renderObjs.camera())}},getScreenCoords:function(e){for(var t,r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var a=(t=e.globe).getCoords.apply(t,i);return e.renderObjs.getScreenCoords(a.x,a.y,a.z)},toGlobeCoords:function(e,t,r){var i=e.renderObjs.intersectingObjects(t,r).find(function(l){return(l.object.__globeObjType||l.object.parent.__globeObjType)==="globe"});if(!i)return null;var s=e.globe.toGeoCoords(i.point),a=s.lat,o=s.lng;return{lat:a,lng:o}},scene:function(e){return e.renderObjs.scene()},camera:function(e){return e.renderObjs.camera()},renderer:function(e){return e.renderObjs.renderer()},controls:function(e){return e.renderObjs.controls()},_destructor:function(e){this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.particlesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([]),e.globe._destructor(),e.renderObjs._destructor()}},bit),_it),stateInit:function(e){var t=e.rendererConfig,r=e.waitForGlobeReady,i=r===void 0?!0:r,s=pit(e,vit),a=new Age(nv({waitForGlobeReady:i},s));return{globe:a,renderObjs:Qge({controlType:"orbit",rendererConfig:t,waitForLoadComplete:i,extraRenderers:[new nS.CSS2DRenderer]}).skyRadius(a.getGlobeRadius()*500).showNavInfo(!1).objects([a]).lights([new nS.AmbientLight(13421772,Math.PI),new nS.DirectionalLight(16777215,.6*Math.PI)]),tweenGroup:new tR}},init:function(e,t){var r=this;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.style.position="relative";var i=document.createElement("div");t.container.appendChild(i),t.renderObjs(i),t.globe.rendererSize(t.renderObjs.renderer().getSize(new nS.Vector2)),this.pointOfView({altitude:2.5});var s=t.globe.getGlobeRadius(),a=t.renderObjs.controls();t.renderObjs.camera().near=.05,a.minDistance=s+Math.max(.001,t.renderObjs.camera().near*1.1),a.maxDistance=s*100,a.enablePan=!1,a.enableDamping=!0,a.dampingFactor=.1,a.rotateSpeed=.3,a.zoomSpeed=.3,a.zoomToCursor=!0,a.addEventListener("change",function(){a.target.setScalar(0);var u=r.pointOfView();a.rotateSpeed=u.altitude*.3,a.zoomSpeed=Math.sqrt(u.altitude)*.5,t.globe.setPointOfVie
5449w(t.renderObjs.camera()),t.onZoom&&t.onZoom(u)});var o=function(d){for(var h=d;h&&!h.hasOwnProperty("__globeObjType");)h=h.parent;return h},l={point:function(d){return d},arc:function(d){return d},polygon:function(d){return d.data},path:function(d){return d},heatmap:function(d){return d},hexbin:function(d){return d},hexPolygon:function(d){return d},tile:function(d){return d},particles:function(d,h){return!h||!h.hasOwnProperty("index")||d.length<=h.index?d:d[h.index]},label:function(d){return d},object:function(d){return d},custom:function(d){return d}};nS.REVISION<155&&(t.renderObjs.renderer().useLegacyLights=!1),t.renderObjs.hoverFilter(function(u){var d=o(u);if(!d)return!1;var h=d.__globeObjType;if(h!=="globe"&&!l.hasOwnProperty(h))return!1;var f=l.hasOwnProperty(h)&&d.__data?l[h](d.__data):null;return["points","hexBinPoints"].some(function(p){return p===h})&&Array.isArray(f)?!1:t.pointerEventsFilter(d,f)}).tooltipContent(function(u,d){var h={point:t.pointLabel,arc:t.arcLabel,polygon:t.polygonLabel,path:t.pathLabel,hexbin:t.hexLabel,hexPolygon:t.hexPolygonLabel,tile:t.tileLabel,particles:t.particleLabel,label:t.labelLabel,object:t.objectLabel,custom:t.customLayerLabel},f=o(u),p=f&&f.__globeObjType;return f&&p&&h.hasOwnProperty(p)&&l.hasOwnProperty(p)&&pn(h[p])(l[p](f.__data,d))||""}).onHover(function(u,d,h){var f={point:t.onPointHover,arc:t.onArcHover,polygon:t.onPolygonHover,path:t.onPathHover,heatmap:t.onHeatmapHover,hexbin:t.onHexHover,hexPolygon:t.onHexPolygonHover,tile:t.onTileHover,particles:t.onParticleHover,label:t.onLabelHover,object:t.onObjectHover,custom:t.onCustomLayerHover},p={globe:t.onGlobeClick,point:t.onPointClick,arc:t.onArcClick,polygon:t.onPolygonClick,path:t.onPathClick,heatmap:t.onHeatmapClick,hexbin:t.onHexClick,hexPolygon:t.onHexPolygonClick,tile:t.onTileClick,particles:t.onParticleClick,label:t.onLabelClick,object:t.onObjectClick,custom:t.onCustomLayerClick},g=o(u);if(g&&!f.hasOwnProperty(g.__globeObjType)&&(g=null),g!==t.hoverObj){var A,x=t.hoverObj?t.hoverObj.__globeObjType:null,b=t.hoverData,_=g?g.__globeObjType:null,M=(A=g)!==null&&A!==void 0&&A.__data?l[_](g.__data,h):null;x&&x!==_&&f[x]&&f[x](null,b||null),_&&f[_]&&f[_](M,x===_?b:null),t.renderObjs.renderer().domElement.classList[_&&p[_]&&pn(t.showPointerCursor)(_,M)?"add":"remove"]("clickable"),t.hoverObj=g,t.hoverData=M}}).onClick(function(u,d,h){if(u){var f={globe:t.onGlobeClick,point:t.onPointClick,arc:t.onArcClick,polygon:t.onPolygonClick,path:t.onPathClick,heatmap:t.onHeatmapClick,hexbin:t.onHexClick,hexPolygon:t.onHexPolygonClick,tile:t.onTileClick,particles:t.onParticleClick,label:t.onLabelClick,object:t.onObjectClick,custom:t.onCustomLayerClick},p=o(u),g=p.__globeObjType;if(p&&f.hasOwnProperty(g)&&f[g]){var A=[d],x=h!=null&&h.isVector3?h:h==null?void 0:h.point;if(g==="globe"){var b=r.toGeoCoords(x),_=b.lat,M=b.lng;A.unshift({lat:_,lng:M})}else A.push(r.toGeoCoords(x));l.hasOwnProperty(g)&&A.unshift(l[g](p.__data,h)),f[g].apply(f,A)}}}).onRightClick(function(u,d,h){if(u){var f={globe:t.onGlobeRightClick,point:t.onPointRightClick,arc:t.onArcRightClick,polygon:t.onPolygonRightClick,path:t.onPathRightClick,heatmap:t.onHeatmapRightClick,hexbin:t.onHexRightClick,hexPolygon:t.onHexPolygonRightClick,tile:t.onTileRightClick,particles:t.onParticleRightClick,label:t.onLabelRightClick,object:t.onObjectRightClick,custom:t.onCustomLayerRightClick},p=o(u),g=p.__globeObjType;if(p&&f.hasOwnProperty(g)&&f[g]){var A=[d],x=h!=null&&h.isVector3?h:h==null?void 0:h.point;if(g==="globe"){var b=r.toGeoCoords(x),_=b.lat,M=b.lng;A.unshift({lat:_,lng:M})}else A.push(r.toGeoCoords(x));l.hasOwnProperty(g)&&A.unshift(l[g](p.__data,h)),f[g].apply(f,A)}}}),this._animationCycle()}}),dO={exports:{}},hO,qee;function Tit(){if(qee)return hO;qee=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return hO=n,hO}var fO,$ee;function Eit(){if($ee)return fO;$ee=1;var n=Tit();function e(){}function t(){}return t.resetWarningCache=e,fO=function(){function r(a,o,l,u,d,h){if(h!==n){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},fO}var Hee;function eAe(){return Hee||(Hee=1,dO.exports=Eit()()),dO.exports}var Cit=eAe();const ue=F1(Cit);var Nit={width:ue.number,height:ue.number,globeOffset:ue.arrayOf(ue.number),backgroundColor:ue.string,backgroundImageUrl:ue.string,globeImageUrl:ue.string,bumpImageUrl:ue.string,globeTileEngineUrl:ue.func,showGlobe:ue.bool,showGraticules:ue.bool,showAtmosphere:ue.bool,atmosphereColor:ue.string,atmosphereAltitude:ue.number,globeMaterial:ue.object,onGlobeReady:ue.func,onGlobeClick:ue.func,onGlobeRightClick:ue.func,pointsData:ue.arrayOf(ue.object),pointLat:ue.oneOfType([ue.number,ue.string,ue.func]),pointLng:ue.oneOfType([ue.number,ue.string,ue.func]),pointColor:ue.oneOfType([ue.string,ue.func]),pointAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),pointRadius:ue.oneOfType([ue.number,ue.string,ue.func]),pointResolution:ue.number,pointsMerge:ue.bool,pointsTransitionDuration:ue.number,pointLabel:ue.oneOfType([ue.string,ue.func]),onPointClick:ue.func,onPointRightClick:ue.func,onPointHover:ue.func,arcsData:ue.arrayOf(ue.object),arcStartLat:ue.oneOfType([ue.number,ue.string,ue.func]),arcStartLng:ue.oneOfType([ue.number,ue.string,ue.func]),arcEndLat:ue.oneOfType([ue.number,ue.string,ue.func]),arcEndLng:ue.oneOfType([ue.number,ue.string,ue.func]),arcColor:ue.oneOfType([ue.string,ue.arrayOf(ue.string),ue.func]),arcAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),arcAltitudeAutoScale:ue.oneOfType([ue.number,ue.string,ue.func]),arcStroke:ue.oneOfType([ue.number,ue.string,ue.func]),arcCurveResolution:ue.number,arcCircularResolution:ue.number,arcDashLength:ue.oneOfType([ue.number,ue.string,ue.func]),arcDashGap:ue.oneOfType([ue.number,ue.string,ue.func]),arcDashInitialGap:ue.oneOfType([ue.number,ue.string,ue.func]),arcDashAnimateTime:ue.oneOfType([ue.number,ue.string,ue.func]),arcsTransitionDuration:ue.number,arcLabel:ue.oneOfType([ue.string,ue.func]),onArcClick:ue.func,onArcRightClick:ue.func,onArcHover:ue.func,polygonsData:ue.arrayOf(ue.object),polygonGeoJsonGeometry:ue.oneOfType([ue.string,ue.func]),polygonCapColor:ue.oneOfType([ue.string,ue.func]),polygonCapMaterial:ue.oneOfType([ue.object,ue.string,ue.func]),polygonSideColor:ue.oneOfType([ue.string,ue.func]),polygonSideMaterial:ue.oneOfType([ue.object,ue.string,ue.func]),polygonStrokeColor:ue.oneOfType([ue.string,ue.func]),polygonAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),polygonCapCurvatureResolution:ue.oneOfType([ue.number,ue.string,ue.func]),polygonsTransitionDuration:ue.number,polygonLabel:ue.oneOfType([ue.string,ue.func]),onPolygonClick:ue.func,onPolygonRightClick:ue.func,onPolygonHover:ue.func,pathsData:ue.array,pathPoints:ue.oneOfType([ue.array,ue.string,ue.func]),pathPointLat:ue.oneOfType([ue.number,ue.string,ue.func]),pathPointLng:ue.oneOfType([ue.number,ue.string,ue.func]),pathPointAlt:ue.oneOfType([ue.number,ue.string,ue.func]),pathResolution:ue.number,pathColor:ue.oneOfType([ue.string,ue.arrayOf(ue.string),ue.func]),pathStroke:ue.oneOfType([ue.number,ue.string,ue.func]),pathDashLength:ue.oneOfType([ue.number,ue.string,ue.func]),pathDashGap:ue.oneOfType([ue.number,ue.string,ue.func]),pathDashInitialGap:ue.oneOfType([ue.number,ue.string,ue.func]),pathDashAnimateTime:ue.oneOfType([ue.number,ue.string,ue.func]),pathTransitionDuration:ue.number,pathLabel:ue.oneOfType([ue.string,ue.func]),onPathClick:ue.func,onPathRightClick:ue.func,onPathHover:ue.func,heatmapsData:ue.array,heatmapPoints:ue.oneOfType([ue.array,ue.string,ue.func]),heatmapPointLat:ue.oneOfType([ue.number,ue.string,ue.func]),heatmapPointLng:ue.oneOfType([ue.number,ue.string,ue.func]),heatmapPointWeight:ue.oneOfType([ue.number,ue.string,ue.func]),heatmapBandwidth:ue.oneOfType([ue.number,ue.string,ue.func]),heatmapColorFn:ue.oneOfType([ue.string,ue.func]),heatmapColorSaturation:ue.oneOfType([ue.number,ue.string,ue.func]),heatmapBaseAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),heatmapTopAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),heatmapsTransitionDuration:ue.number,onHeatmapClick:ue.func,onHeatmapRightClick:ue.func,onHeatmapHover:ue.func,hexBinPointsData:ue.arrayOf(ue.object),hexBinPointLat:ue.oneOfType([ue.number,ue.string,ue.func]),hexBinPointLng:ue.oneOfType([ue.number,ue.string,ue.func]),hexBinPointWeight:ue.oneOfType([ue.number,ue.string,ue.func]),hexBinRes
5449olution:ue.number,hexMargin:ue.oneOfType([ue.number,ue.func]),hexTopColor:ue.func,hexSideColor:ue.func,hexAltitude:ue.oneOfType([ue.number,ue.func]),hexTopCurvatureResolution:ue.number,hexBinMerge:ue.bool,hexTransitionDuration:ue.number,hexLabel:ue.oneOfType([ue.string,ue.func]),onHexClick:ue.func,onHexRightClick:ue.func,onHexHover:ue.func,hexPolygonsData:ue.arrayOf(ue.object),hexPolygonGeoJsonGeometry:ue.oneOfType([ue.string,ue.func]),hexPolygonColor:ue.oneOfType([ue.string,ue.func]),hexPolygonAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),hexPolygonResolution:ue.oneOfType([ue.number,ue.string,ue.func]),hexPolygonMargin:ue.oneOfType([ue.number,ue.string,ue.func]),hexPolygonUseDots:ue.oneOfType([ue.bool,ue.string,ue.func]),hexPolygonCurvatureResolution:ue.oneOfType([ue.number,ue.string,ue.func]),hexPolygonDotResolution:ue.oneOfType([ue.number,ue.string,ue.func]),hexPolygonsTransitionDuration:ue.number,hexPolygonLabel:ue.oneOfType([ue.string,ue.func]),onHexPolygonClick:ue.func,onHexPolygonRightClick:ue.func,onHexPolygonHover:ue.func,tilesData:ue.arrayOf(ue.object),tileLat:ue.oneOfType([ue.number,ue.string,ue.func]),tileLng:ue.oneOfType([ue.number,ue.string,ue.func]),tileAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),tileWidth:ue.oneOfType([ue.number,ue.string,ue.func]),tileHeight:ue.oneOfType([ue.number,ue.string,ue.func]),tileUseGlobeProjection:ue.oneOfType([ue.bool,ue.string,ue.func]),tileMaterial:ue.oneOfType([ue.object,ue.string,ue.func]),tileCurvatureResolution:ue.oneOfType([ue.number,ue.string,ue.func]),tilesTransitionDuration:ue.number,tileLabel:ue.oneOfType([ue.string,ue.func]),onTileClick:ue.func,onTileRightClick:ue.func,onTileHover:ue.func,particlesData:ue.arrayOf(ue.object),particlesList:ue.oneOfType([ue.string,ue.func]),particleLat:ue.oneOfType([ue.number,ue.string,ue.func]),particleLng:ue.oneOfType([ue.number,ue.string,ue.func]),particleAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),particlesSize:ue.oneOfType([ue.number,ue.string,ue.func]),particlesSizeAttenuation:ue.oneOfType([ue.bool,ue.string,ue.func]),particlesColor:ue.oneOfType([ue.string,ue.func]),particlesTexture:ue.oneOfType([ue.string,ue.func]),particleLabel:ue.oneOfType([ue.string,ue.func]),onParticleClick:ue.func,onParticleRightClick:ue.func,onParticleHover:ue.func,ringsData:ue.arrayOf(ue.object),ringLat:ue.oneOfType([ue.number,ue.string,ue.func]),ringLng:ue.oneOfType([ue.number,ue.string,ue.func]),ringAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),ringColor:ue.oneOfType([ue.string,ue.arrayOf(ue.string),ue.func]),ringResolution:ue.number,ringMaxRadius:ue.oneOfType([ue.number,ue.string,ue.func]),ringPropagationSpeed:ue.oneOfType([ue.number,ue.string,ue.func]),ringRepeatPeriod:ue.oneOfType([ue.number,ue.string,ue.func]),labelsData:ue.arrayOf(ue.object),labelLat:ue.oneOfType([ue.number,ue.string,ue.func]),labelLng:ue.oneOfType([ue.number,ue.string,ue.func]),labelAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),labelRotation:ue.oneOfType([ue.number,ue.string,ue.func]),labelText:ue.oneOfType([ue.string,ue.func]),labelSize:ue.oneOfType([ue.number,ue.string,ue.func]),labelTypeFace:ue.object,labelColor:ue.oneOfType([ue.string,ue.func]),labelResolution:ue.number,labelIncludeDot:ue.oneOfType([ue.bool,ue.string,ue.func]),labelDotRadius:ue.oneOfType([ue.number,ue.string,ue.func]),labelDotOrientation:ue.oneOfType([ue.string,ue.func]),labelsTransitionDuration:ue.number,labelLabel:ue.oneOfType([ue.string,ue.func]),onLabelClick:ue.func,onLabelRightClick:ue.func,onLabelHover:ue.func,htmlElementsData:ue.arrayOf(ue.object),htmlLat:ue.oneOfType([ue.number,ue.string,ue.func]),htmlLng:ue.oneOfType([ue.number,ue.string,ue.func]),htmlAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),htmlElement:ue.oneOfType([ue.string,ue.func]),htmlElementVisibilityModifier:ue.func,htmlTransitionDuration:ue.number,objectsData:ue.arrayOf(ue.object),objectLat:ue.oneOfType([ue.number,ue.string,ue.func]),objectLng:ue.oneOfType([ue.number,ue.string,ue.func]),objectAltitude:ue.oneOfType([ue.number,ue.string,ue.func]),objectRotation:ue.oneOfType([ue.shape({x:ue.number,y:ue.number,z:ue.number}),ue.string,ue.func]),objectFacesSurface:ue.oneOfType([ue.bool,ue.string,ue.func]),objectThreeOb
5449ject:ue.oneOfType([ue.object,ue.string,ue.func]),objectLabel:ue.oneOfType([ue.string,ue.func]),onObjectClick:ue.func,onObjectRightClick:ue.func,onObjectHover:ue.func,customLayerData:ue.arrayOf(ue.object),customThreeObject:ue.oneOfType([ue.object,ue.string,ue.func]),customThreeObjectUpdate:ue.oneOfType([ue.string,ue.func]),customLayerLabel:ue.oneOfType([ue.string,ue.func]),onCustomLayerClick:ue.func,onCustomLayerRightClick:ue.func,onCustomLayerHover:ue.func,enablePointerInteraction:ue.bool,pointerEventsFilter:ue.func,lineHoverPrecision:ue.number,showPointerCursor:ue.oneOfType([ue.bool,ue.func]),onZoom:ue.func},Pq=sMe(Sit,{methodNames:["pauseAnimation","resumeAnimation","pointOfView","lights","scene","camera","renderer","postProcessingComposer","controls","getGlobeRadius","getCoords","getScreenCoords","toGeoCoords","toGlobeCoords","globeTileEngineClearCache"],initPropNames:["animateIn","waitForGlobeReady","rendererConfig"]});Pq.displayName="Globe";Pq.propTypes=Nit;function zT(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"}}]})(n)}function Py(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"}}]})(n)}function GT(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"}}]})(n)}function Mit(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M201.5 305.5c-13.8 0-24.9-11.1-24.9-24.6 0-13.8 11.1-24.9 24.9-24.9 13.6 0 24.6 11.1 24.6 24.9 0 13.6-11.1 24.6-24.6 24.6zM504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-132.3-41.2c-9.4 0-17.7 3.9-23.8 10-22.4-15.5-52.6-25.5-86.1-26.6l17.4-78.3 55.4 12.5c0 13.6 11.1 24.6 24.6 24.6 13.8 0 24.9-11.3 24.9-24.9s-11.1-24.9-24.9-24.9c-9.7 0-18 5.8-22.1 13.8l-61.2-13.6c-3-.8-6.1 1.4-6.9 4.4l-19.1 86.4c-33.2 1.4-63.1 11.3-85.5 26.8-6.1-6.4-14.7-10.2-24.1-10.2-34.9 0-46.3 46.9-14.4 62.8-1.1 5-1.7 10.2-1.7 15.5 0 52.6 59.2 95.2 132 95.2 73.1 0 132.3-42.6 132.3-95.2 0-5.3-.6-10.8-1.9-15.8 31.3-16 19.8-62.5-14.9-62.5zM302.8 331c-18.2 18.2-76.1 17.9-93.6 0-2.2-2.2-6.1-2.2-8.3 0-2.5 2.5-2.5 6.4 0 8.6 22.8 22.8 87.3 22.8 110.2 0 2.5-2.2 2.5-6.1 0-8.6-2.2-2.2-6.1-2.2-8.3 0zm7.7-75c-13.6 0-24.6 11.1-24.6 24.9 0 13.6 11.1 24.6 24.6 24.6 13.8 0 24.9-11.1 24.9-24.6 0-13.8-11-24.9-24.9-24.9z"}}]})(n)}function O_(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M331.5 235.7c2.2 .9 4.2 1.9 6.3 2.8c29.2 14.1 50.6 35.2 61.8 61.4c15.7 36.5 17.2 95.8-30.3 143.2c-36.2 36.2-80.3 52.5-142.6 53h-.3c-70.2-.5-124.1-24.1-160.4-70.2c-32.3-41-48.9-98.1-49.5-169.6V256v-.2C17 184.3 33.6 127.2 65.9 86.2C102.2 40.1 156.2 16.5 226.4 16h.3c70.3 .5 124.9 24 162.3 69.9c18.4 22.7 32 50 40.6 81.7l-40.4 10.8c-7.1-25.8-17.8-47.8-32.2-65.4c-29.2-35.8-73-54.2-130.5-54.6c-57 .5-100.1 18.8-128.2 54.4C72.1 146.1 58.5 194.3 58 256c.5 61.7 14.1 109.9 40.3 143.3c28 35.6 71.2 53.9 128.2 54.4c51.4-.4 85.4-12.6 113.7-40.9c32.3-32.2 31.7-71.8 21.4-95.9c-6.1-14.2-17.1-26-31.9-34.9c-3.7 26.9-11.8 48.3-24.7 64.8c-17.1 21.8-41.4 33.6-72.7 35.3c-23.6 1.3-46.3-4.4-63.9-16c-20.8-13.8-33-34.8-34.3-59.3c-2.5-48.3 35.7-83 95.2-86.4c21.1-1.2 40.9-.3 59.2 2.8c-2.4-14.8-7.3-26.6-14.6-35.2c-10-11.7-25.6-17.7-46.2-17.8H227c-16.6 0-39 4.6-53.3 26.3l-34.4-23.6c19.2-29.1 50.3-45.1 87.8-45.1h.8c62.6 .4 99.9 39.5 103.7 107.7l-.2 .2zm-156 68.8c1.3 25.1 28.4 36.8 54.6 35.3c25.6-1.4 54.6-11.4 59.5-73.2c-13.2-2.9-27.8-4.4-43.4-4.4c-4.8 0-9.6 .1-14.4 .4c-42.9 2.4-57.2 23.2-56.2 41.8l-.1 .1z"}}]})(n)}function XR(n){return It({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"}}]})(n)}function D1(n){return It({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"}}]})(n)}function YR(n){return It({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"}}]})(n)}const Wee=["/landing-videos/1.webm","/landing-videos/2.webm","/landing-videos/3.webm","/landing-videos/4.webm","/landing-videos/5.webm","/landing-videos/6.webm","/landing-videos/7.webm","/landing-videos/8.webm"],Xee=[x_,pT,mT,Ay,y1,D1,O_],kit=[[39.9,116.4,51.5,-.13],[51.5,-.13,40.7,-74],[40.7,-74,35.7,139.7],[35.7,139.7,-33.9,151.2],[-33.9,151.2,-23.6,-46.6],[-23.6,-46.6,48.9,2.35],[48.9,2.35,1.35,103.8],[1.35,103.8,37.8,-122.4],[37.8,-122.4,55.8,37.6],[55.8,37.6,-33.9,18.4],[-33.9,18.4,39.9,116.4],[19.4,-99.1,38.7,-9.14]].map(([n,e,t,r],i)=>({startLat:n,startLng:e,endLat:t,endLng:r,color:i%3===0?["#CFFF05","#22D3EE"]:i%3===1?["#10B981","#CFFF05"]:["#22D3EE","#8B5CF6"]}));function Rit(){const n=G.useRef(),e=G.useRef(null),[t,r]=Cce("300px"),[i,s]=G.useState(typeof window<"u"?window.innerWidth:1200);G.useEffect(()=>{const u=()=>s(window.innerWidth);return window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]),G.useEffect(()=>{const u=n.current;if(!u)return;const d=u.controls();d.autoRotate=!wc(),d.autoRotateSpeed=.7,d.enableZoom=!1,u.pointOfVie
5449w({lat:18,lng:-30,altitude:2.2},0)},[]),G.useEffect(()=>{var d;Array.from(((d=e.current)==null?void 0:d.querySelectorAll("video"))||[]).forEach(h=>{r?(h.src||(h.src=h.dataset.src||""),h.play().catch(()=>{})):h.pause()})},[r]),AT(()=>{if(!e.current||wc())return;const u=Si.context(()=>{Si.fromTo(".lp-orbit-tilt",{rotationX:14},{rotationX:-6,ease:"none",scrollTrigger:{trigger:e.current,start:"top bottom",end:"bottom top",scrub:!0}})},e);return()=>u.revert()},[]);const a=i<768,o=a?360:780,l=a?210:440;return c.jsx("div",{ref:t,className:"relative",children:c.jsxs("div",{ref:e,className:`relative mx-auto flex w-full max-w-[1400px] items-center justify-center ${a?"h-[440px]":"h-[820px]"}`,style:{perspective:1400},children:[c.jsx("div",{className:"absolute left-1/2 top-1/2 h-[70%] w-[70%] -translate-x-1/2 -translate-y-1/2 rounded-full bg-[radial-gradient(circle,rgba(207,255,5,0.18),transparent_60%)] blur-3xl","aria-hidden":!0}),c.jsx("div",{className:"pointer-events-none absolute inset-0 z-0 flex items-center justify-center",children:c.jsx(Pq,{ref:n,width:o,height:o,globeImageUrl:"//unpkg.com/three-globe/example/img/earth-night.jpg",bumpImageUrl:"//unpkg.com/three-globe/example/img/earth-topology.png",backgroundColor:"rgba(0,0,0,0)",atmosphereColor:"#CFFF05",atmosphereAltitude:.18,arcsData:kit,arcColor:"color",arcDashLength:.45,arcDashGap:3.2,arcDashInitialGap:()=>Math.random()*4,arcDashAnimateTime:2600,arcStroke:.9,arcAltitudeAutoScale:.35})}),c.jsx("div",{className:"lp-orbit-tilt absolute left-1/2 top-1/2 h-0 w-0",style:{transformStyle:"preserve-3d"},children:c.jsx("div",{className:"lp-orbit-ring h-0 w-0",style:{transformStyle:"preserve-3d"},children:Wee.map((u,d)=>{const h=Xee[d%Xee.length];return c.jsxs("div",{className:`absolute aspect-[9/16] rounded-[22px] bg-black shadow-[0_30px_80px_-20px_rgba(0,0,0,0.9)] ring-1 ring-white/15 ${a?"w-28":"w-44"}`,style:{transform:`translate(-50%, -50%) rotateY(${360/Wee.length*d}deg) translateZ(${l}px)`,transformStyle:"preserve-3d"},children:[c.jsx("video",{"data-src":u,muted:!0,loop:!0,playsInline:!0,preload:"none",className:"h-full w-full rounded-[22px] object-cover"}),c.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-[22px] bg-gradient-to-t from-black/50 via-transparent to-white/10"}),c.jsx("div",{className:`absolute ${d%2?"-bottom-3 -left-3":"-right-3 -top-3"} grid h-10 w-10 place-items-center rounded-xl bg-[#0b0d12] text-white ring-1 ring-white/15`,style:{transform:"translateZ(24px)"},children:c.jsx(h,{className:"h-5 w-5"})})]},u)})})})]})})}function Pit(){const n=hi();return c.jsxs("div",{className:"pointer-events-none absolute inset-x-0 top-0 hidden h-[880px] lg:block","aria-hidden":!0,children:[c.jsxs("div",{"data-depth":"0.6",className:"lp-float-card lp-glass left-[4%] top-[30%] w-[230px]",children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] text-[var(--lp-muted)]",children:[c.jsx("span",{className:"lp-mono",children:n("RENDERING")}),c.jsx("span",{className:"lp-mono text-[var(--lp-lime)]",children:"72%"})]}),c.jsxs("div",{className:"mt-2 font-semibold text-white",children:[n("Vox explainer")," · 30s"]}),c.jsx("div",{className:"mt-3 h-1.5 overflow-hidden rounded-full bg-white/10",children:c.jsx("div",{className:"lp-hero-progress h-full w-[72%] rounded-full bg-[var(--lp-lime)]"})})]}),c.jsxs("div",{"data-depth":"1.1",className:"lp-float-card lp-glass right-[5%] top-[26%] w-[210px]",children:[c.jsx("div",{className:"lp-mono text-[11px] text-[var(--lp-muted)]",children:n("BRAND DETECTED")}),c.jsx("div",{className:"mt-2.5 flex gap-1.5",children:["#CFFF05","#10B981","#22D3EE","#8B5CF6","#F4F6FB"].map(e=>c.jsx("span",{className:"h-7 flex-1 rounded-md",style:{background:e}},e))}),c.jsx("div",{className:"mt-2 text-xs text-white/70",children:n("Applied to videos & carousels")})]}),c.jsxs("div",{"data-depth":"0.9",className:"lp-float-card lp-glass left-[9%] top-[62%] flex items-center gap-3",children:[c.jsx("span",{className:"grid h-9 w-9 place-items-center rounded-xl bg-[var(--lp-lime)] text-sm font-black text-black",children:"Th"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-semibold text-white",children:"POV · 18:00"}),c.jsx("div",{className:"text-xs text-white/60",children:"TikTok · Instagram · YouTube"})]})]}),c.jsxs("div",{"data-depth":"1.4",className:"lp-float-card lp-glass right-[8%] top-[60%] w-[220px]",children:[c.jsx("div",{className:"lp-mono text-[11px] text-[var(--lp-muted)]",children:n("AUTOPILOT")}),c.jsxs("div",{className:"mt-1.5 text-sm font-semibold text-white",children:[n("Next week planned")," ",c.jsx("span",{className:"text-[var(--lp-lime)]",children:"â"})]}),c.jsx("div",{className:"mt-2 flex gap-1",children:Array.from({length:7}).map((e,t)=>c.jsx("span",{className:"h-6 flex-1 rounded bg-white/10",style:{background:t%3===0?"rgba(207,255,5,.7)":void 0}},t))})]})]})}function Lit(){const n=$8(),e=G.useRef(null),[t,r]=G.useState(""),[i,s]=G.useState(0),a=q8(.25),{data:o}=Qr(SB),{t:l,locale:u}=Kr();AT(()=>{if(!e.current)return;const h=Si.context(()=>{if(wc())return;Si.timeline({defaults:{ease:"expo.out"}}).from(".lp-hero-eyebrow",{y:20,opacity:0,duration:.9}).from(".lp-hero-title .lp-wi",{yPercent:120,rotate:5,duration:1.2,stagger:.06},"-=0.6").from(".lp-hero-sub",{y:24,opacity:0,filter:"blur(8px)",duration:1},"-=0.8").from(".lp-hero-cta",{y:24,opacity:0,scale:.96,duration:1},"-=0.75").from(".lp-hero-meta",{opacity:0,duration:.8},"-=0.6").from("[data-depth]",{opacity:0,scale:.8,y:40,duration:1.2,stagger:.1},"-=0.9").from(".lp-hero-stage",{y:120,opacity:0,duration:1.6},"-=1.1"),Si.to(".lp-hero-copy",{yPercent:-18,opacity:.1,ease:"none",scrollTrigger:{trigger:e.current,start:"top top",end:"bottom top",scrub:!0}})},e);return()=>h.revert()},[]),G.useEffect(()=>{var g;if(wc()||window.matchMedia("(pointer: coarse)").matches)return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll("[data-depth]"))||[]).map(A=>({d:parseFloat(A.dataset.depth||"1"),x:Si.quickTo(A,"x",{duration:1.2,ease:"power3.out"}),y:Si.quickTo(A,"y",{duration:1.2,ease:"power3.out"})})),p=A=>{const x=A.clientX/window.innerWidth-.5,b=A.clientY/window.innerHeight-.5;f.forEach(_=>{_.x(x*40*_.d),_.y(b*30*_.d)})};return window.addEventListener("pointermove",p,{passive:!0}),()=>window.removeEventListener("pointermove",p)},[]),G.useEffect(()=>{if(wc())return;const h=window.setInterval(()=>s(f=>(f+1)%aY.length),2400);return()=>window.clearInterval(h)},[]),G.useEffect(()=>{var p,g;const h=(p=e.current)==null?void 0:p.querySelector(`[data-word="${i}"]`),f=(g=e.current)==null?void 0:g.querySelectorAll(`[data-word]:not([data-word="${i}"])`);h&&(Si.to(f||[],{yPercent:-110,opacity:0,filter:"blur(6px)",duration:.5,ease:"power3.in"}),Si.fromTo(h,{yPercent:110,opacity:0,filter:"blur(6px)"},{yPercent:0,opacity:1,filter:"blur(0px)",duration:.8,ease:"expo.out",delay:.15}))},[i]);const d=h=>{h.preventDefault(),n(t)};return c.jsxs("section",{ref:e,className:"relative overflow-hidden pt-36 sm:pt-44",children:[c.jsx(Rce,{}),c.jsx("div",{className:"lp-hero-grid","aria-hidden":!0}),c.jsx("div",{className:"lp-noise","aria-hidden":!0}),c.jsx("div",{className:"absolute inset-x-0 bottom-0 h-64 bg-gradient-to-t from-[var(--lp-bg)] to-transparent","aria-hidden":!0}),c.jsx(Pit,{}),c.jsxs("div",{className:"lp-hero-copy relative z-10 lp-container text-center",children:[c.jsx("div",{className:"lp-hero-eyebrow flex justify-center",children:c.jsxs("a",{href:"/#how",className:"lp-eyebrow",children:[c.jsx("b",{children:l("New")})," ",l("AI Creative Director · 20 viral formats")]})}),c.jsxs("h1",{className:"lp-hero-title lp-display mx-auto mt-8 max-w-5xl text-[clamp(2.7rem,7.4vw,6.4rem)] font-bold leading-[0.98] tracking-[-0.045em] text-white",children:[l("Paste a link.").split(" ").map((h,f)=>c.jsxs("span",{children:[c.jsx("span",{className:"lp-w",children:c.jsx("span",{className:"lp-wi",children:h})})," "]},f)),c.jsx("br",{}),l("Get a week of").split(" ").map((h,f)=>c.jsxs("span",{children:[c.jsx("span",{className:"lp-w",children:c.jsx("span",{className:"lp-wi",children:h})})," "]},`b${f}`)),c.jsx("br",{}),c.jsx("span",{className:"lp-w",children:c.jsx("span",{className:"lp-wi",children:c.jsx("span",{className:"lp-rotator",children:aY.map((h,f)=>c.jsxs("span",{"data-word":f,className:"lp-gradient-text",style:{opacity:f===0?1:0},children:[l(h),"."]},h))})})})]}),c.jsx("p",{className:"lp-hero-sub mx-auto mt-7 max-w-2xl text-lg leading-relaxed text-[var(--lp-muted)] sm:text-xl",children:l("SpreadOut reads your website, plans seven scroll-stopping posts, creates the videos and carousels in your brand colors, and publishes them on auto
5449pilot.")}),c.jsxs("form",{onSubmit:d,className:"lp-hero-cta mx-auto mt-10 max-w-xl",children:[c.jsx("label",{htmlFor:"lp-hero-url",className:"sr-only",children:l("Your website URL")}),c.jsxs("div",{className:"lp-url",children:[c.jsx("span",{className:"lp-mono hidden text-sm text-[var(--lp-muted)] sm:inline",children:"https://"}),c.jsx("input",{id:"lp-hero-url",type:"text",inputMode:"url",autoComplete:"url",placeholder:"yourbrand.com",value:t,onChange:h=>r(h.target.value.replace(/^https?:\/\//i,""))}),c.jsxs("button",{ref:a,type:"submit",className:"lp-btn lp-btn-primary !h-12",children:[c.jsx("span",{className:"lp-btn-shine"}),l("Generate my week")," ",c.jsx("span",{"aria-hidden":!0,children:"â"})]})]})]}),c.jsxs("div",{className:"lp-hero-meta mt-5 flex flex-wrap items-center justify-center gap-x-6 gap-y-3 text-sm text-[var(--lp-muted)]",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--lp-lime)]"}),l("Start free with {n} credits",{n:((o==null?void 0:o.starterCredits)??350).toLocaleString(u)})]}),c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--lp-cyan)]"}),l("Set up in under a minute")]}),c.jsxs("span",{className:"hidden items-center gap-3 sm:flex",children:[c.jsx("a",{href:"https://apps.apple.com/fr/app/spread-out-ai/id6739773279?l=en-GB&platform=iphone",className:"opacity-70 transition-opacity hover:opacity-100",children:c.jsx("img",{src:"https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg",alt:l("Download on the App Store"),className:"h-8"})}),c.jsx("a",{href:"https://play.google.com/store/apps/details?id=com.spreadoutai.app",className:"opacity-70 transition-opacity hover:opacity-100",children:c.jsx("img",{src:"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png",alt:l("Get it on Google Play"),className:"-my-2 h-12"})})]})]})]}),c.jsx("div",{id:"showcase",className:"lp-hero-stage relative z-0 mt-6",children:c.jsx(Rit,{})})]})}const Oit=[{d:Le("Mon"),f:Le("POV"),t:Le("Short")},{d:Le("Tue"),f:Le("Myth vs Fact"),t:Le("Carousel")},{d:Le("Wed"),f:Le("I Tested It"),t:Le("Short")},{d:Le("Thu"),f:Le("Tier List"),t:Le("Long")},{d:Le("Fri"),f:Le("Story Time"),t:Le("Podcast")},{d:Le("Sat"),f:Le("Speedrun"),t:Le("App demo")},{d:Le("Sun"),f:Le("Hot Take"),t:Le("Carousel")}],Dit=[x_,pT,mT,Ay,y1,D1,O_];function jit(){const n=hi();return c.jsxs("div",{className:"lp-scene-scan absolute inset-0 flex flex-col",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-white/10 px-5 py-4",children:[c.jsx("i",{className:"h-3 w-3 rounded-full bg-[#ff5f57]"}),c.jsx("i",{className:"h-3 w-3 rounded-full bg-[#febc2e]"}),c.jsx("i",{className:"h-3 w-3 rounded-full bg-[#28c840]"}),c.jsxs("div",{className:"lp-mono ml-3 flex-1 rounded-full bg-white/5 px-4 py-2 text-sm text-white/80",children:["https://",c.jsx("span",{className:"text-white",children:"yourbrand.com"}),c.jsx("span",{className:"lp-caret"})]})]}),c.jsxs("div",{className:"relative flex-1 overflow-hidden p-6",children:[c.jsx("div",{className:"lp-scan"}),c.jsx("div",{className:"h-8 w-2/3 rounded-lg bg-white/10"}
5449),c.jsx("div",{className:"mt-3 h-4 w-1/2 rounded bg-white/5"}),c.jsx("div",{className:"mt-8 grid grid-cols-3 gap-3",children:[0,1,2].map(e=>c.jsx("div",{className:"h-24 rounded-xl bg-white/[0.06]"},e))}),c.jsx("div",{className:"lp-scan-chips mt-8 flex flex-wrap gap-2",children:[Le("Audience: indie founders"),Le("Tone: bold & witty"),Le("Offer: free trial"),Le("Category: SaaS")].map(e=>c.jsx("span",{className:"rounded-full border border-[rgba(207,255,5,0.35)] bg-[rgba(207,255,5,0.08)] px-3 py-1.5 text-xs text-[#e9ffa1]",children:n(e)},e))}),c.jsx("div",{className:"lp-scan-palette mt-6 flex gap-2",children:["#CFFF05","#10B981","#22D3EE","#8B5CF6","#0B0D12"].map(e=>c.jsx("span",{className:"h-12 flex-1 rounded-xl ring-1 ring-white/10",style:{background:e}},e))})]})]})}function Iit(){const n=hi();return c.jsxs("div",{className:"lp-scene-week absolute inset-0 flex flex-col p-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"lp-kicker",children:n("Creative plan · Week {n}",{n:12})}),c.jsx("span",{className:"rounded-full bg-white/5 px-3 py-1 text-xs text-white/70",children:n("0 repeats vs last week")})]}),c.jsxs("div",{className:"mt-5 grid flex-1 grid-cols-2 gap-3 sm:grid-cols-4",children:[Oit.map((e,t)=>c.jsxs("div",{className:`lp-week-card flex flex-col justify-between rounded-2xl border border-white/10 bg-white/[0.04] p-3.5 ${t===3?"sm:row-span-2":""}`,children:[c.jsx("span",{className:"lp-mono text-[11px] text-white/50",children:n(e.d).toUpperCase()}),c.jsxs("div",{children:[c.jsx("div",{className:"lp-display text-base font-bold leading-tight text-white",children:n(e.f)}),c.jsx("div",{className:"mt-1 text-xs text-[var(--lp-lime)]",children:n(e.t)})]})]},e.d)),c.jsxs("div",{className:"lp-week-card flex items-center justify-center rounded-2xl border border-dashed border-[rgba(207,255,5,0.35)] p-3.5 text-center text-xs text-[#e9ffa1]",children:[n("Next week auto-planned")," â"]})]})]})}function Fit(){const n=hi();return c.jsxs("div",{className:"lp-scene-publish absolute inset-0 flex items-center justify-center gap-8 p-6",children:[c.jsxs("div",{className:"relative aspect-[9/19] h-[88%] rounded-[34px] bg-gradient-to-b from-[#3a3d44] to-[#15161a] p-2 shadow-[0_40px_90px_-20px_rgba(0,0,0,.9)]",children:[c.jsx("video",{src:"/landing-videos/2.webm",muted:!0,loop:!0,playsInline:!0,autoPlay:!0,preload:"none",className:"h-full w-full rounded-[28px] object-cover"}),c.jsx("div",{className:"absolute left-1/2 top-3 h-5 w-20 -translate-x-1/2 rounded-full bg-black"})]}),c.jsx("div",{className:"hidden flex-col gap-3 sm:flex",children:Dit.map((e,t)=>c.jsxs("div",{className:"lp-pub-row flex items-center gap-3 rounded-2xl border border-white/10 bg-white/[0.04] px-4 py-2.5",children:[c.jsx(e,{className:"h-5 w-5 text-white"}),c.jsx("span",{className:"text-sm text-white/80",children:n("Scheduled")}),c.jsx("span",{className:"lp-pub-check ml-auto grid h-6 w-6 place-items-center rounded-full bg-[var(--lp-lime)] text-xs font-black text-black",children:"â"})]},t))})]})}const Yee=[jit,Iit,Fit];function Uit(){const n=G.useRef(null),e=hi();return AT(()=>{if(!n.current||wc())return;const t=Si.matchMedia();return t.add("(min-width: 1024px)",()=>{const r=Si.utils.toArray(".lp-how-scene"),i=Si.utils.toArray(".lp-how-step");Si.set(r.slice(1),{autoAlpha:0,scale:.94,y:40}),Si.set(i.slice(1),{opacity:.28}),Si.timeline({defaults:{ease:"power3.inOut"},scrollTrigger:{trigger:n.current,start:"top top",end:"+=260%",pin:!0,scrub:.8,anticipatePin:1}}).to(".lp-how-progress",{scaleY:1/3,duration:1,ease:"none"}).from(".lp-scan-chips span",{opacity:0,y:12,stagger:.1,duration:.4},.1).from(".lp-scan-palette span",{scaleY:0,transformOrigin:"bottom",stagger:.06,duration:.4},.4).to(r[0],{autoAlpha:0,scale:1.04,y:-40,duration:.6},1).to(r[1],{autoAlpha:1,scale:1,y:0,duration:.6},1.1).to(i[0],{opacity:.28,duration:.4},1).to(i[1],{opacity:1,duration:.4},1.1).from(".lp-week-card",{rotationY:-80,opacity:0,stagger:.07,duration:.5,transformPerspective:800},1.2).to(".lp-how-progress",{scaleY:2/3,duration:1,ease:"none"},1).to(r[1],{autoAlpha:0,scale:1.04,y:-40,duration:.6},2.1).to(r[2],{autoAlpha:1,scale:1,y:0,duration:.6},2.2).to(i[1],{opacity:.28,duration:.4},2.1).to(i[2],{opacity:1,duration:.4},2.2).from(".lp-pub-row",{x:40,opacity:0,stagger:.06,duration:.4},2.3).from(".lp-pub-check",{scale:0,stagger:.08,duration:.3,ease:"back.out(3)"},2.6).to(".lp-how-progress",{scaleY:1,duration:1,ease:"none"},2.1)}),()=>t.revert()},[]),c.jsx("section",{id:"how",ref:n,className:"relative overflow-hidden lg:h-screen",children:c.jsxs("div",{className:"lp-container grid h-full items-center gap-12 py-24 lg:grid-cols-[0.9fr_1.1fr] lg:pb-6 lg:pt-24",children:[c.jsxs("div",{className:"relative",children:[c.jsx("span",{className:"lp-kicker",children:e("How
5449it works")}),c.jsx("h2",{"data-split":!0,className:"lp-display mt-3 text-[clamp(2rem,3.6vw,3.3rem)] font-bold leading-[1.02] tracking-[-0.04em] text-white",children:c.jsx(jf,{text:e("From one link to a week of content.")})}),c.jsxs("div",{className:"relative mt-8 space-y-6 pl-8",children:[c.jsx("div",{className:"absolute bottom-2 left-0 top-2 w-px bg-white/10",children:c.jsx("div",{className:"lp-how-progress h-full w-full origin-top scale-y-0 bg-[var(--lp-lime)] shadow-[0_0_12px_rgba(207,255,5,.8)]"})}),WCe.map((t,r)=>{const i=Yee[r];return c.jsxs("div",{className:"lp-how-step",children:[c.jsx("div",{className:"lp-mono text-xs uppercase tracking-[0.18em] text-[var(--lp-lime)]",children:e(t.kicker)}),c.jsx("h3",{className:"lp-display mt-1.5 text-xl font-bold text-white xl:text-2xl",children:e(t.title)}),c.jsx("p",{className:"mt-1.5 max-w-md text-sm leading-relaxed text-[var(--lp-muted)] xl:text-[15px]",children:e(t.body)}),c.jsx("div",{className:"lp-glass relative mt-6 h-[420px] overflow-hidden rounded-[28px] lg:hidden",children:c.jsx(i,{})})]},t.kicker)})]})]}),c.jsxs("div",{className:"relative hidden h-[min(620px,72vh)] lg:block",children:[c.jsx("div",{className:"absolute -inset-10 rounded-full bg-[radial-gradient(closest-side,rgba(207,255,5,0.12),transparent)] blur-2xl","aria-hidden":!0}),Yee.map((t,r)=>c.jsx("div",{className:"lp-how-scene lp-glass absolute inset-0 overflow-hidden rounded-[32px]",children:c.jsx(t,{})},r))]})]})})}function gg({className:n="",children:e}){const t=Ece(5);return c.jsx("div",{ref:t,"data-reveal":!0,className:`lp-card flex flex-col p-6 sm:p-7 ${n}`,children:e})}function Ag({kicker:n,title:e,body:t}){const r=hi();return c.jsxs("div",{className:"relative z-10",children:[c.jsx("div",{className:"lp-mono text-[11px] uppercase tracking-[0.2em] text-[var(--lp-lime)]",children:r(n)}),c.jsx("h3",{className:"lp-display mt-2 text-xl font-bold leading-tight text-white sm:text-2xl",children:r(e)}),t&&c.jsx("p",{className:"mt-2 text-sm leading-relaxed text-[var(--lp-muted)]",children:r(t)})]})}function Bit({media:n,active:e}){const[t,r]=G.useState(0);if(G.useEffect(()=>{if(r(0),n.kind!=="carousel"||!e||wc())return;const s=window.setInterval(()=>r(a=>(a+1)%n.slides.length),1600);return()=>window.clearInterval(s)},[n,e]),n.kind==="carousel")return c.jsxs("div",{className:"relative mx-auto mt-6 aspect-[4/5] w-full max-w-[190px] translate-x-3",children:[n.slides.map((s,a)=>{const o=(a-t+n.slides.length)%n.slides.length;return c.jsx("img",{src:s,alt:"",loading:"lazy",className:"absolute inset-0 h-full w-full rounded-2xl object-cover shadow-[0_24px_60px_-20px_rgba(0,0,0,.9)] ring-1 ring-white/15 transition-all duration-700 ease-[cubic-bezier(.22,1,.36,1)]",style:{transform:`translateX(${o*-12}px) translateY(${o*-10}px) scale(${1-o*.06}) rotate(${o*-2.5}deg)`,zIndex:10-o,opacity:o>2?0:1}},s)}),c.jsx("div",{className:"absolute -bottom-6 left-0 right-0 flex justify-center gap-1.5",children:n.slides.map((s,a)=>c.jsx("span",{className:`h-1.5 rounded-full transition-all ${a===t?"w-5 bg-[var(--lp-lime)]":"w-1.5 bg-white/25"}`},a))})]});const i=n.aspect==="16/9";return c.jsx("div",{className:`relative mx-auto overflow-hidden bg-black ring-1 ring-white/15 shadow-[0_30px_80px_-30px_rgba(207,255,5,.35)] ${i?"aspect-video w-full rounded-2xl":"aspect-[9/16] w-full max-w-[200px] rounded-[26px]"}`,children:e&&c.jsx("video",{src:n.src,muted:!0,loop:!0,playsInline:!0,autoPlay:!0,preload:"metadata",className:"h-full w-full object-cover"},n.src)})}function Vit(){const[n,e]=G.useState(0),[t,r]=G.useState(0),[i,s]=G.useState(!1),[a,o]=Cce(),l=hi(),u=e9[n].items,d=u[Math.min(t,u.length-1)];return G.useEffect(()=>{if(i||!o||wc())return;const h=window.setInterval(()=>{r(f=>f+1<u.length?f+1:(e(p=>(p+1)%e9.length),0))},4200);return()=>window.clearInterval(h)},[i,o,u.length]),c.jsxs(gg,{className:"lg:col-span-2 lg:row-span-2",children:[c.jsx(Ag,{kicker:Le("Content studio"),title:Le("Every format, made for you."),body:Le("Short videos, long videos and carousels, each scripted, designed, captioned and branded by SpreadOut. These are real outputs.")}),c.jsx("div",{className:"relative z-10 mt-5 flex flex-wrap gap-2",children:e9.map((h,f)=>c.jsx("button",{onClick:()=>{e(f),r(0),s(!0)},className:`rounded-full px-4 py-1.5 text-sm font-semibold transition-colors ${f===n?"bg-[var(--lp-lime)] text-black":"bg-white/5 text-white/70 hover:bg-white/10"}`,children:l(h.label)},h.id))}),c.jsxs("div",{ref:a,className:`relative mt-5 grid flex-1 content-start gap-4 ${d.media.kind==="video"&&d.media.aspect==="16/9"?"":"sm:grid-cols-[1fr_220px]"}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[c.jsx("div",{className:"flex flex-col gap-2",children:u.map((h,f)=>c.jsxs("button",{onClick:()=>r(f),className:`rounded-2xl border px-4 py-3 text-left transition-all duration-500 ${f===t?"border-[rgba(207,255,5,.45)] bg-[rgba(207,255,5,.07)]":"border-white/5 bg-white/[0.02] hover:border-white/15"}`,children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:`font-semibold ${f===t?"text-white":"text-white/70"}`,children:l(h.label)}),c.jsx("span",{className:`h-2 w-2 rounded-full transition-colors ${f===t?"bg-[var(--lp-lime)] shadow-[0_0_10px_rgba(207,255,5,.9)]":"bg-white/20"}`})]}),c.jsx("div",{className:`grid transition-all duration-500 ${f===t?"mt-1 grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:c.jsx("p",{className:"overflow-hidden text-sm text-[var(--lp-muted)]",children:l(h.desc)})})]}
5449,h.id))}),c.jsx("div",{className:"relative flex items-start justify-center",children:c.jsx(Bit,{media:d.media,active:o})})]})]})}function zit(){const n=hi(),e=Math.ceil(J7.length/2),t=({items:r})=>c.jsx("div",{className:"flex flex-col gap-2",children:[...r,...r].map((i,s)=>c.jsx("span",{className:"rounded-xl border border-white/10 bg-white/[0.04] px-3 py-2 text-center text-sm font-semibold text-white/85",children:n(i)},s))});return c.jsxs(gg,{className:"lg:row-span-2",children:[c.jsx(Ag,{kicker:Le("AI Creative Director"),title:Le("Never the same post twice."),body:Le("Each post gets its own angle and viral format, and every week remembers the last.")}),c.jsx("div",{className:"relative mt-6 flex-1 overflow-hidden rounded-2xl [mask-image:linear-gradient(transparent,#000_18%,#000_82%,transparent)]",style:{minHeight:260},children:c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsx("div",{className:"lp-vmarquee",children:c.jsx(t,{items:J7.slice(0,e)})}),c.jsx("div",{className:"lp-vmarquee is-reverse",children:c.jsx(t,{items:J7.slice(e)})})]})})]})}function Git(){const n=hi(),e=[{bg:"linear-gradient(160deg,#CFFF05,#10B981)",ink:"#05060a",t:Le("Stop doing this")},{bg:"linear-gradient(160deg,#111827,#1f2937)",ink:"#fff",t:Le("3 myths, busted")},{bg:"linear-gradient(160deg,#8B5CF6,#22D3EE)",ink:"#fff",t:Le("Save this checklist")}];return c.jsxs(gg,{className:"group",children:[c.jsx(Ag,{kicker:Le("Carousels"),title:Le("Designed in your brand.")}),c.jsx("div",{className:"relative mt-5 h-40 flex-1",children:e.map((t,r)=>c.jsxs("div",{className:`lp-fan lp-fan-${r} absolute left-1/2 top-1/2 flex h-36 w-28 flex-col justify-end rounded-2xl p-3 shadow-2xl ring-1 ring-white/10`,style:{background:t.bg,color:t.ink},children:[c.jsxs("span",{className:"lp-mono text-[9px] opacity-70",children:["0",r+1,"/07"]}),c.jsx("span",{className:"lp-display text-sm font-bold leading-tight",children:n(t.t)})]},r))})]})}function qit(){const n=hi(),e=[Le("Mon"),Le("Tue"),Le("Wed"),Le("Thu"),Le("Fri"),Le("Sat"),Le("Sun")];return c.jsxs(gg,{children:[c.jsx(Ag,{kicker:Le("Autopilot"),title:Le("Posted at peak hours, every week.")}),c.jsx("div",{className:"relative mt-5 grid flex-1 grid-cols-7 gap-1.5",children:e.map((t,r)=>c.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[c.jsx("span",{className:"lp-mono text-[10px] text-white/40",children:n(t).charAt(0)}),c.jsx("div",{className:"flex h-24 w-full flex-col justify-end rounded-lg bg-white/[0.04] p-1",children:c.jsx("div",{className:"lp-slot rounded-md bg-[var(--lp-lime)]",style:{height:`${30+r*37%55}%`,animationDelay:`${r*.25}s`}})})]},r))})]})}function $it(){const e=hi()("Your captions land on every word.").split(" ");return c.jsxs(gg,{children:[c.jsx(Ag,{kicker:Le("Motion design"),title:Le("Karaoke captions and kinetic titles.")}),c.jsx("div",{className:"mt-5 flex flex-1 items-center justify-center rounded-2xl bg-[radial-gradient(120%_90%_at_20%_0%,rgba(139,92,246,.45),transparent_60%),radial-gradient(100%_80%_at_100%_100%,rgba(16,185,129,.35),transparent_60%),#0b0d12] p-4",children:c.jsx("p",{className:"lp-display text-center text-2xl font-bold leading-snug text-white",children:e.map((t,r)=>c.jsx("span",{className:"lp-karaoke mx-0.5 inline-block rounded-md px-1",style:{animationDelay:`${r*.45}s`},children:t},r))})})]})}function Hit(){return c.jsxs(gg,{children:[c.jsx(Ag,{kicker:Le("Blog to social"),title:Le("Every new article becomes posts.")}),c.jsxs("div",{className:"mt-5 flex flex-1 items-center gap-3",children:[c.jsx("div",{className:"flex-1 space-y-2",children:[0,1,2].map(n=>c.jsx("div",{className:"lp-rss-item h-7 rounded-lg bg-white/[0.06]",style:{animationDelay:`${n*.6}s`}},n))}),c.jsx("span",{className:"text-xl text-[var(--lp-lime)]",children:"â"}),c.jsx("div",{className:"grid h-24 w-16 place-items-center rounded-xl bg-gradient-to-b from-[#1f2937] to-black text-[10px] font-bold text-white ring-1 ring-white/15",children:"â¶"})]})]})}function Wit(){const n=hi(),e=["> connect claude-desktop â oauth",'> spreadout.plan_week("yourbrand.com")'," 7 posts planned · 0 repeats",'> spreadout.generate_video("vox-style")'," rendering⦠published â"];return c.jsxs(gg,{className:"lg:col-span-2",children:[c.jsx(Ag,{kicker:Le("MCP for AI agents"),title:Le("Run SpreadOut from Claude, Cursor or your own agent.")}),c.jsx("div",{className:"lp-mono mt-5 flex-1 rounded-2xl border border-white/10 bg-black/60 p-4 text-[13px] leading-7 text-white/80",children:e.map((t,r)=>c.jsx("div",{className:"lp-term-line overflow-hidden whitespace-nowrap",style:{animationDelay:`${r*.9}s`,color:t.startsWith(">")?"#e9ffa1":void 0},children:t},r))}),c.jsxs("a",{href:"/docs",className:"relative z-10 mt-4 text-sm font-semibold text-[var(--lp-lime)] hover:underline",children:[n("Read the docs")," â"]})]})}function Xit(){return c.jsx(gg,{className:"lg:col-span-2",children:c.jsxs("div",{className:"grid flex-1 items-center gap-6 sm:grid-cols-[1fr_180px]",children:[c.jsx(Ag,{kicker:Le("Community discovery"),title:Le("Find the groups where your audience already hangs out."),body:Le("AI searches Facebook, WhatsApp, Telegram, Discord and more, by niche or location, and tailors your message to each one.")}),c.jsxs("div",{className:"lp-radar relative mx-auto h-40 w-40",children:[c.jsx("span",{className:"lp-ping left-[30%] top-[28%]"}),c.jsx("span",{className:"lp-ping left-[66%] top-[55%]",style:{animationDelay:".8s"}}),c.jsx("span",{className:"lp-ping left-[40%] top-[72%]",style:{animationDelay:"1.6s"}})]})]})})}function Yit(){return c.jsx(gg,{className:"lg:col-span-2",children:c.jsxs("div",{className:"grid flex-1 items-center gap-6 sm:grid-cols-[1fr_220px]",children:[c.jsx(Ag,{kicker:Le("Brand sync"),title:Le("Your colors, everywhere, automatically."),body:Le("SpreadOut reads the color scheme from your website and uses it in every video overlay, caption and carousel.")}
5449),c.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:["#CFFF05","#10B981","#22D3EE","#8B5CF6","#F4F6FB"].map((n,e)=>c.jsx("span",{className:"lp-swatch h-24 rounded-xl ring-1 ring-white/10",style:{background:n,animationDelay:`${e*.15}s`}},n))})]})})}function Qit(){const n=hi();return c.jsx("section",{id:"features",className:"relative py-28 sm:py-36",children:c.jsxs("div",{className:"lp-container",children:[c.jsxs("div",{className:"max-w-3xl",children:[c.jsx("span",{className:"lp-kicker",children:n("Everything in one autopilot")}),c.jsx("h2",{"data-split":!0,className:"lp-section-title mt-4 text-white",children:c.jsx(jf,{text:n("A full content team, compressed into one link.")})}),c.jsx("p",{"data-reveal":!0,className:"mt-5 max-w-2xl text-lg text-[var(--lp-muted)]",children:n("Strategy, scripting, video production, design, captions and publishing. SpreadOut does the whole chain, in your brand, every week.")})]}),c.jsxs("div",{className:"mt-14 grid auto-rows-[minmax(250px,auto)] grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[c.jsx(Vit,{}),c.jsx(zit,{}),c.jsx(Git,{}),c.jsx(qit,{}),c.jsx($it,{}),c.jsx(Hit,{}),c.jsx(Wit,{}),c.jsx(Xit,{}),c.jsx(Yit,{})]})]})})}var Vo=(n=>(n.Free="free",n.Premium="premium",n.Pro="pro",n.PremiumYearly="premium-tier-yearly",n.ProYearly="pro-tier-yearly",n))(Vo||{});function Kit(n){return{free:"Free",premium:"Premium",pro:"Pro","premium-tier-yearly":"Premium Yearly","pro-tier-yearly":"Pro Yearly"}[n]}function Zit(n){return n&&Object.values(Vo).includes(n)?n:"free"}const QR=.2,Bb=[{id:Vo.Free,name:"Free",tagline:Le("Try the autopilot on your own brand."),monthlyUsd:0,monthlyCredits:null,highlights:[Le("Short-form AI videos"),Le("Text + image posts"),Le("AI captions & hashtags"),Le("Earn extra credits by watching ads"),Le("Works in any language")]},{id:Vo.Premium,name:"Premium",tagline:Le("For creators and small businesses posting every week."),monthlyUsd:25,monthlyCredits:3e3,popular:!0,highlights:[Le("Ad-free experience"),Le("AI avatar video generation"),Le("Access to all social platforms"),Le("Bulk posting automation"),Le("Custom location targeting"),Le("Up to 30 targeted community results")]},{id:Vo.Pro,name:"Pro",tagline:Le("For agencies, marketers and power users."),monthlyUsd:75,monthlyCredits:7e3,highlights:[Le("Long-form videos (100 credits/min)"),Le("Professional UGC content creation"),Le("PRO AI models & advanced iterations"),Le("Live analytics across all platforms"),Le("Priority support & early beta access"),Le("Up to 50 targeted community results")]}],Qee=[{group:Le("Create"),label:Le("Short-form videos (100 credits)"),values:[!0,!0,!0]},{group:Le("Create"),label:Le("Long-form videos (100 credits / min)"),values:[!1,!1,!0]},{group:Le("Create"),label:Le("AI avatar videos"),values:[!1,!0,!0]},{group:Le("Create"),label:Le("Professional UGC content"),values:[!1,!1,!0]},{group:Le("Create"),label:Le("Text + image posts (20 credits + 5 / AI image)"),values:[Le("Basic"),Le("Professional"),Le("Advanced")]},{group:Le("Create"),label:Le("AI captions & hashtags"),values:[!0,!0,!0]},{group:Le("Create"),label:Le("PRO AI models & advanced iterations"),values:[!1,!1,!0]},{group:Le("Create"),label:Le("Bring your own AI keys (fal.ai, Replicate, Higgsfield, ElevenLabs)"),values:[!0,!0,!0]},{group:Le("Publish"),label:Le("Access to all social platforms"),values:[!1,!0,!0]},{group:Le("Publish"),label:Le("Bulk posting automation"),values:[!1,!0,!0]},{group:Le("Publish"),label:Le("Post analytics (10 credits / sync)"),values:[!0,!0,Le("Live, all platforms")]},{group:Le("Grow"),label:Le("Targeted community results"),values:[Le("Up to 10"),Le("Up to 30"),Le("Up to 50")]},{group:Le("Grow"),label:Le("Custom location targeting"),values:[!1,!0,!0]},{group:Le("Grow"),label:Le("Works in any language"),values:[!0,!0,!0]},{group:Le("Account"),label:Le("Ad-free experience"),values:[!1,!0,!0]},{group:Le("Account"),label:Le("Priority customer support"),values:[!1,!1,!0]},{group:Le("Account"),label:Le("Early access to beta features"),values:[!1,!1,!0]}],fc={shortVideo:100,longVideoPerMinute:100,textImageBase:20,perAiImage:5,analyticsSync:10,groupSearch:20},Jit=[{Icon:x_,name:"Instagram"},{Icon:pT,name:"TikTok"},{Icon:mT,name:"YouTube"},{Icon:Ay,name:"LinkedIn"},{Icon:y1,name:"Facebook"},{Icon:D1,name:"X"},{Icon:O_,name:"Threads"}];function est(){const n=hi();return c.jsx("section",{className:"relative border-y border-white/5 bg-white/[0.015] py-8",children:c.jsxs("div",{className:"lp-container flex flex-col items-center gap-6 md:flex-row",children:[c.jsx("p",{className:"lp-mono shrink-0 text-xs uppercase tracking-[0.2em] text-[var(--lp-muted)]",children:n("Publishes on autopilot to")}),c.jsx(jI,{duration:28,gap:56,className:"w-full",children:Jit.map(({Icon:e,name:t})=>c.jsxs("span",{className:"flex items-center gap-3 text-lg font-semibold text-white/70 transition-colors hover:text-white",children:[c.jsx(e,{className:"h-6 w-6"})," ",t]},t))})]})})}function tst(){const n=hi();return c.jsx("section",{className:"relative py-20",children:c.jsx("div",{className:"lp-container",children:c.jsx("div",{className:"lp-glass grid grid-cols-2 overflow-hidden rounded-[32px] md:grid-cols-4",children:XCe.map((e,t)=>c.jsxs("div",{"data-reveal":!0,className:`relative p-8 sm:p-10 ${t>0?"md:border-l":""} ${t%2?"border-l md:border-l":""} ${t>1?"border-t md:border-t-0":""} border-white/10`,children:[c.jsx("div",{className:"lp-display text-5xl font-bold tracking-tight text-white sm:text-6xl",children:c.jsx(G6e,{to:e.value,suffix:e.suffix})}),c.jsx("div",{className:"mt-2 text-sm text-[var(--lp-muted)]",children:n(e.label)})]},e.label))})})})}function Kee({t:n}){const e=hi();return c.jsxs("figure",{className:"lp-card w-[360px] shrink-0 p-6 sm:w-[400px]",children:[c.jsx("span",{className:"lp-display absolute right-6 top-3 text-6xl leading-none text-white/[0.06]","aria-hidden":!0,
5449children:"â"}),c.jsx("blockquote",{className:"relative text-[15px] leading-relaxed text-white/85",children:e(n.quote)}),c.jsxs("figcaption",{className:"relative mt-5 flex items-center gap-3 border-t border-white/5 pt-4",children:[c.jsx("img",{src:n.avatarSrc,alt:"",className:"h-10 w-10 rounded-full object-cover ring-2 ring-white/10",loading:"lazy"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-semibold text-white",children:n.name}),c.jsx("div",{className:"text-xs text-[var(--lp-muted)]",children:e(n.role)})]})]})]})}function nst({testimonials:n}){const e=Math.ceil(n.length/2),t=hi();return c.jsxs("section",{id:"reviews",className:"relative overflow-hidden py-28 sm:py-36",children:[c.jsxs("div",{className:"lp-container text-center",children:[c.jsx("span",{className:"lp-kicker",children:t("From the community")}),c.jsx("h2",{"data-split":!0,className:"lp-section-title mx-auto mt-4 max-w-3xl text-white",children:c.jsx(jf,{text:t("What people say about SpreadOut.")})})]}),c.jsxs("div",{className:"mt-14 space-y-5",children:[c.jsx(jI,{duration:70,gap:20,children:n.slice(0,e).map(r=>c.jsx(Kee,{t:r},r.name))}),c.jsx(jI,{duration:80,gap:20,reverse:!0,children:n.slice(e).map(r=>c.jsx(Kee,{t:r},r.name))})]})]})}function rst(){const[n,e]=G.useState(0),{data:t}=Qr(SB),{t:r,locale:i}=Kr(),s=Bb.filter(o=>o.monthlyCredits),a=[r("Credits are spent per creation: short videos {video} credits, text + image posts {post} credits (+{image} per AI image) and long videos {long} credits per minute.",{video:(t==null?void 0:t.videoCreditCost)??fc.shortVideo,post:fc.textImageBase,image:fc.perAiImage,long:fc.longVideoPerMinute}),r("New accounts start with {n} free credits (and can earn {ad} more per rewarded ad).",{n:((t==null?void 0:t.starterCredits)??350).toLocaleString(i),ad:(t==null?void 0:t.adCreditReward)??20}),s.map(o=>r("{plan} includes {n} credits a month",{plan:o.name,n:o.monthlyCredits.toLocaleString(i)})).join(", ")+"."].join(" ");return c.jsx("section",{id:"faq",className:"relative py-28 sm:py-36",children:c.jsxs("div",{className:"lp-container grid gap-14 lg:grid-cols-[0.8fr_1.2fr]",children:[c.jsxs("div",{className:"lg:sticky lg:top-32 lg:self-start",children:[c.jsx("span",{className:"lp-kicker",children:r("FAQ")}),c.jsx("h2",{"data-split":!0,className:"lp-section-title mt-4 text-white",children:c.jsx(jf,{text:r("Questions, answered.")})}),c.jsx("p",{"data-reveal":!0,className:"mt-5 max-w-sm text-[var(--lp-muted)]",children:r("Everything about how SpreadOut plans, creates and publishes your content.")}),c.jsxs("div",{"data-reveal":!0,className:"lp-glass mt-8 max-w-sm rounded-3xl p-6",children:[c.jsx("div",{className:"font-semibold text-white",children:r("Still curious?")}),c.jsx("p",{className:"mt-1 text-sm text-[var(--lp-muted)]",children:r("Talk to the team behind SpreadOut, we reply fast.")}),c.jsxs("a",{href:"mailto:[email protected]",className:"lp-btn lp-btn-ghost mt-4 !h-11 text-sm",children:[r("Email us")," â"]})]})]}),c.jsx("div",{className:"divide-y divide-white/10 border-y border-white/10",children:YCe.map((o,l)=>{const u=n===l;return c.jsxs("div",{"data-reveal":!0,className:`lp-acc ${u?"is-open":""}`,children:[c.jsxs("button",{className:"flex w-full items-center justify-between gap-6 py-6 text-left",onClick:()=>e(u?null:l),"aria-expanded":u,children:[c.jsx("span",{className:`lp-display text-lg font-semibold transition-colors sm:text-xl ${u?"text-white":"text-white/80"}`,children:r(o.q)}),c.jsx("span",{className:`lp-acc-icon grid h-9 w-9 shrink-0 place-items-center rounded-full border text-lg ${u?"border-[var(--lp-lime)] bg-[var(--lp-lime)] text-black":"border-white/15 text-white"}`,children:"+"})]}),c.jsx("div",{className:"lp-acc-panel",children:c.jsx("div",{children:c.jsx("p",{className:"max-w-2xl pb-6 leading-relaxed text-[var(--lp-muted)]",children:o.a?r(o.a):a})})})]},o.q)})})]})})}function ist(){const n=$8(),[e,t]=G.useState(""),r=G.useRef(null),i=q8(.25),s=hi();AT(()=>{if(!r.current||wc())return;const o=Si.context(()=>{Si.fromTo(".lp-portal",{scale:.6,opacity:0},{scale:1,opacity:1,ease:"none",scrollTrigger:{trigger:r.current,start:"top bottom",end:"center center",scrub:!0}})},r);return()=>o.revert()},[]);const a=o=>{o.preventDefault(),n(e)};return c.jsxs("section",{ref:r,className:"relative overflow-hidden py-32 sm:py-44",children:[c.jsx("div",{className:"lp-portal pointer-events-none absolute left-1/2 top-1/2 h-[900px] w-[900px] -translate-x-1/2 -translate-y-1/2 roun
5449ded-full","aria-hidden":!0,style:{background:"conic-gradient(from 0deg, rgba(207,255,5,.35), rgba(34,211,238,.25), rgba(139,92,246,.3), rgba(16,185,129,.3), rgba(207,255,5,.35))",filter:"blur(90px)",animation:"lp-spin 18s linear infinite"}}),c.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(closest-side,transparent,var(--lp-bg)_85%)]","aria-hidden":!0}),c.jsxs("div",{className:"lp-container relative text-center",children:[c.jsx("h2",{"data-split":!0,className:"lp-display mx-auto max-w-4xl text-[clamp(2.4rem,6.5vw,5.6rem)] font-bold leading-[0.98] tracking-[-0.045em] text-white",children:c.jsx(jf,{text:s("Your next seven posts are one link away.")})}),c.jsx("p",{"data-reveal":!0,className:"mx-auto mt-6 max-w-xl text-lg text-[var(--lp-muted)]",children:s("Paste your website and watch a week of on-brand content plan itself. Start free, no editing skills needed.")}),c.jsx("form",{"data-reveal":!0,onSubmit:a,className:"mx-auto mt-10 max-w-xl",children:c.jsxs("div",{className:"lp-url",children:[c.jsx("span",{className:"lp-mono hidden text-sm text-[var(--lp-muted)] sm:inline",children:"https://"}),c.jsx("input",{"aria-label":s("Your website URL"),type:"text",inputMode:"url",placeholder:"yourbrand.com",value:e,onChange:o=>t(o.target.value.replace(/^https?:\/\//i,""))}),c.jsxs("button",{ref:i,type:"submit",className:"lp-btn lp-btn-primary !h-12",children:[c.jsx("span",{className:"lp-btn-shine"}),s("Start free")," ",c.jsx("span",{"aria-hidden":!0,children:"â"})]})]})}),c.jsx("a",{"data-reveal":!0,href:"/pricing",className:"mt-6 inline-block text-sm font-semibold text-white/70 underline-offset-4 hover:text-white hover:underline",children:s("Compare plans")})]})]})}function Lq({footerNavigation:n}){const e=hi();return c.jsxs("footer",{className:"relative overflow-hidden border-t border-white/10 pt-20",children:[c.jsxs("div",{className:"lp-container grid gap-12 md:grid-cols-[1.4fr_1fr_1fr]",children:[c.jsxs("div",{children:[c.jsxs("a",{href:"/",className:"flex items-center gap-2.5",children:[c.jsx("img",{src:V1,alt:"",className:"h-8 w-8"}),c.jsx("span",{className:"lp-display text-lg font-bold text-white",children:"SpreadOut"})]}),c.jsx("p",{className:"mt-4 max-w-sm text-sm leading-relaxed text-[var(--lp-muted)]",children:e("The AI social media autopilot. One link in, a week of on-brand videos and carousels out, published everywhere.")}),c.jsxs("div",{className:"mt-6 flex gap-3",children:[c.jsx("a",{href:"https://apps.apple.com/fr/app/spread-out-ai/id6739773279?l=en-GB&platform=iphone",className:"opacity-70 hover:opacity-100",children:c.jsx("img",{src:"https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg",alt:e("Download on the App Store"),className:"h-9"})}),c.jsx("a",{href:"https://play.google.com/store/apps/details?id=com.spreadoutai.app",className:"opacity-70 hover:opacity-100",children:c.jsx("img",{src:"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png",alt:e("Get it on Google Play"),className:"-my-2 h-[52px]"})})]})]}),[{title:e("Product"),items:n.app},{title:e("Legal"),items:n.company}].map(t=>c.jsxs("div",{children:[c.jsx("h3",{className:"lp-mono text-xs uppercase tracking-[0.2em] text-[var(--lp-muted)]",children:t.title}),c.jsx("ul",{className:"mt-5 space-y-3",children:t.items.map(r=>c.jsx("li",{children:c.jsx("a",{href:r.href,className:"text-sm text-white/75 transition-colors hover:text-[var(--lp-lime)]",children:e(r.name)})},r.name))})]},t.title))]}),c.jsxs("div",{className:"lp-container mt-16 flex flex-col items-center justify-between gap-3 border-t border-white/5 py-6 text-xs text-[var(--lp-muted)] sm:flex-row",children:[c.jsxs("span",{children:["© ",new Date().getFullYear()," SpreadOut AI. ",e("All rights reserved.")]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("span",{className:"lp-mono hidden sm:inline",children:e("Built for creators, founders and teams.")}),c.jsx(Y4,{direction:"up"})]})]}),c.jsx("div",{className:"pointer-events-none select-none px-4 pb-2 text-center","aria-hidden":!0,children:c.jsxs("div",{className:"lp-wordmark",children:["Spread",c.jsx("span",{children:"Out"})]})})]})}function sst(){const n=G.useRef(null);Sce();const e=hi();return Tce(n,[e]),G.useEffect(()=>{var i,s;const t=()=>di.refresh();window.addEventListener("load",t),(s=(i=document.fonts)==null?void 0:i.ready)==null||s.then(t);const r=window.setTimeout(t,1200);return()=>{window.removeEventListener("load",t),window.clearTimeout(r)}},[]),c.jsx(pV,{children:c.jsxs("div",{ref:n,className:"lp min-h-screen overflow-x-clip",children:[c.jsx(mV,{}),c.jsxs("main",{children:[c.jsx(Lit,{}),c.jsx(est,{}),c.jsx(Uit,{}),c.jsx(Qit,{}),c.jsx(tst,{}),c.jsx(nst,{testimonials:$Ce}),c.jsx(rst,{}),c.jsx(ist,{})]}),c.jsx(Lq,{footerNavigation:xy})]})})}function ast(){const n=po(),[e,t]=G.useState(""),r=G.useRef(null),{data:i}=Ma(),s=ro(),[a,o]=G.useState(null);G.useEffect(()=>{const d=new URLSearchParams(n.search).get("referralCode");
5449d&&(console.log("[SignupPage] Found referral code in URL:",d),o(d))},[n]),G.useEffect(()=>{if(a)try{localStorage.setItem("spreadout:referralCode",JSON.stringify({code:a,at:Date.now()}))}catch{}},[a]),G.useEffect(()=>{if(i){const u=setTimeout(()=>{s("/dashboard")},1e3);return()=>clearTimeout(u)}},[i,s]);const l=()=>{if(window.turnstile&&r.current&&!r.current.hasChildNodes())try{window.turnstile.render(r.current,{sitekey:"0x4AAAAAAAjvf2a3XoV_saKW",theme:"auto",callback:u=>{console.log("[Turnstile] CAPTCHA challenge passed"),t(u)},"expired-callback":()=>{console.log("[Turnstile] CAPTCHA token expired"),t("")},"error-callback":()=>{console.error("[Turnstile] CAPTCHA challenge error"),t("")}})}catch(u){console.error("[Turnstile] Render error:",u)}};return c.jsx(xT,{title:"Create your account",subtitle:"Sign up and get 350 free credits to get started",children:c.jsxs("div",{className:"auth-form-container",children:[c.jsx(z3e,{additionalFields:[u=>{const{register:d,setValue:h,formState:{errors:f}}=u,[p,g]=G.useState(!1);return G.useEffect(()=>{e&&h("turnstileToken",e,{shouldValidate:!0})},[e,h]),G.useEffect(()=>{const A=()=>{window.turnstile&&r.current&&!r.current.hasChildNodes()&&l()};if(window.turnstile)A();else return window.addEventListener("turnstile:ready",A),()=>window.removeEventListener("turnstile:ready",A)},[]),c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mt-3 mb-3",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{id:"newsletter",type:"checkbox",checked:p,className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",onChange:A=>{const x=A.target.checked;g(x),h("newsletter",x.toString())}}),c.jsx("label",{htmlFor:"newsletter",className:"ml-2 block text-sm text-gray-900 dark:text-white",children:"Subscribe to our newsletter"})]})}),c.jsx("input",{type:"hidden",...d("newsletter"),value:p.toString()}),a&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"hidden",...d("referralCode"),defaultValue:a,"data-testid":"referral-code-input"}),c.jsxs("div",{className:"mt-2 mb-2 text-sm text-green-600 dark:text-[#CFFF05]",children:["Using referral code: ",a]})]}),c.jsxs("div",{className:"my-4 flex flex-col items-center justify-center",children:[c.jsx("div",{ref:r,className:"cf-turnstile min-h-[65px]"}),f.turnstileToken&&c.jsx("p",{className:"mt-1 text-xs text-red-500 font-medium",children:f.turnstileToken.message})]}),c.jsx("input",{type:"hidden",...d("turnstileToken",{required:"Please verify the security check before signing up"}),value:e||""})]})}],appearance:{colors:{primary:"#4f46e5"}}}),c.jsx("div",{className:"mt-4 text-center",children:c.jsxs("p",{className:"text-sm text-gray-600 dark:text-bodydark",children:["Already have an account?"," ",c.jsx(Ks,{to:"/login",className:"font-bold text-[#556b00] dark:text-[#CFFF05] hover:underline",children:"Log in"})]})})]})})}let ost={data:""},lst=n=>{if(typeof window=="object"){let e=(n?n.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(n||document.head).appendChild(e),e.firstChild}return n||ost},cst=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ust=/\/\*[^]*?\*\/| +/g,Zee=/\n+/g,LA=(n,e)=>{let t="",r="",i="";for(let s in n){let a=n[s];s[0]=="@"?s[1]=="i"?t=s+" "+a+";":r+=s[1]=="f"?LA(a,s):s+"{"+LA(a,s[1]=="k"?"":e)+"}":typeof a=="object"?r+=LA(a,e?e.replace(/([^,])+/g,o=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,o):o?o+" "+l:l)):s):a!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=LA.p?LA.p(s,a):s+":"+a+";")}return t+(e&&i?e+"{"+i+"}":i)+r},_m={},tAe=n=>{if(typeof n=="object"){let e="";for(let t in n)e+=t+tAe(n[t]);return e}return n},dst=(n,e,t,r,i)=>{let s=tAe(n),a=_m[s]||(_m[s]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(s));if(!_m[a]){let l=s!==n?n:(u=>{let d,h,f=[{}];for(;d=cst.exec(u.replace(ust,""));)d[4]?f.shift():d[3]?(h=d[3].replace(Zee," ").trim(),f.unshift(f[0][h]=f[0][h]||{})):f[0][d[1]]=d[2].replace(Zee," ").trim();return f[0]})(n);_m[a]=LA(i?{["@keyframes "+a]:l}:l,t?"":"."+a)}let o=t&&_m.g?_m.g:null;return t&&(_m.g=_m[a]),((l,u,d,h)=>{h?u.data=u.data.replace(h,l):u.data.indexOf(l)===-1&&(u.data=d?l+u.data:u.data+l)})(_m[a],e,r,o),a},hst=(n,e,t)=>n.reduce((r,i,s)=>{let a=e[s];if(a&&a.call){let o=a(t),l=o&&o.props&&o.props.className||/^go/.test(o)&&o;a=l?"."+l:o&&typeof o=="object"?o.props?"":LA(o,""):o===!1?"":o}return r+i+(a??"")},"");function KR(n){let e=this||{},t=n.call?n(e.p):n;
5449return dst(t.unshift?t.raw?hst(t,[].slice.call(arguments,1),e.p):t.reduce((r,i)=>Object.assign(r,i&&i.call?i(e.p):i),{}):t,lst(e.target),e.g,e.o,e.k)}let nAe,bU,wU;KR.bind({g:1});let og=KR.bind({k:1});function fst(n,e,t,r){LA.p=e,nAe=n,bU=t,wU=r}function nx(n,e){let t=this||{};return function(){let r=arguments;function i(s,a){let o=Object.assign({},s),l=o.className||i.className;t.p=Object.assign({theme:bU&&bU()},o),t.o=/ *go\d+/.test(l),o.className=KR.apply(t,r)+(l?" "+l:"");let u=n;return n[0]&&(u=o.as||n,delete o.as),wU&&u[0]&&wU(o),nAe(u,o)}return i}}var pst=n=>typeof n=="function",_U=(n,e)=>pst(n)?n(e):n,mst=(()=>{let n=0;return()=>(++n).toString()})(),gst=(()=>{let n;return()=>{if(n===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");n=!e||e.matches}return n}})(),Ast=20,rAe="default",iAe=(n,e)=>{let{toastLimit:t}=n.settings;switch(e.type){case 0:return{...n,toasts:[e.toast,...n.toasts].slice(0,t)};case 1:return{...n,toasts:n.toasts.map(a=>a.id===e.toast.id?{...a,...e.toast}:a)};case 2:let{toast:r}=e;return iAe(n,{type:n.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:i}=e;return{...n,toasts:n.toasts.map(a=>a.id===i||i===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(a=>a.id!==e.toastId)};case 5:return{...n,pausedAt:e.time};case 6:let s=e.time-(n.pausedAt||0);return{...n,pausedAt:void 0,toasts:n.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},xst=[],vst={toasts:[],pausedAt:void 0,settings:{toastLimit:Ast}},Vb={},sAe=(n,e=rAe)=>{Vb[e]=iAe(Vb[e]||vst,n),xst.forEach(([t,r])=>{t===e&&r(Vb[e])})},aAe=n=>Object.keys(Vb).forEach(e=>sAe(n,e)),yst=n=>Object.keys(Vb).find(e=>Vb[e].toasts.some(t=>t.id===n)),Oq=(n=rAe)=>e=>{sAe(e,n)},bst=(n,e="blank",t)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:e,ariaProps:{role:"status","aria-live":"polite"},message:n,pauseDuration:0,...t,id:(t==null?void 0:t.id)||mst()}),qT=n=>(e,t)=>{let r=bst(e,n,t);return Oq(r.toasterId||yst(r.id))({type:2,toast:r}),r.id},gr=(n,e)=>qT("blank")(n,e);gr.error=qT("error");gr.success=qT("success");gr.loading=qT("loading");gr.custom=qT("custom");gr.dismiss=(n,e)=>{let t={type:3,toastId:n};e?Oq(e)(t):aAe(t)};gr.dismissAll=n=>gr.dismiss(void 0,n);gr.remove=(n,e)=>{let t={type:4,toastId:n};e?Oq(e)(t):aAe(t)};gr.removeAll=n=>gr.remove(void 0,n);gr.promise=(n,e,t)=>{let r=gr.loading(e.loading,{...t,...t==null?void 0:t.loading});return typeof n=="function"&&(n=n()),n.then(i=>{let s=e.success?_U(e.success,i):void 0;return s?gr.success(s,{id:r,...t,...t==null?void 0:t.success}):gr.dismiss(r),i}).catch(i=>{let s=e.error?_U(e.error,i):void 0;s?gr.error(s,{id:r,...t,...t==null?void 0:t.error}):gr.dismiss(r)}),n};var wst=og` 5450from { 5451 transform: scale(0) rotate(45deg); 5452 opacity: 0; 5453} 5454to { 5455 transform: scale(1) rotate(45deg); 5456 opacity: 1; 5457}`,_st=og` 5458from { 5459 transform: scale(0); 5460 opacity: 0; 5461} 5462to { 5463 transform: scale(1); 5464 opacity: 1; 5465}`,Sst=og` 5466from { 5467 transform: scale(0) rotate(90deg); 5468 opacity: 0; 5469} 5470to { 5471 transform: scale(1) rotate(90deg); 5472 opacity: 1; 5473}`,Tst=nx("div")` 5474 width: 20px; 5475 opacity: 0; 5476 height: 20px; 5477 border-radius: 10px; 5478 background: ${n=>n.primary||"#ff4b4b"}; 5479 position: relative; 5480 transform: rotate(45deg); 5481 5482 animation: ${wst} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 5483 forwards; 5484 animation-delay: 100ms; 5485 5486 &:after, 5487 &:before { 5488 content: ''; 5489 animation: ${_st} 0.15s ease-out forwards; 5490 animation-delay: 150ms; 5491 position: absolute; 5492 border-radius: 3px; 5493 opacity: 0; 5494 background: ${n=>n.secondary||"#fff"}; 5495 bottom: 9px; 5496 left: 4px; 5497 height: 2px; 5498 width: 12px; 5499 } 5500 5501 &:before { 5502 animation: ${Sst} 0.15s ease-out forwards; 5503 animation-delay: 180ms; 5504 transform: rotate(90deg); 5505 } 5506`,Est=og` 5507 from { 5508 transform: rotate(0deg); 5509 } 5510 to { 5511 transform: rotate(360deg); 5512 } 5513`,Cst=nx("div")` 5514 width: 12px; 5515 height: 12px; 5516 box-sizing: border-box; 5517 border: 2px solid; 5518 border-radius: 100%; 5519 border-color: ${n=>n.secondary||"#e0e0e0"}; 5520 border-right-color: ${n=>n.primary||"#616161"}; 5521 animation: ${Est} 1s linear infinite; 5522`,Nst=og` 5523from { 5524 transform: scale(0) rotate(45deg); 5525 opacity: 0; 5526} 5527to { 5528 transform: scale(1) rotate(45deg); 5529 opacity: 1; 5530}`,Mst=og` 55310% { 5532 height: 0; 5533 width: 0; 5534 opacity: 0; 5535} 553640% { 5537 height: 0; 5538 width: 6px; 5539 opacity: 1; 5540} 5541100% { 5542 opacity: 1; 5543 height: 10px; 5544}`,kst=nx("div")`
5545 width: 20px; 5546 opacity: 0; 5547 height: 20px; 5548 border-radius: 10px; 5549 background: ${n=>n.primary||"#61d345"}; 5550 position: relative; 5551 transform: rotate(45deg); 5552 5553 animation: ${Nst} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 5554 forwards; 5555 animation-delay: 100ms; 5556 &:after { 5557 content: ''; 5558 box-sizing: border-box; 5559 animation: ${Mst} 0.2s ease-out forwards; 5560 opacity: 0; 5561 animation-delay: 200ms; 5562 position: absolute; 5563 border-right: 2px solid; 5564 border-bottom: 2px solid; 5565 border-color: ${n=>n.secondary||"#fff"}; 5566 bottom: 6px; 5567 left: 6px; 5568 height: 10px; 5569 width: 6px; 5570 } 5571`,Rst=nx("div")` 5572 position: absolute; 5573`,Pst=nx("div")` 5574 position: relative; 5575 display: flex; 5576 justify-content: center; 5577 align-items: center; 5578 min-width: 20px; 5579 min-height: 20px; 5580`,Lst=og` 5581from { 5582 transform: scale(0.6); 5583 opacity: 0.4; 5584} 5585to { 5586 transform: scale(1); 5587 opacity: 1; 5588}`,Ost=nx("div")` 5589 position: relative; 5590 transform: scale(0.6); 5591 opacity: 0.4; 5592 min-width: 20px; 5593 animation: ${Lst} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) 5594 forwards; 5595`,Dst=({toast:n})=>{let{icon:e,type:t,iconTheme:r}=n;return e!==void 0?typeof e=="string"?G.createElement(Ost,null,e):e:t==="blank"?null:G.createElement(Pst,null,G.createElement(Cst,{...r}),t!=="loading"&&G.createElement(Rst,null,t==="error"?G.createElement(Tst,{...r}):G.createElement(kst,{...r})))},jst=n=>` 55960% {transform: translate3d(0,${n*-200}%,0) scale(.6); opacity:.5;} 5597100% {transform: translate3d(0,0,0) scale(1); opacity:1;} 5598`,Ist=n=>` 55990% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 5600100% {transform: translate3d(0,${n*-150}%,-1px) scale(.6); opacity:0;} 5601`,Fst="0%{opacity:0;} 100%{opacity:1;}",Ust="0%{opacity:1;} 100%{opacity:0;}",Bst=nx("div")` 5602 display: flex; 5603 align-items: center; 5604 background: #fff; 5605 color: #363636; 5606 line-height: 1.3; 5607 will-change: transform; 5608 box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); 5609 max-width: 350px; 5610 pointer-events: auto; 5611 padding: 8px 10px; 5612 border-radius: 8px; 5613`,Vst=nx("div")` 5614 display: flex; 5615 justify-content: center; 5616 margin: 4px 10px; 5617 color: inherit; 5618 flex: 1 1 auto; 5619 white-space: pre-line; 5620`,zst=(n,e)=>{let t=n.includes("top")?1:-1,[r,i]=gst()?[Fst,Ust]:[jst(t),Ist(t)];return{animation:e?`${og(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${og(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}};G.memo(({toast:n,position:e,style:t,children:r})=>{let i=n.height?zst(n.position||e||"top-center",n.visible):{opacity:0},s=G.createElement(Dst,{toast:n}),a=G.createElement(Vst,{...n.ariaProps},_U(n.message,n));return G.createElement(Bst,{className:n.className,style:{...i,...t,...n.style}},typeof r=="function"?r({icon:s,message:a}):G.createElement(G.Fragment,null,s,a))});fst(G.createElement);KR` 5621 z-index: 9999; 5622 > * { 5623 pointer-events: auto; 5624 } 5625`;var d0=gr;function Gst(){const[n,e]=G.useState(""),[t,r]=G.useState(""),[i,s]=G.useState(!1),[a,o]=G.useState(!1),l=G.useRef(null);G.useEffect(()=>{const d=()=>{if(window.turnstile&&l.current&&!l.current.hasChildNodes())try{window.turnstile.render(l.current,{sitekey:"0x4AAAAAAAjvf2a3XoV_saKW",theme:"auto",callback:h=>{r(h)},"expired-callback":()=>{r("")},"error-callback":()=>{r("")}})}catch(h){console.error("[Turnstile] Render error:",h)}};if(window.turnstile)d();else return window.addEventListener("turnstile:ready",d),()=>window.removeEventListener("turnstile:ready",d)},[]);const u=async d=>{var h;if(d.preventDefault(),!n||!n.includes("@")){d0.error("Please enter a valid email address.");return}if(!t){d0.error("Please complete the security check before proceeding.");return}s(!0);try{await Zse({email:n.trim(),turnstileToken:t}),o(!0),d0.success("Password reset link sent! Check your inbox.")}catch(f){console.error("[PasswordReset] Error:",f);const p=((h=f.data)==null?void 0:h.message)||f.message||"Failed to send reset link.";d0.error(p)}finally{s(!1)}};return c.jsx(xT,{title:"Reset your password",subtitle:"Enter your email address and we'll send you recovery instructions",children:c.jsxs("div",{className:"auth-form-container",children:[a?c.jsx("div",{className:"rounded-md bg-green-50 p-4 border border-green-200 dark:bg-[#132d20] dark:border-emerald-800",children:c.jsxs("div",{className:"flex",children:[c.jsx("div",{className:"flex-shrink-0",children:c.jsx("svg",{className:"h-5 w-5 text-green-400 dark:text-emerald-400",viewBox:"0 0 20 20",fill:"currentColor",children:c.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}),c.jsxs("div",{className:"ml-3",children:[c.jsx("h3",{className:"text-sm font-medium text-green-800 dark:text-emerald-300",children:"Check your inbox"}),c.jsxs("p",{className:"mt-1 text-xs text-green-700 dark:text-emerald-400",children:["If an account exists for ",n,", a password reset link has been sent."]})]})]})}):c.jsxs("form",{onSubmit:u,className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"reset-email",className:"block text-sm font-medium text-gray-700 dark:text-white",children:"Email Address"}),c.jsx("input",{id:"reset-email",type:"email",required:!0,value:n,onChange:d=>e(d.target.value),disabled:i,placeholder:"[email protected]",className:"mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 shadow-sm focus:border-[#CFFF05] focus:outline-none focus:ring-1 focus:ring-[#CFFF05] sm:text-sm bg-[#f8f4ff] dark:bg-form-input dark:border-form-strokedark dark:text-white dark:placeholder-gray-500"})]}),c.jsx("div",{className:"my-4 flex flex-col items-center justify-center",children:c.jsx("div",{ref:l,className:"cf-turnstile min-h-[65px]"})}),c.jsx("button",{type:"submit",disabled:i||!t,className:"w-full flex justify-center py-2.5 px-4 border border-transparent roun
5625ded-md shadow-sm text-sm font-bold text-white bg-[#4f46e5] hover:bg-indigo-700 dark:bg-[#CFFF05] dark:hover:bg-[#b8e604] dark:text-[#0F121A] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:i?"Sending...":"Send reset link"})]}),c.jsx("div",{className:"mt-6 text-center",children:c.jsxs("span",{className:"text-xs font-semibold text-gray-500 dark:text-bodydark",children:["Remember your password?"," ",c.jsx(Ks,{to:"/login",className:"font-bold text-[#556b00] dark:text-[#CFFF05] hover:underline",children:"Back to login"})]})})]})})}function qst(){return c.jsxs(xT,{title:"Set new password",subtitle:"Choose a secure password for your account",children:[c.jsx(q3e,{}),c.jsx("div",{className:"mt-5 text-center",children:c.jsxs("span",{className:"text-xs font-semibold text-gray-500 dark:text-bodydark",children:["Password successfully reset?"," ",c.jsx(Ks,{to:"/login",className:"font-bold text-[#556b00] dark:text-[#CFFF05] hover:underline",children:"Go to login"})]})})]})}function $st(){const n=ro(),e=po(),{data:t,isLoading:r}=Ma(),[i,s]=G.useState(!1),[a,o]=G.useState(!1);return G.useEffect(()=>{new URLSearchParams(e.search).get("verificationStatus")==="success"&&!i&&(s(!0),d0.success("Email verified successfully!"))},[e.search,i]),G.useEffect(()=>{t&&t.isEmailVerified&&!a&&(o(!0),s(!0),d0.success("Email verified successfully!"))},[t,a]),G.useEffect(()=>{if(i&&t&&t.isEmailVerified){const l=setTimeout(()=>{n("/dashboard")},1500);return()=>clearTimeout(l)}},[i,t,n]),c.jsxs(xT,{title:"Verify your email",subtitle:"Please check your inbox to confirm your email address",children:[c.jsx(G3e,{}),c.jsx("div",{className:"mt-5 text-center",children:c.jsxs("span",{className:"text-xs font-semibold text-gray-500 dark:text-bodydark",children:["If everything is okay,"," ",c.jsx(Ks,{to:"/login",className:"font-bold text-[#556b00] dark:text-[#CFFF05] hover:underline",children:"Go to login"})]})})]})}const Hst=({isEnabled:n,email:e})=>{const t=hi(),[r,i]=G.useState(!!n),[s,a]=G.useState(!1);G.useEffect(()=>{i(!!n)},[n]);const o=async()=>{const l=document.querySelector("input[name='email']"),u=e||(l==null?void 0:l.value);if(!u){alert(t("Please fill in the email field first"));return}a(!0);try{const d=await u4e({email:u,subscribed:!r});i(d.subscribed)}catch(d){window.alert(`${t("Error")}: ${d.message||t("Something went wrong")}`)}finally{a(!1)}};return c.jsx("button",{type:"button",role:"switch","aria-checked":r,"aria-label":t("Newsletter"),disabled:s,onClick:o,className:`relative inline-flex h-7 w-12 shrink-0 items-center rounded-full transition-colors duration-300 disabled:opacity-60 ${r?"bg-[#cfff05] shadow-[0_0_18px_rgba(207,255,5,.45)]":"bg-white/10 ring-1 ring-white/15"}`,children:c.jsx("span",{className:`inline-block h-5 w-5 rounded-full shadow transition-transform duration-300 ease-[cubic-bezier(.22,1,.36,1)] ${r?"translate-x-6 bg-[#05060a]":"translate-x-1 bg-white"}`})})},Wst=[Le("Our use case or feature is not relevant anymore."),Le("We are not satisfied with the quality of the product."),Le("The product lacks a feature we need."),Le("The product is expensive for us."),Le("Customer service was less than expected."),Le("We found an alternative."),Le("Ease of use was less than expected."),Le("The free plan is enough for us.")];function oAe({title:n,lines:e,submitLabel:t,busyLabel:r,onClose:i,onSend:s}){const a=hi(),[o,l]=G.useState([]),[u,d]=G.useState(""),[h,f]=G.useState(!1),p=G.useRef(null);G.useEffect(()=>{const x=b=>{b.key==="Escape"&&i()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[i]);const g=x=>l(b=>b.includes(x)?b.filter(_=>_!==x):[...b,x]),A=()=>{f(!0);try{s(o,u.trim())}catch(x){window.alert(`${a("Error")}: ${(x==null?void 0:x.message)||a("Something went wrong")}`)}finally{f(!1)}};return Vl.createPortal(c.jsxs("div",{className:"dark fixed inset-0 z-[1000] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-label":n,children:[c.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:i,style:{animation:"ws-fade .25s ease both"}}
5625),c.jsxs("div",{ref:p,className:"ws-enter relative max-h-[calc(100dvh-2rem)] w-full max-w-lg overflow-y-auto rounded-[28px] border border-white/10 bg-[#0b0d12] p-7 text-white shadow-[0_40px_120px_-20px_rgba(0,0,0,.9)]",style:{fontFamily:"'Plus Jakarta Sans', system-ui, sans-serif"},children:[c.jsx("button",{onClick:i,"aria-label":a("Close"),className:"absolute right-4 top-4 grid h-9 w-9 place-items-center rounded-full bg-white/5 text-xl leading-none text-white/70 transition-colors hover:bg-white/10 hover:text-white",children:"Ã"}),c.jsx("h2",{className:"pr-10 text-2xl font-bold tracking-tight text-white",style:{fontFamily:"'Space Grotesk', sans-serif"},children:n}),c.jsx("div",{className:"mt-3 space-y-2 text-sm leading-relaxed text-white/60",children:e.map(x=>c.jsx("p",{children:x},x))}),c.jsxs("fieldset",{className:"mt-6",children:[c.jsx("legend",{className:"mb-3 text-[11px] uppercase tracking-[0.2em] text-[#cfff05]",style:{fontFamily:"'JetBrains Mono', monospace"},children:a("Choose one or more reasons")}),c.jsx("div",{className:"space-y-2",children:Wst.map(x=>{const b=o.includes(x);return c.jsxs("button",{type:"button",onClick:()=>g(x),className:`flex w-full items-center gap-3 rounded-2xl border px-4 py-3 text-left text-sm transition-colors ${b?"border-[rgba(207,255,5,.45)] bg-[rgba(207,255,5,.07)] text-white":"border-white/[0.08] bg-white/[0.02] text-white/75 hover:border-white/20"}`,children:[c.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded-md border text-[11px] font-black ${b?"border-[#cfff05] bg-[#cfff05] text-black":"border-white/25"}`,children:b?"â":""}),a(x)]},x)})})]}),c.jsxs("label",{className:"mt-5 block",children:[c.jsx("span",{className:"mb-2 block text-sm font-semibold text-white/80",children:a("Other reason")}),c.jsx("textarea",{rows:3,value:u,onChange:x=>d(x.target.value),placeholder:a("Let us know if there's something else..."),className:"w-full resize-none rounded-2xl border border-white/10 bg-white/[0.03] px-4 py-3 text-sm text-white placeholder-white/30 outline-none transition-colors focus:border-[rgba(207,255,5,.6)] focus:ring-0"})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[c.jsx("button",{type:"button",onClick:i,className:"h-11 rounded-full border border-white/15 bg-white/[0.04] px-5 text-sm font-bold text-white transition-colors hover:bg-white/[0.08]",children:a("Keep it")}),c.jsx("button",{type:"button",disabled:h,onClick:A,className:"h-11 rounded-full bg-red-500/15 px-5 text-sm font-bold text-red-300 ring-1 ring-red-500/40 transition-colors hover:bg-red-500/25 disabled:opacity-50",children:h?r:t})]})]})]}),document.body)}const Xst=({onClose:n,onSend:e})=>{const t=hi();return c.jsx(oAe,{title:t("Cancel subscription"),lines:[t("After cancelling you can keep using your remaining credits. They never expire."),t("Once you cancel, no further charges or refunds are made."),t("To improve SpreadOut, we would love to hear why you are cancelling.")],submitLabel:t("Cancel subscription"),busyLabel:t("Loadingâ¦"),onClose:n,onSend:e})},Yst=({onClose:n,onSend:e})=>{const t=hi();return c.jsx(oAe,{title:t("Close account"),lines:[t("Closing your account deactivates it and signs you out. To have your data deleted, email [email protected]."),t("Once you close it, no further charges or refunds are made."),t("To improve SpreadOut, we would love to hear why you are leaving.")],submitLabel:t("Close account"),busyLabel:t("Closingâ¦"),onClose:n,onSend:e})},Qst=({client:n="ca-pub-2108171165843907",slot:e,format:t="auto",style:r={},className:i="",responsive:s=!0})=>{const a=G.useRef(null);G.useEffect(()=>{try{typeof window<"u"&&a.current&&window.adsbygoogle&&(window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({}))}catch(l){console.error("AdSense error:",l)}},[]);const o={display:"block",textAlign:"center",...r};return c.jsx("div",{className:`adsense-container ${i}`,children:c.jsx("ins",{ref:a,className:"adsbygoogle",style:o,"data-ad-client":n,"data-ad-slot":e,"data-ad-format":t,"data-full-width-responsive":s?"true":"false"})})},Kst={BANNER:"ca-pub-2108171165843907/XXXXXXXX"},Dq=()=>c.jsx(Qst,{slot:Kst.BANNER,style:{height:"90px",width:"728px",margin:"0 auto"}}),Zst=()=>{const{t:n,locale:e}=Kr(),[t,r]=G.useState("claude"),[i,s]=G.useState(""),[a,o]=G.useState(!1),[l,u]=G.useState(null),[d,h]=G.useState(!1),[f,p]=G.useState(null),[g,A]=G.useState(null),{data:x,refetch:b}=Qr(N4e),_=x||[],M=`${(Zi.apiUrl||"https://spread-out-server.fly.dev").replace(/\/$/,"")}/api/mcp`,T=l||"YOUR_TOKEN",L=(U,B)=>{navigator.clipboard.writeText(U),p(B),setTimeout(()=>p(null),2200)},D=async U=>{var B;U.preventDefault(),h(!0);try{const z=await CSe({name:i.trim()||void 0,readOnly:a});u(z.token),s(""),b()}catch(z){d0.error(((B=z==null?void 0:z.data)==null?void 0:B.message)||(z==null?void 0:z.message)||n("Could not create the token."))}finally{h(!1)}}
5625,P=async U=>{try{await NSe({id:U}),d0.success(n("Disconnected.")),b()}catch{d0.error(n("Could not disconnect. Try again."))}A(null)},O={claude:{label:"Claude",steps:n("In Claude (web or desktop): Settings â Connectors â Add custom connector. Paste the server URL, then sign in to Spread Out when asked.")},chatgpt:{label:"ChatGPT",steps:n("In ChatGPT: Settings â Apps & Connectors â Advanced â turn on Developer mode, then Create a connector with the server URL. Sign in to Spread Out when asked.")},"claude-code":{label:"Claude Code",steps:n("Run this in your terminal, then type /mcp in Claude Code to sign in:"),code:`claude mcp add --transport http spreadout ${M}`},cursor:{label:"Cursor",steps:n("Add this to your Cursor MCP settings. Cursor opens the Spread Out sign-in the first time."),file:"~/.cursor/mcp.json",code:JSON.stringify({mcpServers:{spreadout:{url:M}}},null,2)},vscode:{label:"VS Code",steps:n("Add this to your workspace, then start the server from the MCP view. VS Code opens the Spread Out sign-in."),file:".vscode/mcp.json",code:JSON.stringify({servers:{spreadout:{type:"http",url:M}}},null,2)},gemini:{label:"Gemini CLI",steps:n("Gemini CLI uses a token: create one below, then add this to your settings."),file:"~/.gemini/settings.json",code:JSON.stringify({mcpServers:{spreadout:{httpUrl:M,headers:{Authorization:`Bearer ${T}`}}}},null,2)},token:{label:n("Other agents"),steps:n("Any MCP client that supports Streamable HTTP: use the server URL with a token from below in the Authorization header."),code:`POST ${M} 5626Authorization: Bearer ${T} 5627Content-Type: application/json 5628Accept: application/json, text/event-stream`}},F=O[t];return c.jsxs("div",{className:"ws-glass ws-enter relative overflow-hidden rounded-[28px] p-6 sm:p-8",style:{animationDelay:".18s"},children:[c.jsx("div",{className:"pointer-events-none absolute -left-20 -top-24 h-64 w-64 rounded-full bg-[rgba(139,92,246,.14)] blur-3xl","aria-hidden":!0}),c.jsxs("div",{className:"relative flex flex-col gap-5 border-b border-white/[0.06] pb-7 lg:flex-row lg:items-end lg:justify-between",children:[c.jsxs("div",{className:"flex items-start gap-3.5",children:[c.jsx("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-2xl bg-white/[0.05] text-[var(--lp-lime)] ring-1 ring-white/10",children:c.jsx(foe,{className:"h-4 w-4"})}),c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-1.5",children:n("MCP for AI agents")}),c.jsx("h2",{className:"ws-display text-xl font-bold text-white sm:text-2xl",children:n("Connect your AI agents")}),c.jsx("p",{className:"ws-muted mt-1 max-w-2xl text-sm",children:n("Let Claude, ChatGPT, Cursor or your own agent plan, generate, schedule and publish with Spread Out, and manage comment replies, using your credits.")})]})]}),c.jsxs(ru,{to:"/docs/mcp",className:"ws-btn ws-btn-ghost !h-11 !px-5 shrink-0 text-sm",children:[c.jsx(lEe,{className:"h-3.5 w-3.5"})," ",n("Read the docs")]})]}),c.jsxs("div",{className:"relative grid grid-cols-1 gap-8 pt-7 lg:grid-cols-12",children:[c.jsxs("div",{className:"space-y-5 lg:col-span-7",children:[c.jsxs("div",{children:[c.jsx("div",{className:"mb-2 text-xs font-bold text-white/70",children:n("Server URL")}),c.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-2xl border border-[rgba(207,255,5,.3)] bg-[rgba(207,255,5,.05)] p-3",children:[c.jsx("span",{className:"ws-mono truncate text-[13px] text-[#e9ffa1]",children:M}),c.jsxs("button",{onClick:()=>L(M,"url"),className:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-[var(--lp-lime)] px-3 py-1.5 text-xs font-bold text-black",children:[f==="url"?c.jsx(n6,{className:"h-3 w-3"}):c.jsx($7,{className:"h-3 w-3"})," ",n(f==="url"?"Copied":"Copy")]})]})]}),c.jsx("div",{className:"flex flex-wrap gap-1 rounded-[22px] border border-white/[0.08] bg-white/[0.03] p-1",children:Object.keys(O).map(U=>c.jsx("button",{onClick:()=>r(U),className:`rounded-full px-3.5 py-2 text-xs font-bold transition-all duration-300 ${t===U?"bg-[var(--lp-lime)] text-black shadow-[0_10px_30px_-12px_rgba(207,255,5,.8)]":"text-white/60 hover:text-white"}`,children:O[U].label},U))}),c.jsxs("p",{className:"text-sm text-white/70",children:[F.steps,F.file&&c.jsxs(c.Fragment,{children:[" ",c.jsx("code",{className:"ws-mono rounded bg-white/[0.06] px-1.5 py-0.5 text-xs text-white/80",children:F.file})]})]}),F.code&&c.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-white/10 bg-black/60 p-5",children:[c.jsxs("button",{onClick:()=>L(F.code,`cfg-${t}`),className:"absolute right-4 top-4 inline-flex items-center gap-1.5 rounded-full bg-white/10 px-3 py-1.5 text-xs font-bold text-white backdrop-blur transition-colors hover:bg-white/20",children:[f===`cfg-${t}`?c.jsx(n6,{className:"h-3 w-3 text-[var(--lp-lime)]"}):c.jsx($7,{className:"h-3 w-3"})," ",f===`cfg-${t}`?n("Copied"):n("Copy")]}
5628),c.jsx("pre",{className:"ws-enter ws-mono overflow-x-auto pb-1 pr-24 pt-2 text-xs leading-relaxed text-[#e9ffa1]",children:F.code},t)]})]}),c.jsxs("div",{className:"space-y-6 lg:col-span-5",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"flex items-center gap-2 text-base font-bold text-white",children:[c.jsx(XTe,{className:"h-4 w-4 text-[var(--lp-lime)]"})," ",n("Connected agents ({n})",{n:_.length})]}),c.jsx("div",{className:"mt-3",children:_.length?c.jsx("div",{className:"divide-y divide-white/[0.06] overflow-hidden rounded-2xl border border-white/[0.08] bg-white/[0.02]",children:_.map(U=>c.jsxs("div",{className:"flex items-center justify-between gap-3 p-3.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"truncate text-sm font-bold text-white",children:U.name}),c.jsxs("span",{className:"ws-mono shrink-0 rounded-full bg-white/[0.06] px-2 py-0.5 text-[9.5px] font-bold uppercase tracking-wider text-white/55",children:[U.kind==="pat"?n("Token"):"OAuth",U.scope==="spreadout:read"?` · ${n("read-only")}`:""]})]}),c.jsxs("div",{className:"ws-mono mt-0.5 truncate text-[11px] text-white/40",children:[U.tokenHint?`â¦${U.tokenHint} · `:"",U.lastUsedAt?n("used {date}",{date:new Date(U.lastUsedAt).toLocaleDateString(e)}):n("added {date}",{date:new Date(U.createdAt).toLocaleDateString(e)})]})]}),g===U.id?c.jsxs("span",{className:"flex shrink-0 gap-1.5",children:[c.jsx("button",{onClick:()=>P(U.id),className:"rounded-full border border-red-400/40 px-3 py-1 text-xs font-bold text-red-200",children:n("Disconnect")}),c.jsx("button",{onClick:()=>A(null),className:"rounded-full border border-white/15 px-3 py-1 text-xs font-bold text-white/70",children:n("Keep")})]}):c.jsx("button",{onClick:()=>A(U.id),title:n("Disconnect"),className:"grid h-9 w-9 shrink-0 place-items-center rounded-full text-white/45 transition-colors hover:bg-red-500/10 hover:text-red-300",children:c.jsx(I8,{className:"h-4 w-4"})})]},U.id))}):c.jsx("div",{className:"rounded-2xl border border-dashed border-white/10 p-5 text-center text-xs text-white/45",children:n("Nothing connected yet. Agents you approve and tokens you create show up here.")})})]}),c.jsxs("div",{children:[c.jsxs("h3",{className:"flex items-center gap-2 text-base font-bold text-white",children:[c.jsx(F8,{className:"h-3.5 w-3.5 text-[var(--lp-lime)]"})," ",n("Personal tokens")]}),c.jsx("p",{className:"ws-muted mt-1 text-xs",children:n("Only for agents that can't sign in with OAuth. Valid for a year, revocable any time.")}),c.jsxs("form",{onSubmit:D,className:"mt-3 space-y-2.5",children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{type:"text",value:i,onChange:U=>s(U.target.value),placeholder:n("Token name (e.g. Gemini CLI)"),className:"min-w-0 flex-1 rounded-full border border-white/10 bg-white/[0.03] px-4 py-2.5 text-sm text-white placeholder-white/30 outline-none transition-colors focus:border-[rgba(207,255,5,.6)] focus:ring-0"}),c.jsx("button",{type:"submit",disabled:d,className:"ws-btn ws-btn-primary !h-11 !px-5 shrink-0 text-sm",children:n(d?"Creatingâ¦":"Create")})]}),c.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-white/60",children:[c.jsx("input",{type:"checkbox",checked:a,onChange:U=>o(U.target.checked),className:"h-4 w-4 rounded border-white/20 bg-white/5 text-[#cfff05] focus:ring-0"}),n("Read-only (cannot generate, publish or spend credits)")]})]}),l&&c.jsxs("div",{className:"ws-enter mt-3 space-y-2 rounded-2xl border border-[rgba(207,255,5,.35)] bg-[rgba(207,255,5,.06)] p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"text-xs font-bold text-[#e9ffa1]",children:n("New token. Copy it now, it is only shown once.")}),c.jsxs("button",{onClick:()=>L(l,"token"),className:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-[var(--lp-lime)] px-3 py-1 text-xs font-bold text-black",children:[f==="token"?c.jsx(n6,{className:"h-3 w-3"}):c.jsx($7,{className:"h-3 w-3"})," ",n(f==="token"?"Copied":"Copy")]})]}),c.jsx("div",{className:"ws-mono select-all break-all rounded-xl border border-white/10 bg-black/40 p-2.5 text-xs text-[#e9ffa1]",children:l})]})]})]})]})]})};function j1({children:n,wide:e=!1}){return c.jsx("div",{className:"relative z-10 px-4 pb-24 pt-10 sm:px-6 lg:px-8 lg:pt-16",children:c.jsx("div",{className:`mx-auto ${e?"max-w-6xl":"max-w-5xl"}`,children:n})})}function D_({tag:n,eyebrow:e,title:t,accent:r,subtitle:i,actions:s,center:a=!1}){return c.jsxs("header",{className:`ws-enter flex flex-col gap-6 ${a?"items-center text-center":"lg:flex-row lg:items-end lg:justify-between"}`,children:[c.jsxs("div",{className:a?"flex flex-col items-center":"",children:[c.jsxs("span",{className:"ws-mono inline-flex items-center gap-2 rounded-full border border-[rgba(207,255,5,.22)] bg-[rgba(207,255,5,.07)] py-1.5 pl-1.5 pr-3.5 text-[11px] uppercase tracking-[0.14em] text-[#e9ffa1]",children:[n&&c.jsx("b",{className:"rounded-full bg-[var(--lp-lime)] px-2 py-0.5 text-black",children:n}),c.jsx("span",{className:n?"":"pl-2",children:e})]}),c.jsxs("h1",{className:"ws-display mt-5 text-4xl font-bold leading-[1.02] text-white sm:text-5xl",children:[t,r?c.jsxs(c.Fragment,{children:[" ",c.jsx("span",{className:"ws-gradient-text",children:r})]}):null]}),i&&c.jsx("p",{className:`ws-muted mt-3 max-w-xl text-base sm:text-lg ${a?"mx-auto":""}`,children:i})]}),s&&c.jsx("div",{className:"flex flex-wrap items-center gap-2.5",children:s})]})}function Fu({children:n,className:e="",glow:t=!1,delay:r=0}){return c.jsxs("div",{className:`ws-glass ws-enter relative overflow-hidden rounded-[28px] p-6 sm:p-8 ${t?"!border-[rgba(207,255,5,.3)]":""} ${e}`,style:r?{animationDelay:`${r}s`}:void 0,children:[t&&c.jsx("div",{className:"pointer-events-none absolute -right-16 -top-20 h-56 w-56 rounded-full bg-[rgba(207,255,5,.12)] blur-3xl","aria-hidden":!0}),c.jsx("div",{className:"relative",children:n})]})}
5628function $f({kicker:n,title:e,subtitle:t,icon:r,right:i}){return c.jsxs("div",{className:"mb-6 flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between",children:[c.jsxs("div",{className:"flex items-start gap-3.5",children:[r&&c.jsx("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-2xl bg-white/[0.05] text-[var(--lp-lime)] ring-1 ring-white/10",children:r}),c.jsxs("div",{children:[n&&c.jsx("div",{className:"ws-kicker mb-1.5",children:n}),c.jsx("h2",{className:"ws-display text-xl font-bold text-white sm:text-2xl",children:e}),t&&c.jsx("p",{className:"ws-muted mt-1 text-sm",children:t})]})]}),i]})}function Um({label:n,value:e,foot:t,highlight:r=!1}){return c.jsxs("div",{className:`relative overflow-hidden rounded-[22px] border p-5 transition-all duration-300 hover:-translate-y-0.5 ${r?"border-[rgba(207,255,5,.35)] bg-[rgba(207,255,5,.06)]":"border-white/[0.08] bg-white/[0.028] hover:border-white/15"}`,children:[c.jsx("div",{className:`text-[13px] font-semibold ${r?"text-[#e9ffa1]":"text-white/55"}`,children:n}),c.jsx("div",{className:"ws-display mt-3 text-3xl font-bold tabular-nums text-white",children:e}),t&&c.jsx("div",{className:"ws-mono mt-1 text-[11px] text-white/45",children:t})]})}function DN({label:n,children:e,hint:t}){return c.jsxs("div",{className:"flex flex-col gap-3 border-b border-white/[0.06] py-4 last:border-0 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-white",children:n}),t&&c.jsx("div",{className:"ws-muted mt-0.5 text-xs",children:t})]}),c.jsx("div",{className:"min-w-0 sm:text-right",children:e})]})}function q5({icon:n,title:e,body:t,action:r}){return c.jsxs("div",{className:"ws-glass ws-enter relative overflow-hidden rounded-[28px] px-6 py-16 text-center sm:py-20",children:[c.jsx("div",{className:"pointer-events-none absolute -top-32 left-1/2 h-64 w-[30rem] -translate-x-1/2 rounded-full bg-[rgba(207,255,5,.1)] blur-3xl","aria-hidden":!0}),c.jsxs("div",{className:"relative mx-auto h-20 w-20",children:[c.jsx("div",{className:"ws-orbit absolute inset-0 rounded-full border border-dashed border-[rgba(207,255,5,.45)]"}),c.jsx("div",{className:"absolute inset-3 grid place-items-center rounded-full bg-white/[0.05] text-3xl ring-1 ring-white/10",children:n})]}),c.jsx("h3",{className:"ws-display relative mt-6 text-2xl font-bold text-white sm:text-3xl",children:e}),t&&c.jsx("p",{className:"ws-muted relative mx-auto mt-3 max-w-md",children:t}),r&&c.jsx("div",{className:"relative mt-8 flex justify-center",children:r})]})}const O6="min-w-0 flex-1 rounded-full border border-white/10 bg-white/[0.03] px-4 py-2.5 text-sm text-white placeholder-white/30 outline-none transition-colors focus:border-[rgba(207,255,5,.6)] focus:ring-0",Jee="inline-flex h-8 items-center gap-1.5 rounded-full border border-white/12 bg-white/[0.04] px-3 text-xs font-semibold text-white/85 transition-colors hover:bg-white/[0.08] hover:text-white disabled:opacity-50",lAe={fal:"#a78bfa",replicate:"#f87171",higgsfield:"#38bdf8",elevenlabs:"#fbbf24"};function cAe({on:n,disabled:e,onChange:t,label:r}){return c.jsx("button",{type:"button",role:"switch","aria-checked":n,"aria-label":r,disabled:e,onClick:()=>t(!n),className:`relative inline-flex h-7 w-12 shrink-0 items-center rounded-full transition-colors duration-300 disabled:cursor-not-allowed disabled:opacity-50 ${n?"bg-[#cfff05] shadow-[0_0_18px_rgba(207,255,5,.45)]":"bg-white/10 ring-1 ring-white/15"}`,children:c.jsx("span",{className:`inline-block h-5 w-5 rounded-full shadow transition-transform duration-300 ease-[cubic-bezier(.22,1,.36,1)] ${n?"translate-x-6 bg-[#05060a]":"translate-x-1 bg-white"}`})})}function uAe({caps:n,kind:e}){var i;const{t}=Kr();if(!n)return null;const r=[];if(e==="video"){n.imageInput?r.push(n.imageRequired?t("ImageâVideo"):t("Text or ImageâVideo")):r.push(t("TextâVideo only")),n.nativeAudio&&r.push(t("Native audio")),n.audioInput&&r.push(t("Lip sync"));const s=(i=n.durations)!=null&&i.length?n.durations[n.durations.length-1]:n.maxDurationS;
5628s&&r.push(t("Max {s}s",{s}))}else r.push(n.imageInput?t("Text + reference images"):t("TextâImage"));return c.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(s=>c.jsx("span",{className:"ws-mono rounded-full border border-white/10 bg-white/[0.04] px-2 py-0.5 text-[10.5px] text-white/60",children:s},s))})}function dAe({provider:n,label:e}){return c.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/[0.05] px-2 py-0.5 text-[11px] font-semibold text-white/80 ring-1 ring-white/10",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:lAe[n]||"#cfff05"}}),e]})}const Jst={fal:"fal.ai",replicate:"Replicate",higgsfield:"Higgsfield"};function hAe({p:n,onChanged:e}){const{t}=Kr(),[r,i]=G.useState(!1),[s,a]=G.useState(""),[o,l]=G.useState(!1),[u,d]=G.useState(null),h=async()=>{l(!0),d(null);try{await A4e({provider:n.id,key:s.trim()}),a(""),i(!1),e()}catch(g){d((g==null?void 0:g.message)||t("Could not save the key."))}finally{l(!1)}},f=async()=>{if(window.confirm(t("Remove your {name} key? Models from {name} will be unselected.",{name:n.label}))){l(!0);try{await x4e({provider:n.id}),e()}finally{l(!1)}}},p=n.connected?n.status==="valid"?c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-semibold text-[#e9ffa1]",children:[c.jsx(kB,{className:"h-3 w-3"}),t("Connected · {hint}",{hint:n.keyHint})]}):c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-semibold text-amber-300",children:[c.jsx(hoe,{className:"h-3 w-3"}),t("Key rejected")]}):c.jsx("span",{className:"text-xs text-white/45",children:t("Not connected")});return c.jsxs("div",{className:`rounded-[22px] border p-4 transition-colors ${n.status==="valid"?"border-[rgba(207,255,5,.25)] bg-[rgba(207,255,5,.04)]":"border-white/[0.08] bg-white/[0.025]"}`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:lAe[n.id]}}),c.jsx("span",{className:"font-semibold text-white",children:n.label})]}),c.jsx("div",{className:"mt-1",children:p}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsxs("button",{onClick:()=>i(g=>!g),className:Jee,children:[c.jsx(F8,{className:"h-2.5 w-2.5"})," ",n.connected?t("Replace key"):t("Add key")]}),n.connected&&c.jsx("button",{onClick:f,disabled:o,className:Jee,children:t("Remove")})]}),n.lastError&&n.connected&&c.jsx("p",{className:"mt-2 text-xs text-amber-300/90",children:n.lastError}),r&&c.jsxs("div",{className:"ws-enter mt-4 space-y-2.5",children:[c.jsx("input",{type:"password",autoComplete:"off",value:s,onChange:g=>a(g.target.value),placeholder:n.keyFormat||t("API key"),className:`${O6} w-full`}),n.keyFormat&&c.jsx("p",{className:"text-[11px] text-white/45",children:t("Paste the whole API key from {name}: it looks like {format}.",{name:n.label,format:n.keyFormat})}),u&&c.jsx("p",{className:"text-xs text-red-300",children:u}),c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("a",{href:n.keyUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-white/55 hover:text-white",children:[t("Get your {name} key",{name:n.label})," ",c.jsx(xM,{className:"h-2.5 w-2.5"})]}),c.jsxs("button",{onClick:h,disabled:o||!s.trim(),className:"ws-btn ws-btn-primary !h-9 !px-4 text-xs disabled:opacity-50",children:[c.jsx("span",{className:"ws-shine"}),t(o?"Verifyingâ¦":"Save & verify")]})]}),c.jsx("p",{className:"text-[11px] text-white/35",children:t("Your key is encrypted and only used to run your generations. It is never shown again.")})]})]})}function eat(n,e,t){return e?n==="video"&&e.perSecondUsd?t("â ${usd} per 30s video at this modelâs rates",{usd:(e.perSecondUsd*30).toFixed(2)}):n==="image"&&e.perImageUsd?t("â ${usd} per 10 images",{usd:(e.perImageUsd*10).toFixed(2)}):null:null}function tat({kind:n,onClose:e,onPick:t}){var A,x;const{t:r}=Kr(),[i,s]=G.useState(""),[a,o]=G.useState(""),[l,u]=G.useState(null),[d,h]=G.useState(null);G.useEffect(()=>{const b=setTimeout(()=>o(i),300);return()=>clearTimeout(b)},[i]),G.useEffect(()=>{const b=_=>{_.key==="Escape"&&e()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[e]);const{data:f,isLoading:p}=Qr(U4e,{kind:n,search:a,limit:40}),g=async b=>{u(`${b.provider}:${b.id}`),h(null);try{await t(b),e()}catch(_){h((_==null?void 0:_.message)||r("Could not select this model."))}finally{u(null)}};return Vl.createPortal(c.jsx("div",{className:"ws inset-0 z-[100] flex items-end justify-center p-0 backdrop-blur-sm sm:items-center sm:p-6",style:{position:"fixed",background:"rgba(0,0,0,.7)"},onClick:e,children:c.jsxs("div",{className:"ws-glass ws-enter flex max-h-[88vh] w-full max-w-2xl flex-col overflow-hidden rounded-t-[28px] sm:rou
5628nded-[28px]",onClick:b=>b.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-white/[0.06] p-5",children:[c.jsx("h3",{className:"ws-display text-lg font-bold text-white",children:r(n==="image"?"Choose an image model":"Choose a video model")}),c.jsx("button",{onClick:e,"aria-label":r("Close"),className:"grid h-9 w-9 place-items-center rounded-full bg-white/[0.05] text-white/70 hover:text-white",children:c.jsx(iw,{className:"h-3.5 w-3.5"})})]}),c.jsxs("div",{className:"border-b border-white/[0.06] px-5 py-3",children:[c.jsxs("label",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/[0.03] px-4",children:[c.jsx(poe,{className:"h-3 w-3 text-white/40"}),c.jsx("input",{autoFocus:!0,value:i,onChange:b=>s(b.target.value),placeholder:r("Search models (e.g. kling, veo, flux)"),className:"h-10 flex-1 border-0 bg-transparent p-0 text-sm text-white placeholder-white/30 outline-none focus:ring-0"})]}),c.jsx("p",{className:"mt-2 text-[11px] text-white/40",children:r(n==="image"?"Only image models that create from text and from reference images are shown â SpreadOut workflows need both.":"Only video models that animate a start image with native audio are shown â SpreadOut workflows need both.")}),d&&c.jsx("p",{className:"mt-2 text-xs text-red-300",children:d})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[p&&c.jsx("div",{className:"space-y-2 p-2",children:[0,1,2,3].map(b=>c.jsx("div",{className:"ws-skeleton h-16 rounded-2xl"},b))}),!p&&((A=f==null?void 0:f.groups)==null?void 0:A.length)===0&&c.jsx("p",{className:"p-6 text-center text-sm text-white/50",children:r("Connect a provider key first.")}),(x=f==null?void 0:f.groups)==null?void 0:x.map(b=>c.jsxs("div",{className:"mb-4",children:[c.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[c.jsx(dAe,{provider:b.provider,label:b.label}),c.jsx("span",{className:"ws-mono text-[11px] text-white/40",children:b.error?"":r("{n} models",{n:b.total})})]}),b.error&&c.jsx("p",{className:"px-2 text-xs text-amber-300",children:b.error}),b.models.map(_=>{var T;const M=`${_.provider}:${_.id}`;return c.jsxs("button",{onClick:()=>g(_),disabled:!!l,className:"group flex w-full items-start gap-3 rounded-2xl p-3 text-left transition-colors hover:bg-white/[0.05] disabled:opacity-60",children:[_.thumbnailUrl&&!/\.(mp4|webm|mov)(\?|$)/i.test(_.thumbnailUrl)?c.jsx("img",{src:_.thumbnailUrl,alt:"",loading:"lazy",onError:L=>{L.currentTarget.style.visibility="hidden"},className:"h-12 w-12 shrink-0 rounded-xl bg-white/[0.04] object-cover ring-1 ring-white/10"}):c.jsx("span",{className:"grid h-12 w-12 shrink-0 place-items-center rounded-xl bg-white/[0.04] text-white/40 ring-1 ring-white/10",children:n==="image"?c.jsx(RB,{}):c.jsx(PB,{})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:"flex flex-wrap items-baseline justify-between gap-x-3",children:[c.jsx("span",{className:"truncate text-sm font-semibold text-white",children:_.name}),c.jsx("span",{className:"ws-mono min-w-0 break-words text-xs text-[#e9ffa1] sm:shrink-0 sm:text-right",children:l===M?r("Checkingâ¦"):((T=_.price)==null?void 0:T.display)||r("Price on provider site")})]}),c.jsx("span",{className:"ws-mono block truncate text-[11px] text-white/35",children:_.id}),c.jsx("span",{className:"mt-1.5 block",children:c.jsx(uAe,{caps:_.capabilities,kind:n})})]})]},M)})]},b.provider))]})]})}),document.body)}function ete({kind:n,selected:e,connectedAny:t,onOpen:r}){const{t:i}=Kr(),s=eat(n,e==null?void 0:e.price,i);return c.jsxs("div",{className:"rounded-[22px] border border-white/[0.08] bg-white/[0.025] p-4",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-2 text-[13px] font-semibold text-white/55",children:[n==="image"?c.jsx(RB,{className:"h-3 w-3"}):c.jsx(PB,{className:"h-3 w-3"}),i(n==="image"?"Image model":"Video model")]}),c.jsxs("button",{onClick:r,disabled:!t,className:"flex w-full items-center justify-between gap-3 rounded-2xl bg-white/[0.03] p-3 text-left ring-1 ring-white/10 transition-colors hover:bg-white/[0.06] disabled:cursor-not-allowed disabled:opacity-50",children:[c.jsx("span",{className:"min-w-0",children:e?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"truncate text-sm font-semibold text-white",children:e.label}),c.jsx(dAe,{provider:e.provider,label:Jst[e.provider]||e.provider})]}),e.price&&c.jsx("span",{className:"ws-mono mt-1 block break-words text-xs text-[#e9ffa1]",children:e.price.display})]}):c.jsx("span",{className:"text-sm text-white/50",children:i(t?"Choose a model":"Connect a provider first")})}),c.jsx(uoe,{className:"h-3 w-3 shrink-0 text-white/40"})]}),e&&c.jsx("div",{className:"mt-2.5",children:c.jsx(uAe,{caps:e.capabilities,kind:n})}),s&&c.jsx("p",{className:"mt-2 text-xs text-white/50",children:s})]})}function nat({voice:n,onChanged:e}){var P,O,F,U,B,z,H,X,W;const{t}=Kr(),r=(P=n.providers)==null?void 0:P[0],i=(r==null?void 0:r.status)==="valid",s=n.selection,{data:a}=Qr(B4e,void 0,{enabled:i}),[o,l]=G.useState((s==null?void 0:s.modelId)||""),[u,d]=G.useState(((O=s==null?void 0:s.femaleVoice)==null?void 0:O.id)||""),[h,f]=G.useState(((F=s==null?void 0:s.maleVoice)==null?void 0:F.id)||""),[p,g]=G.useState(!1),[A,x]=G.useState(null),[b,_]=G.useState(!1);G.useEffect(()=>{var J,ee;!o&&((J=a==null?void 0:a.models)!=null&&J.length)&&l(((ee=a.models.find(ae=>ae.id==="eleven_multilingual_v2"))==null?void 0:ee.id)||a.models[0].id)},[a,o]);const M=o!==((s==null?void 0:s.modelId)||"")||u.trim()!==(((U=s==null?void 0:s.femaleVoice)==null?void 0:U.id)||"")||h.trim()!==(((B=s==null?void 0:s.maleVoice)==null?void 0:B.id)||""),T=async()=>{g(!0),x(null),_(!1);try{await b4e({modelId:o,femaleVoiceId:u,maleVoiceId:h}),_(!0),e()}
5628catch(J){x((J==null?void 0:J.message)||t("Could not save the voices."))}finally{g(!1)}},L=async J=>{x(null);try{await w4e({enabled:J}),e()}catch(ee){x((ee==null?void 0:ee.message)||t("Could not update."))}},D=(z=a==null?void 0:a.models)==null?void 0:z.find(J=>J.id===o);return c.jsxs(Fu,{delay:.08,glow:n.enabled,children:[c.jsx($f,{kicker:t("Optional"),title:t("Voice-overs"),subtitle:t("Narrate videos with your own ElevenLabs voices instead of SpreadOutâs built-in voices."),icon:c.jsx(pEe,{className:"h-4 w-4"})}),c.jsxs("div",{className:"flex flex-col gap-3 rounded-[22px] border border-white/[0.08] bg-white/[0.025] p-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-white",children:t("Use my ElevenLabs voices")}),c.jsx("p",{className:"ws-muted mt-0.5 text-xs",children:t("Voice-overs bill to your ElevenLabs credits. SpreadOut credit prices donât change.")}),!n.canEnable&&c.jsx("p",{className:"mt-1 text-xs text-white/40",children:t("Connect ElevenLabs and save at least one voice to turn this on.")})]}),c.jsx(cAe,{on:n.enabled,disabled:!n.enabled&&!n.canEnable,onChange:L,label:t("Use my ElevenLabs voices")})]}),c.jsxs("div",{className:"mt-4 grid items-start gap-3 md:grid-cols-[1fr_2fr]",children:[r&&c.jsx(hAe,{p:r,onChanged:e}),c.jsxs("div",{className:`rounded-[22px] border border-white/[0.08] bg-white/[0.025] p-4 ${i?"":"pointer-events-none opacity-50"}`,children:[c.jsx("label",{className:"block text-[13px] font-semibold text-white/55",children:t("Voice model")}),c.jsx("select",{value:o,onChange:J=>l(J.target.value),className:`${O6} mt-2 w-full appearance-none bg-[#0b0d12] [color-scheme:dark]`,children:((a==null?void 0:a.models)||[]).map(J=>c.jsxs("option",{value:J.id,children:[J.name," â ",J.price.display]},J.id))}),(H=D==null?void 0:D.languages)!=null&&H.length?c.jsx("p",{className:"mt-1.5 text-[11px] text-white/40",children:t("{n} languages",{n:D.languages.length})}):null,c.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-[13px] font-semibold text-white/55",children:t("Female voice ID")}),c.jsx("input",{value:u,onChange:J=>d(J.target.value),placeholder:"e.g. 21m00Tcm4TlvDq8ikWAM",autoComplete:"off",className:`${O6} ws-mono mt-2 w-full text-xs`}),((X=s==null?void 0:s.femaleVoice)==null?void 0:X.name)&&c.jsxs("p",{className:"mt-1.5 text-xs text-[#e9ffa1]",children:["â ",s.femaleVoice.name]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[13px] font-semibold text-white/55",children:t("Male voice ID")}),c.jsx("input",{value:h,onChange:J=>f(J.target.value),placeholder:"e.g. pNInz6obpgDQGcFmaJgB",autoComplete:"off",className:`${O6} ws-mono mt-2 w-full text-xs`}),((W=s==null?void 0:s.maleVoice)==null?void 0:W.name)&&c.jsxs("p",{className:"mt-1.5 text-xs text-[#e9ffa1]",children:["â ",s.maleVoice.name]})]})]}),c.jsx("p",{className:"mt-3 text-[11px] text-white/40",children:t("Each video has one voice-over. Its voice gender setting picks the voice; if you add only one, itâs used for every video. Copy IDs from ElevenLabs â Voices â ⯠â Copy voice ID.")}),A&&c.jsx("p",{className:"mt-2 text-xs text-red-300",children:A}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-2",children:[c.jsx("span",{className:"ws-mono text-[11px] text-white/45",children:n.credits?t("{n} ElevenLabs credits left",{n:n.credits.remaining.toLocaleString()}):""}),c.jsxs("button",{onClick:T,disabled:p||!o||!u.trim()&&!h.trim()||!M&&!!s,className:"ws-btn ws-btn-primary !h-9 !px-4 text-xs disabled:opacity-50",children:[c.jsx("span",{className:"ws-shine"}),t(p?"Checking voicesâ¦":b&&!M?"Saved":"Save voices")]})]})]})]})]})}function tte({n,title:e,hint:t,done:r,children:i}){return c.jsxs("div",{className:"mt-7",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[c.jsx("span",{className:`ws-mono grid h-7 w-7 shrink-0 place-items-center rounded-full text-xs font-bold ${r?"bg-[var(--lp-lime)] text-black":"bg-white/[0.06] text-white/70 ring-1 ring-white/10"}`,children:r?c.jsx(kB,{className:"h-3.5 w-3.5"}):n}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-[15px] font-bold text-white",children:e}),t&&c.jsx("div",{className:"ws-muted text-xs",children:t})]})]}),i]})}function rat(){const{t:n}=Kr(),{data:e,refetch:t,isLoading:r}=Qr(Rae),[i,s]=G.useState(null),[a,o]=G.useState(null),l=G.useMemo(()=>{var f;return!!((f=e==null?void 0:e.providers)!=null&&f.some(p=>p.status==="valid"))},[e]),u=async f=>{o(null);try{await y4e({enabled:f}),t()}catch(p){o((p==null?void 0:p.message)||n("Could not update."))}},d=f=>async p=>{await v4e({[f]:{provider:p.provider,modelId:p.id}}),t()};if(r||!e)return c.jsx(Fu,{children:c.jsx("div",{className:"ws-skeleton h-40 rounded-2xl"})});const h=!!e.imageModel&&!!e.videoModel;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs(Fu,{delay:.04,glow:e.enabled,children:[c.jsx($f,{kicker:n("Bring your own key"),title:n("AI providers"),subtitle:n("Generate images and videos with your own fal.ai, Replicate or Higgsfield account."),icon:c.jsx(F8,{className:"h-4 w-4"})}),c.jsxs("div",{className:`flex flex-col gap-3 rounded-[22px] border p-4 sm:flex-row sm:items-center sm:justify-between ${e.enabled?"border-[rgba(207,255,5,.35)] bg-[rgba(207,255,5,.06)]":"border-white/[0.08] bg-white/[0.025]"}`,children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-bold text-white",children:e.enabled?n("On: your providers make your images and videos"):n("Off: SpreadOutâs own AI makes your images and videos")}),c.jsx("p",{className:"ws-muted mt-0.5 text-xs",children:n("Images and video bill to your provider account. SpreadOut charges {short} credits per short video (was 100), {min} per minute of long video, {img} per text + image post.",{short:e.fees.shortVideo,min:e.fees.perMinute,img:e.fees.textImage})}),!e.canEnable&&!e.enabled&&c.jsx("p",{className:"mt-1 text-xs text-white/45",children:n("Finish the two steps below to turn this on.")}
5628),a&&c.jsx("p",{className:"mt-1 text-xs text-red-300",children:a})]}),c.jsx(cAe,{on:e.enabled,disabled:!e.enabled&&!e.canEnable,onChange:u,label:n("Use my own providers")})]}),c.jsx(tte,{n:1,done:l,title:n("Connect a provider"),hint:n("Paste an API key from any of these. You can connect several."),children:c.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:e.providers.map(f=>c.jsx(hAe,{p:f,onChanged:t},f.id))})}),c.jsxs(tte,{n:2,done:h,title:n("Choose your models"),hint:n("One for images, one for videos. Only models that work with SpreadOut workflows are listed."),children:[c.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[c.jsx(ete,{kind:"image",selected:e.imageModel,connectedAny:l,onOpen:()=>s("image")}),c.jsx(ete,{kind:"video",selected:e.videoModel,connectedAny:l,onOpen:()=>s("video")})]}),c.jsx("p",{className:"mt-3 text-[11px] text-white/35",children:n("The rare step your video model canât do (lip sync to a recorded track) runs on SpreadOut GPUs for {n} credits.",{n:e.fees.fallbackClip})})]}),i&&c.jsx(tat,{kind:i,onClose:()=>s(null),onPick:d(i)})]}),e.voice&&c.jsx(nat,{voice:e.voice,onChanged:t})]})}const pO=[{id:"Instagram",label:"Instagram",icon:c.jsx(Py,{}),tint:"linear-gradient(135deg,#f58529,#dd2a7b 50%,#8134af)"},{id:"TikTok",label:"TikTok",icon:c.jsx(XR,{}),tint:"linear-gradient(135deg,#25f4ee,#000 50%,#fe2c55)"},{id:"Youtube",label:"YouTube",icon:c.jsx(YR,{}),tint:"#ff0033"},{id:"Facebook",label:"Facebook",icon:c.jsx(zT,{}),tint:"#1877f2"},{id:"LinkedIn",label:"LinkedIn",icon:c.jsx(GT,{}),tint:"#0a66c2"},{id:"X.com",label:"X",icon:c.jsx(D1,{}),tint:"#111"},{id:"Threads",label:"Threads",icon:c.jsx(O_,{}),tint:"#111"}],fAe=({tone:n="workspace"})=>{const{data:e,refetch:t,isLoading:r}=Qr(P8),[i,s]=G.useState(null),[a,o]=G.useState(null),l=n==="workspace",u=hi(),d=A=>e==null?void 0:e.find(x=>x.provider===A),h=A=>!!A&&!!A.authStatus&&A.authStatus!=="active",f=pO.filter(A=>d(A.id)&&!h(d(A.id))).length,p=async A=>{var x;s(A);try{await _Se({provider:A,integrationId:(x=d(A))==null?void 0:x.id}),await t()}finally{s(null),o(null)}},g=async A=>{let x=A.toLowerCase();x==="x.com"&&(x="twitter"),s(A);try{const b=await vae({platform:x});window.location.href=b}catch(b){console.error("Failed to get auth URL",b),s(null)}};return c.jsxs("div",{children:[c.jsxs("div",{className:`mb-3 flex items-center justify-between px-3 ${l?"":"px-0"}`,children:[c.jsx("span",{className:l?"ws-kicker !text-[10px] !text-white/40":"text-sm font-semibold text-gray-700 dark:text-gray-300",children:u("Channels")}),c.jsx("span",{className:`text-[11px] font-semibold ${l?"ws-mono text-white/45":"text-gray-500 dark:text-gray-400"}`,children:u("{n}/{total} live",{n:f,total:pO.length})})]}),c.jsx("ul",{className:`space-y-1.5 ${l?"":"rounded-2xl border border-gray-200 p-2 dark:border-white/10"}`,children:pO.map(A=>{const x=d(A.id),b=h(x),_=i===A.id,M=a===A.id;return c.jsxs("li",{className:`group flex items-center gap-3 rounded-xl px-2.5 py-2 transition-colors ${l?"hover:bg-white/[0.04]":"hover:bg-gray-50 dark:hover:bg-white/5"}`,children:[c.jsxs("span",{className:"relative grid h-8 w-8 shrink-0 place-items-center rounded-lg text-[15px] text-white",style:{background:A.tint},children:[x!=null&&x.profilePictureUrl?c.jsx("img",{src:x.profilePictureUrl,alt:"",className:"h-full w-full rounded-lg object-cover"}):A.icon,c.jsx("span",{className:`absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full ring-2 ${l?"ring-[#07080d]":"ring-white dark:ring-boxdark"} ${b?"bg-amber-400 shadow-[0_0_8px_rgba(251,191,36,.9)]":x?"bg-[#cfff05] shadow-[0_0_8px_rgba(207,255,5,.9)]":"bg-white/20"}`})]}),c.jsxs("div",{className:"min-w-0 flex-1 leading-tight",children:[c.jsx("div",{className:`truncate text-[13px] font-semibold ${l?"text-white/90":"text-gray-900 dark:text-white"}`,children:A.label}),c.jsx("div",{className:`truncate text-[11px] ${l?"text-white/40":"text-gray-500 dark:text-gray-400"}`,children:r?u("Checkingâ¦"):b?c.jsx("span",{className:"text-amber-400",children:u("Login expired · reconnect to post")}):x?x.username?`@${String(x.username).replace(/^@/,"")}`:u("Connected"):u("Not connected")})]}),b?c.jsx("button",{onClick:()=>g(A.id),disabled:_,className:"rounded-full bg-amber-400 px-3 py-1 text-[11px] font-extrabold text-black transition-all hover:bg-amber-300 disabled:opacity-60",children:u(_?"Openingâ¦":"Reconnect")}):x?M?c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{onClick:()=>p(A.id),disabled:_,className:"rounded-full bg-red-500/15 px-2.5 py-1 text-[11px] font-bold text-red-400 ring-1 ring-red-500/30 transition-colors hover:bg-red-500/25 disabled:opacity-50",children:_?"â¦":u("Remove")}),c.jsx("button",{onClick:()=>o(null),className:`rounded-full px-2 py-1 text-[11px] font-semibold ${l?"text-white/50 hover:text-white":"text-gray-500 hover:text-gray-900 dark:hover:text-white"}`,children:u("Keep")})]}):c.jsx("button",{onClick:()=>o(A.id),title:u("Disconnect {platform}",{platform:A.label}),className:`rounded-full px-2.5 py-1 text-[11px] font-semibold opacity-0 transition-all group-hover:opacity-100 focus:opacity-100 ${l?"text-white/50 hover:bg-white/5 hover:text-white":"text-gray-500 hover:text-gray-900 dark:hover:text-white"}`,children:u("Manage")}):c.jsx("button",{onClick:()=>g(A.id),disabled:_,className:`rounded-full px-3 py-1 text-[11px] font-bold transition-all disabled:opacity-60 ${l?"bg-white/[0.06] text-white/80 ring-1 ring-white/10 hover:bg-[#cfff05] hover:text-black hover:ring-transparent":"bg-gray-900 text-white hover:bg-[#cfff05] hover:text-black dark:bg-white/10"}`,children:u(_?"Openingâ¦":"Connect")})]},A.id)})})]})},iat=()=>{const{data:n}=Ma(),{t:e,locale:t}=Kr();if(!n)return null;const r=Number(n.credits||0);return c.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-white/[0.08] bg-gradient-to-br from-white/[0.07] to-white/[0.015] p-4",children:[c.jsx("div",{className:"pointer-events-none absolute -right-10 -top-12 h-32 w-32 rounded-full bg-[rgba(207,255,5,.18)] blur-2xl","aria-hidden":!0}),c.jsx("div",{className:"ws-kicker !text-[10px]",children:e("Credits")}),c.jsxs("div",{className:"mt-1 flex items-end justify-between gap-2",children:[c.jsx("span",{className:`ws-display min-w-0 truncate font-bold leading-none text-white tabular-nums ${r>=1e6?"text-[22px]":"text-[28px]"}
5628`,children:r.toLocaleString(t)}),c.jsx(Ks,{to:"/pricing",className:"shrink-0 whitespace-nowrap rounded-full bg-white/[0.06] px-3 py-1.5 text-[11px] font-bold text-white/80 ring-1 ring-white/10 transition-colors hover:bg-[#cfff05] hover:text-black",children:e("Top up")})]})]})},nte=[{to:"/ai-automator",label:Le("Automate"),icon:c.jsx(j8,{className:"h-[18px] w-[18px]"})},{to:"/comments",label:Le("Comments & Directs"),icon:c.jsx(X4,{className:"h-[18px] w-[18px]"})},{to:"/workflows",label:Le("Scheduled Posts"),icon:c.jsx(roe,{className:"h-[18px] w-[18px]"})},{to:"/post-analytics",label:Le("Post Analytics"),icon:c.jsx(aEe,{className:"h-4 w-4"}),badge:"PRO"}],sat=[{to:"/group-search",label:Le("Search"),icon:c.jsx(poe,{className:"h-4 w-4"})},{to:"/history",label:Le("History"),icon:c.jsx(hEe,{className:"h-4 w-4"})},{to:"/posts",label:Le("Posts"),icon:c.jsx(uEe,{className:"h-4 w-4"})}],aat=[{to:"/account",label:Le("Account Settings"),icon:c.jsx(xEe,{className:"h-4 w-4"})},{to:"/referrals",label:Le("Refer Friends"),icon:c.jsx(dEe,{className:"h-4 w-4"})},{to:"/leaderboard",label:Le("Leaderboard"),icon:c.jsx(goe,{className:"h-4 w-4"})}];function jN({title:n,items:e,onNavigate:t}){const r=hi();return c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-3 px-3 !text-[10px] !text-white/40",children:r(n)}),c.jsx("ul",{className:"space-y-1",children:e.map(i=>c.jsx("li",{children:c.jsx(lse,{to:i.to,onClick:t,className:({isActive:s})=>`group relative flex items-center gap-3 rounded-xl px-3 py-2.5 text-sm font-semibold transition-all duration-300 ${s?"bg-white/[0.07] text-white":"text-white/55 hover:bg-white/[0.04] hover:text-white"}`,children:({isActive:s})=>c.jsxs(c.Fragment,{children:[c.jsx("span",{className:`absolute left-0 top-1/2 h-5 w-[3px] -translate-y-1/2 rounded-full bg-[var(--lp-lime)] shadow-[0_0_12px_rgba(207,255,5,.9)] transition-all duration-300 ${s?"opacity-100":"opacity-0 group-hover:opacity-40"}`}),c.jsx("span",{className:`grid h-8 w-8 place-items-center rounded-lg transition-colors ${s?"bg-[var(--lp-lime)] text-black":"bg-white/[0.04] text-white/60 group-hover:text-white"}`,children:i.icon}),c.jsx("span",{className:"flex-1",children:r(i.label)}),i.badge&&c.jsx("span",{className:"ws-mono rounded-md bg-[rgba(207,255,5,.12)] px-1.5 py-0.5 text-[9px] font-bold tracking-widest text-[var(--lp-lime)] ring-1 ring-[rgba(207,255,5,.25)]",children:i.badge})]})})},i.to))})]})}const oat=({isOpen:n,onClose:e})=>{const t=po(),r=hi(),i=["/ai-automator","/comments","/workflows","/executions","/post-analytics"].some(l=>t.pathname.startsWith(l)),s=["/group-search","/history","/posts"].some(l=>t.pathname.startsWith(l)),a=["/account","/referrals","/leaderboard"].some(l=>t.pathname.startsWith(l)),o=()=>{window.innerWidth<1024&&e()};return c.jsx("aside",{className:`fixed inset-y-0 left-0 z-50 w-[288px] transform border-r border-white/[0.07] bg-[#07080d]/85 backdrop-blur-2xl transition-transform duration-500 ease-[cubic-bezier(.22,1,.36,1)] lg:static lg:z-10 lg:translate-x-0 ${n?"translate-x-0":"-translate-x-full"}`,children:c.jsxs("div",{className:"flex h-full flex-col gap-7 overflow-y-auto px-4 pb-8 pt-5 [&>*]:shrink-0",children:[c.jsxs("div",{className:"flex items-center justify-between lg:hidden",children:[c.jsx("span",{className:"ws-display text-lg font-bold text-white",children:r("Menu")}),c.jsx("button",{onClick:e,className:"grid h-9 w-9 place-items-center rounded-full bg-white/5 text-white/70 hover:bg-white/10 hover:text-white","aria-label":r("Close menu"),children:c.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),c.jsx(iat,{}),i&&c.jsxs(c.Fragment,{children:[c.jsx(jN,{title:Le("Social Automator"),items:nte,onNavigate:o}),c.jsx(fAe,{})]}),s&&c.jsx(jN,{title:Le("Group Search"),items:sat,onNavigate:o}),a&&c.jsx(jN,{title:Le("Social Automator"),items:nte,onNavigate:o}),c.jsx(jN,{title:Le("Your account"),items:aat,onNavigate:o})]})})},pl=({children:n})=>{const[e,t]=G.useState(!1);jB();const r=hi();return c.jsxs("div",{className:"ws flex h-[calc(100dvh-65px)]",children:[c.jsxs("div",{className:"ws-backdrop","aria-hidden":!0,
5628children:[c.jsx("div",{className:"ws-blob a"}),c.jsx("div",{className:"ws-blob b"}),c.jsx("div",{className:"ws-blob c"})]}),c.jsx("button",{onClick:()=>t(i=>!i),className:"ws-glass fixed left-4 top-[76px] z-50 grid h-11 w-11 place-items-center rounded-full text-white lg:hidden","aria-label":r("Toggle menu"),children:c.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e?c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"}):c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 7h16M4 12h10M4 17h16"})})}),e&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm lg:hidden",onClick:()=>t(!1)}),c.jsx(oat,{isOpen:e,onClose:()=>t(!1)}),c.jsxs("main",{className:"relative z-10 flex-1 overflow-y-auto",children:[c.jsx("div",{className:"h-16 lg:hidden"}),n]})]})},pAe=[{id:"account",label:Le("Account"),hint:Le("Profile, sign-in, emails"),Icon:Aoe},{id:"plan",label:Le("Plan & credits"),hint:Le("Subscription and billing"),Icon:doe},{id:"channels",label:Le("Channels"),hint:Le("Where posts are published"),Icon:moe},{id:"ai",label:Le("AI providers"),hint:Le("Use your own fal.ai, Replicate, Higgsfield"),Icon:F8},{id:"agents",label:Le("AI agents"),hint:Le("Claude, ChatGPT, Cursor via MCP"),Icon:foe}],rte=n=>!!n&&pAe.some(e=>e.id===n);function mO({children:n}){return c.jsx("div",{className:"space-y-6",children:n})}function lat({user:n}){const{t:e,locale:t}
5628=Kr(),r=po(),i=ro(),s=new URLSearchParams(r.search).get("tab"),[a,o]=G.useState(rte(s)?s:"account"),[l,u]=G.useState(null),{data:d,isLoading:h}=Qr(Nae),[f,p]=G.useState(!1),[g,A]=G.useState(!1);G.useEffect(()=>{rte(s)&&s!==a&&o(s)},[s]),G.useEffect(()=>{var P;window.innerWidth>=1024||(P=document.querySelector(`[data-account-tab="${a}"]`))==null||P.scrollIntoView({block:"nearest",inline:"center"})},[a]),G.useEffect(()=>{n.email&&c4e({email:n.email}).then(u).catch(P=>console.error("Failed to fetch newsletter subscription:",P))},[n.email]);const x=P=>{o(P),i({search:P==="account"?"":`?tab=${P}`},{replace:!0})},b=(P,O)=>{LX({reasons:P,otherReason:O}),xae({closed:!0}),A(!1),alert(e("Account closed.")),fM()},_=Kit(Zit(n.subscriptionPlan)),M=n.subscriptionStatus==="active"||[Vo.Premium,Vo.Pro,Vo.PremiumYearly,Vo.ProYearly].includes(n.subscriptionPlan),T=(n.username||n.email||"U").charAt(0).toUpperCase(),L=Number(n.credits||0),D=d?c.jsxs("button",{onClick:()=>window.open(d,"_blank"),disabled:h,className:"ws-btn ws-btn-primary !h-11 text-sm",children:[c.jsx("span",{className:"ws-shine"}),e("Manage billing & invoices")]}):c.jsxs(ru,{to:"/pricing",className:"ws-btn ws-btn-primary !h-11 text-sm",children:[c.jsx("span",{className:"ws-shine"}),e("Upgrade plan & get credits")," ",c.jsx(iEe,{className:"h-3 w-3"})]});return c.jsxs(pl,{children:[c.jsxs(j1,{wide:!0,children:[c.jsxs("header",{className:"ws-enter ws-glass relative overflow-hidden rounded-[28px] p-5 sm:p-6",children:[c.jsx("div",{className:"pointer-events-none absolute -right-20 -top-24 h-64 w-64 rounded-full bg-[rgba(207,255,5,.1)] blur-3xl","aria-hidden":!0}),c.jsxs("div",{className:"relative flex flex-col gap-5 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[c.jsx("span",{className:"ws-display grid h-14 w-14 shrink-0 place-items-center rounded-2xl bg-[var(--lp-lime)] text-2xl font-bold text-black shadow-[0_0_30px_-6px_rgba(207,255,5,.7)]",children:T}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"ws-kicker mb-1 !text-[10px]",children:e("Your account")}),c.jsx("h1",{className:"ws-display truncate text-2xl font-bold text-white",children:n.username||n.email||e("No username")}),c.jsx("div",{className:"ws-muted truncate text-sm",children:n.email||e("No email attached")})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[c.jsxs("button",{onClick:()=>x("plan"),className:"flex items-center gap-3 rounded-2xl border border-white/[0.08] bg-black/30 px-4 py-2.5 text-left transition-colors hover:border-white/20",children:[c.jsxs("span",{children:[c.jsx("span",{className:"ws-mono block text-[10px] uppercase tracking-wider text-white/45",children:e("Credits")}),c.jsx("span",{className:`ws-display block text-xl font-bold tabular-nums ${L<100?"text-amber-300":"text-white"}`,children:L.toLocaleString(t)})]}),c.jsx("span",{className:`ws-mono rounded-full px-2.5 py-1 text-[10px] uppercase tracking-wider ${M?"bg-[rgba(207,255,5,.12)] text-[var(--lp-lime)] ring-1 ring-[rgba(207,255,5,.3)]":"bg-white/[0.06] text-white/60"}`,children:_})]}),c.jsxs("button",{onClick:fM,className:"ws-btn ws-btn-ghost !h-11 !px-4 text-sm",children:[c.jsx(AEe,{className:"h-3.5 w-3.5"})," ",e("Log out")]})]})]})]}),c.jsxs("div",{className:"mt-6 grid grid-cols-[minmax(0,1fr)] gap-6 lg:grid-cols-[250px_minmax(0,1fr)]",children:[c.jsx("nav",{"aria-label":e("Account sections"),className:"min-w-0 lg:sticky lg:top-4 lg:self-start",children:c.jsx("div",{className:"-mx-4 flex gap-2 overflow-x-auto px-4 pb-1 [scrollbar-width:none] lg:mx-0 lg:flex-col lg:overflow-visible lg:px-0",children:pAe.map(({id:P,label:O,hint:F,Icon:U})=>{const B=a===P;return c.jsxs("button",{"data-account-tab":P,onClick:()=>x(P),"aria-current":B?"page":void 0,className:`group flex shrink-0 items-center gap-3 rounded-2xl px-3 py-2.5 text-left transition-all duration-300 lg:w-full ${B?"bg-white/[0.07] text-white ring-1 ring-white/10":"text-white/60 hover:bg-white/[0.04] hover:text-white"}`,children:[c.jsx("span",{className:`grid h-8 w-8 shrink-0 place-items-center rounded-lg transition-colors ${B?"bg-[var(--lp-lime)] text-black":"bg-white/[0.04]"}`,children:c.jsx(U,{className:"h-3.5 w-3.5"})}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block whitespace-nowrap text-sm font-semibold",children:e(O)}),c.jsx("span",{className:"hidden truncate text-[11.5px] text-white/40 lg:block",children:e(F)})]})]},P)})})}),c.jsxs("main",{className:"min-w-0",children:[a==="account"&&c.jsxs(mO,{children:[c.jsxs(Fu,{children:[c.jsx($f,{kicker:e("Profile"),title:e("Profile details"),icon:c.jsx(Aoe,{className:"h-4 w-4"})}),c.jsx(DN,{label:e("Email address"),children:c.jsx("span",{className:"break-all text-sm text-white/80",children:n.email||e("No email attached")})}),c.jsx(DN,{label:e("Username"),children:c.jsx("span",{className:"text-sm text-white/80",children:n.username||"â"})})]}),c.jsxs(Fu,{delay:.05,children:[c.jsx($f,{kicker:e("Security"),title:e("Sign-in"),icon:c.jsx(fEe,{className:"h-4 w-4"})}),c.jsx(DN,{label:e("Password"),hint:e("Need to update or reset your password?"),children:c.jsx(ru,{to:"/request-password-reset",className:"ws-btn ws-btn-ghost !h-10 !px-4 text-[13px]",children:e("Reset password")})})]}),c.jsxs(Fu,{delay:.1,children:[c.jsx($f,{kicker:e("Notifications"),title:e("Emails from SpreadOut"),icon:c.jsx(sEe,{className:"h-4 w-4"})}),c.jsx(DN,{label:e("Product newsletter"),hint:e("New templates, viral hook breakdowns and feature releases, about once a week."),children:c.jsx(Hst,{isEnabled:l==null?void 0:l.subscribed,email:n.email})})]}
5628),c.jsx("div",{className:"ws-enter rounded-[28px] border border-red-500/20 bg-red-500/[0.04] p-6 sm:p-8",style:{animationDelay:".15s"},children:c.jsxs("div",{className:"flex flex-col gap-5 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"flex items-start gap-3.5",children:[c.jsx("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-2xl bg-red-500/10 text-red-400 ring-1 ring-red-500/25",children:c.jsx(hoe,{className:"h-4 w-4"})}),c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-1.5 !text-red-400",children:e("Danger zone")}),c.jsx("h2",{className:"ws-display text-xl font-bold text-white",children:e("Close account")}),c.jsx("p",{className:"ws-muted mt-1 max-w-xl text-sm",children:e("Deactivates your account and signs you out. To have your data deleted, email us.")})]})]}),c.jsx("button",{onClick:()=>A(!0),className:"ws-btn !h-11 shrink-0 bg-red-500/10 text-sm text-red-300 ring-1 ring-red-500/30 hover:bg-red-500/20",children:e("Close account")})]})})]}),a==="plan"&&c.jsx(mO,{children:c.jsxs(Fu,{glow:!0,children:[c.jsx($f,{kicker:e("Plan"),title:e("Subscription & credits"),icon:c.jsx(doe,{className:"h-4 w-4"}),right:c.jsx("span",{className:`ws-mono rounded-full px-3 py-1 text-[11px] uppercase tracking-wider ${M?"bg-[rgba(207,255,5,.12)] text-[var(--lp-lime)] ring-1 ring-[rgba(207,255,5,.3)]":"bg-white/[0.06] text-white/60"}`,children:_})}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_auto] md:items-end",children:[c.jsxs("div",{className:"rounded-[22px] border border-white/[0.08] bg-black/30 p-5",children:[c.jsx("div",{className:"ws-kicker !text-[10px]",children:e("Available credits")}),c.jsx("div",{className:"ws-display mt-2 text-5xl font-bold tabular-nums text-white",children:L.toLocaleString(t)}),L<100&&c.jsx("p",{className:"mt-2 text-xs font-semibold text-amber-300",children:e("Running low. Top up to keep generating videos and posts.")})]}),c.jsxs("div",{className:"flex flex-wrap gap-2.5 md:flex-col",children:[D,n.subscriptionStatus==="active"&&c.jsx("button",{onClick:()=>p(!0),className:"ws-btn !h-11 bg-red-500/10 text-sm text-red-300 ring-1 ring-red-500/30 hover:bg-red-500/20",children:e("Cancel plan")})]})]}),c.jsxs("p",{className:"ws-muted mt-5 text-xs",children:[e("Earn more credits by inviting friends.")," ",c.jsx(ru,{to:"/referrals",className:"font-semibold text-[#e9ffa1] hover:underline",children:e("Refer friends")})]})]})}),a==="channels"&&c.jsx(mO,{children:c.jsxs(Fu,{children:[c.jsx($f,{kicker:e("Publishing"),title:e("Connected social accounts"),subtitle:e("The channels SpreadOut publishes your scheduled posts to."),icon:c.jsx(moe,{className:"h-4 w-4"})}),c.jsx("div",{className:"-mx-3",children:c.jsx(fAe,{tone:"workspace"})})]})}),a==="ai"&&c.jsx(rat,{}),a==="agents"&&c.jsx(Zst,{})]},a)]})]}),f&&c.jsx(Xst,{onClose:()=>p(!1),onSend:(P,O)=>{LX({reasons:P,otherReason:O}),p(!1),d&&window.open(d,"_blank")}}),g&&c.jsx(Yst,{onClose:()=>A(!1),onSend:b}),(!n.subscriptionPlan||n.subscriptionPlan===Vo.Free)&&c.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50",children:c.jsx(Dq,{})})]})}const IN=n=>n?n.includes("@")?n.split("@")[0]:n:"",rS=[{ring:"ring-[#ffd700]/60",glow:"shadow-[0_24px_60px_-28px_rgba(255,215,0,.7)]",color:"#ffd700",emoji:"ð¥"},{ring:"ring-[#c0c0c0]/50",glow:"shadow-[0_24px_60px_-28px_rgba(192,192,192,.6)]",color:"#c0c0c0",emoji:"ð¥"},{ring:"ring-[#cd7f32]/50",glow:"shadow-[0_24px_60px_-28px_rgba(205,127,50,.6)]",color:"#cd7f32",emoji:"ð¥"}],cat=()=>{var A;const{t:n,locale:e}=Kr(),[t,r]=G.useState(1),{data:i,isLoading:s,error:a}=Qr(E4e,{page:t,limit:20}),{data:o}=Ma(),l=G.useMemo(()=>{if(!(i!=null&&i.users))return[];const x=(i.pagination.page-1)*i.pagination.limit+1;return i.users.map((b,_)=>({...b,displayName:IN(b.username)||IN(b.email)||n("Anonymous"),rank:x+_,isCurrentUser:o?b.id===o.id:!1}))},[i,o,n]),u=((A=i==null?void 0:i.pagination)==null?void 0:A.pages)||1,d=t===1?l.slice(0,3):[],h=t===1?l.slice(3):l,f=o,p=f?IN(f.username)||IN(f.email)||n("Anonymous"):"",g=x=>new Date(x).toLocaleDateString(e,{month:"short",day:"numeric",year:"numeric"});return c.jsx(pl,{children:c.jsxs(j1,{children:[c.jsx(D_,{eyebrow:n("Community"),title:n("Leaderboard"),accent:n("of sharers."),subtitle:n("Who earned the most credits by sharing SpreadOut and inviting friends."),actions:c.jsxs(Ks,{to:"/referrals",className:"ws-btn ws-btn-primary !h-11 !px-5 text-sm",children:[c.jsx("span",{className:"ws-shine"}),n("Invite friends")," â"]})}),f&&(i==null?void 0:i.userRank)&&c.jsxs("div",{className:"mt-10 grid gap-3 sm:grid-cols-3",children:[c.jsx(Um,{highlight:!0,label:n("Your rank"),value:`#${i.userRank}`,foot:p}),c.jsx(Um,{label:n("Sharing credits"),value:((f.sharingCount||0)*3+(f.referralCount||0)*3).toLocaleStr
5628ing(e)}),c.jsx(Um,{label:n("Referrals"),value:(f.referralCount||0).toLocaleString(e)})]}),s?c.jsx("div",{className:"mt-10 space-y-3",children:Array.from({length:6}).map((x,b)=>c.jsx("div",{className:"ws-skeleton h-16 rounded-2xl",style:{animationDelay:`${b*.08}s`}},b))}):a?c.jsx("div",{className:"mt-10 rounded-2xl border border-red-500/30 bg-red-500/10 p-5 text-center text-sm text-red-300",children:a instanceof Error?a.message:String(a)}):l.length===0?c.jsxs(Fu,{className:"mt-10 text-center",children:[c.jsx("div",{className:"text-4xl",children:"ð"}),c.jsx("h3",{className:"ws-display mt-4 text-2xl font-bold text-white",children:n("No one on the board yet")}),c.jsx("p",{className:"ws-muted mx-auto mt-2 max-w-md",children:n("Share your results or invite a friend to be the first.")})]}):c.jsxs(c.Fragment,{children:[d.length>0&&c.jsx("div",{className:"ws-stagger mt-10 grid gap-4 md:grid-cols-3",children:d.map((x,b)=>c.jsxs("div",{className:`relative overflow-hidden rounded-[24px] border border-white/[0.08] bg-white/[0.03] p-6 ring-1 ${rS[b].ring} ${rS[b].glow} ${b===0?"md:-mt-4":""}`,children:[c.jsx("div",{className:"pointer-events-none absolute -right-10 -top-10 h-32 w-32 rounded-full blur-2xl",style:{background:`${rS[b].color}22`},"aria-hidden":!0}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-4xl",children:rS[b].emoji}),c.jsxs("span",{className:"ws-mono text-xs text-white/45",children:["#",x.rank]})]}),c.jsxs("div",{className:"mt-4 truncate text-lg font-bold text-white",children:[x.displayName,x.isCurrentUser&&c.jsx("span",{className:"ml-2 text-xs text-[var(--lp-lime)]",children:n("(you)")})]}),c.jsx("div",{className:"ws-display mt-1 text-3xl font-bold tabular-nums",style:{color:rS[b].color},children:(x.sharingCredits||0).toLocaleString(e)}),c.jsxs("div",{className:"ws-muted text-xs",children:[n("credits")," · ",n("{n} referrals",{n:x.referralCount||0})]})]},x.id))}),h.length>0&&c.jsxs("div",{className:"ws-glass ws-enter mt-6 overflow-hidden rounded-[24px]",children:[c.jsxs("div",{className:"ws-mono grid grid-cols-[56px_1fr_auto] gap-4 border-b border-white/[0.06] px-5 py-3 text-[10px] uppercase tracking-[0.18em] text-white/40 sm:grid-cols-[56px_1fr_110px_100px_120px]",children:[c.jsx("span",{children:n("Rank")}),c.jsx("span",{children:n("Member")}),c.jsx("span",{className:"text-right",children:n("Credits")}),c.jsx("span",{className:"hidden text-right sm:block",children:n("Referrals")}),c.jsx("span",{className:"hidden text-right sm:block",children:n("Joined")})]}),c.jsx("div",{className:"ws-stagger",children:h.map(x=>c.jsxs("div",{className:`grid grid-cols-[56px_1fr_auto] items-center gap-4 border-b border-white/[0.04] px-5 py-3.5 transition-colors last:border-0 sm:grid-cols-[56px_1fr_110px_100px_120px] ${x.isCurrentUser?"bg-[rgba(207,255,5,.06)]":"hover:bg-white/[0.02]"}`,children:[c.jsx("span",{className:"ws-mono grid h-8 w-8 place-items-center rounded-full bg-white/[0.06] text-xs font-bold text-white/70",children:x.rank}),c.jsxs("span",{className:"truncate text-sm font-semibold text-white",children:[x.displayName,x.isCurrentUser&&c.jsx("span",{className:"ml-2 text-xs text-[var(--lp-lime)]",children:n("(you)")})]}),c.jsx("span",{className:"text-right text-sm font-bold tabular-nums text-white",children:(x.sharingCredits||0).toLocaleString(e)}),c.jsx("span",{className:"hidden text-right text-sm tabular-nums text-white/60 sm:block",children:x.referralCount||0}),c.jsx("span",{className:"hidden text-right text-xs text-white/40 sm:block",children:g(x.createdAt)})]},x.id))})]}),u>1&&c.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2",children:[c.jsxs("button",{disabled:t<=1,onClick:()=>r(x=>x-1),className:"ws-btn ws-btn-ghost !h-10 !px-4 text-sm",children:["â ",n("Previous")]}),c.jsx("span",{className:"ws-mono px-3 text-xs text-white/50",children:n("Page {n} of {total}",{n:t,total:u})}),c.jsxs("button",{disabled:t>=u,onClick:()=>r(x=>x+1),className:"ws-btn ws-btn-ghost !h-10 !px-4 text-sm",children:[n("Next")," â"]})]})]})]})})},uat=async()=>{try{return await S4e({})}catch(n){throw console.error("Error fetching referrals:",n),n}},dat=async()=>{try{return await T4e({})}catch(n){throw console.error("Error getting personal referral code:",n),n}};function jq(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"22 12 18 12 15 21 9 3 6 12 2 12"}}]})(n)}function hat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"}},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"}}]})(n)}function Iq(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}},{tag:"line",attr:{x1:"12",y1:"9",x2:"12",y2:"13"}},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"}}]})(n)}function fat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"}},{tag:"polyline",attr:{points:"19 12 12 19 5 12"}}]})(n)}function Fq(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"12",x2:"5",y2:"12"}},{tag:"polyline",attr:{points:"12 19 5 12 12 5"}}]})(n)}function mAe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"}},{tag:"polyline",attr:{points:"12 5 19 12 12 19"}}]})(n)}function pat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}},{tag:"line",attr:{x1:"16",y1:"2",x2:"16",y2:"6"}},{tag:"line",attr:{x1:"8",y1:"2",x2:"8",y2:"6"}},{tag:"line",attr:{x1:"3",y1:"10",x2:"21",y2:"10"}}]})(n)}function I1(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}},{tag:"polyline",attr:{points:"22 4 12 14.01 9 11.01"}}]})(n)}function Uq(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"}}]})(n)}function gAe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 18 9 12 15 6"}}]})(n)}function AAe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"}}]})(n)}function mat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}}
5628,{tag:"rect",attr:{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}}]})(n)}function xAe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"polyline",attr:{points:"12 6 12 12 16 14"}}]})(n)}function gat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 18 22 12 16 6"}},{tag:"polyline",attr:{points:"8 6 2 12 8 18"}}]})(n)}function ZR(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"polygon",attr:{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"}}]})(n)}function Aat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}},{tag:"path",attr:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}}]})(n)}function vAe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"4",y:"4",width:"16",height:"16",rx:"2",ry:"2"}},{tag:"rect",attr:{x:"9",y:"9",width:"6",height:"6"}},{tag:"line",attr:{x1:"9",y1:"1",x2:"9",y2:"4"}},{tag:"line",attr:{x1:"15",y1:"1",x2:"15",y2:"4"}},{tag:"line",attr:{x1:"9",y1:"20",x2:"9",y2:"23"}},{tag:"line",attr:{x1:"15",y1:"20",x2:"15",y2:"23"}},{tag:"line",attr:{x1:"20",y1:"9",x2:"23",y2:"9"}},{tag:"line",attr:{x1:"20",y1:"14",x2:"23",y2:"14"}},{tag:"line",attr:{x1:"1",y1:"9",x2:"4",y2:"9"}},{tag:"line",attr:{x1:"1",y1:"14",x2:"4",y2:"14"}}]})(n)}function xat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}},{tag:"line",attr:{x1:"1",y1:"10",x2:"23",y2:"10"}}]})(n)}function SU(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"1",x2:"12",y2:"23"}},{tag:"path",attr:{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"}}]})(n)}function vat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}},{tag:"polyline",attr:{points:"7 10 12 15 17 10"}},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"}}]})(n)}function Zk(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}},{tag:"polyline",attr:{points:"15 3 21 3 21 9"}},{tag:"line",attr:{x1:"10",y1:"14",x2:"21",y2:"3"}}]})(n)}function yat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}}]})(n)}function ite(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}},{tag:"polyline",attr:{points:"14 2 14 8 20 8"}},{tag:"line",attr:{x1:"16",y1:"13",x2:"8",y2:"13"}},{tag:"line",attr:{x1:"16",y1:"17",x2:"8",y2:"17"}},{tag:"polyline",attr:{points:"10 9 9 9 8 9"}}]})(n)}function bat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"}},{tag:"line",attr:{x1:"7",y1:"2",x2:"7",y2:"22"}},{tag:"line",attr:{x1:"17",y1:"2",x2:"17",y2:"22"}},{tag:"line",attr:{x1:"2",y1:"12",x2:"22",y2:"12"}},{tag:"line",attr:{x1:"2",y1:"7",x2:"7",y2:"7"}},{tag:"line",attr:{x1:"2",y1:"17",x2:"7",y2:"17"}},{tag:"line",attr:{x1:"17",y1:"17",x2:"22",y2:"17"}},{tag:"line",attr:{x1:"17",y1:"7",x2:"22",y2:"7"}}]})(n)}function TU(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 12 20 22 4 22 4 12"}},{tag:"rect",attr:{x:"2",y:"7",width:"20",height:"5"}},{tag:"line",attr:{x1:"12",y1:"22",x2:"12",y2:"7"}},{tag:"path",attr:{d:"M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"}},{tag:"path",attr:{d:"M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"}}]})(n)}function wat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"3",width:"7",height:"7"}},{tag:"rect",attr:{x:"14",y:"3",width:"7",height:"7"}},{tag:"rect",attr:{x:"14",y:"14",width:"7",height:"7"}},{tag:"rect",attr:{x:"3",y:"14",width:"7",height:"7"}}]})(n)}function yAe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}},{tag:"circle",attr:{cx:"8.5",cy:"8.5",r:"1.5"}},{tag:"polyline",attr:{points:"21 15 16 10 5 21"}}]})(n)}function Bq(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"22 12 16 12 14 15 10 15 8 12 2 12"}},{tag:"path",attr:{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}}]})(n)}function hy(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"12 2 2 7 12 12 22 7 12 2"}},{tag:"polyline",attr:{points:"2 17 12 22 22 17"}},{tag:"polyline",attr:{points:"2 12 12 17 22 12"}}
5628]})(n)}function _at(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"8",y1:"6",x2:"21",y2:"6"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"21",y2:"12"}},{tag:"line",attr:{x1:"8",y1:"18",x2:"21",y2:"18"}},{tag:"line",attr:{x1:"3",y1:"6",x2:"3.01",y2:"6"}},{tag:"line",attr:{x1:"3",y1:"12",x2:"3.01",y2:"12"}},{tag:"line",attr:{x1:"3",y1:"18",x2:"3.01",y2:"18"}}]})(n)}function ste(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}},{tag:"polyline",attr:{points:"16 17 21 12 16 7"}},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"}}]})(n)}function Gv(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}},{tag:"polyline",attr:{points:"22,6 12,13 2,6"}}]})(n)}function bAe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}},{tag:"circle",attr:{cx:"12",cy:"10",r:"3"}}]})(n)}function Sat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"}},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"}},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"}}]})(n)}function Tat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}}]})(n)}function Eat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}},{tag:"path",attr:{d:"M19 10v2a7 7 0 0 1-14 0v-2"}},{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"23"}},{tag:"line",attr:{x1:"8",y1:"23",x2:"16",y2:"23"}}]})(n)}function Cat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"}}]})(n)}function Nat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}},{tag:"line",attr:{x1:"8",y1:"21",x2:"16",y2:"21"}},{tag:"line",attr:{x1:"12",y1:"17",x2:"12",y2:"21"}}]})(n)}function Mat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"5",x2:"5",y2:"19"}},{tag:"circle",attr:{cx:"6.5",cy:"6.5",r:"2.5"}},{tag:"circle",attr:{cx:"17.5",cy:"17.5",r:"2.5"}}]})(n)}function kat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"5 3 19 12 5 21 5 3"}}]})(n)}function Rat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"}},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"}}]})(n)}function Xm(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"23 4 23 10 17 10"}},{tag:"polyline",attr:{points:"1 20 1 14 7 14"}},{tag:"path",attr:{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"}}]})(n)}function wAe(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"}},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}}]})(n)}function OA(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"22",y1:"2",x2:"11",y2:"13"}},{tag:"polygon",attr:{points:"22 2 15 22 11 13 2 9 22 2"}}]})(n)}function Pat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2
56280 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}}]})(n)}function Lat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"18",cy:"5",r:"3"}},{tag:"circle",attr:{cx:"6",cy:"12",r:"3"}},{tag:"circle",attr:{cx:"18",cy:"19",r:"3"}},{tag:"line",attr:{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}},{tag:"line",attr:{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"}}]})(n)}function Jk(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}}]})(n)}function Oat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"4",y1:"21",x2:"4",y2:"14"}},{tag:"line",attr:{x1:"4",y1:"10",x2:"4",y2:"3"}},{tag:"line",attr:{x1:"12",y1:"21",x2:"12",y2:"12"}},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"3"}},{tag:"line",attr:{x1:"20",y1:"21",x2:"20",y2:"16"}},{tag:"line",attr:{x1:"20",y1:"12",x2:"20",y2:"3"}},{tag:"line",attr:{x1:"1",y1:"14",x2:"7",y2:"14"}},{tag:"line",attr:{x1:"9",y1:"8",x2:"15",y2:"8"}},{tag:"line",attr:{x1:"17",y1:"16",x2:"23",y2:"16"}}]})(n)}function Dat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}},{tag:"line",attr:{x1:"12",y1:"18",x2:"12.01",y2:"18"}}]})(n)}function EU(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"}}]})(n)}function ate(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}},{tag:"line",attr:{x1:"7",y1:"7",x2:"7.01",y2:"7"}}]})(n)}function jat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"}},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"}},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"}}]})(n)}function Iat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"23 18 13.5 8.5 8.5 13.5 1 6"}},{tag:"polyline",attr:{points:"17 18 23 18 23 12"}}]})(n)}function M4(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"23 6 13.5 15.5 8.5 10.5 1 18"}},{tag:"polyline",attr:{points:"17 6 23 6 23 12"}}]})(n)}function Fat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"2",y:"7",width:"20",height:"15",rx:"2",ry:"2"}},{tag:"polyline",attr:{points:"17 2 12 7 7 2"}}]})(n)}function Uat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}},{tag:"circle",attr:{cx:"8.5",cy:"7",r:"4"}},{tag:"line",attr:{x1:"20",y1:"8",x2:"20",y2:"14"}},{tag:"line",attr:{x1:"23",y1:"11",x2:"17",y2:"11"}}]})(n)}function Bat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}},{tag:"circle",attr:{cx:"12",cy:"7",r:"4"}}]})(n)}function Zu(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}},{tag:"circle",attr:{cx:"9",cy:"7",r:"4"}},{tag:"path",attr:{d:"M23 21v-2a4 4 0 0 0-3-3.87"}},{tag:"path",attr:{d:"M16 3.13a4 4 0 0 1 0 7.75"}}]})(n)}function Vat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"23 7 16 12 23 17 23 7"}},{tag:"rect",attr:{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"}}]})(n)}function zat(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"15",y1:"9",x2:"9",y2:"15"}},{tag:"line",attr:{x1:"9",y1:"9",x2:"15",y2:"15"}}]})(n)}function JR(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"}},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"}}]})(n)}function e8(n){return It({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"}}]})(n)}const gO=1e3,ote={premium:5,pro:10},Gat=()=>{var p,g,A;const{data:n}=Ma(),{t:e,locale:t}=Kr(),[r,i]=G.useState(!1),{data:s}=Nj({queryKey:["referrals"],queryFn:()=>uat(),enabled:!!n}),{data:a,isLoading:o}=Nj({queryKey:["personalReferralCode"],queryFn:()=>dat(),enabled:!!n}),l=a==null?void 0:a.referralLink,u=x=>{navigator.clipboard.writeText(x).then(()=>{i(!0),setTimeout(()=>i(!1),2e3),gr.success(e("Referral link copied."))},()=>gr.error(e("Could not copy the link.")))},d=()=>{navigator.share?navigator.share({title:e("Join me on SpreadOut"),text:e("Sign up for SpreadOut with my link:"),url:l}).catch(()=>{}):u(l)},h=x=>x==="completed"?{cls:"bg-[rgba(207,255,5,.12)] text-[var(--lp-lime)] ring-[rgba(207,255,5,.3)]",Icon:I1,label:e("Completed")}:x==="expired"?{cls:"bg-red-500/10 text-red-300 ring-red-500/30",Icon:zat,label:e("Expired")}:{cls:"bg-amber-400/10 text-amber-300 ring-amber-400/30",Icon:xAe,label:e("Pending")},f=[{n:"01",title:e("Share your link"),body:e("Send your personal link to friends, clients or your community.")},{n:"02",title:e("They sign up"),body:e("When their account is verified, you get {n}
5628 credits.",{n:gO.toLocaleString(t)})},{n:"03",title:e("Bonus when they subscribe"),body:e("Get {premium} more credits if they subscribe to Premium, {pro} for Pro.",{premium:ote.premium,pro:ote.pro})}];return c.jsx(pl,{children:c.jsxs(j1,{children:[c.jsx(D_,{tag:e("+{n} credits",{n:gO.toLocaleString(t)}),eyebrow:e("Per friend who signs up"),title:e("Invite friends,"),accent:e("earn credits."),subtitle:e("Every friend who signs up with your link earns you {n} credits, plus a bonus when they subscribe.",{n:gO.toLocaleString(t)})}),c.jsxs(Fu,{glow:!0,className:"mt-10",children:[c.jsx($f,{kicker:e("Your link"),title:e("Personal referral link"),subtitle:e("Anyone who signs up with it counts as your referral."),icon:c.jsx(Uat,{className:"h-4 w-4"})}),o?c.jsx("div",{className:"ws-skeleton h-14 rounded-full"}):l?c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-full border border-white/10 bg-black/40 py-1.5 pl-5 pr-1.5",children:[c.jsx("span",{className:"ws-mono min-w-0 flex-1 truncate text-sm text-[#e9ffa1]",children:l}),c.jsxs("button",{onClick:()=>u(l),className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-full bg-white/[0.08] px-4 text-sm font-bold text-white transition-colors hover:bg-white/[0.14]",children:[r?c.jsx(I1,{className:"text-[var(--lp-lime)]"}):c.jsx(mat,{})," ",e(r?"Copied":"Copy")]})]}),c.jsxs("button",{onClick:d,className:"ws-btn ws-btn-primary !h-[52px] shrink-0",children:[c.jsx("span",{className:"ws-shine"}),c.jsx(Lat,{})," ",e("Share link")]})]}):c.jsx("p",{className:"text-sm text-red-300",children:e("Could not load your referral link. Please try again later.")})]}),c.jsxs("div",{className:"ws-stagger mt-6 grid gap-3 sm:grid-cols-2",children:[c.jsx(Um,{label:e("Total referrals"),value:(((p=s==null?void 0:s.stats)==null?void 0:p.totalReferrals)||0).toLocaleString(t)}),c.jsx(Um,{highlight:!0,label:e("Credits earned"),value:(((g=s==null?void 0:s.stats)==null?void 0:g.creditsEarned)||0).toLocaleString(t)})]}),c.jsxs(Fu,{className:"mt-6",delay:.1,children:[c.jsx($f,{kicker:e("History"),title:e("Your referrals"),icon:c.jsx(TU,{className:"h-4 w-4"})}),((A=s==null?void 0:s.referrals)==null?void 0:A.length)>0?c.jsx("div",{className:"ws-stagger divide-y divide-white/[0.06] overflow-hidden rounded-2xl border border-white/[0.08]",children:s.referrals.map(x=>{const b=h(x.status);return c.jsxs("div",{className:"flex flex-col gap-2 bg-white/[0.02] px-4 py-3.5 sm:flex-row sm:items-center sm:gap-4",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-white",children:x.referredEmail||e("Unknown")}),c.jsxs("span",{className:`inline-flex w-fit items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-bold ring-1 ${b.cls}`,children:[c.jsx(b.Icon,{className:"h-3 w-3"})," ",b.label,x.subscribed?` · ${e("Subscribed")}`:""]}),c.jsx("span",{className:"ws-mono text-xs text-white/40 sm:w-28 sm:text-right",children:new Date(x.createdAt).toLocaleDateString(t)}),c.jsxs("span",{className:"text-sm font-bold tabular-nums text-[var(--lp-lime)] sm:w-28 sm:text-right",children:["+",(x.credits||0).toLocaleString(t)]})]},x.id)})}):c.jsx("div",{className:"rounded-2xl border border-dashed border-white/10 p-8 text-center text-sm text-white/50",children:e("No referrals yet. Share your link to start earning credits.")})]}),c.jsxs(Fu,{className:"mt-6",delay:.15,children:[c.jsx($f,{kicker:e("How it works"),title:e("Three steps, no limits.")}),c.jsx("div",{className:"ws-stagger grid gap-4 md:grid-cols-3",children:f.map(x=>c.jsxs("div",{className:"rounded-[22px] border border-white/[0.08] bg-white/[0.02] p-5",children:[c.jsx("span",{className:"ws-mono text-xs text-[var(--lp-lime)]",children:x.n}),c.jsx("h3",{className:"ws-display mt-2 text-lg font-bold text-white",children:x.title}),c.jsx("p",{className:"ws-muted mt-1 text-sm",children:x.body})]},x.n))})]})]})})};function qat({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const $at=G.forwardRef(qat);function Hat({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
5628currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const iS=G.forwardRef(Hat);function Wat({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{fillRule:"evenodd",d:"M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.
5628036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z",clipRule:"evenodd"}))}const FN=G.forwardRef(Wat);function Xat({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const UN=G.forwardRef(Xat),Yat=[{id:"af_heart",label:"Heart ⥠(EN-US)",gender:"female",lang:"en"},{id:"af_alloy",label:"Alloy (EN-US)",gender:"female",lang:"en"},{id:"af_aoede",label:"Aoede (EN-US)",gender:"female",lang:"en"},{id:"af_bella",label:"Bella (EN-US)",gender:"female",lang:"en"},{id:"af_jessica",label:"Jessica (EN-US)",gender:"female",lang:"en"},{id:"af_kore",label:"Kore (EN-US)",gender:"female",lang:"en"},{id:"af_nicole",label:"Nicole (EN-US)",gender:"female",lang:"en"},{id:"af_nova",label:"Nova (EN-US)",gender:"female",lang:"en"},{id:"af_river",label:"River (EN-US)",gender:"female",lang:"en"},{id:"af_sarah",label:"Sarah (EN-US)",gender:"female",lang:"en"},{id:"af_sky",label:"Sky (EN-US)",gender:"female",lang:"en"},{id:"am_adam",label:"Adam (EN-US)",gender:"male",lang:"en"},{id:"am_echo",label:"Echo (EN-US)",gender:"male",lang:"en"},{id:"am_eric",label:"Eric (EN-US)",gender:"male",lang:"en"},{id:"am_fenrir",label:"Fenrir (EN-US)",gender:"male",lang:"en"},{id:"am_liam",label:"Liam (EN-US)",gender:"male",lang:"en"},{id:"am_michael",label:"Michael (EN-US)",gender:"male",lang:"en"},{id:"am_onyx",label:"Onyx (EN-US)",gender:"male",lang:"en"},{id:"am_puck",label:"Puck (EN-US)",gender:"male",lang:"en"},{id:"bf_isabella",label:"Isabella (EN-GB)",gender:"female",lang:"en-gb"},{id:"bf_alice",label:"Alice (EN-GB)",gender:"female",lang:"en-gb"},{id:"bf_lily",label:"Lily (EN-GB)",gender:"female",lang:"en-gb"},{id:"bf_emma",label:"Emma (EN-GB)",gender:"female",lang:"en-gb"},{id:"bm_lewis",label:"Lewis (EN-GB)",gender:"male",lang:"en-gb"},{id:"bm_george",label:"George (EN-GB)",gender:"male",lang:"en-gb"},{id:"bm_fable",label:"Fable (EN-GB)",gender:"male",lang:"en-gb"},{id:"bm_daniel",label:"Daniel (EN-GB)",gender:"male",lang:"en-gb"},{id:"pf_dora",label:"Dora (PT)",gender:"female",lang:"pt"},{id:"pm_alex",label:"Alex (PT)",gender:"male",lang:"pt"},{id:"ef_dora",label:"Dora (ES)",gender:"female",lang:"es"},{id:"em_alex",label:"Alex (ES)",gender:"male",lang:"es"},{id:"ff_siwis",label:"Siwis (FR)",gender:"female",lang:"fr"},{id:"if_sara",label:"Sara (IT)",gender:"female",lang:"it"},{id:"im_nicola",label:"Nicola (IT)",gender:"male",lang:"it"},{id:"jf_alpha",label:"Alpha (JA)",gender:"female",lang:"ja"},{id:"jf_gongitsune",label:"Gongitsune (JA)",gender:"female",lang:"ja"},{id:"jm_kumo",label:"Kumo (JA)",gender:"male",lang:"ja"},{id:"zf_xiaobei",label:"Xiaobei (ZH)",gender:"female",lang:"zh"},{id:"zf_xiaoni",label:"Xiaoni (ZH)",gender:"female",lang:"zh"},{id:"zm_yunjian",label:"Yunjian (ZH)",gender:"male",lang:"zh"},{id:"zm_yunxi",label:"Yunxi (ZH)",gender:"male",lang:"zh"},{id:"hf_alpha",label:"Alpha (HI)",gender:"female",lang:"hi"},{id:"hm_omega",label:"Omega (HI)",gender:"male",lang:"hi"}],t8=60;function Qat(n,e="English"){return{speakerCount:2,speakers:[{name:"Host",gender:"female",voiceId:"af_heart",stylePrompt:"warm, curious, sharp"},{name:"Guest",gender:"male",voiceId:"am_michael",stylePrompt:"knowledgeable, candid, conversational"}],topic:n,language:e,duration:t8}}function lte(n){return!n||!(n.workflowType==="podcast-video"||n.workflowSubType==="podcast-discussion")?n:{...n,workflowType:"long-video",workflowSubType:"podcast-discussion",podcastOptions:n.podcastOptions?{...n.podcastOptions,duration:Math.max(t8,Number(n.podcastOptions.duration)||0)}:void 0}}const Kat={en:"American English","en-gb":"British English",pt:"Portuguese",es:"Spanish",fr:"French",it:"Italian",ja:"Japanese",zh:"Chinese",hi:"Hindi"};function Zat(n){return Yat.filter(e=>e.gender===n)}function Jat(n){const e={};for(const t of n)e[t.lang]||(e[t.lang]=[]),e[t.lang].push(t);return e}function eot({index:n,speaker:e,onChange:t}){var d;const r=G.useRef(null),i=Zat(e.gender),s=Jat(i),o=i.some(h=>h.id===e.voiceId)?e.voiceId:(d=i[0])==null?void 0:d.id,l=h=>{var g;const f=(g=h.target.files)==null?void 0:g[0];if(!f)return;const p=new FileReader;p.onload=A=>{var x;t({...e,referenceImageUrl:(x=A.target)==null?void 0:x.result})},p.readAsDataURL(f)},u=h=>{var g;h.preventDefault();const f=(g=h.dataTransfer.files)==null?void 0:g[0];if(!f||!f.type.startsWith("image/"))return;const p=new FileReader;p.onload=A=>{var x;t({...e,referenceImageUrl:(x=A.target)==null?void 0:x.result})},p.readAsDataURL(f)};return c.jsxs("div",{className:"p-5 bg-[#1A1D24] border border-[#252A36] rounded-2xl space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-9 h-9 rounded-xl bg-[#CFFF05]/10 border border-[#CFFF05]/20 flex items-center justify-center text-lg",children:"ðï¸"}),c.jsxs("span",{className:"text-sm font-bold text-[#CFFF05] uppercase tracking-wider",children:["Speaker ",n+1]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-gray-400 mb-1",children:"Display Name"}),c.jsx("input",{type:"text",value:e.name,onChange:h=>t({...e,name:h.target.value}),placeholder:"e.g. Host, Guest, Alex...",className:"w-full bg-[#0F121A] border border-[#252A36] rounded-lg px-3 py-2.5 text-sm text-white outline-none focus:border-[#CFFF05] focus:ring-1 focus:ring-[#CFFF05] placeholder:text-gray-600"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-gray-400 mb-2",children:"Gender"}),c.jsx("div",{className:"flex bg-[#0F121A] p-1 rounded-xl border border-[#252A36]",children:["female","male"].map(h=>c.jsx("button",{type:"button",onClick:()=>t({...e,gender:h,voiceId:o}),className:`flex-1 py-2 text-xs font-black tracking-wider rounded-lg transition-all capitalize ${e.gender===h?"bg-[#CFFF05] text-[#0F121A] shadow-md shadow-[#CFFF05]/20":"text-gray-500 hover:text-gray-300"}`,children:h==="female"?"â Female":"â Male"},h))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-gray-400 mb-1",children:"Voice"}),c.jsx("select",{value:o,onChange:h=>t({...e,voiceId:h.target.value}),className:"w-full bg-[#0F121A] border border-[#252A36] rounded-lg px-3 py-2.5 text-sm text-white outline-none focus:border-[#CFFF05] focus:ring-1 focus:ring-[#CFFF05]",children:Object.entries(s).map(([h,f])=>c.jsx("optgroup",{label:Kat[h]||h,children:f.map(p=>c.jsx("option",{value:p.id,children:p.label},p.id))},h))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-gray-400 mb-1",children:"Narration Style"}),c.jsx("textarea",{value:e.stylePrompt,onChange:h=>t({...e,stylePrompt:h.target.value}),placeholder:"e.g. casual and energetic, uses humor, speaks clearly",rows:2,className:"w-full bg-[#0F121A] border border-[#252A36] rounded-lg px-3 py-2.5 text-sm text-white outline-none focus:border-[#CFFF05] focus:ring-1 focus:ring-[#CFFF05] resize-none placeholder:text-gray-600"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"block text-xs font-semibold text-gray-400 mb-2",children:["Reference Photo ",c.jsx("span",{className:"text-gray-600 font-normal",children:"(optional â for avatar appearance)"})]}),c.jsx("div",{onClick:()=>{var h;
5628return(h=r.current)==null?void 0:h.click()},onDrop:u,onDragOver:h=>h.preventDefault(),className:"relative border-2 border-dashed border-[#252A36] hover:border-[#CFFF05]/50 rounded-xl cursor-pointer transition-colors overflow-hidden",children:e.referenceImageUrl?c.jsxs("div",{className:"relative group",children:[c.jsx("img",{src:e.referenceImageUrl,alt:"reference",className:"w-full h-28 object-cover rounded-xl"}),c.jsx("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 flex items-center justify-center rounded-xl transition-opacity",children:c.jsx("span",{className:"text-xs font-bold text-white",children:"Change Photo"})})]}):c.jsxs("div",{className:"flex flex-col items-center justify-center py-6 gap-2 text-gray-600",children:[c.jsx("span",{className:"text-2xl",children:"ð·"}),c.jsx("span",{className:"text-xs font-semibold",children:"Drop photo or click to upload"}),c.jsx("span",{className:"text-[10px]",children:"PNG, JPG, WEBP"})]})}),c.jsx("input",{ref:r,type:"file",accept:"image/*",className:"hidden",onChange:l})]})]})}function tot({value:n,onChange:e,isGeneratingScene:t,onGenerateScene:r,generatedSceneUrl:i}){const s=(o,l)=>{const u=[...n.speakers];u[o]=l,e({...n,speakers:u})},a=o=>{if(o===1)e({...n,speakerCount:1,speakers:[n.speakers[0]]});else{const l=n.speakers[1]||{name:"Guest",gender:"male",voiceId:"am_michael",stylePrompt:"knowledgeable, conversational, enthusiastic"};e({...n,speakerCount:2,speakers:[n.speakers[0],l]})}};return c.jsxs("div",{className:"space-y-6 mt-4 p-5 bg-[#0F121A] border border-[#252A36] rounded-2xl",children:[c.jsx("h3",{className:"text-lg font-bold text-white flex items-center gap-2",children:"ðï¸ Podcast Settings"}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-gray-400 mb-2 uppercase tracking-wider",children:"Speakers"}),c.jsx("div",{className:"flex bg-[#1A1D24] p-1 rounded-xl border border-[#252A36]",children:[1,2].map(o=>c.jsx("button",{type:"button",onClick:()=>a(o),className:`flex-1 py-2.5 text-xs font-black tracking-wider rounded-lg transition-all ${n.speakerCount===o?"bg-[#CFFF05] text-[#0F121A] shadow-md shadow-[#CFFF05]/20":"text-gray-500 hover:text-gray-300"}`,children:o===1?"1 Speaker":"2 Speakers"},o))})]}),c.jsx("div",{className:"space-y-4",children:n.speakers.map((o,l)=>c.jsx(eot,{index:l,speaker:o,onChange:u=>s(l,u)},l))}),c.jsxs("div",{className:"p-4 bg-[#1A1D24] border border-[#252A36] rounded-xl space-y-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-bold text-white",children:"Podcast Studio Scene"}),c.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"AI-generate a custom studio background that matches your speakers."})]}),i&&c.jsxs("div",{className:"relative w-full aspect-video rounded-xl overflow-hidden border border-[#252A36]",children:[c.jsx("img",{src:i,alt:"Generated podcast scene",className:"w-full h-full object-cover"}),c.jsx("div",{className:"absolute bottom-2 right-2 bg-[#CFFF05] text-[#0F121A] text-[10px] font-black px-2 py-0.5 rounded-full",children:"SCENE READY"})]}),c.jsx("button",{type:"button",onClick:r,disabled:t,className:"w-full flex items-center justify-center gap-2 py-3 bg-[#CFFF05] hover:bg-[#d8ff2a] text-[#0F121A] text-sm font-black rounded-xl transition-all disabled:opacity-60 disabled:cursor-not-allowed shadow-lg shadow-[#CFFF05]/20",children:t?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-4 h-4 border-2 border-[#0F121A]/30 border-t-[#0F121A] rounded-full animate-spin"}),"Generating Scene..."]}):c.jsxs(c.Fragment,{children:["ð¬ ",i?"Regenerate Scene":"Generate Podcast Scene"]})})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-gray-400 mb-2 uppercase tracking-wider",children:"Duration"}),c.jsx("div",{className:"flex bg-[#1A1D24] p-1 rounded-xl border border-[#252A36]",children:[45,60,90].map(o=>c.jsxs("button",{type:"button",onClick:()=>e({...n,duration:o}),className:`flex-1 py-2.5 text-xs font-black tracking-wider rounded-lg transition-all ${n.duration===o?"bg-[#CFFF05] text-[#0F121A] shadow-md shadow-[#CFFF05]/20":"text-gray-500 hover:text-gray-300"}`,children:[o,"s"]},o))})]})]})}const not=[{at:0,label:Le("Reading your website"),detail:Le("Crawling pages, headings and metadata")},{at:10,label:Le("Understanding your brand"),detail:Le("Product, audience, language and colors")},{at:28,label:Le("Mapping content pillars"),detail:Le("Topics your audience actually cares about")},{at:50,label:Le("Creative Director at work"),detail:Le("Picking a viral format and style per post")},{at:85,label:Le("Writing hooks & captions"),detail:Le("One distinct angle for every day of the week")},{at:140,label:Le("Scheduling peak hours"),detail:Le("Timing each post for maximum reach")}],rot=[{at:0,label:Le("Reading your feed"),detail:Le("Fetching the latest articles")},{at:8,label:Le("Picking the strongest stories"),detail:Le("Freshness, depth and shareability")},{at:25,label:Le("Choosing a format per article"),detail:Le("Carousel, short or long video")},{at:55,label:Le("Writing hooks & captions"),detail:Le("Each post links back to its article")},{at:110,label:Le("Scheduling peak hours"),detail:Le("Spreading posts across the week")}],iot=[Le("Mon"),Le("Tue"),Le("Wed"),Le("Thu"),Le("Fri"),Le("Sat"),Le("Sun")],sot=80;function aot(n){try{return new URL(n.startsWith("http")?n:`https://${n}`).hostname.replace(/^www\./,"")}catch{return""}}function oot({url:n,mode:e="site"}){const[t,r]=G.useState(0),[i,s]=G.useState(!0),a=G.useRef(null),o=hi();G.useEffect(()=>{var A;(A=a.current)==null||A.scrollIntoView({behavior:"smooth",block:"start"})},[]),G.useEffect(()=>{const A=performance.now(),x=window.setInterval(()=>r((performance.now()-A)/1e3),250);return()=>window.clearInterval(x)},[]);const l=e==="rss"?rot:not,u=l.reduce((A,x,b)=>t>=x.at?b:A,0),d=Math.min(96,3+93*(1-Math.exp(-t/sot))),h=G.useMemo(()=>aot(n||""),[n]),f=Math.min(7,Math.floor(d/96*8)),p=Math.floor(t/60),g=String(Math.floor(t%60)).padStart(2,"0");
5628return c.jsxs("div",{ref:a,className:"ws-enter ws-glass relative scroll-mt-24 overflow-hidden rounded-[28px] p-6 sm:p-10",role:"status","aria-live":"polite",children:[c.jsx("div",{className:"pointer-events-none absolute -top-40 left-1/2 h-80 w-[36rem] -translate-x-1/2 rounded-full bg-[rgba(207,255,5,.12)] blur-3xl","aria-hidden":!0}),c.jsxs("div",{className:"relative grid gap-10 lg:grid-cols-[1fr_1.05fr] lg:items-center",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-5",children:[c.jsxs("div",{className:"relative h-20 w-20 shrink-0",children:[c.jsx("div",{className:"ws-orbit absolute inset-0 rounded-full border border-dashed border-[rgba(207,255,5,.45)]"}),c.jsx("div",{className:"ws-orbit rev absolute inset-2 rounded-full border border-white/10",children:c.jsx("span",{className:"absolute -top-1 left-1/2 h-2 w-2 -translate-x-1/2 rounded-full bg-[var(--lp-cyan)] shadow-[0_0_10px_rgba(34,211,238,.9)]"})}),c.jsx("div",{className:"absolute inset-[18px] grid place-items-center overflow-hidden rounded-full bg-white/[0.06] ring-1 ring-white/10",children:h&&i?c.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${h}&sz=64`,alt:"",className:"h-6 w-6",onError:()=>s(!1)}):c.jsx("span",{className:"ws-pulse-dot h-2.5 w-2.5 rounded-full bg-[var(--lp-lime)]"})})]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"ws-kicker",children:o("Generating strategy")}),c.jsx("h3",{className:"ws-display mt-1 truncate text-2xl font-bold text-white sm:text-3xl",children:h?c.jsxs(c.Fragment,{children:[o("Planning a week for")," ",c.jsx("span",{className:"ws-gradient-text",children:h})]}):o("Planning your week")})]})]}),c.jsxs("div",{className:"mt-7",children:[c.jsx("div",{className:"ws-progress",children:c.jsx("i",{style:{width:`${d}%`}})}),c.jsxs("div",{className:"ws-mono mt-2.5 flex justify-between text-[11px] text-white/45",children:[c.jsx("span",{children:o("{time} elapsed · usually 1â4 min",{time:`${p}:${g}`})}),c.jsxs("span",{className:"tabular-nums text-white/70",children:[Math.round(d),"%"]})]})]}),c.jsx("ol",{className:"mt-7 space-y-1",children:l.map((A,x)=>{const b=x<u,_=x===u;return c.jsxs("li",{className:`flex items-start gap-3 rounded-xl px-3 py-2.5 transition-all duration-500 ${_?"bg-white/[0.05]":""} ${x>u?"opacity-35":""}`,children:[c.jsx("span",{className:`mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full transition-all duration-500 ${b?"bg-[var(--lp-lime)] text-black":_?"ring-2 ring-[rgba(207,255,5,.6)]":"ring-1 ring-white/20"}`,children:b?c.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:3.5,viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):_?c.jsx("span",{className:"ws-pulse-dot h-2 w-2 rounded-full bg-[var(--lp-lime)]"}):null}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:`text-sm font-semibold ${_?"text-white":b?"text-white/70":"text-white/60"}`,children:o(A.label)}),c.jsx("div",{className:`grid transition-all duration-500 ${_?"mt-0.5 grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:c.jsxs("p",{className:"overflow-hidden text-xs text-white/45",children:[o(A.detail),"â¦"]})})]})]},A.label)})})]}),c.jsxs("div",{className:"rounded-3xl border border-white/[0.07] bg-black/30 p-4 sm:p-5",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsx("span",{className:"ws-mono text-[11px] uppercase tracking-[0.2em] text-white/45",children:o("Your week")}),c.jsx("span",{className:"ws-mono text-[11px] text-white/45",children:o("{n}/7 planned",{n:f})})]}),c.jsx("div",{className:"grid grid-cols-7 gap-2",children:iot.map((A,x)=>{const b=x<f;return c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:`ws-mono text-center text-[10px] transition-colors duration-500 ${b?"text-[var(--lp-lime)]":"text-white/35"}`,children:o(A)}),c.jsx("div",{className:`ws-skeleton aspect-[9/16] rounded-xl transition-all duration-700 ${b?"ring-1 ring-[rgba(207,255,5,.45)] shadow-[0_0_24px_-6px_rgba(207,255,5,.5)]":""}`,style:{animationDelay:`${x*.12}s`},children:b&&c.jsx("span",{className:"absolute inset-x-1.5 bottom-1.5 h-1 rounded-full bg-[rgba(207,255,5,.7)] ws-enter"})}),c.jsx("div",{className:`ws-skeleton h-1.5 rounded-full ${b?"opacity-100":"opacity-40"}`}),c.jsx("div",{className:`ws-skeleton h-1.5 w-2/3 rounded-full ${b?"opacity-100":"opacity-40"}`})]},A)})}),c.jsx("p",{className:"mt-5 text-center text-xs leading-relaxed text-white/45",children:o("You can keep this tab open. Every post gets its own format, hook and time slot.")})]})]})]})}var AO,cte;function lot(){if(cte)return AO;cte=1;var n=!1,e,t,r,i,s,a,o,l,u,d,h,f,p,g,A;function x(){if(!n){n=!0;var _=navigator.userAgent,M=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Ice
5628weasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(_),T=/(Mac OS X)|(Windows)|(Linux)/.exec(_);if(f=/\b(iPhone|iP[ao]d)/.exec(_),p=/\b(iP[ao]d)/.exec(_),d=/Android/i.exec(_),g=/FBAN\/\w+;/i.exec(_),A=/Mobile/i.exec(_),h=!!/Win64/.exec(_),M){e=M[1]?parseFloat(M[1]):M[5]?parseFloat(M[5]):NaN,e&&document&&document.documentMode&&(e=document.documentMode);var L=/(?:Trident\/(\d+.\d+))/.exec(_);a=L?parseFloat(L[1])+4:e,t=M[2]?parseFloat(M[2]):NaN,r=M[3]?parseFloat(M[3]):NaN,i=M[4]?parseFloat(M[4]):NaN,i?(M=/(?:Chrome\/(\d+\.\d+))/.exec(_),s=M&&M[1]?parseFloat(M[1]):NaN):s=NaN}else e=t=r=s=i=NaN;if(T){if(T[1]){var D=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(_);o=D?parseFloat(D[1].replace("_",".")):!0}else o=!1;l=!!T[2],u=!!T[3]}else o=l=u=!1}}var b={ie:function(){return x()||e},ieCompatibilityMode:function(){return x()||a>e},ie64:function(){return b.ie()&&h},firefox:function(){return x()||t},opera:function(){return x()||r},webkit:function(){return x()||i},safari:function(){return b.webkit()},chrome:function(){return x()||s},windows:function(){return x()||l},osx:function(){return x()||o},linux:function(){return x()||u},iphone:function(){return x()||f},mobile:function(){return x()||f||p||d||A},nativeApp:function(){return x()||g},android:function(){return x()||d},ipad:function(){return x()||p}};return AO=b,AO}var xO,ute;function cot(){if(ute)return xO;ute=1;var n=!!(typeof window<"u"&&window.document&&window.document.createElement),e={canUseDOM:n,canUseWorkers:typeof Worker<"u",canUseEventListeners:n&&!!(window.addEventListener||window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};return xO=e,xO}var vO,dte;function uot(){if(dte)return vO;dte=1;var n=cot(),e;n.canUseDOM&&(e=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** 5629 * Checks if an event is supported in the current execution environment. 5630 * 5631 * NOTE: This will not work correctly for non-generic events such as `change`, 5632 * `reset`, `load`, `error`, and `select`. 5633 * 5634 * Borrows from Modernizr. 5635 * 5636 * @param {string} eventNameSuffix Event name, e.g. "click". 5637 * @param {?boolean} capture Check if the capture phase is supported. 5638 * @return {boolean} True if the event is supported. 5639 * @internal 5640 * @license Modernizr 3.0.0pre (Custom Build) | MIT 5641 */function t(r,i){if(!n.canUseDOM||i&&!("addEventListener"in document))return!1;var s="on"+r,a=s in document;if(!a){var o=document.createElement("div");o.setAttribute(s,"return;"),a=typeof o[s]=="function"}return!a&&e&&r==="wheel"&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}return vO=t,vO}var yO,hte;function dot(){if(hte)return yO;hte=1;var n=lot(),e=uot(),t=10,r=40,i=800;function s(a){var o=0,l=0,u=0,d=0;return"detail"in a&&(l=a.detail),"wheelDelta"in a&&(l=-a.wheelDelta/120),"wheelDeltaY"in a&&(l=-a.wheelDeltaY/120),"wheelDeltaX"in a&&(o=-a.wheelDeltaX/120),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(o=l,l=0),u=o*t,d=l*t,"deltaY"in a&&(d=a.deltaY),"deltaX"in a&&(u=a.deltaX),(u||d)&&a.deltaMode&&(a.deltaMode==1?(u*=r,d*=r):(u*=i,d*=i)),u&&!o&&(o=u<1?-1:1),d&&!l&&(l=d<1?-1:1),{spinX:o,spinY:l,pixelX:u,pixelY:d}}return s.getEventType=function(){return n.firefox()?"DOMMouseScroll":e("wheel")?"wheel":"mousewheel"},yO=s,yO}var bO,fte;function hot(){return fte||(fte=1,bO=dot()),bO}var fot=hot();const pot=F1(fot);function $5(n){"@babel/helpers - typeof";return $5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$5(n)}function mot(n,e){if($5(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if($5(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function got(n){var e=mot(n,"string");return $5(e)=="symbol"?e:e+""}function Aot(n,e,t){return(e=got(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pte(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function sl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
5641e%2?pte(Object(t),!0).forEach(function(r){Aot(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pte(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function xot(n,e,t,r,i,s=0){const{width:a,height:o}=s_(n,e,s),l=Math.min(a,t),u=Math.min(o,r);return l>u*i?{width:u*i,height:u}:{width:l,height:l/i}}function vot(n){return n.width>n.height?n.width/n.naturalWidth:n.height/n.naturalHeight}function sS(n,e,t,r,i=0){const{width:s,height:a}=s_(e.width,e.height,i);return{x:mte(n.x,s,t.width,r),y:mte(n.y,a,t.height,r)}}function mte(n,e,t,r){const i=Math.abs(e*r/2-t/2);return eP(n,-i,i)}function gte(n,e){return Math.sqrt(Math.pow(n.y-e.y,2)+Math.pow(n.x-e.x,2))}function Ate(n,e){return Math.atan2(e.y-n.y,e.x-n.x)*180/Math.PI}function yot(n,e,t,r,i,s=0,a=!0){const o=a?bot:wot,l=s_(e.width,e.height,s),u=s_(e.naturalWidth,e.naturalHeight,s),d={x:o(100,((l.width-t.width/i)/2-n.x/i)/l.width*100),y:o(100,((l.height-t.height/i)/2-n.y/i)/l.height*100),width:o(100,t.width/l.width*100/i),height:o(100,t.height/l.height*100/i)},h=Math.round(o(u.width,d.width*u.width/100)),f=Math.round(o(u.height,d.height*u.height/100)),p=u.width>=u.height*r?{width:Math.round(f*r),height:f}:{width:h,height:Math.round(h/r)};return{croppedAreaPercentages:d,croppedAreaPixels:sl(sl({},p),{},{x:Math.round(o(u.width-p.width,d.x*u.width/100)),y:Math.round(o(u.height-p.height,d.y*u.height/100))})}}function bot(n,e){return Math.min(n,Math.max(0,e))}function wot(n,e){return e}function _ot(n,e,t,r,i,s){const a=s_(e.width,e.height,t),o=eP(r.width/a.width*(100/n.width),i,s);return{crop:{x:o*a.width/2-r.width/2-a.width*o*(n.x/100),y:o*a.height/2-r.height/2-a.height*o*(n.y/100)},zoom:o}}function Sot(n,e,t){const r=vot(e);return t.height>t.width?t.height/(n.height*r):t.width/(n.width*r)}function Tot(n,e,t=0,r,i,s){const a=s_(e.naturalWidth,e.naturalHeight,t),o=eP(Sot(n,e,r),i,s),l=r.height>r.width?r.height/n.height:r.width/n.width;return{crop:{x:((a.width-n.width)/2-n.x)*l,y:((a.height-n.height)/2-n.y)*l},zoom:o}}function xte(n,e){return{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}function Eot(n){return n*Math.PI/180}function s_(n,e,t){const r=Eot(t);return{width:Math.abs(Math.cos(r)*n)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*n)+Math.abs(Math.cos(r)*e)}}function eP(n,e,t){return Math.min(Math.max(n,e),t)}function BN(...n){return n.filter(e=>typeof e=="string"&&e.length>0).join(" ").trim()}var Cot=`.reactEasyCrop_Container { 5642 position: absolute; 5643 top: 0; 5644 left: 0; 5645 right: 0; 5646 bottom: 0; 5647 overflow: hidden; 5648 user-select: none; 5649 touch-action: none; 5650 cursor: move; 5651 display: flex; 5652 justify-content: center; 5653 align-items: center; 5654} 5655 5656.reactEasyCrop_Image, 5657.reactEasyCrop_Video { 5658 will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */ 5659 max-width: unset; /* prevent global img/video reset rules from constraining the cropper media */ 5660} 5661 5662.reactEasyCrop_Contain { 5663 max-width: 100%; 5664 max-height: 100%; 5665 margin: auto; 5666 position: absolute; 5667 top: 0; 5668 bottom: 0; 5669 left: 0; 5670 right: 0; 5671} 5672.reactEasyCrop_Cover_Horizontal { 5673 width: 100%; 5674 height: auto; 5675} 5676.reactEasyCrop_Cover_Vertical { 5677 width: auto; 5678 height: 100%; 5679} 5680 5681.reactEasyCrop_CropArea { 5682 position: absolute; 5683 left: 50%; 5684 top: 50%; 5685 transform: translate(-50%, -50%); 5686 border: 1px solid rgba(255, 255, 255, 0.5); 5687 box-sizing: border-box; 5688 box-shadow: 0 0 0 9999em; 5689 color: rgba(0, 0, 0, 0.5); 5690 overflow: hidden; 5691} 5692 5693.reactEasyCrop_CropAreaRound { 5694 border-radius: 50%; 5695} 5696 5697.reactEasyCrop_CropAreaGrid::before { 5698 content: ' '; 5699 box-sizing: border-box; 5700 position: absolute; 5701 border: 1px solid rgba(255, 255, 255, 0.5); 5702 top: 0; 5703 bottom: 0; 5704 left: 33.33%; 5705 right: 33.33%; 5706 border-top: 0; 5707 border-bottom: 0; 5708} 5709 5710.reactEasyCrop_CropAreaGrid::after { 5711 content: ' '; 5712 box-sizing: border-box; 5713 position: absolute; 5714 border: 1px solid rgba(255, 255, 255, 0.5); 5715 top: 33.33%; 5716 bottom: 33.33%; 5717 left: 0; 5718 right: 0; 5719 border-left: 0; 5720 border-right: 0; 5721} 5722`;const Not=250,Mot=1,kot=3,Rot=1;var tP=class Pf extends G.Component{constructor(...e){super(...e),this.cropperRef=G.createRef(),this.imageRef=G.createRef(),this.videoRef=G.createRef(),this.containerPosition={x:0,y:0}
5722,this.containerRef=null,this.styleRef=null,this.containerRect=null,this.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},this.dragStartPosition={x:0,y:0},this.dragStartCrop={x:0,y:0},this.gestureZoomStart=0,this.gestureRotationStart=0,this.isTouching=!1,this.lastPinchDistance=0,this.lastPinchRotation=0,this.rafDragTimeout=null,this.rafPinchTimeout=null,this.wheelTimer=null,this.resizeEmitTimer=null,this.currentDoc=typeof document<"u"?document:null,this.currentWindow=typeof window<"u"?window:null,this.resizeObserver=null,this.previousCropSize=null,this.isInitialized=!1,this.dragInteractionSource=null,this.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},this.initResizeObserver=()=>{if(typeof window.ResizeObserver>"u"||!this.containerRef)return;let t=!0;this.resizeObserver=new window.ResizeObserver(r=>{if(t){t=!1;return}this.computeSizes({isResizeTriggered:!0})}),this.resizeObserver.observe(this.containerRef)},this.onWindowResize=()=>{this.computeSizes({isResizeTriggered:!0})},this.preventZoomSafari=t=>t.preventDefault(),this.cleanEvents=()=>{this.currentDoc&&(this.currentDoc.removeEventListener("mousemove",this.onMouseMove),this.currentDoc.removeEventListener("mouseup",this.onDragStopped),this.currentDoc.removeEventListener("touchmove",this.onTouchMove),this.currentDoc.removeEventListener("touchend",this.onDragStopped),this.currentDoc.removeEventListener("gesturechange",this.onGestureChange),this.currentDoc.removeEventListener("gestureend",this.onGestureEnd),this.currentDoc.removeEventListener("scroll",this.onScroll))},this.clearScrollEvent=()=>{this.containerRef&&this.containerRef.removeEventListener("wheel",this.onWheel),this.wheelTimer&&clearTimeout(this.wheelTimer)},this.onMediaLoad=()=>{const t=this.computeSizes();t&&(this.previousCropSize=t,this.emitCropData(),this.setInitialCrop(t),this.isInitialized=!0),this.props.onMediaLoaded&&this.props.onMediaLoaded(this.mediaSize)},this.setInitialCrop=t=>{if(this.props.initialCroppedAreaPercentages){const{crop:r,zoom:i}=_ot(this.props.initialCroppedAreaPercentages,this.mediaSize,this.props.rotation,t,this.props.minZoom,this.props.maxZoom);this.props.onCropChange(r),this.props.onZoomChange&&this.props.onZoomChange(i)}else if(this.props.initialCroppedAreaPixels){const{crop:r,zoom:i}=Tot(this.props.initialCroppedAreaPixels,this.mediaSize,this.props.rotation,t,this.props.minZoom,this.props.maxZoom);this.props.onCropChange(r),this.props.onZoomChange&&this.props.onZoomChange(i)}},this.computeSizes=({isResizeTriggered:t=!1}={})=>{const r=this.imageRef.current||this.videoRef.current;if(r&&this.containerRef){var i,s,a,o,l,u;this.containerRect=this.containerRef.getBoundingClientRect(),this.saveContainerPosition();const d=this.containerRect.width/this.containerRect.height,h=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalWidth)||((s=this.videoRef.current)===null||s===void 0?void 0:s.videoWidth)||0,f=((a=this.imageRef.current)===null||a===void 0?void 0:a.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,p=r.offsetWidth<h||r.offsetHeight<f,g=h/f;let A;if(p)switch(this.state.mediaObjectFit){default:case"contain":A=d>g?{width:this.containerRect.height*g,height:this.containerRect.height}:{width:this.containerRect.width,height:this.containerRect.width/g};break;case"horizontal-cover":A={width:this.containerRect.width,height:this.containerRect.width/g};break;case"vertical-cover":A={width:this.containerRect.height*g,height:this.containerRect.height};break}else A={width:r.offsetWidth,height:r.offsetHeight};this.mediaSize=sl(sl({},A),{},{naturalWidth:h,naturalHeight:f}),this.props.setMediaSize&&this.props.setMediaSize(this.mediaSize);const x=this.props.cropSize?this.props.cropSize:xot(this.mediaSize.width,this.mediaSize.height,this.containerRect.width,this.containerRect.height,this.props.aspect,this.props.rotation);return(((l=this.state.cropSize)===null||l===void 0?void 0:l.height)!==x.height||((u=this.state.cropSize)===null||u===void 0?void 0:u.width)!==x.width)&&this.props.onCropSizeChange&&this.props.onCropSizeChange(x),this.setState({cropSize:x},()=>this.recomputeCropPosition({isResizeTriggered:t})),this.props.setCropSize&&this.props.setCropSize(x),x}},this.saveContainerPosition=()=>
5722{if(this.containerRef){const t=this.containerRef.getBoundingClientRect();this.containerPosition={x:t.left,y:t.top}}},this.onMouseDown=t=>{this.currentDoc&&(t.preventDefault(),this.currentDoc.addEventListener("mousemove",this.onMouseMove),this.currentDoc.addEventListener("mouseup",this.onDragStopped),this.saveContainerPosition(),this.onDragStart(Pf.getMousePoint(t),"mouse"))},this.onMouseMove=t=>this.onDrag(Pf.getMousePoint(t)),this.onScroll=t=>{this.currentDoc&&(t.preventDefault(),this.saveContainerPosition())},this.onTouchStart=t=>{this.currentDoc&&(this.isTouching=!0,!(this.props.onTouchRequest&&!this.props.onTouchRequest(t))&&(this.currentDoc.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.currentDoc.addEventListener("touchend",this.onDragStopped),this.saveContainerPosition(),t.touches.length===2?this.onPinchStart(t):t.touches.length===1&&this.onDragStart(Pf.getTouchPoint(t.touches[0]),"touch")))},this.onTouchMove=t=>{t.preventDefault(),t.touches.length===2?this.onPinchMove(t):t.touches.length===1&&this.onDrag(Pf.getTouchPoint(t.touches[0]))},this.onGestureStart=t=>{this.currentDoc&&(t.preventDefault(),this.currentDoc.addEventListener("gesturechange",this.onGestureChange),this.currentDoc.addEventListener("gestureend",this.onGestureEnd),this.gestureZoomStart=this.props.zoom,this.gestureRotationStart=this.props.rotation)},this.onGestureChange=t=>{if(t.preventDefault(),this.isTouching)return;const r=Pf.getMousePoint(t),i=this.gestureZoomStart-1+t.scale;if(this.setNewZoom(i,r,{shouldUpdatePosition:!0}),this.props.onRotationChange){const s=this.gestureRotationStart+t.rotation;this.props.onRotationChange(s)}},this.onGestureEnd=t=>{this.cleanEvents()},this.onDragStart=({x:t,y:r},i)=>{var s,a;this.dragStartPosition={x:t,y:r},this.dragStartCrop=sl({},this.props.crop),this.dragInteractionSource=i,(s=(a=this.props).onInteractionStart)===null||s===void 0||s.call(a,{source:i})},this.onDrag=({x:t,y:r})=>{this.currentWindow&&(this.rafDragTimeout&&this.currentWindow.cancelAnimationFrame(this.rafDragTimeout),this.rafDragTimeout=this.currentWindow.requestAnimationFrame(()=>{if(!this.state.cropSize||t===void 0||r===void 0)return;const i=t-this.dragStartPosition.x,s=r-this.dragStartPosition.y,a={x:this.dragStartCrop.x+i,y:this.dragStartCrop.y+s},o=this.props.restrictPosition?sS(a,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):a;this.props.onCropChange(o)}))},this.onDragStopped=()=>{var t,r,i;this.isTouching=!1,this.cleanEvents(),this.emitCropData(),(t=(r=this.props).onInteractionEnd)===null||t===void 0||t.call(r,{source:(i=this.dragInteractionSource)!==null&&i!==void 0?i:"mouse"}),this.dragInteractionSource=null},this.onWheel=t=>{if(!this.currentWindow||this.props.onWheelRequest&&!this.props.onWheelRequest(t))return;t.preventDefault();const r=Pf.getMousePoint(t),{pixelY:i}=pot(t),s=this.props.zoom-i*this.props.zoomSpeed/200;this.setNewZoom(s,r,{shouldUpdatePosition:!0}),this.state.hasWheelJustStarted||this.setState({hasWheelJustStarted:!0},()=>{var a,o;return(a=(o=this.props).onInteractionStart)===null||a===void 0?void 0:a.call(o,{source:"wheel"})}),this.wheelTimer&&clearTimeout(this.wheelTimer),this.wheelTimer=this.currentWindow.setTimeout(()=>this.setState({hasWheelJustStarted:!1},()=>{var a,o;return(a=(o=this.props).onInteractionEnd)===null||a===void 0?void 0:a.call(o,{source:"wheel"})}),250)},this.getPointOnContainer=({x:t,y:r},i)=>{if(!this.containerRect)throw new Error("The Cropper is not mounted");return{x:this.containerRect.width/2-(t-i.x),y:this.containerRect.height/2-(r-i.y)}},this.getPointOnMedia=({x:t,y:r})=>{const{crop:i,zoom:s}=this.props;return{x:(t+i.x)/s,y:(r+i.y)/s}},this.setNewZoom=(t,r,{shouldUpdatePosition:i=!0}={})=>{if(!this.state.cropSize||!this.props.onZoomChange)return;const s=eP(t,this.props.minZoom,this.props.maxZoom);if(i){const a=this.getPointOnContainer(r,this.containerPosition),o=this.getPointOnMedia(a),l={x:o.x*s-a.x,y:o.y*s-a.y},u=this.props.restrictPosition?sS(l,this.mediaSize,this.state.cropSize,s,this.props.rotation):l;this.props.onCropChange(u)}this.props.onZoomChange(s)},this.getCropData=()=>this.state.cropSize?yot(this.props.restrictPosition?sS(this.props.crop,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):this.props.crop,this.mediaSize,this.state.cropSize,this.getAspect(),this.props.zoom,this.props.rotation,this.props.restrictPosition):null,this.emitCropData=()=>{this.resizeEmitTimer&&(clearTimeout(this.resizeEmitTimer),this.resizeEmitTimer=null);const t=this.getCropData();if(!t)return;const{croppedAreaPercentages:r,croppedAreaPixels:i}=t;this.props.onCropComplete&&this.props.onCropComplete(r,i),this.props.onCropAreaChange&&this.props.onCropAreaChange(r,i)},this.emitCropAreaChange=()=>{const t=this.getCropData();if(!t)return;const{croppedAreaPercentages:r,croppedAreaPixels:i}=t;this.props.onCropAreaChange&&this.props.onCropAreaChange(r,i)},this.recomputeCropPosition=({isResizeTriggered:t=!1}={})=>{var r,i;if(!this.state.cropSize)return;let s=this.props.crop;if(this.isInitialized&&(!((r=this.previousCropSize)===null||r===void 0)&&r.width)&&(!((i=this.previousCropSize)===null||i===void 0)&&i.height)&&(Math.abs(this.previousCropSize.width-this.state.cropSize.width)>1e-6||Math.abs(this.previousCropSize.height-this.state.cropSize.height)>1e-6)){const o=this.state.cropSize.width/this.previousCropSize.width,l=this.state.cropSize.height/this.previousCropSize.height;s={x:this.props.crop.x*o,y:this.props.crop.y*l}}const a=this.props.restrictPosition?sS(s,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):s;this.previousCropSize=this.state.cropSize,this.props.onCropChange(a),t?this.debouncedEmitCropData():this.emitCropData()},this.debouncedEmitCropData=()=>{this.currentWindow&&(this.resizeEmitTimer&&clearTimeout(this.resizeEmitTimer),this.resizeEmitTimer=this.currentWindow.setTimeout(()=>{this.emitCropData()},Not))},this.onKeyDown=t=>{const{crop:r,onCropChange:i,keyboardStep:s,zoom:a,rotation:o}=this.props;let l=s;if(!this.state.cropSize)return;t.shiftKey&&(l*=.2);let u=sl({},r);switch(t.key){case"ArrowUp":u.y-=l,t.preventDefault();break;case"ArrowDown":u.y+=l,t.preventDefault();break;case"ArrowLeft":u.x-=l,t.preventDefault();break;case"ArrowRight":u.x+=l,t.preventDefault();break;default:return}if(this.props.restrictPosition&&(u=sS(u,this.mediaSize,this.state.cropSize,a,o)),!t.repeat){var d,h;(d=(h=this.props).onInteractionStart)===null||d===void 0||d.call(h,{source:"keyboard"})}i(u)},this.onKeyUp=t=>{var r,i;switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault();break;default:return}this.emitCropData(),(r=(i=this.props).onInteractionEnd)===null||r===void 0||r.call(i,{source:"keyboard"})}}componentDidMount(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.onWindowResize),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=Cot,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))}componentWillUnmount(){var e;
5722if(!(!this.currentDoc||!this.currentWindow)){if(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.onWindowResize),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.resizeEmitTimer&&clearTimeout(this.resizeEmitTimer),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef){var t;(t=this.styleRef.parentNode)===null||t===void 0||t.removeChild(this.styleRef)}this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()}}componentDidUpdate(e){var t,r,i,s,a,o,l,u;if(e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((t=e.cropSize)===null||t===void 0?void 0:t.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((i=e.cropSize)===null||i===void 0?void 0:i.width)!==((s=this.props.cropSize)===null||s===void 0?void 0:s.width)?this.computeSizes():(((a=e.crop)===null||a===void 0?void 0:a.x)!==((o=this.props.crop)===null||o===void 0?void 0:o.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video){var d;(d=this.videoRef.current)===null||d===void 0||d.load()}const h=this.getObjectFit();h!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:h},this.computeSizes)}getAspect(){const{cropSize:e,aspect:t}=this.props;return e?e.width/e.height:t}getObjectFit(){if(this.props.objectFit==="cover"){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){var e,t,r,i;this.containerRect=this.containerRef.getBoundingClientRect();const s=this.containerRect.width/this.containerRect.height;return(((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((t=this.videoRef.current)===null||t===void 0?void 0:t.videoWidth)||0)/(((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0)<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit}onPinchStart(e){const t=Pf.getTouchPoint(e.touches[0]),r=Pf.getTouchPoint(e.touches[1]);this.lastPinchDistance=gte(t,r),this.lastPinchRotation=Ate(t,r),this.onDragStart(xte(t,r),"touch")}onPinchMove(e){if(!this.currentDoc||!this.currentWindow)return;const t=Pf.getTouchPoint(e.touches[0]),r=Pf.getTouchPoint(e.touches[1]),i=xte(t,r);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(()=>{const s=gte(t,r),a=this.props.zoom*(s/this.lastPinchDistance);this.setNewZoom(a,i,{shouldUpdatePosition:!1}),this.lastPinchDistance=s;const o=Ate(t,r),l=this.props.rotation+(o-this.lastPinchRotation);this.props.onRotationChange&&this.props.onRotationChange(l),this.lastPinchRotation=o})}render(){var e;const{image:t,video:r,mediaProps:i,cropperProps:s,transform:a,crop:{x:o,y:l},rotation:u,zoom:d,cropShape:h,showGrid:f,roundCropAreaPixels:p,style:{containerStyle:g,cropAreaStyle:A,mediaStyle:x},classes:{containerClassName:b,cropAreaClassName:_,mediaClassName:M}}=this.props,T=(e=this.state.mediaObjectFit)!==null&&e!==void 0?e:this.getObjectFit();return G.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:L=>this.containerRef=L,"data-testid":"container",style:g,className:BN("reactEasyCrop_Container",b)},t?G.createElement("img",sl(sl({alt:"",className:BN("reactEasyCrop_Image",T==="contain"&&"reactEasyCrop_Contain",T==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",T==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",M)},i),{},{src:t,ref:this.imageRef,style:sl(sl({},x),{},{transform:a||`translate(${o}px, ${l}px) rotate(${u}deg) scale(${d})`}),onLoad:this.onMediaLoad}
5722)):r&&G.createElement("video",sl(sl({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:BN("reactEasyCrop_Video",T==="contain"&&"reactEasyCrop_Contain",T==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",T==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",M)},i),{},{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:sl(sl({},x),{},{transform:a||`translate(${o}px, ${l}px) rotate(${u}deg) scale(${d})`}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map(L=>G.createElement("source",sl({key:L.src},L)))),this.state.cropSize&&G.createElement("div",sl({ref:this.cropperRef,style:sl(sl({},A),{},{width:p?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:p?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:BN("reactEasyCrop_CropArea",h==="round"&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",_)},s)))}};tP.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:kot,minZoom:Mot,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:Rot};tP.getMousePoint=n=>({x:Number(n.clientX),y:Number(n.clientY)});tP.getTouchPoint=n=>({x:Number(n.clientX),y:Number(n.clientY)});var Pot=tP;const Lot=n=>new Promise((e,t)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",i=>t(i)),r.setAttribute("crossOrigin","anonymous"),r.src=n});async function Oot(n,e){const t=await Lot(n),r=document.createElement("canvas"),i=r.getContext("2d");return i?(r.width=e.width,r.height=e.height,i.drawImage(t,e.x,e.y,e.width,e.height,0,0,e.width,e.height),new Promise((s,a)=>{r.toBlob(o=>{o?s(new File([o],"avatar_cropped.jpg",{type:"image/jpeg"})):a(new Error("Canvas is empty"))},"image/jpeg")})):Promise.reject(new Error("No 2d context"))}function Dot({imageSrc:n,onClose:e,onCropComplete:t}){const[r,i]=G.useState({x:0,y:0}),[s,a]=G.useState(1),[o,l]=G.useState(null),u=G.useCallback(p=>{i(p)},[]),d=G.useCallback(p=>{a(p)},[]),h=G.useCallback((p,g)=>{l(g)},[]),f=async()=>{try{const p=await Oot(n,o);t(p)}catch(p){console.error(p),e()}};return c.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80",children:c.jsxs("div",{className:"bg-[#1a1d24] rounded-2xl w-[90%] max-w-lg overflow-hidden flex flex-col shadow-2xl border border-gray-800",children:[c.jsxs("div",{className:"p-4 border-b border-gray-800 flex justify-between items-center",children:[c.jsx("h3",{className:"text-lg font-bold text-white",children:"Crop Avatar (9:16)"}),c.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white",children:"â"})]}),c.jsx("div",{className:"relative w-full h-[500px] bg-black",children:c.jsx(Pot,{image:n,crop:r,zoom:s,aspect:9/16,onCropChange:u,onZoomChange:d,onCropComplete:h})}),c.jsxs("div",{className:"p-6 bg-[#0F121A] flex justify-between items-center gap-4",children:[c.jsxs("div",{className:"flex-1 flex flex-col",children:[c.jsx("label",{className:"text-xs text-gray-400 font-semibold mb-2",children:"Zoom"}),c.jsx("input",{type:"range",value:s,min:1,max:3,step:.1,onChange:p=>a(Number(p.target.value)),className:"w-full h-1 bg-gray-700 rounded-lg appearance-none cursor-pointer"})]}),c.jsx("button",{onClick:f,className:"px-6 py-2 bg-[#CFFF05] text-[#0F121A] font-bold rounded-lg hover:brightness-110 transition-all",children:"Crop & Use"})]})]})})}const jot=6,zb=1500,Iot=[{re:/\b(ignore|forget|disregard|override|bypass|reset)\b[^.!?\n]{0,40}\b(previous|prior|above|earlier|all|any|every|system|your|these|those)\b[^.!?\n]{0,30}\b(instructions?|rules?|prompts?|guidelines?|directions?|constraints?|messages?|context|policies|restrictions?)\b/i,reason:"Tries to override the instructions"},{re:/\b(new|updated|real|actual|true|hidden|secret)\s+(instructions?|system\s+prompt)\b/i,reason:"Tries to replace the instructions"},{re:/\b(system|developer)\s+(prompt|message|instructions?)\b|\b(admin|root|developer|god|debug)\s+mode\b/i,reason:"Mentions system prompts or special modes"}
5722,{re:/\b(you are now|you are an? (hacker|unrestricted|jailbroken|evil|uncensored|unfiltered)|from now on,? you|act as an? (ai|assistant|system|developer|hacker|unrestricted)|pretend (to be|you are) an? (ai|assistant|system|developer)|roleplay as an? (ai|system)|jailbreak|do anything now|\bDAN\b)/i,reason:"Tries to change the AI's role"},{re:/\b(reveal|print|output|leak|dump|expose|log|echo|send|share|show|tell|give|display|return|list)\b[^.!?\n]{0,60}\b(api[\s_-]?keys?|secrets?|tokens?|passwords?|credentials?|env(ironment)?\s+variables?|private\s+keys?)\b|(^|[\s'"(])\.env\b/i,reason:"Asks for secrets or keys"},{re:/\b(reveal|repeat|print|show|output|leak|dump|display|tell me)\b[^.!?\n]{0,40}\b(your|the system|system|hidden|initial|original|internal)\s+(prompt|instructions|rules|configuration)\b/i,reason:"Asks for the AI's instructions"},{re:/\b(api[\s_-]?keys?|secret[\s_-]?keys?|access[\s_-]?tokens?|bearer\s+token|private[\s_-]?keys?|passwords?)\b/i,reason:"Mentions keys, tokens or passwords"},{re:/(process\.env|console\.(log|error|info|warn)|require\s*\(|import\s*\(|eval\s*\(|exec\s*\(|child_process|fetch\s*\(|XMLHttpRequest|document\.cookie|localStorage|window\.)/i,reason:"Contains code"},{re:/\b(rm\s+-rf|sudo\s|curl\s+-|wget\s+http|chmod\s|bash\s+-c|powershell\s|DROP\s+TABLE|UNION\s+SELECT|INSERT\s+INTO)/i,reason:"Contains shell or database commands"},{re:/\b(base64|hex)\s*(decode|encoded?)\b|[A-Za-z0-9+/]{60,}={0,2}/,reason:"Contains encoded payloads"}],Fot=/(<\|?(im_start|im_end|system|assistant|user|endoftext)\|?>|\[\/?(INST|SYS)\]|<<\/?SYS>>|^\s*(system|assistant|user|developer)\s*:)/gim,Uot=/[â-ââª-â®â -â¤ï»¿]/g,Bot=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g;function Vot(n){return n.split(new RegExp("(?<=[.!?])\\s+|\\n+")).map(e=>e.trim()).filter(Boolean)}function _Ae(n){const e=new Set;if(typeof n!="string"||!n.trim())return{text:null,modified:!1,reasons:[]};let t=n.normalize("NFKC").replace(Uot,"").replace(Bot," ");t.length>zb&&(t=t.slice(0,zb),e.add(`Trimmed to ${zb} characters`));const r=t;t=t.replace(/```[\s\S]*?```/g,()=>(e.add("Contains code")," ")).replace(/<\s*(script|style|iframe|object|embed)[\s\S]*?<\s*\/\s*\1\s*>/gi,()=>(e.add("Contains HTML or scripts")," ")).replace(Fot,()=>(e.add("Fake chat-role markers removed")," ")).replace(/<[^>]{1,200}>/g," ").replace(/\bhttps?:\/\/\S+|\bwww\.\S+/gi,()=>(e.add("Links removed")," ")).replace(/<{2,}|>{2,}|={4,}|-{4,}|#{3,}/g," ");const i=[];for(const o of Vot(t)){const l=Iot.find(u=>u.re.test(o));if(l){e.add(l.reason);continue}i.push(o)}const s=i.join(" ").replace(/\s+/g," ").trim(),a=e.size>0||s.length<r.replace(/\s+/g," ").trim().length-2;return s.split(/\s+/).filter(Boolean).length<3?{text:null,modified:!0,reasons:e.size?[...e]:["Too short to use as a template"]}:{text:s,modified:a,reasons:[...e]}}const k4="w-full rounded-xl border border-white/10 bg-white/[0.04] px-4 py-3 text-sm text-white placeholder:text-white/35 outline-none transition focus:border-[#CFFF05]/70 focus:bg-white/[0.06] focus:ring-2 focus:ring-[#CFFF05]/20",D6=`${k4} min-h-[112px] resize-y leading-relaxed`;function zot({id:n,value:e,onChange:t,children:r,ariaLabel:i}){return c.jsxs("div",{className:"relative",children:[c.jsx("select",{id:n,"aria-label":i,value:e,onChange:s=>t(s.target.value),className:`${k4} cursor-pointer appearance-none pr-10`,children:r}),c.jsx("svg",{className:"pointer-events-none absolute right-4 top-1/2 h-2 w-3 -translate-y-1/2 text-white/60",viewBox:"0 0 12 8",fill:"none",stroke:"currentColor",strokeWidth:1.6,children:c.jsx("path",{d:"M1 1.5l5 5 5-5"})})]})}function Got(n,e){const[t,r]=G.useState(e[0]||""),i=e.join("|");return G.useEffect(()=>{const a=n.current;if(!a)return;r(l=>e.includes(l)?l:e[0]||"");const o=new IntersectionObserver(l=>{const u=l.filter(d=>d.isIntersecting).sort((d,h)=>d.boundingClientRect.top-h.boundingClientRect.top);u[0]&&r(u[0].target.id.replace(/^ps-/,""))},{root:a,rootMargin:"0px 0px -65% 0px",threshold:0});return e.forEach(l=>{const u=a.querySelector(`#ps-${l}`);u&&o.observe(u)}),()=>o.disconnect()},[i,n]),[t,a=>{const o=n.current,l=o==null?void 0:o.querySelector(`#ps-${a}`);o&&l&&o.scrollTo({top:l.offsetTop-16,behavior:"smooth"}),r(a)}]}function qot(n){const{t:e}=Kr(),t=G.useRef(null),[r,i]=Got(t,n.sections.map(s=>s.id));return G.useEffect(()=>{const s=o=>{o.key==="Escape"&&n.onClose()};window.addEventListener("keydown",s);const a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",s),document.body.style.overflow=a}},[]),c.jsx("div",{className:"fixed inset-0 z-[9999] flex items-stretch justify-center bg-black/75 backdrop-blur-md sm:items-center sm:p-6",role:"dialog","aria-modal":"true","aria-labelledby":"post-settings-title",children:c.jsxs("div",{className:"relative flex h-[100dvh] w-full flex-col overflow-hidden border-white/10 bg-[#0a0c12]/[0.97] shadow-[0_40px_120px_-30px_rgba(0,0,0,.9)] animate-fade-in-up sm:h-[min(920px,calc(100dvh-48px))] sm:max-w-6xl sm:rounded-[28px] sm:border",children:[c.jsxs("div",{className:"border-b border-white/[0.07] px-5 pb-4 pt-5 sm:px-8 sm:pt-6",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"ws-kicker",children:n.kicker}),c.jsx("h2",{id:"post-settings-title",className:"ws-display mt-1.5 truncate text-2xl font-bold text-white sm:text-[28px]",children:n.title}),n.subtitle&&c.jsx("p",{className:"mt-1 text-sm text-white/55",children:n.subtitle})]}),c.jsx("button",{type:"button",onClick:n.onClose,"aria-label":e("Close"),className:"grid h-10 w-10 flex-shrink-0 place-items-center rounded-full border border-white/10 bg-white/[0.04] text-white/70 transition hover:bg-white/[0.09] hover:text-white",children:c.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.4,strokeLinecap:"round",children:c.jsx("path",{d:"M6 6l12 12M18 6L6 18"})})})]}),n.headerExtra&&c.jsx("div",{className:"mt-4",children:n.headerExtra}),c.jsx("nav",{className:"-mx-5 mt-4 flex gap-2 overflow-x-auto px-5 pb-1 lg:hidden","aria-label":e("Settings sections"),children:n.sections.map(s=>c.jsxs("button",{type:"button",onClick:()=>i(s.id),className:`flex flex-shrink-0 items-center gap-1.5 rounded-full border px-3.5 py-1.5 text-xs font-semibold transition ${r===s.id?"border-[#CFFF05]/60 bg-[#CFFF05]/10 text-[#CFFF05]":"border-white/10 text-white/60 hover:text-white"}`,children:[c.jsx("span",{className:"h-3.5 w-3.5",children:s.icon}),s.label]},s.id))})]}),c.jsxs("div",{className:"flex min-h-0 flex-1",children:[c.jsx("nav",{className:"hidden w-60 flex-shrink-0 flex-col gap-1 border-r border-white/[0.07] p-4 lg:flex","aria-label":e("Settings sections"),children:n.sections.map(s=>c.jsxs("button",{type:"button",onClick:()=>i(s.id),className:`flex items-center gap-3 rounded-xl px-3.5 py-2.5 text-left text-sm font-semibold transition ${r===s.id?"bg-[#CFFF05]/10 text-[#CFFF05] shadow-[inset_0_0_0_1px_rgba(207,255,5,.25)]":"text-white/60 hover:bg-white/[0.04] hover:text-white"}`,children:[c.jsx("span",{className:"h-4 w-4 flex-shrink-0",children:s.icon}),s.label]},s.id))}),c.jsx("div",{ref:t,className:"relative min-w-0 flex-1 overflow-y-auto overscroll-contain px-5 py-6 sm:px-8",children:c.jsx("div",{className:"mx-auto flex max-w-3xl flex-col gap-6 pb-6",children:n.children})})]}),c.jsx("div",{className:"border-t border-white/[0.07] bg-[#0a0c12]/95 px-5 py-4 pb-[max(1rem,env(safe-area-inset-bottom))] sm:px-8",children:n.footer})]})})}function fA({id:n,title:e,description:t,children:r,aside:i}){return c.jsxs("section",{id:`ps-${n}`,className:"scroll-mt-4 rounded-[22px] border border-white/[0.08] bg-white/[0.025] p-5 sm:p-6",children:[c.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"ws-display text-lg font-bold text-white",children:e}),t&&c.jsx("p",{className:"mt-1 text-sm leading-relaxed text-white/50",children:t})]}),i]}),c.jsx("div",{className:"flex flex-col gap-5",children:r})]})}function Ml({label:n,hint:e,right:t,htmlFor:r,children:i}){return c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex items-end justify-between gap-3",children:[c.jsx("label",{htmlFor:r,className:"text-[13px] font-semibold text-white/80",children:n}),t]}),i,e&&c.jsx("p",{className:"text-xs leading-relaxed text-white/45",children:e})]})}function q2({id:n,title:e,description:t,checked:r,onChange:i,children:s}){return c.jsxs("div",{className:`rounded-2xl border transition ${r?"border-[#CFFF05]/25 bg-[#CFFF05]/[0.035]":"border-white/[0.08] bg-white/[0.02]"}`,children:[c.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold text-white",children:e}),t&&c.jsx("p",{className:"mt-0.5 text-xs leading-relaxed text-white/50",children:t})]}),c.jsx("button",{id:n,type:"button",role:"switch","aria-checked":r,"aria-label":e,onClick:()=>i(!r),className:`relative inline-flex h-7 w-12 flex-shrink-0 items-center rounded-full transition focus:outline-none focus-visible:ring-2 focus-visible:ring-[#CFFF05]/60 ${r?"bg-[#CFFF05]":"bg-white/15"}`,children:c.jsx("span",{className:`inline-block h-5 w-5 rounded-full shadow transition ${r?"translate-x-6 bg-[#05060a]":"translate-x-1 bg-white"}`})})]}),r&&s&&c.jsx("div",{className:"border-t border-white/[0.06] p-4",children:s})]})}function aS({value:n,onChange:e,options:t,ariaLabel:r}){return c.jsx("div",{role:"radiogroup","aria-label":r,className:"flex w-full gap-1 rounded-2xl border border-white/10 bg-white/[0.03] p-1",children:t.map(i=>c.jsxs("button",{type:"button",role:"radio","aria-checked":n===i.value,onClick:()=>
5722e(i.value),className:`flex min-w-0 flex-1 items-center justify-center gap-2 rounded-xl px-2 py-2.5 text-[13px] font-bold transition sm:px-3 sm:text-sm ${n===i.value?"bg-[#CFFF05] text-[#05060a] shadow-[0_10px_30px_-12px_rgba(207,255,5,.7)]":"text-white/60 hover:bg-white/[0.05] hover:text-white"}`,children:[i.icon&&c.jsx("span",{className:"hidden h-4 w-4 flex-shrink-0 sm:inline-block",children:i.icon}),i.shortLabel?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"truncate sm:hidden",children:i.shortLabel}),c.jsx("span",{className:"hidden truncate sm:inline",children:i.label})]}):c.jsx("span",{className:"truncate",children:i.label})]},i.value))})}function oS({selected:n,title:e,description:t,badge:r,onClick:i}){return c.jsxs("button",{type:"button",onClick:i,"aria-pressed":n,className:`group flex h-full flex-col rounded-2xl border p-4 text-left transition ${n?"border-[#CFFF05]/70 bg-[#CFFF05]/[0.07] shadow-[inset_0_0_0_1px_rgba(207,255,5,.35)]":"border-white/[0.09] bg-white/[0.02] hover:border-white/20 hover:bg-white/[0.04]"}`,children:[c.jsxs("span",{className:"flex w-full items-center justify-between gap-2",children:[c.jsx("span",{className:`text-sm font-bold ${n?"text-white":"text-white/85"}`,children:e}),r&&c.jsx("span",{className:"rounded-md bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide text-white/60",children:r}),!r&&c.jsx("span",{className:`grid h-5 w-5 place-items-center rounded-full border transition ${n?"border-[#CFFF05] bg-[#CFFF05]":"border-white/25"}`,children:n&&c.jsx("svg",{className:"h-3 w-3 text-[#05060a]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3.5,children:c.jsx("path",{d:"M5 13l4 4L19 7",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t&&c.jsx("span",{className:"mt-1.5 text-xs leading-relaxed text-white/50",children:t})]})}function $ot({value:n,onChange:e,isCarousel:t}){const{t:r}=Kr(),i=G.useMemo(()=>_Ae(n),[n]),s=t?[r('Slide 1 asks a question. Each next slide answers one part, numbered. Last slide: "Save this for later".'),r("Write like a friendly coach. Short lines, no jargon, one concrete example per slide.")]:[r('Open with a question my customers ask. Then 3 quick tips, each starting with a verb. End with: "Follow for part 2".'),r("Speak like a calm expert talking to a friend. Mention our free trial in the last sentence.")],a=zb-n.length;return c.jsxs(Ml,{label:r(t?"Your slide copy template":"Your script template"),htmlFor:"custom-script-prompt",right:c.jsxs("span",{className:`ws-mono text-[11px] ${a<100?"text-amber-300":"text-white/35"}`,children:[n.length,"/",zb]}),hint:r("Optional. Shapes tone, structure and recurring lines. Facts still come from your product and sources, and the AI keeps its safety and quality rules."),children:[c.jsx("textarea",{id:"custom-script-prompt",value:n,maxLength:zb,onChange:o=>e(o.target.value),className:D6,placeholder:r(t?"e.g. Number every slide. Keep headlines under 6 words. Finish with a question.":'e.g. Start with a bold question, give 3 steps, end with "Link in bio".')}),!n&&c.jsx("div",{className:"flex flex-wrap gap-2",children:s.map(o=>c.jsxs("button",{type:"button",onClick:()=>e(o),className:"rounded-full border border-white/10 bg-white/[0.03] px-3 py-1.5 text-left text-xs text-white/60 transition hover:border-[#CFFF05]/40 hover:text-white",children:["+ ",o]},o))}),n.trim()&&i.modified&&c.jsxs("div",{role:"status",className:`rounded-xl border px-3.5 py-3 text-xs leading-relaxed ${i.text?"border-amber-400/30 bg-amber-400/[0.07] text-amber-200":"border-red-400/30 bg-red-400/[0.07] text-red-200"}`,children:[c.jsx("p",{className:"font-semibold",children:i.text?r("Some parts will be ignored for safety"):r("This template will be ignored")}),i.reasons.length>0&&c.jsx("p",{className:"mt-1 opacity-80",children:i.reasons.map(o=>r(o)).join(" · ")})]})]})}const Vp=n=>c.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:"h-full w-full",children:c.jsx("path",{d:n})}),Cf={basics:Vp("M4 6h16M4 12h10M4 18h7"),script:Vp("M14 3v4a1 1 0 001 1h4M17 21H7a2 2 0 01-2-2V5a2 2 0 012-2h7l5 5v11a2 2 0 01-2 2zM9 13h6M9 17h4"),product:Vp("M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"),voice:Vp("M12 3a3 3 0 00-3 3v6a3 3 0 006 0V6a3 3 0 00-3-3zM19 11a7 7 0 01-14 0M12 18v3"),hook:Vp("M13 2L3
572214h9l-1 8 10-12h-9l1-8z"),images:Vp("M4 16l4.5-4.5a2 2 0 012.8 0L16 16m-2-2l1.5-1.5a2 2 0 012.8 0L20 14M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2zm8-12h.01"),caption:Vp("M8 10h8M8 14h5M21 12c0 4.4-4 8-9 8a9.9 9.9 0 01-4-.8L3 20l1.3-3.9A7.5 7.5 0 013 12c0-4.4 4-8 9-8s9 3.6 9 8z"),podcast:Vp("M12 18a6 6 0 006-6V9a6 6 0 10-12 0v3a6 6 0 006 6zm0 0v3m-4 0h8"),video:Vp("M15 10l4.5-2.5v9L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"),carousel:Vp("M7 4h10a2 2 0 012 2v12a2 2 0 01-2 2H7a2 2 0 01-2-2V6a2 2 0 012-2zM2 7v10M22 7v10")},Hf=()=>c.jsx("div",{className:"flex items-center justify-center",style:{marginTop:30},children:c.jsx("div",{className:"h-16 w-16 animate-spin rounded-full border-4 border-solid border-primary border-t-transparent"})}),E0={shortVideo:30,perMinute:30,textImage:20},vte=n=>Math.max(E0.perMinute,Math.ceil(n/60)*E0.perMinute),pA={shortVideo:100,perMinute:100,textImageBase:20,perAiImage:5,other:5};function yte(n){if(n.type==="podcast-video"||n.type==="long-video"&&n.subType==="podcast-discussion"){const t=Math.min(120,Math.max(45,Number(n.podcastSeconds)||60));return n.byok?vte(t):Math.max(pA.perMinute,Math.ceil(t/60)*pA.perMinute)}if(n.type==="long-video"){const t=Math.min(90,Math.max(30,Number(n.durationSeconds)||60));return n.byok?vte(t):Math.max(pA.perMinute,Math.ceil(t/60)*pA.perMinute)}return n.type==="video"?n.byok?E0.shortVideo:pA.shortVideo:n.type==="text-image"?n.byok?E0.textImage:pA.textImageBase+Math.max(0,Number(n.aiImages)||0)*pA.perAiImage:pA.other}const Hot=20*1024*1024,xv=n=>{if(!n)return!1;if(n.type&&typeof n.type=="string"&&/pdf/i.test(n.type))return!0;const e=n.name||n.url||"";return/\.pdf(\?|$)/i.test(e)},bte=({files:n=[],onMediaChange:e,id:t="dropzone-media-upload",accept:r,allowDocuments:i=!1})=>{const{t:s}=Kr(),[a,o]=G.useState(n),[l,u]=G.useState(!1),[d,h]=G.useState(null),f=r||(i?"image/*,video/*,application/pdf,.pdf":"image/*,video/*");G.useEffect(()=>{o(n)},[n]);const p=O=>{if(!O)return!1;if(O.type&&typeof O.type=="string")return O.type.startsWith("video/");const F=O.name||O.url||"";return/\.(mp4|mov|webm|avi|mkv|m4v|3gp)$/i.test(F)},g=O=>{if(!O)return!1;if(O.type&&typeof O.type=="string")return O.type.startsWith("image/");const F=O.name||O.url||"";return/\.(jpe?g|png|gif|webp|svg|bmp|tiff)$/i.test(F)},A=O=>{let F=0;const U=O.filter(B=>g(B)||p(B)?!0:i&&xv(B)?typeof B.size=="number"&&B.size>Hot?(F++,!1):!0:!1);return h(F?s("{n} PDF(s) over 20 MB were skipped.",{n:F}):null),U},x=O=>{const F=Array.from(O.target.files||[]),U=A(F),B=[...a,...U];o(B),e(B),O.target.value=""},b=O=>{O.preventDefault(),u(!1);const F=Array.from(O.dataTransfer.files||[]),U=A(F);if(U.length>0){const B=[...a,...U];o(B),e(B)}},_=O=>{const F=a.filter((U,B)=>B!==O);o(F),e(F)},M=O=>O instanceof File||O instanceof Blob?URL.createObjectURL(O):O&&O.url?O.url:O&&O.fileUrl?O.fileUrl:"",T=a.filter(p).length,L=a.filter(g).length,D=a.filter(xv).length,P=[T===1?s("1 video"):s("{n} videos",{n:T}),L===1?s("1 image"):s("{n} images",{n:L}),...i||D?[D===1?s("1 PDF"):s("{n} PDFs",{n:D})]:[]];return c.jsxs("div",{className:"w-full",children:[c.jsx("div",{className:"flex items-center justify-center w-full",children:c.jsxs("label",{htmlFor:t,onDragOver:O=>{O.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:b,className:`flex flex-col items-center justify-center w-full h-44 border-2 border-dashed rounded-xl cursor-pointer transition-all duration-200 ${l?"border-emerald-500 bg-emerald-50/50 dark:bg-emerald-950/20 shadow-lg":"border-gray-300 dark:border-[#252A36] bg-gray-50/50 dark:bg-[#0F121A]/60 hover:bg-gray-100/80 dark:hover:bg-[#1A1D24] hover:border-emerald-500/50"}`,children:[c.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6 px-4 text-center",children:[c.jsx("div",{className:"w-12 h-12 mb-3 rounded-full bg-emerald-500/10 flex items-center justify-center text-emerald-500",children:c.jsx("svg",{className:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})})}),c.jsxs("p",{className:"mb-1 text-sm font-semibold text-gray-800 dark:text-gray-200",children:[c.jsx("span",{className:"text-emerald-500 hover:underline",children:s("Click to upload")})," ",s("or drag and drop")]}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:s(i?"Images (PNG, JPG, WEBP, GIF), videos (MP4, MOV, WEBM) and PDF documents (up to 20 MB)":"Images (PNG, JPG, WEBP, GIF) and Videos (MP4, MOV, WEBM)")})]}),c.jsx("input",{id:t,type:"file",accept:f,className:"hidden",multiple:!0,onChange:x})]})}),d&&c.jsx("p",{className:"mt-2 text-xs text-amber-400",children:d}),a.length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400",children:s("Uploaded files ({n})",{n:a.length})}),c.jsx("span",{className:"text-xs text-emerald-500 font-medium",children:P.join(", ")})]}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:a.map((O,F)=>{const U=p(O),B=xv(O),z=B?"":M(O),H=O.name||(typeof O=="string"?O.split("/").pop():`File ${F+1}`);return c.jsxs("div",{className:"relative group rounded-xl overflow-hidden border border-gray-200 dark:border-[#252A36] bg-gray-100 dark:bg-[#0F121A] aspect-video flex items-center justify-center shadow-sm",children:[B?c.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-1.5 px-3 text-center",children:[c.jsxs("svg",{className:"w-8 h-8 text-[#cfff05]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:[c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"}),c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,d:"M13 3v5a1 1 0 001 1h5M9 13h6M9 17h4"})]}),c.jsx("span",{className:"max-w-full truncate text-[11px] font-medium text-white/80",children:H}),c.jsx("span",{className:"absolute bottom-1.5 left-1.5 bg-black/70 backdrop-blur-sm text-white text-[10px] font-medium px-1.5 py-0.5 rounded",children:"PDF"})]}):U?c.jsxs("div",{className:"w-full h-full relative",children:[c.jsx("video",{src:z,className:"w-full h-full object-cover",muted:!0,preload:"metadata"}),c.jsx("div",{className:"absolute inset-0 bg-black/20 flex items-center justify-center pointer-events-none",children:c.jsx("div",{className:"w-7 h-7 rounded-full bg-black/60 backdrop-blur-sm flex items-center justify-center text-white",children:c.jsx("svg",{className:"w-3.5 h-3.5 fill-current ml-0.5",viewBox:"0 0 24 24",children:c.jsx("path",{d:"M8 5v14l11-7z"})})})}),c.jsx("span",{className:"absolute bottom-1.5 left-1.5 bg-black/70 backdrop-blur-sm text-white text-[10px] font-medium px-1.5 py-0.5 rounded",children:s("Video")})]}):c.jsxs("div",{className:"w-full h-full relative",children:[c.jsx("img",{src:z,alt:H,className:"w-full h-full object-cover"}),c.jsx("span",{className:"absolute bottom-1.5 left-1.5 bg-black/70 backdrop-blur-sm text-white text-[10px] font-medium px-1.5 py-0.5 rounded",children:s("Image")})]}),c.jsxs("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-trans
5722parent to-transparent opacity-0 group-hover:opacity-100 transition-opacity p-2 flex flex-col justify-between",children:[c.jsx("div",{className:"flex justify-end",children:c.jsx("button",{type:"button",onClick:X=>{X.preventDefault(),X.stopPropagation(),_(F)},className:"bg-red-500/90 hover:bg-red-600 text-white rounded-full p-1 shadow-md transition-transform hover:scale-110",title:s("Remove file"),children:c.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})}),c.jsx("p",{className:"text-[10px] text-white truncate drop-shadow-sm font-medium",children:H})]})]},F)})})]})]})};var qu=function(){return qu=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},qu.apply(this,arguments)};function n8(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}function Wot(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var SAe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},da="-ms-",R4="-moz-",ps="-webkit-",TAe="comm",nP="rule",Vq="decl",Xot="@import",Yot="@namespace",EAe="@keyframes",Qot="@layer",CAe=Math.abs,zq=String.fromCharCode,CU=Object.assign;function Kot(n,e){return Go(n,0)^45?(((e<<2^Go(n,0))<<2^Go(n,1))<<2^Go(n,2))<<2^Go(n,3):0}function NAe(n){return n.trim()}function Tm(n,e){return(n=e.exec(n))?n[0]:n}function fi(n,e,t){return n.replace(e,t)}function j6(n,e,t){return n.indexOf(e,t)}function Go(n,e){return n.charCodeAt(e)|0}function fy(n,e,t){return n.slice(e,t)}function Df(n){return n.length}function MAe(n){return n.length}function VS(n,e){return e.push(n),n}function Zot(n,e){return n.map(e).join("")}function wte(n,e){return n.filter(function(t){return!Tm(t,e)})}var rP=1,a_=1,kAe=0,Kh=0,Co=0,j_="";function iP(n,e,t,r,i,s,a,o){return{value:n,root:e,parent:t,type:r,props:i,children:s,line:rP,column:a_,length:a,return:"",siblings:o}}function vA(n,e){return CU(iP("",null,null,"",null,null,0,n.siblings),n,{length:-n.length},e)}function $2(n){for(;n.root;)n=vA(n.root,{children:[n]});VS(n,n.siblings)}function Jot(){return Co}function elt(){return Co=Kh>0?Go(j_,--Kh):0,a_--,Co===10&&(a_=1,rP--),Co}function ep(){return Co=Kh<kAe?Go(j_,Kh++):0,a_++,Co===10&&(a_=1,rP++),Co}function JA(){return Go(j_,Kh)}function I6(){return Kh}function sP(n,e){return fy(j_,n,e)}function H5(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tlt(n){return rP=a_=1,kAe=Df(j_=n),Kh=0,[]}function nlt(n){return j_="",n}function wO(n){return NAe(sP(Kh-1,NU(n===91?n+2:n===40?n+1:n)))}function rlt(n){for(;(Co=JA())&&Co<33;)ep();return H5(n)>2||H5(Co)>3?"":" "}function ilt(n,e){for(;--e&&ep()&&!(Co<48||Co>102||Co>57&&Co<65||Co>70&&Co<97););return sP(n,I6()+(e<6&&JA()==32&&ep()==32))}function NU(n){for(;ep();)switch(Co){case n:return Kh;case 34:case 39:n!==34&&n!==39&&NU(Co);break;case 40:n===41&&NU(n);break;case 92:ep();break}return Kh}function slt(n,e){for(;ep()&&n+Co!==57;)if(n+Co===84&&JA()===47)break;return"/*"+sP(e,Kh-1)+"*"+zq(n===47?n:ep())}function alt(n){for(;!H5(JA());)ep();return sP(n,Kh)}function olt(n){return nlt(F6("",null,null,null,[""],n=tlt(n),0,[0],n))}function F6(n,e,t,r,i,s,a,o,l){for(var u=0,d=0,h=a,f=0,p=0,g=0,A=1,x=1,b=1,_=0,M="",T=i,L=s,D=r,P=M;x;)switch(g=_,_=ep()){case 40:if(g!=108&&Go(P,h-1)==58){j6(P+=fi(wO(_),"&","&\f"),"&\f",CAe(u?o[u-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:P+=wO(_);break;case 9:case 10:case 13:case 32:P+=rlt(g);break;case 92:P+=ilt(I6()-1,7);continue;case 47:switch(JA()){case 42:case 47:VS(llt(slt(ep(),I6()),e,t,l),l),(H5(g||1)==5||H5(JA()||1)==5)&&Df(P)&&fy(P,-1,void 0)!==" "&&(P+=" ");break;default:P+="/"}break;case 123*A:o[u++]=Df(P)*b;case 125*A:case 59:case 0:switch(_){case 0:case 125:x=0;case 59+d:b==-1&&(P=fi(P,/\f/g,"")),p>0&&(Df(P)-h||A===0&&g===47)&&VS(p>32?Ste(P+";",r,t,h-1,l):Ste(fi(P," ","")+";",r,t,h-2,l),l);break;case 59:P+=";";default:if(VS(D=_te(P,e,t,u,d,i,o,M,T=[],L=[],h,s),s),_===123)if(d===0)F6(P,e,D,D,T,s,h,o,L);else{switch(f){case 99:if(Go(P,3)===110)break;case 108:if(Go(P,2)===97)break;default:d=0;case 100:case 109:case 115:}d?F6(n,D,D,r&&VS(_te(n,D,D,0,0,i,o,M,i,T=[],h,L),L),i,L,h,o,r?T:L):F6(P,D,D,D,[""],L,0,o,L)}}u=d=p=0,A=b=1,M=P="",h=a;break;case 58:h=1+Df(P),p=g;default:if(A<1){if(_==123)--A;
vendor: 4,391 bytes, line 5722
5722else if(_==125&&A++==0&&elt()==125)continue}switch(P+=zq(_),_*A){case 38:b=d>0?1:(P+="\f",-1);break;case 44:o[u++]=(Df(P)-1)*b,b=1;break;case 64:JA()===45&&(P+=wO(ep())),f=JA(),d=h=Df(M=P+=alt(I6())),_++;break;case 45:g===45&&Df(P)==2&&(A=0)}}return s}function _te(n,e,t,r,i,s,a,o,l,u,d,h){for(var f=i-1,p=i===0?s:[""],g=MAe(p),A=0,x=0,b=0;A<r;++A)for(var _=0,M=fy(n,f+1,f=CAe(x=a[A])),T=n;_<g;++_)(T=NAe(x>0?p[_]+" "+M:fi(M,/&\f/g,p[_])))&&(l[b++]=T);return iP(n,e,t,i===0?nP:o,l,u,d,h)}function llt(n,e,t,r){return iP(n,e,t,TAe,zq(Jot()),fy(n,2,-2),0,r)}function Ste(n,e,t,r,i){return iP(n,e,t,Vq,fy(n,0,r),fy(n,r+1,-1),r,i)}function RAe(n,e,t){switch(Kot(n,e)){case 5103:return ps+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return ps+n+n;case 4855:return ps+n.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+n;case 4789:return R4+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return ps+n+R4+n+da+n+n;case 5936:switch(Go(n,e+11)){case 114:return ps+n+da+fi(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return ps+n+da+fi(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return ps+n+da+fi(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return ps+n+da+n+n;case 6165:return ps+n+da+"flex-"+n+n;case 5187:return ps+n+fi(n,/(\w+).+(:[^]+)/,ps+"box-$1$2"+da+"flex-$1$2")+n;case 5443:return ps+n+da+"flex-item-"+fi(n,/flex-|-self/g,"")+(Tm(n,/flex-|baseline/)?"":da+"grid-row-"+fi(n,/flex-|-self/g,""))+n;case 4675:return ps+n+da+"flex-line-pack"+fi(n,/align-content|flex-|-self/g,"")+n;case 5548:return ps+n+da+fi(n,"shrink","negative")+n;case 5292:return ps+n+da+fi(n,"basis","preferred-size")+n;case 6060:return ps+"box-"+fi(n,"-grow","")+ps+n+da+fi(n,"grow","positive")+n;case 4554:return ps+fi(n,/([^-])(transform)/g,"$1"+ps+"$2")+n;case 6187:return fi(fi(fi(n,/(zoom-|grab)/,ps+"$1"),/(image-set)/,ps+"$1"),n,"")+n;case 5495:case 3959:return fi(n,/(image-set\([^]*)/,ps+"$1$`$1");case 4968:return fi(fi(n,/(.+:)(flex-)?(.*)/,ps+"box-pack:$3"+da+"flex-pack:$3"),/space-between/,"justify")+ps+n+n;case 4200:if(!Tm(n,/flex-|baseline/))return da+"grid-column-align"+fy(n,e)+n;break;case 2592:case 3360:return da+fi(n,"template-","")+n;case 4384:case 3616:return t&&t.some(function(r,i){return e=i,Tm(r.props,/grid-\w+-end/)})?~j6(n+(t=t[e].value),"span",0)?n:da+fi(n,"-start","")+n+da+"grid-row-span:"+(~j6(t,"span",0)?Tm(t,/\d+/):+Tm(t,/\d+/)-+Tm(n,/\d+/))+";":da+fi(n,"-start","")+n;case 4896:case 4128:return t&&t.some(function(r){return Tm(r.props,/grid-\w+-start/)})?n:da+fi(fi(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return fi(n,/(.+)-inline(.+)/,ps+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Df(n)-1-e>6)switch(Go(n,e+1)){case 109:if(Go(n,e+4)!==45)break;case 102:return fi(n,/(.+:)(.+)-([^]+)/,"$1"+ps+"$2-$3$1"+R4+(Go(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~j6(n,"stretch",0)?RAe(fi(n,"stretch","fill-available"),e,t)+n:n}break;case 5152:case 5920:return fi(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,s,a,o,l,u){return da+i+":"+s+u+(a?da+i+"-span:"+(o?l:+l-+s)+u:"")+n});case 4949:if(Go(n,e+6)===121)return fi(n,":",":"+ps)+n;break;case 6444:switch(Go(n,Go(n,14)===45?18:11)){case 120:return fi(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ps+(Go(n,14)===45?"inline-":"")+"box$3$1"+ps+"$2$3$1"+da+"$2box$3")+n;case 100:return fi(n,":",":"+da)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return fi(n,"scroll-","scroll-snap-")+n}return n}function r8(n,e){for(var t="",r=0;r<n.length;r++)t+=e(n[r],r,n,e)||"";return t}function clt(n,e,t,r){switch(n.type){case Qot:if(n.children.length)break;case Xot:case Yot:case Vq:return n.return=n.return||n.value;case TAe:return"";case EAe:return n.return=n.value+"{"+r8(n.children,r)+"}";case nP:if(!Df(n.value=n.props.join(",")))return""}return Df(t=r8(n.children,r))?n.return=n.value+"{"+t+"}":""}function ult(n){var e=MAe(n);return function(t,r,i,s){for(var a="",o=0;o<e;o++)a+=n[o](t,r,i,s)||"";return a}}function dlt(n){return function(e){e.root||(e=e.return)&&n(e)}}function hlt(n,e,t,r){if(n.length>
5722-1&&!n.return)switch(n.type){case Vq:n.return=RAe(n.value,n.length,t);return;case EAe:return r8([vA(n,{value:fi(n.value,"@","@"+ps)})],r);case nP:if(n.length)return Zot(t=n.props,function(i){switch(Tm(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":$2(vA(n,{props:[fi(i,/:(read-\w+)/,":"+R4+"$1")]})),$2(vA(n,{props:[i]})),CU(n,{props:wte(t,r)});break;case"::placeholder":$2(vA(n,{props:[fi(i,/:(plac\w+)/,":"+ps+"input-$1")]})),$2(vA(n,{props:[fi(i,/:(plac\w+)/,":"+R4+"$1")]})),$2(vA(n,{props:[fi(i,/:(plac\w+)/,da+"input-$1")]})),$2(vA(n,{props:[i]})),CU(n,{props:wte(t,r)});break}return""})}}var Md={},o_=typeof process<"u"&&Md!==void 0&&(Md.REACT_APP_SC_ATTR||Md.SC_ATTR)||"data-styled",PAe="active",LAe="data-styled-version",aP="6.3.12",Gq=`/*!sc*/ 5723`,P4=typeof window<"u"&&typeof document<"u",flt=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Md!==void 0&&Md.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Md.REACT_APP_SC_DISABLE_SPEEDY!==""?Md.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Md.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Md!==void 0&&Md.SC_DISABLE_SPEEDY!==void 0&&Md.SC_DISABLE_SPEEDY!==""&&Md.SC_DISABLE_SPEEDY!=="false"&&Md.SC_DISABLE_SPEEDY);function oP(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(n," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var U6=new Map,i8=new Map,B6=1,zS=function(n){if(U6.has(n))return U6.get(n);for(;i8.has(B6);)B6++;var e=B6++;return U6.set(n,e),i8.set(e,n),e},plt=function(n,e){B6=e+1,U6.set(n,e),i8.set(e,n)},qq=Object.freeze([]),l_=Object.freeze({});function mlt(n,e,t){return t===void 0&&(t=l_),n.theme!==t.theme&&n.theme||e||t.theme}var OAe=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]),glt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Alt=/(^-|-$)/g;function Tte(n){return n.replace(glt,"-").replace(Alt,"")}var xlt=/(a)(d)/gi,Ete=function(n){return String.fromCharCode(n+(n>25?39:97))};function MU(n){var e,t="";for(e=Math.abs(n);e>52;e=e/52|0)t=Ete(e%52)+t;return(Ete(e%52)+t).replace(xlt,"$1-$2")}var _O,rv=function(n,e){for(var t=e.length;t;)n=33*n^e.charCodeAt(--t);return n},DAe=function(n){return rv(5381,n)};function vlt(n){return MU(DAe(n)>>>0)}function ylt(n){return n.displayName||n.name||"Component"}function SO(n){return typeof n=="string"&&!0}var jAe=typeof Symbol=="function"&&Symbol.for,IAe=jAe?Symbol.for("react.memo"):60115,blt=jAe?Symbol.for("react.forward_ref"):60112,wlt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},_lt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},FAe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Slt=((_O={})[blt]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_O[IAe]=FAe,_O);function Cte(n){return("type"in(e=n)&&e.type.$$typeof)===IAe?FAe:"$$typeof"in n?Slt[n.$$typeof]:wlt;var e}var Tlt=Object.defineProperty,Elt=Object.getOwnPropertyNames,Nte=Object.getOwnPropertySymbols,Clt=Object.getOwnPropertyDescriptor,Nlt=Object.getPrototypeOf,Mte=Object.prototype;function UAe(n,e,t){if(typeof e!="string"){if(Mte){var r=Nlt(e);r&&r!==Mte&&UAe(n,r,t)}var i=Elt(e);Nte&&(i=i.concat(Nte(e)));for(var s=Cte(n),a=Cte(e),o=0;o<i.length;++o){var l=i[o];if(!(l in _lt||t&&t[l]||a&&l in a||s&&l in s)){var u=Clt(e,l);try{Tlt(n,l,u)}catch{}}}}return n}function c_(n){return typeof n=="function"}function $q(n){return typeof n=="object"&&"styledComponentId"in n}function vv(n,e){return n&&e?"".concat(n," ").concat(e):n||e||""}function kte(n,e){return n.join("")}function W5(n){return n!==null&&typeof n=="object"&&n.constructor.name===Object.name&&!("props"in n&&n.$$typeof)}function kU(n,e,t){if(t===void 0&&(t=!1),!t&&!W5(n)&&!Array.isArray(n))return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)n[r]=kU(n[r],e[r]);else if(W5(e))for(var r in e)n[r]=kU(n[r],e[r]);return n}function BAe(n,e){Object.defineProperty(n,"toString",{value:e})}var Mlt=(function(){function n(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}return n.prototype.indexOfGroup=function(e){if(e===this._cGroup)return this._cIndex;var t=this._cIndex;if(e>this._cGroup)for(var r=this._cGroup;r<e;r++)t+=this.groupSizes[r];else for(r=this._cGroup-1;r>=e;r--)t-=this.groupSizes[r];return this._cGroup=e,this._cIndex=t,t},n.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,s=i;e>=s;)if((s<<=1)<0)throw oP(16,"".concat(e));this.groupSizes=new Uint32Array(s),this.groupSizes.set(r),this.length=s;for(var a=i;a<s;a++)this.groupSizes[a]=0}for(var o=this.indexOfGroup(e+1),l=0,u=(a=0,t.length);a<u;a++)this.tag.insertRule(o,t[a])&&(this.groupSizes[e]++,o++,l++);l>0&&this._cGroup>e&&(this._cIndex+=l)},n.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),i=r+t;this.groupSizes[e]=0;for(var s=r;s<i;s++)this.tag.deleteRule(r);t>0&&this._cGroup>e&&(this._cIndex-=t)}},n.prototype.getGroup=function(e){var t="";if(e>=this.length||this.groupSizes[e]===0)return t;for(var r=this.groupSizes[e],i=this.indexOfGroup(e),s=i+r,a=i;a<s;a++)t+=this.tag.getRule(a)+Gq;return t},n})(),klt="style[".concat(o_,"][").concat(LAe,'="').concat(aP,'"]'),Rlt=new RegExp("^".concat(o_,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Rte=function(n){return typeof ShadowRoot<"u"&&n instanceof ShadowRoot||"host"in n&&n.nodeType===11},RU=function(n){if(!n)return document;if(Rte(n))return n;if("getRootNode"in n){var e=n.getRootNode();if(Rte(e))return e}return document},Plt=function(n,e,t){for(var r,i=t.split(","),s=0,a=i.length;s<a;s++)(r=i[s])&&n.registerName(e,r)},Llt=function(n,e){for(var t,r=((t=e.textContent)!==null&&t!==void 0?t:"").split(Gq),i=[],s=0,a=r.length;s<a;s++){var o=r[s].trim();if(o){var l=o.match(Rlt);if(l){var u=0|parseInt(l[1],10),d=l[2];u!==0&&(plt(d,u),Plt(n,d,l[3]),n.getTag().insertRules(u,i)),i.length=0}else i.push(o)}}},TO=function(n){for(var e=RU(n.options.target).querySelectorAll(klt),t=0,r=e.length;t<r;t++){var i=e[t];i&&i.getAttribute(o_)!==PAe&&(Llt(n,i),i.parentNode&&i.parentNode.removeChild(i))}};function Olt(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var VAe=function(n){var e=document.head,t=n||e,r=document.createElement("style"),i=(function(o){var l=Array.from(o.querySelectorAll("style[".concat(o_,"]")));return l[l.length-1]})(t),s=i!==void 0?i.nextSibling:null;r.setAttribute(o_,PAe),r.setAttribute(LAe,aP);var a=Olt();
5723return a&&r.setAttribute("nonce",a),t.insertBefore(r,s),r},Dlt=(function(){function n(e){this.element=VAe(e),this.element.appendChild(document.createTextNode("")),this.sheet=(function(t){var r;if(t.sheet)return t.sheet;for(var i=(r=t.getRootNode().styleSheets)!==null&&r!==void 0?r:document.styleSheets,s=0,a=i.length;s<a;s++){var o=i[s];if(o.ownerNode===t)return o}throw oP(17)})(this.element),this.length=0}return n.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}},n.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},n.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},n})(),jlt=(function(){function n(e){this.element=VAe(e),this.nodes=this.element.childNodes,this.length=0}return n.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1},n.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},n.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},n})(),Ilt=(function(){function n(e){this.rules=[],this.length=0}return n.prototype.insertRule=function(e,t){return e<=this.length&&(e===this.length?this.rules.push(t):this.rules.splice(e,0,t),this.length++,!0)},n.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},n.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},n})(),Pte=P4,Flt={isServer:!P4,useCSSOMInjection:!flt},zAe=(function(){function n(e,t,r){e===void 0&&(e=l_),t===void 0&&(t={});var i=this;this.options=qu(qu({},Flt),e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&P4&&Pte&&(Pte=!1,TO(this)),BAe(this,function(){return(function(s){for(var a=s.getTag(),o=a.length,l="",u=function(h){var f=(function(b){return i8.get(b)})(h);if(f===void 0)return"continue";var p=s.names.get(f);if(p===void 0||!p.size)return"continue";var g=a.getGroup(h);if(g.length===0)return"continue";var A=o_+".g"+h+'[id="'+f+'"]',x="";p.forEach(function(b){b.length>0&&(x+=b+",")}),l+=g+A+'{content:"'+x+'"}'+Gq},d=0;d<o;d++)u(d);return l})(i)})}return n.registerId=function(e){return zS(e)},n.prototype.rehydrate=function(){!this.server&&P4&&TO(this)},n.prototype.reconstructWithOptions=function(e,t){t===void 0&&(t=!0);var r=new n(qu(qu({},this.options),e),this.gs,t&&this.names||void 0);return!this.server&&P4&&e.target!==this.options.target&&RU(this.options.target)!==RU(e.target)&&TO(r),r},n.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},n.prototype.getTag=function(){return this.tag||(this.tag=(e=(function(t){var r=t.useCSSOMInjection,i=t.target;return t.isServer?new Ilt(i):r?new Dlt(i):new jlt(i)})(this.options),new Mlt(e)));var e},n.prototype.hasNameForId=function(e,t){var r,i;return(i=(r=this.names.get(e))===null||r===void 0?void 0:r.has(t))!==null&&i!==void 0&&i},n.prototype.registerName=function(e,t){zS(e);var r=this.names.get(e);r?r.add(t):this.names.set(e,new Set([t]))},n.prototype.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(zS(e),r)},n.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},n.prototype.clearRules=function(e){this.getTag().clearGroup(zS(e)),this.clearNames(e)},n.prototype.clearTag=function(){this.tag=void 0},n})();function Ult(n,e){return e==null||typeof e=="boolean"||e===""?"":typeof e!="number"||e===0||n in SAe||n.startsWith("--")?String(e).trim():"".concat(e,"px")}var Blt=function(n){return n>="A"&&n<="Z"};function Lte(n){for(var e="",t=0;t<n.length;t++){var r=n[t];if(t===1&&r==="-"&&n[0]==="-")return n;Blt(r)?e+="-"+r.toLowerCase():e+=r}return e.startsWith("ms-")?"-"+e:e}var Vlt=Symbol.for("sc-keyframes");function zlt(n){return typeof n=="object"&&n!==null&&Vlt in n}var GAe=function(n){return n==null||n===!1||n===""},qAe=function(n){var e=[];for(var t in n){var r=n[t];n.hasOwnProperty(t)&&!GAe(r)&&(Array.isArray(r)&&r.isCss||c_(r)?e.push("".concat(Lte(t),":"),r,";
5723"):W5(r)?e.push.apply(e,n8(n8(["".concat(t," {")],qAe(r),!1),["}"],!1)):e.push("".concat(Lte(t),": ").concat(Ult(t,r),";")))}return e};function qv(n,e,t,r,i){if(i===void 0&&(i=[]),typeof n=="string")return n&&i.push(n),i;if(GAe(n))return i;if($q(n))return i.push(".".concat(n.styledComponentId)),i;if(c_(n)){if(!c_(a=n)||a.prototype&&a.prototype.isReactComponent||!e)return i.push(n),i;var s=n(e);return qv(s,e,t,r,i)}var a;if(zlt(n))return t?(n.inject(t,r),i.push(n.getName(r))):i.push(n),i;if(W5(n)){for(var o=qAe(n),l=0;l<o.length;l++)i.push(o[l]);return i}if(!Array.isArray(n))return i.push(n.toString()),i;for(l=0;l<n.length;l++)qv(n[l],e,t,r,i);return i}function Glt(n){for(var e=0;e<n.length;e+=1){var t=n[e];if(c_(t)&&!$q(t))return!1}return!0}var qlt=DAe(aP),$lt=(function(){function n(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&Glt(e),this.componentId=t,this.baseHash=rv(qlt,t),this.baseStyle=r,zAe.registerId(t)}return n.prototype.generateAndInjectStyles=function(e,t,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,r).className:"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))i=vv(i,this.staticRulesId);else{var s=kte(qv(this.rules,e,t,r)),a=MU(rv(this.baseHash,s)>>>0);if(!t.hasNameForId(this.componentId,a)){var o=r(s,".".concat(a),void 0,this.componentId);t.insertRules(this.componentId,a,o)}i=vv(i,a),this.staticRulesId=a}else{for(var l=rv(this.baseHash,r.hash),u="",d=0;d<this.rules.length;d++){var h=this.rules[d];if(typeof h=="string")u+=h;else if(h){var f=kte(qv(h,e,t,r));l=rv(rv(l,String(d)),f),u+=f}}if(u){var p=MU(l>>>0);if(!t.hasNameForId(this.componentId,p)){var g=r(u,".".concat(p),void 0,this.componentId);t.insertRules(this.componentId,p,g)}i=vv(i,p)}}return{className:i,css:typeof window>"u"?t.getTag().getGroup(zS(this.componentId)):""}},n})(),Hlt=/&/g,Em=47,iv=42;function Ote(n){if(n.indexOf("}")===-1)return!1;for(var e=n.length,t=0,r=0,i=!1,s=0;s<e;s++){var a=n.charCodeAt(s);if(r!==0||i||a!==Em||n.charCodeAt(s+1)!==iv)if(i)a===iv&&n.charCodeAt(s+1)===Em&&(i=!1,s++);else if(a!==34&&a!==39||s!==0&&n.charCodeAt(s-1)===92){if(r===0){if(a===123)t++;else if(a===125&&--t<0)return!0}}else r===0?r=a:r===a&&(r=0);else i=!0,s++}return t!==0||r!==0}function $Ae(n,e){return n.map(function(t){return t.type==="rule"&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map(function(r){return"".concat(e," ").concat(r)})),Array.isArray(t.children)&&t.type!=="@keyframes"&&(t.children=$Ae(t.children,e)),t})}function Wlt(n){var e,t,r,i=l_,s=i.options,a=s===void 0?l_:s,o=i.plugins,l=o===void 0?qq:o,u=function(g,A,x){return x.startsWith(t)&&x.endsWith(t)&&x.replaceAll(t,"").length>0?".".concat(e):g},d=l.slice();d.push(function(g){g.type===nP&&g.value.includes("&")&&(r||(r=new RegExp("\\".concat(t,"\\b"),"g")),g.props[0]=g.props[0].replace(Hlt,t).replace(r,u))}),a.prefix&&d.push(hlt),d.push(clt);var h=[],f=ult(d.concat(dlt(function(g){return h.push(g)}))),p=function(g,A,x,b){A===void 0&&(A=""),x===void 0&&(x=""),b===void 0&&(b="&"),e=b,t=A,r=void 0;var _=(function(T){if(!Ote(T))return T;for(var L=T.length,D="",P=0,O=0,F=0,U=!1,B=0;B<L;B++){var z=T.charCodeAt(B);if(F!==0||U||z!==Em||T.charCodeAt(B+1)!==iv)if(U)z===iv&&T.charCodeAt(B+1)===Em&&(U=!1,B++);else if(z!==34&&z!==39||B!==0&&T.charCodeAt(B-1)===92){if(F===0)if(z===123)O++;else if(z===125){if(--O<0){for(var H=B+1;H<L;){var X=T.charCodeAt(H);if(X===59||X===10)break;H++}H<L&&T.charCodeAt(H)===59&&H++,O=0,B=H-1,P=H;continue}O===0&&(D+=T.substring(P,B+1),P=B+1)}else z===59&&O===0&&(D+=T.substring(P,B+1),P=B+1)}else F===0?F=z:F===z&&(F=0);else U=!0,B++}if(P<L){var W=T.substring(P);Ote(W)||(D+=W)}return D})((function(T){if(T.indexOf("//")===-1)return T;for(var L=T.length,D=[],P=0,O=0,F=0,U=0;O<L;){var B=T.charCodeAt(O);if(B!==34&&B!==39||O!==0&&T.charCodeAt(O-1)===92)if(F===0)if(B===Em&&O+1<L&&T.charCodeAt(O+1)===iv){for(O+=2;O+1<L&&(T.charCodeAt(O)!==iv||T.charCodeAt(O+1)!==Em);)O++;O+=2}else if(B===40&&O>=3&&(32|T.charCodeAt(O-1))==108&&(32|T.charCodeAt(O-2))==114&&(32|T.charCodeAt(O-3))==117)U=1,O++;else if(U>0)B===41?U--:B===40&&U++,O++;else if(B===iv&&O+1<L&&T.charCodeAt(O+1)===Em)O>P&&D.push(T.substring(P,O)),P=O+=2;else if(B===Em&&O+1<L&&T.charCodeAt(O+1)===Em){for(O>P&&D.push(T.substring(P,O));O<L&&T.charCodeAt(O)!==10;)O++;P=O}else O++;else O++;else F===0?F=B:F===B&&(F=0),O++}return P===0?T:(P<L&&D.push(T.substring(P)),D.join(""))})(g)),M=olt(x||A?"".concat(x," ").concat(A," { ").concat(_," }"):_);return a.namespace&&(M=$Ae(M,a.namespace)),h=[],r8(M,f),h};return p.hash=l.length?l.reduce(function(g,A){return A.name||oP(15),rv(g,A.name)},5381).toString():"",p}var Xlt=new zAe,Ylt=Wlt(),HAe=jn.createContext({shouldForwardProp:void 0,styleSheet:Xlt,stylis:Ylt});HAe.Consumer;jn.createContext(void 0);function Dte(){return jn.useContext(HAe)}var WAe=jn.createContext(void 0);WAe.Consumer;var EO={};function Qlt(n,e,t){var r=$q(n),i=n,s=!SO(n),a=e.attrs,o=a===void 0?qq:a,l=e.componentId,u=l===void 0?(function(T,L){var D=typeof T!="string"?"sc":Tte(T);EO[D]=(EO[D]||0)+1;var P="".concat(D,"-").concat(vlt(aP+D+EO[D]));return L?"".concat(L,"-").concat(P):P})(e.displayName,e.parentComponentId):l,d=e.displayName,h=d===void 0?(function(T){return SO(T)?"styled.".concat(T):"Styled(".concat(ylt(T),")")}
5723)(n):d,f=e.displayName&&e.componentId?"".concat(Tte(e.displayName),"-").concat(e.componentId):e.componentId||u,p=r&&i.attrs?i.attrs.concat(o).filter(Boolean):o,g=e.shouldForwardProp;if(r&&i.shouldForwardProp){var A=i.shouldForwardProp;if(e.shouldForwardProp){var x=e.shouldForwardProp;g=function(T,L){return A(T,L)&&x(T,L)}}else g=A}var b=new $lt(t,f,r?i.componentStyle:void 0);function _(T,L){return(function(D,P,O){var F=D.attrs,U=D.componentStyle,B=D.defaultProps,z=D.foldedComponentIds,H=D.styledComponentId,X=D.target,W=jn.useContext(WAe),J=Dte(),ee=D.shouldForwardProp||J.shouldForwardProp,ae=mlt(P,W,B)||l_,le=(function(te,ve,we){for(var Ue,ze=qu(qu({},ve),{className:void 0,theme:we}),yt=0;yt<te.length;yt+=1){var mt=c_(Ue=te[yt])?Ue(ze):Ue;for(var bt in mt)bt==="className"?ze.className=vv(ze.className,mt[bt]):bt==="style"?ze.style=qu(qu({},ze.style),mt[bt]):bt in ve&&ve[bt]===void 0||(ze[bt]=mt[bt])}return"className"in ve&&typeof ve.className=="string"&&(ze.className=vv(ze.className,ve.className)),ze})(F,P,ae),Z=le.as||X,Y={};for(var re in le)le[re]===void 0||re[0]==="$"||re==="as"||re==="theme"&&le.theme===ae||(re==="forwardedAs"?Y.as=le.forwardedAs:ee&&!ee(re,Z)||(Y[re]=le[re]));var _e=(function(te,ve){var we=Dte(),Ue=te.generateAndInjectStyles(ve,we.styleSheet,we.stylis);return Ue})(U,le),Ee=_e.className,Ae=vv(z,H);return Ee&&(Ae+=" "+Ee),le.className&&(Ae+=" "+le.className),Y[SO(Z)&&!OAe.has(Z)?"class":"className"]=Ae,O&&(Y.ref=O),G.createElement(Z,Y)})(M,T,L)}_.displayName=h;var M=jn.forwardRef(_);return M.attrs=p,M.componentStyle=b,M.displayName=h,M.shouldForwardProp=g,M.foldedComponentIds=r?vv(i.foldedComponentIds,i.styledComponentId):"",M.styledComponentId=f,M.target=r?i.target:n,Object.defineProperty(M,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(T){this._foldedDefaultProps=r?(function(L){for(var D=[],P=1;P<arguments.length;P++)D[P-1]=arguments[P];for(var O=0,F=D;O<F.length;O++)kU(L,F[O],!0);return L})({},i.defaultProps,T):T}}),BAe(M,function(){return".".concat(M.styledComponentId)}),s&&UAe(M,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),M}function jte(n,e){for(var t=[n[0]],r=0,i=e.length;r<i;r+=1)t.push(e[r],n[r+1]);return t}var Ite=function(n){return Object.assign(n,{isCss:!0})};function Klt(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(c_(n)||W5(n))return Ite(qv(jte(qq,n8([n],e,!0))));var r=n;return e.length===0&&r.length===1&&typeof r[0]=="string"?qv(r):Ite(qv(jte(r,e)))}function PU(n,e,t){if(t===void 0&&(t=l_),!e)throw oP(1,e);var r=function(i){for(var s=[],a=1;a<arguments.length;a++)s[a-1]=arguments[a];return n(e,t,Klt.apply(void 0,n8([i],s,!1)))};return r.attrs=function(i){return PU(n,e,qu(qu({},t),{attrs:Array.prototype.concat(t.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return PU(n,e,qu(qu({},t),i))},r}var XAe=function(n){return PU(Qlt,n)},rx=XAe;OAe.forEach(function(n){rx[n]=XAe(n)});const Zlt=rx.div` 5724 position: fixed; 5725 top: 50%; 5726 left: 50%; 5727 transform: translate(-50%, -50%); 5728 z-index: 700; 5729 width: 100%; 5730 padding: 0 5px; 5731 box-sizing: border-box; 5732 outline: 0; 5733 5734 @media (min-width: 768px) { 5735 width: inherit; 5736 padding: 0; 5737 } 5738`,Jlt=rx.div` 5739 position: fixed; 5740 width: 100%; 5741 height: 100%; 5742 top: 0; 5743 left: 0; 5744 background: rgba(0, 0, 0, 0.3); 5745 z-index: 500; 5746`,ect=rx.div` 5747 z-index: 100; 5748 background: #ffffff82; 5749 position: relative; 5750 margin: auto; 5751 border-radius: 8px; 5752`,tct=rx.div` 5753 border-radius: 8px 8px 0 0; 5754 display: flex; 5755 justify-content: space-between; 5756 padding: 0rem; 5757`,nct=rx.div` 5758 color: #fff; 5759 align-self: center; 5760 color: lightgray; 5761`,rct=rx.button` 5762 font-size: 0.8rem; 5763 border: none; 5764 border-radius: 3px; 5765 font-size: 3em; 5766 margin-right: 1.2rem; 5767 margin-top: -20px; 5768 margin-bottom: 10px; 5769 background: none; 5770 :hover { 5771 cursor: pointer; 5772 } 5773`,ict=rx.div` 5774 padding: 0px 10px 20px 10px; 5775 margin-top: -60px; 5776 max-height: 90vh; 5777 5778 @media (min-width: 768px) { 5779 max-height: 30rem; 5780 } 5781 overflow-x: hidden; 5782 overflow-y: auto; 5783`,sct=({isShown:n,hide:e,modalContent:t,headerText:r})=>{const i=c.jsxs(jn.Fragment,{children:[c.jsx(Jlt,{}),c.jsx(Zlt,{children:c.jsxs(ect,{children:[c.jsxs(tct,{children:[c.jsx(nct,{children:r}),c.jsx(rct,{onClick:e,children:"Ã"})]}),c.jsx(ict,{children:t})]})})]});return n?Vl.createPortal(i,document.body):null};class act{constructor(){rr(this,"listeners",new Set);rr(this,"reconnectAttempts",0);rr(this,"maxReconnectAttempts",10);rr(this,"reconnectDelay",2e3);rr(this,"isConnecting",!1);rr(this,"abortController",null);rr(this,"connectionStatus","disconnected");console.log("[WebExecutionUpdates] Service created (fetch-based SSE)")}getApiUrl(){return`${Zi.apiUrl}/api/ai-app/execution-updates`}async connect(){if(!(this.isConnecting||this.abortController)){this.isConnecting=!0,this.connectionStatus="connecting";try{const e=Xse();if(!e){console.warn("[WebExecutionUpdates] No session ID â user not authenticated, skipping SSE"),this.isConnecting=!1,this.connectionStatus="disconnected";return}const t=this.getApiUrl();console.log("[WebExecutionUpdates] Connecting to SSE (fetch):",t),this.abortController=new AbortController;const r=await fetch(t,{method:"GET",headers:{Authorization:`Bearer ${e}`,Accept:"text/event-stream","Cache-Control":"no-cache"},signal:this.abortController.signal});if(!r.ok)throw new Error(`SSE connection failed: ${r.status} ${r.statusText}`);if(!r.body)throw new Error("SSE response body is null");console.log("[WebExecutionUpdates] Connected successfully"),this.reconnectAttempts=0,this.isConnecting=!1,this.connectionStatus="connected";const i=r.body.getReader(),s=new TextDecoder;let a="";for(;;){const{done:o,value:l}=await i.read();if(o){console.log("[WebExecutionUpdates] Stream ended");break}a+=s.decode(l,{stream:!0});const u=a.split(` 5784`);a=u.pop()??"";for(const d of u)if(d.startsWith("data: ")){const h=d.slice(6).trim();if(!h)continue;try{const f=JSON.parse(h);console.log("[WebExecutionUpdates] Received:",f.type,f.executionId),f.type!=="keepalive"&&this.listeners.forEac
5784h(p=>{try{p(f)}catch(g){console.error("[WebExecutionUpdates] Listener error:",g)}})}catch(f){console.error("[WebExecutionUpdates] Parse error:",f,"raw:",h)}}}this.abortController=null,this.connectionStatus="disconnected",this.scheduleReconnect()}catch(e){if((e==null?void 0:e.name)==="AbortError"){console.log("[WebExecutionUpdates] Connection aborted (disconnect called)");return}console.error("[WebExecutionUpdates] Connection error:",e==null?void 0:e.message),this.abortController=null,this.isConnecting=!1,this.connectionStatus="disconnected",this.scheduleReconnect()}}}scheduleReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts){console.log("[WebExecutionUpdates] Max reconnection attempts reached");return}const e=Math.min(this.reconnectDelay*Math.pow(1.5,this.reconnectAttempts),3e4);this.reconnectAttempts++,console.log(`[WebExecutionUpdates] Reconnecting in ${Math.round(e/1e3)}s (attempt ${this.reconnectAttempts})`),setTimeout(()=>this.connect(),e)}addListener(e){this.listeners.add(e)}removeListener(e){this.listeners.delete(e)}disconnect(){var e;console.log("[WebExecutionUpdates] Disconnecting..."),(e=this.abortController)==null||e.abort(),this.abortController=null,this.listeners.clear(),this.reconnectAttempts=0,this.connectionStatus="disconnected"}getConnectionStatus(){return this.connectionStatus}}let CO=null;const NO=()=>(CO||(CO=new act),CO),oct=()=>{const[n,e]=jn.useState([]),[t,r]=jn.useState("disconnected");jn.useEffect(()=>{const l=NO(),u=h=>{h.type!=="keepalive"&&e(f=>[...f,h]),h.type==="connected"&&r("connected")};l.addListener(u);const d=setInterval(()=>{r(l.getConnectionStatus())},1e3);return()=>{l.removeListener(u),clearInterval(d)}},[]);const i=jn.useCallback(()=>e([]),[]),s=jn.useCallback(l=>{if(!l)return n[n.length-1];for(let u=n.length-1;u>=0;u--)if(n[u].executionId===l)return n[u];return null},[n]),a=jn.useCallback(()=>{NO().connect()},[]),o=jn.useCallback(()=>{NO().disconnect()},[]);return{updates:n,connectionStatus:t,clearUpdates:i,getLatestUpdate:s,connect:a,disconnect:o,isConnected:t==="connected"}},yv=async(n,e,t)=>{console.log(`ðµ [executeWorkflowWeb] Starting background workflow via Wasp action (retryExecutionId: ${e}, forceFresh: ${t})`),console.log("ðµ [executeWorkflowWeb] Workflow ID:",n==null?void 0:n.id),console.log("ðµ [executeWorkflowWeb] Workflow type:",n==null?void 0:n.type);const r=await e4e({workflow:n,retryExecutionId:e,forceFresh:t});return console.log("ðµ [executeWorkflowWeb] Started:",r),r},mA=(n,e=null)=>{if(!n)return e;let t;if(typeof n=="object")t=n;else try{t=JSON.parse(n)}catch{return e}return Array.isArray(t)?t:e},lct={"quick-tip":Le("Quick tip"),storytelling:Le("Storytelling"),"product-plug":Le("Product plug"),"behind-scenes":Le("Behind the scenes"),"vox-style":Le("Vox Style"),"app-demo":Le("App Demo"),"hook-tease":Le("Hook & tease"),"fast-facts":Le("Fast facts"),"mini-explainer":Le("Mini explainer"),"ai-voiceover-clips":Le("Cinematic AI voiceover"),"step-tutorial":Le("Step-by-step tutorial"),"podcast-discussion":Le("Podcast discussion"),"top-list":Le("Top 5 list"),"explainer-video":Le("Explainer video"),"brand-story":Le("Brand story"),"scripted-story":Le("Scripted story"),"tailored-ad-video":Le("Tailored ad"),ugc:Le("UGC video")};function cct(){var _u,as,gd,Su,Ad;const{data:n,isLoading:e,refetch:t,isRefetching:r}=Ma(),{t:i,locale:s}=Kr(),[a,o]=G.useState(!1),l=cl(VSe),u=cl(WSe),d=po(),h=ro(),[f,p]=G.useState(null),[g,A]=G.useState(""),[x,b]=G.useState(""),[_,M]=G.useState("text-image"),[T,L]=G.useState(""),[D,P]=G.useState(""),[O,F]=G.useState(""),[U,B]=G.useState(""),[z,H]=G.useState(!1),[X,W]=G.useState(""),[J,ee]=G.useState(""),[ae,le]=G.useState("software"),[Z,Y]=G.useState([]),[re,_e]=G.useState([{value:"facebook",label:"Facebook",color:"#1877F2"}]),[Ee,Ae]=G.useState(()=>{let de="";try{de=new URLSearchParams(window.location.search).get("url")||localStorage.getItem("spreadout:pendingStrategyUrl")||"",localStorage.removeItem("spreadout:pendingStrategyUrl")}catch{}return[{type:"url",url:de,file:null}]}),[te,ve]=G.useState([]),[we,Ue]=G.useState("ai-generated"),[ze,yt]=G.useState([]),[mt,bt]=G.useState(null),dt=de=>{if(!de)return"";const Be={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6}[de.toLowerCase()];if(Be===void 0)return de;const xt=new Date;return xt.setDate(xt.getDate()-xt.getDay()+Be),xt.toLocaleDateString(s,{weekday:"long"})},St=de=>{if(!de)return"";const[me,Be]=de.split(":");if(!me||!Be)return de;const xt=new Date;return xt.setHours(parseInt(me,10),parseInt(Be,10)),xt.toLocaleTimeString(s,{hour:"2-digit",minute:"2-digit"})},[kt,Fe]=G.useState([]),[Ze,Ye]=G.useState(!1),[ft,At]=G.useState(1),[Ce,Se]=G.useState("automated"),[qe,pt]=G.useState([]),[Te,oe]=G.useState(!1),[ge,Ne]=G.useState(null),[ke,Xe]=G.useState(!1),[et,Qe]=G.useState("site"),lt=jn.useRef(!1);G.useEffect(()=>{var de;if(!lt.current){lt.current=!0;return}(de=document.querySelector(".ws main"))==null||de.scrollTo({top:0,behavior:"smooth"})},[ft]);
5784const[tt,Ft]=G.useState(!1),[Mt,Nt]=G.useState(!1),[Je,fn]=G.useState(null),[Tn,nt]=G.useState([]),[Kt,Lt]=G.useState(!1),[cn,dn]=G.useState(!1),[Bt,Ht]=G.useState(!1),[qt,Fn]=G.useState(null),[xe,Oe]=G.useState(!1),[Ge,$e]=G.useState([]),[m,be]=G.useState(null),[en,on]=G.useState(jot),[tn,Qt]=G.useState(""),[Pt,bn]=G.useState([]),[wn,zn]=G.useState(!1),[Un,_n]=G.useState(null),[xr,Ir]=G.useState(null),[is,si]=G.useState(!1),[vr,Yi]=G.useState([]),[Vi,Pe]=G.useState(null),[He,ce]=G.useState(!1),[at,vt]=G.useState(null),[vn,Rn]=G.useState(null),[ln,kn]=G.useState(!1),[pe,Nr]=G.useState(null),[zr,sr]=G.useState(!1),[Ai,Oi]=G.useState(!1),[ss,qi]=G.useState(!1),[aa,Gn]=G.useState(!1),[ks,yr]=G.useState(!0),[vl,Yo]=G.useState(!0),[ai,Rc]=G.useState(!1),[Qi,Rs]=G.useState(!1);G.useEffect(()=>{if(_==="text-image")wu(!1),af(!1),jc(!1),Hl(30);else if(_==="video"){wu(!0),af(!0);const de=T==="vox-style"||T==="app-demo";jc(!de),oh(!de),Wl(!0),Hl(30),T||L("product-plug")}else if(_==="long-video"){wu(!0),af(!0);const de=T==="vox-style"||T==="app-demo";jc(!de),oh(!de),Wl(!0),Hl(60),T||L("product-plug")}},[_]);const[vu,Xn]=G.useState({show:!1,step:"",progress:0}),[$i,yl]=G.useState(null),[ah,Pc]=G.useState({show:!1,progress:0,startTime:0,elapsedTime:0}),{updates:pi,getLatestUpdate:yu,connect:tf,disconnect:dp}=oct();G.useEffect(()=>(tf(),()=>dp()),[tf,dp]);const[Qo,oh]=G.useState(!1),[ql,lh]=G.useState("ai-generated"),[oa,ix]=G.useState(null),[id,bg]=G.useState(null),[Dy,nf]=G.useState(null),[sd,rf]=G.useState(""),[sx,U_]=G.useState(!1),[Lo,hp]=G.useState({speakerCount:2,speakers:[{name:"Host",gender:"female",voiceId:"af_heart",stylePrompt:"warm, professional, curious"},{name:"Guest",gender:"male",voiceId:"am_michael",stylePrompt:"knowledgeable, conversational, enthusiastic"}],topic:"",language:"English",duration:t8}),[wg,_g]=G.useState(),[jy,ad]=G.useState(!1),{data:z0,refetch:G0}=Qr(hM,{includeUnscheduled:!0},{enabled:!1}),{data:q0,refetch:ax}=Qr(R4e,{workflowId:f||""},{enabled:!!f}),[od,$0]=G.useState(null),[Oo,fp]=G.useState(!1),[pp,ld]=G.useState(!1),[H0,W0]=G.useState([]),[ox,ch]=G.useState(!1),[Ko,X0]=G.useState(null),[Do,Lc]=G.useState("free-samples"),[$l,uh]=G.useState(1),[Y0,Q0]=G.useState(!0),[Iy,B_]=G.useState(!1),[V_,K0]=G.useState(""),[Fy,Sg]=G.useState(!0),[Tg,mp]=G.useState(!0),[Er,Hl]=G.useState(30),[Oc,cd]=G.useState("free-samples"),[bu,Dc]=G.useState("English"),[sf,af]=G.useState(!0),[xa,wu]=G.useState(!1),[Ao,Eg]=G.useState("Female"),[ud,gp]=G.useState("Default"),[Ni,jc]=G.useState(!1),[Ic,Wl]=G.useState(!1),[ea,Xl]=G.useState([]),[ta,of]=G.useState(null),[YT,Uy]=G.useState(new Date().toLocaleDateString("en",{weekday:"long"}).toLowerCase()),[Ap,xp]=G.useState(null),[dd,lf]=G.useState(!1),[lx,dh]=G.useState(!0);G.useEffect(()=>{const de=()=>{dh(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",de),()=>document.removeEventListener("visibilitychange",de)},[]);const[bl,vp]=G.useState(!1),[Zo,yp]=G.useState(""),Z0=de=>{const me=de.toLowerCase()==="male"?"professional young man":"professional young woman",Be=de.toLowerCase()==="male"?"well-groomed short hair":"styled shoulder-length hair";return`Professional half-body portrait of a ${me} content creator, 25-30 years old, photorealistic human face and upper body, natural human skin texture with subtle pores and skin details, ${Be} with realistic strands and texture, warm friendly smile, looking directly at camera with engaging eye contact, natural hand gesture near chest or gesturing naturally, wearing casual modern clothing suitable for content creation, soft professional lighting, clean modern background, shot with professional camera showing head shoulders and upper torso, high resolution, ultra realistic, human anatomy, natural expressions and body language, commercial photography style, suitable for video testimonials and social media content, natural arm positioning and hand gestures. High quality, 8k, cinematic lighting.`};G.useEffect(()=>{const de=Z0("Male"),me=Z0("Female");(!Zo||Zo===de||Zo===me)&&yp(Z0(Ao))},[Ao]);const{data:Di}=Qr(P8),{data:Cg}
5784=Qr(Rae),cx=!!(Cg!=null&&Cg.mediaActive),[ux,QT]=G.useState(),{data:Yl,isLoading:KT}=Qr(Tae,{userId:n==null?void 0:n.id}),Fc={facebook:10,twitter:4,linkedin:20,threads:20,reddit:1,instagram:10},cf=re.length>0?Math.min(...re.map(de=>Fc[de.value]||10)):10;G.useEffect(()=>{$l>cf&&uh(cf)},[re,cf]),G.useEffect(()=>{if(Di&&Di.length>0){const de=Di.map(me=>{let Be=(me.provider||"").toLowerCase();return Be==="x.com"||Be==="twitter"?"twitter":Be});_e(me=>{const Be=me.filter(xt=>{let Ct=(xt.value||"").toLowerCase();return(Ct==="x.com"||Ct==="twitter")&&(Ct="twitter"),Ct==="instagram-reels"&&(Ct="instagram"),Ct==="facebook-reels"&&(Ct="facebook"),Ct==="youtube-shorts"&&(Ct="youtube"),de.includes(Ct)});return Be.length>0?Be:Di.map(xt=>{let Ct=(xt.provider||"").toLowerCase();(Ct==="x.com"||Ct==="twitter")&&(Ct="twitter");const zt={facebook:{label:"Facebook",color:"#1877F2"},instagram:{label:"Instagram",color:"#E4405F"},twitter:{label:"X.com",color:"#000000"},tiktok:{label:"TikTok",color:"#000000"},youtube:{label:"YouTube",color:"#FF0000"},linkedin:{label:"LinkedIn",color:"#0A66C2"}}[Ct]||{label:xt.provider,color:"#6366F1"};return{value:Ct,label:zt.label,color:zt.color}})})}},[Di]);const[uf,dx]=G.useState(!1),By=[{id:"realistic",title:"Realistic / Digital Twin",description:"The Founder-Style Digital Twin",prompt:"A hyper-realistic vertical iPhone selfie video of a charismatic startup founder avatar speaking naturally to the camera in a modern minimalist office with large architectural windows and reflective matte surfaces. The avatar looks nearly indistinguishable from a real human, featuring expressive eyes with authentic ring-light reflections, subtle facial asymmetry, imperfect teeth, realistic skin pores, faint under-eye texture, natural smile lines, and slightly uneven facial movement. He wears a premium fitted black t-shirt, lightweight smart glasses with holographic UI reflections, and a subtle luxury smartwatch. Soft daylight mixes with monitor glow and warm ambient desk lighting, creating layered cinematic contrast across the face. The creator casually explains a futuristic productivity app while gesturing naturally toward floating holographic interface elements beside him. Slight handheld selfie shake, rolling shutter artifacts, autofocus breathing, realistic exposure inconsistencies, subtle flyaway hairs, fabric wrinkles, natural body posture shifts, micro-motion blur from hand gestures, cinematic depth of field, soft bloom, gentle lens flare, shallow focus, atmospheric realism, authentic TikTok creator energy, RAW smartphone aesthetic, photorealistic rendering, vertical 9:16 composition."},{id:"virtual_influencer",title:"Virtual Influencer",description:"The Fashion-Tech Virtual Influencer",prompt:"A stylish CGI virtual influencer filming a mirror selfie inside a luxury futuristic penthouse dressing room overlooking a neon city skyline at night. She has a signature platinum-lavender bob haircut with glossy strands and slight flyaway hairs, luminous skin with subtle shimmer highlights, oversized chrome earrings, glass-like nails, and a sleek monochrome designer outfit woven with holographic reactive fabric. Her makeup features metallic eyeliner, glossy lips, and soft blush gradients that catch the ambient lighting naturally. She confidently poses while casually talking to followers about a luxury fashion-tech collaboration. The environment features reflective marble surfaces, soft ambient LED strips, blurred skyline windows, floating digital displays, and designer decor elements. Ring-light reflections shimmer in her eyes while RGB accent lighting casts warm and cool tones across the scene. Realistic cloth folds, slight skin texture, cinematic depth of field, soft bloom, subtle grain, slight lens distortion, imperfect handheld framing, smartphone autofocus breathing, gentle motion blur, premium influencer aesthetic, social-media-native realism, cinematic luxury atmosphere, RAW smartphone capture, vertical 9:16 format."},{id:"brand_mascot",title:"AI Persona / Brand Mascot",description:"The Friendly AI Brand Companion",prompt:"A clean and approachable AI brand mascot avatar standing inside a bright futuristic customer experience hub filled with floating holographic interfaces and immersive architectural lighting. The avatar has smooth semi-realistic facial features, glowing soft-blue eyes with realistic reflections, a warm welcoming smile, subtle facial asymmetry, and animated light patterns flowing beneath translucent synthetic skin. Wearing a modern branded jacket with minimalist logo accents and adaptive smart fabrics, the avatar gestures naturally while introducing a new digital service directly to the camera. The environment c
5784ontains floating UI panels, interactive display walls, reflective flooring, soft volumetric lighting, and calming futuristic design language. Natural conversational posture, subtle hand motion blur, slight smartphone camera shake, authentic eye movement, realistic exposure fluctuations, shallow depth of field, soft bloom, cinematic lens softness, detailed skin texture, gentle flyaway hairs, photorealistic rendering, premium social-media commercial aesthetic, handheld creator realism, vertical 9:16 composition."},{id:"cyberpunk",title:"Futuristic Cyberpunk",description:"The Neon Alley Cyberpunk Creator",prompt:"A raw smartphone selfie video of a cyberpunk female avatar walking through a rain-soaked neon alley at night in a dense futuristic megacity. She has glowing magenta synthetic hair with subtle animated fiber-optic strands, biomechanical jawline implants, holographic tattoos running along her neck and collarbone, reflective chrome eyeliner, and luminous cybernetic contact lenses. Wearing a dark layered tactical techwear jacket with illuminated seams, utility straps, adaptive smart fabrics, and metallic detailing, she speaks directly to the camera while neon advertisements flicker behind her. Wet pavement reflections, drifting steam vents, holographic street signs, passing autonomous vehicles, and floating digital particles create cinematic environmental depth. Harsh neon lighting mixes cyan and magenta tones across her face while volumetric fog diffuses the background glow. Slight motion blur from walking, realistic rain particles on the camera lens, rolling shutter artifacts, autofocus breathing, imperfect handheld framing, subtle skin texture, realistic pores, fabric wrinkles, cinematic depth of field, atmospheric haze, gritty urban realism, RAW iPhone aesthetic, vertical 9:16 composition."},{id:"space_explorer",title:"Sci-Fi Space Explorer",description:"The Deep-Space Expedition Log",prompt:"A cinematic first-person vlog recording of a futuristic space explorer inside a sleek interstellar spacecraft observation deck orbiting a massive glowing planet. The avatar wears a minimalist matte-white adaptive spacesuit with illuminated interface seams, lightweight armored textures, and a transparent helmet visor displaying floating navigation graphics and biometric overlays. Their expression feels focused yet deeply human, with realistic skin texture, natural eye movement, subtle under-eye detail, and authentic breathing condensation visible through the visor. Massive planets, asteroid fields, and distant stars glow outside panoramic windows while faint nebula light reflects into the spacecraft interior. Soft blue spacecraft lighting mixes with warm reflections from control panels and holographic navigation systems. The explorer casually documents a mission update while adjusting floating holographic controls. Subtle zero-gravity hair movement, drifting dust particles, volumetric lighting, lens softness near edges, cinematic depth of field, slight exposure fluctuations, realistic suit material folds, handheld astronaut vlog aesthetic, immersive sci-fi realism, RAW smartphone space-log aesthetic, vertical 9:16 format."},{id:"y2k",title:"Y2K Aesthetic",description:"The Hyper-Pop Y2K Creator",prompt:"A nostalgic Y2K-inspired selfie recording of a trendy female avatar inside a colorful bedroom studio packed with translucent tech gadgets, chrome furniture, retro desktop monitors, inflatable decor, and glowing early-internet visuals. She wears tinted pink sunglasses, metallic low-rise fashion, glossy lip makeup, chunky headphones around her neck, butterfly hair clips, rhinestone accessories, and shimmering silver jewelry layered across her outfit. Her flip-phone-inspired smartphone case is visible as she casually talks to the audience while applying holographic lip gloss and adjusting her hair in the mirror. Soft pastel LED lighting fills the room while old CRT monitors cast warm nostalgic glow patterns across the environment. Slight overexposure from direct flash lighting, grainy digital camera texture, subtle lens bloom, chromatic aberration, rolling shutter artifacts, imperfect framing, realistic skin texture, flyaway hairs, playful facial expressions, handheld realism, internet-core energy, RAW early-2000s digital camera aesthetic, cinematic Y2K atmosphere, vertical 9:16 aspect ratio."}
5784,{id:"techwear",title:"Techwear / Cyber Streetwear",description:"The Underground Techwear Vlogger",prompt:"A moody vertical smartphone vlog of a cyber-streetwear avatar walking through a futuristic subway station late at night beneath flickering holographic transit signs. The avatar wears layered black techwear with tactical straps, oversized cargo silhouettes, matte utility fabrics, chest rigs, modular pouches, adaptive smart textiles, and a sleek minimalist face mask partially covering the lower face. A hood shadows the eyes while subtle LED accents glow from the jacket seams and chest harness. The creator films themselves while discussing futuristic urban culture and underground digital communities. Ambient neon signs, wet concrete textures, train reflections, atmospheric fog, scrolling holographic displays, and drifting steam create cinematic environmental depth. Natural motion blur from walking, gritty handheld camera movement, realistic fabric folds, subtle rain residue on clothing, smartphone sharpening artifacts, rolling shutter imperfections, shallow focus, cinematic depth of field, volumetric lighting, RAW mobile video realism, authentic underground cyber aesthetic, vertical 9:16 framing."},{id:"cottagecore",title:"Cottagecore / Fantasy",description:"The Enchanted Forest Creator",prompt:"A dreamy handheld selfie video of a fantasy-inspired cottagecore avatar wandering through a magical forest garden during golden hour surrounded by wildflowers and glowing bioluminescent plants. She has long braided hair decorated with tiny flowers, ribbons, and drifting fairy dust particles that softly glow in the sunlight. Wearing a soft linen dress layered with embroidered floral details, mushroom-shaped accessories, delicate translucent fairy wings, and handcrafted jewelry, she gently speaks to the camera while gathering herbs from a rustic woven basket. Sunlight filters naturally through trees, creating warm haze, cinematic god rays, and soft highlights across the environment. Floating pollen particles drift through the air while subtle wind movement animates fabric, wings, and hair naturally. Authentic skin texture, soft blush tones, flyaway hairs, shallow depth of field, cinematic bloom, cozy magical realism, slightly imperfect handheld framing, atmospheric forest ambience, whimsical natural aesthetic, vertical smartphone UGC style, 9:16 aspect ratio."},{id:"surreal",title:"Abstract / Surreal",description:"The Dream-State Surreal Avatar",prompt:"A surreal vertical portrait recording of an abstract humanoid avatar existing inside a dream-like dimension of floating geometric structures, liquid light, and impossible shifting architecture. The avatarâs face partially fragments into reflective crystalline shapes while glowing colors slowly drip, reform, and pulse across translucent skin surfaces. One eye appears holographic while the other dissolves into floating particles and mirrored fragments. Their movements feel fluid, emotionally expressive, and gravity-defying as they speak directly to the viewer in slow cinematic motion. The environment continuously morphs with floating mirrors, volumetric fog, distorted staircases, bending light rays, and suspended objects orbiting through space. Ethereal lighting pulses between deep blue, crimson, gold, and ultraviolet tones while reflective surfaces shimmer unpredictably. Subtle VHS distortion, chromatic aberration, cinematic grain, rendering imperfections, dream-state blur, anamorphic lens flares, atmospheric haze, experimental art-film aesthetic, immersive surreal realism, vertical 9:16 composition."},{id:"pixel_art",title:"Pixel Art / Retro 3D",description:"The Retro Gaming Stream Avatar",prompt:"A vertical retro-inspired gaming vlog featuring a low-poly 3D avatar inside a nostalgic pixel-art arcade room glowing with colorful CRT monitor reflections. The character has exaggerated retro-game proportions, blocky geometric hair, voxel-style facial features, pixel-textured clothing, and glowing CRT-style highlights across the face. Wearing a colorful bomber jacket inspired by late-90s gam
5784ing culture layered over retro streetwear, the avatar enthusiastically speaks to the audience while holding a transparent handheld console with glowing pixel graphics. The environment contains voxel arcade machines, CRT monitors, floating pixel particles, retro posters, holographic scoreboards, and nostalgic gaming clutter. Lighting mimics classic arcade neon reflections with subtle bloom and scanline effects across the scene. Intentional low-resolution textures, compression artifacts, VHS noise, chromatic aberration, old-camera grain, playful handheld framing, cinematic retro-futuristic atmosphere, nostalgic internet gaming energy, stylized pixel realism, vertical 9:16 format."}],[Ng,Mg]=G.useState("cinematic"),[ZT,JT]=G.useState([{id:"cinematic",name:"Epic Cinematic",url:"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",category:"Cinematic"},{id:"upbeat",name:"Upbeat Corporate",url:"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3",category:"Corporate"},{id:"ambient",name:"Ambient Journey",url:"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-3.mp3",category:"Ambient"},{id:"lofi",name:"Lo-Fi Chill",url:"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-4.mp3",category:"Lofi"}]),[bp,hd]=G.useState(null),[Uc,kg]=G.useState(null),J0=de=>{kg(de.id),yp(de.prompt)};G.useEffect(()=>{try{const de=localStorage.getItem("spreadout_automatorOptions");if(de){const me=JSON.parse(de);console.log("DEBUG: Loading cached options from localStorage:",me),me.workflowType&&M(me.workflowType),me.workflowSubType&&L(me.workflowSubType),me.socialMedias&&_e(me.socialMedias),me.language&&Dc(me.language),me.enableViralHook!==void 0&&jc(me.enableViralHook),me.enableBackgroundMusic!==void 0&&Wl(me.enableBackgroundMusic),me.enableVoice!==void 0&&wu(me.enableVoice),me.voiceGender&&Eg(me.voiceGender),me.voiceType&&gp(me.voiceType),me.enableAvatar!==void 0&&oh(me.enableAvatar),me.enableCaptions!==void 0&&af(me.enableCaptions),me.avatarSource&&lh(me.avatarSource),me.selectedAvatarUrl&&me.avatarSource==="user-provided"&&bg(me.selectedAvatarUrl),me.selectedAvatarId&&of(me.selectedAvatarId),me.videoSourceOption&&cd(me.videoSourceOption),me.videoGenerationLimit&&Hl(me.videoGenerationLimit),me.imageGenerationOption&&Lc(me.imageGenerationOption),me.contentMode&&Ue(me.contentMode),me.selectedTemplateId&&kg(me.selectedTemplateId),me.avatarPrompt&&yp(me.avatarPrompt)}}catch(de){console.warn("Error loading cached options:",de)}finally{setTimeout(()=>dx(!0),100)}},[]),G.useEffect(()=>{if(uf)try{const de={workflowType:_,workflowSubType:T,contentMode:we,socialMedias:re,language:bu,enableViralHook:Ni,enableBackgroundMusic:Ic,selectedMusicMood:Ng,enableVoice:xa,voiceGender:Ao,voiceType:ud,enableAvatar:Qo,enableCaptions:sf,avatarSource:ql,selectedAvatarUrl:id,selectedAvatarId:ta,videoSourceOption:Oc,videoGenerationLimit:Er,imageGenerationOption:Do,selectedTemplateId:Uc,avatarPrompt:Zo};localStorage.setItem("spreadout_automatorOptions",JSON.stringify(de))}catch(de){console.warn("Error saving cached options:",de)}},[uf,_,T,we,re,bu,Ni,Ic,xa,Ao,ud,Qo,sf,ql,id,ta,Oc,Er,Do,Uc,Zo]),G.useEffect(()=>{const de=localStorage.getItem("spreadout_savedAvatars");if(de)try{let me=JSON.parse(de);const Be=Zi.apiUrl.replace(/\/$/,"");me=me.map(xt=>({...xt,url:xt.url.startsWith("/api/download/")?`${Be}${xt.url}`:xt.url})),Xl(me)}catch(me){console.error("Error parsing saved avatars:",me)}},[]),G.useEffect(()=>{ea.length>0&&localStorage.setItem("spreadout_savedAvatars",JSON.stringify(ea))},[ea]);const{data:Rg,isLoading:em}=Qr(k4e,{workflowId:(_u=Yl==null?void 0:Yl[0])==null?void 0:_u.id},{enabled:!!((as=Yl==null?void 0:Yl[0])!=null&&as.id)}),{data:zi,refetch:hh}=Qr(_B,{includeUnscheduled:!0},{enabled:ft===3||ft===2||Mt,refetchInterval:Bt||qe.some(de=>{var me,Be;return de.isGenerating||((me=de.execution)==null?void 0:me.status)==="processing"||((Be=de.execution)==null?void 0:Be.status)==="pending"})?5e3:!1});G.useEffect(()=>{ft===3&&f&&!pp&&(q0&&q0.length>0&&!od&&!Oo?(console.log("DEBUG: Pre-filling script from existing post"),$0(q0[0].text)):!od&&!Oo&&(console.log("DEBUG: No script found, generating preview..."),df()))},[ft,q0,f,od,Oo]);const df=async de=>{var me;if(!(!f||pp))try{ld(!0);const Be=await JSe({workflowId:f,selectedTopic:de||void 0,targetDuration:Er,productUrl:J?J.startsWith("http")?J:`https://${J}`:"",productName:D,productCategory:X,productDescription:O});if(!de&&Be.topics&&Be.topics.length>0){W0(Be.topics),ch(!0),gr.success(i("Multiple topics detected!")),ld(!1);return}if($0(Be.script),ch(!1),W0([]),X0(null),gr.success(i("AI Script generated for review!")),Ni)try{zn(!0);const xt=D?`${D} ${X||""}`:Be.script,Ct=await jX({keywords:xt,script:Be.script});if(((me=Ct==null?void 0:Ct.urls)==null?void 0:me.length)>
57840){const zt=Ct.urls.map((Wt,hn)=>({url:Wt,title:`Viral Hook ${hn+1}`,description:"Trending content found for your script",source:"discovered"}));bn(zt)}}catch(xt){console.warn("Failed to auto-discover hooks:",xt)}finally{zn(!1)}}catch(Be){console.error("Error generating script preview:",Be),gr.error(i("Failed to generate script preview: ")+(Be.message||"Unknown error"))}finally{ld(!1)}},wp=c.jsxs("div",{className:"bg-white dark:bg-[#0F121A] -m-3 p-6 rounded-b-xl border-t border-gray-200 dark:border-[#252A36] space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsx("div",{className:"p-2 bg-emerald-500/20 rounded-lg",children:c.jsx(FN,{className:"w-5 h-5 text-emerald-500"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-gray-900 dark:text-white font-bold",children:"Pick Your Focus"}),c.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-xs mt-1",children:"We found several interesting narratives. Which should we focus on?"})]})]}),c.jsx("div",{className:"space-y-3 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar",children:H0.map((de,me)=>c.jsxs("div",{className:`group relative p-4 rounded-2xl border transition-all duration-300 cursor-pointer overflow-hidden ${Ko===de?"bg-emerald-500/10 border-emerald-500 shadow-[0_0_20px_rgba(52,211,153,0.1)]":"bg-gray-50 dark:bg-[#1A1D24]/40 border-gray-200 dark:border-[#252A36] hover:border-slate-500 hover:bg-gray-50 dark:bg-[#1A1D24]/60"}`,onClick:()=>X0(de),children:[c.jsxs("div",{className:"flex items-start gap-4 relative z-10",children:[c.jsx("div",{className:`mt-0.5 flex-shrink-0 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors duration-300 ${Ko===de?"border-emerald-500 bg-emerald-500":"border-gray-300 dark:border-[#3A4150] group-hover:border-slate-400"}`,children:Ko===de&&c.jsx(iS,{className:"w-3.5 h-3.5 text-slate-950 stroke-[3px]"})}),c.jsx("span",{className:`font-semibold text-sm leading-relaxed transition-colors duration-300 ${Ko===de?"text-emerald-500":"text-gray-700 dark:text-gray-300 group-hover:text-white"}`,children:de})]}),c.jsx("div",{className:`absolute inset-0 bg-gradient-to-r from-emerald-500/0 via-emerald-500/5 to-emerald-500/0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none ${Ko===de?"hidden":""}`})]},me))}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 pt-4 border-t border-gray-200 dark:border-[#252A36]/50",children:[c.jsx("button",{onClick:()=>ch(!1),className:"px-4 py-3 bg-gray-50 dark:bg-[#1A1D24] text-gray-700 dark:text-gray-300 rounded-xl hover:bg-slate-750 transition-all font-bold text-xs uppercase tracking-wider",children:"Cancel"}),c.jsx("button",{onClick:()=>df("__all__"),className:"px-4 py-3 bg-gray-200 dark:bg-[#252A36] text-gray-700 dark:text-gray-300 rounded-xl hover:bg-gray-200 dark:bg-[#252A36] transition-all font-bold text-xs uppercase tracking-wider border border-gray-300 dark:border-[#3A4150]",children:"Use Full Content"}),c.jsx("button",{disabled:!Ko||pp,onClick:()=>df(Ko),className:"col-span-2 sm:col-span-1 px-4 py-3 bg-emerald-500 text-slate-950 rounded-xl hover:bg-emerald-400 transition-all font-black text-xs uppercase tracking-wider shadow-[0_8px_30px_rgb(52,211,153,0.2)] disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed flex items-center justify-center gap-2 group",children:pp?c.jsx(Hf,{className:"w-4 h-4"}):c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"Confirm"}),c.jsx(FN,{className:"w-3.5 h-3.5 transition-transform duration-300 group-hover:rotate-12"})]})})]})]}),{data:js,refetch:tm}=Qr(hM,{includeUnscheduled:!0},{enabled:ft>=2,refetchInterval:Bt||qe.some(de=>{var me,Be;return de.isGenerating||((me=de.execution)==null?void 0:me.status)==="processing"||((Be=de.execution)==null?void 0:Be.status)==="pending"})?5e3:!1});G.useEffect(()=>{const de=new URLSearchParams(d.search),me=de.get("code");me&&(wSe({code:me}),h("/ai-automator"));const Be=de.get("workflowId");Be&&p(Be)},[d.search]),G.useEffect(()=>{var de,me,Be;if(f&&Yl){const xt=Yl.find(xn=>xn.id===f);if(xt){A(xt.name),b(xt.description),_e(mA(xt.socialMedias,[])),Ae(mA
5784(xt.sources,[{type:"social-media",url:"",file:null}])),M(xt.type||"text-image"),yt(mA(xt.includedUrls,[])),ve(mA(xt.mediaFiles,[])),bt(mA(xt.schedule,null));const xn=mA(xt.options,{});xn.contentMode&&Ue(xn.contentMode),xt.type==="text-image"?(Lc(xn.imageGenerationOption||"free-samples"),uh(xn.numberOfImages||1),Q0(xn.enableInfographics!==void 0?xn.enableInfographics:!0),B_(xn.includeUrl||!1),K0(xn.postUrl||""),Sg(xn.generateHashtags!==!1),mp(xn.enableViralHashtags!==!1),oh(xn.enableAvatar||!1),Xl(xn.savedAvatars||[]),of(xn.selectedAvatarId||null)):(xt.type==="video"||xt.type==="long-video")&&(Hl(xn.videoGenerationLimit||30),cd(xn.videoSourceOption||"generate-ai"),Dc(xn.language||"English"),af(xn.enableCaptions??!0),wu(xn.enableVoice||!1),Eg(xn.voiceGender||"Female"),gp(xn.voiceType||"Default"),jc(xn.enableViralHook||!1),Wl(xn.enableBackgroundMusic||!1),Sg(xn.generateHashtags||!0),mp(xn.enableViralHashtags||!0),oh(xn.enableAvatar||!1),Xl(xn.savedAvatars||[]),of(xn.selectedAvatarId||null),xn.narrationScript&&$0(xn.narrationScript),xn.productName&&P(xn.productName),xn.productDescription&&F(xn.productDescription),xn.productCategory&&W(xn.productCategory),xn.productUrl&&ee(xn.productUrl),xn.selectedHookUrl&&be(xn.selectedHookUrl),xn.selectedHookVideos&&$e(xn.selectedHookVideos))}let Ct=[];const zt=mA(xt.options,{}),Wt=mA(xt.schedule,{});((Wt==null?void 0:Wt.automationType)==="auto-pilot"||((de=xt.name)==null?void 0:de.startsWith("[Auto-Pilot]")))&&oe(!0),Se("automated"),zt!=null&&zt.scheduleItems&&zt.scheduleItems.length>0?Ct=zt.scheduleItems.map(xn=>({...xn,config:xn.config||zt})):Wt&&Wt.days&&Wt.days.length>0&&Wt.days.forEach(xn=>{var En,v;const Wr=((En=Wt.times)==null?void 0:En[xn])||((v=Wt.times)==null?void 0:v[xn.toLowerCase()])||Wt.time||"09:00";(Array.isArray(Wr)?Wr:[Wr]).forEach(w=>{Ct.push({day:xn,time:w,config:zt,executionId:null})})});const qn=new URLSearchParams(d.search);if(qn.get("addPost")==="true"||qn.get("action")==="addPost"){const xn=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],Wr=new Set(Ct.map(N=>{var C;return(C=N.day)==null?void 0:C.toLowerCase()})),jt=xn.find(N=>!Wr.has(N))||"monday",En=((me=Wt==null?void 0:Wt.times)==null?void 0:me[jt])||"10:00",v=((Be=Ct[0])==null?void 0:Be.config)||zt||{},w={day:jt,time:En,config:{...v}},S=[...Ct,w];pt(S),At(2),v&&(v.workflowType&&M(v.workflowType),v.language&&Dc(v.language),v.workflowSubType&&L(v.workflowSubType),v.productName!==void 0&&P(v.productName),v.productDescription!==void 0&&F(v.productDescription),v.productCategory!==void 0&&W(v.productCategory),v.productUrl!==void 0&&ee(v.productUrl),v.imageGenerationOption!==void 0&&Lc(v.imageGenerationOption),v.videoSourceOption!==void 0&&cd(v.videoSourceOption)),Ne(S.length-1),Ft(!0)}else pt(Ct),At(2)}},[f,Yl]),G.useEffect(()=>{const de=me=>{if(Bt||is||cn||ah.show)return me.preventDefault(),me.returnValue="Content is still being generated. Are you sure you want to leave?","Content is still being generated. Are you sure you want to leave?"};return window.addEventListener("beforeunload",de),()=>{window.removeEventListener("beforeunload",de)}},[Bt,is,cn,ah.show]);const Pg={"podcast-discussion":"Podcast Discussion Video","quick-tip":"Quick Tip Video","product-plug":"UGC Product Video","hook-tease":"Hook & Tease Video","fast-facts":"Fast Facts Video","mini-explainer":"Mini Explainer Video","ai-voiceover-clips":"AI Voiceover Video","tailored-ad-video":"Tailored Ad Video","step-tutorial":"Step-by-Step Tutorial","top-list":"Top 5 List Video","explainer-video":"Explainer Video","brand-story":"Brand Story Video","scripted-story":"Scripted Story Video","avatar-qa":"Avatar Q&A Video"},nm=de=>{L(de),Pg[de]&&A(Pg[de]),de==="podcast-discussion"&&Hl(Lo.duration||t8),de==="product-plug"?(wu(!0),cd("free-samples"),b("AI-generated UGC video for product promotion using avatar narration")):(de==="vox-style"||de==="app-demo")&&(oh(!1),jc(!1))},hx=async de=>{if(!de||de.length<8||zr)return;const me=de.startsWith("http")?de:`https://${de}`;if(!/instagram\.com|tiktok\.com|twitter\.com|x\.com|facebook\.com|linkedin\.com|youtube\.com\/(channel|user|@)/.test(me)){sr(!0);try{const Be=await PX({url:me});Be!=null&&Be.isRss?Nr(Be):Nr(null)}catch{Nr(null)}finally{sr(!1)}}},fh=[{value:"youtube",label:"Youtube",color:"#FF0000"},{value:"tiktok",label:"TikTok",color:"#000000"},{value:"instagram",label:"Instagram",color:"#E4405F"},{value:_==="video"||_==="long-video"?"facebook-reels":"facebook",label:"Facebook",color:"#1877F2"},{value:"twitter",label:"X.com",color:"#000000"},{value:"linkedin",label:"LinkedIn",color:"#0077B6"}
5784];G.useEffect(()=>{const de=re.map(Be=>Be.label).join(", ");let me=[];if(_==="text-image")me=[{id:"1",data:{label:"Get Content"},position:{x:50,y:50}},{id:"2",data:{label:"Compile with AI"},position:{x:250,y:50}},{id:"3",data:{label:"Generate Keywords"},position:{x:450,y:50}},{id:"e1-2",source:"1",target:"2",animated:!0},{id:"e2-3",source:"2",target:"3",animated:!0}],Do==="free-samples"?me.push({id:"4",data:{label:"Stock Images"},position:{x:250,y:150}}):me.push({id:"4",data:{label:"AI Generated Images"},position:{x:250,y:150}}),me.push({id:"e3-4",source:"3",target:"4",animated:!0}),me.push({id:"5",data:{label:"Generate Post Text"},position:{x:450,y:150}}),me.push({id:"e4-5",source:"4",target:"5",animated:!0}),me.push({id:"6",data:{label:`Publish to ${de}`},position:{x:650,y:150}}),me.push({id:"e5-6",source:"5",target:"6",animated:!0});else if(_==="video"||_==="long-video"){me=[{id:"1",data:{label:"Get Content"},position:{x:50,y:50}},{id:"2",data:{label:"Compile with AI"},position:{x:250,y:50}},{id:"3",data:{label:"Generate Keywords"},position:{x:450,y:50}},{id:"e1-2",source:"1",target:"2",animated:!0},{id:"e2-3",source:"2",target:"3",animated:!0}];let Be="3";Ni&&(me.push({id:"4",data:{label:"Get Viral Hook"},position:{x:50,y:150}}),me.push({id:"e3-4",source:"3",target:"4",animated:!0}),Be="4"),Oc==="free-samples"?me.push({id:"5",data:{label:"Stock Videos"},position:{x:250,y:150}}):me.push({id:"5",data:{label:"AI Generated Videos"},position:{x:250,y:150}}),me.push({id:`e${Be}-5`,source:Be,target:"5",animated:!0}),me.push({id:"6",data:{label:"Generate Post Text"},position:{x:450,y:150}}),me.push({id:"e5-6",source:"5",target:"6",animated:!0}),me.push({id:"7",data:{label:`Publish to ${de}`},position:{x:650,y:150}}),me.push({id:"e6-7",source:"6",target:"7",animated:!0})}Fe(me)},[_,re,Do,Oc,Ni]);const rm=de=>yte({type:de,subType:T,durationSeconds:Er,podcastSeconds:Lo==null?void 0:Lo.duration,aiImages:Do==="generate-ai"?$l||1:0,byok:cx}),Lg=de=>{const me=rm(de);return((n==null?void 0:n.credits)||0)>=me},z_=de=>{const me=rm(de),Be=(n==null?void 0:n.credits)||0,xt=me-Be;return de==="video"||de==="long-video"?`You need at least ${me} credits to create video content. You currently have ${Be} credits. You need ${xt} more credits.`:`You need at least ${me} credits to create text+image content. You currently have ${Be} credits. You need ${xt} more credits.`},G_=[{number:1,title:Le("What are we making?"),description:Le("Content type and setup")},{number:2,title:Le("When should it post?"),description:Le("Schedule and timing")},{number:3,title:Le("Preview & Launch"),description:Le("Generate preview and schedule")}],Bc=de=>{switch(de){case 1:if(!Lg(_))return!1;if(we==="original-only")return te.some(me=>!xv(me));if(we==="mixed")return Ee.some(Be=>Be.url&&!vn)||te.length>0;if(T==="product-plug"&&(_==="video"||_==="long-video")){const me=!!_,Be=!!(J.trim()||D.trim()&&O.trim()&&X.trim());return me&&Be}else if(T==="tailored-ad-video"&&(_==="video"||_==="long-video")){const me=!!_,Be=!!(sd.trim()&&sd.trim().length>=10);return me&&Be}else if((_==="video"||_==="long-video")&&(J.trim()||D.trim()&&O.trim()&&X.trim())){const me=!!_,Be=!!(J.trim()||D.trim()&&O.trim()&&X.trim());return me&&Be}else{const me=!!_,Be=Ee.every(xt=>xt.type==="file"?!!xt.file:!!xt.url&&!vn);return me&&Be}case 2:return Ce==="automated"?qe&&qe.length>0:mt?mt.type==="daily"?!!mt.times:mt.type==="weekly"?mt.days&&mt.days.length>0:mt.type==="specific"?mt.dateTimeSelections&&mt.dateTimeSelections.length>0:!0:!1;case 3:return re.length===0?!1:Te||Ce==="automated"?!0:qe.length>0&&qe.every(me=>{var Be,xt,Ct;return me.executionId&&(((Be=me.execution)==null?void 0:Be.status)==="completed"||((xt=me.execution)==null?void 0:xt.status)==="succeeded"||((Ct=me.execution)==null?void 0:Ct.status)==="posted")});default:return!1}},q_=async()=>{if(!dd){lf(!0);try{const de=await r4e({voiceGender:Ao.toLowerCase(),prompt:Zo.trim()||void 0}),me={id:Date.now().toString(),url:de.imageUrl,gender:Ao.toLowerCase(),timestamp:Date.now()};Xl(Be=>[me,...Be].slice(0,10)),of(me.id)}catch(de){console.error("Error generating avatar preview:",de),alert("Failed to generate avatar preview. Please try again.")}finally{lf(!1)}}},fx=de=>{of(de);const me=ea.find(Be=>Be.id===de);if(me){const Be=me.gender.charAt(0).toUpperCase()+me.gender.slice(1);Eg(Be)}vp(!1)},Vy=de=>{Xl(me=>me.filter(Be=>Be.id!==de)),ta===de&&of(null)},_s=de=>{for(let me=1;me<de;me++)if(!Bc(me))return!1;return!0},Og=de=>{const me=Pt[de-1];$e(Be=>Be.includes(de)?(be(null),[]):(be((me==null?void 0:me.url)||null),[de]))},Dg=()=>{if(T==="product-plug"){const de=J.trim()!=="",me=D.trim()!==""&&O.trim()!==""&&X.trim()!==""&&Z.length>0;if(!de&&!me)return alert("For UGC product videos, you must provide either a product URL OR complete all product details (name, description, category, and images)."),!1}return T==="tailored-ad-video"&&(!sd.trim()||sd.trim().length<10)?(alert("For Tailored Ad Videos, you must provide a prompt with at least 10 characters."),!1):!0},fd=async()=>{var de,me,Be,xt,Ct,zt,Wt,hn,qn,Yn,xn,Wr,jt,En,v,w,S,N,C,k;if(Dg()){if(!Lg(_)){alert(z_(_));return}dn(!0),Xn({show:!0,step:"Creating workflow and schedule...",progress:10});try{let R=[];if(te.length>0){Xn({show:!0,step:"Uploading media files...",progress:25});for(const De of te)if(De.name&&De.size&&!De.url)try{const{uploadUrl:Me,key:ot}=await dm({fileType:De.type,name:De.name}),Ke=Me.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?Me.replace("http://localhost:3001",Zi.apiUrl):Me;await Ns.put(Ke,De,{headers:{"Content-Type":De.type}}),R.push({name:De.name,type:De.type,size:De.size,url:`${Zi.apiUrl}/api/download/${encodeURIComponent(ot)}`})}catch(Me){console.error("Failed to upload media file:",Me)}else De.url&&R.push(De)}const I=R,V=Ee.map(De=>({type:De.type,url:De.url?De.url.startsWith("http")?De.url:`https://${De.url}`:De.url,file:De.file?{name:De.file.name,type:De.file.type,size:De.file.size,lastModified:De.file.lastModified}:null}));let $=[];if(Z.length>0){Xn({show:!0,step:"Uploading product images...",progress:15});for(const De of Z)if(De.name&&De.size&&!De.url)try{const{uploadUrl:Me,key:ot}=await dm({fileType:De.type,name:De.name}),Ke=Me.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?Me.replace("http://localhost:3001",Zi.apiUrl):Me;await Ns.put(Ke,De,{headers:{"Content-Type":De.type}}),$.push({name:De.name,type:De.type,size:De.size,url:`${Zi.apiUrl}/api/download/${encodeURIComponent(ot)}`})}catch(Me){console.error("Failed to upload product image:",Me)}else De.url&&$.push(De)}let K=ta?(de=ea.find(De=>De.id===ta))==null?void 0:de.url:null;
5784if(ql==="user-provided")if(oa){Xn({show:!0,step:"Uploading custom avatar...",progress:20});try{const{uploadUrl:De,key:Me}=await dm({fileType:oa.type,name:oa.name}),ot=De.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?De.replace("http://localhost:3001",Zi.apiUrl):De;await Ns.put(ot,oa,{headers:{"Content-Type":oa.type}}),K=`${Zi.apiUrl}/api/download/${encodeURIComponent(Me)}`,bg(K)}catch(De){console.error("Failed to upload avatar:",De)}}else id&&(K=id);const ie={workflowType:_,contentMode:we,videoGenerationLimit:Er,videoSourceOption:Oc,language:bu,enableCaptions:sf,enableVoice:xa,voiceGender:Ao,voiceType:ud,enableViralHook:Ni,enableBackgroundMusic:Ic,selectedMusicMood:Ng,generateHashtags:Fy,enableViralHashtags:Tg,workflowSubType:T,productName:D,productDescription:O,productCategory:X,productUrl:J?J.startsWith("http")?J:`https://${J}`:"",productType:ae,productImages:$.length>0?$:Z.map(De=>({name:De.name,type:De.type,size:De.size})),enableAvatar:Qo,avatarSource:ql,avatarFile:oa?oa.name:null,selectedAvatarUrl:K,savedAvatars:ea,selectedAvatarId:ta,imageGenerationOption:Do,podcastOptions:_==="podcast-video"||T==="podcast-discussion"?Lo:void 0};if(Te||Ce==="automated"&&qe.length>0||g&&(g.startsWith("[Auto-Pilot]")||g.startsWith("[Batch]"))){Xn({show:!0,step:Te?"Configuring Continuous Auto-Pilot...":"Configuring Batch Workflows...",progress:50});let De=(g||"").replace(/^\[(Auto-Pilot|Batch)\]\s*/,"")||((me=Ee[0])!=null&&me.url?Ee[0].url+" Workflow":"Automated Strategy");De=De.replace(/(https?:\/\/[^\s]+|www\.[^\s]+|[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(?:\/[^\s]*)?)/gi,Et=>Et.toLowerCase());const ot=`${Te?"[Auto-Pilot]":"[Batch]"} ${De}`,Ke=new Date().getTimezoneOffset(),Ot=JSON.stringify({automationType:Te?"auto-pilot":"batch",days:qe.map(Et=>{var Zt;return(Zt=Et.day)==null?void 0:Zt.toLowerCase()}),times:qe.reduce((Et,Zt)=>{var nn;return{...Et,[(nn=Zt.day)==null?void 0:nn.toLowerCase()]:Zt.time}},{}),timezoneOffset:Ke,lastRun:new Date().toISOString()}),$t=[...qe];Xn({show:!0,step:`Preparing ${qe.length} schedule items...`,progress:60});for(let Et=0;Et<qe.length;Et++){const Zt=qe[Et],nn={type:"weekly",days:[Zt.day],times:{[Zt.day]:Zt.time},automationType:"one-off",timezoneOffset:new Date().getTimezoneOffset()};if((Be=Zt.execution)!=null&&Be.workflowId)try{await Cm({id:Zt.execution.workflowId,socialMedias:JSON.stringify(re),schedule:JSON.stringify(nn)})}catch(rn){console.error("Failed to update existing child workflow:",rn)}else if(!Zt.executionId){const rn={...ie};Zt.config&&Object.assign(rn,Zt.config),rn.workflowType==="long-video"||rn.type==="long-video"||((xt=Zt.config)==null?void 0:xt.contentType)==="Long Video"?(rn.videoGenerationLimit=Math.min(90,Math.max(30,Number(rn.videoGenerationLimit)||60)),rn.videoSettings&&(rn.videoSettings.duration=Math.min(90,Math.max(30,Number(rn.videoSettings.duration)||60)))):(rn.videoGenerationLimit=Math.min(30,Number(rn.videoGenerationLimit)||30),rn.videoSettings&&(rn.videoSettings.duration=Math.min(30,Number(rn.videoSettings.duration)||30))),rn.enableCaptions=((Ct=Zt.config)==null?void 0:Ct.enableCaptions)!==!1,rn.enableInfographics=((zt=Zt.config)==null?void 0:zt.enableInfographics)!==!1,rn.isAutoPilotChild=!0,delete rn.continuousAutoPilot,rn.timezoneOffset=Ke;let li=JSON.stringify(I);if((Wt=Zt.config)!=null&&Wt.mediaFiles&&Zt.config.mediaFiles.length>0){const Br=[];for(const Vr of Zt.config.mediaFiles)if(Vr.name&&Vr.size&&!Vr.url)try{const{uploadUrl:ji,key:Is}=await dm({fileType:Vr.type,name:Vr.name}),Ss=ji.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?ji.replace("http://localhost:3001",Zi.apiUrl):ji;await Ns.put(Ss,Vr,{headers:{"Content-Type":Vr.type}}),Br.push({name:Vr.name,type:Vr.type,size:Vr.size,url:`${Zi.apiUrl}/api/download/${encodeURIComponent(Is)}`})}catch(ji){console.error("Failed to upload item media:",ji)}else Br.push(Vr);li=JSON.stringify(Br)}if((hn=Zt.config)!=null&&hn.productImages&&Zt.config.productImages.length>0){const Br=[];for(const Vr of Zt.config.productImages)if(Vr.name&&Vr.size&&!Vr.url)try{const{uploadUrl:ji,key:Is}=await dm({fileType:Vr.type,name:Vr.name}),Ss=ji.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?ji.replace("http://localhost:3001",Zi.apiUrl):ji;await Ns.put(Ss,Vr,{headers:{"Content-Type":Vr.type}}),Br.push({name:Vr.name,type:Vr.type,size:Vr.size,url:`${Zi.apiUrl}/api/download/${encodeURIComponent(Is)}`})}catch(ji){console.error("Failed to upload item product image:",ji)}else Br.push(Vr);rn.productImages=Br}const Ga=(qn=Zt.config)!=null&&qn.rssItemLink?[{type:"url",url:Zt.config.rssItemLink,file:null}]:V,Lr={name:`${De} - ${Zt.day}`,description:((Yn=Zt.config)==null?void 0:Yn.postDescription)||x||"",socialMedias:JSON.stringify(re),schedule:JSON.stringify(nn),graph:JSON.stringify(kt),mediaFiles:li,includedUrls:JSON.stringify(ze),sources:JSON.stringify(Ga),options:JSON.stringify({...rn,productUrl:((xn=Zt.config)==null?void 0:xn.rssItemLink)||rn.productUrl,productName:((Wr=Zt.config)==null?void 0:Wr.rssItemTitle)||rn.productName,productDescription:((jt=Zt.config)==null?void 0:jt.postDescription)||rn.productDescription,rssItemTitle:(En=Zt.config)==null?void 0:En.rssItemTitle,rssItemLink:(v=Zt.config)==null?void 0:v.rssItemLink,rssItemGuid:(w=Zt.config)==null?void 0:w.rssItemGuid}),type:((S=Zt.config)==null?void 0:S.workflowType)||((N=Zt.config)==null?void 0:N.type)||_};try{const Br=await AS(Lr),Vr=await yv(Br);Vr&&Vr.id&&($t[Et].executionId=Vr.id,$t[Et].childWorkflowId=Br.id)}catch(Br){console.error("Failed to start execution for item:",Br)}}}const Tt={...ie,continuousAutoPilot:!!Te,timezoneOffset:Ke,isRssFeed:(pe==null?void 0:pe.isRss)||
5784!1,rssFeedUrl:(pe==null?void 0:pe.feedUrl)||((C=Ee[0])!=null&&C.url?Ee[0].url.startsWith("http")?Ee[0].url:`https://${Ee[0].url}`:""),scheduleItems:$t.map(Et=>{var Zt;return{day:Et.day,time:Et.time,config:Et.config,executionId:Et.executionId||null,childWorkflowId:Et.childWorkflowId||((Zt=Et.execution)==null?void 0:Zt.workflowId)||null}})},ht={name:ot,description:x,socialMedias:JSON.stringify(re),schedule:Ot,graph:JSON.stringify(kt),mediaFiles:JSON.stringify(I),includedUrls:JSON.stringify(ze),sources:JSON.stringify(V),options:JSON.stringify(Tt),type:_};let Xt=f;if(f)await Cm({id:f,...ht}),console.log("â
Auto-Pilot parent workflow updated:",f);else{const Et=await AS(ht);Xt=Et.id,console.log("â
Auto-Pilot parent workflow created:",Et.id)}if(Xt)for(const Et of $t){const Zt=Et.childWorkflowId||((k=Et.execution)==null?void 0:k.workflowId);if(Zt)try{const nn=Et.config||{};await Cm({id:Zt,options:JSON.stringify({...nn,parentWorkflowId:Xt,isAutoPilotChild:!0})})}catch(nn){console.warn("Could not link parentWorkflowId to child:",nn)}}Xn({show:!0,step:"Auto-Pilot configured successfully!",progress:100}),setTimeout(()=>{Xn({show:!1,step:"",progress:0}),h("/workflows")},1500),dn(!1);return}const fe=qe.filter(De=>{var Me;return(Me=De.execution)==null?void 0:Me.workflowId});if(fe.length>0){console.log("ð Updating existing generated workflows:",fe.length),Xn({show:!0,step:`"Updating ${fe.length} scheduled workflows..."`,progress:50});for(const De of fe){const Me={type:"weekly",days:[De.day],times:{[De.day]:De.time},automationType:"one-off",timezoneOffset:new Date().getTimezoneOffset()};await Cm({id:De.execution.workflowId,socialMedias:JSON.stringify(re),schedule:JSON.stringify(Me)})}Xn({show:!0,step:"Schedules updated successfully!",progress:100}),setTimeout(()=>{if(Xn({show:!1,step:"",progress:0}),fe.length===1&&fe[0].executionId){const De=document.getElementById("root")||document.body;De.style.transition="opacity 0.5s ease",De.style.opacity="0",setTimeout(()=>{h(`/executions?id=${fe[0].executionId}`),setTimeout(()=>{De.style.opacity="1"},100)},500)}else h("/workflows")},1500),dn(!1);return}let ye=g||"";ye||(Ee.length>0&&Ee[0].url?ye=Ee[0].url+" Workflow":T==="product-plug"?D?ye=D+" Workflow":J&&(ye=J+" Workflow"):ye=_+" Workflow"),ye&&(ye=ye.replace(/(https?:\/\/[^\s]+|www\.[^\s]+|[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(?:\/[^\s]*)?)/gi,De=>De.toLowerCase()));const je={name:ye,description:x,socialMedias:JSON.stringify(re),schedule:JSON.stringify(mt),graph:JSON.stringify(kt),mediaFiles:JSON.stringify(I),includedUrls:JSON.stringify(ze),sources:JSON.stringify(V),options:JSON.stringify(ie),type:_};if(f){console.log("ð Updating existing workflow:",f),Xn({show:!0,step:"Updating workflow...",progress:50});const De=await Cm({id:f,...je});console.log("â
Workflow updated:",De),Xn({show:!0,step:"Schedule updated successfully!",progress:100}),setTimeout(()=>{if(Xn({show:!1,step:"",progress:0}),$i){const Me=document.getElementById("root")||document.body;Me.style.transition="opacity 0.5s ease",Me.style.opacity="0",setTimeout(()=>{h(`/executions?id=${$i}`),setTimeout(()=>{Me.style.opacity="1"},100)},500)}else h("/workflows")},1500),dn(!1);return}Xn({show:!0,step:"Creating new workflow...",progress:50});const We=await AS(je);console.log("â
Workflow created:",We),Xn({show:!0,step:"Starting workflow execution...",progress:70});try{const De=await yv(We);De&&De.id&&yl(De.id),Xn({show:!0,step:"Workflow execution started!",progress:100})}catch(De){alert("Workflow execution failed: "+De.message)}setTimeout(()=>Xn({show:!1,step:"",progress:0}),3e3),console.log("ð§¹ Resetting form..."),A(""),b(""),_e(_==="text-image"?[{value:"facebook",label:"Facebook",color:"#1877F2"}]:[{value:"facebook-reels",label:"Facebook Reels",color:"#1877F2"}]),Ae([{type:"social-media",url:"",file:null}]),ve([]),yt([]),bt(null),At(1),Fn(null),$e([]),bn([])}catch(R){Xn({show:!0,step:"Error occurred",progress:0}),setTimeout(()=>Xn({show:!1,step:"",progress:0}),3e3),window.alert("Error: "+(R.message||"Something went wrong"))}finally{dn(!1)}}};G.useEffect(()=>{var de;if(Bt&&T!=="tailored-ad-video"&&js){const me=yu($i||void 0);let Be=null;if($i&&(Be=js.find(xt=>
5784xt.id===$i)),Be||(Be=js.find(xt=>{var hn,qn,Yn,xn;const Ct=((qn=(hn=xt.workflow)==null?void 0:hn.name)==null?void 0:qn.includes(g+" - Preview"))||xt.workflowId===f,zt=((Yn=xt.workflow)==null?void 0:Yn.type)==="video"||((xn=xt.workflow)==null?void 0:xn.type)==="long-video",Wt=xr?new Date(xt.createdAt).getTime()>=xr-5e3:!0;return Ct&&zt&&Wt})),me&&(!Be||new Date(me.timestamp)>new Date(Be.updatedAt))&&(Be={...Be,id:me.executionId,status:me.status,result:me.result||me.message}),Be){console.log("DEBUG: Found target execution (SSE+DB):",{id:Be.id,status:Be.status,result:(de=Be.result)==null?void 0:de.substring(0,100)});const xt=Be.status==="completed"&&Be.result&&(Be.result.includes("completed successfully")||Be.result.includes("Video processing completed")||Be.result.includes("Video generation completed")||Be.result.includes("Video ready!")||Be.result.includes("video processing successful")||Be.result.includes("imageUrls")||Be.result.includes("Image post ready!"));if(xt){let Ct=null;if(Be.result){const zt=Be.result.match(/https?:\/\/[^\s"]+/);zt&&(Ct=zt[0].replace(/[",)]+$/,""))}if(!Ct&&zi){const zt=zi.find(Wt=>{var hn;return Wt.workflowId===(Be.workflowId||f)&&((hn=Wt.videoUrls)==null?void 0:hn.length)>0&&!Wt.videoUrls[0].includes("?processing=true")&&!Wt.videoUrls[0].includes("temp_")});zt&&(Ct=zt.videoUrls[0])}Ct&&(console.log("DEBUG: Final rendered video detected:",Ct),Xn({show:!0,step:"Video ready!",progress:100}),Fn(Ct),setTimeout(()=>{Xn({show:!1,step:"",progress:0}),Pc({show:!1,progress:0,startTime:0,elapsedTime:0})},3e3),Ht(!1),Ir(null),Ni&&wl(Be))}else if(Be.status==="processing"||Be.status==="completed"&&!xt){const Ct=Be.status==="completed"?"Almost done...":"Generating your video...",zt=Be.status==="completed"?90:60;Xn({show:!0,step:Ct,progress:zt})}else Be.status==="failed"&&(console.error("DEBUG: Video rendering execution failed:",Be.result),Ht(!1),Xn({show:!0,step:"Generation failed. Please try again.",progress:0}),Pc({show:!1,progress:0,startTime:0,elapsedTime:0}),gr.error(Be.result||"Video generation failed"),setTimeout(()=>Xn({show:!1,step:"",progress:0}),5e3))}}},[Bt,js,zi,g,$i,f]),G.useEffect(()=>{if(is&&js&&js.length>0&&zi&&zi.length>0){if(at&&Date.now()-at>18e4){console.warn("DEBUG: Image generation timeout (3 minutes)"),Xn({show:!0,step:"Image generation timeout - please try again",progress:0}),setTimeout(()=>Xn({show:!1,step:"",progress:0}),5e3),si(!1),vt(null);return}const de=js.find(me=>{var zt,Wt,hn;const Be=(Wt=(zt=me.workflow)==null?void 0:zt.name)==null?void 0:Wt.includes(g+" - Preview"),xt=((hn=me.workflow)==null?void 0:hn.type)==="text-image",Ct=at?new Date(me.createdAt).getTime()>=at-5e3:!0;return Be&&xt&&Ct});if(de)if(de.status==="completed"){const Be=zi.find(xt=>xt.workflowId===de.workflowId&&xt.imageUrls&&xt.imageUrls.length>0);Be&&Be.imageUrls&&Be.imageUrls.length>0&&(Xn({show:!0,step:"Images generated!",progress:95}),console.log("DEBUG: Generated images detected:",Be.imageUrls),console.log("DEBUG: Generated post text:",Be.text),Yi(Be.imageUrls),Pe(Be.text),yl(de.id),Xn({show:!0,step:"Preview ready!",progress:100}),setTimeout(()=>Xn({show:!1,step:"",progress:0}),2e3),si(!1),vt(null))}else de.status==="processing"?Xn({show:!0,step:"Generating images and content...",progress:75}):de.status==="failed"&&(Xn({show:!0,step:"Image generation failed - please try again",progress:0}),setTimeout(()=>Xn({show:!1,step:"",progress:0}),5e3),si(!1),vt(null))}},[is,js,zi,g]),G.useEffect(()=>{const de=setInterval(()=>{pt(me=>{let Be=!1;const xt=me.map(Ct=>{var Wt,hn,qn,Yn,xn,Wr,jt,En,v;if(Ct.isGenerating||((Wt=Ct.execution)==null?void 0:Wt.status)==="processing"||((hn=Ct.execution)==null?void 0:hn.status)==="pending"){const w=Ct.generationStartTime||((qn=Ct.execution)!=null&&qn.createdAt?new Date(Ct.execution.createdAt).getTime():Date.now()),S=Date.now()-w,N=((Yn=Ct.config)==null?void 0:Yn.workflowType)||_,C=((xn=Ct.config)==null?void 0:xn.workflowSubType)||T;let k=20;if(N==="text-image")k=3;else if(C==="vox-style"||C==="app-demo")k=40;else if(N==="long-video"){const V=Number(((Wr=Ct.config)==null?void 0:Wr.videoGenerationLimit)||Er||60);k=Math.max(20,Math.ceil(V/60)*20)}else k=20;const R=k*60*1e3,I=Math.min(99,Math.floor(S/R*99));if(I!==Ct.generationProgress||!Ct.generationStartTime)return Be=!0,{...Ct,generationStartTime:w,generationProgress:I}}else if((((jt=Ct.execution)==null?void 0:jt.status)==="completed"||((En=Ct.execution)==null?void 0:En.status)==="succeeded"||((v=Ct.execution)==null?void 0:v.status)==="posted")&&Ct.generationProgress!==100)return Be=!0,{...Ct,generationProgress:100};return Ct});return Be?xt:me})},1e3);return()=>clearInterval(de)},[_]),G.useEffect(()=>{js&&pt(de=>{let me=!1;const Be=de.map(xt=>{var Ct;
5784if(xt.executionId){const zt=js.find(Wt=>Wt.id===xt.executionId);if(zt&&zt.status!==((Ct=xt.execution)==null?void 0:Ct.status))return me=!0,{...xt,execution:zt}}else if(f){const zt=js.find(Wt=>Wt.workflowId===f);if(zt)return me=!0,{...xt,executionId:zt.id,execution:zt}}return xt});return me?Be:de})},[js,f]),G.useEffect(()=>{console.log("DEBUG: Hook video effect triggered:",{enableViralHook:Ni,renderedVideoUrl:!!qt,postsDataLength:(zi==null?void 0:zi.length)||0}),Ni&&(console.log("DEBUG: Calling fetchViralHookVideos..."),pd())},[Ni,od]),G.useEffect(()=>{if(ft===3&&f&&(_==="video"||_==="long-video")&&T!=="tailored-ad-video"&&!qt&&!Bt&&(console.log("DEBUG: Running fallback video detection for workflow:",f),zi&&zi.length>0)){const de=zi.filter(me=>me.workflowId===f&&me.videoUrls&&me.videoUrls.length>0).sort((me,Be)=>new Date(Be.createdAt).getTime()-new Date(me.createdAt).getTime());if(de.length>0){const me=de[0].videoUrls[0];console.log("DEBUG: Found fallback video for this workflow:",me),Fn(me),Ni&&pd()}}},[ft,f,_,qt,Bt,zi,Ni]),G.useEffect(()=>{Pt.length>0&&Ge.length===0&&($e([1]),console.log("DEBUG: Auto-selected first hook video:",Pt[0]))},[Pt]),G.useEffect(()=>{if(Pt.some(me=>me.isProcessing)&&Ni){console.log("DEBUG: Found processing hook videos, will refresh in 10 seconds...");const me=setTimeout(()=>
5784{console.log("DEBUG: Refreshing hook videos to check for completed processing..."),pd()},1e4);return()=>clearTimeout(me)}},[Pt,Ni]),G.useEffect(()=>{console.log("DEBUG: Video loading state check:",{currentStep:ft,workflowType:_,isRenderingVideo:Bt,renderedVideoUrl:!!qt,renderedVideoUrlValue:qt,enableViralHook:Ni,hookVideoOptionsCount:Pt.length,selectedHookVideosCount:Ge.length,postsDataCount:(zi==null?void 0:zi.length)||0,allExecutionsCount:(js==null?void 0:js.length)||0})},[ft,_,Bt,qt,Ni,Pt.length,Ge.length,zi==null?void 0:zi.length,js==null?void 0:js.length]);const wl=async de=>{try{console.log("DEBUG: Fetching hook video options from execution data..."),de.result&&typeof de.result=="string"&&de.result.match(/\{[^}]*hookVideo[^}]*\}/g)&&console.log("DEBUG: Found potential hook video data in execution result"),await pd()}catch(me){console.error("DEBUG: Error fetching hook video options from execution:",me),await pd()}},pd=async(de=!1)=>{var me;try{if(console.log("DEBUG: Fetching viral hook videos..."),!de&&Pt.length>0&&Pt.some(zt=>zt.source==="discovered")){console.log("DEBUG: Keeping discovered hooks, skipping fetch");return}zn(!0),de&&bn([]);const Be=(D?`${D} ${X||""}`:od)||"viral trending social media hook",xt=de?`${Be} __salt_${Date.now()}_${Math.random().toString(36).slice(2,7)}`:Be;if(Be)try{const zt=await jX({keywords:xt,script:od,forceRefresh:de});if(((me=zt==null?void 0:zt.urls)==null?void 0:me.length)>0){const Wt=zt.urls.map((hn,qn)=>({url:hn,title:`Viral Hook ${qn+1}`,description:"Trending content found for your script",source:"discovered"}));bn(Wt),zn(!1);return}}catch(zt){console.warn("Failed to auto-discover hooks:",zt)}if(!zi||zi.length===0){console.log("DEBUG: No posts data available for fallback hook videos"),ph(),zn(!1);return}const Ct=zi.filter(zt=>zt.workflowId===f&&zt.videoUrls&&zt.videoUrls.length>0);if(Ct.length>
57840){const zt=[],Wt=new Set;Ct.sort((qn,Yn)=>new Date(Yn.createdAt).getTime()-new Date(qn.createdAt).getTime()).forEach(qn=>{qn.videoUrls&&qn.videoUrls.forEach((Yn,xn)=>{if(Wt.has(Yn))return;const Wr=Yn.toLowerCase(),jt=Wr.includes("rendered/")||Wr.includes("concatenated_")||Wr.includes("ugc_final_")||Wr.includes("sora2_");if((Wr.includes("viralhog")||Wr.includes("pexels")||Wr.includes("videohooks")||Wr.includes("pixabay")||Wr.includes("mixkit")||Wr.includes("coverr")||Wr.includes("sora")||xn>0&&!jt)&&!jt&&zt.length<20){Wt.add(Yn);const v=Yn.includes("?processing=true")||Yn.includes("processing")||Yn.includes("temp_");zt.push({url:Yn,title:`Hook Candidate ${zt.length+1}`,description:`Viral hook discovered from ${Yn.includes("viralhog")?"ViralHog":"source"}`,thumbnail:null,source:"discovered",postId:qn.id,isProcessing:v})}})}),bn(zt),zt.length===0&&(console.log("DEBUG: No valid hook videos found in posts fallback"),ph())}else console.log("DEBUG: No posts with videos found for fallback hook videos"),ph()}catch(Be){console.error("Failed to fetch viral hook videos:",Be),ph()}finally{zn(!1)}},ph=()=>{console.log("DEBUG: Creating mock hook videos as fallback");const de=[];qt&&!qt.includes("?processing=true")&&de.push({url:qt,title:"Current Video Hook",description:"Use current video as hook",thumbnail:null,source:"current"}),[{label:"Trending Now",color:"from-rose-500/20 to-orange-500/20"},{label:"Viral Clip",color:"from-violet-500/20 to-fuchsia-500/20"},{label:"Hook Style A",color:"from-blue-500/20 to-cyan-500/20"},{label:"Hook Style B",color:"from-emerald-500/20 to-teal-500/20"}].forEach((Be,xt)=>{de.length<4&&de.push({url:null,title:Be.label,description:"Auto-generated during rendering",thumbnail:null,source:"placeholder",isProcessing:!1,placeholderColor:Be.color})}),de.length===0&&de.push({url:qt||"#",title:"Hook Video 1",description:"Viral hook video will be available after generation",thumbnail:null,source:"placeholder",isProcessing:!1}),console.log(`DEBUG: Created ${de.length} mock hook videos`),bn(de)};G.useEffect(()=>{if(pi.length>0){const de=pi[pi.length-1];switch(console.log("[WebApp] Received SSE update:",de),de.type){case"status_update":de.progress&&Xn({show:!0,step:de.message||"Processing...",progress:de.progress});break;case"progress":Xn({show:!0,step:de.message||"Processing...",progress:de.progress||0});break;case"completed":if(Xn({show:!0,step:"Workflow completed successfully!",progress:100}),de.result){const Be=(typeof de.result=="string"?de.result:JSON.stringify(de.result)).match(/https?:\/\/[^\s"]+\.mp4/);Be&&(console.log("DEBUG: [SSE completed] Setting rendered video URL:",Be[0]),Fn(Be[0]),Oe(!1))}G0(),hh(),tm(),setTimeout(()=>{if(Xn({show:!1,step:"",progress:0}),Pc({show:!1,progress:0,startTime:0,elapsedTime:0}),Ht(!1),Ir(null),si(!1),ft!==3&&$i){const me=document.getElementById("root")||document.body;me.style.transition="opacity 0.5s ease",me.style.opacity="0",setTimeout(()=>{h(`/executions?id=${$i}`),setTimeout(()=>{me.style.opacity="1"},100)},500)}yl(null)},3e3);break;case"failed":Xn({show:!0,step:`Workflow failed: ${de.result||"Unknown error"}`,progress:0}),Ht(!1),Ir(null),setTimeout(()=>{Xn({show:!1,step:"",progress:0}),Pc({show:!1,progress:0,startTime:0,elapsedTime:0}),yl(null),si(!1)},5e3);break}}},[pi,G0,hh,tm,$i]),G.useEffect(()=>{const de=Ee.find(me=>(me.type==="url"||me.type==="social-media")&&me.url);de&&de.url&&ee(me=>!me||de.url.startsWith(me)||me.startsWith(de.url)?de.url:me)},[Ee]);const im=()=>{ft>1&&At(ft-1)},hf=de=>{const me=de.target.value;me&&!_p(me)?Rn("Invalid URL format"):Rn(null),me&&_p(me)&&hx(me)};function _p(de){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(de)}const px=async()=>{var de;ad(!0);try{const me=Lo.speakers.map(Ct=>Ct.referenceImageUrl).filter(Boolean),Be=Lo.topic||D||((de=Ee[0])==null?void 0:de.url)||"Podcast Scene",xt=await YSe({speakers:Lo.speakers,topic:Be,speakerCount:Lo.speakerCount,referenceImageUrls:me});xt!=null&&xt.imageUrl&&(_g(xt.imageUrl),hp(Ct=>({...Ct,podcastSceneImageUrl:xt.imageUrl})),gr.success(i("Podcast studio scene generated!")))}catch(me){console.error("Failed to generate podcast scene:",me),gr.error(i("Failed to generate podcast scene: ")+(me.message||"Unknown error"))}finally{ad(!1)}},jg=async de=>{const me=[];for(const Be of de)if(xv(Be)&&!Be.url&&Be.name&&Be.size){const{uploadUrl:xt,key:Ct}=await dm({fileType:Be.type||"application/pdf",name:Be.name}),zt=xt.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?xt.replace("http://localhost:3001",Zi.apiUrl):xt;await Ns.put(zt,Be,{headers:{"Content-Type":Be.type||"application/pdf"}}),me.push({name:Be.name,type:Be.type||"application/pdf",size:Be.size,url:`${Zi.apiUrl}/api/download/${encodeURIComponent(Ct)}`})}else me.push(Be);return me},sm=async()=>{var xt,Ct,zt,Wt;if(ke)return;if(we==="original-only"&&!te.some(hn=>!xv(hn))){gr.error(i("Please upload at least one image or video for Original Content Only mode."));return}if(we==="mixed"&&!((xt=Ee[0])!=null&&xt.url)&&te.length===0){gr.error(i("Add a website link or upload files (photos, videos or PDFs) first."));return}if(we==="ai-generated"&&!((Ct=Ee[0])!=null&&Ct.url)&&!D&&te.length===0){gr.error(i("Please enter a URL, product info, or upload media first."));return}const de=20;if(!n||n.credits<de){gr.error(i("You need {n} credits to generate a strategy.",{n:de}));return}if(pe!=null&&pe.isRss){Oi(!0);return}const me=(zt=Ee[0])!=null&&zt.url?Ee[0].url.startsWith("http")?Ee[0].url:`https://${Ee[0].url}`:"";if(me&&!pe)try{const hn=await PX({url:me});if(hn!=null&&hn.isRss){Nr(hn),Oi(!0);return}}catch{}Qe("site"),Xe(!0);try{await l({amount:de}),t()}catch{gr.error(i("Failed to deduct credits.")),Xe(!1);return}let Be=te;if(we!=="ai-generated"&&te.some(hn=>xv(hn)&&!hn.url))try{Be=await jg(te),ve(Be)}catch(hn){gr.error(i("Could not upload your PDF: ")+((hn==null?void 0:hn.message)||i("Something went wrong"))),Xe(!1);return}try{const hn=await XSe({entryPoint:((Wt=Ee[0])==null?void 0:Wt.url)||"",additionalInfo:D,contentMode:we,productType:ae,mediaFiles:Be.map(Yn=>({name:Yn.name,type:Yn.type,size:Yn.size,url:Yn.url||Yn.fileUrl||void 0}))});let qn=hn;if(hn&&!Array.isArray(hn)&&hn.posts&&(qn=hn.posts,hn.productInfo&&(D||P(hn.productInfo.name||""),O||F(hn.productInfo.description||""),X||W(hn.productInfo.category||""),hn.productInfo.type&&le(hn.productInfo.type))),qn&&Array.isArray(qn)){const Yn={"text-image":["quick-tip","storytelling","product-plug","behind-scenes"],video:["product-plug","hook-tease","fast-facts","mini-explainer","ai-voiceover-clips","vox-style","app-demo"],"long-video":["step-tutorial","top-list","explainer-video","brand-story","scripted-story","vox-style","app-demo","podcast-discussion"]},xn={"text-image":"quick-tip",video:"product-plug","long-video":"step-tutorial"},Wr=qn.map(jt=>{var I,V,$,K,ie,he,fe,ye,je,We,De,Me,ot,Ke,Ot,$t,Tt;const En=(jt.contentType||"").toLowerCase();let v="video";En.includes("long")?v="long-video":En.includes("short")||En.includes("video")?v="video":(En.includes("text")||En.includes("image"))&&(v="text-image");const w=(jt.contentStyle||"").trim(),N=(Yn[v]||[]).includes(w)?w:xn[v],C=jt.imageGenerationOption,k=v==="text-image"?C==="generate-ai"?"generate-ai":C==="user-media"?"user-media":"free-samples":"free-samples",R=
5784ht=>{if(!ht)return"English";const Xt=ht.toLowerCase();return Xt.includes("portug")||Xt.includes("pt")?"Portuguese":Xt.includes("span")||Xt.includes("espa")?"Spanish":Xt.includes("french")||Xt.includes("fran")?"French":Xt.includes("germ")||Xt.includes("deut")?"German":Xt.includes("ital")?"Italian":Xt.includes("japan")?"Japanese":Xt.includes("korean")?"Korean":Xt.includes("chin")?"Chinese":Xt.includes("hind")?"Hindi":Xt.includes("arab")?"Arabic":ht.trim().charAt(0).toUpperCase()+ht.trim().slice(1).toLowerCase()};return{day:jt.day,time:jt.time,config:{workflowType:v,contentMode:we,mediaFiles:te,language:R(jt.language),workflowSubType:N,imageGenerationOption:k,numberOfImages:jt.numberOfImages!==void 0&&jt.numberOfImages!==null?Number(jt.numberOfImages):Math.floor(Math.random()*9)+2,postDescription:jt.postCaption||"",t2iPromptHint:jt.t2iPromptHint||"",creativeBrief:jt.creativeBrief||void 0,podcastOptions:N==="podcast-discussion"?Qat(((I=hn.productInfo)==null?void 0:I.name)||D||((V=jt.postCaption)==null?void 0:V.substring(0,60))||"Topic discussion",R(jt.language)):void 0,productName:(($=hn.productInfo)==null?void 0:$.name)||D||"",productDescription:((K=hn.productInfo)==null?void 0:K.description)||O||"",productCategory:((ie=hn.productInfo)==null?void 0:ie.category)||X||"",productType:((he=hn.productInfo)==null?void 0:he.type)||jt.productType||ae||"software",productUrl:((fe=Ee[0])==null?void 0:fe.url)||J||"",videoGenerationLimit:(()=>{var Et;const ht=v==="long-video"||jt.contentType==="Long Video"||jt.workflowType==="long-video",Xt=(Et=jt.videoSettings)!=null&&Et.duration?Number(jt.videoSettings.duration):ht?60:30;return ht?Math.min(90,Math.max(30,Xt)):Math.min(30,Math.max(15,Xt))})(),videoSettings:{duration:(()=>{var Et;const ht=v==="long-video"||jt.contentType==="Long Video"||jt.workflowType==="long-video",Xt=(Et=jt.videoSettings)!=null&&Et.duration?Number(jt.videoSettings.duration):ht?60:30;return ht?Math.min(90,Math.max(30,Xt)):Math.min(30,Math.max(15,Xt))})(),videoSourceOption:((ye=jt.videoSettings)==null?void 0:ye.videoSourceOption)||"free-samples",enableViralHook:((je=jt.videoSettings)==null?void 0:je.enableViralHook)!==void 0?!!((We=jt.videoSettings)!=null&&We.enableViralHook):!0,enableBackgroundMusic:((De=jt.videoSettings)==null?void 0:De.enableBackgroundMusic)!==void 0?!!((Me=jt.videoSettings)!=null&&Me.enableBackgroundMusic):!0,enableCaptions:!0,enableInfographics:!0,enableAvatar:jt.contentType==="Long Video"||jt.workflowType==="long-video"?!1:((ot=jt.videoSettings)==null?void 0:ot.enableAvatar)??!1},enableViralHook:((Ke=jt.videoSettings)==null?void 0:Ke.enableViralHook)!==void 0?!!((Ot=jt.videoSettings)!=null&&Ot.enableViralHook):!0,enableBackgroundMusic:(($t=jt.videoSettings)==null?void 0:$t.enableBackgroundMusic)!==void 0?!!((Tt=jt.videoSettings)!=null&&Tt.enableBackgroundMusic):!0,enableCaptions:!0,enableInfographics:!0},reasoning:jt.reasoning}});pt(Wr),At(2)}else gr.error(i("Failed to generate strategy."))}catch{gr.error(i("An error occurred."))}finally{Xe(!1)}},ff=async de=>{var xt;Oi(!1);const me=pe;if(!(me!=null&&me.isRss))return;const Be=20;Qe("rss"),Xe(!0);try{await l({amount:Be}),t()}catch{gr.error(i("Failed to deduct credits.")),Xe(!1);return}try{const Ct=await QSe({feedUrl:me.feedUrl,feedTitle:me.feedTitle,siteUrl:me.siteUrl});if(gr.dismiss("rss-gen"),Ct!=null&&Ct.posts&&Array.isArray(Ct.posts)&&Ct.posts.length>
57840){const zt=Ct.posts.map(Wt=>{var hn;return{day:Wt.day,time:Wt.time,config:lte({...Wt.config,contentMode:we,mediaFiles:te,productUrl:Wt.config.rssItemLink||((hn=Ee[0])==null?void 0:hn.url)||""}),reasoning:Wt.reasoning}});pt(zt),!D&&me.feedTitle&&P(me.feedTitle),!J&&me.siteUrl&&ee(me.siteUrl),gr.success(i("Generated {n} posts â one per article",{n:zt.length})+" ð°"),At(2),de&&await am(me,((xt=zt[0])==null?void 0:xt.config)||{})}else gr.error(i("Could not generate RSS strategy. Try again."))}catch(Ct){gr.dismiss("rss-gen"),gr.error((Ct==null?void 0:Ct.message)||"Failed to generate RSS strategy.")}finally{Xe(!1)}},am=async(de,me)=>{if(de){Gn(!0);try{const Be={workflowType:me.workflowType||_,workflowSubType:me.workflowSubType||T,language:me.language||"English",socialMedias:re,imageGenerationOption:me.imageGenerationOption||Do,numberOfImages:me.numberOfImages||$l,enableCaptions:!0,enableInfographics:!0,videoGenerationLimit:me.videoGenerationLimit||Er,videoSettings:me.videoSettings||{},enableViralHook:me.enableViralHook!==void 0?me.enableViralHook:Ni,enableBackgroundMusic:me.enableBackgroundMusic!==void 0?me.enableBackgroundMusic:Ic,contentMode:we,productName:D||de.feedTitle||"",productCategory:"Blog / Content",productType:"software"};await KSe({feedUrl:de.feedUrl,feedTitle:de.feedTitle,siteUrl:de.siteUrl,workflowTemplate:Be}),gr.success("â
"+i("Blog sync active! New articles will auto-post to your accounts."),{duration:5e3})}catch(Be){gr.error(i("Could not enable auto-sync: ")+((Be==null?void 0:Be.message)||"Unknown error"))}finally{Gn(!1)}}},md=de=>{var Ct,zt;const me=de.toLowerCase(),Be=de.charAt(0).toUpperCase()+de.slice(1),xt=((Ct=mt==null?void 0:mt.times)==null?void 0:Ct[me])??((zt=mt==null?void 0:mt.times)==null?void 0:zt[Be])??(mt==null?void 0:mt.time)??"09:00";return Array.isArray(xt)?xt.length>0?xt:["09:00"]:typeof xt=="string"&&xt.trim().length>0?[xt]:["09:00"]},Ig=(de,me,Be)=>{const xt=de.toLowerCase(),Ct=[...md(xt)];Ct[me]=Be,bt(zt=>({...zt||{type:"weekly",days:[xt]},times:{...(zt==null?void 0:zt.times)||{},[xt]:Ct}}))},Ql=de=>{const me=de.toLowerCase(),Be=md(me);if(Be.length>=5){gr.error(i("Maximum 5 post times per day allowed"));return}const xt=Be[Be.length-1]||"09:00",[Ct,zt]=xt.split(":").map(Number),Wt=(Ct+4)%24,hn=`${String(Wt).padStart(2,"0")}:${String(isNaN(zt)?0:zt).padStart(2,"0")}`,qn=[...Be,hn];bt(Yn=>({...Yn||{type:"weekly",days:[me]},times:{...(Yn==null?void 0:Yn.times)||{},[me]:qn}}))},hs=(de,me)=>{const Be=de.toLowerCase(),xt=md(Be);if(xt.length<=1)return;const Ct=xt.filter((zt,Wt)=>Wt!==me);bt(zt=>({...zt||{},times:{...(zt==null?void 0:zt.times)||{},[Be]:Ct}}))},Nn=de=>{const me=(mt==null?void 0:mt.days)||["monday","wednesday","friday"],Be={};me.forEach(xt=>{Be[xt.toLowerCase()]=[...de]}),bt(xt=>({...xt||{type:"weekly"},days:me,times:Be})),gr.success(i("Applied {n} post times across all active days",{n:de.length}))},xo=()=>{if(!(mt!=null&&mt.days)||mt.days.length===0){gr.error(i("Please select at least one day."));return}const de=T||(_==="video"?"product-plug":"quick-tip"),me=[];mt.days.forEach(Be=>{md(Be).forEach(Ct=>{me.push({day:Be,time:Ct,config:{workflowType:_||"video",workflowSubType:de,language:bu||"English",contentMode:we||"ai-generated",mediaFiles:te||[],productName:D||"",productDescription:O||"",productCategory:X||"",productUrl:J||"",productType:ae||"software",videoSourceOption:Oc||"free-samples",imageGenerationOption:Do||"generate-ai",numberOfImages:$l||5,enableInfographics:Y0,enableCaptions:sf,enableVoice:xa,enableAvatar:Qo,avatarSource:ql,enableViralHook:Ni,enableBackgroundMusic:Ic,postDescription:U||""}})})}),pt(me),At(2)},$_=de=>{window.confirm("Are you sure you want to remove this scheduled post?")&&pt(me=>me.filter((Be,xt)=>xt!==de))},H_=()=>{var Ct;const de=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],me=new Set(qe.map(zt=>{var Wt;return(Wt=zt.day)==null?void 0:Wt.toLowerCase()})),Be=de.find(zt=>!me.has(zt))||"monday",xt=((Ct=mt==null?void 0:mt.times)==null?void 0:Ct[Be])||(mt==null?void 0:mt.time)||"09:00";pt(zt=>[...zt,{day:Be,time:xt,config:null}])},pf=de=>{const me=qe[de],Be=me.config?{...me,config:lte(me.config)}:me;if(Be.config){if(Be.config.workflowType&&M(Be.config.workflowType),Be.config.language){const xt=Be.config.language.toLowerCase();xt.includes("portug")||xt.includes("pt")?Dc("Portuguese"):xt.includes("span")||xt.includes("espa")?Dc("Spanish"):xt.includes("french")||xt.includes("fran")?Dc("French"):xt.includes("germ")||xt.includes("deut")?Dc("German"):xt.includes("ital")?Dc("Italian"):Dc(Be.config.language.charAt(0).toUpperCase()+Be.config.language.slice(1).toLowerCase())}if(Be.config.workflowSubType&&L(Be.config.workflowSubType),Qt(typeof Be.config.customScriptPrompt=="string"?Be.config.customScriptPrompt:""),Be.config.productName!==void 0&&P(Be.config.productName),Be.config.productDescription!==void 0&&F(Be.config.productDescription),Be.config.productCategory!==void 0&&W(Be.config.productCategory),Be.config.productUrl!==void 0&&ee(Be.config.productUrl),Be.config.productType!==void 0&&le(Be.config.productType),Be.config.videoGenerationLimit!==void 0){const xt=Number(Be.config.videoGenerationLimit),Ct=Be.config.workflowType==="long-video"||Be.contentType==="Long Video";Hl(Ct?Math.min(90,Math.max(30,xt)):Math.min(30,Math.max(15,xt)))}Be.config.enableCaptions!==void 0&&af(Be.config.enableCaptions),Be.config.numberOfImages!==void 0&&Be.config.numberOfImages!==null&&uh(Number(Be.config.numberOfImages)),Be.config.enableInfographics!==void 0&&Q0(Be.config.enableInfographics),Be.config.enableVoice!==void 0&&wu(Be.config.enableVoice),Be.config.enableAvatar!==void 0&&oh(Be.config.enableAvatar),Be.config.enableViralHook!==void 0&&jc(Be.config.enableViralHook),Be.config.enableBackgroun
5784dMusic!==void 0&&Wl(Be.config.enableBackgroundMusic),Be.config.selectedHookVideos!==void 0&&$e(Be.config.selectedHookVideos),Be.config.selectedHookUrl!==void 0&&be(Be.config.selectedHookUrl),Be.config.imageGenerationOption!==void 0&&Lc(Be.config.imageGenerationOption),Be.config.postDescription!==void 0&&B(Be.config.postDescription),Be.config.mediaFiles!==void 0&&ve(Be.config.mediaFiles),Be.config.productImages!==void 0&&Y(Be.config.productImages),Be.config.videoSourceOption!==void 0?cd(Be.config.videoSourceOption):cd(Be.config.workflowSubType==="product-plug"||Be.config.workflowType==="video"?"free-samples":"generate-ai"),Be.config.podcastOptions&&(hp(Be.config.podcastOptions),Be.config.podcastOptions.podcastSceneImageUrl&&_g(Be.config.podcastOptions.podcastSceneImageUrl))}Ne(de),Ft(!0)},An=()=>{if(ge!==null){const de=[...qe];de[ge].config={workflowType:_,language:bu,workflowSubType:T,imageGenerationOption:Do,videoSourceOption:Oc,numberOfImages:$l,enableInfographics:Y0,postDescription:U,productName:D,productDescription:O,productCategory:X,productUrl:J?J.startsWith("http")?J:`https://${J}`:"",productType:ae,videoGenerationLimit:Er,enableCaptions:sf,enableVoice:xa,enableAvatar:Qo,avatarSource:ql,enableViralHook:Ni,selectedHookVideos:Ge,selectedHookUrl:m,voiceGender:Ao,voiceType:ud,enableBackgroundMusic:Ic,mediaFiles:te,productImages:Z,podcastOptions:_==="podcast-video"||T==="podcast-discussion"?Lo:void 0,customScriptPrompt:_Ae(tn).text||void 0},pt(de)}Ft(!1),Ne(null)},va=async()=>{var de;if(!z){H(!0);try{const me=await m4e({productName:D,productDescription:O,productCategory:X,targetUrl:((de=Ee[0])==null?void 0:de.url)||J,contentStyle:T,language:bu});B(me.description||""),gr.success(i("Description generated!"))}catch(me){gr.error(me.message||"Failed to generate description")}finally{H(!1)}}},mh=async(de,me,Be)=>{var zt;const xt=[...qe];xt[de][me]=Be,pt(xt);const Ct=xt[de];if((zt=Ct.execution)!=null&&zt.workflowId)try{const Wt={type:"weekly",days:[Ct.day],times:{[Ct.day]:Ct.time},automationType:"one-off",timezoneOffset:new Date().getTimezoneOffset()};await Cm({id:Ct.execution.workflowId,schedule:JSON.stringify(Wt)}),gr.success(i("Schedule updated to {day} at {time}",{day:dt(Ct.day),time:St(Ct.time)}))}catch(Wt){console.error("Failed to update schedule in DB:",Wt),gr.error(i("Failed to save new schedule"))}},Jo=async de=>{const me=qe[de];if(!me.config||me.isGenerating)return;pt(xt=>{const Ct=[...xt];return Ct[de]={...Ct[de],isGenerating:!0},Ct}),M(me.config.workflowType||"video"),Dc(me.config.language||"English"),L(me.config.workflowSubType||"quick-tip");const Be=me.config.workflowType==="text-image"?20:100;if(!n||n.credits<Be){gr.error(i("You need {n} credits to generate this post.",{n:Be})),pt(xt=>{const Ct=[...xt];return Ct[de]={...Ct[de],isGenerating:!1},Ct});return}try{await l({amount:Be}),t(),Kl(de,me)}catch{gr.error(i("Failed to deduct credits.")),pt(Ct=>
5784{const zt=[...Ct];return zt[de]={...zt[de],isGenerating:!1},zt})}},Kl=async(de,me)=>{var Be,xt,Ct,zt,Wt,hn,qn,Yn,xn,Wr,jt,En,v,w,S,N,C;try{const k=me.config.workflowType||"video",R=k==="text-image",I=R?me.config.imageGenerationOption==="generate-ai"?"generate-ai":me.config.imageGenerationOption==="free-samples"?"free-samples":Do==="generate-ai"?"generate-ai":"free-samples":Do,V=(()=>{var Me;let De=me.config.productUrl||((Me=Ee[0])==null?void 0:Me.url)||J||"";De&&!De.startsWith("http")&&(De=`https://${De}`);try{const ot=new URL(De);if(ot.protocol==="http:"||ot.protocol==="https:")return De}catch{}return""})(),$=me.config.postDescription||U||"",K=me.config.productImages||Z||[];let ie=[];if(K.length>0)for(const De of K)if(De.name&&De.size&&!De.url)try{const{uploadUrl:Me,key:ot}=await dm({fileType:De.type,name:De.name}),Ke=Me.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?Me.replace("http://localhost:3001",Zi.apiUrl):Me;await Ns.put(Ke,De,{headers:{"Content-Type":De.type}}),ie.push({name:De.name,type:De.type,size:De.size,url:`${Zi.apiUrl}/api/download/${encodeURIComponent(ot)}`})}catch(Me){console.error("Failed to upload file:",Me)}else De.url&&ie.push(De);const he=me.config.mediaFiles||te||[];let fe=[];if(he.length>0)for(const De of he)if(De.name&&De.size&&!De.url)try{const{uploadUrl:Me,key:ot}=await dm({fileType:De.type,name:De.name}),Ke=Me.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?Me.replace("http://localhost:3001",Zi.apiUrl):Me;await Ns.put(Ke,De,{headers:{"Content-Type":De.type}}),fe.push({name:De.name,type:De.type,size:De.size,url:`${Zi.apiUrl}/api/download/${encodeURIComponent(ot)}`})}catch(Me){console.error("Failed to upload media file:",Me)}else De.url&&fe.push(De);let ye=ta?(Be=ea.find(De=>De.id===ta))==null?void 0:Be.url:null;if(ql==="user-provided")if(oa)try{const{uploadUrl:De,key:Me}=await dm({fileType:oa.type,name:oa.name}),ot=De.startsWith("http://localhost")&&Zi.apiUrl.includes("https")?De.replace("http://localhost:3001",Zi.apiUrl):De;await Ns.put(ot,oa,{headers:{"Content-Type":oa.type}}),ye=`${Zi.apiUrl}/api/download/${encodeURIComponent(Me)}`,bg(ye)}catch(De){console.error("Failed to upload avatar:",De)}else id&&(ye=id);const je={name:`${me.day} Post Workflow`,type:k,description:$||O||"",options:JSON.stringify({productName:me.config.productName||D,productDescription:me.config.productDescription||O,productCategory:me.config.productCategory||X,productUrl:V,productType:me.config.productType||ae,language:me.config.language||bu||"English",scheduledDay:String(me.day||"").toLowerCase()||void 0,scheduledTime:Array.isArray(me.time)?me.time[0]:me.time,postDescription:$,contentMode:me.config.contentMode||we,t2iPromptHint:me.config.t2iPromptHint||"",creativeBrief:me.config.creativeBrief||void 0,customScriptPrompt:typeof((xt=me.config)==null?void 0:xt.customScriptPrompt)=="string"?me.config.customScriptPrompt:void 0,workflowType:k,workflowSubType:me.config.workflowSubType||"quick-tip",imageGenerationOption:me.config.imageGenerationOption||I,numberOfImages:R?me.config.numberOfImages?Number(me.config.numberOfImages):$l?Number($l):1:null,includeUrl:Iy,postUrl:V_,generateHashtags:Fy,enableViralHashtags:Tg,enableInfographics:((Ct=me.config)==null?void 0:Ct.enableInfographics)??((Wt=(zt=me.config)==null?void 0:zt.videoSettings)==null?void 0:Wt.enableInfographics)??Y0,...R?{}:{videoGenerationLimit:k==="long-video"?Math.min(90,Math.max(30,Number(((hn=me.config)==null?void 0:hn.videoGenerationLimit)||((Yn=(qn=me.config)==null?void 0:qn.videoSettings)==null?void 0:Yn.duration)||Er||60))):Math.min(30,Math.max(15,Number(((xn=me.config)==null?void 0:xn.videoGenerationLimit)||((jt=(Wr=me.config)==null?void 0:Wr.videoSettings)==null?void 0:jt.duration)||Er||30))),videoSourceOption:((En=me.config)==null?void 0:En.videoSourceOption)||((w=(v=me.config)==null?void 0:v.videoSettings)==null?void 0:w.videoSourceOption)||Oc,enableCaptions:sf,enableVoice:xa,voiceGender:Ao,voiceType:ud,enableViralHook:((S=me.config)==null?void 0:S.enableViralHook)!==void 0?me.config.enableViralHook:Ni,enableBackgroundMusic:((N=me.config)==null?void 0:N.enableBackgroun
5784dMusic)!==void 0?me.config.enableBackgroundMusic:Ic,selectedMusicMood:Ng,narrationScript:((C=me.config)==null?void 0:C.narrationScript)||void 0,selectedHookVideos:Ge,selectedHookUrl:m,viralHookDuration:en},enableAvatar:Qo,avatarSource:ql,avatarFile:oa?oa.name:null,selectedAvatarUrl:ye,savedAvatars:ea,selectedAvatarId:ta,productImages:ie.length>0?ie:K.map(De=>({name:De.name,type:De.type,size:De.size})),mediaFiles:fe.length>0?fe:he.map(De=>({name:De.name,type:De.type,size:De.size,url:De.url||De.fileUrl||void 0}))}),mediaFiles:fe.length>0?JSON.stringify(fe):void 0,socialMedias:re,sources:Ee},We=await AS(je);We!=null&&We.id&&(pt(De=>{const Me=[...De];return Me[de].isGenerating=!0,Me[de].generationStartTime=Date.now(),Me[de].generationProgress=0,Me}),yv(We).then(De=>{pt(Me=>{const ot=[...Me];return ot[de].isGenerating=!1,ot[de].executionId=(De==null?void 0:De.id)||We.id,ot[de].execution={id:De==null?void 0:De.id,status:"processing",workflowId:We.id},ot}),nt(Me=>[...Me,{id:De==null?void 0:De.id,status:"processing",workflowId:We.id}])}).catch(De=>{gr.error(i("Failed to execute workflow")),pt(Me=>{const ot=[...Me];return ot[de].isGenerating=!1,ot})}))}catch{gr.error(i("Failed to generate post."))}};return c.jsxs(pl,{children:[c.jsx("div",{className:"relative w-full h-full min-h-[calc(100vh-64px)]",children:n!=null&&n.closed?c.jsx("div",{className:"flex items-center justify-center h-screen",children:c.jsx(Hf,{})}):c.jsx(c.Fragment,{children:c.jsxs("div",{className:"min-h-screen w-full",children:[c.jsx("div",{className:"relative z-10 pt-10 lg:pt-16 pb-8 lg:pb-10",children:c.jsx("div",{className:"w-full max-w-none px-4 sm:px-6 lg:px-8",children:c.jsxs("div",{className:"ws-enter text-center",children:[c.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-[rgba(207,255,5,.22)] bg-[rgba(207,255,5,.07)] py-1.5 pl-1.5 pr-3.5 ws-mono text-[11px] uppercase tracking-[0.14em] text-[#e9ffa1]",children:[c.jsx("b",{className:"rounded-full bg-[var(--lp-lime)] px-2 py-0.5 text-black",children:i("Autopilot")}),i(ft===1?"Step 1 of 3":ft===2?"Step 2 of 3":"Step 3 of 3")]}),c.jsx("h2",{className:"ws-display mt-5 text-4xl font-bold leading-[1.02] text-white sm:text-5xl lg:text-6xl",children:ft===1?c.jsxs(c.Fragment,{children:[i("Your content team,")," ",c.jsx("span",{className:"ws-gradient-text",children:i("on autopilot.")})]}):ft===2?c.jsxs(c.Fragment,{children:[i("Your week,")," ",c.jsx("span",{className:"ws-gradient-text",children:i("planned.")})]}):c.jsxs(c.Fragment,{children:[i("Ready to")," ",c.jsx("span",{className:"ws-gradient-text",children:i("go live.")})]})}),c.jsx("p",{className:"ws-muted mx-auto mt-4 max-w-2xl px-4 text-base sm:text-lg",children:i(ft===1?"Paste a link. We build a week of videos and carousels in your brand, then post them at peak hours.":ft===2?"Every post has its own format, hook and time slot. Tweak anything, then generate.":"Pick your channels, review the posts and lock in the schedule.")})]})})}),c.jsx("div",{className:"relative z-10 mb-8 w-full px-4 sm:px-6 lg:mb-10 lg:px-8",children:c.jsxs("div",{className:"ws-glass mx-auto max-w-5xl rounded-[24px] p-2 ws-enter",children:[c.jsx("div",{className:"relative grid grid-cols-3 gap-1",children:G_.map(de=>{const me=ft===de.number,Be=ft>de.number,xt=_s(de.number);return c.jsxs("button",{onClick:()=>xt&&At(de.number),disabled:!xt,className:`group relative flex items-center justify-center gap-3 rounded-[18px] px-3 py-3 text-left transition-all duration-500 sm:justify-start sm:px-4 ${me?"bg-white/[0.07] shadow-[inset_0_1px_0_rgba(255,255,255,.06)]":xt?"hover:bg-white/[0.035]":"cursor-not-allowed"}`,children:[c.jsx("span",{className:`relative grid h-9 w-9 shrink-0 place-items-center rounded-full text-sm font-bold transition-all duration-500 ${me?"bg-[var(--lp-lime)] text-black shadow-[0_0_0_4px_rgba(207,255,5,.15),0_0_24px_rgba(207,255,5,.5)]":Be?"bg-[rgba(207,255,5,.14)] text-[var(--lp-lime)] ring-1 ring-[rgba(207,255,5,.35)]":"bg-white/[0.04] text-white/40 ring-1 ring-white/10"}`,children:Be?c.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:3,viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):de.number}),c.jsxs("span",{className:"hidden min-w-0 sm:block",children:[c.jsx("span",{className:`block truncate text-sm font-semibold transition-colors ${me?"text-white":Be?"text-white/75":"text-white/45"}`,children:i(de.title)}),c.jsx("span",{className:"block truncate text-xs text-white/40",children:i(de.description)})]})]},de.number)})}),c.jsx("div",{className:"mx-3 mb-1 mt-2 h-[3px] overflow-hidden rounded-full bg-white/[0.06]",children:c.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-[#cfff05] via-[#7cf7c4] to-[#22d3ee] shadow-[0_0_14px_rgba(207,255,5,.6)] transition-all duration-700 ease-[
5784cubic-bezier(.22,1,.36,1)]",style:{width:`${(ft-1)/2*100||4}%`}})})]})}),c.jsx("div",{className:"relative z-10 w-full px-4 sm:px-6 lg:px-8 pb-8",children:c.jsxs("div",{className:"max-w-5xl mx-auto",children:[ft===1&&ke&&c.jsx(oot,{url:(gd=Ee[0])==null?void 0:gd.url,mode:et}),ft===1&&!ke&&c.jsxs("div",{className:"space-y-8 lg:space-y-10 ws-enter",children:[c.jsxs("div",{className:"relative mx-auto grid max-w-md grid-cols-2 rounded-full border border-white/[0.08] bg-white/[0.03] p-1",children:[c.jsx("span",{"aria-hidden":!0,className:`absolute inset-y-1 w-[calc(50%-4px)] rounded-full bg-[var(--lp-lime)] shadow-[0_10px_30px_-10px_rgba(207,255,5,.8)] transition-transform duration-500 ease-[cubic-bezier(.22,1,.36,1)] ${Ce==="manual"?"translate-x-full":"translate-x-0"}`,style:{left:4}}),c.jsx("button",{className:`relative z-10 rounded-full py-2.5 text-sm font-bold transition-colors duration-300 ${Ce==="automated"?"text-black":"text-white/60 hover:text-white"}`,onClick:()=>Se("automated"),children:i("Automated strategy")}),c.jsx("button",{className:`relative z-10 rounded-full py-2.5 text-sm font-bold transition-colors duration-300 ${Ce==="manual"?"text-black":"text-white/60 hover:text-white"}`,onClick:()=>Se("manual"),children:i("Manual post")})]}),c.jsxs("div",{className:"ws-glass rounded-[28px] p-6 sm:p-8",children:[c.jsx("div",{className:"ws-kicker mb-2",children:i("The source")}),c.jsx("h3",{className:"ws-display text-2xl sm:text-3xl font-bold text-white mb-6",children:i("What should we promote?")}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-8",children:[{id:"ai-generated",label:i("AI Generated Content"),tag:i("Default"),desc:i("Generate visuals, videos, and scripts with AI models"),icon:c.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{id:"mixed",label:i("Mixed"),tag:i("Media + AI"),desc:i("Mix your original photos & videos with AI copy and workflows"),icon:c.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})},{id:"original-only",label:i("Original Content Only"),tag:i("No AI Visuals"),desc:i("Strictly use only your uploaded media for all generated posts"),icon:c.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})})}].map(de=>{const me=we===de.id;return c.jsxs("button",{type:"button",onClick:()=>Ue(de.id),className:`relative p-4 rounded-2xl border text-left transition-all duration-300 flex flex-col justify-between hover:-translate-y-0.5 ${me?"border-[rgba(207,255,5,.55)] bg-[rgba(207,255,5,.06)] shadow-[0_20px_50px_-24px_rgba(207,255,5,.5)]":"border-white/[0.08] bg-white/[0.02] hover:border-white/20"}`,children:[c.jsxs("div",{className:"flex items-center justify-between w-full mb-2",children:[c.jsx("div",{className:`p-2 rounded-lg ${me?"bg-emerald-500 text-white":"bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400"}`,children:de.icon}),de.tag&&c.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded-full ${me?"bg-emerald-500 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400"}`,children:de.tag})]}),c.jsxs("div",{children:[c.jsx("div",{className:"font-bold text-sm text-gray-900 dark:text-white mb-1",children:de.label}),c.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 leading-snug",children:de.desc})]}),me&&c.jsxs("div",{className:"absolute top-2 right-2 flex h-2 w-2",children:[c.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),c.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]})]},de.id)})}),Ee.map((de,me)=>c.jsxs("div",{className:"flex flex-col space-y-3 mb-6",children:[c.jsx("label",{className:"text-sm font-semibold text-white/80",children:i(we==="original-only"?"Website or social link (optional context)":we==="mixed"?"Website or social link (optional if you upload files)":"Website or social link")}),c.jsxs("div",{className:"relative group w-full",children:[c.jsx("div",{className:"absolute -inset-px rounded-full bg-gradient-to-r from-[#cfff05]/40 via-[#22d3ee]/30 to-[#8b5cf6]/40 opacity-40 blur-[2px] transition duration-500 group-focus-within:opacity-100 group-hover:opacity-70"}),c.jsx("input",{type:"text",className:"relative w-full rounded-full border border-white/10 bg-[#0a0c12] px-7 py-5 text-lg text-white placeholder-white/30 shadow-[0_0_0_6px_rgba(207,255,5,.04)] outline-none transition-all focus:border-[rgba(207,255,5,.6)]",placeholder:i("Paste your website or social link, e.g. yourbrand.com"),value:de.url,onChange:Be=>{const xt=[...Ee];xt[me].url=Be.target.value.toLowerCase(),Ae(xt),Nr(null)},onBlur:hf}),zr&&me===0&&c.jsxs("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 flex items-center gap-1.5 text-xs text-gray-400",children:[c.jsxs("svg",{className:"animate-spin w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",children:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"})]}),i("Detectingâ¦")]})]}),(pe==null?void 0:pe.isRss)&&me===0&&c.jsxs("button",{onClick:()=>Oi(!0),className:"flex items-center gap-2.5 px-4 py-2.5 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700/50 rounded-xl text-left hover:border-amber-400 dark:hover:border-amber-500 transition-all group/rss",children:[c.jsx("span",{className:"text-lg",children:"ð¡"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("span",{className:"text-xs font-bold text-amber-700 dark:text-amber-400 uppercase tracking-wide",children:i("RSS Feed Detected")}),c.jsx("span",{className:"text-xs font-medium text-amber-600 dar
5784k:text-amber-500 bg-amber-100 dark:bg-amber-900/40 px-2 py-0.5 rounded-full",children:i("{n} articles available",{n:pe.itemCount})})]}),c.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-400/80 mt-0.5 truncate",children:[pe.feedTitle||pe.feedUrl," · ",i("Posts will be generated per article")]})]}),c.jsx("span",{className:"text-xs text-amber-500 dark:text-amber-400 group-hover/rss:translate-x-0.5 transition-transform font-medium shrink-0",children:i("Configure â")})]})]},me)),(we==="mixed"||we==="original-only")&&c.jsxs("div",{className:"mt-6 pt-6 border-t border-gray-100 dark:border-[#252A36] animate-fade-in",children:[c.jsx("div",{className:"flex items-center justify-between mb-3",children:c.jsxs("div",{children:[c.jsxs("label",{className:"text-sm font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[c.jsx("span",{children:i("Original Media Upload")}),c.jsx("span",{className:"text-xs font-medium text-emerald-500 bg-emerald-500/10 px-2 py-0.5 rounded-full",children:i(we==="original-only"?"Strictly Original Media":"Mixed with AI")})]}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:i(we==="original-only"?"Upload images and videos â only your media is used for post visuals (AI visual rendering is disabled). Add PDFs (brochures, catalogs, briefs) and the weekly plan is written from them.":"Upload images, videos or PDFs. The weekly plan is based on your files, and AI Director mixes your media with AI-assisted posts.")})]})}),c.jsx(bte,{id:"step1-content-media-upload",files:te,onMediaChange:de=>ve(de),allowDocuments:!0})]})]}),Ce==="manual"&&(()=>{const de=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],me=(mt==null?void 0:mt.days)||[];let Be=0;return me.forEach(xt=>{Be+=md(xt).length}),c.jsxs("div",{className:"bg-gray-50 dark:bg-[#1A1D24] p-6 rounded-2xl border border-gray-200 dark:border-[#252A36] space-y-6",children:[c.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 pb-4 border-b border-gray-200 dark:border-[#252A36]",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white",children:i("Weekly Schedule")}),c.jsx("span",{className:"text-xs font-bold px-2.5 py-1 rounded-full bg-[#CFFF05]/15 text-[#0F121A] dark:text-[#CFFF05] border border-[#CFFF05]/30",children:Be===1?i("1 post / week"):i("{n} posts / week",{n:Be})})]}),c.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:[i("Select your active publishing days and schedule")," ",c.jsx("strong",{children:i("up to 5 posts per day")}),"."]})]}),c.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[c.jsx("span",{className:"text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mr-1",children:i("Presets:")}),c.jsx("button",{type:"button",onClick:()=>Nn(["09:00"]),className:"text-xs font-medium px-2.5 py-1 rounded-lg bg-white dark:bg-[#0F121A] border border-gray-200 dark:border-[#252A36] text-gray-700 dark:text-gray-300 hover:border-[#CFFF05] hover:text-[#0F121A] dark:hover:text-white transition-all shadow-sm",children:i("1/day (09:00)")}),c.jsx("button",{type:"button",onClick:()=>Nn(["09:00","18:00"]),className:"text-xs font-medium px-2.5 py-1 rounded-lg bg-white dark:bg-[#0F121A] border border-gray-200 dark:border-[#252A36] text-gray-700 dark:text-gray-300 hover:border-[#CFFF05] hover:text-[#0F121A] dark:hover:text-white transition-all shadow-sm",children:i("2/day (09:00, 18:00)")}),c.jsx("button",{type:"button",onClick:()=>Nn(["09:00","14:00","20:00"]),className:"text-xs font-medium px-2.5 py-1 rounded-lg bg-white dark:bg-[#0F121A] border border-gray-200 dark:border-[#252A36] text-gray-700 dark:text-gray-300 hover:border-[#CFFF05] hover:text-[#0F121A] dark:hover:text-white transition-all shadow-sm",children:i("3/day (Prime)")})]})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-7 gap-3.5",children:de.map(xt=>{const Ct=me.some(qn=>qn.toLowerCase()===xt),Wt=(xt.charAt(0).toUpperCase()+xt.slice(1)).slice(0,3),hn=md(xt);return c.jsxs("div",{className:`flex flex-col rounded-2xl border transition-all duration-200 overflow-hidden ${Ct?"bg-white dark:bg-[#0F121A] border-[#CFFF05] dark:border-[#CFFF05] shadow-[0_0_15px_rgba(207,255,5,0.1)] ring-1 ring-[#CFFF05]/40":"bg-white/60 dark:bg-[#0F121A]/60 border-gray-200 dark:border-[#252A36] opacity-75 hover:opacity-100 hover:border-gray-300 dark:hover:border-[#3A4150]"}`,children:[c.jsxs("button",{type:"button",onClick:()=>{const qn=(mt==null?void 0:mt.days)||[],Yn=Ct?qn.filter(xn=>xn.toLowerCase()!==xt):[...qn,xt];bt({...mt,days:Yn})},className:`w-full p-3 text-left flex items-center justify-between border-b transition-colors ${Ct?"bg-[#CFFF05]/10 dark:bg-[#CFFF05]/10 border-[#CFFF05]/30":"bg-gray-100/50 dark:bg-[#1A1D24]/50 border-gray-200 dark:border-[#252A36]"}`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:`w-2.5 h-2.5 rounded-full transition-all ${Ct?"bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.8)]":"bg-gray-300 dark:bg-gray-600"}`}),c.jsx("span",{className:`text-sm font-bold ${Ct?"text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-400"}`,children:i(Wt)})]}),Ct&&c.jsxs("span",{className:"text-[10px] font-extrabold px-1.5 py-0.5 rounded-md bg-[#CFFF05] text-[#0F121A]",children:[hn.length,"/5"]})]}),c.jsx("div",{className:"p-3 flex-1 flex flex-col justify-between space-y-2.5 min-h-[140px]",children:Ct?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"space-y-2",children:hn.map((qn,Yn)=>c.jsxs("div",{className:"flex items-center gap-1.5 group",children:[c.jsx("span",{className:"text-[10px] font-mono text-gray-400 dark:text-gray-500 w-3.5 flex-shrink-0 text-center",children:Yn+1}),c.jsx("input",{type:"time",value:qn,onChange:xn=>Ig(xt,Yn,xn.target.value),className:"w-full bg-gray-50 dark:bg-[#1A1D24] border border-gray-200 dark:border-[#252A36] focus:border-[#CFFF05] focus:ring-1 focus:ring-[#CFFF05] rounded-lg px-2 py-1.5 text-xs font-semibold text-gray-900 dark:text-white outline-none transition-all"}),hn.length>1&&c.jsx("button",{type:"button",onClick:()=>hs(xt,Yn),title:i("Remove time"),className:"p-1 rounded text-gray-400 hover:text-red-500 hover:bg-red-500/10 transition-colors flex-shrink-0",children:c.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M6 18L18 6M6 6l12 12"})})})]},Yn))}),hn.length<5?c.jsxs("button",{type:"button",onClick:()=>Ql(xt),className:"w-full mt-2 py-1.5 px-2 rounded-lg border border-dashed border-gray-300 dark:border-[#3A4150] hover:border-[#CFFF05] dark:hover:border-[#CFFF05] text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-[#CFFF05] text-[11px] font-bold transition-all flex items-center justify-center gap-1 group",children:[c.jsx("span",{className:"text-base leading-none group-hover:scale-110 transition-transform",children:"+"}),i("Add time")]}):c.jsx("div",{className:"text-center mt-2 py-1 rounded bg-gray-100 dark:bg-[#1A1D24] text-[10px] font-bold text-gray-400 dark:text-gray-500",children:i("Max 5 times")})]}):c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center p-2",children:[c.jsx("span",{className:"text-[11px] text-gray-400 dark:text-gray-500 font-medium",children:i("Off")}),c.jsx("button",{type:"button",onClick:()=>{const qn=(mt==null?void 0:mt.days)||[];bt({...mt,days:[...qn,xt]})},className:"mt-2 text-[10px] font-bold text-emerald-500 hover:underline",children:i("+ Enable")})]})})]},xt)})})]})})()]}),ft===2&&c.jsxs("div",{className:"space-y-8 ws-enter",children:[c.jsxs("div",{className:"mb-8 flex flex-col sm:flex-row justify-between gap-4 sm:items-center",children:[c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-2",children:qe.length===1?i("1 post this week"):i("{n} posts this week",{n:qe.length})}),c.jsx("h2",{className:"ws-display text-3xl font-bold text-white mb-1",children:i("Weekly schedule")}),c.jsx("p",{className:"ws-muted",children:i("Generate each post now, or let Auto-Pilot do it every week.")})]}),Ce==="automated"&&(()=>{const de=(n==null?void 0:n.subscriptionStatus)==="active"||(n==null?void 0:n.subscriptionPlan)==="pro",me=rm(_),Be=me*3,xt=((n==null?void 0:n.credits)||0)>=Be,Ct=de&&xt;return c.jsxs("div",{title:de?xt?"":i("You need {n} credits to enable Auto-Pilot",{n:Be}):i("Upgrade to Pro/Premium to unlock Auto-Pilot"),className:`relative flex items-center gap-4 pl-4 pr-5 py-3 rounded-2xl border transition-all duration-200 5785 ${Te?"bg-emerald-50 dark:bg-emerald-400/10 border-emerald-400/40 shadow-[0_0_16px_rgba(52,211,153,0.15)]":Ct?"bg-white dark:bg-slate-900 border-gray-200 dark:border-slate-700 hover:border-emerald-400/30 dark:hover:border-emerald-400/30 shadow-sm":"bg-gray-50 dark:bg-slate-900/60 border-gray-100 dark:border-slate-800 opacity-70"}`,children:[!de&&c.jsx("span",{className:"absolute -top-2.5 -right-2 bg-amber-400 text-slate-900 text-[9px] font-extrabold px-2 py-0.5 rounded-full uppercase tracking-widest shadow-md",children:i("PRO")}),c.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[c.jsxs("div",{className:`relative flex-shrink-0 w-8 h-8 rounded-xl flex items-center justify-center text-base 5786 ${Te?"bg-emerald-100 dark:bg-emerald-400/20 text-emerald-600 dark:text-emerald-400":Ct?"bg-gray-100 dark:bg-slate-800 text-gray-500 dark:text-slate-400":"bg-gray-200/50 dark:bg-slate-800/50 text-gray-400 dark:text-slate-600"}`,children:[Ct?"ð¤":"ð",Te&&c.jsx("span",{className:"absolute inset-0 rounded-xl animate-ping bg-emerald-400/20"})]}),c.jsxs("div",{children:[c.jsx("p",{className:`text-sm font-bold leading-tight 5787 ${Te?"text-emerald-600 dark:text-emerald-400":Ct?"text-gray-900 dark:text-slate-200":"text-gray-500 dark:text-slate-500"}`,children:i("Auto-Pilot")}),c.jsx("p",{className:`text-[11px] leading-tight mt-0.5 5788 ${Te?"text-emerald-600/70 dark:text-emerald-400/70":Ct?"text-gray-500 dark:text-slate-500":"text-gray-400 dark:text-slate-600"}`,children:de?xt?i(Te?"Generates every week â":"Auto-generates weekly"):i("{n} credits needed",{n:Be}):i("Pro/Premium required")})]})]}),c.jsx(ITe,{checked:Te,onChange:zt=>{if(zt&&!de){gr.error(i("Upgrade to a Pro or Premium plan to use Continuous Auto-Pilot."));return}if(zt&&!xt){gr.error(i("You need at least {n} credits ({cost}/post à 3 posts/week).",{n:Be,cost:me}));return}oe(zt),zt&&setTimeout(()=>At(3),3e3)},className:`flex-shrink-0 relative inline-flex h-6 w-11 items-center rounded-full border-2 border-transparent transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-400/40 focu
5788s:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-slate-900 5789 ${Ct?"cursor-pointer":"cursor-not-allowed"} 5790 ${Te?"bg-emerald-400":"bg-gray-300 dark:bg-slate-700"}`,children:c.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 transform rounded-full shadow-lg ring-0 transition-transform duration-200 5791 ${Te?"translate-x-5 bg-white dark:bg-slate-900":"translate-x-0 bg-white dark:bg-slate-300"}`})})]})})()]}),Te&&Ce==="automated"&&c.jsxs("div",{className:"flex items-center gap-3 px-5 py-3 rounded-xl bg-emerald-400/10 border border-emerald-400/30 text-emerald-400 mb-2 animate-fade-in",children:[c.jsx("span",{className:"text-lg",children:"ð¤"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-bold leading-tight",children:i("Auto-Pilot is ON â No manual generation needed")}),c.jsxs("p",{className:"text-[11px] text-emerald-400/70 mt-0.5",children:[i("The AI will automatically generate and schedule your posts each week. Just click")," ",c.jsxs("strong",{children:['"',i("Review & schedule"),'"']})," ",i("to confirm the days.")]})]})]}),c.jsx("div",{className:"ws-stagger grid grid-cols-1 md:grid-cols-2 gap-5",children:qe.map((de,me)=>{var Yn,xn,Wr,jt,En,v,w,S,N,C,k,R,I,V,$,K,ie,he,fe,ye,je,We,De,Me,ot;let Be=0,xt=0;const Ct=((Yn=de.config)==null?void 0:Yn.workflowType)||_,zt=((xn=de.config)==null?void 0:xn.workflowSubType)||T,Wt=(((Wr=de.config)==null?void 0:Wr.imageGenerationOption)||Do)==="generate-ai",hn=Number(((jt=de.config)==null?void 0:jt.numberOfImages)||$l||1),qn=Number(((En=de.config)==null?void 0:En.videoGenerationLimit)||Er||60);return Be=yte({type:Ct,subType:zt,durationSeconds:qn,podcastSeconds:((w=(v=de.config)==null?void 0:v.podcastOptions)==null?void 0:w.duration)||(Lo==null?void 0:Lo.duration),aiImages:Wt?hn:0,byok:cx}),Ct==="text-image"?xt=Wt?Math.max(3,hn*2):2:zt==="vox-style"||zt==="app-demo"?xt=40:Ct==="long-video"?xt=Math.max(20,Math.max(1,Math.ceil(qn/60))*20):xt=20,c.jsxs("div",{className:`ws-card relative overflow-hidden group p-6 hover:-translate-y-0.5 hover:shadow-[0_30px_70px_-40px_rgba(207,255,5,.35)] 5792 ${Te&&!de.executionId?"!border-[rgba(207,255,5,.2)]":""}`,children:[c.jsx("div",{className:"pointer-events-none absolute -right-16 -top-16 h-40 w-40 rounded-full bg-[rgba(207,255,5,.08)] blur-3xl opacity-0 transition-opacity duration-500 group-hover:opacity-100","aria-hidden":!0}),c.jsxs("div",{className:"flex justify-between items-start mb-4",children:[c.jsxs("div",{children:[c.jsx("select",{value:((S=de.day)==null?void 0:S.toLowerCase())||"monday",onChange:Ke=>mh(me,"day",Ke.target.value),className:"ws-display -ml-1 rounded-lg border-0 bg-transparent py-0 pl-1 pr-8 text-2xl font-bold text-white capitalize outline-none ring-0 focus:ring-0 cursor-pointer hover:text-[var(--lp-lime)] transition-colors disabled:opacity-80 disabled:cursor-default",children:["monday","tuesday","wednesday","thursday","friday","saturday","sunday"].map(Ke=>c.jsx("option",{value:Ke,className:"bg-white dark:bg-slate-900 text-base capitalize",children:dt(Ke)},Ke))}),c.jsx("div",{className:"ws-mono text-sm text-[var(--lp-lime)] flex items-center mt-1",children:c.jsx("input",{type:"time",value:de.time||"09:00",onChange:Ke=>mh(me,"time",Ke.target.value),className:"border-0 bg-transparent p-0 outline-none ring-0 focus:ring-0 cursor-pointer hover:text-white transition-colors disabled:opacity-80 disabled:cursor-default"})})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[de.isGenerating||((N=de.execution)==null?void 0:N.status)==="processing"||((C=de.execution)==null?void 0:C.status)==="pending"?c.jsxs("div",{className:"bg-amber-500/20 text-amber-500 px-3 py-1 rounded-full text-xs font-bold border border-amber-500/30 flex items-center gap-1.5",children:[c.jsx("div",{className:"w-2 h-2 bg-amber-500 rounded-full animate-pulse"}),i("Generating...")]}):((k=de.execution)==null?void 0:k.status)==="completed"||((R=de.execution)==null?void 0:R.status)==="succeeded"||((I=de.execution)==null?void 0:I.status)==="posted"?c.jsxs("div",{className:"bg-emerald-500/20 text-emerald-500 px-3 py-1 rounded-full text-xs font-bold border border-emerald-500/30 flex items-center gap-1.5",children:[c.jsx("span",{children:"â "})," ",i("Ready")]}):((V=de.execution)==null?void 0:V.status)==="failed"?c.jsxs("div",{className:"bg-red-500/20 text-red-500 px-3 py-1 rounded-full text-xs font-bold border border-red-500/30 flex items-center gap-1.5",children:[c.jsx("span",{children:"â"})," ",i("Failed")]}):(($=de.execution)==null?void 0:$.status)==="cancelled"?c.jsxs("div",{className:"bg-gray-500/20 text-gray-400 px-3 py-1 rounded-full text-xs font-bold border border-gray-500/30 flex items-center gap-1.5",children:[c.jsx("span",{children:"â¹ï¸"})," ",i("Stopped")]}):Te?c.jsxs("div",{className:"bg-emerald-400/10 text-emerald-400 px-3 py-1 rounded-full text-xs font-bold border border-emerald-400/20 flex items-center gap-1",children:[c.jsx("span",{children:"ð¤"})," ",i("Auto")]}):c.jsx("div",{className:"bg-gray-200 dark:bg-[#252A36] text-gray-600 dark:text-gray-400 px-3 py-1 rounded-full text-xs font-bold border border-gray-300 dark:border-[#3A4150]",children:i("Pending")}),!de.executionId&&!de.isGenerating&&c.jsx("button",{onClick:()=>$_(me),className:"p-1.5 text-gray-400 hover:text-red-500 hover:bg-red-500/10 rounded-lg transition-colors",title:i("Remove post"),children:c.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),de.config?c.jsxs("div",{className:"space-y-3 mb-6",children:[c.jsxs("div",{className:"flex flex-wrap gap-2 text-xs font-semibold",children:[c.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/[0.06] px-3 py-1.5 text-white/85 ring-1 ring-white/10",children:[c.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${de.config.workflowType==="text-image"?"bg-[#8b5cf6]":de.config.workflowType==="long-video"||de.config.workflowType==="podcast-video"?"bg-[#22d3ee]":"bg-[#cfff05]"}`}),de.config.workflowType==="text-image"?i("Carousel"):de.config.workflowType==="long-video"||de.config.workflowType==="podcast-video"?i("Long video"):i("Short video")]}),c.jsx("span",{className:"inline-flex items-center rounded-full bg-white/[0.03] px-3 py-1.5 capitalize text-white/60 ring-1 ring-white/[0.08]",children:i(lct[de.config.workflowSubType||"quick-tip"]||(de.config.workflowSubType||"quick-tip").replace(/-/g," "))})]}),de.reasoning&&c.jsx("p",{className:"border-l-2 border-[rgba(207,255,5,.5)] pl-3 text-sm leading-relaxed text-white/60",children:de.reasoning}),!de.executionId&&c.jsxs("button",{onClick:()=>pf(me),className:"inline-flex items-center gap-1.5 text-sm font-semibold text-white/70 transition-colors hover:text-[var(--lp-lime)]",children:[c.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),i("Edit post settings")]})]}):c.jsx("div",{className:"mb-6",children:c.jsx("button",{onClick:()=>pf(me),className:"w-full py-4 border-2 border-dashed border-gray-300 dark:border-[#3A4150] rounded-xl text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:text-white hover:border-slate-500 hover:bg-gray-200 dark:bg-[#252A36]/30 transition-all font-medium flex items-center justify-center",children:i("Configure Content Settings")})}),!de.executionId&&!de.isGenerating&&de.config&&c.jsx("div",{className:"flex flex-col items-center gap-2",children:c.jsxs("button",{onClick:()=>Jo(me),disabled:de.isGenerating||Te,className:"ws-btn ws-btn-primary w-full !h-12",children:[i("Generate post"),c.jsxs("span",{className:"ws-mono rounded-full bg-black/10 px-2 py-0.5 text-[11px] font-bold",children:[Be," cr",cx?" · BYOK":""]})]})}),(de.isGenerating||((K=de.execution)==null?void 0:K.status)==="processing"||((ie=de.execution)==null?void 0:ie.status)==="pending"||((he=de.execution)==null?void 0:he.status)==="created"||((fe=de.execution)==null?void 0:fe.status)==="started"||de.executionId&&!((ye
5792=de.execution)!=null&&ye.status))&&c.jsxs("div",{className:"w-full rounded-2xl border border-[rgba(207,255,5,.22)] bg-[rgba(207,255,5,.04)] p-5 flex flex-col items-center",children:[c.jsxs("span",{className:"mb-3 flex items-center gap-2 text-sm font-bold text-white",children:[c.jsx("span",{className:"ws-pulse-dot h-2 w-2 rounded-full bg-[var(--lp-lime)]"}),i("Generating post")]}),c.jsx("div",{className:"ws-progress w-full",children:c.jsx("i",{style:{width:`${Math.max(3,de.generationProgress||0)}%`}})}),c.jsxs("div",{className:"ws-mono mt-2 flex w-full justify-between text-[11px] text-white/45",children:[c.jsxs("span",{children:["~",i("{n} min",{n:xt})]}),c.jsxs("span",{className:"text-white/70",children:[de.generationProgress||0,"%"]})]}),c.jsxs("button",{onClick:async()=>{var Ot,$t;const Ke=de.executionId||((Ot=de.execution)==null?void 0:Ot.id)||(($t=js==null?void 0:js.find(Tt=>Tt.workflowId===(de.workflowId||f)))==null?void 0:$t.id);if(pt(Tt=>{const ht=[...Tt];return ht[me]&&(ht[me]={...ht[me],isGenerating:!1,execution:{...ht[me].execution||{},status:"cancelled"}}),ht}),Ke)try{await u({id:Ke}),gr.success(i("Workflow stopped successfully."))}catch(Tt){console.error(i("Failed to stop execution:"),Tt),gr.error(i("Workflow generation stopped."))}else gr.success(i("Generation cancelled."))},className:"mt-4 px-4 py-1.5 border border-red-500/30 text-red-500 hover:bg-red-500/10 rounded-lg text-xs font-semibold transition-colors flex items-center gap-2 group",children:[c.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-sm group-hover:scale-110 transition-transform"}),i("Stop Generation")]})]}),((je=de.execution)==null?void 0:je.status)==="cancelled"&&c.jsxs("div",{className:"w-full p-4 bg-gray-50 dark:bg-gray-800/50 border border-gray-200 dark:border-gray-700/50 rounded-lg flex flex-col items-center",children:[c.jsx("span",{className:"text-gray-600 dark:text-gray-400 font-bold mb-2",children:i("â¹ï¸ Generation Cancelled")}),c.jsxs("div",{className:"flex flex-row gap-2",children:[c.jsx("button",{onClick:()=>Jo(me),className:"text-xs bg-emerald-100 dark:bg-emerald-800/30 text-emerald-700 dark:text-emerald-300 px-3 py-1.5 rounded hover:bg-emerald-200 dark:hover:bg-emerald-800/50 transition-colors font-semibold",children:i("Restart Generation")}),c.jsx("button",{onClick:()=>pf(me),className:"text-xs bg-gray-200 dark:bg-gray-800 text-gray-700 dark:text-gray-300 px-3 py-1.5 rounded hover:bg-gray-300 dark:hover:bg-gray-700 transition-colors font-semibold",children:i("Edit Content Settings")})]})]}),((We=de.execution)==null?void 0:We.status)==="failed"&&c.jsxs("div",{className:"w-full p-4 bg-red-50 dark:bg-red-900/10 border border-red-200 dark:border-red-800/30 rounded-lg flex flex-col items-center",children:[c.jsx("span",{className:"text-red-600 dark:text-red-400 font-bold mb-2",children:i("â Generation Failed")}),c.jsxs("div",{className:"flex flex-row gap-2",children:[c.jsx("button",{onClick:()=>Jo(me),className:"text-xs bg-red-100 dark:bg-red-800/30 text-red-700 dark:text-red-300 px-3 py-1.5 rounded hover:bg-red-200 dark:hover:bg-red-800/50 transition-colors font-semibold",children:i("Retry Generation")}),c.jsx("button",{onClick:()=>pf(me),className:"text-xs bg-gray-200 dark:bg-gray-800 text-gray-700 dark:text-gray-300 px-3 py-1.5 rounded hover:bg-gray-300 dark:hover:bg-gray-700 transition-colors font-semibold",children:i("Edit Content Settings")})]})]}),((De=de.execution)==null?void 0:De.status)==="completed"&&c.jsxs("div",{className:"w-full flex flex-col gap-3",children:[c.jsx("div",{className:"flex items-center justify-center p-3 bg-emerald-50 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800/50 rounded-lg shadow-sm",children:c.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400 font-bold text-sm flex items-center gap-2",children:[c.jsx("span",{className:"text-lg",children:"â
"})," ",i("Generated Successfully")]})}),c.jsx("button",{onClick:()=>{fn(me),Nt(!0)},className:"ws-btn ws-btn-ghost w-full !h-12",children:i("Preview content")})]}),de.executionId&&!de.isGenerating&&!["processing","pending","failed","completed","created","started"].includes((Me=de.execution)==null?void 0:Me.status)&&!!((ot=de.execution)!=null&&ot.status)&&c.jsx("button",{onClick:()=>{fn(me),Nt(!0)},className:"ws-btn ws-btn-ghost w-full !h-12",children:i("Preview content")})]},me)})}),c.jsx("div",{className:"flex justify-center mt-6",children:c.jsxs("button",{onClick:H_,className:"flex items-center gap-2 rounded-full border border-dashed border-white/20 px-6 py-3 font-bold text-white/70 transition-all hover:border-[rgba(207,255,5,.6)] hover:bg-[rgba(207,255,5,.05)] hover:text-[var(--lp-lime)]",children:[c.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M12 4v16m8-8H4"})}),i("Add New Post")]})}),tt&&(()=>{var xn,Wr;const de=_==="video"||_==="long-video",me=_==="podcast-video"||T==="podcast-discussion",Be=_==="text-image",xt=de&&!me,Ct=Be?[["quick-tip",i("Actionable Quick Tip")],["storytelling",i("Narrative Storytelling")],["product-plug",i("Agency-Grade Product Plug")],["behind-scenes",i("Authentic Behind-the-Scenes")]]:_==="video"?[["product-plug",i("UGC Product Ad")],["vox-style",i("Vox Style")],["app-demo",i("App Demo")],["hook-tease",i("Viral Hook & Tease")],["fast-facts",i("Rapid-Fire Fast Facts")],["mini-explainer",i("Mini Educational Explainer")],["ai-voiceover-clips",i("Cinematic AI Voiceover")]]:[["vox-style",i("Vox Style")],["app-demo",i("App Demo")],["step-tutorial",i("Deep-Dive Step-by-Step Tutorial")],["podcast-discussion",i("Podcast Discussion (two hosts)")],["top-list",i("Curated Top 5 Listicles")],["explainer-video",i("Masterclass Explainer Video")],["brand-story",i("Documentary Brand Story")],["scripted-story",i("Cinematic Scripted Narrative")]],zt=((xn=Ct.find(([jt])=>jt===T))==null?void 0:xn[1])||T,Wt=i(Be?"Image post or carousel":_==="long-video"?"Long Video":"Short Video"),hn=[{id:"basics",label:i("Basics"),icon:Cf.basics},{id:"script",label:i("Script"),icon:Cf.script},...de?[{id:"product",label:i("Product Info"),icon:Cf.product}]:[],...me?[{id:"podcast",label:i("Podcast"),icon:Cf.podcast}]:[],...de&&!me?[{id:"media",label:i("Voice & visuals"),icon:Cf.voice}]:[],...xt?[{id:"hook",label:i("Viral Hook"),icon:Cf.hook}]:[],...Be?[{id:"images",label:i("Images"),icon:Cf.images},{id:"caption",label:i("Post Caption"),icon:Cf.caption}]:[]],qn=Be&&(!U||U.trim().length===0),Yn=jt=>{M(jt),jt==="video"||jt==="podcast-video"?Hl(v=>Math.min(30,Math.max(15,v||30))):jt==="long-video"&&Hl(v=>Math.max(30,v||60)),L({"text-image":"quick-tip",video:"product-plug","long-video":"step-tutorial","podcast-video":"podcast-discussion"}[jt]||"quick-tip")};
5792return c.jsxs(qot,{kicker:i("Post Settings"),title:zt,subtitle:`${Wt} · ${i(bu)}${de?` · ${_==="long-video"?`${Math.floor(Er/60)}m ${Er%60>0?`${Er%60}s`:""}`:`${Er}s`}`:` · ${$l} ${i($l===1?"image":"slides")}`}`,sections:hn,onClose:()=>Ft(!1),headerExtra:c.jsx(aS,{ariaLabel:i("Content Type"),value:_==="podcast-video"?"long-video":_,onChange:jt=>Yn(jt),options:[{value:"video",label:i("Short Video"),icon:Cf.video},{value:"long-video",label:i("Long Video"),icon:Cf.video},{value:"text-image",label:i("Image / Carousel"),shortLabel:i("Images"),icon:Cf.carousel}]}),footer:c.jsxs("div",{className:"flex flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx("p",{className:`text-xs ${qn?"text-amber-300":"text-white/40"}`,children:i(qn?"Add a post caption to save these settings.":"Settings apply to this post only.")}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx("button",{type:"button",onClick:()=>Ft(!1),className:"ws-btn ws-btn-ghost flex-1 !h-12 sm:flex-none",children:i("Cancel")}),c.jsx("button",{type:"button",onClick:An,disabled:qn,className:"ws-btn ws-btn-primary flex-1 !h-12 sm:flex-none sm:!px-8",children:i("Save Settings")})]})]}),children:[c.jsxs(fA,{id:"basics",title:i("Basics"),description:i("What kind of post this is and how it sounds."),children:[c.jsx(Ml,{label:i("Content Style"),children:c.jsx("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2 xl:grid-cols-3",children:Ct.map(([jt,En])=>c.jsx(oS,{selected:T===jt,title:En,onClick:()=>nm(jt)},jt))})}),c.jsxs("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2",children:[c.jsx(Ml,{label:i("Language"),htmlFor:"ps-language",children:c.jsx(zot,{id:"ps-language",value:bu,onChange:Dc,children:["English","Spanish","French","German","Italian","Portuguese","Japanese","Korean","Chinese","Hindi","Arabic"].map(jt=>c.jsx("option",{value:jt,children:i(jt)},jt))})}),_==="long-video"&&c.jsx(Ml,{label:i("Video Length"),right:c.jsxs("span",{className:"ws-mono text-sm font-bold text-[#CFFF05]",children:[Math.floor(Er/60),"m ",Er%60>0?`${Er%60}s`:""]}),hint:`${i("30s")} â ${i("90s (max)")}`,children:c.jsx("input",{type:"range",min:"30",max:"90",step:"5","aria-label":i("Video Length"),value:Math.min(90,Math.max(30,Er||60)),onChange:jt=>Hl(Math.min(90,Math.max(30,Number(jt.target.value)))),className:"mt-3 w-full accent-[#CFFF05]"})}),_==="video"&&c.jsx(Ml,{label:i("Video Length"),right:c.jsxs("span",{className:"ws-mono text-sm font-bold text-[#CFFF05]",children:[Er,"s"]}),hint:`${i("15s")} â ${i("30s")}${Ni?` · ${i("The first ~6s are the viral hook clip.")}`:""}`,children:c.jsx("input",{type:"range",min:"15",max:"30",step:"5","aria-label":i("Video Length"),value:Math.min(30,Math.max(15,Er||30)),onChange:jt=>Hl(Number(jt.target.value)),className:"mt-3 w-full accent-[#CFFF05]"})})]})]}),c.jsx(fA,{id:"script",title:i("Script"),description:i(Be?"Optional: tell the AI how to write your slides.":"Optional: tell the AI how to write your script."),children:c.jsx($ot,{value:tn,onChange:Qt,isCarousel:Be})}),de&&c.jsxs(fA,{id:"product",title:i("Product Info"),description:i("What the video promotes. The more specific, the better the script."),children:[T==="app-demo"?c.jsx(aS,{ariaLabel:i("Product type"),value:"software",onChange:()=>le("software"),options:[{value:"software",label:i("SOFTWARE / WEB")}]}):c.jsx(aS,{ariaLabel:i("Product type"),value:ae==="physical"?"physical":"software",onChange:jt=>le(jt),options:[{value:"software",label:i("SOFTWARE / WEB")},{value:"physical",label:i("PHYSICAL PRODUCT")}]}),c.jsxs("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2",children:[c.jsx(Ml,{label:i("URL"),htmlFor:"ps-url",children:c.jsx("input",{id:"ps-url",type:"url",inputMode:"url",value:J,onChange:jt=>{ee(jt.target.value),$0(null)},className:k4,placeholder:i("https://example.com")})}),c.jsx(Ml,{label:i("Name"),htmlFor:"ps-name",children:c.jsx("input",{id:"ps-name",type:"text",value:D,onChange:jt=>P(jt.target.value),className:k4,placeholder:i("Your Product Name")})}),c.jsx(Ml,{label:i("Category"),htmlFor:"ps-category",children:c.jsx("input",{id:"ps-category",type:"text",value:X,onChange:jt=>W(jt.target.value),className:k4,placeholder:i("e.g. Productivity App, Skincare...")})})]}),c.jsx(Ml,{label:i("Description"),htmlFor:"ps-description",children:c.jsx("textarea",{id:"ps-description",value:O,onChange:jt=>F(jt.target.value),className:D6,placeholder:i("Describe what it does and why it's great...")})}),(T==="app-demo"||T==="product-plug"||T==="ugc-product-ad"||T==="tailored-ad-video")&&
5792c.jsx(Ml,{label:i("App Media Sources (Screenshots / Recordings)"),hint:i("Upload screenshots or recordings of your product or software. Every uploaded media file will be prioritized as authentic product UI and visual B-roll in your video."),children:c.jsx(bte,{files:te,onMediaChange:jt=>ve(jt)})})]}),me&&c.jsx(fA,{id:"podcast",title:i("Podcast"),children:c.jsx(tot,{value:Lo,onChange:jt=>{hp(jt),Hl(jt.duration)},isGeneratingScene:jy,onGenerateScene:px,generatedSceneUrl:wg})}),de&&!me&&c.jsxs(fA,{id:"media",title:i("Voice & visuals"),description:i("Footage, narration, presenter, captions and music."),children:[c.jsx(Ml,{label:i("B-roll video source"),children:c.jsxs("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2",children:[c.jsx(oS,{selected:Oc==="free-samples",title:i("Pexels Videos"),badge:i("Default"),description:i("Authentic stock footage tailored to your product context"),onClick:()=>cd("free-samples")}),c.jsx(oS,{selected:Oc==="generate-ai",title:i("AI Videos"),badge:i("AI"),description:i("AI-generated keyframe B-roll clips"),onClick:()=>cd("generate-ai")})]})}),c.jsx(q2,{id:"ps-voice",title:i("Enable AI Voice"),checked:xa,onChange:wu,children:c.jsx(Ml,{label:i("Voice Gender"),children:c.jsx(aS,{ariaLabel:i("Voice Gender"),value:Ao==="Male"?"Male":"Female",onChange:jt=>Eg(jt),options:[{value:"Female",label:i("Female")},{value:"Male",label:i("Male")}]})})}),_!=="long-video"&&c.jsx(q2,{id:"ps-avatar",title:i("AI Presenter (Avatar)"),checked:Qo,onChange:oh,children:c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsx(aS,{ariaLabel:i("AI Presenter (Avatar)"),value:ql==="user-provided"?"user-provided":"ai-generated",onChange:jt=>lh(jt),options:[{value:"ai-generated",label:i("AI Generated")}
5792,{value:"user-provided",label:i("Upload Own")}]}),ql==="ai-generated"?c.jsxs(c.Fragment,{children:[ea.length>0&&c.jsx(Ml,{label:i("Avatar History"),children:c.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:ea.map(jt=>c.jsxs("button",{type:"button",onClick:()=>fx(jt.id),"aria-pressed":ta===jt.id,className:`relative h-24 w-16 flex-shrink-0 overflow-hidden rounded-xl border-2 transition ${ta===jt.id?"border-[#CFFF05]":"border-transparent hover:border-white/30"}`,children:[c.jsx("img",{src:jt.url,alt:"avatar",className:"h-full w-full object-cover"}),ta===jt.id&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#CFFF05]/20",children:c.jsx(iS,{className:"h-6 w-6 text-[#CFFF05] drop-shadow-md"})})]},jt.id))})}),c.jsx(Ml,{label:i("Preset Styles"),children:c.jsx("div",{className:"flex snap-x gap-2.5 overflow-x-auto pb-1",children:By.map(jt=>c.jsxs("button",{type:"button",onClick:()=>J0(jt),title:jt.description,"aria-pressed":Uc===jt.id,className:`relative flex h-32 w-20 flex-shrink-0 snap-center flex-col items-center justify-end overflow-hidden rounded-xl border-2 text-center transition ${Uc===jt.id?"border-[#CFFF05] shadow-[0_0_15px_rgba(207,255,5,0.2)]":"border-white/10 hover:border-white/30"}`,children:[c.jsx("img",{src:`/avatar-templates/${jt.id}.png`,alt:jt.title,className:"absolute inset-0 h-full w-full object-cover"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/90 via-black/20 to-transparent"}),c.jsx("div",{className:"relative w-full p-1.5 pb-2 text-[9px] font-bold leading-tight text-white drop-shadow-md",children:jt.title}),Uc===jt.id&&c.jsx("div",{className:"absolute right-1 top-1 rounded-full bg-[#CFFF05] p-[1px]",children:c.jsx(iS,{className:"h-3 w-3 stroke-[3px] text-[#0F121A]"})})]},jt.id))})}),c.jsx(Ml,{label:i("Visual Prompt"),htmlFor:"ps-avatar-prompt",right:c.jsx("button",{type:"button",onClick:()=>vp(!0),className:"text-xs font-semibold text-[#CFFF05] hover:underline",children:i("View Gallery")}),children:c.jsx("textarea",{id:"ps-avatar-prompt",value:Zo,onChange:jt=>yp(jt.target.value),className:D6,placeholder:i("Describe your AI presenter...")})}
5792),c.jsxs("div",{className:"flex items-center gap-4 rounded-2xl border border-white/10 bg-white/[0.03] p-3",children:[ta?c.jsxs("button",{type:"button",onClick:()=>{var jt;return xp(((jt=ea.find(En=>En.id===ta))==null?void 0:jt.url)||null)},className:"group relative h-24 w-16 flex-shrink-0 overflow-hidden rounded-xl border-2 border-[#CFFF05]",children:[c.jsx("img",{src:(Wr=ea.find(jt=>jt.id===ta))==null?void 0:Wr.url,alt:"selected avatar",className:"h-full w-full object-cover"}),c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 transition-opacity group-hover:opacity-100",children:c.jsx("span",{className:"px-1 text-center text-[10px] font-bold text-white",children:i("Preview")})})]}):c.jsx("div",{className:"flex h-24 w-16 flex-shrink-0 items-center justify-center rounded-xl border-2 border-dashed border-white/15 text-2xl",children:"ð¤"}),c.jsx("button",{type:"button",onClick:q_,disabled:dd||!Zo,className:"ws-btn ws-btn-primary flex-1 !h-11",children:dd?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[#05060a]/30 border-t-[#05060a]"})," ",i("Generating...")]}):i("⨠Craft Avatar")})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"relative flex min-h-[200px] cursor-pointer flex-col items-center justify-center gap-3 overflow-hidden rounded-2xl border-2 border-dashed border-white/15 bg-white/[0.02] p-8 text-center transition hover:border-[#CFFF05]/50",children:[oa?c.jsxs("div",{className:"absolute inset-0",children:[oa.type.startsWith("video/")?c.jsx("video",{src:URL.createObjectURL(oa),className:"h-full w-full object-cover opacity-50",autoPlay:!0,loop:!0,muted:!0,playsInline:!0}):c.jsx("img",{src:URL.createObjectURL(oa),alt:"avatar preview",className:"h-full w-full object-cover opacity-50"}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black/40",children:[c.jsx("span",{className:"mb-2 text-3xl",children:"â
"}),c.jsx("p",{className:"text-sm font-bold text-white",children:oa.name}),c.jsx("p",{className:"mt-1 text-xs text-gray-200",children:i("Click to change file")})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-3xl",children:"ð¤"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-bold text-white/85",children:i("Upload Image/Video")}),c.jsx("p",{className:"mt-1 text-xs text-white/45",children:i("Select a file from your device")})]})]}),c.jsx("input",{type:"file",className:"hidden",accept:"image/*,video/*",onChange:jt=>{var v;const En=(v=jt.target.files)==null?void 0:v[0];if(En){if(En.type.startsWith("image/")){const w=new FileReader;w.addEventListener("load",()=>{var S;return nf(((S=w.result)==null?void 0:S.toString())||null)}),w.readAsDataURL(En)}else ix(En);jt.target.value=""}}})]}),Dy&&c.jsx(Dot,{imageSrc:Dy,onClose:()=>nf(null),onCropComplete:jt=>{ix(jt),nf(null)}})]})]})}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[c.jsx(q2,{id:"ps-captions",title:i("Captions"),checked:sf,onChange:af}
5792),c.jsx(q2,{id:"ps-music",title:i("Background Music"),checked:Ic,onChange:Wl})]})]}),xt&&c.jsx(fA,{id:"hook",title:i("Viral Hook"),description:i("A ~6 second real-world clip opens the video to stop the scroll, then your narration starts."),children:c.jsx(q2,{id:"viral-hook-toggle",title:i("â¡ Viral Hook"),description:i(T==="vox-style"||T==="app-demo"?"Not used by Vox Style and App Demo videos.":"Prepend a trending viral video clip to boost retention"),checked:Ni,onChange:jt=>{jc(jt),jt?pd(!1):($e([]),be(null))},children:c.jsxs("div",{className:"flex flex-col gap-3 animate-fade-in",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-white/50",children:i("Select one hook video")}),Ge.length>0&&c.jsx("span",{className:"rounded-full bg-[#CFFF05]/10 px-2 py-1 text-xs font-bold text-[#CFFF05]",children:i("1 selected")})]}),wn&&Pt.length===0&&c.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-10",children:[c.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-[#CFFF05]/30 border-t-[#CFFF05]"}),c.jsx("p",{className:"text-xs text-white/50",children:i("Discovering viral hooksâ¦")})]}),Pt.length>0&&c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-4",children:Pt.map((jt,En)=>{const v=En+1,w=Ge.includes(v);return c.jsxs("button",{id:`hook-video-card-${En}`,type:"button","aria-pressed":w,onClick:()=>{w?($e([]),be(null)):($e([v]),be(jt.url))},className:`group relative flex flex-col overflow-hidden rounded-xl border-2 text-left transition focus:outline-none ${w?"border-[#CFFF05] shadow-lg shadow-[#CFFF05]/20":"border-white/10 hover:border-white/30"}`,children:[c.jsxs("div",{className:"relative aspect-[9/16] w-full overflow-hidden bg-[#0F121A]",children:[jt.isProcessing?c.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-[#CFFF05]/30 border-t-[#CFFF05]"})}):c.jsx("video",{src:jt.url,loop:!0,muted:!0,playsInline:!0,preload:"metadata",className:"h-full w-full object-cover",ref:S=>{S&&(w&&S.paused?S.play().catch(()=>{}):!w&&!S.paused&&!S.matches(":hover")&&S.pause())},onMouseEnter:S=>{w||S.currentTarget.play().catch(()=>{})},onMouseLeave:S=>{w||(S.currentTarget.pause(),S.currentTarget.currentTime=0)}}),!jt.isProcessing&&c.jsx("div",{className:`absolute inset-0 flex items-center justify-center transition-opacity ${w?"opacity-0":"opacity-100 group-hover:opacity-0"}`,children:c.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-black/60",children:c.jsx("svg",{className:"ml-0.5 h-4 w-4 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{d:"M8 5v14l11-7z"})})})}),w&&c.jsx("div",{className:"absolute right-1.5 top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-[#CFFF05] shadow",children:c.jsx("svg",{className:"h-3 w-3 text-[#0F121A]",fill:"none",stroke:"currentColor",strokeWidth:3,viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})})]}),c.jsx("div",{className:`truncate px-2.5 py-2 text-xs font-medium transition-colors ${w?"bg-[#CFFF05]/10 text-[#CFFF05]":"bg-white/[0.03] text-white/70"}`,children:jt.title||`Hook ${v}`})]},En)})}),c.jsx("button",{id:"load-more-hooks",type:"button",onClick:()=>pd(!0),disabled:wn,className:"flex w-full items-center justify-center gap-2 rounded-xl border border-dashed border-white/15 py-2.5 text-sm font-semibold text-white/60 transition hover:border-[#CFFF05]/50 hover:text-[#CFFF05] disabled:cursor-not-allowed disabled:opacity-50",children:wn?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current/30 border-t-current"}),i("Loadingâ¦")]}):c.jsxs(c.Fragment,{children:[c.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),i("Load More Hooks")]})})]})})}),Be&&c.jsxs(fA,{id:"images",title:i("Images"),description:i("Two or more images make a carousel, planned as one story from cover to call to action."),children:[c.jsx(Ml,{label:i("Where should we source your images?"),children:c.jsxs("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2",children:[c.jsx(oS,{selected:Do==="free-samples",title:i("Free Stock Photos"),onClick:()=>Lc("free-samples")}),c.jsx(oS,{selected:Do==="generate-ai",title:i("AI Image Generation"),onClick:()=>Lc("generate-ai")})]})}),c.jsx(Ml,{label:i("How many images to include?"),right:c.jsx("span",{className:"ws-mono rounded-lg bg-[#CFFF05]/10 px-2.5 py-1 text-sm font-bold text-[#CFFF05]",children:$l}),hint:`${i("Just 1")} â ${i("Max 10")}`,children:c.jsx("input",{type:"range",min:"1",max:"10","aria-label":i("How many images to include?"),value:$l,onChange:jt=>uh(parseInt(jt.target.value)),className:"mt-2 w-full accent-[#CFFF05]"})}),c.jsx(q2,{id:"ps-infographics",title:i("Include infographics"),checked:Y0,onChange:Q0})]}),Be&&c.jsx(fA,{id:"caption",title:i("Post Caption"),description:i("Required for image posts. Write it or let AI draft it from your settings."),aside:c.jsx("button",{type:"button",onClick:va,disabled:z,className:"ws-btn ws-btn-ghost flex-shrink-0 !h-10 !px-4 !text-xs",children:i(z?"Generating...":"⨠AI Generate")}),children:c.jsx("textarea",{"aria-label":i("Post Caption"),value:U,onChange:jt=>B(jt.target.value),className:`${D6} min-h-[160px] ${qn?"border-amber-400/40":""}`,placeholder:i("Write your perfect caption or let AI do the magic...")})})]})})()]}),ft===3&&c.jsxs("div",{className:"space-y-8 ws-enter",children:[c.jsxs("div",{className:"ws-glass rounded-[28px] p-6 sm:p-8",children:[c.jsxs("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-2",children:i("01 · Channels")}),c.jsx("h3",{className:"ws-display text-2xl font-bold text-white",children:i("Where should it post?")})]}),c.jsx("p",{className:"ws-muted text-sm",children:i("Each channel gets its own optimized format.")})]}),c.jsx("div",{className:"mt-6 grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:fh.map(de=>{const me=de.value.split("-")[0],Be=!!(Di!=null&&Di.some(Wt=>{let hn=Wt.provider.toLowerCase();return hn==="x.com"&&(hn="twitter"),hn===me})),xt=Be&&re.some(Wt=>Wt.value===de.value),Ct=me==="youtube"?c.jsx(YR,{}):me==="tiktok"?c.jsx(XR,{}):me==="instagram"?c.jsx(Py,{}):me==="facebook"?c.jsx(zT,{}):me==="twitter"?c.jsx(D1,{}):c.jsx(GT,{}),zt=async()=>{try{const Wt=await vae({platform:me});window.location.href=Wt}catch{gr.error(i("Could not start {platform} connection.",{platform:de.label}))}};return c.jsxs("button",{onClick:()=>
5792{if(!Be){zt();return}_e(Wt=>Wt.find(qn=>qn.value===de.value)?Wt.length===1?Wt:Wt.filter(qn=>qn.value!==de.value):[...Wt,de])},className:`group relative flex flex-col items-center rounded-2xl border p-5 text-center transition-all duration-300 hover:-translate-y-0.5 ${xt?"border-[rgba(207,255,5,.55)] bg-[rgba(207,255,5,.06)] shadow-[0_24px_60px_-30px_rgba(207,255,5,.6)]":Be?"border-white/10 bg-white/[0.025] hover:border-white/25":"border-dashed border-white/10 bg-transparent hover:border-[rgba(207,255,5,.4)]"}`,children:[c.jsx("span",{className:`absolute right-2.5 top-2.5 grid h-5 w-5 place-items-center rounded-full transition-all duration-300 ${xt?"scale-100 bg-[var(--lp-lime)] text-black":"scale-75 opacity-0"}`,children:c.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:3.5,viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),c.jsx("span",{className:`mb-3 grid h-12 w-12 place-items-center rounded-2xl text-xl text-white shadow-lg transition-all duration-300 ${Be?"":"opacity-40 grayscale group-hover:opacity-70"} ${xt?"scale-110":""}`,style:{backgroundColor:de.color==="#000000"?"#15171d":de.color},children:Ct}),c.jsx("span",{className:`text-sm font-bold ${xt?"text-white":"text-white/70"}`,children:de.label}),Be?c.jsx("span",{className:`ws-mono mt-1.5 text-[10px] uppercase tracking-wider ${xt?"text-[var(--lp-lime)]":"text-white/40"}`,children:xt?"Posting":i("Tap to add")}):c.jsx("span",{className:"mt-2 rounded-full bg-[var(--lp-lime)] px-2.5 py-0.5 text-[10px] font-extrabold uppercase tracking-wider text-black",children:i("Connect")})]},de.value)})}),!(Di!=null&&Di.length)&&c.jsx("p",{className:"mt-5 rounded-2xl border border-amber-400/20 bg-amber-400/[0.06] px-4 py-3 text-sm text-amber-200/90",children:i("Connect at least one channel so SpreadOut can publish for you. You can also do it from the sidebar at any time.")})]}),c.jsxs("div",{className:"ws-glass rounded-[28px] p-6 sm:p-8",children:[c.jsxs("div",{className:"mb-6 flex items-end justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-2",children:i("02 · Review")}),c.jsx("h3",{className:"ws-display text-2xl font-bold text-white",children:i("Generated posts")})]}),c.jsx("span",{className:"ws-mono rounded-full bg-white/[0.05] px-3 py-1.5 text-xs text-white/70 ring-1 ring-white/10",children:i("{n}/{total} ready",{n:Tn.length,total:qe.length})})]}),c.jsxs("div",{className:"space-y-4",children:[qe.filter(de=>de.executionId).length===0&&!Te&&c.jsxs("div",{className:"flex flex-col items-center rounded-2xl border border-dashed border-white/10 px-6 py-12 text-center",children:[c.jsx("div",{className:"mb-4 grid h-12 w-12 place-items-center rounded-2xl bg-white/[0.04] text-white/40 ring-1 ring-white/10",children:c.jsx("svg",{className:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),c.jsx("p",{className:"text-sm font-semibold text-white/80",children:i("No posts generated yet")}),c.jsx("p",{className:"mt-1 max-w-sm text-sm text-white/45",children:i("Posts you generate in the previous step show up here for a final review before they go live.")}),c.jsx("button",{onClick:()=>At(2),className:"ws-btn ws-btn-ghost mt-5 !h-10 !px-5 text-sm",children:i("Back to schedule")})]}),qe.filter(de=>de.executionId).length===0&&Te&&c.jsxs("div",{className:"flex flex-col items-center justify-center p-12 bg-emerald-900/10 rounded-xl border-2 border-emerald-500/20 border-dashed text-center",children:[c.jsxs("div",{className:"w-16 h-16 rounded-full bg-emerald-500/20 flex items-center justify-center mb-4 relative",children:[c.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-emerald-400 border-t-transparent animate-spin opacity-50"}),c.jsx("span",{className:"text-2xl animate-pulse",children:"ð¤"})]}),c.jsx("h4",{className:"text-lg font-bold text-emerald-400 mb-2",children:i("Auto-Pilot Ready")}),c.jsxs("p",{className:"text-sm text-slate-400 max-w-sm leading-relaxed",children:[i("No manual generation needed! Your posts will be")," ",c.jsx("strong",{className:"text-slate-300",children:i("automatically generated and scheduled")})," ",i("in the background based on your weekly configuration.")]})]}),qe.filter(de=>de.executionId).map((de,me)=>{var Wr,jt;const Be=de.execution,xt=(Be==null?void 0:Be.status)==="succeeded"||(Be==null?void 0:Be.status)==="completed"?"Ready":(Be==null?void 0:Be.status)==="failed"?"Failed":"Generating...";let Ct=`Post ${me+1}`,zt=[],Wt=[];if(Be!=null&&Be.result||Be!=null&&Be.results){let En=Be.result||Be.results;
5792if(typeof En=="string")try{En=JSON.parse(En)}catch{}En!=null&&En.text?Ct=En.text:En!=null&&En.content?Ct=En.content:typeof En=="string"&&En.length>0&&(Ct=En),En!=null&&En.videoUrls&&En.videoUrls.length>0?zt=En.videoUrls:En!=null&&En.videoUrl&&(zt=[En.videoUrl]),En!=null&&En.imageUrls&&En.imageUrls.length>0?Wt=En.imageUrls:En!=null&&En.imageUrl&&(Wt=[En.imageUrl])}zt.length===0&&Wt.length===0&&(qt?zt=[qt]:vr.length>0&&(Wt=vr));const hn=zt.length>0||Wt.length>0;Ct===`Post ${me+1}`&&((Wr=de.config)!=null&&Wr.productName)&&(Ct=de.config.productName);const qn=((jt=de.config)==null?void 0:jt.workflowType)||_||"video",Yn=qn==="long-video",xn=Yn?"aspect-video":qn==="text-image"?"aspect-[4/5]":"aspect-[9/16]";return c.jsxs("div",{className:`ws-enter overflow-hidden rounded-3xl border border-white/10 bg-[#0a0c12] mb-6 flex flex-col shadow-[0_40px_90px_-50px_rgba(0,0,0,1)] ${Yn?"max-w-2xl mx-auto":"max-w-md mx-auto"} w-full`,children:[c.jsxs("div",{className:"flex justify-between items-center p-3 border-b border-slate-800",children:[c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-tr from-yellow-400 via-red-500 to-purple-500 p-[2px]",children:Di&&Di.length>0&&Di[0].profilePictureUrl?c.jsx("img",{src:Di[0].profilePictureUrl,className:"w-full h-full rounded-full border-2 border-slate-900 object-cover",alt:"Profile"}):c.jsx("div",{className:"w-full h-full bg-slate-900 rounded-full border-2 border-slate-900 flex items-center justify-center",children:c.jsx("span",{className:"text-xs text-white",children:"ð¤"})})}),c.jsxs("div",{className:"ml-3 flex flex-col",children:[c.jsx("span",{className:"font-semibold text-sm text-white",children:Di&&Di.length>0&&Di[0].username?Di[0].username:(n==null?void 0:n.username)||"user"}),c.jsxs("span",{className:"text-[10px] text-slate-400",children:[de.day?dt(de.day):""," ",de.time?i("at {time}",{time:St(de.time)}):""]})]})]}),c.jsx("span",{className:`text-xs font-bold px-2 py-1 rounded-full ${xt==="Ready"?"bg-emerald-500/20 text-emerald-400":xt==="Failed"?"bg-red-500/20 text-red-500":"bg-amber-500/20 text-amber-500 animate-pulse"}`,children:xt})]}),hn?(()=>{const En=zt.length>0?[zt[0]]:[],v=En.length+Wt.length>1;return c.jsxs("div",{className:"w-full bg-slate-950 relative group",children:[c.jsxs("div",{className:`w-full ${v?"flex overflow-x-auto snap-x snap-mandatory hide-scrollbar items-center":"flex justify-center items-center"}`,children:[En.map((w,S)=>c.jsx("div",{className:`${v?"w-full flex-shrink-0 snap-center":"w-full"} bg-black flex justify-center items-center`,children:c.jsx("video",{src:w,className:`w-full h-auto max-h-[70vh] object-contain ${xn}`,autoPlay:!0,loop:!0,muted:!0,playsInline:!0})},`vid-${S}`)),Wt.map((w,S)=>c.jsx("div",{className:`${v?"w-full flex-shrink-0 snap-center":"w-full"} bg-black flex justify-center items-center`,children:c.jsx("img",{src:w,className:`w-full h-auto max-h-[70vh] object-contain ${xn}`,alt:"Post media"})},`img-${S}`))]}),v&&c.jsx("div",{className:"absolute top-3 right-3 bg-black/60 rounded-full px-2 py-1 text-xs text-white font-medium",children:i("Slide âï¸")})]})})():c.jsx("div",{className:"w-full bg-slate-800 flex items-center justify-center min-h-[400px]",children:c.jsx("span",{className:"text-slate-500 font-medium",children:i("Media Pending")})}),c.jsxs("div",{className:"p-3 pt-3 border-t border-slate-800",children:[c.jsxs("div",{className:"flex gap-4 mb-2",children:[c.jsx("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})}),c.jsx("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}
5792),c.jsx("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})]}),c.jsxs("p",{className:"text-sm text-slate-200 leading-relaxed whitespace-pre-wrap",children:[c.jsx("span",{className:"font-semibold mr-2 text-white",children:Di&&Di.length>0&&Di[0].username?Di[0].username:(n==null?void 0:n.username)||"user"}),Ct]})]})]},me)})]})]})]}),c.jsxs("div",{className:`mx-auto mt-12 flex max-w-5xl items-center justify-between border-t border-white/[0.07] pb-16 pt-8 ${ft===1&&ke?"hidden":""}`,children:[c.jsxs("button",{onClick:im,disabled:ft===1,className:`ws-btn ws-btn-ghost ${ft===1?"invisible":""}`,children:[c.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),i("Previous")]}),c.jsx("div",{className:"flex space-x-4",children:ft===1?Ce==="automated"?c.jsxs("button",{onClick:sm,disabled:ke||!Bc(1),className:"ws-btn ws-btn-primary !h-14 !px-8",children:[c.jsx("span",{className:"ws-shine"}),ke?"Generatingâ¦":i("Generate weekly strategy"),c.jsx("svg",{className:"w-5 h-5 ml-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}):c.jsxs("button",{onClick:xo,disabled:!Bc(1),className:"ws-btn ws-btn-primary !h-14 !px-8",children:[i("Next: configure posts"),c.jsx("svg",{className:"w-5 h-5 ml-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}):ft===2?c.jsxs("button",{onClick:()=>At(3),disabled:!Bc(2),className:"ws-btn ws-btn-primary !h-14 !px-8",children:[i("Review & schedule"),c.jsx("svg",{className:"w-5 h-5 ml-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}):c.jsx("div",{className:"relative",children:c.jsx("button",{onClick:fd,disabled:!Bc(1)||!Bc(2)||!Bc(3)||cn||Bt,className:"ws-btn ws-btn-primary !h-14 !px-8",children:cn?c.jsx(Hf,{}):c.jsxs("div",{className:"flex items-center",children:[c.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),c.jsx("span",{children:i(f?"Update Schedule":"Create Schedule")})]})})})})]})]})}),Un&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/85 backdrop-blur-md",children:c.jsxs("div",{className:"relative w-full max-w-2xl mx-4 sm:mx-8",children:[c.jsx("button",{onClick:()=>_n(null),className:"absolute -top-12 right-0 text-white hover:text-gray-700 dark:text-gray-300 transition-colors z-10",children:c.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),c.jsxs("div",{className:"bg-white dark:bg-[#0F121A] rounded-2xl overflow-hidden shadow-2xl shadow-black/50 border border-gray-200 dark:border-[#252A36]/40 shadow-black/20",children:[c.jsx("video",{ref:de=>{de&&(lx||de.pause())},src:Un.url,controls:!0,autoPlay:!0,className:"w-full h-auto max-h-[70vh] object-contain",poster:Un.thumbnail}),c.jsxs("div",{className:"p-5 bg-gray-50 dark:bg-[#1A1D24] text-white border-t border-gray-200 dark:border-[#252A36]",children:[c.jsx("h3",{className:"text-lg font-semibold mb-1",children:Un.title}),Un.description&&c.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:Un.description}),c.jsxs("div",{className:"flex justify-between items-center mt-3",children:[c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:i("Viral Hook Video")}),c.jsx("button",{onClick:()=>{const de=Pt.findIndex(me=>me.url===Un.url);de>=0&&Og(de+1)},className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${Ge.includes(Pt.findIndex(de=>de.url===Un.url)+1)?"bg-red-600 hover:bg-red-500 text-white shadow-lg shadow-red-500/20":"bg-blue-600 hover:bg-blue-500 text-white"}`,children:Ge.includes(Pt.findIndex(de=>de.url===Un.url)+1)?i("Remove from Selection"):i("Add to Selection")})]})]})]})]})}),bl&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4",onClick:()=>vp(!1),children:c.jsxs("div",{className:"bg-white dark:bg-[#0F121A] rounded-2xl p-6 max-w-4xl w-full max-h-[85vh] overflow-y-auto border border-gray-200 dark:border-[#252A36] shadow-2xl shadow-black/20",onClick:de=>de.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsx("h3",{className:"text-lg font-bold text-gray-900 dark:text-white",children:i("Your Avatar History")}),c.jsx("button",{onClick:()=>vp(!1),className:"text-gray-600 dark:text-gray-400 hover:text-gray-100 p-1 rounded-full hover:bg-gray-50 dark:bg-[#1A1D24] transition-colors",children:c.jsx(UN,{className:"w-5 h-5"})})]}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 ga
5792p-4",children:[ea.map(de=>c.jsxs("div",{className:"relative group",children:[c.jsxs("div",{onClick:()=>xp(de.url),className:`aspect-[3/4] rounded-xl overflow-hidden cursor-pointer border-2 transition-all duration-300 ${ta===de.id?"border-emerald-500 scale-[1.02] shadow-lg shadow-emerald-500/30":"border-gray-200 dark:border-[#252A36] hover:border-gray-300 dark:border-[#3A4150]"}`,children:[c.jsx("img",{src:de.url,alt:"saved avatar",className:"w-full h-full object-cover"}),ta===de.id&&c.jsx("div",{className:"absolute inset-0 bg-emerald-500/15 flex items-center justify-center",children:c.jsx("div",{className:"bg-emerald-500 text-white rounded-full p-1 shadow-2xl shadow-black/20",children:c.jsx(iS,{className:"w-4 h-4"})})})]}),c.jsx("button",{onClick:me=>{me.stopPropagation(),Vy(de.id)},className:"absolute -top-2 -right-2 bg-white dark:bg-[#0F121A] text-gray-600 dark:text-gray-400 hover:text-red-500 p-1 rounded-full border border-gray-200 dark:border-[#252A36] opacity-0 group-hover:opacity-100 transition-opacity",children:c.jsx(UN,{className:"w-4 h-4"})}),c.jsxs("div",{className:"mt-2 flex justify-between items-center px-1",children:[c.jsx("span",{className:"text-[10px] text-gray-500 dark:text-gray-400 capitalize",children:de.gender}),c.jsx("span",{className:"text-[10px] text-gray-500 dark:text-gray-400",children:new Date(de.timestamp).toLocaleDateString()})]})]},de.id)),ea.length===0&&c.jsx("div",{className:"col-span-full py-12 text-center text-gray-500 dark:text-gray-400",children:i("No saved avatars found. Generate one to see it here!")})]})]})}),Ap&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/85 backdrop-blur-md p-4",onClick:()=>xp(null),children:c.jsxs("div",{className:"relative max-w-4xl max-h-[90vh] w-full flex flex-col items-center",children:[c.jsx("button",{onClick:()=>xp(null),className:"absolute -top-12 right-0 text-white hover:text-gray-700 dark:text-gray-300 transition-colors z-10",children:c.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),c.jsx("img",{src:Ap,alt:"Full size avatar",className:"max-w-full max-h-[85vh] rounded-lg shadow-2xl shadow-black/20 object-contain"}),c.jsxs("div",{className:"mt-4 flex gap-4",children:[ea.find(de=>de.url===Ap)&&c.jsxs("button",{onClick:()=>{var me;const de=(me=ea.find(Be=>Be.url===Ap))==null?void 0:me.id;de&&(fx(de),xp(null),vp(!1))},className:"px-6 py-2 bg-emerald-500 text-white rounded-full font-medium hover:bg-emerald-600 transition-colors shadow-2xl shadow-black/20 flex items-center",children:[c.jsx(iS,{className:"w-5 h-5 mr-2"}),i("Select Avatar")]}),c.jsxs("a",{href:Ap,download:`avatar-${Date.now()}.png`,className:"px-6 py-2 bg-white text-gray-900 rounded-full font-medium hover:bg-gray-100 transition-colors shadow-2xl shadow-black/20 shadow-black/25 shadow-black/20 flex items-center",target:"_blank",rel:"noopener noreferrer",children:[c.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),i("Download Image")]})]})]})})]})})}),Mt&&Je!==null&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm p-4 md:p-8",children:c.jsxs("div",{className:"bg-white dark:bg-[#0F121A] border border-gray-200 dark:border-[#252A36] rounded-2xl w-full max-w-2xl h-[80vh] flex flex-col shadow-2xl overflow-hidden relative animate-fade-in-up",children:[c.jsxs("div",{className:"flex justify-between items-center p-6 border-b border-gray-200 dark:border-[#252A36] bg-white dark:bg-[#0F121A]/95 sticky top-0 z-10",children:[c.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:i("Preview Content")}),c.jsx("button",{onClick:()=>Nt(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:c.jsx(UN,{className:"w-6 h-6"})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:(()=>{const de=qe[Je],me=zi==null?void 0:zi.find(Ct=>{var zt;return Ct.workflowId===(((zt=de==null?void 0:de.execution)==null?void 0:zt.workflowId)||(de==null?void 0:de.executionId))});if(!me)return c.jsx("p",{className:"text-gray-500",children:i("Loading media...")});const Be=Yl==null?void 0:Yl.find(Ct=>Ct.id===me.workflowId),xt=(Be==null?void 0:Be.type)==="long-video";return c.jsx("div",{className:"flex flex-col items-center bg-slate-950 p-4 sm:p-8 rounded-xl border border-slate-800/50",children:c.jsxs("div",{className:`w-full ${xt?"max-w-2xl":"max-w-md"} bg-slate-900 rounded-xl overflow-hidden shadow-2xl border border-slate-800`,children:[c.jsxs("div",{className:"flex items-center p-3 border-b border-slate-800",children:[c.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-tr from-yellow-400 via-red-500 to-purple-500 p-[2px]",children:Di&&Di.length>0&&Di[0].profilePictureUrl?c.jsx("img",{src:Di[0].profilePictureUrl,className:"w-full h-full rounded-full border-2 border-slate-900 object-cover",alt:"Profile"}):c.jsx("div",{className:"w-full h-full bg-slate-900 rounded-full border-2 border-slate-900 flex items-center justify-center",children:c.jsx("span",{className:"text-xs text-white",children:"ð¤"})})}),c.jsx("span",{className:"ml-3 font-semibold text-sm text-white",children:Di&&Di.length>0&&Di[0].username?Di[0].username:(n==null?void 0:n.username)||"user"})]}),c.jsx("div",{className:"w-full bg-slate-950 relative group",children:(()=>{const Ct=me.videoUrls&&me.videoUrls.length>0?[me.videoUrls[0]]:[],zt=me.imageUrls||[],Wt=Ct.length+zt.length>1;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`w-full ${Wt?"flex overflow-x-auto snap-x snap-mandatory hide-scrollbar items-center":"flex justify-center items-center"}`,children:[Ct.map((hn,qn)=>c.jsx("div",{className:`${Wt?"w-full flex-shrink-0 snap-center":"w-full"} bg-black flex justify-center items-center`,children:c.jsx("video",{src:hn,controls:!0,className:"w-full h-auto max-h-[70vh] object-contain"})},`vid-${qn}`)),zt.map((hn,qn)=>c.jsx("div",{className:`${Wt?"w-full flex-shrink-0 snap-center":"w-full"} bg-black flex justify-center items-center`,children:c.jsx("img",{src:hn,className:"w-full h-auto max-h-[70vh] object-contain",alt:"Post preview"})},`img-${qn}`))]}),Wt&&c.jsx("div",{className:"absolute top-3 right-3 bg-black/60 rounded-full px-2 py-1 text-xs text-white font-medium",children:i("Slide âï¸")})]})})()}),c.jsx("div",{className:"p-3 pt-3 border-t border-slate-800",children:c.jsx("textarea",{className:"w-full bg-transparent border-0 text-sm text-slate-200 min-h-[100px] focus:ring-0 focus:outline-none resize-none",defaultValue:me.text,id:"editPostText",placeholder:i("Write a caption...")})})]})})})()}),c.jsxs("div",{className:"p-6 border-t border-gray-200 dark:border-[#252A36] bg-white dark:bg-[#0F121A]/95 flex justify-end gap-4 sticky bottom-0 z-10",children:[c.jsx("button",{onClick:()=>Nt(!1),className:"px-6 py-3 rounded-xl font-bold text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:bg-[#1A1D24] transition-colors",children:i("Close")}),c.jsx("button",{onClick:async()=>{var xt;const de=qe[Je],me=zi==null?void 0:zi.find(Ct=>{var zt;return Ct.workflowId===(((zt=de==null?void 0:de.execution)==null?void 0:zt.workflowId)||(de==null?void 0:de.executionId))}),Be=(xt=document.getElementById("editPostText"))==null?void 0:xt.value;if(me&&Be!==void 0)try{await bae({postId:me.id,text:Be}),hh(),gr.success(i("Post text updated successfully!")),Nt(!1)}catch{gr.error(i("Failed to update post."))}},className:"px-8 py-3 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl font-bold shadow-lg shadow-emerald-500/20 transition-all",children:i("Save Changes")}
5792)]})]})}),c.jsx(sct,{isShown:ox,hide:()=>ch(!1),headerText:i("Select a Topic for your Video"),modalContent:wp}),Ai&&(pe==null?void 0:pe.isRss)&&Vl.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-end sm:items-center justify-center p-0 sm:p-4",children:[c.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>Oi(!1)}),c.jsxs("div",{className:"relative w-full sm:max-w-lg bg-white dark:bg-[#0F121A] rounded-t-3xl sm:rounded-2xl shadow-2xl overflow-hidden",children:[c.jsx("div",{className:"flex justify-center pt-3 pb-1 sm:hidden",children:c.jsx("div",{className:"w-10 h-1 rounded-full bg-gray-300 dark:bg-gray-700"})}),c.jsx("div",{className:"px-6 pt-5 pb-4 border-b border-gray-100 dark:border-[#1E2230]",children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-100 dark:bg-amber-900/30 flex items-center justify-center text-xl shrink-0",children:pe.feedUrl!==((Su=Ee[0])==null?void 0:Su.url)?"ð°":"ð¡"}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-bold text-gray-900 dark:text-white leading-tight",children:pe.feedUrl!==((Ad=Ee[0])==null?void 0:Ad.url)?i("Blog Website Detected"):i("RSS Feed Detected")}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate max-w-xs",children:pe.feedTitle||pe.feedUrl})]})]}),c.jsx("button",{onClick:()=>Oi(!1),className:"p-1.5 rounded-lg text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-[#1E2230] transition-colors shrink-0",children:c.jsx(UN,{className:"w-4 h-4"})})]})}),c.jsxs("div",{className:"px-6 py-5 space-y-4 max-h-[65vh] overflow-y-auto",children:[c.jsx("div",{className:"p-4 rounded-xl bg-emerald-50 dark:bg-emerald-900/10 border border-emerald-200 dark:border-emerald-800/40",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(FN,{className:"w-5 h-5 text-emerald-500 shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:i("One post per article")}),c.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",children:[i("We found")," ",c.jsx("strong",{className:"text-gray-700 dark:text-gray-300",children:i("{n} articles",{n:pe.itemCount})}),i(". Instead of a generic blog post, each article gets its own tailored social post with real content from that article.")]})]})]})}),pe.items.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2",children:i("Latest Articles")}),c.jsxs("div",{className:"space-y-1.5",children:[pe.items.slice(0,5).map((de,me)=>c.jsxs("div",{className:"flex items-start gap-2.5 p-2.5 rounded-lg bg-gray-50 dark:bg-[#1A1D24]/60 border border-gray-100 dark:border-[#252A36]",children:[c.jsx("span",{className:"text-xs font-bold text-gray-400 w-4 shrink-0 pt-0.5",children:me+1}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-medium text-gray-800 dark:text-gray-200 line-clamp-1",children:de.title}),de.pubDate&&c.jsx("p",{className:"text-[10px] text-gray-400 mt-0.5",children:new Date(de.pubDate).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})})]})]},de.guid)),pe.itemCount>5&&c.jsxs("p",{className:"text-xs text-center text-gray-400 py-1",children:["+",i("{n} more",{n:pe.itemCount-5})]})]})]}),c.jsxs("div",{className:"relative py-1",children:[c.jsx("div",{className:"absolute inset-0 flex items-center",children:c.jsx("div",{className:"w-full border-t border-gray-200 dark:border-[#252A36]"})}),c.jsx("div",{className:"relative flex justify-center",children:c.jsx("span",{className:"px-3 text-xs text-gray-400 dark:text-gray-500 bg-white dark:bg-[#0F121A]",children:i("Optional")})})]}),c.jsxs("div",{className:"p-4 rounded-xl border border-gray-200 dark:border-[#252A36] bg-gray-50/50 dark:bg-[#1A1D24]/30",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("span",{className:"text-base",children:"ð"}),c.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:i("Connect Blog for Auto-Sync")})]}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 leading-relaxed",children:i("Every new article published to this feed will automatically generate and schedule a social post.")})]}),c.jsx("button",{onClick:()=>qi(de=>!de),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors duration-200 mt-0.5 ${ss?"bg-emerald-500":"bg-gray-200 dark:bg-gray-700"}`,children:c.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform duration-200 ${ss?"translate-x-6":"translate-x-1"}`})})]}),ss&&c.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 dark:border-[#252A36] flex items-center gap-2 text-xs text-emerald-600 dark:text-emerald-400",children:[c.jsx($at,{className:"w-3.5 h-3.5 shrink-0"}),c.jsx("span",{children:i("Spread Out AI will check this feed every 30 minutes and auto-post new articles.")})]})]})]}),c.jsxs("div",{className:"px-6 py-4 border-t border-gray-100 dark:border-[#1E2230] flex flex-col sm:flex-row gap-3",children:[c.jsx("button",{onClick:()=>
5792Oi(!1),className:"flex-1 py-3 px-4 rounded-xl border border-gray-200 dark:border-[#252A36] text-sm font-semibold text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-[#1A1D24] transition-colors",children:i("Cancel")}),c.jsx("button",{onClick:()=>ff(ss),disabled:ke||aa,className:"flex-1 py-3 px-4 rounded-xl bg-emerald-500 hover:bg-emerald-400 disabled:opacity-50 disabled:cursor-not-allowed text-white text-sm font-bold shadow-lg shadow-emerald-500/20 transition-all flex items-center justify-center gap-2",children:ke?c.jsxs(c.Fragment,{children:[c.jsxs("svg",{className:"animate-spin w-4 h-4",viewBox:"0 0 24 24",fill:"none",children:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"})]}),i("Generatingâ¦")]}):c.jsxs(c.Fragment,{children:[c.jsx(FN,{className:"w-4 h-4"}),ss?"Generate & Connect Blog â¨":"Generate Posts â¨"]})})]})]})]}),document.body)]})}const uct=()=>{const[n,e]=G.useState(!1),[t,r]=G.useState(null),[i,s]=G.useState(null),a="Generate an engaging UGC ad video with avatar for the following product: https://www.amazon.com/Instant-Pot-Multi-Use-Programmable-Pressure/dp/B00FLYWNYQ/ref=sr_1_3?_encoding=UTF8&content-id=amzn1.sym.8158743a-e3ec-4239-b3a8-31bfee7d4a15&dib=eyJ2IjoiMSJ9.Jcq8w8ngb1LGhnPudpuQJWBbiiiwfJs4MOvoCL8wg7UqmXVKdvP65F5i-Y40xoHSDuoShyv5G0LC9QTzDZjJo_G4uGvU8PqQFMoW5H9NlWHoC9TV-A28OVzzjNjKNbJ56w9pOp2tbQRDaETWZVJ2v-5hgE9ilA1QrvMEZO2lt78fTdrPV6qEtVqeaMCaF8lHcFwzox9j72dNMrLhegfw4_Oh6FpaSaKqfIZqHCqUEe8.S3yUHHjJuWcZVpL7R4l7xJaqBKfL48Cba7n1l6AMWLc&dib_tag=se&keywords=cooker&pd_rd_r=74b3a8ad-1aa3-479c-90ef-3ede946268ab&pd_rd_w=KgEgL&pd_rd_wg=x1cZi&qid=1758654292&sr=8-3&th=1",o=async()=>{console.log("ð¬ Starting Tailored Ad Video Test"),console.log("Test Parameters:",{promptLength:a.length,voiceGender:"Male",avatarId:"professional-male-1"}),e(!0),s(null),r(null);try{const l=Date.now(),u=await i4e({prompt:a.trim(),voiceGender:"Male",avatarId:"professional-male-1"}),d=(Date.now()-l)/1e3;console.log("â
Test completed successfully!"),console.log(`Duration: ${d.toFixed(2)} seconds`),console.log("Result:",u),r(u)}catch(l){console.error("â Test failed:",l),s(l.message||"Unknown error")}finally{e(!1)}};return c.jsxs("div",{className:"max-w-4xl mx-auto p-6 bg-white rounded-lg shadow-lg",children:[c.jsx("h1",{className:"text-2xl font-bold mb-6 text-gray-900",children:"ð¬ Tailored Ad Video Test"}),c.jsxs("div",{className:"mb-6",children:[c.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Test Prompt:"}),c.jsx("div",{className:"bg-gray-100 p-3 rounded border text-sm",children:a}),c.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:["Length: ",a.length," characters"]})]}),c.jsxs("div",{className:"mb-6",children:[c.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Test Parameters:"}),c.jsxs("ul",{className:"list-disc list-inside text-sm text-gray-700",children:[c.jsx("li",{children:"Voice Gender: Male"}),c.jsx("li",{children:"Avatar ID: professional-male-1"}),c.jsxs("li",{children:["Prompt Length: ",a.length," characters"]})]})]}),c.jsx("button",{onClick:o,disabled:n,className:`px-6 py-3 rounded-lg font-semibold text-white transition-colors ${n?"bg-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"}`,children:n?"ð Generating Video...":"ð Start Test"}),n&&c.jsxs("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded",children:[c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600 mr-2"}),c.jsx("span",{className:"text-blue-800",children:"Generating tailored ad video... This may take several minutes."})]}),c.jsx("div",{className:"mt-2 text-sm text-blue-600",children:"Check the browser console and server logs for detailed progress."})]}),i&&c.jsxs("div",{className:"mt-4 p-4 bg-red-50 border border-red-200 rounded",children:[c.jsx("h3",{className:"text-red-800 font-semibold",children:"â Error:"}),c.jsx("p",{className:"text-red-700 mt-1",children:i}),c.jsx("div",{className:"mt-2 text-sm text-red-600",children:"Check the browser console and server logs for more details."})]}),t&&c.jsxs("div",{className:"mt-4 p-4 bg-green-50 border border-green-200 rounded",children:[c.jsx("h3",{className:"text-green-800 font-semibold",children:"â
Success!"}),c.jsxs("div",{className:"mt-2",children:[c.jsx("h4",{className:"font-semibold text-gray-700",children:"Result:"}),c.jsx("pre",{className:"mt-1 text-sm bg-gray-100 p-2 rounded overflow-x-auto",children:JSON.stringify(t,null,2)})]}),t.fileUrl&&c.jsxs("div",{className:"mt-4",children:[c.jsx("h4",{className:"font-semibold text-gray-700",children:"Generated Video:"}),c.jsx("video",{src:t.fileUrl,controls:!0,className:"mt-2 max-w-full h-auto rounded border",style:{maxHeight:"400px"},children:"Your browser does not support the video tag."}),c.jsx("div",{className:"mt-2",children:c.jsx("a",{href:t.fileUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 underline",children:"Open video in new tab"})})]})]})]})},u_=["monday","tuesday","wednesday","thursday","friday","saturday","
5792sunday"],YAe=n=>{if(!n)return{};if(typeof n=="object")return n;try{return JSON.parse(n)||{}}catch{return{}}},X5=n=>{const e=String(n||"").trim().toLowerCase();return u_.includes(e)?e:null},Hq=n=>{const e=Array.isArray(n)?n[0]:n;return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:null},QAe=n=>u_[(n.getDay()+6)%7];function Gb(n){var i,s;const e=YAe(n);if(e.automationType!=="one-off")return null;const t=X5((i=e.days)==null?void 0:i[0]),r=t?Hq(((s=e.times)==null?void 0:s[t])??e.time):null;return t&&r?{day:t,time:r}:null}function dct(n,e=new Date){var s;const t=Gb(n.schedule);if(t)return t;const r=YAe(n.options),i=(s=/^(monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i.exec(n.name||""))==null?void 0:s[1];return{day:X5(r.scheduledDay)||X5(i)||QAe(e),time:Hq(r.scheduledTime)||"10:00"}}function KAe(n,e,t=new Date){const r=u_.indexOf(X5(n)),[i,s]=e.split(":").map(Number),a=new Date(t);return a.setHours(i,s,0,0),a.setDate(a.getDate()+(r-u_.indexOf(QAe(t))+7)%7),a.getTime()<=t.getTime()&&a.setDate(a.getDate()+7),a}function hct(n,e,t=new Date){const r=X5(n),i=Hq(e);if(!r||!i)throw new Error(`Invalid post slot: ${n} ${e}`);const s=KAe(r,i,t);return{type:"weekly",days:[r],times:{[r]:i},automationType:"one-off",timezoneOffset:t.getTimezoneOffset(),minPublishDate:new Date(s.getTime()-6e4).toISOString()}}function ZAe({workflow:n,onDone:e}){const{t,locale:r}=Kr(),i=dct(n),s=Gb(n==null?void 0:n.schedule),[a,o]=G.useState(i.day),[l,u]=G.useState(i.time),[d,h]=G.useState(null),[f,p]=G.useState(""),g=(T,L)=>new Date(2024,0,1+u_.indexOf(T)).toLocaleDateString(r,{weekday:L}),A=/^\d{2}:\d{2}$/.test(l),x=A?KAe(a,l):null,b=!!s&&s.day===a&&s.time===l,_=async()=>{h("save"),p("");try{await Cm({id:n.id,schedule:JSON.stringify(hct(a,l))}),e==null||e(!0)}catch(T){p((T==null?void 0:T.message)||t("Something went wrong"))}finally{h(null)}},M=async()=>{h("clear"),p("");try{await Cm({id:n.id,schedule:null}),e==null||e(!1)}catch(T){p((T==null?void 0:T.message)||t("Something went wrong"))}finally{h(null)}};return c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-3",children:t("Post on")}),c.jsx("div",{className:"grid grid-cols-7 gap-1.5",role:"radiogroup","aria-label":t("Day of the week"),children:u_.map(T=>c.jsx("button",{type:"button",role:"radio","aria-checked":a===T,onClick:()=>o(T),title:g(T,"long"),className:`rounded-xl py-2.5 text-xs font-bold transition-all ${a===T?"bg-[var(--lp-lime)] text-black shadow-[0_8px_24px_-10px_rgba(207,255,5,.8)]":"bg-white/[0.05] text-white/70 ring-1 ring-white/10 hover:bg-white/[0.09] hover:text-white"}`,children:g(T,"short")},T))}),c.jsxs("label",{className:"mt-4 flex items-center justify-between gap-3 rounded-xl bg-white/[0.04] px-4 py-3 ring-1 ring-white/10",children:[c.jsx("span",{className:"text-sm font-semibold text-white/80",children:t("Time")}),c.jsx("input",{type:"time",value:l,onChange:T=>u(T.target.value),className:"ws-mono rounded-lg border-0 bg-black/40 px-3 py-1.5 text-sm text-white focus:ring-2 focus:ring-[var(--lp-lime)] [color-scheme:dark]"})]}),x&&c.jsx("p",{className:"ws-muted mt-3 text-sm",children:t("Next post: {when}",{when:x.toLocaleString(r,{weekday:"long",day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})})}),f&&c.jsx("p",{className:"mt-2 text-sm text-red-300",children:f}),c.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-2",children:[c.jsx("button",{onClick:_,disabled:!A||!!d||b,className:"ws-btn ws-btn-primary !h-11 flex-1 !px-5 text-sm",children:d==="save"?t("Savingâ¦"):s?t("Move to {day} · {time}",{day:g(a,"long"),time:l}):t("Schedule for {day} · {time}",{day:g(a,"long"),time:l})}),s&&c.jsx("button",{onClick:M,disabled:!!d,className:"ws-btn ws-btn-ghost !h-11 !px-4 text-sm",children:t(d==="clear"?"Savingâ¦":"Remove schedule")})]})]})}const MO=[{key:"instagram",label:"Instagram",color:"#E4405F",provider:"instagram"},{key:"facebook",label:"Facebook",color:"#1877F2",provider:"facebook"},{key:"tiktok",label:"TikTok",color:"#000000",provider:"tiktok"},{key:"youtube",label:"Youtube",color:"#FF0000",provider:"youtube"},{key:"twitter",label:"X.com",color:"#000000",provider:"x.com"},{key:"linkedin",label:"LinkedIn",color:"#0077B6",provider:"linkedin"}];function JAe(n){const e=String(n||"").toLowerCase().trim();return e==="facebook-reels"?"facebook":e==="instagram-reels"?"instagram":e==="youtube-shorts"?"youtube":e==="x"||e==="x.com"?"twitter":e}const fct=n=>JAe(String(n||"").toLowerCase());function pct(n){let e=[];
5792if(Array.isArray(n))e=n;else if(typeof n=="string"&&n.trim())try{const t=JSON.parse(n);e=Array.isArray(t)?t:[t]}catch{e=n.split(",")}return[...new Set(e.map(t=>JAe(typeof t=="string"?t:(t==null?void 0:t.value)||"")).filter(Boolean))]}const mct={instagram:Py,facebook:zT,tiktok:XR,youtube:YR,twitter:D1,linkedin:GT};function gct({workflow:n,connections:e,onClose:t,onSaved:r}){const{t:i}=Kr(),s=G.useMemo(()=>pct(n.socialMedias),[n.socialMedias]),[a,o]=G.useState(s),[l,u]=G.useState(!1),[d,h]=G.useState(null),f=_=>(e||[]).find(M=>fct(M.provider)===_),p=_=>o(M=>M.includes(_)?M.filter(T=>T!==_):[...M,_]),g=a.filter(_=>!s.includes(_)),A=s.filter(_=>!a.includes(_)),x=g.length+A.length>0,b=async()=>{var _;u(!0),h(null);try{const M=await GSe({parentWorkflowId:n.id,channels:a});r(M)}catch(M){h(((_=M==null?void 0:M.data)==null?void 0:_.message)||(M==null?void 0:M.message)||i("Could not save. Try again.")),u(!1)}};return Vl.createPortal(c.jsx("div",{className:"ws inset-0 z-[100] flex items-end justify-center backdrop-blur-sm sm:items-center sm:p-6",style:{position:"fixed",background:"rgba(0,0,0,.7)"},onClick:t,children:c.jsxs("div",{className:"ws-glass w-full max-w-lg overflow-hidden rounded-t-[28px] !bg-[#0a0c12]/95 sm:rounded-[28px]",style:{animation:"ws-enter .45s cubic-bezier(.22,1,.36,1) both"},onClick:_=>_.stopPropagation(),role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-white/[0.06] p-5 sm:p-6",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"ws-kicker mb-1.5",children:i("Channels")}),c.jsx("h3",{className:"ws-display truncate text-xl font-bold text-white",children:n.name.replace(/^\[(Auto-Pilot|Batch)\]\s*/,"")}),c.jsx("p",{className:"ws-muted mt-1 text-sm",children:i("Choose where every upcoming post of this campaign is published.")})]}),c.jsx("button",{onClick:t,"aria-label":i("Close"),className:"grid h-9 w-9 shrink-0 place-items-center rounded-full bg-white/[0.05] text-white/70 hover:text-white",children:c.jsx(KTe,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"grid grid-cols-1 gap-2 p-5 sm:grid-cols-2 sm:p-6",children:MO.map(_=>{const M=f(_.key),T=!!M&&(M.authStatus||"active")==="active",L=a.includes(_.key),D=mct[_.key];return c.jsxs("button",{type:"button",disabled:!T&&!L,onClick:()=>p(_.key),"aria-pressed":L,className:`flex items-center gap-3 rounded-2xl border p-3 text-left transition-all duration-300 disabled:cursor-not-allowed disabled:opacity-40 ${L?"border-[rgba(207,255,5,.5)] bg-[rgba(207,255,5,.07)]":"border-white/[0.08] bg-white/[0.02] hover:border-white/20"}`,children:[c.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-full text-white",style:{background:_.color==="#000000"?"#111":_.color},children:c.jsx(D,{className:"h-4 w-4"})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block text-sm font-bold text-white",children:_.label}),c.jsx("span",{className:`block truncate text-[11.5px] ${T?"text-white/50":"text-amber-300/80"}`,children:M?T?M.username?`@${String(M.username).replace(/^@/,"")}`:i("Connected"):i("Login expired"):i("Not connected")})]}),c.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-full ${L?"bg-[var(--lp-lime)] text-black":"ring-1 ring-white/20"}`,children:L&&c.jsx(ioe,{className:"h-3.5 w-3.5"})})]},_.key)})}),c.jsxs("div",{className:"space-y-3 border-t border-white/[0.06] p-5 sm:px-6",children:[c.jsxs("p",{className:"text-xs text-white/50",children:[c.jsx(rw,{className:"-mt-0.5 mr-1 inline h-3.5 w-3.5"}),i("Need another account? Connect it under Channels in the sidebar, then come back here.")]}),x&&c.jsxs("p",{className:"text-xs text-white/65",children:[g.length>0&&i("Upcoming posts will also go to {list}.",{list:g.map(_=>{var M;return(M=MO.find(T=>T.key===_))==null?void 0:M.label}).join(", ")}),g.length>0&&A.length>0&&" ",A.length>0&&i("They will stop going to {list}.",{list:A.map(_=>{var M;return(M=MO.find(T=>T.key===_))==null?void 0:M.label}).join(", ")})," ",i("Posts already published stay where they are.")]}),d&&c.jsx("div",{className:"rounded-2xl border border-red-400/25 bg-red-500/10 px-4 py-3 text-sm text-red-200",children:d}),c.jsxs("div",{className:"flex justify-end gap-2.5",children:[c.jsx("button",{type:"button",onClick:t,className:"ws-btn ws-btn-ghost !h-11 !px-5 text-sm",children:i("Cancel")}),c.jsx("button",{type:"button",onClick:b,disabled:l||!x||!a.length,className:"ws-btn ws-btn-primary !h-11 !px-6 text-sm",children:i(l?"Savingâ¦":"Save channels")})]})]})]})}),document.body)}const s8={facebook:c.jsx(y1,{className:"w-5 h-5"}),twitter:c.jsx(MB,{className:"w-5 h-5"}),linkedin:c.jsx(Ay,{className:"w-5 h-5"}),reddit:c.jsx(coe,{className:"w-5 h-5"}),youtube:c.jsx(mT,{className:"w-5 h-5"}),tiktok:c.jsx(pT,{className:"w-5 h-5"}),instagram:c.jsx(x_,{className:"w-5 h-5"}),"facebook-reels":c.jsx(y1,{className:"w-5 h-5"})},Fte={facebook:{label:"Facebook",color:"#1877F2"},"facebook-reels":{label:"Facebook Reels",color:"#1877F2"},instagram:{label:"Instagram",color:"#E4405F"},"instagram-reels":{label:"Instagram Reels",color:"#E4405F"},tiktok:{label:"TikTok",color:"#000000"},twitter:{label:"Twitter",color:"#1DA1F2"},x:{label:"X",color:"#000000"},linkedin:{label:"LinkedIn",color:"#0A66C2"},youtube:{label:"YouTube",color:"#FF0000"},"youtube-shorts":{label:"YouTube Shorts",color:"#FF0000"},reddit:{label:"Reddit",color:"#FF4500"}},sv=n=>{if(!n)return"";let e=n.replace(/^\[(Auto-Pilot|Batch)\]\s*/i,"").trim();return e=e.replace(/(https?:\/\/[^\s]+|www\.[^\s]+|[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(?:\/[^\s]*)?)/gi,t=>t.toLowerCase()),e},sb=(n,e)=>{if(!n)return!1;const t=n.status;if(!t||t==="running"||t==="processing"||t==="pending"||t==="queued"||t==="generating"||t==="failed"||t==="cancelled")return!1;if(t==="posted")return!0;let r={};try{r=typeof n.result=="string"?JSON.parse(n.result):n.result||{}}catch{}const i=Array.isArray(r.imageUrls)&&r.imageUrls.length>0||!!r.imageUrl,s=Array.isArray(r.videoUrls)&&r.videoUrls.length>0||!!r.finalVideoUrl||!!r.videoUrl,a=!!r.postId||!!r.postUrl||!!r.liveUrl;return i||s||a?!0:t==="completed"||t==="succeeded"||t==="scheduled"},LU=(n,e,t)=>{if(!n)return!1;const r=n.status;if(!r||r==="posted"||r==="completed"||r==="succeeded"||r==="failed"||r==="cancelled"||r==="queued"||r==="pending")return!1;const a=(e||n.type||(t==null?void 0:t.workflowType)||"").toLowerCase().includes("long")?7200*1e3:5400*1e3,o=new Date(n.updatedAt||n.createdAt||0).getTime();return isNaN(o)||o===0?!1:Date.now()-o>a},H2=(n,e,t,r)=>{if(!t||t.length===0)return null;const i=((e==null?void 0:e.name)||"").replace("[Auto-Pilot] ","").replace("[Batch] ","").trim(),s=((n==null?void 0:n.day)||"").trim(),a=n==null?void 0:n.childWorkflowId;if(a){const o=t.filter(l=>
5792l.workflowId===a);if(o.length>0){const l=o.find(u=>["running","processing","generating","queued","pending"].includes(u.status));return l||o.sort((u,d)=>new Date(d.createdAt).getTime()-new Date(u.createdAt).getTime())[0]}}if(n!=null&&n.executionId){const o=t.find(l=>l.id===n.executionId);if(o)return o}if(i&&s&&r){const o=r.find(l=>{const u=(l.name||"").trim();return u.toLowerCase()===`${i} - ${s}`.toLowerCase()||u.toLowerCase().startsWith(i.toLowerCase())&&u.toLowerCase().endsWith(s.toLowerCase())});if(o){const l=t.filter(u=>u.workflowId===o.id);if(l.length>0){const u=l.find(d=>["running","processing","generating","queued","pending"].includes(d.status));return u||l.sort((d,h)=>new Date(h.createdAt).getTime()-new Date(d.createdAt).getTime())[0]}}}return null},GS=(n,e)=>{if(!n)return[];let t=[];if(Array.isArray(n))t=n;else if(typeof n=="string"){const i=n.trim();if(i.startsWith("[")||i.startsWith("{"))try{const s=JSON.parse(i);t=Array.isArray(s)?s:[s]}catch{t=i.split(",").map(a=>a.trim()).filter(Boolean)}else t=i.split(",").map(s=>s.trim()).filter(Boolean)}const r=t.map(i=>{if(typeof i=="string"){const s=i.replace(/^\[?"?|"?\]?$/g,"").toLowerCase().trim(),a=Fte[s]||{label:s.charAt(0).toUpperCase()+s.slice(1),color:"#6366F1"};let o=a.color;return(s==="tiktok"||s==="x")&&(o="#000000"),{value:s,label:a.label,color:o}}if(typeof i=="object"&&i!==null){const s=(i.value||i.name||"").toLowerCase(),a=Fte[s];let o=i.color||(a==null?void 0:a.color)||"#6366F1";const l=!o||o.toLowerCase()==="#ffffff"||o.toLowerCase()==="#fff"||o.toLowerCase()==="white";return(s==="tiktok"||s==="x"||l)&&(o=(a==null?void 0:a.color)||"#000000"),{value:s||"social",label:i.label||(a==null?void 0:a.label)||s||"Social",color:o}}return{value:"social",label:"Social",color:"#6366F1"}}).filter(i=>i.value);if(e&&e.length>0){const i=e.map(a=>{let o=(a.provider||"").toLowerCase();return o==="x.com"||o==="twitter"?"twitter":o}),s=r.filter(a=>{let o=a.value.toLowerCase();return(o==="x.com"||o==="twitter")&&(o="twitter"),o==="instagram-reels"&&(o="instagram"),o==="facebook-reels"&&(o="facebook"),o==="youtube-shorts"&&(o="youtube"),i.includes(o)});return s.length>0?s:r}return r},V6=(n,e="text-xs font-medium")=>{const t=(n.value||"").toLowerCase(),r=(n.color||"").toLowerCase(),s=t==="tiktok"||t==="x"||r==="#000000"||r==="#000"||(!r||r==="#ffffff"||r==="#fff"||r==="white"||r==="rgb(255,255,255)"||r==="rgba(255,255,255,1)"),a=s?"#000000":n.color||"#6366F1";return c.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full shadow-sm text-white ${s?"bg-black text-white border border-gray-700/80 dark:border-gray-600":""}`,style:{backgroundColor:a,color:"#ffffff"},children:[s8[n.value],c.jsx("span",{className:e,children:n.label})]},n.value)},DA=n=>{if(!n)return[];let e;if(typeof n=="object")e=n;else if(typeof n=="string")try{e=JSON.parse(n),typeof e=="string"&&(e=JSON.parse(e))}catch{return n}else e=n;return e},OU=({type:n,className:e="w-3.5 h-3.5"})=>n==="vertical"?c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("rect",{width:"12",height:"18",x:"6",y:"3",rx:"2.5"}),c.jsx("polygon",{points:"10 9 10 15 15 12",fill:"currentColor",stroke:"none"})]}):n==="long"?c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("rect",{width:"20",height:"14",x:"2",y:"5",rx:"2.5"}),c.jsx("polygon",{points:"10 9 10 15 15 12",fill:"currentColor",stroke:"none"})]}):c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("rect",{width:"13",height:"13",x:"8",y:"8",rx:"2"}),c.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}),c.jsx("circle",{cx:"12.5",cy:"12.5",r:"1.5",fill:"currentColor",stroke:"none"}),c.jsx("path",{d:"m19 17-3.5-3.5-5 5"})]}),DU=(n,e)=>{const t=((e==null?void 0:e.workflowType)||(e==null?void 0:e.type)||n||"").toLowerCase().trim();return t==="video"||t==="short-video"||t==="short_video"||t==="shorts"||t==="vertical"||t==="vertical-video"||t==="vertical_video"||t==="ugc"?{label:Us("Vertical Video"),type:"vertical",badgeClass:"bg-purple-500/10 text-purple-600 dar
5792k:text-purple-400 border border-purple-500/20"}:t==="long-video"||t==="long_video"||t==="long"||t==="landscape-video"||t==="landscape"?{label:Us("Long Video"),type:"long",badgeClass:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border border-indigo-500/20"}:{label:Us("Carousel"),type:"carousel",badgeClass:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20"}},jU=(n,e)=>{const t=o=>{var l,u,d,h;if(!o)return"";if(typeof o=="string")try{const f=JSON.parse(o);return t(f)}catch{return o}return o.workflowSubType||o.contentStyle||o.style||((l=o.config)==null?void 0:l.workflowSubType)||((u=o.config)==null?void 0:u.contentStyle)||((d=o.options)==null?void 0:d.workflowSubType)||((h=o.options)==null?void 0:h.contentStyle)||""};let r=t(n)||t(e);if(!r&&(e!=null&&e.workflow)&&(r=t(e.workflow)),!r){const o=((e==null?void 0:e.name)||(e==null?void 0:e.workflowName)||(n==null?void 0:n.name)||"").toLowerCase();o.includes("vox")?r="vox-style":o.includes("app demo")||o.includes("app-demo")?r="app-demo":o.includes("step tutorial")||o.includes("step-tutorial")?r="step-tutorial":o.includes("top list")||o.includes("top-list")?r="top-list":o.includes("explainer")?r="explainer-video":o.includes("brand story")?r="brand-story":o.includes("quick tip")||o.includes("quick-tip")?r="quick-tip":o.includes("storytelling")?r="storytelling":o.includes("behind scenes")||o.includes("behind-scenes")?r="behind-scenes":o.includes("fast facts")||o.includes("fast-facts")?r="fast-facts":o.includes("hook tease")||o.includes("hook-tease")?r="hook-tease":(o.includes("ugc")||o.includes("product plug"))&&(r="product-plug")}const i=r.toLowerCase().trim();if(!i)return null;const s={"vox-style":{label:Us("Vox Style"),badgeClass:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20"},vox:{label:Us("Vox Style"),badgeClass:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20"},"app-demo":{label:Us("App Demo"),badgeClass:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20"},appdemo:{label:Us("App Demo"),badgeClass:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20"},"product-plug":{label:Us("Product Plug"),badgeClass:"bg-pink-500/10 text-pink-600 dark:text-pink-400 border border-pink-500/20"},"ugc-product-ad":{label:Us("UGC Product Ad"),badgeClass:"bg-pink-500/10 text-pink-600 dark:text-pink-400 border border-pink-500/20"},ugc:{label:Us("UGC"),badgeClass:"bg-pink-500/10 text-pink-600 dark:text-pink-400 border border-pink-500/20"},"tailored-ad-video":{label:Us("Tailored Ad"),badgeClass:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border border-violet-500/20"},"tailored-ad":{label:Us("Tailored Ad"),badgeClass:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border border-violet-500/20"},"quick-tip":{label:Us("Quick Tip"),badgeClass:"bg-teal-500/10 text-teal-600 dark:text-teal-400 border border-teal-500/20"},storytelling:{label:Us("Storytelling"),badgeClass:"bg-orange-500/10 text-orange-600 dark:text-orange-400 border border-orange-500/20"},"behind-scenes":{label:Us("Behind the Scenes"),badgeClass:"bg-stone-500/10 text-stone-600 dar
5792k:text-stone-400 border border-stone-500/20"},"hook-tease":{label:Us("Hook & Tease"),badgeClass:"bg-rose-500/10 text-rose-600 dark:text-rose-400 border border-rose-500/20"},"fast-facts":{label:Us("Fast Facts"),badgeClass:"bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border border-cyan-500/20"},"mini-explainer":{label:Us("Mini Explainer"),badgeClass:"bg-sky-500/10 text-sky-600 dark:text-sky-400 border border-sky-500/20"},"ai-voiceover-clips":{label:Us("AI Voiceover"),badgeClass:"bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400 border border-fuchsia-500/20"},"step-tutorial":{label:Us("Step Tutorial"),badgeClass:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20"},"top-list":{label:Us("Top List"),badgeClass:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 border border-yellow-500/20"},"explainer-video":{label:Us("Explainer"),badgeClass:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border border-indigo-500/20"},"brand-story":{label:Us("Brand Story"),badgeClass:"bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20"},"scripted-story":{label:Us("Scripted Story"),badgeClass:"bg-purple-500/10 text-purple-600 dark:text-purple-400 border border-purple-500/20"}};return s[i]?s[i]:{label:i.replace(/[-_]+/g," ").split(" ").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" "),badgeClass:"bg-gray-500/10 text-gray-700 dark:text-gray-300 border border-gray-500/20"}},Act=(n,e)=>{if(!n)return!1;const t=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],r=new Date,i=r.toLocaleDateString("en-US",{weekday:"long"}).toLowerCase(),s=t.indexOf(i),a=t.indexOf(n.toLowerCase().trim());if(a===-1||s===-1)return!1;if(a<s)return!0;if(a===s){if(!e)return!1;const o=e.split(":").map(f=>parseInt(f,10));if(o.length===0||isNaN(o[0]))return!1;const[l,u=0]=o,d=r.getHours(),h=r.getMinutes();return d>l||d===l&&h>=u}return!1};function e1e(n){if(!n||n.status==="posted")return null;try{const e=typeof n.result=="string"?JSON.parse(n.result):n.result||{},t=e.publishError||(typeof e.error=="string"&&/publish/i.test(e.error)?e.error:null);return t?{message:t,reconnect:Array.isArray(e.reconnect)?e.reconnect:[]}:null}catch{return null}}const xct={generating:Le("Generating"),posted:Le("Posted"),failed:Le("Failed"),scheduled:Le("Scheduled"),queued:Le("Queued"),completed:Le("Completed"),cancelled:Le("Cancelled"),pending:Le("Pending"),running:Le("Generating")},t1e=n=>Us(xct[n]||n),vct={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6},L4=n=>{const e=vct[(n||"").trim().toLowerCase()];return e===void 0?n||"":new Date(2024,0,7+e).toLocaleDateString(Toe(),{weekday:"long"})};function Ute(n,e){const t=e1e(e);return t?c.jsxs("span",{title:t.message,children:["â ",Us("Post failed"),t.reconnect.length?` · ${Us("Reconnect {platforms}",{platforms:t.reconnect.join(", ")})}`:` · ${Us("Retry")}`]}):t1e(n)}function yct(n){var i;let e={};try{e=typeof(n==null?void 0:n.result)=="string"?JSON.parse(n.result):(n==null?void 0:n.result)||{}}catch{}const t=((i=e==null?void 0:e.videoUrls)==null?void 0:i[0])||(e==null?void 0:e.videoUrl)||(e==null?void 0:e.finalVideoUrl)||void 0,r=Array.isArray(e==null?void 0:e.imageUrls)?e.imageUrls.filter(Boolean):e!=null&&e.imageUrl?[e.imageUrl]:[];return{video:t,images:r,text:typeof(e==null?void 0:e.text)=="string"?e.text:typeof(e==null?void 0:e.content)=="string"?e.content:""}}function bct({workflow:n,execution:e,older:t,socialMedias:r,regenerating:i,retrying:s,deleting:a,onView:o,onRetry:l,onRegenerate:u,onRepost:d,onDelete:h,onSchedule:f}){var _e,Ee;const{t:p,locale:g}=Kr(),[A,x]=G.useState(!1),b=e==null?void 0:e.status,_=!i&&(b==="queued"||b==="pending"),M=!i&&sb(e,n==null?void 0:n.type),T=!i&&!!e&&(b==="failed"||!M&&!_&&LU(e,n==null?void 0:n.type,n==null?void 0:n.options)),L=!i&&b==="posted",D=!i&&M&&!L&&!T,P=i||!!e&&!M&&!T&&!L&&!_,O=!e&&!i,F=e1e(e),U=DA(n==null?void 0:n.schedule),B=Gb(n==null?void 0:n.schedule),z=(U==null?void 0:U.automationType)==="auto"?(_e=U==null?void 0:U.days)==null?void 0:_e[0]:null,H=z?[].concat(((Ee=U==null?void 0:U.times)==null?void 0:Ee[z])??[])[0]:null,X=B?`${L4(B.day)}
5792 · ${B.time}`:z&&H?`${L4(z)} · ${H}`:null,W=!!X,J=L?new Date(e.updatedAt||e.createdAt).toLocaleDateString(g,{month:"short",day:"numeric"}):X||new Date((e||n).createdAt).toLocaleDateString(g,{month:"short",day:"numeric"}),ee=F?{label:c.jsxs(c.Fragment,{children:["â ",p("Post failed")]}),cls:"bg-orange-400 text-black ring-black/10"}:L?{label:p("Posted"),cls:"bg-[var(--lp-lime)] text-black ring-transparent"}:T?{label:p("Failed"),cls:"bg-red-500 text-white ring-black/10"}:D?{label:p(W?"Scheduled":"Ready"),cls:"bg-sky-400 text-black ring-black/10"}:_?{label:p("Queued"),cls:"bg-black/70 text-white ring-white/15"}:P?{label:p("Generating"),cls:"bg-amber-300 text-black ring-black/10"}:{label:p("Not generated yet"),cls:"bg-black/70 text-white/80 ring-white/15"},ae=yct(e),le=!!e&&(D||L||!!F),Z=P&&typeof(e==null?void 0:e.result)=="string"&&!e.result.startsWith("{")?e.result:"",Y=DU(n==null?void 0:n.type,DA((e==null?void 0:e.options)||(n==null?void 0:n.options))),re=jU(DA((e==null?void 0:e.options)||(n==null?void 0:n.options)),n);return c.jsxs("article",{className:"group flex flex-col overflow-hidden rounded-[24px] border border-white/[0.08] bg-white/[0.03] transition-all duration-300 hover:-translate-y-0.5 hover:border-white/20",children:[c.jsxs("button",{type:"button",onClick:()=>le&&o(e.id),disabled:!le,className:`relative block aspect-square w-full overflow-hidden bg-black/40 text-left sm:aspect-[4/5] ${le?"cursor-pointer":"cursor-default"}`,"aria-label":le?p("View Post"):void 0,children:[P||_?c.jsx("div",{className:"absolute inset-0",children:c.jsx("div",{className:"ws-skeleton grid h-full w-full place-items-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-3 px-6 text-center",children:[c.jsx("span",{className:"h-9 w-9 animate-spin rounded-full border-2 border-white/15 border-t-[var(--lp-lime)]"}),c.jsx("span",{className:"text-xs font-semibold text-white/70",children:_?p("Waiting in queueâ¦"):Z||p("Generating...")})]})})}):T?c.jsx("div",{className:"absolute inset-0 grid place-items-center bg-gradient-to-b from-red-500/10 to-transparent",children:c.jsxs("div",{className:"px-6 text-center",children:[c.jsx("div",{className:"text-3xl",children:"â ï¸"}),c.jsx("div",{className:"mt-2 text-sm font-semibold text-red-200",children:p("Generation failed")})]})}):ae.video?c.jsxs(c.Fragment,{children:[c.jsx("video",{src:`${ae.video}#t=0.1`,muted:!0,playsInline:!0,loop:!0,preload:"metadata",onMouseEnter:Ae=>{Ae.currentTarget.play().catch(()=>{})},onMouseLeave:Ae=>{Ae.currentTarget.pause()},className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]"}),c.jsx("span",{className:"pointer-events-none absolute bottom-3 right-3 grid h-8 w-8 place-items-center rounded-full bg-black/60 text-white backdrop-blur-md","aria-hidden":!0,children:"â¶"})]}):ae.images.length>0?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:ae.images[0],alt:"",loading:"lazy",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]"}),ae.images.length>1&&c.jsxs("span",{className:"ws-mono absolute bottom-3 right-3 rounded-full bg-black/65 px-2 py-0.5 text-[11px] font-bold text-white backdrop-blur-md",children:["+",ae.images.length-1]})]}):ae.text?c.jsx("div",{className:"absolute inset-0 flex items-center bg-gradient-to-br from-[rgba(207,255,5,.08)] to-transparent p-6",children:c.jsx("p",{className:"line-clamp-[8] text-sm leading-relaxed text-white/80",children:ae.text})}):c.jsx("div",{className:"absolute inset-0 grid place-items-center",children:c.jsx("span",{className:"text-4xl opacity-60",children:"âï¸"})}),c.jsxs("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex items-start justify-between gap-2 bg-gradient-to-b from-black/60 to-transparent p-3",children:[c.jsx("span",{className:`rounded-full px-2.5 py-1 text-[11px] font-bold ring-1 backdrop-blur-md ${ee.cls}`,title:F==null?void 0:F.message,children:ee.label}),c.jsx("span",{className:"ws-mono rounded-full bg-black/45 px-2.5 py-1 text-[11px] text-white/80 backdrop-blur-md",children:J})]})]}),c.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("h3",{className:"min-w-0 truncate text-base font-bold text-white",title:sv(n.name),children:sv(n.name)}),c.jsx("div",{className:"flex shrink-0 -space-x-1.5",children:r.map(Ae=>{const te=["tiktok","x","twitter","threads"].includes((Ae.value||"").toLowerCase())||!Ae.color||/^#(fff|ffffff|000|000000)$/i.test(Ae.color);return c.jsx("span",{title:Ae.label,"aria-label":Ae.label,className:"grid h-6 w-6 place-items-center rounded-full text-[11px] text-white ring-2 ring-[#0b0d12]",style:{background:te?"#000":Ae.color},children:s8[Ae.value]},Ae.value)})})]}),c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[c.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 text-[11px] font-bold ${Y.badgeClass}`,children:[c.jsx(OU,{type:Y.type,className:"h-3.5 w-3.5 shrink-0"}),Y.label]}),re&&c.jsx("span",{className:`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold ${re.badgeClass}`,children:re.label})]}),F&&c.jsx("p",{className:"mt-2 text-xs text-orange-200/90",children:F.reconnect.length?p("Reconnect {platforms}",{platforms:F.reconnect.join(", ")}):F.message}),c.jsxs("div",{className:"mt-auto flex items-center gap-2 pt-4",children:[T?c.jsx("button",{onClick:l,disabled:s,className:"ws-btn ws-btn-primary !h-10 flex-1 !px-4 text-sm",children:s?c.jsx(Hf,{}):c.jsxs(c.Fragment,{children:[c.jsx(vM,{size:12})," ",p("Try again")]})}):O?c.jsxs("button",{onClick:u,className:"ws-btn ws-btn-primary !h-10 flex-1 !px-4 text-sm",children:[c.jsx("span",{className:"ws-shine"}),p("Generate")]}):le?c.jsx("button",{onClick:()=>o(e.id),className:"ws-btn ws-btn-primary !h-10 flex-1 !px-4 text-sm",children:p("View Post")}):c.jsxs("button",{disabled:!0,className:"ws-btn ws-btn-ghost !h-10 flex-1 !px-4 text-sm",children:[c.jsx("span",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-white/20 border-t-white"})," ",p(_?"Queued":"Generating...")]}),L?c.jsx("button",{onClick:d,title:p("Repost to connected social media platforms"),"aria-label":p("Repost"),className:"ws-btn ws-btn-ghost !h-10 !w-10 !px-0",children:c.jsx(bS,{size:14})}):!O&&c.jsx("button",{onClick:u,disabled:i||P||_,title:p("Regenerate post"),"aria-label":p("Regenerate"),className:"ws-btn ws-btn-ghost !h-10 !w-10 !px-0",children:c.jsx(vM,{size:13,className:i?"animate-spin":""})}),le&&!L&&c.jsx("button",{onClick:f,title:p(W?"Change schedule":"Schedule post"),"aria-label":p(W?"Change schedule":"Schedule post"),className:`ws-btn !h-10 !w-10 !px-0 ${W?"bg-sky-4
579200/15 text-sky-200 ring-1 ring-sky-300/30":"ws-btn-ghost"}`,children:c.jsx(sI,{size:13})}),c.jsx(Ks,{to:`/ai-automator?workflowId=${n.id}`,title:p("Edit"),"aria-label":p("Edit"),className:"ws-btn ws-btn-ghost !h-10 !w-10 !px-0",children:c.jsx(gEe,{size:13})}),c.jsx("button",{onClick:h,disabled:a,title:p("Delete"),"aria-label":p("Delete"),className:"ws-btn ws-btn-ghost !h-10 !w-10 !px-0 hover:!text-red-300",children:a?c.jsx(Hf,{}):c.jsx(Ev,{size:13})})]}),t.length>0&&c.jsxs("div",{className:"mt-3 border-t border-white/[0.06] pt-3",children:[c.jsx("button",{onClick:()=>x(Ae=>!Ae),className:"ws-mono text-[11px] uppercase tracking-[0.12em] text-white/50 hover:text-white",children:A?p("Hide earlier versions"):p("{n} earlier versions",{n:t.length})}),A&&c.jsx("ul",{className:"mt-2 space-y-1.5",children:t.map(Ae=>c.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-xl bg-white/[0.03] px-3 py-2 text-xs",children:[c.jsx("span",{className:"text-white/70",children:t1e(Ae.status==="completed"?"completed":Ae.status)}),c.jsx("span",{className:"ws-mono text-white/45",children:new Date(Ae.createdAt).toLocaleDateString(g,{month:"short",day:"numeric"})}),Ae.status!=="failed"&&c.jsx("button",{onClick:()=>o(Ae.id),className:"font-bold text-[var(--lp-lime)] hover:underline",children:p("Open")})]},Ae.id))})]})]})]})}function wct(){var Te,oe;const{data:n}=Ma(),{t:e,locale:t}=Kr(),r=ro(),{data:i,isLoading:s,refetch:a}=Qr(Tae,{userId:n==null?void 0:n.id},{refetchInterval:5e3}),{data:o,isLoading:l,refetch:u}=Qr(hM,{includeUnscheduled:!0},{refetchInterval:5e3}),{data:d,refetch:h}=Qr(_B,{},{refetchInterval:5e3}),{data:f}=Qr(P8),[p,g]=G.useState(null),[A,x]=G.useState(null),[b,_]=G.useState(null),[M,T]=G.useState(null),[L,D]=G.useState(null),[P,O]=G.useState({}),[F,U]=G.useState({}),[B,z]=G.useState("scheduled"),[H,X]=G.useState({isOpen:!1,execution:null,workflow:null,selectedPlatforms:[],isPosting:!1,successMessage:null,errorMessage:null}),W=cl(yae),J=cl(qSe),ee=cl($Se),ae=cl(AS),le=cl(Cm),Z=cl(wae),Y=cl(ZSe),[re,_e]=G.useState({}),Ee=(ge,Ne)=>{if(!Ne)return;let ke=[];try{const Qe=ge==null?void 0:ge.socialMedias,lt=typeof Qe=="string"?JSON.parse(Qe):Qe;Array.isArray(lt)&&(ke=lt.map(tt=>(tt.value||tt.platform||tt).toLowerCase()))}catch{}const Xe=(f||[]).map(Qe=>{let lt=(Qe.provider||"").toLowerCase();return lt==="x.com"||lt==="twitter"?"twitter":lt});let et=Xe.filter(Qe=>ke.some(lt=>{let tt=lt;return tt==="facebook-reels"&&(tt="facebook"),tt==="instagram-reels"&&(tt="instagram"),tt==="youtube-shorts"&&(tt="youtube"),(tt==="x.com"||tt==="x")&&(tt="twitter"),tt===Qe}));et.length===0&&Xe.length>0&&(et=Xe),X({isOpen:!0,execution:Ne,workflow:ge,selectedPlatforms:et,isPosting:!1,successMessage:null,errorMessage:null})},Ae=async()=>{if(!(!H.execution||H.selectedPlatforms.length===0)){X(ge=>({...ge,isPosting:!0,errorMessage:null,successMessage:null}));try{await Z({executionId:H.execution.id,platforms:H.selectedPlatforms}),X(ge=>({...ge,isPosting:!1,successMessage:e("Post successfully republished to selected platform(s)!")})),setTimeout(()=>{X(ge=>({...ge,isOpen:!1,successMessage:null}))},1500)}catch(ge){X(Ne=>({...Ne,isPosting:!1,errorMessage:ge.message||e("Failed to repost to social platforms.")}))}}},te=async(ge,Ne)=>{try{O(ke=>({...ke,[Ne]:!0})),await yv(ge,Ne)}catch(ke){console.error("Failed to retry workflow:",ke)}finally{setTimeout(()=>O(ke=>({...ke,[Ne]:!1})),1e3)}},ve=async ge=>{if(confirm(e("Re-roll weekly strategy across all upcoming days? This will generate brand-new alternating content types, styles, and angles."))){_e(Ne=>({...Ne,[ge.id]:!0}));try{await Y({parentWorkflowId:ge.id}),await Promise.all([u==null?void 0:u().catch(()=>{}),a==null?void 0:a().catch(()=>{}),h==null?void 0:h().catch(()=>{})])}catch(Ne){console.error("Failed to refresh weekly strategy:",Ne),alert(e("Failed to refresh weekly strategy: ")+(Ne.message||e("Something went wrong")))}finally{_e(Ne=>({...Ne,[ge.id]:!1}))}}},we=async(ge,Ne,ke)=>{var tt,Ft,Mt;const Xe=(ke==null?void 0:ke.id)||(Ne==null?void 0:Ne.executionId)||`item-${Ne==null?void 0:Ne.day}`,et=Ne!=null&&Ne.day?`day-${Ne.day}`:null,Qe=ke!=null&&ke.workflowId?`wf-${ke.workflowId}`:null;let lt=null;U(Nt=>({...Nt,[Xe]:!0,...et?{[et]:!0}:{},...Qe?{[Qe]:!0}:{}}));try{let Nt=null;if(ke!=null&&ke.workflowId&&(Nt=i==null?void 0:i.find(fn=>fn.id===ke.workflowId)),!Nt&&(Ne!=null&&Ne.childWorkflowId)&&i&&(Nt=i==null?void 0:i.find(fn=>fn.id===Ne.childWorkflowId)),!Nt&&ge&&(Ne!=null&&Ne.day)&&i){const fn=(ge.name||"").replace("[Auto-Pilot] ","").replace("[Batch] ","").trim(),Tn=(Ne.day||"").trim();Nt=i.find(nt=>{const Kt=(nt.name||"").trim();return Kt.toLowerCase()===`${fn} - ${Tn}`.toLowerCase()||Kt.toLowerCase().startsWith(fn.toLowerCase())&&Kt.toLowerCase().endsWith(Tn.toLowerCase())})}!Nt&&!Ne&&ge&&(Nt=ge);let Je=null;if(Nt){if(Ne!=null&&Ne.config)try{const nt=typeof Nt.options=="string"?JSON.parse(Nt.options||"{}"):Nt.options||{},Kt={...nt,...Ne.config,isAutoPilotChild:!0},Lt=Ne.config.workflowType||Ne.config.type||Nt.type;(Lt!==Nt.type||JSON.stringify(nt)!==JSON.stringify(Kt))&&(await le({id:Nt.id,type:Lt,options:JSON.stringify(Kt)}),Nt.type=Lt,Nt.options=JSON.stringify(Kt))}catch(nt){console.warn("Could not sync item.config to targetWorkflow:",nt)}const fn=ke&&ke.status!=="posted"?ke.id:void 0,Tn=await yv(Nt,fn,!0);Tn&&Tn.id&&(lt=String(Tn.id),U(nt=>({...nt,[lt]:!0})))}else if(ge){const Tn={...typeof ge.options=="string"?JSON.parse(ge.options||"{}"):ge.options||{},...(Ne==null?void 0:Ne.config)||{},isAutoPilotChild:!0};delete Tn.scheduleItems;const nt={type:"weekly",days:[(Ne==null?void 0:Ne.day)||"monday"],times:{[(Ne==null?void 0:Ne.day)||"monday"]:(Ne==null?void 0:Ne.time)||"10:00"},automationType:"one-off",timezoneOffset:new Date().getTimezoneOffset()};Je=await ae({name:`${ge.name.replace("[Auto-Pilot] ","").replace("[Batch] ","")} - ${(Ne==null?void 0:Ne.day)||"Post"}`,type:((tt=Ne==null?void 0:Ne.config)==null?void 0:tt.workflowType)||((Ft=Ne==null?void 0:Ne.config)==null?void 0:Ft.type)||ge.type,socialMedias:ge.socialMedias,schedule:JSON.stringify(nt),options:JSON.stringify(Tn),sources:ge.sources,mediaFiles:ge.mediaFiles,includedUrls:ge.includedUrls,description:((Mt=Ne==null?void 0:Ne.config)==null?void 0:Mt.postDescription)||ge.description||""});const Kt=await yv(Je,void 0,!0);Kt&&Kt.id&&(lt=String(Kt.id),U(Lt=>({...Lt,[lt]:!0})))}if(ge&&Ne&<){const fn=typeof ge.options=="string"?JSON.parse(ge.options||"{}"):ge.options||{},Tn=(Nt==null?void 0:Nt.id)||(Je==null?void 0:Je.id)||(Ne==null?void 0:Ne.childWorkflowId),nt=(fn.scheduleItems||[]).map(Kt=>{var Lt,cn;return((Lt=Kt.day)==null?void 0:Lt.toLowerCase())===((cn=Ne.day)==null?void 0:cn.toLowerCase())||Kt.executionId&&Kt.executionId===(ke==null?void 0:ke.id)?{...Kt,executionId:lt,childWorkflowId:Tn||Kt.childWorkflowId,previousExecutionId:(ke==null?void 0:ke.status)==="posted"?ke.id:Kt.previousExecutionId,lastGeneratedAt:new Date().toISOString()}:Kt});
5792fn.scheduleItems=nt,await le({id:ge.id,options:JSON.stringify(fn)})}await Promise.all([u==null?void 0:u().catch(()=>{}),a==null?void 0:a().catch(()=>{})])}catch(Nt){console.error("Error regenerating post:",Nt),alert(e("Error regenerating post: ")+(Nt.message||e("Something went wrong")))}finally{setTimeout(()=>{U(Nt=>{const Je={...Nt};return delete Je[Xe],et&&delete Je[et],Qe&&delete Je[Qe],lt&&delete Je[lt],Je})},4e3)}},Ue=async(ge,Ne,ke)=>{if(ke.stopPropagation(),!confirm(e("Are you sure you want to delete this scheduled post?")))return;let Xe=typeof ge.options=="string"?JSON.parse(ge.options||"{}"):ge.options||{};const et=(Xe==null?void 0:Xe.scheduleItems)||[],Qe=et[Ne];if(!Qe)return;const lt=Qe.executionId||`item-${Ne}`;_(lt);try{const tt=H2(Qe,ge,o,i);if(tt&&(await W({id:tt.id}),tt.workflowId))try{await ee({workflowId:tt.workflowId}),await J({id:tt.workflowId})}catch{}const Ft=et.filter((Je,fn)=>fn!==Ne);let Mt=typeof ge.schedule=="string"?JSON.parse(ge.schedule||"{}"):ge.schedule||{};const Nt=Ft.map(Je=>{var fn;return(fn=Je.day)==null?void 0:fn.toLowerCase()});Mt!=null&&Mt.days&&(Mt.days=Mt.days.filter(Je=>Nt.includes(Je.toLowerCase()))),Mt!=null&&Mt.times&&Qe.day&&(Nt.includes(Qe.day.toLowerCase())||(delete Mt.times[Qe.day.toLowerCase()],delete Mt.times[Qe.day])),Xe.scheduleItems=Ft,await le({id:ge.id,options:JSON.stringify(Xe),schedule:JSON.stringify(Mt)})}catch(tt){console.error("Failed to delete scheduled post:",tt),alert(e("Error deleting post: ")+(tt.message||e("Something went wrong")))}finally{_(null)}},ze=async(ge,Ne,ke)=>{if(ke.stopPropagation(),!confirm(e("Are you sure you want to delete this generated post?")))return;let Xe=typeof ge.options=="string"?JSON.parse(ge.options||"{}"):ge.options||{};const et=(Xe==null?void 0:Xe.scheduleItems)||[],Qe=et[Ne];if(!Qe)return;const lt=Qe.executionId||`batch-${Ne}`;_(lt);try{const tt=H2(Qe,ge,o,i);if(tt&&(await W({id:tt.id}),tt.workflowId))try{await ee({workflowId:tt.workflowId}),await J({id:tt.workflowId})}catch{}const Ft=et.filter((Mt,Nt)=>Nt!==Ne);Ft.length===0?await J({id:ge.id}):(Xe.scheduleItems=Ft,await le({id:ge.id,options:JSON.stringify(Xe)}))}catch(tt){console.error("Failed to delete batch post:",tt),alert(e("Error deleting post: ")+(tt.message||e("Something went wrong")))}finally{_(null)}},yt=G.useMemo(()=>!i||!o?[]:i.map(ge=>{const Ne={workflow:ge,executions:[]};return o.forEach(ke=>{ke.workflowId===ge.id&&Ne.executions.push(ke)}),Ne}),[i,o]),[mt,bt]=G.useState({}),[dt,St]=G.useState({}),kt=ge=>{const Ne=yt.filter(Xe=>{var Qe;const et=DA((Qe=Xe==null?void 0:Xe.workflow)==null?void 0:Qe.options);return(et==null?void 0:et.isRssSyncPost)&&(et==null?void 0:et.parentWorkflowId)===ge.id}).sort((Xe,et)=>new Date(et.workflow.createdAt).getTime()-new Date(Xe.workflow.createdAt).getTime());if(Ne.length===0)return null;const ke=mt[ge.id]?Ne:Ne.slice(0,6);return c.jsxs("div",{className:"p-6 border-t border-gray-200 dark:border-gray-800",children:[c.jsx("h5",{className:"text-sm font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-4 flex items-center justify-between",children:c.jsxs("span",{children:[e("New articles from your feed")," · ",Ne.length]})}),c.jsx("div",{className:"space-y-2",children:ke.map(({workflow:Xe,executions:et})=>{const Qe=DA(Xe.options),lt=[...et||[]].sort((Je,fn)=>new Date(fn.createdAt).getTime()-new Date(Je.createdAt).getTime())[0],tt=lt&&sb(lt,Xe.type??void 0),Ft=dt[Xe.id]?"generating":lt?lt.status==="posted"?"posted":lt.status==="failed"?"failed":tt?"scheduled":lt.status==="queued"?"queued":"generating":"not generated",Mt=Ft==="posted"?"bg-[#CFFF05]/15 text-[#CFFF05]":Ft==="scheduled"?"bg-emerald-500/15 text-emerald-400":Ft==="failed"?"bg-red-500/15 text-red-400":Ft==="not generated"?"bg-gray-500/15 text-gray-400":"bg-amber-500/15 text-amber-400",Nt=!dt[Xe.id]&&(!lt||lt.status==="failed");return c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-gray-200 dark:border-[#252A36] bg-white dark:bg-[#1A1D24] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-semibold text-gray-900 dark:text-white",children:(Qe==null?void 0:Qe.rssItemTitle)||Xe.name}),c.jsxs("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400",children:[c.jsx("span",{children:new Date(Xe.createdAt).toLocaleDateString(Toe()||void 0,{month:"short",day:"numeric"})}),(Qe==null?void 0:Qe.rssItemLink)&&c.jsxs("a",{href:Qe.rssItemLink,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:[c.jsx(xM,{size:9})," ",e("Article")]})]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx("span",{className:`rounded-full px-2 py-1 text-[10px] font-black uppercase tracking-wider ${Mt}`,children:e(Ft==="not generated"?"Not generated":Ft==="posted"?"Posted":Ft==="scheduled"?"Scheduled":Ft==="failed"?"Failed":Ft==="queued"?"Queued":"Generating")}),Nt&&c.jsx("button",{onClick:async()=>{St(Je=>({...Je,[Xe.id]:!0}));try{await yv({id:Xe.id},lt==null?void 0:lt.id,!0),u(),a()}catch(Je){alert(e("Error: ")+(Je.message||e("Something went wrong")))}finally{St(Je=>({...Je,[Xe.id]:!1}))}},className:"rounded-lg bg-emerald-500/10 px-3 py-1.5 text-xs font-bold text-emerald-700 hover:bg-emerald-500/20 dark:text-[#CFFF05]",children:e(lt?"Retry":"Generate")})]})]},Xe.id)})}),Ne.length>6&&c.jsx("button",{onClick:()=>bt(Xe=>
5792({...Xe,[ge.id]:!Xe[ge.id]})),className:"mt-3 text-xs font-bold text-emerald-700 hover:underline dark:text-[#CFFF05]",children:mt[ge.id]?e("Show fewer"):e("Show all {count}",{count:Ne.length})})]})},Fe=yt.filter(ge=>{var Xe,et;const Ne=((Xe=ge==null?void 0:ge.workflow)==null?void 0:Xe.name)||"";let ke=DA((et=ge==null?void 0:ge.workflow)==null?void 0:et.options);return!Ne.startsWith("[Auto-Pilot]")&&!Ne.startsWith("[Batch]")&&!(ke!=null&&ke.isAutoPilotChild)}),Ze=yt.filter(ge=>{var Ne;return(((Ne=ge==null?void 0:ge.workflow)==null?void 0:Ne.name)||"").startsWith("[Auto-Pilot]")}),Ye=yt.filter(ge=>{var Ne;return(((Ne=ge==null?void 0:ge.workflow)==null?void 0:Ne.name)||"").startsWith("[Batch]")}),ft=G.useMemo(()=>{const ge={},Ne=[];Fe.forEach(Xe=>{let et=DA(Xe.workflow.options);const Qe=DA(Xe.workflow.schedule),lt=(Qe==null?void 0:Qe.automationType)==="auto-pilot"||Xe.workflow.name.startsWith("[Auto-Pilot]"),tt=(et==null?void 0:et.isStrategyGroup)||lt,Ft=(et==null?void 0:et.strategySessionId)||(tt?lt?"auto-pilot-group-"+Xe.workflow.createdAt:"strategy-group-"+Xe.workflow.name:null);Ft?(ge[Ft]?lt&&!ge[Ft].isAutoPilot&&(ge[Ft].name=e("Generated Strategy (Auto-Pilot)"),ge[Ft].isAutoPilot=!0):ge[Ft]={name:e(lt?"Generated Strategy (Auto-Pilot)":"Generated Strategy"),workflows:[],isAutoPilot:lt},ge[Ft].workflows.push(Xe)):Ne.push(Xe)});const ke=[];return Object.values(ge).forEach(Xe=>{Xe.workflows.length>=1&&ke.push({type:"group",...Xe,date:new Date(Xe.workflows[0].workflow.createdAt).getTime()})}),Ne.forEach(Xe=>{ke.push({type:"single",workflowWithExecutions:Xe,date:new Date(Xe.workflow.createdAt).getTime()})}),ke.sort((Xe,et)=>et.date-Xe.date)},[Fe]),At=G.useMemo(()=>o?o.filter(ge=>ge.status==="posted").map(ge=>{var Qe,lt;let Ne={};try{Ne=typeof ge.result=="string"?JSON.parse(ge.result):ge.result||{}}catch{}const ke=i==null?void 0:i.find(tt=>tt.id===ge.workflowId),Xe=d==null?void 0:d.find(tt=>tt.workflowId===ge.workflowId);let et=(Ne==null?void 0:Ne.postUrl)||(Ne==null?void 0:Ne.liveUrl)||(Ne==null?void 0:Ne.url)||(Xe==null?void 0:Xe.postUrl);if(!et&&(Xe!=null&&Xe.socialMedia))try{const tt=typeof Xe.socialMedia=="string"?JSON.parse(Xe.socialMedia):Xe.socialMedia;Array.isArray(tt)&&(et=((Qe=tt.find(Ft=>Ft.postUrl||Ft.liveUrl||Ft.url))==null?void 0:Qe.postUrl)||((lt=tt.find(Ft=>Ft.postUrl||Ft.liveUrl||Ft.url))==null?void 0:lt.liveUrl))}catch{}return{execution:ge,workflow:ke,result:Ne,livePostUrl:et,date:new Date(ge.updatedAt||ge.createdAt).getTime()}}).sort((ge,Ne)=>Ne.date-ge.date):[],[o,i,d]),Ce=async ge=>{if(confirm(e("Are you sure you want to delete this workflow?"))){g(ge.id);try{await ee({workflowId:ge.id}),await J({id:ge.id}),window.location.reload()}catch(Ne){window.alert(e("Error: ")+(Ne.message||e("Something went wrong")))}finally{g(null)}}},Se=({workflow:ge,executions:Ne})=>{const ke=[...Ne||[]].sort((et,Qe)=>new Date(Qe.createdAt).getTime()-new Date(et.createdAt).getTime()),Xe=ke[0]||null;return c.jsx(bct,{workflow:ge,execution:Xe,older:ke.slice(1),socialMedias:GS(ge.socialMedias,f),regenerating:!!F["wf-"+ge.id]||!!Xe&&!!F[Xe.id],retrying:!!Xe&&!!P[Xe.id],deleting:p===ge.id,onView:et=>r(`/executions?id=${et}`),onRetry:()=>Xe&&te(ge,Xe.id),onRegenerate:()=>we(ge,null,Xe||{workflowId:ge.id}),onRepost:()=>Xe&&Ee(ge,Xe),onDelete:()=>Ce(ge),onSchedule:()=>T(ge)},ge.id)},qe=async(ge,Ne)=>{if(Ne.stopPropagation(),confirm(e("Are you sure you want to stop this Auto-Pilot? It will no longer generate weekly posts automatically.")))try{await J({id:ge}),window.location.reload()}catch(ke){alert(e("Error stopping Auto-Pilot: ")+(ke.message||e("Something went wrong")))}},pt=async(ge,Ne)=>{if(Ne.stopPropagation(),confirm(e("Are you sure you want to delete this execution? This action cannot be undone."))){_(ge);try{await W({id:ge}),window.location.reload()}catch(ke){alert(e("Error deleting execution: ")+(ke.message||e("Something went wrong")))}finally{_(null)}}};return c.jsxs(pl,{children:[c.jsxs(j1,{children:[c.jsx(D_,{tag:e("Autopilot"),eyebrow:e(B==="scheduled"?"Scheduled posts":"Posted history"),title:e(B==="scheduled"?"Your schedule,":"Everything you"),accent:e(B==="scheduled"?"on autopilot.":"published."),subtitle:e(B==="scheduled"?"Active Auto-Pilots, batch generations and every upcoming post in one place.":"Every post published to your connected channels, with its media."),actions:c.jsxs(Ks,{to:"/ai-automator",className:"ws-btn ws-btn-primary !h-11 !px-5 text-sm",children:[c.jsx("span",{className:"ws-shine"}),"+ ",e("New workflow")]})}
5792),c.jsxs("div",{className:"ws-enter relative mb-8 mt-8 grid max-w-md grid-cols-2 rounded-full border border-white/[0.08] bg-white/[0.03] p-1",style:{animationDelay:".08s"},children:[c.jsx("span",{"aria-hidden":!0,className:`absolute inset-y-1 w-[calc(50%-4px)] rounded-full bg-[var(--lp-lime)] shadow-[0_10px_30px_-10px_rgba(207,255,5,.8)] transition-transform duration-500 ease-[cubic-bezier(.22,1,.36,1)] ${B==="history"?"translate-x-full":"translate-x-0"}`,style:{left:4}}),[["scheduled",e("Schedules"),Ze.length+ft.length+Ye.length],["history",e("Posted"),At.length]].map(([ge,Ne,ke])=>c.jsxs("button",{onClick:()=>z(ge),className:`relative z-10 flex items-center justify-center gap-2 rounded-full py-2.5 text-sm font-bold transition-colors duration-300 ${B===ge?"text-black":"text-white/60 hover:text-white"}`,children:[Ne,c.jsx("span",{className:`ws-mono rounded-full px-2 py-0.5 text-[11px] ${B===ge?"bg-black/15":"bg-white/[0.08] text-white/60"}`,children:ke})]},ge))]}),s||l?c.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((ge,Ne)=>c.jsx("div",{className:"ws-skeleton h-28 rounded-[24px]",style:{animationDelay:`${Ne*.08}s`}},Ne))}):B==="history"?At.length===0?c.jsx(q5,{icon:"ð",title:e("Nothing published yet"),body:e("Once your scheduled or Auto-Pilot posts go live, their history and media previews show up here.")}):c.jsx("div",{className:"space-y-6 max-w-5xl mx-auto",children:c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:At.map(({execution:ge,workflow:Ne,result:ke,livePostUrl:Xe,date:et})=>{var Mt;const Qe=((Mt=ke==null?void 0:ke.videoUrls)==null?void 0:Mt[0])||(ke==null?void 0:ke.videoUrl)||(ke==null?void 0:ke.finalVideoUrl),lt=(ke==null?void 0:ke.imageUrls)||[],tt=(ke==null?void 0:ke.text)||(ke==null?void 0:ke.content)||(Ne==null?void 0:Ne.description)||"",Ft=GS(Ne==null?void 0:Ne.socialMedias,f);return c.jsxs("div",{className:"bg-white dark:bg-[#1A1D24] rounded-3xl border border-gray-200 dark:border-[#252A36] overflow-hidden flex flex-col shadow-lg shadow-black/5 hover:border-emerald-500/40 transition-all",children:[Qe?c.jsxs("div",{className:"relative w-full aspect-[9/16] max-h-80 bg-black overflow-hidden flex items-center justify-center",children:[c.jsx("video",{src:Qe,controls:!0,playsInline:!0,className:"w-full h-full object-contain"}),Xe&&c.jsxs("a",{href:Xe,target:"_blank",rel:"noopener noreferrer",className:"absolute top-2 right-2 z-10 px-2 py-1 rounded-full bg-black/70 hover:bg-black/90 text-white text-[10px] font-bold flex items-center gap-1 backdrop-blur-md transition-all",title:e("Open live post"),children:[c.jsx("span",{children:e("Live")}),c.jsx("svg",{className:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]}):lt.length>0?c.jsxs("div",{className:"relative w-full aspect-video bg-black/10 overflow-hidden",children:[Xe?c.jsxs("a",{href:Xe,target:"_blank",rel:"noopener noreferrer",className:"block w-full h-full relative group cursor-pointer",children:[c.jsx("img",{src:lt[0],alt:"Post media",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}),c.jsxs("span",{className:"absolute top-2 right-2 bg-black/70 group-hover:bg-emerald-600 text-white text-[10px] font-bold px-2 py-0.5 rounded-full flex items-center gap-1 backdrop-blur-md transition-colors",children:[c.jsx("span",{children:e("Live Post")}),c.jsx("svg",{className:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]}):c.jsx("img",{src:lt[0],alt:"Post media",className:"w-full h-full object-cover"}),lt.length>1&&c.jsxs("span",{className:"absolute bottom-2 right-2 bg-black/70 text-white text-[10px] font-bold px-2 py-0.5 rounded-full",children:["+",e("{n} more",{n:lt.length-1})]})]}):Xe?c.jsxs("a",{href:Xe,target:"_blank",rel:"noopener noreferrer",className:"w-full h-24 bg-gradient-to-r from-emerald-500/10 to-transparent flex items-center justify-center border-b border-gray-100 dark:border-[#252A36] group hover:bg-emerald-500/15 transition-colors",children:[c.jsx("span",{className:"text-3xl group-hover:scale-110 transition-transform",children:"âï¸"}),c.jsxs("span",{className:"ml-2 text-xs font-bold text-emerald-600 dark:text-[#CFFF05] flex items-center gap-1",children:[c.jsx("span",{children:e("Open Post")}),c.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]}):c.jsx("div",{className:"w-full h-24 bg-gradient-to-r from-emerald-500/10 to-transparent flex items-center justify-center border-b border-gray-100 dark:border-[#252A36]",children:c.jsx("span",{className:"text-3xl",children:"âï¸"})}),c.jsxs("div",{className:"p-5 flex-1 flex flex-col justify-between",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between items-start mb-3 gap-2",children:[c.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:Ft.map(Nt=>V6(Nt,"text-[10px] font-bold"))}),c.jsx("span",{className:"text-[10px] font-black uppercase tracking-wider px-2 py-0.5 rounded-full bg-emerald-500 text-white",children:e("Posted")})]}),c.jsx("h4",{className:"font-bold text-gray-900 dark:text-white text-sm line-clamp-1 mb-1",children:sv((Ne==null?void 0:Ne.name)||e("Published Post"))}),c.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mb-3",children:new Date(et).toLocaleStr
5792ing(t,{weekday:"short",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),tt&&c.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-300 line-clamp-3 mb-4 bg-gray-50 dark:bg-[#0F121A] p-2.5 rounded-xl border border-gray-100 dark:border-[#252A36] italic",children:['"',tt,'"']})]}),c.jsxs("div",{className:"flex items-center gap-2 pt-3 border-t border-gray-100 dark:border-[#252A36]",children:[c.jsxs("button",{onClick:()=>Ee(Ne,ge),className:"flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-xl text-xs font-bold bg-blue-500/10 text-blue-600 hover:bg-blue-500/20 dark:bg-blue-500/15 dark:text-blue-400 dark:hover:bg-blue-500/25 border border-blue-500/20 dark:border-blue-500/30 transition-all",children:[c.jsx(bS,{size:12}),c.jsx("span",{children:e("Repost")})]}),c.jsx(Ks,{to:`/executions?id=${ge.id}`,className:"py-2 px-3 rounded-xl text-xs font-bold bg-gray-100 hover:bg-gray-200 dark:bg-[#252A36] dark:hover:bg-[#2A303C] text-gray-700 dark:text-gray-300 transition-colors",children:e("Details")}),c.jsx("button",{onClick:Nt=>pt(ge.id,Nt),disabled:b===ge.id,className:"p-2 rounded-xl text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors",title:e("Delete post record"),children:b===ge.id?c.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-red-500 border-t-transparent"}):c.jsx(Ev,{size:12})})]})]})]},ge.id)})})}):Ze.length===0&&Ye.length===0&&ft.length===0?c.jsx(q5,{icon:"â¨",title:e("Your schedule is empty"),body:e("Paste a link and the autopilot plans, creates and schedules a week of videos and carousels for you."),action:c.jsxs(Ks,{to:"/ai-automator",className:"ws-btn ws-btn-primary",children:[c.jsx("span",{className:"ws-shine"}),e("Plan my first week")," â"]})}):c.jsxs("div",{className:"space-y-6 max-w-5xl mx-auto",children:[Ze.length>0&&c.jsxs("div",{className:"mb-10",children:[c.jsxs("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[c.jsx("span",{className:"text-emerald-500",children:"ð¤"})," ",e("Active Auto-Pilots")]}),c.jsx("div",{className:"space-y-4",children:Ze.map(({workflow:ge})=>{let Ne={};try{Ne=typeof ge.options=="string"?JSON.parse(ge.options):ge.options||{}}catch{}const ke=(Ne==null?void 0:Ne.scheduleItems)||[],Xe=GS(ge.socialMedias,f);return c.jsxs("div",{className:"bg-white dark:bg-[#1A1D24] rounded-2xl shadow-lg border border-emerald-500/30 overflow-hidden mb-6",children:[c.jsxs("div",{className:"p-5 flex justify-between items-center bg-gradient-to-r from-emerald-500/5 to-transparent",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-lg font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[sv(ge.name),c.jsx("span",{className:"px-2 py-0.5 bg-emerald-500 text-[#0F121A] text-[10px] font-black uppercase tracking-wider rounded-full",children:e("Auto")})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 mb-2",children:[Xe.map(et=>V6(et,"text-xs font-medium")),c.jsxs("button",{type:"button",onClick:et=>{et.stopPropagation(),D(ge)},className:"inline-flex items-center gap-1 rounded-full border border-dashed border-gray-400/60 px-2.5 py-1 text-xs font-bold text-gray-600 transition-colors hover:border-emerald-500 hover:text-emerald-600 dark:border-white/25 dark:text-white/70 dark:hover:border-[#CFFF05] dark:hover:text-[#CFFF05]",title:e("Add or remove the accounts this campaign publishes to"),children:[c.jsx(qX,{size:9})," ",e("Channels")]})]}),c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:e("Generating and scheduling posts weekly automatically.")})]}),c.jsx("div",{children:c.jsx("button",{onClick:et=>qe(ge.id,et),className:"px-4 py-2 bg-red-500/10 text-red-500 hover:bg-red-500/20 font-bold rounded-lg text-sm transition-colors",children:e("Stop Auto-Pilot")})})]}),c.jsxs("div",{className:"p-6 bg-gray-50/50 dark:bg-[#0F121A]/50 border-t border-emerald-500/10",children:[c.jsxs("div",{className:"flex justify-between items-center mb-4 flex-wrap gap-2",children:[c.jsxs("h5",{className:"text-sm font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider flex items-center gap-2",children:[c.jsx("span",{children:e("Weekly Schedule")}),ke.length===0?null:ke.every(Qe=>{var Mt;const lt=H2(Qe,ge,o,i);(Mt=Qe.config)!=null&&Mt.workflowType||ge.type;const tt=(lt==null?void 0:lt.id)||Qe.executionId||`item-${Qe.day}`;return!(!!F[tt]||(lt!=null&<.id?!!F[lt.id]:!1)||(Qe.executionId?!!F[Qe.executionId]:!1)||(Qe.day?!!F["day-"+Qe.day]:!1)||(lt!=null&<.workflowId?!!F["wf-"+lt.workflowId]:!1))&<&&(lt.status==="posted"||sb(lt))})?c.jsxs("span",{className:"text-[10px] bg-blue-500/20 text-blue-600 dar
5792k:text-blue-400 px-2 py-1 rounded-full flex items-center gap-1.5 font-black uppercase tracking-wider",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-500"}),e("All Scheduled")]}):c.jsxs("span",{className:"text-[10px] bg-emerald-500/20 text-emerald-600 dark:text-emerald-400 px-2 py-1 rounded-full flex items-center gap-1.5 font-black uppercase tracking-wider",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),e("Generating in background")]})]}),c.jsx("button",{onClick:()=>ve(ge),disabled:!!re[ge.id],className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-bold bg-emerald-500/10 text-emerald-700 dark:text-[#CFFF05] hover:bg-emerald-500/20 border border-emerald-500/20 transition-all disabled:opacity-50 disabled:cursor-not-allowed",title:e("Re-roll weekly strategy across all days with fresh alternating content types and styles"),children:re[ge.id]?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-3 h-3 border-2 border-emerald-500 dark:border-[#CFFF05] border-t-transparent rounded-full animate-spin"}),c.jsx("span",{children:e("Re-rolling Weekly Plan...")})]}):c.jsxs(c.Fragment,{children:[c.jsx(GX,{size:13}),c.jsx("span",{children:e("Re-roll Weekly Strategy")})]})})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ke.map((et,Qe)=>{var qt,Fn;const lt=((qt=et.config)==null?void 0:qt.workflowType)||ge.type,tt=H2(et,ge,o,i),Ft=(tt==null?void 0:tt.id)||et.executionId||`item-${et.day||Qe}`,Mt=!!F[Ft]||(tt!=null&&tt.id?!!F[tt.id]:!1)||(et.executionId?!!F[et.executionId]:!1)||(et.day?!!F["day-"+et.day]:!1)||(tt!=null&&tt.workflowId?!!F["wf-"+tt.workflowId]:!1),Nt=!Mt&&((tt==null?void 0:tt.status)==="queued"||(tt==null?void 0:tt.status)==="pending"),Je=!Mt&&sb(tt),fn=!Je&&!Nt&&LU(tt,lt,et.config),Tn=!Mt&&((tt==null?void 0:tt.status)==="failed"||!!fn),nt=!Mt&&(tt==null?void 0:tt.status)==="posted",Kt=!Mt&&Je&&!nt&&!Tn,Lt=Mt||!Je&&!Tn&&!nt&&!Nt,cn=Act(et.day,et.time),dn=nt||cn;let Bt="Generating",Ht="bg-amber-500/20 text-amber-600 dark:text-amber-400 animate-pulse";return Tn?(Bt="Failed",Ht="bg-red-500/20 text-red-600 dark:text-red-400"):nt?(Bt=e("Next Week ⢠Rescheduled"),Ht="bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30"):Kt?(Bt=e(dn?"Next Week ⢠Scheduled":"This week ⢠Scheduled"),Ht="bg-blue-500/20 text-blue-600 dark:text-blue-400 border border-blue-500/30"):Nt?(Bt=e("Queued in batch"),Ht="bg-amber-500/15 text-amber-600 dark:text-amber-400 border border-amber-500/30"):(Mt||Lt)&&(Bt=dn?e("Generating Next Week"):"Generating",Ht="bg-amber-500/20 text-amber-600 dark:text-amber-400 animate-pulse"),c.jsx("div",{className:"bg-white dark:bg-[#1A1D24] rounded-2xl border border-gray-200 dark:border-[#3A4150] overflow-hidden flex flex-col hover:border-emerald-500/50 transition-colors",children:c.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[c.jsxs("div",{className:"flex justify-between items-start mb-3",children:[c.jsx("div",{className:`px-2.5 py-1 rounded-md text-[10px] font-black uppercase tracking-wider ${Ht}`,children:Ute(Bt,tt)}),c.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 font-medium flex flex-col items-end text-right",children:[c.jsx("span",{className:"capitalize block font-semibold text-gray-800 dark:text-gray-200",children:dn?`${e("Next:")} ${L4(et.day)} ⢠${et.time}`:`${L4(et.day)} ⢠${et.time}`}),nt?c.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-bold text-emerald-600 dark:text-emerald-400 mt-0.5",children:[c.jsx(kB,{className:"w-2.5 h-2.5"}),c.jsx("span",{children:e("Posted this week")})]}):et.previousExecutionId?c.jsx("button",{onClick:xe=>{xe.stopPropagation(),r(`/executions?id=${et.previousExecutionId}`)},className:"text-[10px] text-gray-400 hover:text-emerald-600 dark:hover:text-emerald-400 underline mt-0.5",children:e("View previous post â")}):null]})]}),c.jsxs("h6",{className:"font-bold text-gray-900 dark:text-white text-base mb-1 truncate capitalize",children:[((Fn=et.config)==null?void 0:Fn.workflowType)||"Post"," ",Qe+1]}),c.jsx("div",{className:"flex items-center gap-1.5 mb-4 mt-1 flex-wrap",children:(()=>{const xe=DU(lt,et.config),Oe=jU(et.config||et,(tt==null?void 0:tt.workflow)||ge);return c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-bold ${xe.badgeClass}`,children:[c.jsx(OU,{type:xe.type,className:"w-3.5 h-3.5 shrink-0"}),c.jsx("span",{children:xe.label})]}),Oe&&c.jsx("span",{className:`inline-flex items-center px-2.5 py-1 rounded-md text-xs font-bold ${Oe.badgeClass}`,children:c.jsx("span",{children:Oe.label})})]})})()}),(()=>{let xe="";if(tt!=null&&tt.result&&typeof tt.result=="string")if(tt.result.startsWith("{"))try{const Oe=JSON.parse(tt.result);Oe!=null&&Oe.step&&(xe=Oe.step)}catch{}else xe=tt.result;return(Lt||Nt)&&xe?c.jsxs("p",{className:"text-xs text-amber-600 dar
5792k:text-amber-400 font-medium mb-3 truncate flex items-center gap-1.5",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 animate-ping shrink-0"}),c.jsx("span",{className:"truncate",children:xe})]}):null})(),c.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-2 border-t border-gray-100 dark:border-[#252A36",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[Tn?c.jsx("button",{onClick:()=>tt&&te(void 0,tt.id),disabled:!tt||P[tt.id]||Mt,className:`flex-1 flex justify-center items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-semibold transition-colors bg-red-50 text-red-600 hover:bg-red-100 dark:bg-red-500/10 dark:text-red-400 dark:hover:bg-red-500/20 ${(!tt||P[tt.id]||Mt)&&"opacity-50 cursor-not-allowed"}`,children:tt&&P[tt.id]?"Retrying...":e("Try again")}):c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>{tt&&r(`/executions?id=${tt.id}`)},disabled:Mt||Lt&&!tt,className:`flex-1 flex justify-center items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-bold transition-colors ${Mt||Lt&&!tt?"bg-amber-500/10 text-amber-600 dark:text-amber-400 cursor-wait":Kt||nt?"bg-blue-50 text-blue-600 hover:bg-blue-100 dark:bg-blue-500/10 dark:text-blue-400 dark:hover:bg-blue-500/20":Nt?"bg-amber-500/10 text-amber-600 dark:text-amber-400":"bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-[#252A36] dark:text-gray-300 dark:hover:bg-[#3A4150]"} ${!tt&&!Lt&&!Mt&&!Nt?"opacity-70":""}`,children:Mt||Lt&&!tt?dn?e("Generating Next Week..."):"Generating...":e(Nt?"Queued in Batch":"View Post")}),c.jsx("button",{onClick:()=>we(ge,et,tt),disabled:Mt,className:"flex items-center justify-center gap-1.5 px-3 py-2 rounded-xl text-xs font-bold bg-[#CFFF05]/10 text-emerald-700 hover:bg-[#CFFF05]/20 dark:bg-[#CFFF05]/15 dark:text-[#CFFF05] dark:hover:bg-[#CFFF05]/25 border border-emerald-500/20 dark:border-[#CFFF05]/30 transition-all disabled:opacity-50 disabled:cursor-not-allowed",title:e(dn?"Regenerate next week's post with fresh AI content":"Regenerate post with fresh AI content"),children:Mt?c.jsx("div",{className:"w-3.5 h-3.5 border-2 border-emerald-500 dark:border-[#CFFF05] border-t-transparent rounded-full animate-spin"}):c.jsxs(c.Fragment,{children:[c.jsx(vM,{size:11}),c.jsx("span",{children:e("Regenerate")})]})})]}),c.jsx("button",{onClick:xe=>Ue(ge,Qe,xe),disabled:b===(et.executionId||`item-${Qe}`),className:"p-2 rounded-xl text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors border border-transparent hover:border-red-100 dark:hover:border-red-500/20 disabled:opacity-50 disabled:cursor-not-allowed",title:e("Delete scheduled post"),children:b===(et.executionId||`item-${Qe}`)?c.jsx("div",{className:"w-4 h-4 animate-spin rounded-full border-2 border-red-500 border-t-transparent"}):c.jsx(Ev,{size:14})})]}),(()=>{const xe=et.previousExecutionId?o==null?void 0:o.find($e=>$e.id===et.previousExecutionId):null,Oe=nt||!!et.previousPublishedAt||(xe==null?void 0:xe.status)==="posted",Ge=et.previousExecutionId||(nt?tt==null?void 0:tt.id:null);return Ge?c.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-500 dark:text-gray-400 px-1 pt-1",children:[c.jsxs("span",{className:"flex items-center gap-1.5 font-medium",children:[c.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${Oe?"bg-emerald-500":"bg-blue-500"}`}),c.jsx("span",{className:"truncate",children:Oe?"Last post published":"Previous post"})]}),c.jsxs("button",{onClick:()=>r(`/executions?id=${Ge}`),className:"font-bold text-emerald-600 dark:text-[#CFFF05] hover:underline flex items-center gap-1 shrink-0",title:e(Oe?"View the published post in executions":"View the previous post in executions"),children:[c.jsx("span",{children:e("View Post")}),c.jsx(xM,{size:8})]})]}):null})()]})]})},Qe)})})]})]},ge.id)})})]}),Ye.length>0&&c.jsxs("div",{className:"mb-10",children:[c.jsxs("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[c.jsx("span",{className:"text-blue-500",children:"ð¦"})," ",e("Batch Generations")]}),c.jsx("div",{className:"space-y-4",children:Ye.map(({workflow:ge})=>{let Ne={};try{Ne=typeof ge.options=="string"?JSON.parse(ge.options):ge.options||{}}catch{}const ke=(Ne==null?void 0:Ne.scheduleItems)||[],Xe=GS(ge.socialMedias);return c.jsxs("div",{className:"bg-white dark:bg-[#1A1D24] rounded-2xl shadow-lg border border-gray-200 dark:border-gray-800 overflow-hidden mb-6",children:[c.jsxs("div",{className:"p-5 flex justify-between items-center bg-gray-50 dark:bg-gray-800/30",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-lg font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[sv(ge.name),c.jsx("span",{className:"px-2 py-0.5 bg-blue-500 text-white text-[10px] font-black uppercase tracking-wider rounded-full",children:Ne!=null&&Ne.rssFeedUrl?"RSS Auto-Pilot":"Batch"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 mb-2",children:[Xe.map(et=>V6(et,"text-xs font-medium")),c.jsxs("button",{type:"button",onClick:et=>{et.stopPropagation(),D(ge)},className:"inline-flex items-center gap-1 rounded-full border border-dashed border-gray-400/60 px-2.5 py-1 text-xs font-bold text-gray-600 transition-colors hover:border-emerald-500 hover:text-emerald-600 dark:border-white/25 dark:text-white/70 dark:hover:border-[#CFFF05] dark:hover:text-[#CFFF05]",title:e("Add or remove the accounts this campaign publishes to"),children:[c.jsx(qX,{size:9})," ",e("Channels")]})]}),c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:Ne!=null&&Ne.rssFeedUrl?e("Posts built from your blog feed; new articles are picked up automatically."):e("A single batch of generated posts.")})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[ke.length>0&&c.jsx("button",{onClick:et=>{et.stopPropagation(),ve(ge)},disabled:!!re[ge.id],className:"flex items-center gap-1.5 px-3 py-2 rounded-lg text-sm font-bold bg-emerald-500/10 text-emerald-700 dark:text-[#CFFF05] hover:bg-emerald-500/20 border border-emerald-500/20 transition-all disabled:opacity-50 disabled:cursor-not-allowed",title:e("Re-roll weekly strategy across all days with fresh content types, styles and articles"),children:re[ge.id]?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-3 h-3 border-2 border-emerald-500 dark:border-[#CFFF05] border-t-transparent roun
5792ded-full animate-spin"}),c.jsx("span",{children:e("Re-rolling Weekly Plan...")})]}):c.jsxs(c.Fragment,{children:[c.jsx(GX,{size:13}),c.jsx("span",{children:e("Re-roll Weekly Strategy")})]})}),c.jsx("button",{onClick:async et=>{if(et.stopPropagation(),confirm(e("Are you sure you want to delete this batch?")))try{await ee({workflowId:ge.id}),await J({id:ge.id}),window.location.reload()}catch(Qe){alert(e("Error: ")+(Qe.message||e("Something went wrong")))}},className:"px-4 py-2 bg-red-500/10 text-red-500 hover:bg-red-500/20 font-bold rounded-lg text-sm transition-colors",children:e("Delete Batch")})]})]}),ke.length>0&&c.jsxs("div",{className:"p-6 bg-gray-50/50 dark:bg-[#0F121A]/50 border-t border-gray-200 dark:border-gray-800",children:[c.jsxs("h5",{className:"text-sm font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-4 flex justify-between items-center",children:[c.jsx("span",{children:e("Generated Posts")}),ke.length>0&&ke.every(Qe=>{var Mt;const lt=H2(Qe,ge,o,i);(Mt=Qe.config)!=null&&Mt.workflowType||ge.type;const tt=(lt==null?void 0:lt.id)||Qe.executionId||`batch-${Qe.day}`;return!(!!F[tt]||(lt!=null&<.id?!!F[lt.id]:!1)||(Qe.executionId?!!F[Qe.executionId]:!1)||(Qe.day?!!F["day-"+Qe.day]:!1)||(lt!=null&<.workflowId?!!F["wf-"+lt.workflowId]:!1))&<&&sb(lt)})?c.jsxs("span",{className:"text-[10px] bg-blue-500/20 text-blue-600 dark:text-blue-400 px-2 py-1 rounded-full flex items-center gap-1.5 font-black uppercase tracking-wider",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-500"}),e("All Scheduled")]}):c.jsxs("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-2 py-1 rounded-full flex items-center gap-1.5 font-black uppercase tracking-wider",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 animate-pulse"}),e("Generating in background")]})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ke.map((et,Qe)=>{var dn,Bt;const lt=((dn=et.config)==null?void 0:dn.workflowType)||ge.type,tt=H2(et,ge,o,i),Ft=(tt==null?void 0:tt.id)||et.executionId||`batch-${et.day||Qe}`,Mt=!!F[Ft]||(tt!=null&&tt.id?!!F[tt.id]:!1)||(et.executionId?!!F[et.executionId]:!1)||(et.day?!!F["day-"+et.day]:!1)||(tt!=null&&tt.workflowId?!!F["wf-"+tt.workflowId]:!1),Nt=!Mt&&((tt==null?void 0:tt.status)==="queued"||(tt==null?void 0:tt.status)==="pending"),Je=!Mt&&sb(tt),fn=!Je&&!Nt&&LU(tt,lt,et.config),Tn=!Mt&&((tt==null?void 0:tt.status)==="failed"||!!fn),nt=!Mt&&(tt==null?void 0:tt.status)==="posted",Kt=!Mt&&Je&&!nt&&!Tn,Lt=Mt||!Je&&!Tn&&!nt&&!Nt,cn=Mt?"generating":tt?nt?"posted":Tn?"failed":Kt?"scheduled":Nt?"queued":"generating":"generating";return c.jsxs("div",{className:"bg-white dark:bg-[#1A1D24] rounded-xl p-4 border border-gray-200 dark:border-[#252A36] shadow-sm flex flex-col",children:[c.jsxs("div",{className:"flex justify-between items-start mb-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-[#252A36] text-gray-700 dark:text-gray-300 rounded text-xs font-bold uppercase",children:L4(et.day)}),c.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-xs font-medium flex items-center gap-1",children:[c.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),et.time]})]}),c.jsx("span",{className:`text-[10px] font-black uppercase tracking-wider px-2 py-1 rounded-full ${nt?"bg-emerald-500 text-white":Kt?"bg-blue-500/20 text-blue-500":Tn?"bg-red-500/20 text-red-500":Nt?"bg-amber-500/15 text-amber-600 dark:text-amber-400 border border-amber-500/30":"bg-amber-500/20 text-amber-500 animate-pulse"}`,children:Ute(cn,tt)})]}),c.jsx("div",{className:"flex items-center gap-1.5 mb-2 mt-0.5 flex-wrap",children:(()=>{const Ht=DU(lt,et.config),qt=jU(et.config||et,(tt==null?void 0:tt.workflow)||ge);return c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-md text-xs font-bold ${Ht.badgeClass}`,children:[c.jsx(OU,{type:Ht.type,className:"w-3.5 h-3.5 shrink-0"}),c.jsx("span",{children:Ht.label})]}),qt&&c.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-bold ${qt.badgeClass}`,children:c.jsx("span",{children:qt.label})})]})})()}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 flex-1 mb-4 line-clamp-2",children:((Bt=et.config)==null?void 0:Bt.postDescription)||e("Generating strategy...")}),c.jsxs("div",{className:"mt-auto flex items-center gap-2 pt-2 border-t border-gray-100 dark:border-[#252A36]",children:[tt&&c.jsx(Ks,{to:`/executions?id=${tt.id}`,className:`flex-1 text-center py-2 rounded-lg text-xs font-bold transition-colors ${Lt||Mt?"bg-amber-500/10 text-amber-600 dar
5792k:text-amber-400 cursor-wait":Kt?"bg-blue-50 text-blue-600 hover:bg-blue-100 dark:bg-blue-500/10 dark:text-blue-400 dark:hover:bg-blue-500/20":"bg-gray-100 hover:bg-gray-200 dark:bg-[#252A36] dark:hover:bg-[#2A303C] text-gray-900 dark:text-white"} ${(Lt||Mt)&&"pointer-events-none opacity-70"}`,children:e(Lt||Mt?"Generating...":Kt?"View Post":"Details")}),nt?c.jsxs("button",{onClick:()=>Ee(ge,tt),disabled:!tt||Mt,className:"flex items-center justify-center gap-1 px-2.5 py-2 rounded-lg text-xs font-bold bg-blue-500/10 text-blue-600 hover:bg-blue-500/20 dark:bg-blue-500/15 dark:text-blue-400 dark:hover:bg-blue-500/25 border border-blue-500/20 dark:border-blue-500/30 transition-all disabled:opacity-50",title:e("Repost to connected social media platforms"),children:[c.jsx(bS,{size:11}),c.jsx("span",{children:e("Repost")})]}):c.jsx("button",{onClick:()=>we(ge,et,tt),disabled:Mt,className:"flex items-center justify-center gap-1 px-2.5 py-2 rounded-lg text-xs font-bold bg-[#CFFF05]/10 text-emerald-700 hover:bg-[#CFFF05]/20 dark:bg-[#CFFF05]/15 dark:text-[#CFFF05] dark:hover:bg-[#CFFF05]/25 border border-emerald-500/20 dark:border-[#CFFF05]/30 transition-all disabled:opacity-50",title:e("Regenerate post"),children:Mt?c.jsx("div",{className:"w-3 h-3 border-2 border-emerald-500 dark:border-[#CFFF05] border-t-transparent rounded-full animate-spin"}):c.jsx(vM,{size:10})}),c.jsx("button",{onClick:Ht=>ze(ge,Qe,Ht),disabled:b===(et.executionId||`batch-${Qe}`),className:"p-2 rounded-lg text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors",title:e("Delete post"),children:b===(et.executionId||`batch-${Qe}`)?c.jsx("div",{className:"w-3 h-3 animate-spin rounded-full border-2 border-red-500 border-t-transparent"}):c.jsx(Ev,{size:12})})]})]},Qe)})})]}),kt(ge)]},ge.id)})})]}),ft.length>0&&c.jsxs("section",{className:"ws-enter mt-4",children:[c.jsx($f,{kicker:e("One-off posts"),title:e("Your posts"),subtitle:e("Posts you created one at a time. Open one to see it, regenerate it, or publish it again."),right:c.jsx("span",{className:"ws-mono rounded-full bg-white/[0.06] px-3 py-1 text-xs text-white/60",children:e("{n} posts",{n:Fe.length})})}),ft.some(ge=>ge.type==="single")&&c.jsx("div",{className:"ws-stagger grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3",children:ft.filter(ge=>ge.type==="single").map(ge=>Se(ge.workflowWithExecutions))}),ft.filter(ge=>ge.type==="group").map((ge,Ne)=>c.jsxs("div",{className:"mt-10",children:[c.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[c.jsx("span",{className:"h-5 w-1 rounded-full bg-[var(--lp-lime)]","aria-hidden":!0}),c.jsx("h3",{className:"ws-display text-lg font-bold text-white",children:ge.name}),c.jsx("span",{className:"ws-mono rounded-full bg-white/[0.06] px-2.5 py-0.5 text-[11px] text-white/60",children:e("{n} posts",{n:ge.workflows.length})})]}),c.jsx("div",{className:"ws-stagger grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3",children:ge.workflows.map(ke=>Se(ke))})]},`group-${Ne}`))]})]})]}),L&&c.jsx(gct,{workflow:L,connections:f,onClose:()=>D(null),onSaved:ge=>{D(null),a(),gr.success(e("Channels updated for {n} scheduled post(s).",{n:ge.updatedPosts}))}}),M&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/70 p-4 backdrop-blur-sm sm:items-center",onClick:()=>T(null),children:c.jsxs("div",{className:"ws ws-glass ws-enter w-full max-w-md rounded-[28px] p-6",onClick:ge=>ge.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":e("Schedule post"),children:[c.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h3",{className:"ws-display text-xl font-bold text-white",children:e("Schedule post")}),c.jsx("p",{className:"ws-muted mt-1 truncate text-sm",children:sv(M.name)})]}),c.jsx("button",{onClick:()=>T(null),"aria-label":e("Close"),className:"ws-btn ws-btn-ghost !h-9 !w-9 !px-0",children:c.jsx(iw,{size:13})})]}),c.jsx(ZAe,{workflow:M,onDone:()=>{T(null),a()}})]})}),H.isOpen&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm animate-fade-in",children:c.jsxs("div",{className:"bg-white dark:bg-[#1A1D24] border border-gray-200 dark:border-[#3A4150] rounded-3xl max-w-md w-full p-6 shadow-2xl overflow-hidden relative animate-scale-up",children:[c.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-gray-100 dark:border-[#252A36]",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-10 h-10 rounded-2xl bg-blue-500/10 dark:bg-blue-500/20 text-blue-600 dar
5792k:text-blue-400 flex items-center justify-center",children:c.jsx(bS,{size:18})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-bold text-gray-900 dark:text-white text-lg",children:e("Repost Content")}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e("Instantly publish this post to your accounts")})]})]}),c.jsx("button",{onClick:()=>!H.isPosting&&X(ge=>({...ge,isOpen:!1})),disabled:H.isPosting,className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded-xl hover:bg-gray-100 dark:hover:bg-[#252A36] transition-colors",children:c.jsx(iw,{size:16})})]}),c.jsxs("div",{className:"my-4 p-3 bg-gray-50 dark:bg-[#0F121A] rounded-2xl border border-gray-100 dark:border-[#252A36]",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-1",children:[c.jsx("span",{className:"font-semibold text-gray-700 dark:text-gray-300 truncate max-w-[200px]",children:sv(((Te=H.execution)==null?void 0:Te.workflowName)||((oe=H.workflow)==null?void 0:oe.name)||e("Selected Post"))}),c.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 font-bold uppercase",children:e("Ready to Repost")})]}),(()=>{var Ne,ke;let ge="";try{const Xe=typeof((Ne=H.execution)==null?void 0:Ne.result)=="string"?JSON.parse(H.execution.result):(ke=H.execution)==null?void 0:ke.result;ge=(Xe==null?void 0:Xe.text)||(Xe==null?void 0:Xe.content)||""}catch{}return ge?c.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 line-clamp-2 mt-1 italic",children:['"',ge,'"']}):null})()]}),c.jsxs("div",{className:"mb-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("label",{className:"text-xs font-bold text-gray-700 dark:text-gray-300 uppercase tracking-wider",children:e("Select Connected Platforms")}),(f||[]).length>1&&c.jsx("button",{onClick:()=>{const ge=(f||[]).map(Ne=>{let ke=(Ne.provider||"").toLowerCase();return ke==="x.com"||ke==="twitter"?"twitter":ke});H.selectedPlatforms.length===ge.length?X(Ne=>({...Ne,selectedPlatforms:[]})):X(Ne=>({...Ne,selectedPlatforms:ge}))},className:"text-[11px] font-semibold text-blue-600 dark:text-blue-400 hover:underline",children:H.selectedPlatforms.length===(f||[]).length?e("Deselect All"):e("Select All")})]}),!f||f.length===0?c.jsxs("div",{className:"p-4 bg-amber-50 dark:bg-amber-500/10 border border-amber-200 dark:border-amber-500/20 rounded-2xl text-center",children:[c.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-300 mb-2",children:e("No social media accounts are connected to your account yet.")}),c.jsx(Ks,{to:"/settings#social-accounts",className:"inline-block px-3 py-1.5 bg-amber-500 text-white rounded-xl text-xs font-bold hover:bg-amber-600 transition-colors",children:e("Connect Social Accounts")})]}):c.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1",children:f.map(ge=>{var et;let Ne=(ge.provider||"").toLowerCase();(Ne==="x.com"||Ne==="twitter")&&(Ne="twitter");const ke=H.selectedPlatforms.includes(Ne),Xe=s8[Ne]||s8[(et=ge.provider)==null?void 0:et.toLowerCase()]||c.jsx(bS,{className:"w-5 h-5"});return c.jsxs("div",{onClick:()=>{H.isPosting||X(Qe=>({...Qe,selectedPlatforms:ke?Qe.selectedPlatforms.filter(lt=>lt!==Ne):[...Qe.selectedPlatforms,Ne]}))},className:`flex items-center justify-between p-3 rounded-2xl border cursor-pointer transition-all ${ke?"bg-emerald-500/10 border-emerald-500/40 dark:border-[#CFFF05]/50 text-gray-900 dark:text-white":"bg-white dark:bg-[#0F121A]/50 border-gray-200 dark:border-[#252A36] text-gray-500 dark:text-gray-400 hover:border-gray-300 dark:hover:border-[#3A4150]"}`,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"text-gray-700 dark:text-gray-300",children:Xe}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-bold capitalize text-gray-900 dark:text-white",children:ge.provider}),ge.username&&c.jsx("p",{className:"text-[11px] text-gray-400",children:ge.username})]})]}),c.jsx("div",{className:`w-6 h-6 rounded-lg flex items-center justify-center border transition-all ${ke?"bg-emerald-500 dark:bg-[#CFFF05] border-transparent text-white dark:text-black":"border-gray-300 dark:border-gray-600 bg-transparent"}`,children:ke&&c.jsx(n6,{size:11})})]},ge.id||ge.provider)})})]}),H.errorMessage&&c.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-500/10 border border-red-200 dark:border-red-500/20 rounded-2xl text-xs text-red-600 dark:text-red-400",children:H.errorMessage}),H.successMessage&&c.jsx("div",{className:"mb-4 p-3 bg-emerald-50 dark:bg-emerald-500/10 border border-emerald-200 dark:border-emerald-500/20 rounded-2xl text-xs text-emerald-600 dark:text-emerald-400 font-bold",children:H.successMessage}),c.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[c.jsx("button",{type:"button",onClick:()=>X(ge=>({...ge,isOpen:!1}
5792)),disabled:H.isPosting,className:"flex-1 py-3 px-4 rounded-xl text-xs font-bold text-gray-700 dark:text-gray-300 bg-gray-100 hover:bg-gray-200 dark:bg-[#252A36] dark:hover:bg-[#2A303C] transition-colors disabled:opacity-50",children:e("Cancel")}),c.jsx("button",{type:"button",onClick:Ae,disabled:H.isPosting||H.selectedPlatforms.length===0||!f||f.length===0,className:"flex-1 py-3 px-4 rounded-xl text-xs font-bold text-gray-900 bg-[#CFFF05] hover:bg-[#bce604] dark:text-black dark:bg-[#CFFF05] dark:hover:bg-[#bce604] shadow-lg shadow-[#CFFF05]/20 flex items-center justify-center gap-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:H.isPosting?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-3.5 h-3.5 border-2 border-black border-t-transparent rounded-full animate-spin"}),c.jsx("span",{children:e("Publishing...")})]}):c.jsxs(c.Fragment,{children:[c.jsx(mEe,{size:12}),c.jsx("span",{children:e("Repost Now")})]})})]})]})})]})}function py(n){"@babel/helpers - typeof";return py=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},py(n)}function _ct(n,e){if(py(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(py(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function n1e(n){var e=_ct(n,"string");return py(e)=="symbol"?e:e+""}function qS(n,e,t){return(e=n1e(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bte(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ar(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bte(Object(t),!0).forEach(function(r){qS(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bte(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Sct(n){if(Array.isArray(n))return n}function Tct(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function IU(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function r1e(n,e){if(n){if(typeof n=="string")return IU(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?IU(n,e):void 0}}function Ect(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 5793In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gh(n,e){return Sct(n)||Tct(n,e)||r1e(n,e)||Ect()}function Wq(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function xu(n,e){if(n==null)return{};var t,r,i=Wq(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}var Cct=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Nct(n){var e=n.defaultInputValue,t=e===void 0?"":e,r=n.defaultMenuIsOpen,i=r===void 0?!1:r,s=n.defaultValue,a=s===void 0?null:s,o=n.inputValue,l=n.menuIsOpen,u=n.onChange,d=n.onInputChange,h=n.onMenuClose,f=n.onMenuOpen,p=n.value,g=xu(n,Cct),A=G.useState(o!==void 0?o:t),x=Gh(A,2),b=x[0],_=x[1],M=G.useState(l!==void 0?l:i),T=Gh(M,2),L=T[0],D=T[1],P=G.useState(p!==void 0?p:a),O=Gh(P,2),F=O[0],U=O[1],B=G.useCallback(function(ae,le){typeof u=="function"&&u(
5793ae,le),U(ae)},[u]),z=G.useCallback(function(ae,le){var Z;typeof d=="function"&&(Z=d(ae,le)),_(Z!==void 0?Z:ae)},[d]),H=G.useCallback(function(){typeof f=="function"&&f(),D(!0)},[f]),X=G.useCallback(function(){typeof h=="function"&&h(),D(!1)},[h]),W=o!==void 0?o:b,J=l!==void 0?l:L,ee=p!==void 0?p:F;return Ar(Ar({},g),{},{inputValue:W,menuIsOpen:J,onChange:B,onInputChange:z,onMenuClose:X,onMenuOpen:H,value:ee})}function Mct(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Vte(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,n1e(r.key),r)}}function kct(n,e,t){return e&&Vte(n.prototype,e),t&&Vte(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Rct(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&n_(n,e)}function Pct(n,e){if(e&&(py(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sq(n)}function Lct(n){var e=Eq();return function(){var t,r=G5(n);if(e){var i=G5(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Pct(this,t)}}function Oct(n){if(Array.isArray(n))return IU(n)}function Dct(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function jct(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 5794In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xq(n){return Oct(n)||Dct(n)||r1e(n)||jct()}function Ict(n){if(n.sheet)return n.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===n)return document.styleSheets[e]}function Fct(n){var e=document.createElement("style");return e.setAttribute("data-emotion",n.key),n.nonce!==void 0&&e.setAttribute("nonce",n.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Uct=(function(){function n(t){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=n.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Fct(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=Ict(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++}
vendor: 3,264 bytes, line 5794
5794,e.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},n})(),oc="-ms-",a8="-moz-",ms="-webkit-",i1e="comm",Yq="rule",Qq="decl",Bct="@import",s1e="@keyframes",Vct="@layer",zct=Math.abs,lP=String.fromCharCode,Gct=Object.assign;function qct(n,e){return Ll(n,0)^45?(((e<<2^Ll(n,0))<<2^Ll(n,1))<<2^Ll(n,2))<<2^Ll(n,3):0}function a1e(n){return n.trim()}function $ct(n,e){return(n=e.exec(n))?n[0]:n}function gs(n,e,t){return n.replace(e,t)}function FU(n,e){return n.indexOf(e)}function Ll(n,e){return n.charCodeAt(e)|0}function Y5(n,e,t){return n.slice(e,t)}function Kp(n){return n.length}function Kq(n){return n.length}function VN(n,e){return e.push(n),n}function Hct(n,e){return n.map(e).join("")}var cP=1,d_=1,o1e=0,nd=0,No=0,I_="";function uP(n,e,t,r,i,s,a){return{value:n,root:e,parent:t,type:r,props:i,children:s,line:cP,column:d_,length:a,return:""}}function lS(n,e){return Gct(uP("",null,null,"",null,null,0),n,{length:-n.length},e)}function Wct(){return No}function Xct(){return No=nd>0?Ll(I_,--nd):0,d_--,No===10&&(d_=1,cP--),No}function Xd(){return No=nd<o1e?Ll(I_,nd++):0,d_++,No===10&&(d_=1,cP++),No}function C0(){return Ll(I_,nd)}function z6(){return nd}function $T(n,e){return Y5(I_,n,e)}function Q5(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function l1e(n){return cP=d_=1,o1e=Kp(I_=n),nd=0,[]}function c1e(n){return I_="",n}function G6(n){return a1e($T(nd-1,UU(n===91?n+2:n===40?n+1:n)))}function Yct(n){for(;(No=C0())&&No<33;)Xd();return Q5(n)>2||Q5(No)>3?"":" "}function Qct(n,e){for(;--e&&Xd()&&!(No<48||No>102||No>57&&No<65||No>70&&No<97););return $T(n,z6()+(e<6&&C0()==32&&Xd()==32))}function UU(n){for(;Xd();)switch(No){case n:return nd;case 34:case 39:n!==34&&n!==39&&UU(No);break;case 40:n===41&&UU(n);break;case 92:Xd();break}return nd}function Kct(n,e){for(;Xd()&&n+No!==57;)if(n+No===84&&C0()===47)break;return"/*"+$T(e,nd-1)+"*"+lP(n===47?n:Xd())}function Zct(n){for(;!Q5(C0());)Xd();return $T(n,nd)}function Jct(n){return c1e(q6("",null,null,null,[""],n=l1e(n),0,[0],n))}function q6(n,e,t,r,i,s,a,o,l){for(var u=0,d=0,h=a,f=0,p=0,g=0,A=1,x=1,b=1,_=0,M="",T=i,L=s,D=r,P=M;x;)switch(g=_,_=Xd()){case 40:if(g!=108&&Ll(P,h-1)==58){FU(P+=gs(G6(_),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:P+=G6(_);break;case 9:case 10:case 13:case 32:P+=Yct(g);break;case 92:P+=Qct(z6()-1,7);continue;case 47:switch(C0()){case 42:case 47:VN(eut(Kct(Xd(),z6()),e,t),l);break;default:P+="/"}break;case 123*A:o[u++]=Kp(P)*b;case 125*A:case 59:case 0:switch(_){case 0:case 125:x=0;case 59+d:b==-1&&(P=gs(P,/\f/g,"")),p>0&&Kp(P)-h&&VN(p>32?Gte(P+";",r,t,h-1):Gte(gs(P," ","")+";",r,t,h-2),l);break;case 59:P+=";";default:if(VN(D=zte(P,e,t,u,d,i,o,M,T=[],L=[],h),s),_===123)if(d===0)q6(P,e,D,D,T,s,h,o,L);else switch(f===99&&Ll(P,3)===110?100:f){case 100:case 108:case 109:case 115:q6(n,D,D,r&&VN(zte(n,D,D,0,0,i,o,M,i,T=[],h),L),i,L,h,o,r?T:L);break;default:q6(P,D,D,D,[""],L,0,o,L)}}u=d=p=0,A=b=1,M=P="",h=a;break;case 58:h=1+Kp(P),p=g;default:if(A<1){if(_==123)--A;
vendor: 21,053 bytes, lines 5794-5801
5794else if(_==125&&A++==0&&Xct()==125)continue}switch(P+=lP(_),_*A){case 38:b=d>0?1:(P+="\f",-1);break;case 44:o[u++]=(Kp(P)-1)*b,b=1;break;case 64:C0()===45&&(P+=G6(Xd())),f=C0(),d=h=Kp(M=P+=Zct(z6())),_++;break;case 45:g===45&&Kp(P)==2&&(A=0)}}return s}function zte(n,e,t,r,i,s,a,o,l,u,d){for(var h=i-1,f=i===0?s:[""],p=Kq(f),g=0,A=0,x=0;g<r;++g)for(var b=0,_=Y5(n,h+1,h=zct(A=a[g])),M=n;b<p;++b)(M=a1e(A>0?f[b]+" "+_:gs(_,/&\f/g,f[b])))&&(l[x++]=M);return uP(n,e,t,i===0?Yq:o,l,u,d)}function eut(n,e,t){return uP(n,e,t,i1e,lP(Wct()),Y5(n,2,-2),0)}function Gte(n,e,t,r){return uP(n,e,t,Qq,Y5(n,0,r),Y5(n,r+1,-1),r)}function qb(n,e){for(var t="",r=Kq(n),i=0;i<r;i++)t+=e(n[i],i,n,e)||"";return t}function tut(n,e,t,r){switch(n.type){case Vct:if(n.children.length)break;case Bct:case Qq:return n.return=n.return||n.value;case i1e:return"";case s1e:return n.return=n.value+"{"+qb(n.children,r)+"}";case Yq:n.value=n.props.join(",")}return Kp(t=qb(n.children,r))?n.return=n.value+"{"+t+"}":""}function nut(n){var e=Kq(n);return function(t,r,i,s){for(var a="",o=0;o<e;o++)a+=n[o](t,r,i,s)||"";return a}}function rut(n){return function(e){e.root||(e=e.return)&&n(e)}}var iut=function(e,t,r){for(var i=0,s=0;i=s,s=C0(),i===38&&s===12&&(t[r]=1),!Q5(s);)Xd();return $T(e,nd)},sut=function(e,t){var r=-1,i=44;do switch(Q5(i)){case 0:i===38&&C0()===12&&(t[r]=1),e[r]+=iut(nd-1,t,r);break;case 2:e[r]+=G6(i);break;case 4:if(i===44){e[++r]=C0()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=lP(i)}while(i=Xd());return e},aut=function(e,t){return c1e(sut(l1e(e),t))},qte=new WeakMap,out=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!qte.get(r))&&!i){qte.set(e,!0);for(var s=[],a=aut(t,s),o=r.props,l=0,u=0;l<a.length;l++)for(var d=0;d<o.length;d++,u++)e.props[u]=s[l]?a[l].replace(/&\f/g,o[d]):o[d]+" "+a[l]}}},lut=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function u1e(n,e){switch(qct(n,e)){case 5103:return ms+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ms+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return ms+n+a8+n+oc+n+n;case 6828:case 4268:return ms+n+oc+n+n;case 6165:return ms+n+oc+"flex-"+n+n;case 5187:return ms+n+gs(n,/(\w+).+(:[^]+)/,ms+"box-$1$2"+oc+"flex-$1$2")+n;case 5443:return ms+n+oc+"flex-item-"+gs(n,/flex-|-self/,"")+n;case 4675:return ms+n+oc+"flex-line-pack"+gs(n,/align-content|flex-|-self/,"")+n;case 5548:return ms+n+oc+gs(n,"shrink","negative")+n;case 5292:return ms+n+oc+gs(n,"basis","preferred-size")+n;case 6060:return ms+"box-"+gs(n,"-grow","")+ms+n+oc+gs(n,"grow","positive")+n;case 4554:return ms+gs(n,/([^-])(transform)/g,"$1"+ms+"$2")+n;case 6187:return gs(gs(gs(n,/(zoom-|grab)/,ms+"$1"),/(image-set)/,ms+"$1"),n,"")+n;case 5495:case 3959:return gs(n,/(image-set\([^]*)/,ms+"$1$`$1");case 4968:return gs(gs(n,/(.+:)(flex-)?(.*)/,ms+"box-pack:$3"+oc+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ms+n+n;case 4095:case 3583:case 4068:case 2532:return gs(n,/(.+)-inline(.+)/,ms+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Kp(n)-1-e>6)switch(Ll(n,e+1)){case 109:if(Ll(n,e+4)!==45)break;case 102:return gs(n,/(.+:)(.+)-([^]+)/,"$1"+ms+"$2-$3$1"+a8+(Ll(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~FU(n,"stretch")?u1e(gs(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(Ll(n,e+1)!==115)break;case 6444:switch(Ll(n,Kp(n)-3-(~FU(n,"!important")&&10))){case 107:return gs(n,":",":"+ms)+n;case 101:return gs(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ms+(Ll(n,14)===45?"inline-":"")+"box$3$1"+ms+"$2$3$1"+oc+"$2box$3")+n}break;case 5936:switch(Ll(n,e+11)){case 114:return ms+n+oc+gs(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return ms+n+oc+gs(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return ms+n+oc+gs(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return ms+n+oc+n+n}return n}var cut=function(e,t,r,i){if(e.length>-1&&!e.return)switch(e.type){case Qq:e.return=u1e(e.value,e.length);break;case s1e:return qb([lS(e,{value:gs(e.value,"@","@"+ms)})],i);case Yq:if(e.length)return Hct(e.props,function(s){switch($ct(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return qb([lS(e,{props:[gs(s,/:(read-\w+)/,":"+a8+"$1")]})],i);case"::placeholder":return qb([lS(e,{props:[gs(s,/:(plac\w+)/,":"+ms+"input-$1")]}),lS(e,{props:[gs(s,/:(plac\w+)/,":"+a8+"$1")]}),lS(e,{props:[gs(s,/:(plac\w+)/,oc+"input-$1")]})],i)}return""})}},uut=[cut],dut=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(A){var x=A.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(A),A.setAttribute("data-s",""))})}var i=e.stylisPlugins||uut,s={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(A){for(var x=A.getAttribute("data-emotion").split(" "),b=1;b<x.length;b++)s[x[b]]=!0;o.push(A)});var l,u=[out,lut];{var d,h=[tut,rut(function(A){d.insert(A)})],f=nut(u.concat(i,h)),p=function(x){return qb(Jct(x),f)};l=function(x,b,_,M){d=_,p(x?x+"{"+b.styles+"}":b.styles),M&&(g.inserted[b.name]=!0)}}var g={key:t,sheet:new Uct({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:l};return g.sheet.hydrate(o),g},kO={exports:{}},Ts={};/** @license React v16.13.1 5795 * react-is.production.min.js 5796 * 5797 * Copyright (c) Facebook, Inc. and its affiliates. 5798 * 5799 * This source code is licensed under the MIT license found in the 5800 * LICENSE file in the root directory of this source tree. 5801 */var $te;function hut(){if($te)return Ts;$te=1;var n=typeof Symbol=="function"&&Symbol.for,e=n?Symbol.for("react.element"):60103,t=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,a=n?Symbol.for("react.provider"):60109,o=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,p=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,A=n?Symbol.for("react.block"):60121,x=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function M(L){if(typeof L=="object"&&L!==null){var D=L.$$typeof;switch(D){case e:switch(L=L.type,L){case l:case u:case r:case s:case i:case h:return L;default:switch(L=L&&L.$$typeof,L){case o:case d:case g:case p:case a:return L;default:return D}}case t:return D}}}function T(L){return M(L)===u}return Ts.AsyncMode=l,Ts.ConcurrentMode=u,Ts.ContextConsumer=o,Ts.ContextProvider=a,Ts.Element=e,Ts.ForwardRef=d,Ts.Fragment=r,Ts.Lazy=g,Ts.Memo=p,Ts.Portal=t,Ts.Profiler=s,Ts.StrictMode=i,Ts.Suspense=h,Ts.isAsyncMode=function(L){return T(L)||M(L)===l},Ts.isConcurrentMode=T,Ts.isContextConsumer=function(L){return M(L)===o},Ts.isContextProvider=function(L){return M(L)===a},Ts.isElement=function(L){return typeof L=="object"&&L!==null&&L.$$typeof===e},Ts.isForwardRef=function(L){return M(L)===d},Ts.isFragment=function(L){return M(L)===r},Ts.isLazy=function(L){return M(L)===g},Ts.isMemo=function(L){return M(L)===p},Ts.isPortal=function(L){return M(L)===t},Ts.isProfiler=function(L){return M(L)===s},Ts.isStrictMode=function(L){return M(L)===i},Ts.isSuspense=function(L){return M(L)===h},Ts.isValidElementType=function(L){return typeof L=="string"||typeof L=="function"||L===r||L===u||L===s||L===i||L===h||L===f||typeof L=="object"&&L!==null&&(L.$$typeof===g||L.$$typeof===p||L.$$typeof===a||L.$$typeof===o||L.$$typeof===d||L.$$typeof===x||L.$$typeof===b||L.$$typeof===_||L.$$typeof===A)},Ts.typeOf=M,Ts}var Hte;function fut(){return Hte||(Hte=1,kO.exports=hut()),kO.exports}var RO,Wte;function put(){if(Wte)return RO;Wte=1;var n=fut(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},t={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=r,s[n.Memo]=i;function a(g){return n.isMemo(g)?i:s[g.$$typeof]||e}var o=Object.defineProperty,l=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,f=Object.prototype;function p(g,A,x){if(typeof A!="string"){if(f){var b=h(A);b&&b!==f&&p(g,b,x)}var _=l(A);u&&(_=_.concat(u(A)));for(var M=a(g),T=a(A),L=0;L<_.length;++L){var D=_[L];if(!t[D]&&!(x&&x[D])&&!(T&&T[D])&&!(M&&M[D])){var P=d(A,D);try{o(g,D,P)}catch{}}}}return g}return RO=p,RO}put();var mut=!0;function gut(n,e,t){var r="";return t.split(" ").forEach(function(i){n[i]!==void 0?e.push(n[i]+";"):i&&(r+=i+" ")}),r}var d1e=function(e,t,r){var i=e.key+"-"+t.name;(r===!1||mut===!1)&&e.registered[i]===void 0&&(e.registered[i]=t.styles)},Aut=function(e,t,r){d1e(e,t,r);var i=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var s=t;do e.insert(t===s?"."+i:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function xut(n){for(var e=0,t,r=0,i=n.length;i>=4;++r,i-=4)t=n.charCodeAt(r)&255|(n.charCodeAt(++r)&255)<<8|(n.charCodeAt(++r)&255)<<16|(n.charCodeAt(++r)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(n.charCodeAt(r+2)&255)<<16;case 2:e^=(n.charCodeAt(r+1)&255)<<8;case 1:e^=n.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var vut=/[A-Z]|^ms/g,yut=/_EMO_([^_]+?)_([^]*?)_EMO_/g,h1e=function(e){return e.charCodeAt(1)===45},Xte=function(e){return e!=null&&typeof e!="boolean"},PO=Wot(function(n){return h1e(n)?n:n.replace(vut,"-$&").toLowerCase()}),Yte=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(yut,function(r,i,s){return Zp={name:i,styles:s,next:Zp},i})}return SAe[e]!==1&&!h1e(e)&&typeof t=="number"&&t!==0?t+"px":t};function K5(n,e,t){if(t==null)return"";var r=t;if(r.__emotion_styles!==void 0)return r;switch(typeof t){case"boolean":return"";case"object":{var i=t;if(i.anim===1)return Zp={name:i.name,styles:i.styles,next:Zp},i.name;var s=t;if(s.styles!==void 0){var a=s.next;if(a!==void 0)for(;a!==void 0;)Zp={name:a.name,styles:a.styles,next:Zp},a=a.next;var o=s.styles+";";return o}return but(n,e,t)}case"function":{if(n!==void 0){var l=Zp,u=t(n);return Zp=l,K5(n,e,u)}break}}var d=t;return d}function but(n,e,t){var r="";if(Array.isArray(t))for(var i=0;i<t.length;i++)r+=K5(n,e,t[i])+";";else for(var s in t){var a=t[s];if(typeof a!="object"){var o=a;Xte(o)&&(r+=PO(s)+":"+Yte(s,o)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&e==null)for(var l=0;l<a.length;l++)Xte(a[l])&&(r+=PO(s)+":"+Yte(s,a[l])+";");else{var u=K5(n,e,a);switch(s){case"animation":case"animationName":{r+=PO(s)+":"+u+";";break}default:r+=s+"{"+u+"}"}}}return r}var Qte=/label:\s*([^\s;{]+)\s*(;|$)/g,Zp;function f1e(n,e,t){if(n.length===1&&typeof n[0]=="object"&&n[0]!==null&&n[0].styles!==void 0)return n[0];var r=!0,i="";Zp=void 0;var s=n[0];if(s==null||s.raw===void 0)r=!1,i+=K5(t,e,s);else{var a=s;i+=a[0]}for(var o=1;o<n.length;o++)if(i+=K5(t,e,n[o]),r){var l=s;i+=l[o]}Qte.lastIndex=0;for(var u="",d;(d=Qte.exec(i))!==null;)u+="-"+d[1];var h=xut(i)+u;return{name:h,styles:i,next:Zp}}var wut=function(e){return e()},_ut=$b.useInsertionEffect?$b.useInsertionEffect:!1,Sut=_ut||wut,p1e=G.createContext(typeof HTMLElement<"u"?dut({key:"css"}):null);p1e.Provider;var Tut=function(e){return G.forwardRef(function(t,r){var i=G.useContext(p1e);return e(t,i,r)})},Eut=G.createContext({}),Zq={}.hasOwnProperty,BU="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Cut=function(e,t){var r={};for(var i in t)Zq.call(t,i)&&(r[i]=t[i]);return r[BU]=e,r},Nut=function(e){var t=e.cache,r=e.serialized,i=e.isStringTag;return d1e(t,r,i),Sut(function(){return Aut(t,r,i)}),null},Mut=Tut(function(n,e,t){var r=n.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var i=n[BU],s=[r],a="";typeof n.className=="string"?a=gut(e.registered,s,n.className):n.className!=null&&(a=n.className+" ");var o=f1e(s,void 0,G.useContext(Eut));a+=e.key+"-"+o.name;var l={};for(var u in n)Zq.call(n,u)&&u!=="css"&&u!==BU&&(l[u]=n[u]);return l.className=a,t&&(l.ref=t),G.createElement(G.Fragment,null,G.createElement(Nut,{cache:e,serialized:o,isStringTag:typeof i=="string"}),G.createElement(i,l))}),kut=Mut,Cr=function(e,t){var r=arguments;if(t==null||!Zq.call(t,"css"))return G.createElement.apply(void 0,r);var i=r.length,s=new Array(i);s[0]=kut,s[1]=Cut(e,t);for(var a=2;a<i;a++)s[a]=r[a];return G.createElement.apply(null,s)};(function(n){var e;e||(e=n.JSX||(n.JSX={}))})(Cr||(Cr={}));function Jq(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return f1e(e)}function Rut(){var n=Jq.apply(void 0,arguments),e="animation-"+n.name;return{name:e,styles:"@keyframes "+e+"{"+n.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function Put(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}const Lut=Math.min,Out=Math.max,o8=Math.round,zN=Math.floor,l8=n=>({x:n,y:n});function Dut(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function dP(){return typeof window<"u"}function m1e(n){return A1e(n)?(n.nodeName||"").toLowerCase():"#document"}function lg(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function g1e(n){var e;return(e=(A1e(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function A1e(n){return dP()?n instanceof Node||n instanceof lg(n).Node:!1}function jut(n){return dP()?n instanceof Element||n instanceof lg(n).Element:!1}function e$(n){return dP()?n instanceof HTMLElement||n instanceof lg(n).HTMLElement:!1}function Kte(n){return!dP()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof lg(n).ShadowRoot}function x1e(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=t$(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&i!=="inline"&&i!=="contents"}let LO;function Iut(){return LO==null&&(LO=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),LO}function Fut(n){return/^(html|body|#document)$/.test(m1e(n))}function t$(n){return lg(n).getComputedStyle(n)}function Uut(n){if(m1e(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Kte(n)&&n.host||g1e(n);return Kte(e)?e.host:e}function v1e(n){const e=Uut(n);return Fut(e)?n.ownerDocument?n.ownerDocument.body:n.body:e$(e)&&x1e(e)?e:v1e(e)}function c8(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=v1e(n),s=i===((r=n.ownerDocument)==null?void 0:r.body),a=lg(i);if(s){const o=VU(a);return e.concat(a,a.visualViewport||[],x1e(i)?i:[],o&&t?c8(o):[])}else return e.concat(i,c8(i,[],t))}function VU(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function But(n){const e=t$(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=e$(n),s=i?n.offsetWidth:t,a=i?n.offsetHeight:r,o=o8(t)!==s||o8(r)!==a;return o&&(t=s,r=a),{width:t,height:r,$:o}}function n$(n){return jut(n)?n:n.contextElement}function Zte(n){const e=n$(n);if(!e$(e))return l8(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:s}=But(e);let a=(s?o8(t.width):t.width)/r,o=(s?o8(t.height):t.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const Vut=l8(0);function zut(n){const e=lg(n);return!Iut()||!e.visualViewport?Vut:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Gut(n,e,t){return!1}function Jte(n,e,t,r){e===void 0&&(e=!1);const i=n.getBoundingClientRect(),s=n$(n);let a=l8(1);e&&(a=Zte(n));const o=Gut()?zut(s):l8(0);let l=(i.left+o.x)/a.x,u=(i.top+o.y)/a.y,d=i.width/a.x,h=i.height/a.y;if(s){const f=lg(s),p=r;let g=f,A=VU(g);for(;A&&r&&p!==g;){const x=Zte(A),b=A.getBoundingClientRect(),_=t$(A),M=b.left+(A.clientLeft+parseFloat(_.paddingLeft))*x.x,T=b.top+(A.clientTop+parseFloat(_.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,h*=x.y,l+=M,u+=T,g=lg(A),A=VU(g)}}return Dut({width:d,height:h,x:l,y:u})}function y1e(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function qut(n,e){let t=null,r;const i=g1e(n);function s(){var o;clearTimeout(r),(o=t)==null||o.disconnect(),t=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const u=n.getBoundingClientRect(),{left:d,top:h,width:f,height:p}=u;if(o||e(),!f||!p)return;const g=zN(h),A=zN(i.clientWidth-(d+f)),x=zN(i.clientHeight-(h+p)),b=zN(d),M={rootMargin:-g+"px "+-A+"px "+-x+"px "+-b+"px",threshold:Out(0,Lut(1,l))||1};let T=!0;function L(D){const P=D[0].intersectionRatio;if(P!==l){if(!T)return a();P?a(!1,P):r=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!y1e(u,n.getBoundingClientRect())&&a(),T=!1}try{t=new IntersectionObserver(L,{...M,root:i.ownerDocument})}catch{t=new IntersectionObserver(L,M)}t.observe(n)}return a(!0),s}function $ut(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=n$(n),d=i||s?[...u?c8(u):[],...e?c8(e):[]]:[];d.forEach(b=>{i&&b.addEventListener("scroll",t,{passive:!0}),s&&b.addEventListener("resize",t)});const h=u&&o?qut(u,t):null;let f=-1,p=null;a&&(p=new ResizeObserver(b=>{let[_]=b;_&&_.target===u&&p&&e&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var M;(M=p)==null||M.observe(e)})),t()}),u&&!l&&p.observe(u),e&&p.observe(e));let g,A=l?Jte(n):null;l&&x();function x(){const b=Jte(n);A&&!y1e(A,b)&&t(),A=b,g=requestAnimationFrame(x)}return t(),()=>{var b;d.forEach(_=>{i&&_.removeEventListener("scroll",t),s&&_.removeEventListener("resize",t)}),h==null||h(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(g)}}var zU=G.useLayoutEffect,Hut=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],u8=function(){};function Wut(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function Xut(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var s=[].concat(r);if(e&&n)for(var a in e)e.hasOwnProperty(a)&&e[a]&&s.push("".concat(Wut(n,a)));return s.filter(function(o){return o}).map(function(o){return String(o).trim()}).join(" ")}var ene=function(e){return rdt(e)?e.filter(Boolean):py(e)==="object"&&e!==null?[e]:[]},b1e=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=xu(e,Hut);return Ar({},t)},no=function(e,t,r){var i=e.cx,s=e.getStyles,a=e.getClassNames,o=e.className;return{css:s(t,e),className:i(r??{},a(t,e),o)}};function hP(n){return[document.documentElement,document.body,window].indexOf(n)>-1}function Yut(n){return hP(n)?window.innerHeight:n.clientHeight}function w1e(n){return hP(n)?window.pageYOffset:n.scrollTop}function d8(n,e){if(hP(n)){window.scrollTo(0,e);return}n.scrollTop=e}function Qut(n){var e=getComputedStyle(n),t=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var i=n;i=i.parentElement;)if(e=getComputedStyle(i),!(t&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.documentElement}function Kut(n,e,t,r){return t*((n=n/r-1)*n*n+1)+e}function GN(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:u8,i=w1e(n),s=e-i,a=10,o=0;function l(){o+=a;var u=Kut(o,i,s,t);d8(n,u),o<t?window.requestAnimationFrame(l):r(n)}l()}function tne(n,e){var t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.offsetHeight/3;r.bottom+i>t.bottom?d8(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+i,n.scrollHeight)):r.top-i<t.top&&d8(n,Math.max(e.offsetTop-i,0))}function Zut(n){var e=n.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function nne(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Jut(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}
5801var _1e=!1,edt={get passive(){return _1e=!0}},qN=typeof window<"u"?window:{};qN.addEventListener&&qN.removeEventListener&&(qN.addEventListener("p",u8,edt),qN.removeEventListener("p",u8,!1));var tdt=_1e;function ndt(n){return n!=null}function rdt(n){return Array.isArray(n)}function $N(n,e,t){return n?e:t}var idt=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];var s=Object.entries(e).filter(function(a){var o=Gh(a,1),l=o[0];return!r.includes(l)});return s.reduce(function(a,o){var l=Gh(o,2),u=l[0],d=l[1];return a[u]=d,a},{})},sdt=["children","innerProps"],adt=["children","innerProps"];function odt(n){var e=n.maxHeight,t=n.menuEl,r=n.minHeight,i=n.placement,s=n.shouldScroll,a=n.isFixedPosition,o=n.controlHeight,l=Qut(t),u={placement:"bottom",maxHeight:e};if(!t||!t.offsetParent)return u;var d=l.getBoundingClientRect(),h=d.height,f=t.getBoundingClientRect(),p=f.bottom,g=f.height,A=f.top,x=t.offsetParent.getBoundingClientRect(),b=x.top,_=a?window.innerHeight:Yut(l),M=w1e(l),T=parseInt(getComputedStyle(t).marginBottom,10),L=parseInt(getComputedStyle(t).marginTop,10),D=b-L,P=_-A,O=D+M,F=h-M-A,U=p-_+M+T,B=M+A-L,z=160;switch(i){case"auto":case"bottom":if(P>=g)return{placement:"bottom",maxHeight:e};if(F>=g&&!a)return s&&GN(l,U,z),{placement:"bottom",maxHeight:e};if(!a&&F>=r||a&&P>=r){s&&GN(l,U,z);var H=a?P-T:F-T;return{placement:"bottom",maxHeight:H}}if(i==="auto"||a){var X=e,W=a?D:O;return W>=r&&(X=Math.min(W-T-o,e)),{placement:"top",maxHeight:X}}if(i==="bottom")return s&&d8(l,U),{placement:"bottom",maxHeight:e};break;case"top":if(D>=g)return{placement:"top",maxHeight:e};if(O>=g&&!a)return s&&GN(l,B,z),{placement:"top",maxHeight:e};if(!a&&O>=r||a&&D>=r){var J=e;return(!a&&O>=r||a&&D>=r)&&(J=a?D-L:O-L),s&&GN(l,B,z),{placement:"top",maxHeight:J}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function ldt(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var S1e=function(e){return e==="auto"?"bottom":e},cdt=function(e,t){var r,i=e.placement,s=e.theme,a=s.borderRadius,o=s.spacing,l=s.colors;return Ar((r={label:"menu"},qS(r,ldt(i),"100%"),qS(r,"position","absolute"),qS(r,"width","100%"),qS(r,"zIndex",1),r),t?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:o.menuGutter,marginTop:o.menuGutter})},T1e=G.createContext(null),udt=function(e){var t=e.children,r=e.minMenuHeight,i=e.maxMenuHeight,s=e.menuPlacement,a=e.menuPosition,o=e.menuShouldScrollIntoView,l=e.theme,u=G.useContext(T1e)||{},d=u.setPortalPlacement,h=G.useRef(null),f=G.useState(i),p=Gh(f,2),g=p[0],A=p[1],x=G.useState(null),b=Gh(x,2),_=b[0],M=b[1],T=l.spacing.controlHeight;return zU(function(){var L=h.current;if(L){var D=a==="fixed",P=o&&!D,O=odt({maxHeight:i,menuEl:L,minHeight:r,placement:s,shouldScroll:P,isFixedPosition:D,controlHeight:T});A(O.maxHeight),M(O.placement),d==null||d(O.placement)}},[i,s,a,o,r,d,T]),t({ref:h,placerProps:Ar(Ar({},e),{},{placement:_||S1e(s),maxHeight:g})})},ddt=function(e){var t=e.children,r=e.innerRef,i=e.innerProps;return Cr("div",er({},no(e,"menu",{menu:!0}),{ref:r},i),t)},hdt=ddt,fdt=function(e,t){var r=e.maxHeight,i=e.theme.spacing.baseUnit;return Ar({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:i,paddingTop:i})},pdt=function(e){var t=e.children,r=e.innerProps,i=e.innerRef,s=e.isMulti;return Cr("div",er({},no(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:i},r),t)},E1e=function(e,t){var r=e.theme,i=r.spacing.baseUnit,s=r.colors;return Ar({textAlign:"center"},t?{}:{color:s.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},mdt=E1e,gdt=E1e,Adt=function(e){var t=e.children,r=t===void 0?"No options":t,i=e.innerProps,s=xu(e,sdt);return Cr("div",er({},no(Ar(Ar({},s),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},xdt=function(e){var t=e.children,r=t===void 0?"Loading...":t,i=e.innerProps,s=xu(e,adt);return Cr("div",er({},no(Ar(Ar({},s),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},vdt=function(e){var t=e.rect,r=e.offset,i=e.position;return{left:t.left,position:i,top:r,width:t.width,zIndex:1}},ydt=function(e){var t=e.appendTo,r=e.children,i=e.controlElement,s=e.innerProps,a=e.menuPlacement,o=e.menuPosition,l=G.useRef(null),u=G.useRef(null),d=G.useState(S1e(a)),h=Gh(d,2),f=h[0],p=h[1],g=G.useMemo(function(){return{setPortalPlacement:p}},[]),A=G.useState(null),x=Gh(A,2),b=x[0],_=x[1],M=G.useCallback(function(){if(i){var P=Zut(i),O=o==="fixed"?0:window.pageYOffset,F=P[f]+O;(F!==(b==null?void 0:b.offset)||P.left!==(b==null?void 0:b.rect.left)||P.width!==(b==null?void 0:b.rect.width))&&_({offset:F,rect:P})}},[i,o,f,b==null?void 0:b.offset,b==null?void 0:b.rect.left,b==null?void 0:b.rect.width]);zU(function(){M()},[M]);var T=G.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=$ut(i,l.current,M,{elementResize:"ResizeObserver"in window}))},[i,M]);zU(function(){T()},[T]);var L=G.useCallback(function(P){l.current=P,T()},[T]);if(!t&&o!=="fixed"||!b)return null;var D=Cr("div",er({ref:L},no(Ar(Ar({},e),{},{offset:b.offset,position:o,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),r);return Cr(T1e.Provider,{value:g},t?Vl.createPortal(D,t):D)},bdt=function(e){var t=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}}
5801,wdt=function(e){var t=e.children,r=e.innerProps,i=e.isDisabled,s=e.isRtl;return Cr("div",er({},no(e,"container",{"--is-disabled":i,"--is-rtl":s}),r),t)},_dt=function(e,t){var r=e.theme.spacing,i=e.isMulti,s=e.hasValue,a=e.selectProps.controlShouldRenderValue;return Ar({alignItems:"center",display:i&&s&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},Sdt=function(e){var t=e.children,r=e.innerProps,i=e.isMulti,s=e.hasValue;return Cr("div",er({},no(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":s}),r),t)},Tdt=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Edt=function(e){var t=e.children,r=e.innerProps;return Cr("div",er({},no(e,"indicatorsContainer",{indicators:!0}),r),t)},rne,Cdt=["size"],Ndt=["innerProps","isRtl","size"],Mdt={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},C1e=function(e){var t=e.size,r=xu(e,Cdt);return Cr("svg",er({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Mdt},r))},r$=function(e){return Cr(C1e,er({size:20},e),Cr("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},N1e=function(e){return Cr(C1e,er({size:20},e),Cr("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},M1e=function(e,t){var r=e.isFocused,i=e.theme,s=i.spacing.baseUnit,a=i.colors;return Ar({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:r?a.neutral60:a.neutral20,padding:s*2,":hover":{color:r?a.neutral80:a.neutral40}})},kdt=M1e,Rdt=function(e){var t=e.children,r=e.innerProps;return Cr("div",er({},no(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),t||Cr(N1e,null))},Pdt=M1e,Ldt=function(e){var t=e.children,r=e.innerProps;return Cr("div",er({},no(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),t||Cr(r$,null))},Odt=function(e,t){var r=e.isDisabled,i=e.theme,s=i.spacing.baseUnit,a=i.colors;return Ar({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:s*2,marginTop:s*2})},Ddt=function(e){var t=e.innerProps;return Cr("span",er({},t,no(e,"indicatorSeparator",{"indicator-separator":!0})))},jdt=Rut(rne||(rne=Put([` 5802 0%, 80%, 100% { opacity: 0; } 5803 40% { opacity: 1; } 5804`]))),Idt=function(e,t){var r=e.isFocused,i=e.size,s=e.theme,a=s.colors,o=s.spacing.baseUnit;return Ar({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?a.neutral60:a.neutral20,padding:o*2})},OO=function(e){var t=e.delay,r=e.offset;return Cr("span",{css:Jq({animation:"".concat(jdt," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Fdt=function(e){var t=e.innerProps,r=e.isRtl,i=e.size,s=i===void 0?4:i,a=xu(e,Ndt);return Cr("div",er({},no(Ar(Ar({},a),{},{innerProps:t,isRtl:r,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Cr(OO,{delay:0,offset:r}),Cr(OO,{delay:160,offset:!0}),Cr(OO,{delay:320,offset:!r}))},Udt=function(e,t){var r=e.isDisabled,i=e.isFocused,s=e.theme,a=s.colors,o=s.borderRadius,l=s.spacing;return Ar({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},Bdt=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,s=e.innerRef,a=e.innerProps,o=e.menuIsOpen;return Cr("div",er({ref:s}
5804,no(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":o}),a,{"aria-disabled":r||void 0}),t)},Vdt=Bdt,zdt=["data"],Gdt=function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},qdt=function(e){var t=e.children,r=e.cx,i=e.getStyles,s=e.getClassNames,a=e.Heading,o=e.headingProps,l=e.innerProps,u=e.label,d=e.theme,h=e.selectProps;return Cr("div",er({},no(e,"group",{group:!0}),l),Cr(a,er({},o,{selectProps:h,theme:d,getStyles:i,getClassNames:s,cx:r}),u),Cr("div",null,t))},$dt=function(e,t){var r=e.theme,i=r.colors,s=r.spacing;return Ar({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},Hdt=function(e){var t=b1e(e);t.data;var r=xu(t,zdt);return Cr("div",er({},no(e,"groupHeading",{"group-heading":!0}),r))},Wdt=qdt,Xdt=["innerRef","isDisabled","isHidden","inputClassName"],Ydt=function(e,t){var r=e.isDisabled,i=e.value,s=e.theme,a=s.spacing,o=s.colors;return Ar(Ar({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},Qdt),t?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:o.neutral80})},k1e={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Qdt={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ar({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},k1e)},Kdt=function(e){return Ar({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},k1e)},Zdt=function(e){var t=e.cx,r=e.value,i=b1e(e),s=i.innerRef,a=i.isDisabled,o=i.isHidden,l=i.inputClassName,u=xu(i,Xdt);return Cr("div",er({},no(e,"input",{"input-container":!0}),{"data-value":r||""}),Cr("input",er({className:t({input:!0},l),ref:s,style:Kdt(o),disabled:a},u)))},Jdt=Zdt,eht=function(e,t){var r=e.theme,i=r.spacing,s=r.borderRadius,a=r.colors;return Ar({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:a.neutral10,borderRadius:s/2,margin:i.baseUnit/2})},tht=function(e,t){var r=e.theme,i=r.borderRadius,s=r.colors,a=e.cropWithEllipsis;return Ar({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},nht=function(e,t){var r=e.theme,i=r.spacing,s=r.borderRadius,a=r.colors,o=e.isFocused;return Ar({alignItems:"center",display:"flex"},t?{}:{borderRadius:s/2,backgroundColor:o?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},R1e=function(e){var t=e.children,r=e.innerProps;return Cr("div",r,t)},rht=R1e,iht=R1e;function sht(n){var e=n.children,t=n.innerProps;return Cr("div",er({role:"button"},t),e||Cr(r$,{size:14}))}var aht=function(e){var t=e.children,r=e.components,i=e.data,s=e.innerProps,a=e.isDisabled,o=e.removeProps,l=e.selectProps,u=r.Container,d=r.Label,h=r.Remove;return Cr(u,{data:i,innerProps:Ar(Ar({},no(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),s),selectProps:l},Cr(d,{data:i,innerProps:Ar({},no(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),Cr(h,{data:i,innerProps:Ar(Ar({},no(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},o),selectProps:l}))},oht=aht,lht=function(e,t){var r=e.isDisabled,i=e.isFocused,s=e.isSelected,a=e.theme,o=a.spacing,l=a.colors;return Ar({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:s?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:s?l.neutral0:"inherit",padding:"".concat(o.baseUnit*2,"px ").concat(o.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:s?l.primary:l.primary50}})},cht=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,s=e.isSelected,a=e.innerRef,o=e.innerProps;return Cr("div",er({},no(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":s}),{ref:a,"aria-disabled":r},o),t)},uht=cht,dht=function(e,t){var r=e.theme,i=r.spacing,s=r.colors;return Ar({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:s.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},hht=function(e){var t=e.children,r=e.innerProps;return Cr("div",er({},no(e,"placeholder",{placeholder:!0}),r),t)},fht=hht,pht=function(e,t){var r=e.isDisabled,i=e.theme,s=i.spacing,a=i.colors;return Ar({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?a.neutral40:a.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},mht=function(e){var t=e.children,r=e.isDisabled,i=e.innerProps;return Cr("div",er({},no(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),t)},ght=mht,Aht={ClearIndicator:Ldt,Control:Vdt,DropdownIndicator:Rdt,DownChevron:N1e,CrossIcon:r$,Group:Wdt,GroupHeading:Hdt,IndicatorsContainer:Edt,IndicatorSeparator:Ddt,Input:Jdt,LoadingIndicator:Fdt,Menu:hdt,MenuList:pdt,MenuPortal:ydt,LoadingMessage:xdt,NoOptionsMessage:Adt,MultiValue:oht,MultiValueContainer:rht,MultiValueLabel:iht,MultiValueRemove:sht,Option:uht,Placeholder:fht,SelectContainer:wdt,SingleValue:ght,ValueContainer:Sdt},P1e=function(e){return Ar(Ar({},Aht),e.components)},ine=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function xht(n,e){return!!(n===e||ine(n)&&ine(e))}function vht(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!xht(n[t],e[t]))return!1;return!0}function L1e(n,e){e===void 0&&(e=vht);var t=null;function r(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(t&&t.lastThis===this&&e(i,t.lastArgs))return t.lastResult;var a=n.apply(this,i);return t={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){t=null},r}var yht={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},bht=function(e){return Cr("span",er({css:yht},e))},sne=bht,wht={guidance:function(e){var t=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,s=e.context,a=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,r=e.label,i=r===void 0?"":r,s=e.labels,a=e.isDisabled;
vendor: 4,240 bytes, line 5804
5804switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,i=e.options,s=e.label,a=s===void 0?"":s,o=e.selectValue,l=e.isDisabled,u=e.isSelected,d=e.isAppleDevice,h=function(A,x){return A&&A.length?"".concat(A.indexOf(x)+1," of ").concat(A.length):""};if(t==="value"&&o)return"value ".concat(a," focused, ").concat(h(o,r),".");if(t==="menu"&&d){var f=l?" disabled":"",p="".concat(u?" selected":"").concat(f);return"".concat(a).concat(p,", ").concat(h(i,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},_ht=function(e){var t=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,s=e.focusableOptions,a=e.isFocused,o=e.selectValue,l=e.selectProps,u=e.id,d=e.isAppleDevice,h=l.ariaLiveMessages,f=l.getOptionLabel,p=l.inputValue,g=l.isMulti,A=l.isOptionDisabled,x=l.isSearchable,b=l.menuIsOpen,_=l.options,M=l.screenReaderStatus,T=l.tabSelectsValue,L=l.isLoading,D=l["aria-label"],P=l["aria-live"],O=G.useMemo(function(){return Ar(Ar({},wht),h||{})},[h]),F=G.useMemo(function(){var W="";if(t&&O.onChange){var J=t.option,ee=t.options,ae=t.removedValue,le=t.removedValues,Z=t.value,Y=function(we){return Array.isArray(we)?null:we},re=ae||J||Y(Z),_e=re?f(re):"",Ee=ee||le||void 0,Ae=Ee?Ee.map(f):[],te=Ar({isDisabled:re&&A(re,o),label:_e,labels:Ae},t);W=O.onChange(te)}return W},[t,O,A,o,f]),U=G.useMemo(function(){var W="",J=r||i,ee=!!(r&&o&&o.includes(r));if(J&&O.onFocus){var ae={focused:J,label:f(J),isDisabled:A(J,o),isSelected:ee,options:s,context:J===r?"menu":"value",selectValue:o,isAppleDevice:d};W=O.onFocus(ae)}return W},[r,i,f,A,O,s,o,d]),B=G.useMemo(function(){var W="";if(b&&_.length&&!L&&O.onFilter){var J=M({count:s.length});W=O.onFilter({inputValue:p,resultsMessage:J})}return W},[s,p,b,O,_,M,L]),z=(t==null?void 0:t.action)==="initial-input-focus",H=G.useMemo(function(){var W="";if(O.guidance){var J=i?"value":b?"menu":"input";W=O.guidance({"aria-label":D,context:J,isDisabled:r&&A(r,o),isMulti:g,isSearchable:x,tabSelectsValue:T,isInitialFocus:z})}return W},[D,r,i,g,A,x,b,O,o,T,z]),X=Cr(G.Fragment,null,Cr("span",{id:"aria-selection"},F),Cr("span",{id:"aria-focused"},U),Cr("span",{id:"aria-results"},B),Cr("span",{id:"aria-guidance"},H));return Cr(G.Fragment,null,Cr(sne,{id:u},z&&X),Cr(sne,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!z&&X))},Sht=_ht,GU=[{base:"A",letters:"Aâ¶ï¼¡ÃÃÃẦẤẪẨÃÄÄáº°áº®áº´áº²È¦Ç ÃÇẢÃ
ǺÇÈÈẠẬẶá¸ÄȺⱯ"},{base:"AA",letters:"ê²"},{base:"AE",letters:"ÃǼǢ"},{base:"AO",letters:"ê´"},{base:"AU",letters:"ê¶"},{base:"AV",letters:"ê¸êº"},{base:"AY",letters:"ê¼"},{base:"B",letters:"Bâ·ï¼¢á¸á¸á¸ÉÆÆ"},{base:"C",letters:"Câ¸ï¼£ÄÄÄÄÃá¸ÆÈ»ê¾"},{base:"D",letters:"Dâ¹ï¼¤á¸Äá¸á¸á¸á¸ÄÆÆÆê¹"},{base:"DZ",letters:"DZÇ"},{base:"Dz",letters:"DzÇ
"},{base:"E",letters:"Eâºï¼¥ÃÃÃá»áº¾á»á»áº¼Äá¸á¸ÄÄÃẺÄÈÈẸá»È¨á¸Äá¸á¸ÆÆ"},{base:"F",letters:"Fâ»ï¼¦á¸Æê»"},{base:"G",letters:"Gâ¼ï¼§Ç´ÄḠÄÄ Ç¦Ä¢Ç¤Æê ê½ê¾"},{base:"H",letters:"Hâ½ï¼¨Ä¤á¸¢á¸¦ÈḤḨḪĦⱧⱵê"},{base:"I",letters:"Iâ¾ï¼©ÃÃÃĨĪĬİÃḮá»ÇÈÈá»Ä®á¸¬Æ"},{base:"J",letters:"Jâ¿ï¼ªÄ´É"},{base:"K",letters:"KâKḰǨḲĶḴÆâ±©êêêê¢"},{base:"L",letters:"LâLĿĹĽḶḸĻḼḺÅȽⱢⱠêêê"},{base:"LJ",letters:"Ç"},{base:"Lj",letters:"Ç"},{base:"M",letters:"Mâï¼á¸¾á¹á¹â±®Æ"},{base:"N",letters:"NâNǸÅÃá¹Åá¹Å
á¹á¹È Æêê¤"},{base:"NJ",letters:"Ç"},{base:"Nj",letters:"Ç"},{base:"O",letters:"OâOÃÃÃá»á»á»á»Ãá¹È¬á¹Åá¹á¹ÅȮȰÃȪá»ÅÇÈÈÆ á»á»á» á»á»¢á»á»ÇªÇ¬ÃÇ¾ÆÆêê"},{base:"OI",letters:"Æ¢"},{base:"OO",letters:"ê"},{base:"OU",letters:"È¢"},{base:"P",letters:"Pâ
ï¼°á¹á¹Æ¤â±£êêê"},{base:"Q",letters:"Qâï¼±êêÉ"}
vendor: 3,876 bytes, line 5804
5804,{base:"R",letters:"Râï¼²Åá¹ÅÈÈá¹á¹Åá¹ÉⱤêê¦ê"},{base:"S",letters:"Sâï¼³áºÅṤÅṠŠṦṢṨÈÅâ±¾ê¨ê"},{base:"T",letters:"TâTṪŤṬÈŢṰṮŦƬƮȾê"},{base:"TZ",letters:"ê¨"},{base:"U",letters:"Uâï¼µÃÃÃŨṸŪṺŬÃÇÇÇÇỦŮŰÇÈÈÆ¯á»ªá»¨á»®á»¬á»°á»¤á¹²Å²á¹¶á¹´É"},{base:"V",letters:"VâVṼṾƲêÉ
"},{base:"VY",letters:"ê "},{base:"W",letters:"Wâï¼·áºáºÅ´áºáºáºâ±²"},{base:"X",letters:"XâXáºáº"},{base:"Y",letters:"YâYỲÃŶỸȲáºÅ¸á»¶á»´Æ³ÉỾ"},{base:"Z",letters:"ZâZŹáºÅ»Å½áºáºÆµÈ¤â±¿â±«ê¢"},{base:"a",letters:"aâï½áºÃ áâầấẫẩãÄÄằắẵẳȧǡäÇảåǻÇÈÈạáºáº·á¸Ä
â±¥É"},{base:"aa",letters:"ê³"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"êµ"},{base:"au",letters:"ê·"},{base:"av",letters:"ê¹ê»"},{base:"ay",letters:"ê½"},{base:"b",letters:"bâï½á¸á¸
á¸ÆÆÉ"},{base:"c",letters:"câï½ÄÄÄÄÃ§á¸ÆÈ¼ê¿â"},{base:"d",letters:"dâï½á¸Äá¸á¸á¸á¸ÄÆÉÉêº"},{base:"dz",letters:"dzÇ"},{base:"e",letters:"eâï½
èéêá»áº¿á»
á»áº½Äá¸á¸ÄÄëẻÄÈ
Èẹá»È©á¸Äá¸á¸ÉÉÇ"},{base:"f",letters:"fâï½á¸Æê¼"},{base:"g",letters:"gâï½ÇµÄḡÄÄ¡Ç§Ä£Ç¥É ê¡áµ¹ê¿"},{base:"h",letters:"hâï½Ä¥á¸£á¸§ÈḥḩḫáºÄ§â±¨â±¶É¥"},{base:"hv",letters:"Æ"},{base:"i",letters:"iâï½Ã¬ÃîĩīÄïḯá»ÇÈÈá»Ä¯á¸É¨Ä±"},{base:"j",letters:"jâï½ÄµÇ°É"},{base:"k",letters:"kâï½á¸±Ç©á¸³Ä·á¸µÆâ±ªêêê
ê£"},{base:"l",letters:"lâï½ÅÄºÄ¾á¸·á¸¹Ä¼á¸½á¸»Å¿ÅÆÉ«â±¡êêê"},{base:"lj",letters:"Ç"},{base:"m",letters:"mâï½á¸¿á¹á¹É±É¯"},{base:"n",letters:"nâï½Ç¹Åñá¹
Åá¹Åá¹á¹ÆÉ²Åêê¥"},{base:"nj",letters:"Ç"},{base:"o",letters:"oâï½Ã²Ã³Ã´á»á»á»á»Ãµá¹Èá¹Åá¹á¹Åȯȱöȫá»ÅÇÈÈÆ¡á»á»á»¡á»á»£á»á»Ç«ÇøǿÉêêɵ"},{base:"oi",letters:"Æ£"},{base:"ou",letters:"È£"},{base:"oo",letters:"ê"},{base:"p",letters:"pâï½á¹á¹Æ¥áµ½êêê"},{base:"q",letters:"qâ ï½Éêê"},{base:"r",letters:"râ¡ï½Åá¹ÅÈÈá¹á¹Åá¹Éɽêê§ê"},{base:"s",letters:"sâ¢ï½ÃÅá¹¥ÅṡšṧṣṩÈÅÈ¿ê©ê
áº"},{base:"t",letters:"tâ£ï½á¹«áºÅ¥á¹ÈţṱṯŧÆÊⱦê"},{base:"tz",letters:"ê©"},{base:"u",letters:"uâ¤ï½Ã¹ÃºÃ»Å©á¹¹Å«á¹»ÅüÇÇÇÇủůűÇÈÈÆ°á»«á»©á»¯á»á»±á»¥á¹³Å³á¹·á¹µÊ"},{base:"v",letters:"vâ¥ï½á¹½á¹¿ÊêÊ"},{base:"vy",letters:"ê¡"},{base:"w",letters:"wâ¦ï½áºáºÅµáºáº
áºáºâ±³"},{base:"x",letters:"xâ§ï½áºáº"},{base:"y",letters:"yâ¨ï½á»³Ã½Å·á»¹È³áºÃ¿á»·áºá»µÆ´Éỿ"},{base:"z",letters:"zâ©ï½ÅºáºÅ¼Å¾áºáºÆ¶È¥Éⱬê£"}],Tht=new RegExp("["+GU.map(function(n){return n.letters}).join("")+"]","g"),O1e={};for(var DO=0;DO<GU.length;DO++)for(var jO=GU[DO],IO=0;IO<jO.letters.length;IO++)O1e[jO.letters[IO]]=jO.base;var D1e=function(e){return e.replace(Tht,function(t){return O1e[t]})},Eht=L1e(D1e),ane=function(e){return e.replace(/^\s+|\s+$/g,"")},Cht=function(e){return"".concat(e.label," ").concat(e.value)},Nht=function(e){return function(t,r){if(t.data.__isNew__)return!0;var i=Ar({ignoreCase:!0,ignoreAccents:!0,stringify:Cht,trim:!0,matchFrom:"any"},e),s=i.ignoreCase,a=i.ignoreAccents,o=i.stringify,l=i.trim,u=i.matchFrom,d=l?ane(r):r,h=l?ane(o(t)):o(t);return s&&(d=d.toLowerCase(),h=h.toLowerCase()),a&&(d=Eht(d),h=D1e(h)),u==="start"?h.substr(0,d.length)===d:h.indexOf(d)>-1}},Mht=["innerRef"];function kht(n){var e=n.innerRef,t=xu(n,Mht),r=idt(t,"onExited","in","enter","exit","appear");return Cr("input",er({ref:e},r,{css:Jq({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Rht=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Pht(n){var e=n.isEnabled,t=n.onBottomArrive,r=n.onBottomLeave,
5804i=n.onTopArrive,s=n.onTopLeave,a=G.useRef(!1),o=G.useRef(!1),l=G.useRef(0),u=G.useRef(null),d=G.useCallback(function(x,b){if(u.current!==null){var _=u.current,M=_.scrollTop,T=_.scrollHeight,L=_.clientHeight,D=u.current,P=b>0,O=T-L-M,F=!1;O>b&&a.current&&(r&&r(x),a.current=!1),P&&o.current&&(s&&s(x),o.current=!1),P&&b>O?(t&&!a.current&&t(x),D.scrollTop=T,F=!0,a.current=!0):!P&&-b>M&&(i&&!o.current&&i(x),D.scrollTop=0,F=!0,o.current=!0),F&&Rht(x)}},[t,r,i,s]),h=G.useCallback(function(x){d(x,x.deltaY)},[d]),f=G.useCallback(function(x){l.current=x.changedTouches[0].clientY},[]),p=G.useCallback(function(x){var b=l.current-x.changedTouches[0].clientY;d(x,b)},[d]),g=G.useCallback(function(x){if(x){var b=tdt?{passive:!1}:!1;x.addEventListener("wheel",h,b),x.addEventListener("touchstart",f,b),x.addEventListener("touchmove",p,b)}},[p,f,h]),A=G.useCallback(function(x){x&&(x.removeEventListener("wheel",h,!1),x.removeEventListener("touchstart",f,!1),x.removeEventListener("touchmove",p,!1))},[p,f,h]);return G.useEffect(function(){if(e){var x=u.current;return g(x),function(){A(x)}}},[e,g,A]),function(x){u.current=x}}var one=["boxSizing","height","overflow","paddingRight","position"],lne={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function cne(n){n.cancelable&&n.preventDefault()}function une(n){n.stopPropagation()}function dne(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function hne(){return"ontouchstart"in window||navigator.maxTouchPoints}var fne=!!(typeof window<"u"&&window.document&&window.document.createElement),cS=0,W2={capture:!1,passive:!1};function Lht(n){var e=n.isEnabled,t=n.accountForScrollbars,r=t===void 0?!0:t,i=G.useRef({}),s=G.useRef(null),a=G.useCallback(function(l){if(fne){var u=document.body,d=u&&u.style;if(r&&one.forEach(function(g){var A=d&&d[g];i.current[g]=A}),r&&cS<1){var h=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,p=window.innerWidth-f+h||0;Object.keys(lne).forEach(function(g){var A=lne[g];d&&(d[g]=A)}),d&&(d.paddingRight="".concat(p,"px"))}u&&hne()&&(u.addEventListener("touchmove",cne,W2),l&&(l.addEventListener("touchstart",dne,W2),l.addEventListener("touchmove",une,W2))),cS+=1}},[r]),o=G.useCallback(function(l){if(fne){var u=document.body,d=u&&u.style;cS=Math.max(cS-1,0),r&&cS<1&&one.forEach(function(h){var f=i.current[h];d&&(d[h]=f)}),u&&hne()&&(u.removeEventListener("touchmove",cne,W2),l&&(l.removeEventListener("touchstart",dne,W2),l.removeEventListener("touchmove",une,W2)))}},[r]);return G.useEffect(function(){if(e){var l=s.current;return a(l),function(){o(l)}}},[e,a,o]),function(l){s.current=l}}var Oht=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Dht={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function jht(n){var e=n.children,t=n.lockEnabled,r=n.captureEnabled,i=r===void 0?!0:r,s=n.onBottomArrive,a=n.onBottomLeave,o=n.onTopArrive,l=n.onTopLeave,u=Pht({isEnabled:i,onBottomArrive:s,onBottomLeave:a,onTopArrive:o,onTopLeave:l}),d=Lht({isEnabled:t}),h=function(p){u(p),d(p)};return Cr(G.Fragment,null,t&&Cr("div",{onClick:Oht,css:Dht}),e(h))}var Iht={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Fht=function(e){var t=e.name,r=e.onFocus;return Cr("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Iht,value:"",onChange:function(){}})},Uht=Fht;function i$(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function Bht(){return i$(/^iPhone/i)}function j1e(){return i$(/^Mac/i)}function Vht(){return i$(/^iPad/i)||j1e()&&navigator.maxTouchPoints>1}function zht(){return Bht()||Vht()}function Ght(){return j1e()||zht()}var qht=function(e){return e.label},$ht=function(e){return e.label},Hht=function(e){return e.value},Wht=function(e){return!!e.isDisabled},Xht={clearIndicator:Pdt,container:bdt,control:Udt,dropdownIndicator:kdt,group:Gdt,groupHeading:$dt,indicatorsContainer:Tdt,indicatorSeparator:Odt,input:Ydt,loadingIndicator:Idt,loadingMessage:gdt,menu:cdt,menuList:fdt,menuPortal:vdt,multiValue:eht,multiValueLabel:tht,multiValueRemove:nht,noOptionsMessage:mdt,option:lht,placeholder:dht,singleValue:pht,valueContainer:_dt},Yht={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Qht=4,I1e=4,Kht=38,Zht=I1e*2,Jht={baseUnit:I1e,controlHeight:Kht,menuGutter:Zht},FO={borderRadius:Qht,colors:Yht,spacing:Jht},eft={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:nne(),captureMenuScroll:!nne(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Nht(),formatGroupLabel:qht,getOptionLabel:$ht,getOptionValue:Hht,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Wht,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Jut(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function pne(n,e,t,r){var i=B1e(n,e,t),s=V1e(n,e,t),a=U1e(n,e),o=h8(n,e);return{type:"option",data:e,isDisabled:i,isSelected:s,label:a,value:o,index:r}}function $6(n,e){return n.options.map(function(t,r){if("options"in t){var i=t.o
5804ptions.map(function(a,o){return pne(n,a,e,o)}).filter(function(a){return gne(n,a)});return i.length>0?{type:"group",data:t,options:i,index:r}:void 0}var s=pne(n,t,e,r);return gne(n,s)?s:void 0}).filter(ndt)}function F1e(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,Xq(t.options.map(function(r){return r.data}))):e.push(t.data),e},[])}function mne(n,e){return n.reduce(function(t,r){return r.type==="group"?t.push.apply(t,Xq(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):t.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),t},[])}function tft(n,e){return F1e($6(n,e))}function gne(n,e){var t=n.inputValue,r=t===void 0?"":t,i=e.data,s=e.isSelected,a=e.label,o=e.value;return(!G1e(n)||!s)&&z1e(n,{label:a,value:o,data:i},r)}function nft(n,e){var t=n.focusedValue,r=n.selectValue,i=r.indexOf(t);if(i>-1){var s=e.indexOf(t);if(s>-1)return t;if(i<e.length)return e[i]}return null}function rft(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var UO=function(e,t){var r,i=(r=e.find(function(s){return s.data===t}))===null||r===void 0?void 0:r.id;return i||null},U1e=function(e,t){return e.getOptionLabel(t)},h8=function(e,t){return e.getOptionValue(t)};function B1e(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function V1e(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var r=h8(n,e);return t.some(function(i){return h8(n,i)===r})}function z1e(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var G1e=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return t===void 0?r:t},ift=1,q1e=(function(n){Rct(t,n);var e=Lct(t);function t(r){var i;if(Mct(this,t),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var d=i.props,h=d.onChange,f=d.name;u.name=f,i.ariaOnChange(l,u),h(l,u)},i.setValue=function(l,u,d){var h=i.props,f=h.closeMenuOnSelect,p=h.isMulti,g=h.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:g}),f&&(i.setState({inputIsHiddenAfterUpdate:!p}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:d})},i.selectOption=function(l){var u=i.props,d=u.blurInputOnSelect,h=u.isMulti,f=u.name,p=i.state.selectValue,g=h&&i.isOptionSelected(l,p),A=i.isOptionDisabled(l,p);if(g){var x=i.getOptionValue(l);i.setValue(p.filter(function(b){return i.getOptionValue(b)!==x}),"deselect-option",l)}else if(!A)h?i.setValue([].concat(Xq(p),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:f});return}d&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,d=i.state.selectValue,h=i.getOptionValue(l),f=d.filter(function(g){return i.getOptionValue(g)!==h}),p=$N(u,f,f[0]||null);i.onChange(p,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange($N(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,d=u[u.length-1],h=u.slice(0,u.length-1),f=$N(l,h,h[0]||null);d&&i.onChange(f,{action:"pop-value",removedValue:d})},i.getFocusedOptionId=function(l){return UO(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return mne($6(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];return Xut.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return U1e(i.props,l)},i.getOptionValue=function(l){return h8(i.props,l)},i.getStyles=function(l,u){var d=i.props.unstyled,h=Xht[l](u,d);h.boxSizing="border-box";var f=i.props.styles[l];return f?f(h,u):h},i.getClassNames=function(l,u){var d,h;return(d=(h=i.props.classNames)[l])===null||d===void 0?void 0:d.call(h,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return P1e(i.props)},i.buildCategorizedOptions=function(){return $6(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return F1e(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Ar({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,d=u.isMulti,h=u.menuIsOpen;i.focusInput(),h?(i.setState({inputIsHiddenAfterUpdate:!d}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&hP(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,d=u&&u.item(0);d&&(i.initialTouchX=d.clientX,i.initialTouchY=d.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,d=u&&u.item(0);if(d){var h=Math.abs(d.clientX-i.initialTouchX),f=Math.abs(d.clientY-i.initialTouchY),p=5;i.userIsDragging=h>p||f>p}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,d=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(d,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),d=u.indexOf(l);
5804i.setState({focusedOption:l,focusedOptionId:d>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return G1e(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,d=u.isMulti,h=u.backspaceRemovesValue,f=u.escapeClearsValue,p=u.inputValue,g=u.isClearable,A=u.isDisabled,x=u.menuIsOpen,b=u.onKeyDown,_=u.tabSelectsValue,M=u.openMenuOnFocus,T=i.state,L=T.focusedOption,D=T.focusedValue,P=T.selectValue;if(!A&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!d||p)return;i.focusValue("previous");break;case"ArrowRight":if(!d||p)return;i.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(D)i.removeValue(D);else{if(!h)return;d?i.popValue():g&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!x||!_||!L||M&&i.isOptionSelected(L,P))return;i.selectOption(L);break;case"Enter":if(l.keyCode===229)break;if(x){if(!L||i.isComposing)return;i.selectOption(L);break}return;case"Escape":x?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:p}),i.onMenuClose()):g&&f&&i.clearValue();break;case" ":if(p)return;if(!x){i.openMenu("first");break}if(!L)return;i.selectOption(L);break;case"ArrowUp":x?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":x?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!x)return;i.focusOption("pageup");break;case"PageDown":if(!x)return;i.focusOption("pagedown");break;case"Home":if(!x)return;i.focusOption("first");break;case"End":if(!x)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++ift),i.state.selectValue=ene(r.value),r.menuIsOpen&&i.state.selectValue.length){var s=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),o=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=s,i.state.focusedOption=a[o],i.state.focusedOptionId=UO(s,a[o])}return i}return kct(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&tne(this.menuListRef,this.focusedOptionRef),Ght()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var s=this.props,a=s.isDisabled,o=s.menuIsOpen,l=this.state.isFocused;(l&&!a&&i.isDisabled||l&&o&&!i.menuIsOpen)&&this.focusInput(),l&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(tne(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,s){this.props.onInputChange(i,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var s=this,a=this.state,o=a.selectValue,l=a.isFocused,u=this.buildFocusableOptions(),d=i==="first"?0:u.length-1;if(!this.props.isMulti){var h=u.indexOf(o[0]);h>-1&&(d=h)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[d],focusedOptionId:this.getFocusedOptionId(u[d])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(i){var s=this.state,a=s.selectValue,o=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(o);o||(l=-1);var u=a.length-1,d=-1;if(a.length){switch(i){case"previous":l===0?d=0:l===-1?d=u:d=l-1;break;case"next":l>-1&&l<u&&(d=l+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:a[d]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,a=this.state.focusedOption,o=this.getFocusableOptions();if(o.length){var l=0,u=o.indexOf(a);a||(u=-1),i==="up"?l=u>0?u-1:o.length-1:i==="down"?l=(u+1)%o.length:i==="pageup"?(l=u-s,l<0&&(l=0)):i==="pagedown"?(l=u+s,l>o.length-1&&(l=o.length-1)):i==="last"&&(l=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(o[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(FO):Ar(Ar({},FO),this.props.theme):FO})},{key:"getCommonProps",value:function(){var i=this.clearValue,s=this.cx,a=this.getStyles,o=this.getClassNames,l=this.getValue,u=this.selectOption,d=this.setValue,h=this.props,f=h.isMulti,p=h.isRtl,g=h.options,A=this.hasValue();return{clearValue:i,cx:s,getStyles:a,getClassNames:o,getValue:l,hasValue:A,isMulti:f,isRtl:p,options:g,selectOption:u,selectProps:h,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,s=i.isClearable,a=i.isMulti;return s===void 0?a:s}},{key:"isOptionDisabled",value:function(i,s){return B1e(this.props,i,s)}},{key:"isOptionSelected",value:function(i,s){return V1e(this.props,i,s)}},{key:"filterOption",value:function(i,s){return z1e(this.props,i,s)}},{key:"formatOptionLabel",value:function(i,s){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,o=this.state.selectValue;return this.props.formatOptionLabel(i,{context:s,inputValue:a,selectValue:o})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var i=this.props,s=i.isDisabled,a=i.isSearchable,o=i.inputId,l=i.inputValue,u=i.tabIndex,d=i.form,h=i.menuIsOpen,f=i.required,p=this.getComponents(),g=p.Input,A=this.state,x=A.inputIsHidden,b=A.ariaSelection,_=this.commonProps,M=o||this.getElementId("input"),T=Ar(Ar(Ar({"aria-autocomplete":"list","aria-expanded":h,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},h&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(b==null?void 0:b.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?G.createElement(g,er({},_,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:M,innerRef:this.getInputRef,isDisabled:s,isHidden:x,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:d,type:"text",value:l}
vendor: 5,678 bytes, line 5804
5804,T)):G.createElement(kht,er({id:M,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:u8,onFocus:this.onInputFocus,disabled:s,tabIndex:u,inputMode:"none",form:d,value:""},T))})},{key:"renderPlaceholderOrValue",value:function(){var i=this,s=this.getComponents(),a=s.MultiValue,o=s.MultiValueContainer,l=s.MultiValueLabel,u=s.MultiValueRemove,d=s.SingleValue,h=s.Placeholder,f=this.commonProps,p=this.props,g=p.controlShouldRenderValue,A=p.isDisabled,x=p.isMulti,b=p.inputValue,_=p.placeholder,M=this.state,T=M.selectValue,L=M.focusedValue,D=M.isFocused;if(!this.hasValue()||!g)return b?null:G.createElement(h,er({},f,{key:"placeholder",isDisabled:A,isFocused:D,innerProps:{id:this.getElementId("placeholder")}}),_);if(x)return T.map(function(O,F){var U=O===L,B="".concat(i.getOptionLabel(O),"-").concat(i.getOptionValue(O));return G.createElement(a,er({},f,{components:{Container:o,Label:l,Remove:u},isFocused:U,isDisabled:A,key:B,index:F,removeProps:{onClick:function(){return i.removeValue(O)},onTouchEnd:function(){return i.removeValue(O)},onMouseDown:function(H){H.preventDefault()}},data:O}),i.formatOptionLabel(O,"value"))});if(b)return null;var P=T[0];return G.createElement(d,er({},f,{data:P,isDisabled:A}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),s=i.ClearIndicator,a=this.commonProps,o=this.props,l=o.isDisabled,u=o.isLoading,d=this.state.isFocused;if(!this.isClearable()||!s||l||!this.hasValue()||u)return null;var h={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return G.createElement(s,er({},a,{innerProps:h,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),s=i.LoadingIndicator,a=this.commonProps,o=this.props,l=o.isDisabled,u=o.isLoading,d=this.state.isFocused;if(!s||!u)return null;var h={"aria-hidden":"true"};return G.createElement(s,er({},a,{innerProps:h,isDisabled:l,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),s=i.DropdownIndicator,a=i.IndicatorSeparator;if(!s||!a)return null;var o=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return G.createElement(a,er({},o,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),s=i.DropdownIndicator;if(!s)return null;var a=this.commonProps,o=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return G.createElement(s,er({},a,{innerProps:u,isDisabled:o,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,s=this.getComponents(),a=s.Group,o=s.GroupHeading,l=s.Menu,u=s.MenuList,d=s.MenuPortal,h=s.LoadingMessage,f=s.NoOptionsMessage,p=s.Option,g=this.commonProps,A=this.state.focusedOption,x=this.props,b=x.captureMenuScroll,_=x.inputValue,M=x.isLoading,T=x.loadingMessage,L=x.minMenuHeight,D=x.maxMenuHeight,P=x.menuIsOpen,O=x.menuPlacement,F=x.menuPosition,U=x.menuPortalTarget,B=x.menuShouldBlockScroll,z=x.menuShouldScrollIntoView,H=x.noOptionsMessage,X=x.onMenuScrollToTop,W=x.onMenuScrollToBottom;if(!P)return null;var J=function(_e,Ee){var Ae=_e.type,te=_e.data,ve=_e.isDisabled,we=_e.isSelected,Ue=_e.label,ze=_e.value,yt=A===te,mt=ve?void 0:function(){return i.onOptionHover(te)},bt=ve?void 0:function(){return i.selectOption(te)},dt="".concat(i.getElementId("option"),"-").concat(Ee),St={id:dt,onClick:bt,onMouseMove:mt,onMouseOver:mt,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:we};return G.createElement(p,er({},g,{innerProps:St,data:te,isDisabled:ve,isSelected:we,key:dt,label:Ue,type:Ae,value:ze,isFocused:yt,innerRef:yt?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(_e.data,"menu"))},ee;if(this.hasOptions())ee=this.getCategorizedOptions().map(function(re){if(re.type==="group"){var _e=re.data,Ee=re.options,Ae=re.index,te="".concat(i.getElementId("group"),"-").concat(Ae),ve="".concat(te,"-heading");return G.createElement(a,er({},g,{key:te,data:_e,options:Ee,Heading:o,headingProps:{id:ve,data:re.data},label:i.formatGroupLabel(re.data)}),re.options.map(function(we){return J(we,"".concat(Ae,"-").concat(we.index))}))}else if(re.type==="option")return J(re,"".concat(re.index))});else if(M){var ae=T({inputValue:_});if(ae===null)return null;ee=G.createElement(h,g,ae)}else{var le=H({inputValue:_});if(le===null)return null;ee=G.createElement(f,g,le)}var Z={minMenuHeight:L,maxMenuHeight:D,menuPlacement:O,menuPosition:F,menuShouldScrollIntoView:z},Y=G.createElement(udt,er({},g,Z),function(re){var _e=re.ref,Ee=re.placerProps,Ae=Ee.placement,te=Ee.maxHeight;return G.createElement(l,er({},g,Z,{innerRef:_e,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:M,placement:Ae}),G.createElement(jht,{captureEnabled:b,onTopArrive:X,onBottomArrive:W,lockEnabled:B},function(ve){return G.createElement(u,er({},g,{innerRef:function(Ue){i.getMenuListRef(Ue),ve(Ue)},innerProps:{role:"listbox","aria-multiselectable":g.isMulti,id:i.getElementId("listbox")},isLoading:M,maxHeight:te,focusedOption:A}),ee)}))});return U||F==="fixed"?G.createElement(d,er({},g,{appendTo:U,controlElement:this.controlRef,menuPlacement:O,menuPosition:F}),Y):Y}},{key:"renderFormField",value:function(){var i=this,s=this.props,a=s.delimiter,o=s.isDisabled,l=s.isMulti,u=s.name,d=s.required,h=this.state.selectValue;if(d&&!this.hasValue()&&!o)return G.createElement(Uht,{name:u,onFocus:this.onValueInputFocus});if(!(!u||o))if(l)if(a){var f=h.map(function(A){return i.getOptionValue(A)}).join(a);return G.createElement("input",{name:u,type:"hidden",value:f})}
5804else{var p=h.length>0?h.map(function(A,x){return G.createElement("input",{key:"i-".concat(x),name:u,type:"hidden",value:i.getOptionValue(A)})}):G.createElement("input",{name:u,type:"hidden",value:""});return G.createElement("div",null,p)}else{var g=h[0]?this.getOptionValue(h[0]):"";return G.createElement("input",{name:u,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,s=this.state,a=s.ariaSelection,o=s.focusedOption,l=s.focusedValue,u=s.isFocused,d=s.selectValue,h=this.getFocusableOptions();return G.createElement(Sht,er({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:o,focusedValue:l,isFocused:u,selectValue:d,focusableOptions:h,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),s=i.Control,a=i.IndicatorsContainer,o=i.SelectContainer,l=i.ValueContainer,u=this.props,d=u.className,h=u.id,f=u.isDisabled,p=u.menuIsOpen,g=this.state.isFocused,A=this.commonProps=this.getCommonProps();return G.createElement(o,er({},A,{className:d,innerProps:{id:h,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:g}),this.renderLiveRegion(),G.createElement(s,er({},A,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:g,menuIsOpen:p}),G.createElement(l,er({},A,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),G.createElement(a,er({},A,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,s){var a=s.prevProps,o=s.clearFocusValueOnUpdate,l=s.inputIsHiddenAfterUpdate,u=s.ariaSelection,d=s.isFocused,h=s.prevWasFocused,f=s.instancePrefix,p=i.options,g=i.value,A=i.menuIsOpen,x=i.inputValue,b=i.isMulti,_=ene(g),M={};if(a&&(g!==a.value||p!==a.options||A!==a.menuIsOpen||x!==a.inputValue)){var T=A?tft(i,_):[],L=A?mne($6(i,_),"".concat(f,"-option")):[],D=o?nft(s,_):null,P=rft(s,T),O=UO(L,P);M={selectValue:_,focusedOption:P,focusedOptionId:O,focusableOptionsWithIds:L,focusedValue:D,clearFocusValueOnUpdate:!1}}var F=l!=null&&i!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},U=u,B=d&&h;return d&&!B&&(U={value:$N(b,_,_[0]||null),options:_,action:"initial-input-focus"},B=!h),(u==null?void 0:u.action)==="initial-input-focus"&&(U=null),Ar(Ar(Ar({},M),F),{},{prevProps:i,ariaSelection:U,prevWasFocused:B})}}]),t})(G.Component);q1e.defaultProps=eft;var sft=G.forwardRef(function(n,e){var t=Nct(n);return G.createElement(q1e,er({ref:e},t))}),aft=sft;const Ane={disabled:!1},f8=jn.createContext(null);var oft=function(e){return e.scrollTop},$S="unmounted",Wx="exited",Xx="entering",ab="entered",qU="exiting",V0=(function(n){Tq(e,n);function e(r,i){var s;s=n.call(this,r,i)||this;var a=i,o=a&&!a.isMounting?r.enter:r.appear,l;return s.appearStatus=null,r.in?o?(l=Wx,s.appearStatus=Xx):l=ab:r.unmountOnExit||r.mountOnEnter?l=$S:l=Wx,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(i,s){var a=i.in;return a&&s.status===$S?{status:Wx}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(i){var s=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Xx&&a!==ab&&(s=Xx):(a===Xx||a===ab)&&(s=qU)}this.updateStatus(!1,s)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var i=this.props.timeout,s,a,o;return s=a=o=i,i!=null&&typeof i!="number"&&(s=i.exit,a=i.enter,o=i.appear!==void 0?i.appear:a),{exit:s,enter:a,appear:o}},t.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===Xx){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:fS.findDOMNode(this);a&&oft(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Wx&&this.setState({status:$S})},t.performEnter=function(i){var s=this,a=this.props.enter,o=this.context?this.context.
vendor: 3,204 bytes, line 5804
5804isMounting:i,l=this.props.nodeRef?[o]:[fS.findDOMNode(this),o],u=l[0],d=l[1],h=this.getTimeouts(),f=o?h.appear:h.enter;if(!i&&!a||Ane.disabled){this.safeSetState({status:ab},function(){s.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Xx},function(){s.props.onEntering(u,d),s.onTransitionEnd(f,function(){s.safeSetState({status:ab},function(){s.props.onEntered(u,d)})})})},t.performExit=function(){var i=this,s=this.props.exit,a=this.getTimeouts(),o=this.props.nodeRef?void 0:fS.findDOMNode(this);if(!s||Ane.disabled){this.safeSetState({status:Wx},function(){i.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:qU},function(){i.props.onExiting(o),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Wx},function(){i.props.onExited(o)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},t.setNextCallback=function(i){var s=this,a=!0;return this.nextCallback=function(o){a&&(a=!1,s.nextCallback=null,i(o))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},t.onTransitionEnd=function(i,s){this.setNextCallback(s);var a=this.props.nodeRef?this.props.nodeRef.current:fS.findDOMNode(this),o=i==null&&!this.props.addEndListener;if(!a||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},t.render=function(){var i=this.state.status;if(i===$S)return null;var s=this.props,a=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var o=Wq(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return jn.createElement(f8.Provider,{value:null},typeof a=="function"?a(i,o):jn.cloneElement(jn.Children.only(a),o))},e})(jn.Component);V0.contextType=f8;V0.propTypes={};function X2(){}V0.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:X2,onEntering:X2,onEntered:X2,onExit:X2,onExiting:X2,onExited:X2};V0.UNMOUNTED=$S;V0.EXITED=Wx;V0.ENTERING=Xx;V0.ENTERED=ab;V0.EXITING=qU;function s$(n,e){var t=function(s){return e&&G.isValidElement(s)?e(s):s},r=Object.create(null);return n&&G.Children.map(n,function(i){return i}).forEach(function(i){r[i.key]=t(i)}),r}function lft(n,e){n=n||{},e=e||{};function t(d){return d in e?e[d]:n[d]}var r=Object.create(null),i=[];for(var s in n)s in e?i.length&&(r[s]=i,i=[]):i.push(s);var a,o={};for(var l in e){if(r[l])for(a=0;a<r[l].length;a++){var u=r[l][a];o[r[l][a]]=t(u)}o[l]=t(l)}for(a=0;a<i.length;a++)o[i[a]]=t(i[a]);return o}function bv(n,e,t){return t[e]!=null?t[e]:n.props[e]}function cft(n,e){return s$(n.children,function(t){return G.cloneElement(t,{onExited:e.bind(null,t),in:!0,appear:bv(t,"appear",n),enter:bv(t,"enter",n),exit:bv(t,"exit",n)})})}function uft(n,e,t){var r=s$(n.children),i=lft(e,r);
5804return Object.keys(i).forEach(function(s){var a=i[s];if(G.isValidElement(a)){var o=s in e,l=s in r,u=e[s],d=G.isValidElement(u)&&!u.props.in;l&&(!o||d)?i[s]=G.cloneElement(a,{onExited:t.bind(null,a),in:!0,exit:bv(a,"exit",n),enter:bv(a,"enter",n)}):!l&&o&&!d?i[s]=G.cloneElement(a,{in:!1}):l&&o&&G.isValidElement(u)&&(i[s]=G.cloneElement(a,{onExited:t.bind(null,a),in:u.props.in,exit:bv(a,"exit",n),enter:bv(a,"enter",n)}))}}),i}var dft=Object.values||function(n){return Object.keys(n).map(function(e){return n[e]})},hft={component:"div",childFactory:function(e){return e}},fP=(function(n){Tq(e,n);function e(r,i){var s;s=n.call(this,r,i)||this;var a=s.handleExited.bind(Sq(s));return s.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},s}var t=e.prototype;return t.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},t.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(i,s){var a=s.children,o=s.handleExited,l=s.firstRender;return{children:l?cft(i,o):uft(i,a,o),firstRender:!1}},t.handleExited=function(i,s){var a=s$(this.props.children);i.key in a||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(o){var l=er({},o.children);return delete l[i.key],{children:l}}))},t.render=function(){var i=this.props,s=i.component,a=i.childFactory,o=Wq(i,["component","childFactory"]),l=this.state.contextValue,u=dft(this.state.children).map(a);return delete o.appear,delete o.enter,delete o.exit,s===null?jn.createElement(f8.Provider,{value:l},u):jn.createElement(f8.Provider,{value:l},jn.createElement(s,o,u))},e})(jn.Component);fP.propTypes={};fP.defaultProps=hft;var fft=["in","onExited","appear","enter","exit"],pft=function(e){return function(t){t.in,t.onExited,t.appear,t.enter,t.exit;var r=xu(t,fft);return G.createElement(e,r)}},mft=pft,gft=["component","duration","in","onExited"],$1e=function(e){var t=e.component,r=e.duration,i=r===void 0?1:r,s=e.in;e.onExited;var a=xu(e,gft),o=G.useRef(null),l={entering:{opacity:0},entered:{opacity:1,transition:"opacity ".concat(i,"ms")},exiting:{opacity:0},exited:{opacity:0}};return G.createElement(V0,{mountOnEnter:!0,unmountOnExit:!0,in:s,timeout:i,nodeRef:o},function(u){var d={style:Ar({},l[u]),ref:o};return G.createElement(t,er({innerProps:d},a))})},$U=260,Aft=function(e){var t=e.children,r=e.in,i=e.onExited,s=G.useRef(null),a=G.useState("auto"),o=Gh(a,2),l=o[0],u=o[1];G.useEffect(function(){var h=s.current;if(h){var f=window.requestAnimationFrame(function(){return u(h.getBoundingClientRect().width)});return function(){return window.cancelAnimationFrame(f)}}},[]);var d=function(f){switch(f){default:return{width:l};case"exiting":return{width:0,transition:"width ".concat($U,"ms ease-out")};case"exited":return{width:0}}};return G.createElement(V0,{enter:!1,mountOnEnter:!0,unmountOnExit:!0,in:r,onExited:function(){var f=s.current;f&&(i==null||i(f))},timeout:$U,nodeRef:s},function(h){return G.createElement("div",{ref:s,style:Ar({overflow:"hidden",whiteSpace:"nowrap"},d(h))},t)})},xft=["in","onExited"],vft=function(e){return function(t){var r=t.in,i=t.onExited,s=xu(t,xft);return G.createElement(Aft,{in:r,onExited:i},G.createElement(e,er({cropWithEllipsis:r},s)))}},yft=vft,bft=function(e){return function(t){return G.createElement($1e,er({component:e,duration:t.isMulti?$U:1},t))}},wft=bft,_ft=function(e){return function(t){return G.createElement($1e,er({component:e},t))}},Sft=_ft,Tft=["component"],Eft=["children"],Cft=function(e){return function(t){return t.isMulti?G.createElement(Nft,er({component:e},t)):G.createElement(fP,er({component:e},t))}},Nft=function(e){var t=e.component,r=xu(e,Tft),i=Mft(r);return G.createElement(fP,er({component:t},i))},Mft=function(e){var t=e.children,r=xu(e,Eft),i=r.isMulti,s=r.hasValue,a=r.innerProps,o=r.selectProps,l=o.components,u=o.controlShouldRenderValue,d=G.useState(i&&u&&s),h=Gh(d,2),f=h[0],p=h[1],g=G.useState(!1),A=Gh(g,2),x=A[0],b=A[1];G.useEffect(function(){s&&!f&&p(!0)},[s,f]),G.useEffect(function(){x&&!s&&f&&p(!1),b(!1)},[x,s,f]);var _=function(){return b(!0)},M=function(P){if(i&&G.isValidElement(P)){if(P.type===l.MultiValue)return G.cloneElement(P,{onExited:_});if(P.type===l.Placeholder&&f)return null}return P},T=Ar(Ar({},a),{},{style:Ar(Ar({},a==null?void 0:a.style),{},{display:i&&s||f?"flex":"grid"})}),L=Ar(Ar({},r),{},{innerProps:T,children:G.Children.toArray(t).map(M)});return L},kft=Cft,Rft=["Input","MultiValue","Placeholder","SingleValue","ValueContainer"],H1e=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=P1e({components:e}
5804),r=t.Input,i=t.MultiValue,s=t.Placeholder,a=t.SingleValue,o=t.ValueContainer,l=xu(t,Rft);return Ar({Input:mft(r),MultiValue:yft(i),Placeholder:wft(s),SingleValue:Sft(a),ValueContainer:kft(o)},l)},HT=H1e();HT.Input;HT.MultiValue;HT.Placeholder;HT.SingleValue;HT.ValueContainer;var Pft=L1e(H1e),$v=(n=>(n.FREE="free-tier",n.PREMIUM="premium-tier",n.PRO="pro-tier",n.PREMIUM_YEARLY="premium-tier-yearly",n.PRO_YEARLY="pro-tier-yearly",n))($v||{});const Lft=({childToParent:n,value:e,isDisabled:t=!1,onMenuOpen:r,onMenuClose:i})=>{const s=Pft(),a=hi(),{data:o,isLoading:l}=Ma(),u=(o==null?void 0:o.subscriptionPlan)!==null&&(o==null?void 0:o.subscriptionPlan)!==$v.FREE,d=[{value:"facebook",label:a("Facebook Groups"),color:"#1877F2",enabled:!0},{value:"linkedin",label:a("LinkedIn Groups"),color:"#0077B6",enabled:!0},{value:"internet-forums",label:a("Internet Forums"),color:"#7f7f7f",enabled:!0},{value:"discord",label:a("Discord Channels"),color:"#5865F2",enabled:u},{value:"telegram",label:a("Telegram Groups"),color:"#0088cc",enabled:u},{value:"twitter",label:a("Twitter Accounts"),color:"#0019A8",enabled:u},{value:"whatsapp",label:a("Whatsapp Groups"),color:"#25D366",enabled:u}],f=[{value:"all-platforms",label:a("All Platforms"),enabled:!0},...d],p=g=>{g&&g.some(A=>A.value==="all-platforms")?n(d.filter(A=>A.enabled)):n(g)};return c.jsx(aft,{onMenuOpen:r,onMenuClose:i,menuPosition:"fixed",menuPortalTarget:document.body,placeholder:a("Choose the platforms"),noOptionsMessage:()=>a("No more platforms"),theme:g=>({...g,backgroundColor:"transparent",borderRadius:8,color:"white",colors:{...g.colors,primary25:"rgba(207,255,5,0.12)",primary:"#cfff05"}}),styles:{control:(g,A)=>({...g,backgroundColor:"rgba(0,0,0,0.4)",border:A.isFocused?"1px solid rgba(207,255,5,0.6)":"1px solid rgba(255,255,255,0.1)",borderRadius:999,minHeight:52,padding:"0 8px",boxShadow:"none",":hover":{borderColor:"rgba(255,255,255,0.2)"}}),menu:(g,A)=>({...g,backgroundColor:"#0b0d12",border:"1px solid rgba(255,255,255,0.1)",borderRadius:18,overflow:"hidden",color:"white",zIndex:9999}),multiValue:(g,{data:A})=>({...g,backgroundColor:A.color,color:"#fff",borderRadius:999,paddingLeft:4}),multiValueLabel:(g,A)=>({...g,color:"white"}),placeholder:(g,A)=>({...g,color:"rgba(255,255,255,0.35)"}),noOptionsMessage:(g,A)=>({...g,color:"white"})},onChange:p,closeMenuOnSelect:!1,components:s,isMulti:!0,options:f,isOptionDisabled:g=>!g.enabled,value:e,isDisabled:t})};function Oft({checked:n,onChange:e,disabled:t,loading:r}){const i=hi();return c.jsxs("div",{className:`switch-container mb-4${t?" opacity-50 cursor-not-allowed":""}`,style:t?{pointerEvents:"none",userSelect:"none"}:{},children:[c.jsxs("label",{className:"switch",children:[c.jsx("input",{type:"checkbox",checked:n,onChange:s=>e(s.target.checked),disabled:t}),c.jsx("span",{className:"slider"})]}),c.jsx("span",{className:`label-text ${t?"text-gray-400 dark:text-gray-500":"text-gray-900 dark:text-white"}`,children:i(n?"Using AI-recommended platforms for the selected country":"Use AI-recommended platforms for the selected country")}),r&&c.jsxs("svg",{className:"animate-spin ml-2 h-5 w-5 text-green-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"})]})]})}const Dft=()=>{const[n,e]=G.useState(!1),[t,r]=G.useState(null);let i=0;const s="AIzaSyB2ZI2dqbpO8rwUqwN0H5_p93vqgVY5BU8";return{googleSearch:async(o,l,u)=>{e(!0),r(null);try{let d=1;const h=[];for(;h.length<45;){const f={q:o,key:s,cx:l,num:9,start:d};u&&(f.location=u);const p=`https://www.googleapis.com/customsearch/v1?${Object.keys(f).map(x=>`${x}=${encodeURIComponent(f[x])}`).join("&")}`,A=await(await fetch(p)).json();if(A.error)throw new Error(A.error.message);if(!A.items)break;if(h.push(...A.items.map(x=>{var b,_,M;return{id:(i++).toString(),title:x.title,link:x.link,snippet:x.snippet,thumbnail:(M=(_=(b=x.pagemap)==null?void 0:b.cse_image)==null?void 0:_[0])==null?void 0:M.src}})),A.queries.nextPage)d=A.queries.nextPage[0].startIndex;else break}return e(!1),h}catch(d){return console.error("Error fetching search results:",d),r("Error fetching search results"),e(!1),[]}},loading:n,error:t}};let jft=0;const xne=async(n,e)=>{try{const r=await FSe({query:n,next:e}),i=[];return i.push(...r.results.map(s=>{var a,o,l;return{id:(jft++).toString(),title:s.title,link:s.link,snippet:s.snippet,members:1e3,engagement:90,thumbnail:(l=(o=(a=s.pagemap)==null?void 0:a.cse_image)==null?void 0:o[0])==null?void 0:l.src}})),i}catch(t){throw t}};var zp={},HN={},BO,vne;function Ift(){if(vne)return BO;vne=1;var n="Expected a function",e=NaN,t="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,l=typeof jA=="object"&&jA&&jA.Object===Object&&jA,u=typeof self=="object"&&self&&self.Object===Object&&self,d=l||u||Function("return this")(),h=Object.prototype,f=h.toString,p=Math.max,g=Math.min,A=function(){return d.Date.now()};function x(L,D,P){var O,F,U,B,z,H,X=0,W=!1,J=!1,ee=!0;if(typeof L!="function")throw new TypeError(n);D=T(D)||0,b(P)&&(W=!!P.leading,J="maxWait"in P,U=J?p(T(P.maxWait)||0,D):U,ee="trailing"in P?!!P.trailing:ee);function ae(ve){var we=O,Ue=F;return O=F=void 0,X=ve,B=L.apply(Ue,we),B}function le(ve){return X=ve,z=setTimeout(re,D),W?ae(ve):B}function Z(ve){var we=ve-H,Ue=ve-X,ze=D-we;return J?g(ze,U-Ue):ze}function Y(ve){var we=ve-H,Ue=ve-X;return H===void 0||we>=D||we<0||J&&Ue>=U}function re(){var ve=A();if(Y(ve))return _e(ve);z=setTimeout(re,Z(ve))}function _e(ve){return z=void 0,ee&&O?ae(ve):(O=F=void 0,B)}function Ee(){z!==void 0&&clearTimeout(z),X=0,O=H=F=z=void 0}function Ae(){return z===void 0?B:_e(A())}function te(){var ve=A(),we=Y(ve);if(O=arguments,F=this,H=ve,we){if(z===void 0)return le(H);if(J)return z=setTimeout(re,D),ae(H)}return z===void 0&&(z=setTimeout(re,D)),B}return te.cancel=Ee,te.flush=Ae,te}function b(L){var D=typeof L;return!!L&&(D=="object"||D=="function")}function _(L){return!!L&&typeof L=="object"}function M(L){return typeof L=="symbol"||_(L)&&f.call(L)==t}function T(L){if(typeof L=="number")return L;if(M(L))return e;if(b(L)){var D=typeof L.valueOf=="function"?L.valueOf():L;
5804L=b(D)?D+"":D}if(typeof L!="string")return L===0?L:+L;L=L.replace(r,"");var P=s.test(L);return P||a.test(L)?o(L.slice(2),P?2:8):i.test(L)?e:+L}return BO=x,BO}var uS={},yne;function Fft(){return yne||(yne=1,Object.defineProperty(uS,"__esModule",{value:!0}),uS.compose=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){for(var i=arguments.length,s=Array(i),a=0;a<i;a++)s[a]=arguments[a];t.forEach(function(o){return o&&o.apply(void 0,s)})}},uS.pick=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce(function(s,a){return e&&e.hasOwnProperty(a)&&(s[a]=e[a]),s},{})}),uS}var bne;function Uft(){if(bne)return HN;bne=1,Object.defineProperty(HN,"__esModule",{value:!0});var n=Object.assign||function(A){for(var x=1;x<arguments.length;x++){var b=arguments[x];for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(A[_]=b[_])}return A},e=(function(){function A(x,b){for(var _=0;_<b.length;_++){var M=b[_];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,b,_){return b&&A(x.prototype,b),_&&A(x,_),x}})(),t=f_(),r=u(t),i=eAe(),s=u(i),a=Ift(),o=u(a),l=Fft();function u(A){return A&&A.__esModule?A:{default:A}}function d(A,x){if(!(A instanceof x))throw new TypeError("Cannot call a class as a function")}function h(A,x){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:A}function f(A,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);A.prototype=Object.create(x&&x.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(A,x):A.__proto__=x)}var p=function(x){return{mainText:x.main_text,secondaryText:x.secondary_text}},g=(function(A){f(x,A);function x(b){d(this,x);var _=h(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,b));return _.init=function(){if(!window.google)throw new Error("[react-places-autocomplete]: Google Maps JavaScript API library must be loaded. See: https://github.com/kenny-hibino/react-places-autocomplete#load-google-library");if(!window.google.maps.places)throw new Error("[react-places-autocomplete]: Google Maps Places library must be loaded. Please add `libraries=places` to the src URL. See: https://github.com/kenny-hibino/react-places-autocomplete#load-google-library");_.autocompleteService=new window.google.maps.places.AutocompleteService,_.autocompleteOK=window.google.maps.places.PlacesServiceStatus.OK,_.setState(function(M){return M.ready?null:{ready:!0}})},_.autocompleteCallback=function(M,T){if(_.setState({loading:!1}),T!==_.autocompleteOK){_.props.onError(T,_.clearSuggestions);return}var L=_.props.highlightFirstSuggestion;_.setState({suggestions:M.map(function(D,P){return{id:D.id,description:D.description,placeId:D.place_id,active:!!(L&&P===0),index:P,formattedSuggestion:p(D.structured_formatting),matchedSubstrings:D.matched_substrings,terms:D.terms,types:D.types}})})},_.fetchPredictions=function(){var M=_.props.value;M.length&&(_.setState({loading:!0}),_.autocompleteService.getPlacePredictions(n({},_.props.searchOptions,{input:M}),_.autocompleteCallback))},_.clearSuggestions=function(){_.setState({suggestions:[]})},_.clearActive=function(){_.setState({suggestions:_.state.suggestions.map(function(M){return n({},M,{active:!1})})})},_.handleSelect=function(M,T,L){_.clearSuggestions(),_.props.onSelect?_.props.onSelect(M,T,L):_.props.onChange(M)},_.getActiveSuggestion=function(){return _.state.suggestions.find(function(M){return M.active})},_.selectActiveAtIndex=function(M){var T=_.state.suggestions.find(function(L){return L.index===M}).description;_.setActiveAtIndex(M),_.props.onChange(T)},_.selectUserInputValue=function(){_.clearActive(),_.props.onChange(_.state.userInputValue)},_.handleEnterKey=function(){var M=_.getActiveSuggestion();
5804M===void 0?_.handleSelect(_.props.value,null,null):_.handleSelect(M.description,M.placeId,M)},_.handleDownKey=function(){if(_.state.suggestions.length!==0){var M=_.getActiveSuggestion();M===void 0?_.selectActiveAtIndex(0):M.index===_.state.suggestions.length-1?_.selectUserInputValue():_.selectActiveAtIndex(M.index+1)}},_.handleUpKey=function(){if(_.state.suggestions.length!==0){var M=_.getActiveSuggestion();M===void 0?_.selectActiveAtIndex(_.state.suggestions.length-1):M.index===0?_.selectUserInputValue():_.selectActiveAtIndex(M.index-1)}},_.handleInputKeyDown=function(M){switch(M.key){case"Enter":M.preventDefault(),_.handleEnterKey();break;case"ArrowDown":M.preventDefault(),_.handleDownKey();break;case"ArrowUp":M.preventDefault(),_.handleUpKey();break;case"Escape":_.clearSuggestions();break}},_.setActiveAtIndex=function(M){_.setState({suggestions:_.state.suggestions.map(function(T,L){return L===M?n({},T,{active:!0}):n({},T,{active:!1})})})},_.handleInputChange=function(M){var T=M.target.value;if(_.props.onChange(T),_.setState({userInputValue:T}),!T){_.clearSuggestions();return}_.props.shouldFetchSuggestions&&_.debouncedFetchPredictions()},_.handleInputOnBlur=function(){_.mousedownOnSuggestion||_.clearSuggestions()},_.getActiveSuggestionId=function(){var M=_.getActiveSuggestion();return M?"PlacesAutocomplete__suggestion-"+M.placeId:void 0},_.getIsExpanded=function(){return _.state.suggestions.length>0},_.getInputProps=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(M.hasOwnProperty("value"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `value`. Use `value` prop instead");if(M.hasOwnProperty("onChange"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `onChange`. Use `onChange` prop instead");var T={type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-expanded":_.getIsExpanded(),"aria-activedescendant":_.getActiveSuggestionId(),disabled:!_.state.ready};return n({},T,M,{onKeyDown:(0,l.compose)(_.handleInputKeyDown,M.onKeyDown),onBlur:(0,l.compose)(_.handleInputOnBlur,M.onBlur),value:_.props.value,onChange:function(D){_.handleInputChange(D)}})},_.getSuggestionItemProps=function(M){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=_.handleSuggestionMouseEnter.bind(_,M.index),D=_.handleSuggestionClick.bind(_,M);return n({},T,{key:M.id,id:_.getActiveSuggestionId(),role:"option",onMouseEnter:(0,l.compose)(L,T.onMouseEnter),onMouseLeave:(0,l.compose)(_.handleSuggestionMouseLeave,T.onMouseLeave),onMouseDown:(0,l.compose)(_.handleSuggestionMouseDown,T.onMouseDown),onMouseUp:(0,l.compose)(_.handleSuggestionMouseUp,T.onMouseUp),onTouchStart:(0,l.compose)(_.handleSuggestionTouchStart,T.onTouchStart),onTouchEnd:(0,l.compose)(_.handleSuggestionMouseUp,T.onTouchEnd),onClick:(0,l.compose)(D,T.onClick)})},_.handleSuggestionMouseEnter=function(M){_.setActiveAtIndex(M)},_.handleSuggestionMouseLeave=function(){_.mousedownOnSuggestion=!1,_.clearActive()},_.handleSuggestionMouseDown=function(M){M.preventDefault(),_.mousedownOnSuggestion=!0}
5804,_.handleSuggestionTouchStart=function(){_.mousedownOnSuggestion=!0},_.handleSuggestionMouseUp=function(){_.mousedownOnSuggestion=!1},_.handleSuggestionClick=function(M,T){T&&T.preventDefault&&T.preventDefault();var L=M.description,D=M.placeId;_.handleSelect(L,D,M),setTimeout(function(){_.mousedownOnSuggestion=!1})},_.state={loading:!1,suggestions:[],userInputValue:b.value,ready:!b.googleCallbackName},_.debouncedFetchPredictions=(0,o.default)(_.fetchPredictions,b.debounce),_}return e(x,[{key:"componentDidMount",value:function(){var _=this.props.googleCallbackName;if(_){var M=window.google&&window.google.maps&&window.google.maps.places;M?this.init():window[_]=this.init}else this.init()}},{key:"componentWillUnmount",value:function(){var _=this.props.googleCallbackName;_&&window[_]&&delete window[_]}},{key:"render",value:function(){return this.props.children({getInputProps:this.getInputProps,getSuggestionItemProps:this.getSuggestionItemProps,loading:this.state.loading,suggestions:this.state.suggestions})}}]),x})(r.default.Component);return g.propTypes={onChange:s.default.func.isRequired,value:s.default.string.isRequired,children:s.default.func.isRequired,onError:s.default.func,onSelect:s.default.func,searchOptions:s.default.shape({bounds:s.default.object,componentRestrictions:s.default.object,location:s.default.object,offset:s.default.oneOfType([s.default.number,s.default.string]),radius:s.default.oneOfType([s.default.number,s.default.string]),types:s.default.array}),debounce:s.default.number,highlightFirstSuggestion:s.default.bool,shouldFetchSuggestions:s.default.bool,googleCallbackName:s.default.string},g.defaultProps={onError:function(x,b){return console.error(`[react-places-autocomplete]: error happened when fetching data from Google Maps API. 5805Please check the docs here (https://developers.google.com/maps/documentation/javascript/places#place_details_responses) 5806Status: `,x)},searchOptions:{},debounce:200,highlightFirstSuggestion:!1,shouldFetchSuggestions:!0},HN.default=g,HN}var Y2={},wne;function Bft(){return wne||(wne=1,Object.defineProperty(Y2,"__esModule",{value:!0}),Y2.geocodeByAddress=function(e){var t=new window.google.maps.Geocoder,r=window.google.maps.GeocoderStatus.OK;return new Promise(function(i,s){t.geocode({address:e},function(a,o){o!==r&&s(o),i(a)})})},Y2.getLatLng=function(e){return new Promise(function(t,r){try{var i={lat:e.geometry.location.lat(),lng:e.geometry.location.lng()};t(i)}catch(s){r(s)}})},Y2.geocodeByPlaceId=function(e){var t=new window.google.maps.Geocoder,r=window.google.maps.GeocoderStatus.OK;return new Promise(function(i,s){t.geocode({placeId:e},function(a,o){o!==r&&s(o),i(a)})})}),Y2}var _ne;function Vft(){if(_ne)return zp;_ne=1,Object.defineProperty(zp,"__esModule",{value:!0}),zp.getLatLng=zp.geocodeByPlaceId=zp.geocodeByAddress=void 0;var n=Uft(),e=r(n),t=Bft();function r(i){return i&&i.__esModule?i:{default:i}}return zp.geocodeByAddress=t.geocodeByAddress,zp.geocodeByPlaceId=t.geocodeByPlaceId,zp.getLatLng=t.getLatLng,zp.default=e.default,zp}var W1e=Vft();const zft=F1(W1e),Gft=({onLocationChange:n})=>{const e=hi(),[t,r]=G.useState(!1),[i,s]=G.useState(""),[a,o]=G.useState(!1),l=ro(),{data:u,isLoading:d}=Ma(),h=(u==null?void 0:u.subscriptionPlan)!==null&&(u==null?void 0:u.subscriptionPlan)!==$v.FREE,f=async()=>{r(!t),t?(s(""),n("")):p()},p=()=>{if(!navigator.geolocation){alert(e("Geolocation is not supported by your browser"));return}o(!0),navigator.geolocation.getCurrentPosition(async A=>{const{latitude:x,longitude:b}=A.coords;try{const M=await(await fetch(`https://maps.googleapis.com/maps/api/geocode/json?latlng=${x},${b}&key=AIzaSyB2ZI2dqbpO8rwUqwN0H5_p93vqgVY5BU8`)).json();if(M&&M.results&&M.results[0]){const T=M.results[0].address_components,L=(U,B,z=!1)=>{for(let H of B){const X=U.find(W=>W.types.includes(H));if(X)return z?X.short_name:X.long_name}return""},D=["locality","administrative_area_level_3","administrative_area_level_2"],P=["administrative_area_level_1"];let O=L(T,D),F=L(T,P,!0);s(`${O}, ${F}`||""),n(`${O}, ${F}`||"")}else alert(e("Could not detect your location."))}catch(_){console.error("Error fetching geolocation data:",_)}finally{o(!1)}},A=>{alert(e("Could not detect your location.")),o(!1)})},g=async A=>{await W1e.geocodeByAddress(A),s(A),n(A)};return c.jsxs("div",{className:"location-form",children:[c.jsxs("div",{className:"switch-container",children:[c.jsxs("label",{className:"switch",children:[c.jsx("input",{type:"checkbox",checked:t,onChange:f}),c.jsx("span",{className:"slider"})]}),c.jsx("span",{className:"label-text text-gray-900 dark:text-white",children:e("Target a location")})]}),a&&c.jsx("p",{children:e("Detecting your locationâ¦")}),t&&c.jsxs("div",{className:"input-group text-black dark:text-white",children:[c.jsx("label",{children:e("Location")}),c.jsx(zft,{value:i,onChange:s,onSelect:g,searchOptions:{types:["(regions)"]},children:({getInputProps:A,suggestions:x,getSuggestionItemProps:b,loading:_})=>c.jsxs("div",{children:[c.jsx("input",{...A({placeholder:e("Country, region or city"),className:"input-field border-2 border-green-700 text-black dark:text-white",onFocus:()=>{h||window.confirm("Your current plan does not include this feature. Would you like to upgrade to Pro?")&&l("/#pricing")}})}),c.jsxs("div",{className:"suggestions-dropdown",children:[_&&c.jsx("div",{children:e("Loadingâ¦")}),x.map(M=>{const T=M.active?{backgroundColor:"#3b4a5a",cursor:"pointer"}:{backgroundColor:"#2e3742",cursor:"pointer"};return G.createElement("div",{...b(M,{style:T}),key:M.placeId},M.description)})]})]})})]})]})};var VO,Sne;function qft(){if(Sne)return VO;Sne=1;function n(){this.__data__=[],this.size=0}return VO=n,VO}var zO,Tne;function X1e(){if(Tne)return zO;Tne=1;function n(e,t){return e===t||e!==e&&t!==t}return zO=n,zO}var GO,Ene;function pP(){if(Ene)return GO;Ene=1;var n=X1e();function e(t,r){for(var i=t.length;i--;)if(n(t[i][0],r))return i;return-1}return GO=e,GO}var qO,Cne;function $ft(){if(Cne)return qO;Cne=1;var n=pP(),e=Array.prototype,t=e.splice;function r(i){var s=this.__data__,a=n(s,i);if(a<0)return!1;var o=s.length-1;return a==o?s.pop():t.call(s,a,1),--this.size,!0}return qO=r,qO}var $O,Nne;function Hft(){if(Nne)return $O;Nne=1;var n=pP();function e(t){var r=this.__data__,i=n(r,t);return i<0?void 0:r[i][1]}return $O=e,$O}var HO,Mne;function Wft(){if(Mne)return HO;Mne=1;var n=pP();function e(t){return n(this.__data__,t)>-1}
vendor: 8,880 bytes, line 5806
5806return HO=e,HO}var WO,kne;function Xft(){if(kne)return WO;kne=1;var n=pP();function e(t,r){var i=this.__data__,s=n(i,t);return s<0?(++this.size,i.push([t,r])):i[s][1]=r,this}return WO=e,WO}var XO,Rne;function mP(){if(Rne)return XO;Rne=1;var n=qft(),e=$ft(),t=Hft(),r=Wft(),i=Xft();function s(a){var o=-1,l=a==null?0:a.length;for(this.clear();++o<l;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,XO=s,XO}var YO,Pne;function Yft(){if(Pne)return YO;Pne=1;var n=mP();function e(){this.__data__=new n,this.size=0}return YO=e,YO}var QO,Lne;function Qft(){if(Lne)return QO;Lne=1;function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return QO=n,QO}var KO,One;function Kft(){if(One)return KO;One=1;function n(e){return this.__data__.get(e)}return KO=n,KO}var ZO,Dne;function Zft(){if(Dne)return ZO;Dne=1;function n(e){return this.__data__.has(e)}return ZO=n,ZO}var JO,jne;function Y1e(){if(jne)return JO;jne=1;var n=typeof jA=="object"&&jA&&jA.Object===Object&&jA;return JO=n,JO}var eD,Ine;function xg(){if(Ine)return eD;Ine=1;var n=Y1e(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return eD=t,eD}var tD,Fne;function a$(){if(Fne)return tD;Fne=1;var n=xg(),e=n.Symbol;return tD=e,tD}var nD,Une;function Jft(){if(Une)return nD;Une=1;var n=a$(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,i=n?n.toStringTag:void 0;function s(a){var o=t.call(a,i),l=a[i];try{a[i]=void 0;var u=!0}catch{}var d=r.call(a);return u&&(o?a[i]=l:delete a[i]),d}return nD=s,nD}var rD,Bne;function ept(){if(Bne)return rD;Bne=1;var n=Object.prototype,e=n.toString;function t(r){return e.call(r)}return rD=t,rD}var iD,Vne;function gP(){if(Vne)return iD;Vne=1;var n=a$(),e=Jft(),t=ept(),r="[object Null]",i="[object Undefined]",s=n?n.toStringTag:void 0;function a(o){return o==null?o===void 0?i:r:s&&s in Object(o)?e(o):t(o)}return iD=a,iD}var sD,zne;function Q1e(){if(zne)return sD;zne=1;function n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return sD=n,sD}var aD,Gne;function K1e(){if(Gne)return aD;Gne=1;var n=gP(),e=Q1e(),t="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function a(o){if(!e(o))return!1;var l=n(o);return l==r||l==i||l==t||l==s}return aD=a,aD}var oD,qne;function tpt(){if(qne)return oD;qne=1;var n=xg(),e=n["__core-js_shared__"];return oD=e,oD}var lD,$ne;function npt(){if($ne)return lD;$ne=1;var n=tpt(),e=(function(){var r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function t(r){return!!e&&e in r}return lD=t,lD}var cD,Hne;function Z1e(){if(Hne)return cD;Hne=1;var n=Function.prototype,e=n.toString;function t(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return cD=t,cD}var uD,Wne;function rpt(){if(Wne)return uD;Wne=1;var n=K1e(),e=npt(),t=Q1e(),r=Z1e(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,a=Function.prototype,o=Object.prototype,l=a.toString,u=o.hasOwnProperty,d=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(f){if(!t(f)||e(f))return!1;var p=n(f)?d:s;return p.test(r(f))}return uD=h,uD}var dD,Xne;function ipt(){if(Xne)return dD;Xne=1;function n(e,t){return e==null?void 0:e[t]}return dD=n,dD}var hD,Yne;function F_(){if(Yne)return hD;Yne=1;var n=rpt(),e=ipt();function t(r,i){var s=e(r,i);return n(s)?s:void 0}return hD=t,hD}var fD,Qne;function o$(){if(Qne)return fD;Qne=1;var n=F_(),e=xg(),t=n(e,"Map");return fD=t,fD}var pD,Kne;function AP(){if(Kne)return pD;Kne=1;var n=F_(),e=n(Object,"create");return pD=e,pD}var mD,Zne;function spt(){if(Zne)return mD;Zne=1;var n=AP();function e(){this.__data__=n?n(null):{},this.size=0}return mD=e,mD}var gD,Jne;function apt(){if(Jne)return gD;Jne=1;function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return gD=n,gD}var AD,ere;function opt(){if(ere)return AD;ere=1;var n=AP(),e="__lodash_hash_undefined__",t=Object.prototype,r=t.hasOwnProperty;function i(s){var a=this.__data__;if(n){var o=a[s];return o===e?void 0:o}return r.call(a,s)?a[s]:void 0}return AD=i,AD}var xD,tre;function lpt(){if(tre)return xD;tre=1;var n=AP(),e=Object.prototype,t=e.hasOwnProperty;function r(i){var s=this.__data__;return n?s[i]!==void 0:t.call(s,i)}return xD=r,xD}var vD,nre;function cpt(){if(nre)return vD;nre=1;var n=AP(),e="__lodash_hash_undefined__";function t(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=n&&i===void 0?e:i,this}return vD=t,vD}var yD,rre;function upt(){if(rre)return yD;rre=1;var n=spt(),e=apt(),t=opt(),r=lpt(),i=cpt();function s(a){var o=-1,l=a==null?0:a.length;for(this.clear();++o<l;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,yD=s,yD}var bD,ire;function dpt(){if(ire)return bD;ire=1;var n=upt(),e=mP(),t=o$();function r(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}return bD=r,bD}var wD,sre;function hpt(){if(sre)return wD;sre=1;function n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return wD=n,wD}var _D,are;function xP(){if(are)return _D;are=1;var n=hpt();function e(t,r){var i=t.__data__;return n(r)?i[typeof r=="string"?"string":"hash"]:i.map}return _D=e,_D}var SD,ore;function fpt(){if(ore)return SD;ore=1;var n=xP();function e(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}return SD=e,SD}var TD,lre;function ppt(){if(lre)return TD;lre=1;var n=xP();function e(t){return n(this,t).get(t)}return TD=e,TD}var ED,cre;function mpt(){if(cre)return ED;cre=1;var n=xP();function e(t){return n(this,t).has(t)}return ED=e,ED}var CD,ure;function gpt(){if(ure)return CD;ure=1;var n=xP();function e(t,r){var i=n(this,t),s=i.size;return i.set(t,r),this.size+=i.size==s?0:1,this}return CD=e,CD}var ND,dre;function J1e(){if(dre)return ND;dre=1;var n=dpt(),e=fpt(),t=ppt(),r=mpt(),i=gpt();function s(a){var o=-1,l=a==null?0:a.length;for(this.clear();++o<l;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,ND=s,ND}var MD,hre;function Apt(){if(hre)return MD;hre=1;var n=mP(),e=o$(),t=J1e(),r=200;function i(s,a){var o=this.__data__;if(o instanceof n){var l=o.__data__;if(!e||l.length<r-1)return l.push([s,a]),this.size=++o.size,this;o=this.__data__=new t(l)}return o.set(s,a),this.size=o.size,this}return MD=i,MD}var kD,fre;function xpt(){if(fre)return kD;fre=1;var n=mP(),e=Yft(),t=Qft(),r=Kft(),i=Zft(),s=Apt();function a(o){var l=this.__data__=new n(o);this.size=l.size}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=s,kD=a,kD}var RD,pre;function vpt(){if(pre)return RD;pre=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return RD=e,RD}var PD,mre;function ypt(){if(mre)return PD;mre=1;function n(e){return this.__data__.has(e)}return PD=n,PD}var LD,gre;function bpt(){if(gre)return LD;gre=1;var n=J1e(),e=vpt(),t=ypt();function r(i){var s=-1,a=i==null?0:i.length;for(this.__data__=new n;++s<a;)this.add(i[s])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,LD=r,LD}var OD,Are;function wpt(){if(Are)return OD;Are=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}return OD=n,OD}var DD,xre;function _pt(){if(xre)return DD;xre=1;function n(e,t){return e.has(t)}return DD=n,DD}var jD,vre;function exe(){if(vre)return jD;vre=1;var n=bpt(),e=wpt(),t=_pt(),r=1,i=2;function s(a,o,l,u,d,h){var f=l&r,p=a.length,g=o.length;if(p!=g&&!(f&&g>p))return!1;var A=h.get(a),x=h.get(o);if(A&&x)return A==o&&x==a;var b=-1,_=!0,M=l&i?new n:void 0;for(h.set(a,o),h.set(o,a);++b<p;){var T=a[b],L=o[b];if(u)var D=f?u(L,T,b,o,a,h):u(T,L,b,a,o,h);if(D!==void 0){if(D)continue;_=!1;break}if(M){if(!e(o,function(P,O){if(!t(M,O)&&(T===P||d(T,P,l,u,h)))return M.push(O)})){_=!1;break}}else if(!(T===L||d(T,L,l,u,h))){_=!1;break}}return h.delete(a),h.delete(o),_}return jD=s,jD}var ID,yre;function Spt(){if(yre)return ID;yre=1;var n=xg(),e=n.Uint8Array;return ID=e,ID}var FD,bre;function Tpt(){if(bre)return FD;bre=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,s){r[++t]=[s,i]}),r}return FD=n,FD}var UD,wre;function Ept(){if(wre)return UD;wre=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return UD=n,UD}var BD,_re;function Cpt(){if(_re)return BD;_re=1;var n=a$(),e=Spt(),t=X1e(),r=exe(),i=Tpt(),s=Ept(),a=1,o=2,l="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Map]",f="[object Number]",p="[object RegExp]",g="[object Set]",A="[object String]",x="[object Symbol]",b="[object ArrayBuffer]",_="[object DataView]",M=n?n.prototype:void 0,T=
vendor: 4,411 bytes, line 5806
5806M?M.valueOf:void 0;function L(D,P,O,F,U,B,z){switch(O){case _:if(D.byteLength!=P.byteLength||D.byteOffset!=P.byteOffset)return!1;D=D.buffer,P=P.buffer;case b:return!(D.byteLength!=P.byteLength||!B(new e(D),new e(P)));case l:case u:case f:return t(+D,+P);case d:return D.name==P.name&&D.message==P.message;case p:case A:return D==P+"";case h:var H=i;case g:var X=F&a;if(H||(H=s),D.size!=P.size&&!X)return!1;var W=z.get(D);if(W)return W==P;F|=o,z.set(D,P);var J=r(H(D),H(P),F,U,B,z);return z.delete(D),J;case x:if(T)return T.call(D)==T.call(P)}return!1}return BD=L,BD}var VD,Sre;function Npt(){if(Sre)return VD;Sre=1;function n(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}return VD=n,VD}var zD,Tre;function l$(){if(Tre)return zD;Tre=1;var n=Array.isArray;return zD=n,zD}var GD,Ere;function Mpt(){if(Ere)return GD;Ere=1;var n=Npt(),e=l$();function t(r,i,s){var a=i(r);return e(r)?a:n(a,s(r))}return GD=t,GD}var qD,Cre;function kpt(){if(Cre)return qD;Cre=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,s=0,a=[];++r<i;){var o=e[r];t(o,r,e)&&(a[s++]=o)}return a}return qD=n,qD}var $D,Nre;function Rpt(){if(Nre)return $D;Nre=1;function n(){return[]}return $D=n,$D}var HD,Mre;function Ppt(){if(Mre)return HD;Mre=1;var n=kpt(),e=Rpt(),t=Object.prototype,r=t.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(a){return a==null?[]:(a=Object(a),n(i(a),function(o){return r.call(a,o)}))}:e;return HD=s,HD}var WD,kre;function Lpt(){if(kre)return WD;kre=1;function n(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}return WD=n,WD}var XD,Rre;function vP(){if(Rre)return XD;Rre=1;function n(e){return e!=null&&typeof e=="object"}return XD=n,XD}var YD,Pre;function Opt(){if(Pre)return YD;Pre=1;var n=gP(),e=vP(),t="[object Arguments]";function r(i){return e(i)&&n(i)==t}return YD=r,YD}var QD,Lre;function Dpt(){if(Lre)return QD;Lre=1;var n=Opt(),e=vP(),t=Object.prototype,r=t.hasOwnProperty,i=t.propertyIsEnumerable,s=n((function(){return arguments})())?n:function(a){return e(a)&&r.call(a,"callee")&&!i.call(a,"callee")};return QD=s,QD}var HS={exports:{}},KD,Ore;function jpt(){if(Ore)return KD;Ore=1;function n(){return!1}return KD=n,KD}HS.exports;var Dre;function txe(){return Dre||(Dre=1,(function(n,e){var t=xg(),r=jpt(),i=e&&!e.nodeType&&e,s=i&&!0&&n&&!n.nodeType&&n,a=s&&s.exports===i,o=a?t.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||r;n.exports=u})(HS,HS.exports)),HS.exports}var ZD,jre;function Ipt(){if(jre)return ZD;jre=1;var n=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(r,i){var s=typeof r;return i=i??n,!!i&&(s=="number"||s!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return ZD=t,ZD}var JD,Ire;function nxe(){if(Ire)return JD;Ire=1;var n=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=n}return JD=e,JD}var ej,Fre;function Fpt(){if(Fre)return ej;Fre=1;var n=gP(),e=nxe(),t=vP(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",a="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",d="[object Number]",h="[object Object]",f="[object RegExp]",p="[object Set]",g="[object String]",A="[object WeakMap]",x="[object ArrayBuffer]",b="[object DataView]",_="[object Float32Array]",M="[object Float64Array]",T="[object Int8Array]",L="[object Int16Array]",D="[object Int32Array]",P="[object Uint8Array]",O="[object Uint8ClampedArray]",F="[object Uint16Array]",U="[object Uint32Array]",B={};B[_]=B[M]=B[T]=B[L]=B[D]=B[P]=B[O]=B[F]=B[U]=!0,B[r]=B[i]=B[x]=B[s]=B[b]=B[a]=B[o]=B[l]=B[u]=B[d]=B[h]=B[f]=B[p]=B[g]=B[A]=!1;function z(H){return t(H)&&e(H.length)&&!!B[n(H)]}return ej=z,ej}var tj,Ure;function Upt(){if(Ure)return tj;Ure=1;function n(e){return function(t){return e(t)}}return tj=n,tj}var WS={exports:{}};WS.exports;var Bre;function Bpt(){return Bre||(Bre=1,(function(n,e){var t=Y1e(),r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,a=s&&t.process,o=(function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}})();n.exports=o})(WS,WS.exports)),WS.exports}var nj,Vre;function rxe(){if(Vre)return nj;Vre=1;var n=Fpt(),e=Upt(),t=Bpt(),r=t&&t.isTypedArray,i=r?e(r):n;return nj=i,nj}var rj,zre;function Vpt(){if(zre)return rj;zre=1;var n=Lpt(),e=Dpt(),t=l$(),r=txe(),i=Ipt(),s=rxe(),a=Object.prototype,o=a.hasOwnProperty;function l(u,d){var h=t(u),f=!h&&e(u),p=!h&&!f&&r(u),g=!h&&!f&&!p&&s(u),A=h||f||p||g,x=A?n(u.length,String):[],b=x.length;
vendor: 3,385 bytes, line 5806
5806for(var _ in u)(d||o.call(u,_))&&!(A&&(_=="length"||p&&(_=="offset"||_=="parent")||g&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||i(_,b)))&&x.push(_);return x}return rj=l,rj}var ij,Gre;function zpt(){if(Gre)return ij;Gre=1;var n=Object.prototype;function e(t){var r=t&&t.constructor,i=typeof r=="function"&&r.prototype||n;return t===i}return ij=e,ij}var sj,qre;function Gpt(){if(qre)return sj;qre=1;function n(e,t){return function(r){return e(t(r))}}return sj=n,sj}var aj,$re;function qpt(){if($re)return aj;$re=1;var n=Gpt(),e=n(Object.keys,Object);return aj=e,aj}var oj,Hre;function $pt(){if(Hre)return oj;Hre=1;var n=zpt(),e=qpt(),t=Object.prototype,r=t.hasOwnProperty;function i(s){if(!n(s))return e(s);var a=[];for(var o in Object(s))r.call(s,o)&&o!="constructor"&&a.push(o);return a}return oj=i,oj}var lj,Wre;function Hpt(){if(Wre)return lj;Wre=1;var n=K1e(),e=nxe();function t(r){return r!=null&&e(r.length)&&!n(r)}return lj=t,lj}var cj,Xre;function Wpt(){if(Xre)return cj;Xre=1;var n=Vpt(),e=$pt(),t=Hpt();function r(i){return t(i)?n(i):e(i)}return cj=r,cj}var uj,Yre;function Xpt(){if(Yre)return uj;Yre=1;var n=Mpt(),e=Ppt(),t=Wpt();function r(i){return n(i,t,e)}return uj=r,uj}var dj,Qre;function Ypt(){if(Qre)return dj;Qre=1;var n=Xpt(),e=1,t=Object.prototype,r=t.hasOwnProperty;function i(s,a,o,l,u,d){var h=o&e,f=n(s),p=f.length,g=n(a),A=g.length;if(p!=A&&!h)return!1;for(var x=p;x--;){var b=f[x];if(!(h?b in a:r.call(a,b)))return!1}var _=d.get(s),M=d.get(a);if(_&&M)return _==a&&M==s;var T=!0;d.set(s,a),d.set(a,s);for(var L=h;++x<p;){b=f[x];var D=s[b],P=a[b];if(l)var O=h?l(P,D,b,a,s,d):l(D,P,b,s,a,d);if(!(O===void 0?D===P||u(D,P,o,l,d):O)){T=!1;break}L||(L=b=="constructor")}if(T&&!L){var F=s.constructor,U=a.constructor;F!=U&&"constructor"in s&&"constructor"in a&&!(typeof F=="function"&&F instanceof F&&typeof U=="function"&&U instanceof U)&&(T=!1)}return d.delete(s),d.delete(a),T}return dj=i,dj}var hj,Kre;function Qpt(){if(Kre)return hj;Kre=1;var n=F_(),e=xg(),t=n(e,"DataView");return hj=t,hj}var fj,Zre;function Kpt(){if(Zre)return fj;Zre=1;var n=F_(),e=xg(),t=n(e,"Promise");return fj=t,fj}var pj,Jre;function Zpt(){if(Jre)return pj;Jre=1;var n=F_(),e=xg(),t=n(e,"Set");return pj=t,pj}var mj,eie;function Jpt(){if(eie)return mj;eie=1;var n=F_(),e=xg(),t=n(e,"WeakMap");return mj=t,mj}var gj,tie;function e0t(){if(tie)return gj;tie=1;var n=Qpt(),e=o$(),t=Kpt(),r=Zpt(),i=Jpt(),s=gP(),a=Z1e(),o="[object Map]",l="[object Object]",u="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",p=a(n),g=a(e),A=a(t),x=a(r),b=a(i),_=s;return(n&&_(new n(new ArrayBuffer(1)))!=f||e&&_(new e)!=o||t&&_(t.resolve())!=u||r&&_(new r)!=d||i&&_(new i)!=h)&&(_=function(M){var T=s(M),L=T==l?M.constructor:void 0,D=L?a(L):"";if(D)switch(D){case p:return f;case g:return o;case A:return u;case x:return d;case b:return h}return T}),gj=_,gj}var Aj,nie;function t0t(){if(nie)return Aj;nie=1;var n=xpt(),e=exe(),t=Cpt(),r=Ypt(),i=e0t(),s=l$(),a=txe(),o=rxe(),l=1,u="[object Arguments]",d="[object Array]",h="[object Object]",f=Object.prototype,p=f.hasOwnProperty;function g(A,x,b,_,M,T){var L=s(A),D=s(x),P=L?d:i(A),O=D?d:i(x);P=P==u?h:P,O=O==u?h:O;var F=P==h,U=O==h,B=P==O;if(B&&a(A)){if(!a(x))return!1;L=!0,F=!1}if(B&&!F)return T||(T=new n),L||o(A)?e(A,x,b,_,M,T):t(A,x,P,b,_,M,T);if(!(b&l)){var z=F&&p.call(A,"__wrapped__"),H=U&&p.call(x,"__wrapped__");
vendor: 100,467 bytes, lines 5806-5836
5806if(z||H){var X=z?A.value():A,W=H?x.value():x;return T||(T=new n),M(X,W,b,_,T)}}return B?(T||(T=new n),r(A,x,b,_,M,T)):!1}return Aj=g,Aj}var xj,rie;function n0t(){if(rie)return xj;rie=1;var n=t0t(),e=vP();function t(r,i,s,a,o){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:n(r,i,s,a,t,o)}return xj=t,xj}var vj,iie;function r0t(){if(iie)return vj;iie=1;var n=n0t();function e(t,r){return n(t,r)}return vj=e,vj}var H6={exports:{}};/*! 5807 * Quill Editor v1.3.7 5808 * https://quilljs.com/ 5809 * Copyright (c) 2014, Jason Chen 5810 * Copyright (c) 2013, salesforce.com 5811 */var i0t=H6.exports,sie;function s0t(){return sie||(sie=1,(function(n,e){(function(r,i){n.exports=i()})(typeof self<"u"?self:i0t,function(){return(function(t){var r={};function i(s){if(r[s])return r[s].exports;var a=r[s]={i:s,l:!1,exports:{}};return t[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=r,i.d=function(s,a,o){i.o(s,a)||Object.defineProperty(s,a,{configurable:!1,enumerable:!0,get:o})},i.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(a,"a",a),a},i.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},i.p="",i(i.s=109)})([(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(17),a=i(18),o=i(19),l=i(45),u=i(46),d=i(47),h=i(48),f=i(49),p=i(12),g=i(32),A=i(33),x=i(31),b=i(1),_={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:s.default,Format:a.default,Leaf:o.default,Embed:h.default,Scroll:l.default,Block:d.default,Inline:u.default,Text:f.default,Attributor:{Attribute:p.default,Class:g.default,Style:A.default,Store:x.default}};r.default=_}),(function(t,r,i){var s=this&&this.__extends||(function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,_){b.__proto__=_}||function(b,_){for(var M in _)_.hasOwnProperty(M)&&(b[M]=_[M])};return function(b,_){x(b,_);function M(){this.constructor=b}b.prototype=_===null?Object.create(_):(M.prototype=_.prototype,new M)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=(function(x){s(b,x);function b(_){var M=this;return _="[Parchment] "+_,M=x.call(this,_)||this,M.message=_,M.name=M.constructor.name,M}return b})(Error);r.ParchmentError=a;var o={},l={},u={},d={};r.DATA_KEY="__blot";var h;(function(x){x[x.TYPE=3]="TYPE",x[x.LEVEL=12]="LEVEL",x[x.ATTRIBUTE=13]="ATTRIBUTE",x[x.BLOT=14]="BLOT",x[x.INLINE=7]="INLINE",x[x.BLOCK=11]="BLOCK",x[x.BLOCK_BLOT=10]="BLOCK_BLOT",x[x.INLINE_BLOT=6]="INLINE_BLOT",x[x.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",x[x.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",x[x.ANY=15]="ANY"})(h=r.Scope||(r.Scope={}));function f(x,b){var _=g(x);if(_==null)throw new a("Unable to create "+x+" blot");var M=_,T=x instanceof Node||x.nodeType===Node.TEXT_NODE?x:M.create(b);return new M(T,b)}r.create=f;function p(x,b){return b===void 0&&(b=!1),x==null?null:x[r.DATA_KEY]!=null?x[r.DATA_KEY].blot:b?p(x.parentNode,b):null}r.find=p;function g(x,b){b===void 0&&(b=h.ANY);var _;if(typeof x=="string")_=d[x]||o[x];else if(x instanceof Text||x.nodeType===Node.TEXT_NODE)_=d.text;else if(typeof x=="number")x&h.LEVEL&h.BLOCK?_=d.block:x&h.LEVEL&h.INLINE&&(_=d.inline);else if(x instanceof HTMLElement){var M=(x.getAttribute("class")||"").split(/\s+/);for(var T in M)if(_=l[M[T]],_)break;_=_||u[x.tagName]}return _==null?null:b&h.LEVEL&_.scope&&b&h.TYPE&_.scope?_:null}r.query=g;function A(){for(var x=[],b=0;b<arguments.length;b++)x[b]=arguments[b];if(x.length>1)return x.map(function(T){return A(T)});var _=x[0];if(typeof _.blotName!="string"&&typeof _.attrName!="string")throw new a("Invalid definition");if(_.blotName==="abstract")throw new a("Cannot register abstract class");if(d[_.blotName||_.attrName]=_,typeof _.keyName=="string")o[_.keyName]=_;else if(_.className!=null&&(l[_.className]=_),_.tagName!=null){Array.isArray(_.tagName)?_.tagName=_.tagName.map(function(T){return T.toUpperCase()}):_.tagName=_.tagName.toUpperCase();var M=Array.isArray(_.tagName)?_.tagName:[_.tagName];M.forEach(function(T){(u[T]==null||_.className==null)&&(u[T]=_)})}return _}r.register=A}),(function(t,r,i){var s=i(51),a=i(11),o=i(3),l=i(20),u="\0",d=function(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]};d.prototype.insert=function(h,f){var p={};return h.length===0?this:(p.insert=h,f!=null&&typeof f=="object"&&Object.keys(f).length>0&&(p.attributes=f),this.push(p))},d.prototype.delete=function(h){return h<=0?this:this.push({delete:h})},d.prototype.retain=function(h,f){if(h<=0)return this;var p={retain:h};return f!=null&&typeof f=="object"&&Object.keys(f).length>0&&(p.attributes=f),this.push(p)},d.prototype.push=function(h){var f=this.ops.length,p=this.ops[f-1];if(h=o(!0,{},h),typeof p=="object"){if(typeof h.delete=="number"&&typeof p.delete=="number")return this.ops[f-1]={delete:p.delete+h.delete},this;if(typeof p.delete=="number"&&h.insert!=null&&(f-=1,p=this.ops[f-1],typeof p!="object"))return this.ops.unshift(h),this;if(a(h.attributes,p.attributes)){if(typeof h.insert=="string"&&typeof p.insert=="string")return this.ops[f-1]={insert:p.insert+h.insert},typeof h.attributes=="object"&&(this.ops[f-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof p.retain=="number")return this.ops[f-1]={retain:p.retain+h.retain},typeof h.attributes=="object"&&(this.ops[f-1].attributes=h.attributes),this}}return f===this.ops.length?this.ops.push(h):this.ops.splice(f,0,h),this},d.prototype.chop=function(){var h=this.ops[this.ops.length-1];return h&&h.retain&&!h.attributes&&this.ops.pop(),this},d.prototype.filter=function(h){return this.ops.filter(h)},d.prototype.forEach=function(h){this.ops.forEach(h)},d.prototype.map=function(h){return this.ops.map(h)},d.prototype.partition=function(h){var f=[],p=[];return this.forEach(function(g){var A=h(g)?f:p;A.push(g)}),[f,p]},d.prototype.reduce=function(h,f){return this.ops.reduce(h,f)},d.prototype.changeLength=function(){return this.reduce(function(h,f){return f.insert?h+l.length(f):f.delete?h-f.delete:h},0)},d.prototype.length=function(){return this.reduce(function(h,f){return h+l.length(f)},0)},d.prototype.slice=function(h,f){h=h||0,typeof f!="number"&&(f=1/0);for(var p=[],g=l.iterator(this.ops),A=0;A<f&&g.hasNext();){var x;A<h?x=g.next(h-A):(x=g.next(f-A),p.push(x)),A+=l.length(x)}return new d(p)},d.prototype.compose=function(h){var f=l.iterator(this.ops),p=l.iterator(h.ops),g=[],A=p.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){for(var x=A.retain;f.peekType()==="insert"&&f.peekLength()<=x;)x-=f.peekLength(),g.push(f.next());A.retain-x>0&&p.next(A.retain-x)}for(var b=new d(g);f.hasNext()||p.hasNext();)if(p.peekType()==="insert")b.push(p.next());else if(f.peekType()==="delete")b.push(f.next());else{var _=Math.min(f.peekLength(),p.peekLength()),M=f.next(_),T=p.next(_);if(typeof T.retain=="number"){var L={};typeof M.retain=="number"?L.retain=_:L.insert=M.insert;var D=l.attributes.compose(M.attributes,T.attributes,typeof M.retain=="number");if(D&&(L.attributes=D),b.push(L),!p.hasNext()&&a(b.ops[b.ops.length-1],L)){var P=new d(f.rest());return b.concat(P).chop()}}else typeof T.delete=="number"&&typeof M.retain=="number"&&b.push(T)}return b.chop()},d.prototype.concat=function(h){var f=new d(this.ops.slice());return h.ops.length>0&&(f.push(h.ops[0]),f.ops=f.ops.concat(h.ops.slice(1))),f},d.prototype.diff=function(h,f){if(this.ops===h.ops)return new d;var p=[this,h].map(function(_){return _.map(function(M){if(M.insert!=null)return typeof M.insert=="string"?M.insert:u;var T=_===h?"on":"with";throw new Error("diff() called "+T+" non-document")}).join("")}),g=new d,A=s(p[0],p[1],f),x=l.iterator(this.ops),b=l.iterator(h.ops);return A.forEach(function(_){for(var M=_[1].length;M>0;){var T=0;switch(_[0]){case s.INSERT:T=Math.min(b.peekLength(),M),g.push(b.next(T));break;case s.DELETE:T=Math.min(M,x.peekLength()),x.next(T),g.delete(T);break;case s.EQUAL:T=Math.min(x.peekLength(),b.peekLength(),M);var L=x.next(T),D=b.next(T);a(L.insert,D.insert)?g.retain(T,l.attributes.diff(L.attributes,D.attributes)):g.push(D).delete(T);break}M-=T}}),g.chop()},d.prototype.eachLine=function(h,f){f=f||` 5812`;for(var p=l.iterator(this.ops),g=new d,A=0;p.hasNext();){if(p.peekType()!=="insert")return;var x=p.peek(),b=l.length(x)-p.peekLength(),_=typeof x.insert=="string"?x.insert.indexOf(f,b)-b:-1;if(_<0)g.push(p.next());else if(_>0)g.push(p.next(_));else{if(h(g,p.next(1).attributes||{},A)===!1)return;A+=1,g=new d}}g.length()>0&&h(g,{},A)},d.prototype.transform=function(h,f){if(f=!!f,typeof h=="number")return this.transformPosition(h,f);for(var p=l.iterator(this.ops),g=l.iterator(h.ops),A=new d;p.hasNext()||g.hasNext();)if(p.peekType()==="insert"&&(f||g.peekType()!=="insert"))A.retain(l.length(p.next()));else if(g.peekType()==="insert")A.push(g.next());else{var x=Math.min(p.peekLength(),g.peekLength()),b=p.next(x),_=g.next(x);if(b.delete)continue;_.delete?A.push(_):A.retain(x,l.attributes.transform(b.attributes,_.attributes,f))}return A.chop()},d.prototype.transformPosition=function(h,f){f=!!f;for(var p=l.iterator(this.ops),g=0;p.hasNext()&&g<=h;){var A=p.peekLength(),x=p.peekType();if(p.next(),x==="delete"){h-=Math.min(A,h-g);continue}else x==="insert"&&(g<h||!f)&&(h+=A);g+=A}return h},t.exports=d}),(function(t,r){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=function(p){return typeof Array.isArray=="function"?Array.isArray(p):s.call(p)==="[object Array]"},u=function(p){if(!p||s.call(p)!=="[object Object]")return!1;var g=i.call(p,"constructor"),A=p.constructor&&p.constructor.prototype&&i.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!g&&!A)return!1;var x;for(x in p);return typeof x>"u"||i.call(p,x)},d=function(p,g){a&&g.name==="__proto__"?a(p,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):p[g.name]=g.newValue},h=function(p,g){if(g==="__proto__")if(i.call(p,g)){if(o)return o(p,g).value}else return;return p[g]};t.exports=function f(){var p,g,A,x,b,_,M=arguments[0],T=1,L=arguments.length,D=!1;for(typeof M=="boolean"&&(D=M,M=arguments[1]||{},T=2),(M==null||typeof M!="object"&&typeof M!="function")&&(M={});T<L;++T)if(p=arguments[T],p!=null)for(g in p)A=h(M,g),x=h(p,g),M!==x&&(D&&x&&(u(x)||(b=l(x)))?(b?(b=!1,_=A&&l(A)?A:[]):_=A&&u(A)?A:{},d(M,{name:g,newValue:f(D,_,x)})):typeof x<"u"&&d(M,{name:g,newValue:x}));return M}}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BlockEmbed=r.bubbleFormats=void 0;var s=(function(){function B(z,H){for(var X=0;X<H.length;X++){var W=H[X];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(z,W.key,W)}}return function(z,H,X){return H&&B(z.prototype,H),X&&B(z,X),z}})(),a=function B(z,H,X){z===null&&(z=Function.prototype);var W=Object.getOwnPropertyDescriptor(z,H);if(W===void 0){var J=Object.getPrototypeOf(z);return J===null?void 0:B(J,H,X)}else{if("value"in W)return W.value;var ee=W.get;return ee===void 0?void 0:ee.call(X)}},o=i(3),l=M(o),u=i(2),d=M(u),h=i(0),f=M(h),p=i(16),g=M(p),A=i(6),x=M(A),b=i(7),_=M(b);function M(B){return B&&B.__esModule?B:{default:B}}function T(B,z){if(!(B instanceof z))throw new TypeError("Cannot call a class as a function")}function L(B,z){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:B}function D(B,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);B.prototype=Object.create(z&&z.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf(B,z):B.__proto__=z)}var P=1,O=(function(B){D(z,B);function z(){return T(this,z),L(this,(z.__proto__||Object.getPrototypeOf(z)).apply(this,arguments))}return s(z,[{key:"attach",value:function(){a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"attach",this).call(this),this.attributes=new f.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new d.default().insert(this.value(),(0,l.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(X,W){var J=f.default.query(X,f.default.Scope.BLOCK_ATTRIBUTE);J!=null&&this.attributes.attribute(J,W)}},{key:"formatAt",value:function(X,W,J,ee){this.format(J,ee)}},{key:"insertAt",value:function(X,W,J){if(typeof W=="string"&&W.endsWith(` 5813`)){var ee=f.default.create(F.blotName);this.parent.insertBefore(ee,X===0?this:this.next),ee.insertAt(0,W.slice(0,-1))}else a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"insertAt",this).call(this,X,W,J)}}]),z})(f.default.Embed);O.scope=f.default.Scope.BLOCK_BLOT;var F=(function(B){D(z,B);function z(H){T(this,z);var X=L(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,H));return X.cache={},X}return s(z,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(f.default.Leaf).reduce(function(X,W){return W.length()===0?X:X.insert(W.value(),U(W))},new d.default).insert(` 5814`,U(this))),this.cache.delta}},{key:"deleteAt",value:function(X,W){a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"deleteAt",this).call(this,X,W),this.cache={}}},{key:"formatAt",value:function(X,W,J,ee){W<=0||(f.default.query(J,f.default.Scope.BLOCK)?X+W===this.length()&&this.format(J,ee):a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"formatAt",this).call(this,X,Math.min(W,this.length()-X-1),J,ee),this.cache={})}},{key:"insertAt",value:function(X,W,J){if(J!=null)return a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"insertAt",this).call(this,X,W,J);if(W.length!==0){var ee=W.split(` 5815`),ae=ee.shift();ae.length>0&&(X<this.length()-1||this.children.tail==null?a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"insertAt",this).call(this,Math.min(X,this.length()-1),ae):this.children.tail.insertAt(this.children.tail.length(),ae),this.cache={});var le=this;ee.reduce(function(Z,Y){return le=le.split(Z,!0),le.insertAt(0,Y),Y.length},X+ae.length)}}},{key:"insertBefore",value:function(X,W){var J=this.children.head;a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"insertBefore",this).call(this,X,W),J instanceof g.default&&J.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"length",this).call(this)+P),this.cache.length}},{key:"moveChildren",value:function(X,W){a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"moveChildren",this).call(this,X,W),this.cache={}}},{key:"optimize",value:function(X){a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"optimize",this).call(this,X),this.cache={}}},{key:"path",value:function(X){return a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"path",this).call(this,X,!0)}},{key:"removeChild",value:function(X){a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"removeChild",this).call(this,X),this.cache={}}},{key:"split",value:function(X){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(W&&(X===0||X>=this.length()-P)){var J=this.clone();return X===0?(this.parent.insertBefore(J,this),this):(this.parent.insertBefore(J,this.next),J)}else{var ee=a(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"split",this).call(this,X,W);return this.cache={},ee}}}]),z})(f.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[x.default,f.default.Embed,_.default];function U(B){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return B==null||(typeof B.formats=="function"&&(z=(0,l.default)(z,B.formats())),B.parent==null||B.parent.blotName=="scroll"||B.parent.statics.scope!==B.statics.scope)?z:U(B.parent,z)}r.bubbleFormats=U,r.BlockEmbed=O,r.default=F}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.overload=r.expandConfig=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},a=(function(){function le(Z,Y){var re=[],_e=!0,Ee=!1,Ae=void 0;try{for(var te=Z[Symbol.iterator](),ve;!(_e=(ve=te.next()).done)&&(re.push(ve.value),!(Y&&re.length===Y));_e=!0);}catch(we){Ee=!0,Ae=we}finally{try{!_e&&te.return&&te.return()}finally{if(Ee)throw Ae}}return re}return function(Z,Y){if(Array.isArray(Z))return Z;if(Symbol.iterator in Object(Z))return le(Z,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function le(Z,Y){for(var re=0;re<Y.length;re++){var _e=Y[re];_e.enumerable=_e.enumerable||!1,_e.configurable=!0,"value"in _e&&(_e.writable=!0),Object.defineProperty(Z,_e.key,_e)}}return function(Z,Y,re){return Y&&le(Z.prototype,Y),re&&le(Z,re),Z}})();i(50);var l=i(2),u=U(l),d=i(14),h=U(d),f=i(8),p=U(f),g=i(9),A=U(g),x=i(0),b=U(x),_=i(15),M=U(_),T=i(3),L=U(T),D=i(10),P=U(D),O=i(34),F=U(O);function U(le){return le&&le.__esModule?le:{default:le}}function B(le,Z,Y){return Z in le?Object.defineProperty(le,Z,{value:Y,enumerable:!0,configurable:!0,writable:!0}):le[Z]=Y,le}function z(le,Z){if(!(le instanceof Z))throw new TypeError("Cannot call a class as a function")}var H=(0,P.default)("quill"),X=(function(){o(le,null,[{key:"debug",value:function(Y){Y===!0&&(Y="log"),P.default.level(Y)}},{key:"find",value:function(Y){return Y.__quill||b.default.find(Y)}},{key:"import",value:function(Y){return this.imports[Y]==null&&H.error("Cannot import "+Y+". Are you sure it was registered?"),this.imports[Y]}},{key:"register",value:function(Y,re){var _e=this,Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof Y!="string"){var Ae=Y.attrName||Y.blotName;typeof Ae=="string"?this.register("formats/"+Ae,Y,re):Object.keys(Y).forEach(function(te){_e.register(te,Y[te],re)})}else this.imports[Y]!=null&&!Ee&&H.warn("Overwriting "+Y+" with",re),this.imports[Y]=re,(Y.startsWith("blots/")||Y.startsWith("formats/"))&&re.blotName!=="abstract"?b.default.register(re):Y.startsWith("modules")&&typeof re.register=="function"&&re.register()}}]);function le(Z){var Y=this,re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(z(this,le),this.options=W(Z,re),this.container=this.options.container,this.container==null)return H.error("Invalid Quill container",Z);this.options.debug&&le.debug(this.options.debug);var _e=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new h.default(this.scroll),this.selection=new M.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(Ae){Ae===p.default.events.TEXT_CHANGE&&Y.root.classList.toggle("ql-blank",Y.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(Ae,te){var ve=Y.selection.lastRange,we=ve&&ve.length===0?ve.index:void 0;J.call(Y,function(){return Y.editor.update(null,te,we)},Ae)});var Ee=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+_e+"<p><br></p></div>");this.setContents(Ee),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(le,[{key:"addContainer",value:function(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof Y=="string"){var _e=Y;Y=document.createElement("div"),Y.classList.add(_e)}return this.container.insertBefore(Y,re),Y}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(Y,re,_e){var Ee=this,Ae=ee(Y,re,_e),te=a(Ae,4);return Y=te[0],re=te[1],_e=te[3],J.call(this,function(){return Ee.editor.deleteText(Y,re)},_e,Y,-1*re)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(Y),this.container.classList.toggle("ql-disabled",!Y)}},{key:"focus",value:function(){var Y=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=Y,this.scrollIntoView()}},{key:"format",value:function(Y,re){var _e=this,Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return J.call(this,function(){var Ae=_e.getSelection(!0),te=new u.default;if(Ae==null)return te;if(b.default.query(Y,b.default.Scope.BLOCK))te=_e.editor.formatLine(Ae.index,Ae.length,B({},Y,re));else{if(Ae.length===0)return _e.selection.format(Y,re),te;te=_e.editor.formatText(Ae.index,Ae.length,B({},Y,re))}return _e.setSelection(Ae,p.default.sources.SILENT),te},Ee)}},{key:"formatLine",value:function(Y,re,_e,Ee,Ae){var te=this,ve=void 0,we=ee(Y,re,_e,Ee,Ae),Ue=a(we,4);return Y=Ue[0],re=Ue[1],ve=Ue[2],Ae=Ue[3],J.call(this,function(){return te.editor.formatLine(Y,re,ve)},Ae,Y,0)}},{key:"formatText",value:function(Y,re,_e,Ee,Ae){var te=this,ve=void 0,we=ee(Y,re,_e,Ee,Ae),Ue=a(we,4);return Y=Ue[0],re=Ue[1],ve=Ue[2],Ae=Ue[3],J.call(this,function(){return te.editor.formatText(Y,re,ve)},Ae,Y,0)}},{key:"getBounds",value:function(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_e=void 0;typeof Y=="number"?_e=this.selection.getBounds(Y,re):_e=this.selection.getBounds(Y.index,Y.length);var Ee=this.container.getBoundingClientRect();return{bottom:_e.bottom-Ee.top,height:_e.height,left:_e.left-Ee.left,right:_e.right-Ee.left,top:_e.top-Ee.top,width:_e.width}}},{key:"getContents",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-Y,_e=ee(Y,re),Ee=a(_e,2);return Y=Ee[0],re=Ee[1],this.editor.getContents(Y,re)}},{key:"getFormat",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof Y=="number"?this.editor.getFormat(Y,re):this.editor.getFormat(Y.index,Y.length)}},{key:"getIndex",value:function(Y){return Y.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(Y){return this.scroll.leaf(Y)}},{key:"getLine",value:function(Y){return this.scroll.line(Y)}},{key:"getLines",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof Y!="number"?this.scroll.lines(Y.index,Y.length):this.scroll.lines(Y,re)}},{key:"getModule",value:function(Y){return this.theme.modules[Y]}},{key:"getSelection",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Y&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-Y,_e=ee(Y,re),Ee=a(_e,2);return Y=Ee[0],re=Ee[1],this.editor.getText(Y,re)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(Y,re,_e){var Ee=this,Ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:le.sources.API;return J.call(this,function(){return Ee.editor.insertEmbed(Y,re,_e)},Ae,Y)}},{key:"insertText",value:function(Y,re,_e,Ee,Ae){var te=this,ve=void 0,we=ee(Y,0,_e,Ee,Ae),Ue=a(we,4);return Y=Ue[0],ve=Ue[2],Ae=Ue[3],J.call(this,function(){return te.editor.insertText(Y,re,ve)},Ae,Y,re.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(Y,re,_e){this.clipboard.dangerouslyPasteHTML(Y,re,_e)}},{key:"removeFormat",value:function(Y,re,_e){var Ee=this,Ae=ee(Y,re,_e),te=a(Ae,4);return Y=te[0],re=te[1],_e=te[3],J.call(this,function(){return Ee.editor.removeFormat(Y,re)},_e,Y)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(Y){var re=this,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return J.call(this,function(){Y=new u.default(Y);var Ee=re.getLength(),Ae=re.editor.deleteText(0,Ee),te=re.editor.applyDelta(Y),ve=te.ops[te.ops.length-1];ve!=null&&typeof ve.insert=="string"&&ve.insert[ve.insert.length-1]===` 5816`&&(re.editor.deleteText(re.getLength()-1,1),te.delete(1));var we=Ae.compose(te);return we},_e)}},{key:"setSelection",value:function(Y,re,_e){if(Y==null)this.selection.setRange(null,re||le.sources.API);else{var Ee=ee(Y,re,_e),Ae=a(Ee,4);Y=Ae[0],re=Ae[1],_e=Ae[3],this.selection.setRange(new _.Range(Y,re),_e),_e!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,_e=new u.default().insert(Y);return this.setContents(_e,re)}},{key:"update",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,re=this.scroll.update(Y);return this.selection.update(Y),re}},{key:"updateContents",value:function(Y){var re=this,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return J.call(this,function(){return Y=new u.default(Y),re.editor.applyDelta(Y,_e)},_e,!0)}}]),le})();X.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},X.events=p.default.events,X.sources=p.default.sources,X.version="1.3.7",X.imports={delta:u.default,parchment:b.default,"core/module":A.default,"core/theme":F.default};function W(le,Z){if(Z=(0,L.default)(!0,{container:le,modules:{clipboard:!0,keyboard:!0,history:!0}},Z),!Z.theme||Z.theme===X.DEFAULTS.theme)Z.theme=F.default;else if(Z.theme=X.import("themes/"+Z.theme),Z.theme==null)throw new Error("Invalid theme "+Z.theme+". Did you register it?");var Y=(0,L.default)(!0,{},Z.theme.DEFAULTS);[Y,Z].forEach(function(Ee){Ee.modules=Ee.modules||{},Object.keys(Ee.modules).forEach(function(Ae){Ee.modules[Ae]===!0&&(Ee.modules[Ae]={})})});var re=Object.keys(Y.modules).concat(Object.keys(Z.modules)),_e=re.reduce(function(Ee,Ae){var te=X.import("modules/"+Ae);return te==null?H.error("Cannot load "+Ae+" module. Are you sure you registered it?"):Ee[Ae]=te.DEFAULTS||{},Ee},{});return Z.modules!=null&&Z.modules.toolbar&&Z.modules.toolbar.constructor!==Object&&(Z.modules.toolbar={container:Z.modules.toolbar}),Z=(0,L.default)(!0,{},X.DEFAULTS,{modules:_e},Y,Z),["bounds","container","scrollingContainer"].forEach(function(Ee){typeof Z[Ee]=="string"&&(Z[Ee]=document.querySelector(Z[Ee]))}),Z.modules=Object.keys(Z.modules).reduce(function(Ee,Ae){return Z.modules[Ae]&&(Ee[Ae]=Z.modules[Ae]),Ee},{}),Z}function J(le,Z,Y,re){if(this.options.strict&&!this.isEnabled()&&Z===p.default.sources.USER)return new u.default;var _e=Y==null?null:this.getSelection(),Ee=this.editor.delta,Ae=le();if(_e!=null&&(Y===!0&&(Y=_e.index),re==null?_e=ae(_e,Ae,Z):re!==0&&(_e=ae(_e,Y,re,Z)),this.setSelection(_e,p.default.sources.SILENT)),Ae.length()>0){var te,ve=[p.default.events.TEXT_CHANGE,Ae,Ee,Z];if((te=this.emitter).emit.apply(te,[p.default.events.EDITOR_CHANGE].concat(ve)),Z!==p.default.sources.SILENT){var we;(we=this.emitter).emit.apply(we,ve)}}return Ae}function ee(le,Z,Y,re,_e){var Ee={};return typeof le.index=="number"&&typeof le.length=="number"?typeof Z!="number"?(_e=re,re=Y,Y=Z,Z=le.length,le=le.index):(Z=le.length,le=le.index):typeof Z!="number"&&(_e=re,re=Y,Y=Z,Z=0),(typeof Y>"u"?"undefined":s(Y))==="object"?(Ee=Y,_e=re):typeof Y=="string"&&(re!=null?Ee[Y]=re:_e=Y),_e=_e||p.default.sources.API,[le,Z,Ee,_e]}function ae(le,Z,Y,re){if(le==null)return null;var _e=void 0,Ee=void 0;if(Z instanceof u.default){var Ae=[le.index,le.index+le.length].map(function(Ue){return Z.transformPosition(Ue,re!==p.default.sources.USER)}),te=a(Ae,2);_e=te[0],Ee=te[1]}else{var ve=[le.index,le.index+le.length].map(function(Ue){return Ue<Z||Ue===Z&&re===p.default.sources.USER?Ue:Y>=0?Ue+Y:Math.max(Z,Ue+Y)}),we=a(ve,2);_e=we[0],Ee=we[1]}return new _.Range(_e,Ee-_e)}r.expandConfig=W,r.overload=ee,r.default=X}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function x(b,_){for(var M=0;M<_.length;M++){var T=_[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,_,M){return _&&x(b.prototype,_),M&&x(b,M),b}})(),a=function x(b,_,M){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,_);if(T===void 0){var L=Object.getPrototypeOf(b);return L===null?void 0:x(L,_,M)}else{if("value"in T)return T.value;var D=T.get;return D===void 0?void 0:D.call(M)}},o=i(7),l=h(o),u=i(0),d=h(u);function h(x){return x&&x.__esModule?x:{default:x}}function f(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function p(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function g(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var A=(function(x){g(b,x);function b(){return f(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"formatAt",value:function(M,T,L,D){if(b.compare(this.statics.blotName,L)<0&&d.default.query(L,d.default.Scope.BLOT)){var P=this.isolate(M,T);D&&P.wrap(L,D)}else a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,M,T,L,D)}},{key:"optimize",value:function(M){if(a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,M),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var T=this.parent.isolate(this.offset(),this.length());this.moveChildren(T),T.wrap(this)}}}],[{key:"compare",value:function(M,T){var L=b.order.indexOf(M),D=b.order.indexOf(T);return L>=0||D>=0?L-D:M===T?0:M<T?-1:1}}]),b})(d.default.Inline);A.allowedChildren=[A,d.default.Embed,l.default],A.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],r.default=A}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(0),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function l(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}function u(f,p){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:f}function d(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);f.prototype=Object.create(p&&p.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(f,p):f.__proto__=p)}var h=(function(f){d(p,f);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(a.default.Text);r.default=h}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function _(M,T){for(var L=0;L<T.length;L++){var D=T[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(M,D.key,D)}}return function(M,T,L){return T&&_(M.prototype,T),L&&_(M,L),M}})(),a=function _(M,T,L){M===null&&(M=Function.prototype);var D=Object.getOwnPropertyDescriptor(M,T);if(D===void 0){var P=Object.getPrototypeOf(M);return P===null?void 0:_(P,T,L)}else{if("value"in D)return D.value;var O=D.get;return O===void 0?void 0:O.call(L)}},o=i(54),l=h(o),u=i(10),d=h(u);function h(_){return _&&_.__esModule?_:{default:_}}function f(_,M){if(!(_ instanceof M))throw new TypeError("Cannot call a class as a function")}function p(_,M){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:_}function g(_,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);_.prototype=Object.create(M&&M.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(_,M):_.__proto__=M)}var A=(0,d.default)("quill:events"),x=["selectionchange","mousedown","mouseup","click"];x.forEach(function(_){document.addEventListener(_,function(){for(var M=arguments.length,T=Array(M),L=0;L<M;L++)T[L]=arguments[L];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(D){if(D.__quill&&D.__quill.emitter){var P;(P=D.__quill.emitter).handleDOM.apply(P,T)}})})});var b=(function(_){g(M,_);function M(){f(this,M);var T=p(this,(M.__proto__||Object.getPrototypeOf(M)).call(this));return T.listeners={},T.on("error",A.error),T}return s(M,[{key:"emit",value:function(){A.log.apply(A,arguments),a(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(L){for(var D=arguments.length,P=Array(D>1?D-1:0),O=1;O<D;O++)P[O-1]=arguments[O];(this.listeners[L.type]||[]).forEach(function(F){var U=F.node,B=F.handler;(L.target===U||U.contains(L.target))&&B.apply(void 0,[L].concat(P))})}},{key:"listenDOM",value:function(L,D,P){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push({node:D,handler:P})}}]),M})(l.default);b.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},b.sources={API:"api",SILENT:"silent",USER:"user"},r.default=b}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});function s(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}var a=function o(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,o),this.quill=l,this.options=u};a.DEFAULTS={},r.default=a}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=["error","warn","log","info"],a="warn";function o(u){if(s.indexOf(u)<=s.indexOf(a)){for(var d,h=arguments.length,f=Array(h>1?h-1:0),p=1;p<h;p++)f[p-1]=arguments[p];(d=console)[u].apply(d,f)}}function l(u){return s.reduce(function(d,h){return d[h]=o.bind(console,h,u),d},{})}o.level=l.level=function(u){a=u},r.default=l}),(function(t,r,i){var s=Array.prototype.slice,a=i(52),o=i(53),l=t.exports=function(f,p,g){return g||(g={}),f===p?!0:f instanceof Date&&p instanceof Date?f.getTime()===p.getTime():!f||!p||typeof f!="object"&&typeof p!="object"?g.strict?f===p:f==p:h(f,p,g)};function u(f){return f==null}function d(f){return!(!f||typeof f!="object"||typeof f.length!="number"||typeof f.copy!="function"||typeof f.slice!="function"||f.length>0&&typeof f[0]!="number")}function h(f,p,g){var A,x;if(u(f)||u(p)||f.prototype!==p.prototype)return!1;if(o(f))return o(p)?(f=s.call(f),p=s.call(p),l(f,p,g)):!1;if(d(f)){if(!d(p)||f.length!==p.length)return!1;for(A=0;A<f.length;A++)if(f[A]!==p[A])return!1;return!0}try{var b=a(f),_=a(p)}catch{return!1}if(b.length!=_.length)return!1;for(b.sort(),_.sort(),A=b.length-1;A>=0;A--)if(b[A]!=_[A])return!1;for(A=b.length-1;A>=0;A--)if(x=b[A],!l(f[x],p[x],g))return!1;return typeof f==typeof p}}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(1),a=(function(){function o(l,u,d){d===void 0&&(d={}),this.attrName=l,this.keyName=u;var h=s.Scope.TYPE&s.Scope.ATTRIBUTE;d.scope!=null?this.scope=d.scope&s.Scope.LEVEL|h:this.scope=s.Scope.ATTRIBUTE,d.whitelist!=null&&(this.whitelist=d.whitelist)}return o.keys=function(l){return[].map.call(l.attributes,function(u){return u.name})},o.prototype.add=function(l,u){return this.canAdd(l,u)?(l.setAttribute(this.keyName,u),!0):!1},o.prototype.canAdd=function(l,u){var d=s.query(l,s.Scope.BLOT&(this.scope|s.Scope.TYPE));return d==null?!1:this.whitelist==null?!0:typeof u=="string"?this.whitelist.indexOf(u.replace(/["']/g,""))>-1:this.whitelist.indexOf(u)>-1},o.prototype.remove=function(l){l.removeAttribute(this.keyName)},o.prototype.value=function(l){var u=l.getAttribute(this.keyName);return this.canAdd(l,u)&&u?u:""},o})();r.default=a}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Code=void 0;var s=(function(){function O(F,U){var B=[],z=!0,H=!1,X=void 0;try{for(var W=F[Symbol.iterator](),J;!(z=(J=W.next()).done)&&(B.push(J.value),!(U&&B.length===U));z=!0);}catch(ee){H=!0,X=ee}finally{try{!z&&W.return&&W.return()}finally{if(H)throw X}}return B}return function(F,U){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return O(F,U);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),a=(function(){function O(F,U){for(var B=0;B<U.length;B++){var z=U[B];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(F,z.key,z)}}return function(F,U,B){return U&&O(F.prototype,U),B&&O(F,B),F}})(),o=function O(F,U,B){F===null&&(F=Function.prototype);var z=Object.getOwnPropertyDescriptor(F,U);if(z===void 0){var H=Object.getPrototypeOf(F);return H===null?void 0:O(H,U,B)}else{if("value"in z)return z.value;var X=z.get;return X===void 0?void 0:X.call(B)}},l=i(2),u=_(l),d=i(0),h=_(d),f=i(4),p=_(f),g=i(6),A=_(g),x=i(7),b=_(x);function _(O){return O&&O.__esModule?O:{default:O}}function M(O,F){if(!(O instanceof F))throw new TypeError("Cannot call a class as a function")}function T(O,F){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:O}function L(O,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);O.prototype=Object.create(F&&F.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(O,F):O.__proto__=F)}var D=(function(O){L(F,O);function F(){return M(this,F),T(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F})(A.default);D.blotName="code",D.tagName="CODE";var P=(function(O){L(F,O);function F(){return M(this,F),T(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return a(F,[{key:"delta",value:function(){var B=this,z=this.domNode.textContent;return z.endsWith(` 5817`)&&(z=z.slice(0,-1)),z.split(` 5818`).reduce(function(H,X){return H.insert(X).insert(` 5819`,B.formats())},new u.default)}},{key:"format",value:function(B,z){if(!(B===this.statics.blotName&&z)){var H=this.descendant(b.default,this.length()-1),X=s(H,1),W=X[0];W!=null&&W.deleteAt(W.length()-1,1),o(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,B,z)}}},{key:"formatAt",value:function(B,z,H,X){if(z!==0&&!(h.default.query(H,h.default.Scope.BLOCK)==null||H===this.statics.blotName&&X===this.statics.formats(this.domNode))){var W=this.newlineIndex(B);if(!(W<0||W>=B+z)){var J=this.newlineIndex(B,!0)+1,ee=W-J+1,ae=this.isolate(J,ee),le=ae.next;ae.format(H,X),le instanceof F&&le.formatAt(0,B-J+z-ee,H,X)}}}},{key:"insertAt",value:function(B,z,H){if(H==null){var X=this.descendant(b.default,B),W=s(X,2),J=W[0],ee=W[1];J.insertAt(ee,z)}}},{key:"length",value:function(){var B=this.domNode.textContent.length;return this.domNode.textContent.endsWith(` 5820`)?B:B+1}},{key:"newlineIndex",value:function(B){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(z)return this.domNode.textContent.slice(0,B).lastIndexOf(` 5821`);var H=this.domNode.textContent.slice(B).indexOf(` 5822`);return H>-1?B+H:-1}},{key:"optimize",value:function(B){this.domNode.textContent.endsWith(` 5823`)||this.appendChild(h.default.create("text",` 5824`)),o(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,B);var z=this.next;z!=null&&z.prev===this&&z.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===z.statics.formats(z.domNode)&&(z.optimize(B),z.moveChildren(this),z.remove())}},{key:"replace",value:function(B){o(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"replace",this).call(this,B),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(z){var H=h.default.find(z);H==null?z.parentNode.removeChild(z):H instanceof h.default.Embed?H.remove():H.unwrap()})}}],[{key:"create",value:function(B){var z=o(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,B);return z.setAttribute("spellcheck",!1),z}},{key:"formats",value:function(){return!0}}]),F})(p.default);P.blotName="code-block",P.tagName="PRE",P.TAB=" ",r.Code=D,r.default=P}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},a=(function(){function le(Z,Y){var re=[],_e=!0,Ee=!1,Ae=void 0;try{for(var te=Z[Symbol.iterator](),ve;!(_e=(ve=te.next()).done)&&(re.push(ve.value),!(Y&&re.length===Y));_e=!0);}catch(we){Ee=!0,Ae=we}finally{try{!_e&&te.return&&te.return()}finally{if(Ee)throw Ae}}return re}return function(Z,Y){if(Array.isArray(Z))return Z;if(Symbol.iterator in Object(Z))return le(Z,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function le(Z,Y){for(var re=0;re<Y.length;re++){var _e=Y[re];_e.enumerable=_e.enumerable||!1,_e.configurable=!0,"value"in _e&&(_e.writable=!0),Object.defineProperty(Z,_e.key,_e)}}return function(Z,Y,re){return Y&&le(Z.prototype,Y),re&&le(Z,re),Z}})(),l=i(2),u=z(l),d=i(20),h=z(d),f=i(0),p=z(f),g=i(13),A=z(g),x=i(24),b=z(x),_=i(4),M=z(_),T=i(16),L=z(T),D=i(21),P=z(D),O=i(11),F=z(O),U=i(3),B=z(U);function z(le){return le&&le.__esModule?le:{default:le}}function H(le,Z,Y){return Z in le?Object.defineProperty(le,Z,{value:Y,enumerable:!0,configurable:!0,writable:!0}):le[Z]=Y,le}function X(le,Z){if(!(le instanceof Z))throw new TypeError("Cannot call a class as a function")}var W=/^[ -~]*$/,J=(function(){function le(Z){X(this,le),this.scroll=Z,this.delta=this.getDelta()}return o(le,[{key:"applyDelta",value:function(Y){var re=this,_e=!1;this.scroll.update();var Ee=this.scroll.length();return this.scroll.batchStart(),Y=ae(Y),Y.reduce(function(Ae,te){var ve=te.retain||te.delete||te.insert.length||1,we=te.attributes||{};if(te.insert!=null){if(typeof te.insert=="string"){var Ue=te.insert;Ue.endsWith(` 5825`)&&_e&&(_e=!1,Ue=Ue.slice(0,-1)),Ae>=Ee&&!Ue.endsWith(` 5826`)&&(_e=!0),re.scroll.insertAt(Ae,Ue);var ze=re.scroll.line(Ae),yt=a(ze,2),mt=yt[0],bt=yt[1],dt=(0,B.default)({},(0,_.bubbleFormats)(mt));if(mt instanceof M.default){var St=mt.descendant(p.default.Leaf,bt),kt=a(St,1),Fe=kt[0];dt=(0,B.default)(dt,(0,_.bubbleFormats)(Fe))}we=h.default.attributes.diff(dt,we)||{}}else if(s(te.insert)==="object"){var Ze=Object.keys(te.insert)[0];if(Ze==null)return Ae;re.scroll.insertAt(Ae,Ze,te.insert[Ze])}Ee+=ve}return Object.keys(we).forEach(function(Ye){re.scroll.formatAt(Ae,ve,Ye,we[Ye])}),Ae+ve},0),Y.reduce(function(Ae,te){return typeof te.delete=="number"?(re.scroll.deleteAt(Ae,te.delete),Ae):Ae+(te.retain||te.insert.length||1)},0),this.scroll.batchEnd(),this.update(Y)}},{key:"deleteText",value:function(Y,re){return this.scroll.deleteAt(Y,re),this.update(new u.default().retain(Y).delete(re))}},{key:"formatLine",value:function(Y,re){var _e=this,Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Ee).forEach(function(Ae){if(!(_e.scroll.whitelist!=null&&!_e.scroll.whitelist[Ae])){var te=_e.scroll.lines(Y,Math.max(re,1)),ve=re;te.forEach(function(we){var Ue=we.length();if(!(we instanceof A.default))we.format(Ae,Ee[Ae]);else{var ze=Y-we.offset(_e.scroll),yt=we.newlineIndex(ze+ve)-ze+1;we.formatAt(ze,yt,Ae,Ee[Ae])}ve-=Ue})}}),this.scroll.optimize(),this.update(new u.default().retain(Y).retain(re,(0,P.default)(Ee)))}},{key:"formatText",value:function(Y,re){var _e=this,Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Ee).forEach(function(Ae){_e.scroll.formatAt(Y,re,Ae,Ee[Ae])}),this.update(new u.default().retain(Y).retain(re,(0,P.default)(Ee)))}},{key:"getContents",value:function(Y,re){return this.delta.slice(Y,Y+re)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(Y,re){return Y.concat(re.delta())},new u.default)}},{key:"getFormat",value:function(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_e=[],Ee=[];re===0?this.scroll.path(Y).forEach(function(te){var ve=a(te,1),we=ve[0];we instanceof M.default?_e.push(we):we instanceof p.default.Leaf&&Ee.push(we)}):(_e=this.scroll.lines(Y,re),Ee=this.scroll.descendants(p.default.Leaf,Y,re));var Ae=[_e,Ee].map(function(te){if(te.length===0)return{};for(var ve=(0,_.bubbleFormats)(te.shift());Object.keys(ve).length>0;){var we=te.shift();if(we==null)return ve;ve=ee((0,_.bubbleFormats)(we),ve)}return ve});return B.default.apply(B.default,Ae)}},{key:"getText",value:function(Y,re){return this.getContents(Y,re).filter(function(_e){return typeof _e.insert=="string"}).map(function(_e){return _e.insert}).join("")}},{key:"insertEmbed",value:function(Y,re,_e){return this.scroll.insertAt(Y,re,_e),this.update(new u.default().retain(Y).insert(H({},re,_e)))}},{key:"insertText",value:function(Y,re){var _e=this,Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return re=re.replace(/\r\n/g,` 5827`).replace(/\r/g,` 5828`),this.scroll.insertAt(Y,re),Object.keys(Ee).forEach(function(Ae){_e.scroll.formatAt(Y,re.length,Ae,Ee[Ae])}),this.update(new u.default().retain(Y).insert(re,(0,P.default)(Ee)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var Y=this.scroll.children.head;return Y.statics.blotName!==M.default.blotName||Y.children.length>1?!1:Y.children.head instanceof L.default}},{key:"removeFormat",value:function(Y,re){var _e=this.getText(Y,re),Ee=this.scroll.line(Y+re),Ae=a(Ee,2),te=Ae[0],ve=Ae[1],we=0,Ue=new u.default;te!=null&&(te instanceof A.default?we=te.newlineIndex(ve)-ve+1:we=te.length()-ve,Ue=te.delta().slice(ve,ve+we-1).insert(` 5829`));var ze=this.getContents(Y,re+we),yt=ze.diff(new u.default().insert(_e).concat(Ue)),mt=new u.default().retain(Y).concat(yt);return this.applyDelta(mt)}},{key:"update",value:function(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Ee=this.delta;if(re.length===1&&re[0].type==="characterData"&&re[0].target.data.match(W)&&p.default.find(re[0].target)){var Ae=p.default.find(re[0].target),te=(0,_.bubbleFormats)(Ae),ve=Ae.offset(this.scroll),we=re[0].oldValue.replace(b.default.CONTENTS,""),Ue=new u.default().insert(we),ze=new u.default().insert(Ae.value()),yt=new u.default().retain(ve).concat(Ue.diff(ze,_e));Y=yt.reduce(function(mt,bt){return bt.insert?mt.insert(bt.insert,te):mt.push(bt)},new u.default),this.delta=Ee.compose(Y)}else this.delta=this.getDelta(),(!Y||!(0,F.default)(Ee.compose(Y),this.delta))&&(Y=Ee.diff(this.delta,_e));return Y}}]),le})();function ee(le,Z){return Object.keys(Z).reduce(function(Y,re){return le[re]==null||(Z[re]===le[re]?Y[re]=Z[re]:Array.isArray(Z[re])?Z[re].indexOf(le[re])<0&&(Y[re]=Z[re].concat([le[re]])):Y[re]=[Z[re],le[re]]),Y},{})}function ae(le){return le.reduce(function(Z,Y){if(Y.insert===1){var re=(0,P.default)(Y.attributes);return delete re.image,Z.insert({image:Y.attributes.image},re)}if(Y.attributes!=null&&(Y.attributes.list===!0||Y.attributes.bullet===!0)&&(Y=(0,P.default)(Y),Y.attributes.list?Y.attributes.list="ordered":(Y.attributes.list="bullet",delete Y.attributes.bullet)),typeof Y.insert=="string"){var _e=Y.insert.replace(/\r\n/g,` 5830`).replace(/\r/g,` 5831`);return Z.insert(_e,Y.attributes)}return Z.push(Y)},new u.default)}r.default=J}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Range=void 0;var s=(function(){function O(F,U){var B=[],z=!0,H=!1,X=void 0;try{for(var W=F[Symbol.iterator](),J;!(z=(J=W.next()).done)&&(B.push(J.value),!(U&&B.length===U));z=!0);}catch(ee){H=!0,X=ee}finally{try{!z&&W.return&&W.return()}finally{if(H)throw X}}return B}return function(F,U){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return O(F,U);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),a=(function(){function O(F,U){for(var B=0;B<U.length;B++){var z=U[B];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(F,z.key,z)}}return function(F,U,B){return U&&O(F.prototype,U),B&&O(F,B),F}})(),o=i(0),l=b(o),u=i(21),d=b(u),h=i(11),f=b(h),p=i(8),g=b(p),A=i(10),x=b(A);function b(O){return O&&O.__esModule?O:{default:O}}function _(O){if(Array.isArray(O)){for(var F=0,U=Array(O.length);F<O.length;F++)U[F]=O[F];return U}else return Array.from(O)}function M(O,F){if(!(O instanceof F))throw new TypeError("Cannot call a class as a function")}var T=(0,x.default)("quill:selection"),L=function O(F){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;M(this,O),this.index=F,this.length=U},D=(function(){function O(F,U){var B=this;M(this,O),this.emitter=U,this.scroll=F,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=l.default.create("cursor",this),this.lastRange=this.savedRange=new L(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){B.mouseDown||setTimeout(B.update.bind(B,g.default.sources.USER),1)}),this.emitter.on(g.default.events.EDITOR_CHANGE,function(z,H){z===g.default.events.TEXT_CHANGE&&H.length()>0&&B.update(g.default.sources.SILENT)}),this.emitter.on(g.default.events.SCROLL_BEFORE_UPDATE,function(){if(B.hasFocus()){var z=B.getNativeRange();z!=null&&z.start.node!==B.cursor.textNode&&B.emitter.once(g.default.events.SCROLL_UPDATE,function(){try{B.setNativeRange(z.start.node,z.start.offset,z.end.node,z.end.offset)}catch{}})}}),this.emitter.on(g.default.events.SCROLL_OPTIMIZE,function(z,H){if(H.range){var X=H.range,W=X.startNode,J=X.startOffset,ee=X.endNode,ae=X.endOffset;B.setNativeRange(W,J,ee,ae)}}),this.update(g.default.sources.SILENT)}return a(O,[{key:"handleComposition",value:function(){var U=this;this.root.addEventListener("compositionstart",function(){U.composing=!0}),this.root.addEventListener("compositionend",function(){if(U.composing=!1,U.cursor.parent){var B=U.cursor.restore();if(!B)return;setTimeout(function(){U.setNativeRange(B.startNode,B.startOffset,B.endNode,B.endOffset)},1)}})}},{key:"handleDragging",value:function(){var U=this;this.emitter.listenDOM("mousedown",document.body,function(){U.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){U.mouseDown=!1,U.update(g.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(U,B){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[U])){this.scroll.update();var z=this.getNativeRange();if(!(z==null||!z.native.collapsed||l.default.query(U,l.default.Scope.BLOCK))){if(z.start.node!==this.cursor.textNode){var H=l.default.find(z.start.node,!1);if(H==null)return;if(H instanceof l.default.Leaf){var X=H.split(z.start.offset);H.parent.insertBefore(this.cursor,X)}else H.insertBefore(this.cursor,z.start.node);this.cursor.attach()}this.cursor.format(U,B),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(U){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=this.scroll.length();U=Math.min(U,z-1),B=Math.min(U+B,z-1)-U;var H=void 0,X=this.scroll.leaf(U),W=s(X,2),J=W[0],ee=W[1];if(J==null)return null;var ae=J.position(ee,!0),le=s(ae,2);H=le[0],ee=le[1];var Z=document.createRange();if(B>0){Z.setStart(H,ee);var Y=this.scroll.leaf(U+B),re=s(Y,2);if(J=re[0],ee=re[1],J==null)return null;var _e=J.position(ee,!0),Ee=s(_e,2);return H=Ee[0],ee=Ee[1],Z.setEnd(H,ee),Z.getBoundingClientRect()}else{var Ae="left",te=void 0;return H instanceof Text?(ee<H.data.length?(Z.setStart(H,ee),Z.setEnd(H,ee+1)):(Z.setStart(H,ee-1),Z.setEnd(H,ee),Ae="right"),te=Z.getBoundingClientRect()):(te=J.domNode.getBoundingClientRect(),ee>0&&(Ae="right")),{bottom:te.top+te.height,height:te.height,left:te[Ae],right:te[Ae],top:te.top,width:0}}}},{key:"getNativeRange",value:function(){var U=document.getSelection();if(U==null||U.rangeCount<=0)return null;var B=U.getRangeAt(0);if(B==null)return null;var z=this.normalizeNative(B);return T.info("getNativeRange",z),z}},{key:"getRange",value:function(){var U=this.getNativeRange();if(U==null)return[null,null];var B=this.normalizedToRange(U);return[B,U]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(U){var B=this,z=[[U.start.node,U.start.offset]];U.native.collapsed||z.push([U.end.node,U.end.offset]);var H=z.map(function(J){var ee=s(J,2),ae=ee[0],le=ee[1],Z=l.default.find(ae,!0),Y=Z.offset(B.scroll);return le===0?Y:Z instanceof l.default.Container?Y+Z.length():Y+Z.index(ae,le)}),X=Math.min(Math.max.apply(Math,_(H)),this.scroll.length()-1),W=Math.min.apply(Math,[X].concat(_(H)));return new L(W,X-W)}},{key:"normalizeNative",value:function(U){if(!P(this.root,U.startContainer)||!U.collapsed&&!P(this.root,U.endContainer))return null;var B={start:{node:U.startContainer,offset:U.startOffset},end:{node:U.endContainer,offset:U.endOffset},native:U};return[B.start,B.end].forEach(function(z){for(var H=z.node,X=z.offset;!(H instanceof Text)&&H.childNodes.length>0;)if(H.childNodes.length>X)H=H.childNodes[X],X=0;else if(H.childNodes.length===X)H=H.lastChild,X=H instanceof Text?H.data.length:H.childNodes.length+1;else break;z.node=H,z.offset=X}),B}},{key:"rangeToNative",value:function(U){var B=this,z=U.collapsed?[U.index]:[U.index,U.index+U.length],H=[],X=this.scroll.length();return z.forEach(function(W,J){W=Math.min(X-1,W);var ee=void 0,ae=B.scroll.leaf(W),le=s(ae,2),Z=le[0],Y=le[1],re=Z.position(Y,J!==0),_e=s(re,2);ee=_e[0],Y=_e[1],H.push(ee,Y)}),H.length<2&&(H=H.concat(H)),H}},{key:"scrollIntoView",value:function(U){var B=this.lastRange;if(B!=null){var z=this.getBounds(B.index,B.length);if(z!=null){var H=this.scroll.length()-1,X=this.scroll.line(Math.min(B.index,H)),W=s(X,1),J=W[0],ee=J;if(B.length>0){var ae=this.scroll.line(Math.min(B.index+B.length,H)),le=s(ae,1);ee=le[0]}if(!(J==null||ee==null)){var Z=U.getBoundingClientRect();z.top<Z.top?U.scrollTop-=Z.top-z.top:z.bottom>Z.bottom&&(U.scrollTop+=z.bottom-Z.bottom)}}}}},{key:"setNativeRange",value:function(U,B){var z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:U,H=arguments.length>3&&arguments[3]!==void 0?arguments[3]:B,X=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(T.info("setNativeRange",U,B,z,H),!(U!=null&&(this.root.parentNode==null||U.parentNode==null||z.parentNode==null))){var W=document.getSelection();if(W!=null)if(U!=null){this.hasFocus()||this.root.focus();var J=(this.getNativeRange()||{}).native;if(J==null||X||U!==J.startContainer||B!==J.startOffset||z!==J.endContainer||H!==J.endOffset){U.tagName=="BR"&&(B=[].indexOf.call(U.parentNode.childNodes,U),U=U.parentNode),z.tagName=="BR"&&(H=[].indexOf.call(z.parentNode.childNodes,z),z=z.parentNode);var ee=document.createRange();ee.setStart(U,B),ee.setEnd(z,H),W.removeAllRanges(),W.addRange(ee)}}else W.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(U){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.default.sources.API;if(typeof B=="string"&&(z=B,B=!1),T.info("setRange",U),U!=null){var H=this.rangeToNative(U);this.setNativeRange.apply(this,_(H).concat([B]))}else this.setNativeRange(null);this.update(z)}},{key:"update",value:function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g.default.sources.USER,B=this.lastRange,z=this.getRange(),H=s(z,2),X=H[0],W=H[1];if(this.lastRange=X,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,f.default)(B,this.lastRange)){var J;!this.composing&&W!=null&&W.native.collapsed&&W.start.node!==this.cursor.textNode&&this.cursor.restore();var ee=[g.default.events.SELECTION_CHANGE,(0,d.default)(this.lastRange),(0,d.default)(B),U];if((J=this.emitter).emit.apply(J,[g.default.events.EDITOR_CHANGE].concat(ee)),U!==g.default.sources.SILENT){var ae;(ae=this.emitter).emit.apply(ae,ee)}}}}]),O})();function P(O,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),O.contains(F)}r.Range=L,r.default=D}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function g(A,x){for(var b=0;b<x.length;b++){var _=x[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(A,_.key,_)}}return function(A,x,b){return x&&g(A.prototype,x),b&&g(A,b),A}})(),a=function g(A,x,b){A===null&&(A=Function.prototype);var _=Object.getOwnPropertyDescriptor(A,x);if(_===void 0){var M=Object.getPrototypeOf(A);return M===null?void 0:g(M,x,b)}else{if("value"in _)return _.value;var T=_.get;return T===void 0?void 0:T.call(b)}},o=i(0),l=u(o);function u(g){return g&&g.__esModule?g:{default:g}}function d(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function h(g,A){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:g}function f(g,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);g.prototype=Object.create(A&&A.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(g,A):g.__proto__=A)}var p=(function(g){f(A,g);function A(){return d(this,A),h(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return s(A,[{key:"insertInto",value:function(b,_){b.children.length===0?a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertInto",this).call(this,b,_):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),A})(l.default.Embed);p.blotName="break",p.tagName="BR",r.default=p}),(function(t,r,i){var s=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,p){f.__proto__=p}||function(f,p){for(var g in p)p.hasOwnProperty(g)&&(f[g]=p[g])};return function(f,p){h(f,p);function g(){this.constructor=f}f.prototype=p===null?Object.create(p):(g.prototype=p.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(44),o=i(30),l=i(1),u=(function(h){s(f,h);function f(p){var g=h.call(this,p)||this;return g.build(),g}return f.prototype.appendChild=function(p){this.insertBefore(p)},f.prototype.attach=function(){h.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},f.prototype.build=function(){var p=this;this.children=new a.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(g){try{var A=d(g);p.insertBefore(A,p.children.head||void 0)}catch(x){if(x instanceof l.ParchmentError)return;throw x}})},f.prototype.deleteAt=function(p,g){if(p===0&&g===this.length())return this.remove();this.children.forEachAt(p,g,function(A,x,b){A.deleteAt(x,b)})},f.prototype.descendant=function(p,g){var A=this.children.find(g),x=A[0],b=A[1];return p.blotName==null&&p(x)||p.blotName!=null&&x instanceof p?[x,b]:x instanceof f?x.descendant(p,b):[null,-1]},f.prototype.descendants=function(p,g,A){g===void 0&&(g=0),A===void 0&&(A=Number.MAX_VALUE);var x=[],b=A;return this.children.forEachAt(g,A,function(_,M,T){(p.blotName==null&&p(_)||p.blotName!=null&&_ instanceof p)&&x.push(_),_ instanceof f&&(x=x.concat(_.descendants(p,M,b))),b-=T}),x},f.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),h.prototype.detach.call(this)},f.prototype.formatAt=function(p,g,A,x){this.children.forEachAt(p,g,function(b,_,M){b.formatAt(_,M,A,x)})},f.prototype.insertAt=function(p,g,A){var x=this.children.find(p),b=x[0],_=x[1];if(b)b.insertAt(_,g,A);else{var M=A==null?l.create("text",g):l.create(g,A);this.appendChild(M)}},f.prototype.insertBefore=function(p,g){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(A){return p instanceof A}))throw new l.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,g)},f.prototype.length=function(){return this.children.reduce(function(p,g){return p+g.length()},0)},f.prototype.moveChildren=function(p,g){this.children.forEach(function(A){p.insertBefore(A,g)})},f.prototype.optimize=function(p){if(h.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var g=l.create(this.statics.defaultChild);this.appendChild(g),g.optimize(p)}else this.remove()},f.prototype.path=function(p,g){g===void 0&&(g=!1);var A=this.children.find(p,g),x=A[0],b=A[1],_=[[this,p]];return x instanceof f?_.concat(x.path(b,g)):(x!=null&&_.push([x,b]),_)},f.prototype.removeChild=function(p){this.children.remove(p)},f.prototype.replace=function(p){p instanceof f&&p.moveChildren(this),h.prototype.replace.call(this,p)},f.prototype.split=function(p,g){if(g===void 0&&(g=!1),!g){if(p===0)return this;if(p===this.length())return this.next}var A=this.clone();return this.parent.insertBefore(A,this.next),this.children.forEachAt(p,this.length(),function(x,b,_){x=x.split(b,g),A.appendChild(x)}),A},f.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},f.prototype.update=function(p,g){var A=this,x=[],b=[];p.forEach(function(_){_.target===A.domNode&&_.type==="childList"&&(x.push.apply(x,_.addedNodes),b.push.apply(b,_.removedNodes))}),b.forEach(function(_){if(!(_.parentNode!=null&&_.tagName!=="IFRAME"&&document.body.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var M=l.find(_);M!=null&&(M.domNode.parentNode==null||M.domNode.parentNode===A.domNode)&&M.detach()}}),x.filter(function(_){return _.parentNode==A.domNode}).sort(function(_,M){return _===M?0:_.compareDocumentPosition(M)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(_){var M=null;_.nextSibling!=null&&(M=l.find(_.nextSibling));var T=d(_);(T.next!=M||T.next==null)&&(T.parent!=null&&T.parent.removeChild(A),A.insertBefore(T,M||void 0))})},f})(o.default);function d(h){var f=l.find(h);if(f==null)try{f=l.create(h)}catch{f=l.create(l.Scope.INLINE),[].slice.call(h.childNodes).forEach(function(g){f.domNode.appendChild(g)}),h.parentNode&&h.parentNode.replaceChild(f.domNode,h),f.attach()}return f}r.default=u}),(function(t,r,i){var s=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,p){f.__proto__=p}||function(f,p){for(var g in p)p.hasOwnProperty(g)&&(f[g]=p[g])};return function(f,p){h(f,p);function g(){this.constructor=f}f.prototype=p===null?Object.create(p):(g.prototype=p.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12),o=i(31),l=i(17),u=i(1),d=(function(h){s(f,h);function f(p){var g=h.call(this,p)||this;return g.attributes=new o.default(g.domNode),g}return f.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},f.prototype.format=function(p,g){var A=u.query(p);A instanceof a.default?this.attributes.attribute(A,g):g&&A!=null&&(p!==this.statics.blotName||this.formats()[p]!==g)&&this.replaceWith(p,g)},f.prototype.formats=function(){var p=this.attributes.values(),g=this.statics.formats(this.domNode);return g!=null&&(p[this.statics.blotName]=g),p},f.prototype.replaceWith=function(p,g){var A=h.prototype.replaceWith.call(this,p,g);return this.attributes.copy(A),A},f.prototype.update=function(p,g){var A=this;h.prototype.update.call(this,p,g),p.some(function(x){return x.target===A.domNode&&x.type==="attributes"})&&this.attributes.build()},f.prototype.wrap=function(p,g){var A=h.prototype.wrap.call(this,p,g);return A instanceof f&&A.statics.scope===this.statics.scope&&this.attributes.move(A),A},f})(l.default);r.default=d}),(function(t,r,i){var s=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var f in h)h.hasOwnProperty(f)&&(d[f]=h[f])};return function(d,h){u(d,h);function f(){this.constructor=d}d.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(30),o=i(1),l=(function(u){s(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.value=function(h){return!0},d.prototype.index=function(h,f){return this.domNode===h||this.domNode.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(f,1):-1},d.prototype.position=function(h,f){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return h>0&&(p+=1),[this.parent.domNode,p]},d.prototype.value=function(){var h;return h={},h[this.statics.blotName]=this.statics.value(this.domNode)||!0,h},d.scope=o.Scope.INLINE_BLOT,d})(a.default);r.default=l}),(function(t,r,i){var s=i(11),a=i(3),o={attributes:{compose:function(u,d,h){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});var f=a(!0,{},d);h||(f=Object.keys(f).reduce(function(g,A){return f[A]!=null&&(g[A]=f[A]),g},{}));for(var p in u)u[p]!==void 0&&d[p]===void 0&&(f[p]=u[p]);return Object.keys(f).length>0?f:void 0},diff:function(u,d){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});var h=Object.keys(u).concat(Object.keys(d)).reduce(function(f,p){return s(u[p],d[p])||(f[p]=d[p]===void 0?null:d[p]),f},{});return Object.keys(h).length>0?h:void 0},transform:function(u,d,h){if(typeof u!="object")return d;if(typeof d=="object"){if(!h)return d;var f=Object.keys(d).reduce(function(p,g){return u[g]===void 0&&(p[g]=d[g]),p},{});return Object.keys(f).length>0?f:void 0}}},iterator:function(u){return new l(u)},length:function(u){return typeof u.delete=="number"?u.delete:typeof u.retain=="number"?u.retain:typeof u.insert=="string"?u.insert.length:1}};function l(u){this.ops=u,this.index=0,this.offset=0}l.prototype.hasNext=function(){return this.peekLength()<1/0},l.prototype.next=function(u){u||(u=1/0);var d=this.ops[this.index];if(d){var h=this.offset,f=o.length(d);if(u>=f-h?(u=f-h,this.index+=1,this.offset=0):this.offset+=u,typeof d.delete=="number")return{delete:u};var p={};return d.attributes&&(p.attributes=d.attributes),typeof d.retain=="number"?p.retain=u:typeof d.insert=="string"?p.insert=d.insert.substr(h,u):p.insert=d.insert,p}else return{retain:1/0}},l.prototype.peek=function(){return this.ops[this.index]},l.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},l.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},l.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var u=this.offset,d=this.index,h=this.next(),f=this.ops.slice(this.index);return this.offset=u,this.index=d,[h].concat(f)}else return[]},t.exports=o}),(function(t,r){var i=(function(){function s(A,x){return x!=null&&A instanceof x}var a;try{a=Map}catch{a=function(){}}var o;try{o=Set}catch{o=function(){}}var l;try{l=Promise}catch{l=function(){}}function u(A,x,b,_,M){typeof x=="object"&&(b=x.depth,_=x.prototype,M=x.includeNonEnumerable,x=x.circular);var T=[],L=[],D=typeof Buffer<"u";typeof x>"u"&&(x=!0),typeof b>"u"&&(b=1/0);function P(O,F){if(O===null)return null;if(F===0)return O;var U,B;if(typeof O!="object")return O;if(s(O,a))U=new a;else if(s(O,o))U=new o;else if(s(O,l))U=new l(function(Z,Y){O.then(function(re){Z(P(re,F-1))},function(re){Y(P(re,F-1))})});else if(u.__isArray(O))U=[];else if(u.__isRegExp(O))U=new RegExp(O.source,g(O)),O.lastIndex&&(U.lastIndex=O.lastIndex);else if(u.__isDate(O))U=new Date(O.getTime());else{if(D&&Buffer.isBuffer(O))return Buffer.allocUnsafe?U=Buffer.allocUnsafe(O.length):U=new Buffer(O.length),O.copy(U),U;s(O,Error)?U=Object.create(O):typeof _>"u"?(B=Object.getPrototypeOf(O),U=Object.create(B)):(U=Object.create(_),B=_)}if(x){var z=T.indexOf(O);if(z!=-1)return L[z];T.push(O),L.push(U)}s(O,a)&&O.forEach(function(Z,Y){var re=P(Y,F-1),_e=P(Z,F-1);U.set(re,_e)}),s(O,o)&&O.forEach(function(Z){var Y=P(Z,F-1);U.add(Y)});for(var H in O){var X;B&&(X=Object.getOwnPropertyDescriptor(B,H)),!(X&&X.set==null)&&(U[H]=P(O[H],F-1))}if(Object.getOwnPropertySymbols)for(var W=Object.getOwnPropertySymbols(O),H=0;H<W.length;H++){var J=W[H],ee=Object.getOwnPropertyDescriptor(O,J);ee&&!ee.enumerable&&!M||(U[J]=P(O[J],F-1),ee.enumerable||Object.defineProperty(U,J,{enumerable:!1}))}if(M)for(var ae=Object.getOwnPropertyNames(O),H=0;H<ae.length;H++){var le=ae[H],ee=Object.getOwnPropertyDescriptor(O,le);ee&&ee.enumerable||(U[le]=P(O[le],F-1),Object.defineProperty(U,le,{enumerable:!1}))}return U}return P(A,b)}u.clonePrototype=function(x){if(x===null)return null;var b=function(){};return b.prototype=x,new b};function d(A){return Object.prototype.toString.call(A)}u.__objToStr=d;function h(A){return typeof A=="object"&&d(A)==="[object Date]"}u.__isDate=h;function f(A){return typeof A=="object"&&d(A)==="[object Array]"}u.__isArray=f;function p(A){return typeof A=="object"&&d(A)==="[object RegExp]"}u.__isRegExp=p;function g(A){var x="";return A.global&&(x+="g"),A.ignoreCase&&(x+="i"),A.multiline&&(x+="m"),x}return u.__getRegExpFlags=g,u})();typeof t=="object"&&t.exports&&(t.exports=i)}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function U(B,z){var H=[],X=!0,W=!1,J=void 0;try{for(var ee=B[Symbol.iterator](),ae;!(X=(ae=ee.next()).done)&&(H.push(ae.value),!(z&&H.length===z));X=!0);}catch(le){W=!0,J=le}finally{try{!X&&ee.return&&ee.return()}finally{if(W)throw J}}return H}return function(B,z){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return U(B,z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),a=(function(){function U(B,z){for(var H=0;H<z.length;H++){var X=z[H];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(B,X.key,X)}}return function(B,z,H){return z&&U(B.prototype,z),H&&U(B,H),B}})(),o=function U(B,z,H){B===null&&(B=Function.prototype);var X=Object.getOwnPropertyDescriptor(B,z);if(X===void 0){var W=Object.getPrototypeOf(B);return W===null?void 0:U(W,z,H)}else{if("value"in X)return X.value;var J=X.get;return J===void 0?void 0:J.call(H)}},l=i(0),u=T(l),d=i(8),h=T(d),f=i(4),p=T(f),g=i(16),A=T(g),x=i(13),b=T(x),_=i(25),M=T(_);function T(U){return U&&U.__esModule?U:{default:U}}function L(U,B){if(!(U instanceof B))throw new TypeError("Cannot call a class as a function")}function D(U,B){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B&&(typeof B=="object"||typeof B=="function")?B:U}function P(U,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);U.prototype=Object.create(B&&B.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(U,B):U.__proto__=B)}function O(U){return U instanceof p.default||U instanceof f.BlockEmbed}var F=(function(U){P(B,U);function B(z,H){L(this,B);var X=D(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,z));return X.emitter=H.emitter,Array.isArray(H.whitelist)&&(X.whitelist=H.whitelist.reduce(function(W,J){return W[J]=!0,W},{})),X.domNode.addEventListener("DOMNodeInserted",function(){}),X.optimize(),X.enable(),X}return a(B,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(H,X){var W=this.line(H),J=s(W,2),ee=J[0],ae=J[1],le=this.line(H+X),Z=s(le,1),Y=Z[0];if(o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"deleteAt",this).call(this,H,X),Y!=null&&ee!==Y&&ae>0){if(ee instanceof f.BlockEmbed||Y instanceof f.BlockEmbed){this.optimize();return}if(ee instanceof b.default){var re=ee.newlineIndex(ee.length(),!0);if(re>-1&&(ee=ee.split(re+1),ee===Y)){this.optimize();return}}else if(Y instanceof b.default){var _e=Y.newlineIndex(0);_e>-1&&Y.split(_e+1)}var Ee=Y.children.head instanceof A.default?null:Y.children.head;ee.moveChildren(Y,Ee),ee.remove()}this.optimize()}},{key:"enable",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",H)}},{key:"formatAt",value:function(H,X,W,J){this.whitelist!=null&&!this.whitelist[W]||(o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"formatAt",this).call(this,H,X,W,J),this.optimize())}},{key:"insertAt",value:function(H,X,W){if(!(W!=null&&this.whitelist!=null&&!this.whitelist[X])){if(H>=this.length())if(W==null||u.default.query(X,u.default.Scope.BLOCK)==null){var J=u.default.create(this.statics.defaultChild);this.appendChild(J),W==null&&X.endsWith(` 5832`)&&(X=X.slice(0,-1)),J.insertAt(0,X,W)}else{var ee=u.default.create(X,W);this.appendChild(ee)}else o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"insertAt",this).call(this,H,X,W);this.optimize()}}},{key:"insertBefore",value:function(H,X){if(H.statics.scope===u.default.Scope.INLINE_BLOT){var W=u.default.create(this.statics.defaultChild);W.appendChild(H),H=W}o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"insertBefore",this).call(this,H,X)}},{key:"leaf",value:function(H){return this.path(H).pop()||[null,-1]}},{key:"line",value:function(H){return H===this.length()?this.line(H-1):this.descendant(O,H)}},{key:"lines",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,W=function J(ee,ae,le){var Z=[],Y=le;return ee.children.forEachAt(ae,le,function(re,_e,Ee){O(re)?Z.push(re):re instanceof u.default.Container&&(Z=Z.concat(J(re,_e,Y))),Y-=Ee}),Z};return W(this,H,X)}},{key:"optimize",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"optimize",this).call(this,H,X),H.length>0&&this.emitter.emit(h.default.events.SCROLL_OPTIMIZE,H,X))}},{key:"path",value:function(H){return o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"path",this).call(this,H).slice(1)}},{key:"update",value:function(H){if(this.batch!==!0){var X=h.default.sources.USER;typeof H=="string"&&(X=H),Array.isArray(H)||(H=this.observer.takeRecords()),H.length>0&&this.emitter.emit(h.default.events.SCROLL_BEFORE_UPDATE,X,H),o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"update",this).call(this,H.concat([])),H.length>0&&this.emitter.emit(h.default.events.SCROLL_UPDATE,X,H)}}}]),B})(u.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[p.default,f.BlockEmbed,M.default],r.default=F}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},a=(function(){function te(ve,we){var Ue=[],ze=!0,yt=!1,mt=void 0;try{for(var bt=ve[Symbol.iterator](),dt;!(ze=(dt=bt.next()).done)&&(Ue.push(dt.value),!(we&&Ue.length===we));ze=!0);}catch(St){yt=!0,mt=St}finally{try{!ze&&bt.return&&bt.return()}finally{if(yt)throw mt}}return Ue}return function(ve,we){if(Array.isArray(ve))return ve;if(Symbol.iterator in Object(ve))return te(ve,we);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function te(ve,we){for(var Ue=0;Ue<we.length;Ue++){var ze=we[Ue];ze.enumerable=ze.enumerable||!1,ze.configurable=!0,"value"in ze&&(ze.writable=!0),Object.defineProperty(ve,ze.key,ze)}}return function(ve,we,Ue){return we&&te(ve.prototype,we),Ue&&te(ve,Ue),ve}})(),l=i(21),u=U(l),d=i(11),h=U(d),f=i(3),p=U(f),g=i(2),A=U(g),x=i(20),b=U(x),_=i(0),M=U(_),T=i(5),L=U(T),D=i(10),P=U(D),O=i(9),F=U(O);function U(te){return te&&te.__esModule?te:{default:te}}function B(te,ve,we){return ve in te?Object.defineProperty(te,ve,{value:we,enumerable:!0,configurable:!0,writable:!0}):te[ve]=we,te}function z(te,ve){if(!(te instanceof ve))throw new TypeError("Cannot call a class as a function")}function H(te,ve){if(!te)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ve&&(typeof ve=="object"||typeof ve=="function")?ve:te}function X(te,ve){if(typeof ve!="function"&&ve!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ve);te.prototype=Object.create(ve&&ve.prototype,{constructor:{value:te,enumerable:!1,writable:!0,configurable:!0}}),ve&&(Object.setPrototypeOf?Object.setPrototypeOf(te,ve):te.__proto__=ve)}var W=(0,P.default)("quill:keyboard"),J=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",ee=(function(te){X(ve,te),o(ve,null,[{key:"match",value:function(Ue,ze){return ze=Ae(ze),["altKey","ctrlKey","metaKey","shiftKey"].some(function(yt){return!!ze[yt]!==Ue[yt]&&ze[yt]!==null})?!1:ze.key===(Ue.which||Ue.keyCode)}}]);function ve(we,Ue){z(this,ve);var ze=H(this,(ve.__proto__||Object.getPrototypeOf(ve)).call(this,we,Ue));return ze.bindings={},Object.keys(ze.options.bindings).forEach(function(yt){yt==="list autofill"&&we.scroll.whitelist!=null&&!we.scroll.whitelist.list||ze.options.bindings[yt]&&ze.addBinding(ze.options.bindings[yt])}),ze.addBinding({key:ve.keys.ENTER,shiftKey:null},re),ze.addBinding({key:ve.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ze.addBinding({key:ve.keys.BACKSPACE},{collapsed:!0},le),ze.addBinding({key:ve.keys.DELETE},{collapsed:!0},Z)):(ze.addBinding({key:ve.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},le),ze.addBinding({key:ve.keys.DELETE},{collapsed:!0,suffix:/^.?$/},Z)),ze.addBinding({key:ve.keys.BACKSPACE},{collapsed:!1},Y),ze.addBinding({key:ve.keys.DELETE},{collapsed:!1},Y),ze.addBinding({key:ve.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},le),ze.listen(),ze}return o(ve,[{key:"addBinding",value:function(Ue){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},yt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},mt=Ae(Ue);if(mt==null||mt.key==null)return W.warn("Attempted to add invalid keyboard binding",mt);typeof ze=="function"&&(ze={handler:ze}),typeof yt=="function"&&(yt={handler:yt}),mt=(0,p.default)(mt,ze,yt),this.bindings[mt.key]=this.bindings[mt.key]||[],this.bindings[mt.key].push(mt)}},{key:"listen",value:function(){var Ue=this;this.quill.root.addEventListener("keydown",function(ze){if(!ze.defaultPrevented){var yt=ze.which||ze.keyCode,mt=(Ue.bindings[yt]||[]).filter(function(ke){return ve.match(ze,ke)});if(mt.length!==0){var bt=Ue.quill.getSelection();if(!(bt==null||!Ue.quill.hasFocus())){var dt=Ue.quill.getLine(bt.index),St=a(dt,2),kt=St[0],Fe=St[1],Ze=Ue.quill.getLeaf(bt.index),Ye=a(Ze,2),ft=Ye[0],At=Ye[1],Ce=bt.length===0?[ft,At]:Ue.quill.getLeaf(bt.index+bt.length),Se=a(Ce,2),qe=Se[0],pt=Se[1],Te=ft instanceof M.default.Text?ft.value().slice(0,At):"",oe=qe instanceof M.default.Text?qe.value().slice(pt):"",ge={collapsed:bt.length===0,empty:bt.length===0&&kt.length()<=1,format:Ue.quill.getFormat(bt),offset:Fe,prefix:Te,suffix:oe},Ne=mt.some(function(ke){if(ke.collapsed!=null&&ke.collapsed!==ge.collapsed||ke.empty!=null&&ke.empty!==ge.empty||ke.offset!=null&&ke.offset!==ge.offset)return!1;if(Array.isArray(ke.format)){if(ke.format.every(function(Xe){return ge.format[Xe]==null}))return!1}else if(s(ke.format)==="object"&&!Object.keys(ke.format).every(function(Xe){return ke.format[Xe]===!0?ge.format[Xe]!=null:ke.format[Xe]===!1?ge.format[Xe]==null:(0,h.default)(ke.format[Xe],ge.format[Xe])}))return!1;return ke.prefix!=null&&!ke.prefix.test(ge.prefix)||ke.suffix!=null&&!ke.suffix.test(ge.suffix)?!1:ke.handler.call(Ue,bt,ge)!==!0});Ne&&ze.preventDefault()}}}})}}]),ve})(F.default);ee.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},ee.DEFAULTS={bindings:{bold:Ee("bold"),italic:Ee("italic"),underline:Ee("underline"),indent:{key:ee.keys.TAB,format:["blockquote","indent","list"],handler:function(ve,we){if(we.collapsed&&we.offset!==0)return!0;this.quill.format("indent","+1",L.default.sources.USER)}},outdent:{key:ee.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(ve,we){if(we.collapsed&&we.offset!==0)return!0;this.quill.format("indent","-1",L.default.sources.USER)}},"outdent backspace":{key:ee.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(ve,we){we.format.indent!=null?this.quill.format("indent","-1",L.default.sources.USER):we.format.list!=null&&this.quill.format("list",!1,L.default.sources.USER)}},"indent code-block":_e(!0),"outdent code-block":_e(!1),"remove tab":{key:ee.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(ve){this.quill.deleteText(ve.index-1,1,L.default.sources.USER)}},tab:{key:ee.keys.TAB,handler:function(ve){this.quill.history.cutoff();var we=new A.default().retain(ve.index).delete(ve.length).insert(" ");this.quill.updateContents(we,L.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ve.index+1,L.default.sources.SILENT)}},"list empty enter":{key:ee.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(ve,we){this.quill.format("list",!1,L.default.sources.USER),we.format.indent&&this.quill.format("indent",!1,L.default.sources.USER)}},"checklist enter":{key:ee.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(ve){var we=this.quill.getLine(ve.index),Ue=a(we,2),ze=Ue[0],yt=Ue[1],mt=(0,p.default)({},ze.formats(),{list:"checked"}),bt=new A.default().retain(ve.index).insert(` 5833`,mt).retain(ze.length()-yt-1).retain(1,{list:"unchecked"});this.quill.updateContents(bt,L.default.sources.USER),this.quill.setSelection(ve.index+1,L.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:ee.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(ve,we){var Ue=this.quill.getLine(ve.index),ze=a(Ue,2),yt=ze[0],mt=ze[1],bt=new A.default().retain(ve.index).insert(` 5834`,we.format).retain(yt.length()-mt-1).retain(1,{header:null});this.quill.updateContents(bt,L.default.sources.USER),this.quill.setSelection(ve.index+1,L.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(ve,we){var Ue=we.prefix.length,ze=this.quill.getLine(ve.index),yt=a(ze,2),mt=yt[0],bt=yt[1];if(bt>Ue)return!0;var dt=void 0;switch(we.prefix.trim()){case"[]":case"[ ]":dt="unchecked";break;case"[x]":dt="checked";break;case"-":case"*":dt="bullet";break;default:dt="ordered"}this.quill.insertText(ve.index," ",L.default.sources.USER),this.quill.history.cutoff();var St=new A.default().retain(ve.index-bt).delete(Ue+1).retain(mt.length()-2-bt).retain(1,{list:dt});this.quill.updateContents(St,L.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ve.index-Ue,L.default.sources.SILENT)}},"code exit":{key:ee.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(ve){var we=this.quill.getLine(ve.index),Ue=a(we,2),ze=Ue[0],yt=Ue[1],mt=new A.default().retain(ve.index+ze.length()-yt-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(mt,L.default.sources.USER)}},"embed left":ae(ee.keys.LEFT,!1),"embed left shift":ae(ee.keys.LEFT,!0),"embed right":ae(ee.keys.RIGHT,!1),"embed right shift":ae(ee.keys.RIGHT,!0)}};function ae(te,ve){var we,Ue=te===ee.keys.LEFT?"prefix":"suffix";return we={key:te,shiftKey:ve,altKey:null},B(we,Ue,/^$/),B(we,"handler",function(yt){var mt=yt.index;te===ee.keys.RIGHT&&(mt+=yt.length+1);var bt=this.quill.getLeaf(mt),dt=a(bt,1),St=dt[0];return St instanceof M.default.Embed?(te===ee.keys.LEFT?ve?this.quill.setSelection(yt.index-1,yt.length+1,L.default.sources.USER):this.quill.setSelection(yt.index-1,L.default.sources.USER):ve?this.quill.setSelection(yt.index,yt.length+1,L.default.sources.USER):this.quill.setSelection(yt.index+yt.length+1,L.default.sources.USER),!1):!0}),we}function le(te,ve){if(!(te.index===0||this.quill.getLength()<=1)){var we=this.quill.getLine(te.index),Ue=a(we,1),ze=Ue[0],yt={};if(ve.offset===0){var mt=this.quill.getLine(te.index-1),bt=a(mt,1),dt=bt[0];if(dt!=null&&dt.length()>1){var St=ze.formats(),kt=this.quill.getFormat(te.index-1,1);yt=b.default.attributes.diff(St,kt)||{}}}var Fe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(ve.prefix)?2:1;this.quill.deleteText(te.index-Fe,Fe,L.default.sources.USER),Object.keys(yt).length>0&&this.quill.formatLine(te.index-Fe,Fe,yt,L.default.sources.USER),this.quill.focus()}}function Z(te,ve){var we=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(ve.suffix)?2:1;if(!(te.index>=this.quill.getLength()-we)){var Ue={},ze=0,yt=this.quill.getLine(te.index),mt=a(yt,1),bt=mt[0];if(ve.offset>=bt.length()-1){var dt=this.quill.getLine(te.index+1),St=a(dt,1),kt=St[0];if(kt){var Fe=bt.formats(),Ze=this.quill.getFormat(te.index,1);Ue=b.default.attributes.diff(Fe,Ze)||{},ze=kt.length()}}this.quill.deleteText(te.index,we,L.default.sources.USER),Object.keys(Ue).length>0&&this.quill.formatLine(te.index+ze-1,we,Ue,L.default.sources.USER)}}function Y(te){var ve=this.quill.getLines(te),we={};if(ve.length>1){var Ue=ve[0].formats(),ze=ve[ve.length-1].formats();we=b.default.attributes.diff(ze,Ue)||{}}this.quill.deleteText(te,L.default.sources.USER),Object.keys(we).length>0&&this.quill.formatLine(te.index,1,we,L.default.sources.USER),this.quill.setSelection(te.index,L.default.sources.SILENT),this.quill.focus()}function re(te,ve){var we=this;te.length>0&&this.quill.scroll.deleteAt(te.index,te.length);var Ue=Object.keys(ve.format).reduce(function(ze,yt){return M.default.query(yt,M.default.Scope.BLOCK)&&!Array.isArray(ve.format[yt])&&(ze[yt]=ve.format[yt]),ze},{});this.quill.insertText(te.index,` 5835`,Ue,L.default.sources.USER),this.quill.setSelection(te.index+1,L.default.sources.SILENT),this.quill.focus(),Object.keys(ve.format).forEach(function(ze){Ue[ze]==null&&(Array.isArray(ve.format[ze])||ze!=="link"&&we.quill.format(ze,ve.format[ze],L.default.sources.USER))})}function _e(te){return{key:ee.keys.TAB,shiftKey:!te,format:{"code-block":!0},handler:function(we){var Ue=M.default.query("code-block"),ze=we.index,yt=we.length,mt=this.quill.scroll.descendant(Ue,ze),bt=a(mt,2),dt=bt[0],St=bt[1];if(dt!=null){var kt=this.quill.getIndex(dt),Fe=dt.newlineIndex(St,!0)+1,Ze=dt.newlineIndex(kt+St+yt),Ye=dt.domNode.textContent.slice(Fe,Ze).split(` 5836`);St=0,Ye.forEach(function(ft,At){te?(dt.insertAt(Fe+St,Ue.TAB),St+=Ue.TAB.length,At===0?ze+=Ue.TAB.length:yt+=Ue.TAB.length):ft.startsWith(Ue.TAB)&&(dt.deleteAt(Fe+St,Ue.TAB.length),St-=Ue.TAB.length,At===0?ze-=Ue.TAB.length:yt-=Ue.TAB.length),St+=ft.length+1}),this.quill.update(L.default.sources.USER),this.quill.setSelection(ze,yt,L.default.sources.SILENT)}}}}function Ee(te){return{key:te[0].toUpperCase(),shortKey:!0,handler:function(we,Ue){this.quill.format(te,!Ue.format[te],L.default.sources.USER)}}}function Ae(te){if(typeof te=="string"||typeof te=="number")return Ae({key:te});if((typeof te>"u"?"undefined":s(te))==="object"&&(te=(0,u.default)(te,!1)),typeof te.key=="string")if(ee.keys[te.key.toUpperCase()]!=null)te.key=ee.keys[te.key.toUpperCase()];else if(te.key.length===1)te.key=te.key.toUpperCase().charCodeAt(0);else return null;return te.shortKey&&(te[J]=te.shortKey,delete te.shortKey),te}r.default=ee,r.SHORTKEY=J}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function b(_,M){var T=[],L=!0,D=!1,P=void 0;try{for(var O=_[Symbol.iterator](),F;!(L=(F=O.next()).done)&&(T.push(F.value),!(M&&T.length===M));L=!0);}catch(U){D=!0,P=U}finally{try{!L&&O.return&&O.return()}finally{if(D)throw P}}return T}return function(_,M){if(Array.isArray(_))return _;if(Symbol.iterator in Object(_))return b(_,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),a=function b(_,M,T){_===null&&(_=Function.prototype);var L=Object.getOwnPropertyDescriptor(_,M);if(L===void 0){var D=Object.getPrototypeOf(_);return D===null?void 0:b(D,M,T)}else{if("value"in L)return L.value;var P=L.get;return P===void 0?void 0:P.call(T)}},o=(function(){function b(_,M){for(var T=0;T<M.length;T++){var L=M[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(_,L.key,L)}}return function(_,M,T){return M&&b(_.prototype,M),T&&b(_,T),_}})(),l=i(0),u=f(l),d=i(7),h=f(d);function f(b){return b&&b.__esModule?b:{default:b}}function p(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function g(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function A(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var x=(function(b){A(_,b),o(_,null,[{key:"value",value:function(){}}]);function _(M,T){p(this,_);var L=g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,M));return L.selection=T,L.textNode=document.createTextNode(_.CONTENTS),L.domNode.appendChild(L.textNode),L._length=0,L}return o(_,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(T,L){if(this._length!==0)return a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,T,L);for(var D=this,P=0;D!=null&&D.statics.scope!==u.default.Scope.BLOCK_BLOT;)P+=D.offset(D.parent),D=D.parent;D!=null&&(this._length=_.CONTENTS.length,D.optimize(),D.formatAt(P,_.CONTENTS.length,T,L),this._length=0)}},{key:"index",value:function(T,L){return T===this.textNode?0:a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"index",this).call(this,T,L)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var T=this.textNode,L=this.selection.getNativeRange(),D=void 0,P=void 0,O=void 0;if(L!=null&&L.start.node===T&&L.end.node===T){var F=[T,L.start.offset,L.end.offset];D=F[0],P=F[1],O=F[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==_.CONTENTS){var U=this.textNode.data.split(_.CONTENTS).join("");this.next instanceof h.default?(D=this.next.domNode,this.next.insertAt(0,U),this.textNode.data=_.CONTENTS):(this.textNode.data=U,this.parent.insertBefore(u.default.create(this.textNode),this),this.textNode=document.createTextNode(_.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),P!=null){var B=[P,O].map(function(H){return Math.max(0,Math.min(D.data.length,H-1))}),z=s(B,2);return P=z[0],O=z[1],{startNode:D,startOffset:P,endNode:D,endOffset:O}}}}},{key:"update",value:function(T,L){var D=this;if(T.some(function(O){return O.type==="characterData"&&O.target===D.textNode})){var P=this.restore();P&&(L.range=P)}}},{key:"value",value:function(){return""}}]),_})(u.default.Embed);x.blotName="cursor",x.className="ql-cursor",x.tagName="span",x.CONTENTS="\uFEFF",r.default=x}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(0),a=u(s),o=i(4),l=u(o);function u(g){return g&&g.__esModule?g:{default:g}}function d(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function h(g,A){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:g}function f(g,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);g.prototype=Object.create(A&&A.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(g,A):g.__proto__=A)}var p=(function(g){f(A,g);function A(){return d(this,A),h(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return A})(a.default.Container);p.allowedChildren=[l.default,o.BlockEmbed,p],r.default=p}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var s=(function(){function x(b,_){for(var M=0;M<_.length;M++){var T=_[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,_,M){return _&&x(b.prototype,_),M&&x(b,M),b}})(),a=function x(b,_,M){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,_);if(T===void 0){var L=Object.getPrototypeOf(b);return L===null?void 0:x(L,_,M)}else{if("value"in T)return T.value;var D=T.get;return D===void 0?void 0:D.call(M)}},o=i(0),l=u(o);function u(x){return x&&x.__esModule?x:{default:x}}function d(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function h(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function f(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var p=(function(x){f(b,x);function b(){return d(this,b),h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"value",value:function(M){var T=a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,M);return T.startsWith("rgb(")?(T=T.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+T.split(",").map(function(L){return("00"+parseInt(L).toString(16)).slice(-2)}).join("")):T}}]),b})(l.default.Attributor.Style),g=new l.default.Attributor.Class("color","ql-color",{scope:l.default.Scope.INLINE}),A=new p("color","color",{scope:l.default.Scope.INLINE});r.ColorAttributor=p,r.ColorClass=g,r.ColorStyle=A}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var s=(function(){function A(x,b){for(var _=0;_<b.length;_++){var M=b[_];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,b,_){return b&&A(x.prototype,b),_&&A(x,_),x}})(),a=function A(x,b,_){x===null&&(x=Function.prototype);var M=Object.getOwnPropertyDescriptor(x,b);if(M===void 0){var T=Object.getPrototypeOf(x);return T===null?void 0:A(T,b,_)}else{if("value"in M)return M.value;var L=M.get;return L===void 0?void 0:L.call(_)}},o=i(6),l=u(o);function u(A){return A&&A.__esModule?A:{default:A}}function d(A,x){if(!(A instanceof x))throw new TypeError("Cannot call a class as a function")}function h(A,x){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:A}function f(A,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);A.prototype=Object.create(x&&x.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(A,x):A.__proto__=x)}var p=(function(A){f(x,A);function x(){return d(this,x),h(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"format",value:function(_,M){if(_!==this.statics.blotName||!M)return a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,_,M);M=this.constructor.sanitize(M),this.domNode.setAttribute("href",M)}}],[{key:"create",value:function(_){var M=a(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,_);return _=this.sanitize(_),M.setAttribute("href",_),M.setAttribute("rel","noopener noreferrer"),M.setAttribute("target","_blank"),M}},{key:"formats",value:function(_){return _.getAttribute("href")}},{key:"sanitize",value:function(_){return g(_,this.PROTOCOL_WHITELIST)?_:this.SANITIZED_URL}}]),x})(l.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function g(A,x){var b=document.createElement("a");b.href=A;var _=b.href.slice(0,b.href.indexOf(":"));return x.indexOf(_)>-1}r.default=p,r.sanitize=g}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},a=(function(){function x(b,_){for(var M=0;M<_.length;M++){var T=_[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,_,M){return _&&x(b.prototype,_),M&&x(b,M),b}})(),o=i(23),l=h(o),u=i(107),d=h(u);function h(x){return x&&x.__esModule?x:{default:x}}function f(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}var p=0;function g(x,b){x.setAttribute(b,x.getAttribute(b)!=="true")}var A=(function(){function x(b){var _=this;f(this,x),this.select=b,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){_.togglePicker()}),this.label.addEventListener("keydown",function(M){switch(M.keyCode){case l.default.keys.ENTER:_.togglePicker();break;case l.default.keys.ESCAPE:_.escape(),M.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(x,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),g(this.label,"aria-expanded"),g(this.options,"aria-hidden")}},{key:"buildItem",value:function(_){var M=this,T=document.createElement("span");return T.tabIndex="0",T.setAttribute("role","button"),T.classList.add("ql-picker-item"),_.hasAttribute("value")&&T.setAttribute("data-value",_.getAttribute("value")),_.textContent&&T.setAttribute("data-label",_.textContent),T.addEventListener("click",function(){M.selectItem(T,!0)}),T.addEventListener("keydown",function(L){switch(L.keyCode){case l.default.keys.ENTER:M.selectItem(T,!0),L.preventDefault();break;case l.default.keys.ESCAPE:M.escape(),L.preventDefault();break}}),T}},{key:"buildLabel",value:function(){var _=document.createElement("span");return _.classList.add("ql-picker-label"),_.innerHTML=d.default,_.tabIndex="0",_.setAttribute("role","button"),_.setAttribute("aria-expanded","fal
5836se"),this.container.appendChild(_),_}},{key:"buildOptions",value:function(){var _=this,M=document.createElement("span");M.classList.add("ql-picker-options"),M.setAttribute("aria-hidden","true"),M.tabIndex="-1",M.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",M.id),this.options=M,[].slice.call(this.select.options).forEach(function(T){var L=_.buildItem(T);M.appendChild(L),T.selected===!0&&_.selectItem(L)}),this.container.appendChild(M)}},{key:"buildPicker",value:function(){var _=this;[].slice.call(this.select.attributes).forEach(function(M){_.container.setAttribute(M.name,M.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var _=this;this.close(),setTimeout(function(){return _.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(_){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,T=this.container.querySelector(".ql-selected");if(_!==T&&(T!=null&&T.classList.remove("ql-selected"),_!=null&&(_.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(_.parentNode.children,_),_.hasAttribute("data-value")?this.label.setAttribute("data-value",_.getAttribute("data-value")):this.label.removeAttribute("data-value"),_.hasAttribute("data-label")?this.label.setAttribute("data-label",_.getAttribute("data-label")):this.label.removeAttribute("data-label"),M))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":s(Event))==="object"){var L=document.createEvent("Event");L.initEvent("change",!0,!0),this.select.dispatchEvent(L)}this.close()}}},{key:"update",value:function(){var _=void 0;if(this.select.selectedIndex>-1){var M=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];_=this.select.options[this.select.selectedIndex],this.selectItem(M)}else this.selectItem(null);var T=_!=null&&_!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",T)}}]),x})();r.default=A}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(0),a=W(s),o=i(5),l=W(o),u=i(4),d=W(u),h=i(16),f=W(h),p=i(25),g=W(p),A=i(24),x=W(A),b=i(35),_=W(b),M=i(6),T=W(M),L=i(22),D=W(L),P=i(7),O=W(P),F=i(55),U=W(F),B=i(42),z=W(B),H=i(23),X=W(H);function W(J){return J&&J.__esModule?J:{default:J}}l.default.register({"blots/block":d.default,"blots/block/embed":u.BlockEmbed,"blots/break":f.default,"blots/container":g.default,"blots/cursor":x.default,"blots/embed":_.default,"blots/inline":T.default,"blots/scroll":D.default,"blots/text":O.default,"modules/clipboard":U.default,"modules/history":z.default,"modules/keyboard":X.default}),a.default.register(d.default,f.default,x.default,T.default,D.default,O.default),r.default=l.default}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(1),a=(function(){function o(l){this.domNode=l,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(o.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),o.create=function(l){if(this.tagName==null)throw new s.ParchmentError("Blot definition missing tagName");var u;return Array.isArray(this.tagName)?(typeof l=="string"&&(l=l.toUpperCase(),parseInt(l).toString()===l&&(l=parseInt(l))),typeof l=="number"?u=document.createElement(this.tagName[l-1]):this.tagName.indexOf(l)>-1?u=document.createElement(l):u=document.createElement(this.tagName[0])):u=document.createElement(this.tagName),this.className&&u.classList.add(this.className),u},o.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},o.prototype.clone=function(){var l=this.domNode.cloneNode(!1);return s.create(l)},o.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},o.prototype.deleteAt=function(l,u){var d=this.isolate(l,u);d.remove()},o.prototype.formatAt=function(l,u,d,h){var f=this.isolate(l,u);if(s.query(d,s.Scope.BLOT)!=null&&h)f.wrap(d,h);else if(s.query(d,s.Scope.ATTRIBUTE)!=null){var p=s.create(this.statics.scope);f.wrap(p),p.format(d,h)}},o.prototype.insertAt=function(l,u,d){var h=d==null?s.create("text",u):s.create(u,d),f=this.split(l);this.parent.insertBefore(h,f)},o.prototype.insertInto=function(l,u){u===void 0&&(u=null),this.parent!=null&&this.parent.children.remove(this);var d=null;l.children.insertBefore(this,u),u!=null&&(d=u.domNode),(this.domNode.parentNode!=l.domNode||this.domNode.nextSibling!=d)&&l.domNode.insertBefore(this.domNode,d),this.parent=l,this.attach()},o.prototype.isolate=function(l,u){var d=this.split(l);return d.split(u),d},o.prototype.length=function(){return 1},o.prototype.offset=function(l){return l===void 0&&(l=this.parent),this.parent==null||this==l?0:this.parent.children.offset(this)+this.parent.offset(l)},o.prototype.optimize=function(l){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},o.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},o.prototype.replace=function(l){l.parent!=null&&(l.parent.insertBefore(this,l.next),l.remove())},o.prototype.replaceWith=function(l,u){var d=typeof l=="string"?s.create(l,u):l;return d.replace(this),d},o.prototype.split=function(l,u){return l===0?this:this.next},o.prototype.update=function(l,u){},o.prototype.wrap=function(l,u){var d=typeof l=="string"?s.create(l,u):l;return this.parent!=null&&this.parent.insertBefore(d,this.next),d.appendChild(this),d},o.blotName="abstract",o})();r.default=a}
vendor: 13,629 bytes, line 5836
5836),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(12),a=i(32),o=i(33),l=i(1),u=(function(){function d(h){this.attributes={},this.domNode=h,this.build()}return d.prototype.attribute=function(h,f){f?h.add(this.domNode,f)&&(h.value(this.domNode)!=null?this.attributes[h.attrName]=h:delete this.attributes[h.attrName]):(h.remove(this.domNode),delete this.attributes[h.attrName])},d.prototype.build=function(){var h=this;this.attributes={};var f=s.default.keys(this.domNode),p=a.default.keys(this.domNode),g=o.default.keys(this.domNode);f.concat(p).concat(g).forEach(function(A){var x=l.query(A,l.Scope.ATTRIBUTE);x instanceof s.default&&(h.attributes[x.attrName]=x)})},d.prototype.copy=function(h){var f=this;Object.keys(this.attributes).forEach(function(p){var g=f.attributes[p].value(f.domNode);h.format(p,g)})},d.prototype.move=function(h){var f=this;this.copy(h),Object.keys(this.attributes).forEach(function(p){f.attributes[p].remove(f.domNode)}),this.attributes={}},d.prototype.values=function(){var h=this;return Object.keys(this.attributes).reduce(function(f,p){return f[p]=h.attributes[p].value(h.domNode),f},{})},d})();r.default=u}),(function(t,r,i){var s=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var f in h)h.hasOwnProperty(f)&&(d[f]=h[f])};return function(d,h){u(d,h);function f(){this.constructor=d}d.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12);function o(u,d){var h=u.getAttribute("class")||"";return h.split(/\s+/).filter(function(f){return f.indexOf(d+"-")===0})}var l=(function(u){s(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.keys=function(h){return(h.getAttribute("class")||"").split(/\s+/).map(function(f){return f.split("-").slice(0,-1).join("-")})},d.prototype.add=function(h,f){return this.canAdd(h,f)?(this.remove(h),h.classList.add(this.keyName+"-"+f),!0):!1},d.prototype.remove=function(h){var f=o(h,this.keyName);f.forEach(function(p){h.classList.remove(p)}),h.classList.length===0&&h.removeAttribute("class")},d.prototype.value=function(h){var f=o(h,this.keyName)[0]||"",p=f.slice(this.keyName.length+1);return this.canAdd(h,p)?p:""},d})(a.default);r.default=l}),(function(t,r,i){var s=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var f in h)h.hasOwnProperty(f)&&(d[f]=h[f])};return function(d,h){u(d,h);function f(){this.constructor=d}d.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12);function o(u){var d=u.split("-"),h=d.slice(1).map(function(f){return f[0].toUpperCase()+f.slice(1)}).join("");return d[0]+h}var l=(function(u){s(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.keys=function(h){return(h.getAttribute("style")||"").split(";").map(function(f){var p=f.split(":");return p[0].trim()})},d.prototype.add=function(h,f){return this.canAdd(h,f)?(h.style[o(this.keyName)]=f,!0):!1},d.prototype.remove=function(h){h.style[o(this.keyName)]="",h.getAttribute("style")||h.removeAttribute("style")},d.prototype.value=function(h){var f=h.style[o(this.keyName)];return this.canAdd(h,f)?f:""},d})(a.default);r.default=l}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function l(u,d){for(var h=0;h<d.length;h++){var f=d[h];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,d,h){return d&&l(u.prototype,d),h&&l(u,h),u}})();function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=(function(){function l(u,d){a(this,l),this.quill=u,this.options=d,this.modules={}}return s(l,[{key:"init",value:function(){var d=this;Object.keys(this.options.modules).forEach(function(h){d.modules[h]==null&&d.addModule(h)})}},{key:"addModule",value:function(d){var h=this.quill.constructor.import("modules/"+d);return this.modules[d]=new h(this.quill,this.options.modules[d]||{}),this.modules[d]}}]),l})();o.DEFAULTS={modules:{}},o.themes={default:o},r.default=o}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function b(_,M){for(var T=0;T<M.length;T++){var L=M[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(_,L.key,L)}}return function(_,M,T){return M&&b(_.prototype,M),T&&b(_,T),_}})(),a=function b(_,M,T){_===null&&(_=Function.prototype);var L=Object.getOwnPropertyDescriptor(_,M);if(L===void 0){var D=Object.getPrototypeOf(_);return D===null?void 0:b(D,M,T)}else{if("value"in L)return L.value;var P=L.get;return P===void 0?void 0:P.call(T)}},o=i(0),l=h(o),u=i(7),d=h(u);function h(b){return b&&b.__esModule?b:{default:b}}function f(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function p(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function g(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var A="\uFEFF",x=(function(b){g(_,b);function _(M){f(this,_);var T=p(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,M));return T.contentNode=document.createElement("span"),T.contentNode.setAttribute("contenteditable",!1),[].slice.call(T.domNode.childNodes).forEach(function(L){T.contentNode.appendChild(L)}),T.leftGuard=document.createTextNode(A),T.rightGuard=document.createTextNode(A),T.domNode.appendChild(T.leftGuard),T.domNode.appendChild(T.contentNode),T.domNode.appendChild(T.rightGuard),T}return s(_,[{key:"index",value:function(T,L){return T===this.leftGuard?0:T===this.rightGuard?1:a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"index",this).call(this,T,L)}},{key:"restore",value:function(T){var L=void 0,D=void 0,P=T.data.split(A).join("");if(T===this.leftGuard)if(this.prev instanceof d.default){var O=this.prev.length();this.prev.insertAt(O,P),L={startNode:this.prev.domNode,startOffset:O+P.length}}else D=document.createTextNode(P),this.parent.insertBefore(l.default.create(D),this),L={startNode:D,startOffset:P.length};else T===this.rightGuard&&(this.next instanceof d.default?(this.next.insertAt(0,P),L={startNode:this.next.domNode,startOffset:P.length}):(D=document.createTextNode(P),this.parent.insertBefore(l.default.create(D),this.next),L={startNode:D,startOffset:P.length}));return T.data=A,L}},{key:"update",value:function(T,L){var D=this;T.forEach(function(P){if(P.type==="characterData"&&(P.target===D.leftGuard||P.target===D.rightGuard)){var O=D.restore(P.target);O&&(L.range=O)}})}}]),_})(l.default.Embed);r.default=x}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var s=i(0),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}var l={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},u=new a.default.Attributor.Attribute("align","align",l),d=new a.default.Attributor.Class("align","ql-align",l),h=new a.default.Attributor.Style("align","text-align",l);r.AlignAttribute=u,r.AlignClass=d,r.AlignStyle=h}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var s=i(0),a=l(s),o=i(26);function l(h){return h&&h.__esModule?h:{default:h}}var u=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),d=new o.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});r.BackgroundClass=u,r.BackgroundStyle=d}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var s=i(0),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}var l={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},u=new a.default.Attributor.Attribute("direction","dir",l),d=new a.default.Attributor.Class("direction","ql-direction",l),h=new a.default.Attributor.Style("direction","direction",l);r.DirectionAttribute=u,r.DirectionClass=d,r.DirectionStyle=h}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var s=(function(){function b(_,M){for(var T=0;T<M.length;T++){var L=M[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(_,L.key,L)}}return function(_,M,T){return M&&b(_.prototype,M),T&&b(_,T),_}})(),a=function b(_,M,T){_===null&&(_=Function.prototype);var L=Object.getOwnPropertyDescriptor(_,M);if(L===void 0){var D=Object.getPrototypeOf(_);return D===null?void 0:b(D,M,T)}else{if("value"in L)return L.value;var P=L.get;return P===void 0?void 0:P.call(T)}},o=i(0),l=u(o);function u(b){return b&&b.__esModule?b:{default:b}}function d(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function h(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function f(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var p={scope:l.default.Scope.INLINE,whitelist:["serif","monospace"]},g=new l.default.Attributor.Class("font","ql-font",p),A=(function(b){f(_,b);function _(){return d(this,_),h(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return s(_,[{key:"value",value:function(T){return a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"value",this).call(this,T).replace(/["']/g,"")}}]),_})(l.default.Attributor.Style),x=new A("font","font-family",p);r.FontStyle=x,r.FontClass=g}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var s=i(0),a=o(s);function o(d){return d&&d.__esModule?d:{default:d}}var l=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),u=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=l,r.SizeStyle=u}),(function(t,r,i){t.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var s=(function(){function M(T,L){for(var D=0;D<L.length;D++){var P=L[D];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(T,P.key,P)}}return function(T,L,D){return L&&M(T.prototype,L),D&&M(T,D),T}})(),a=i(0),o=f(a),l=i(5),u=f(l),d=i(9),h=f(d);function f(M){return M&&M.__esModule?M:{default:M}}function p(M,T){if(!(M instanceof T))throw new TypeError("Cannot call a class as a function")}function g(M,T){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:M}function A(M,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);M.prototype=Object.create(T&&T.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(M,T):M.__proto__=T)}var x=(function(M){A(T,M);function T(L,D){p(this,T);var P=g(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L,D));return P.lastRecorded=0,P.ignoreChange=!1,P.clear(),P.quill.on(u.default.events.EDITOR_CHANGE,function(O,F,U,B){O!==u.default.events.TEXT_CHANGE||P.ignoreChange||(!P.options.userOnly||B===u.default.sources.USER?P.record(F,U):P.transform(F))}),P.quill.keyboard.addBinding({key:"Z",shortKey:!0},P.undo.bind(P)),P.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},P.redo.bind(P)),/Win/i.test(navigator.platform)&&P.quill.keyboard.addBinding({key:"Y",shortKey:!0},P.redo.bind(P)),P}return s(T,[{key:"change",value:function(D,P){if(this.stack[D].length!==0){var O=this.stack[D].pop();this.stack[P].push(O),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(O[D],u.default.sources.USER),this.ignoreChange=!1;var F=_(O[D]);this.quill.setSelection(F)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(D,P){if(D.ops.length!==0){this.stack.redo=[];var O=this.quill.getContents().diff(P),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var U=this.stack.undo.pop();O=O.compose(U.undo),D=U.redo.compose(D)}else this.lastRecorded=F;this.stack.undo.push({redo:D,undo:O}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}}
5836,{key:"transform",value:function(D){this.stack.undo.forEach(function(P){P.undo=D.transform(P.undo,!0),P.redo=D.transform(P.redo,!0)}),this.stack.redo.forEach(function(P){P.undo=D.transform(P.undo,!0),P.redo=D.transform(P.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),T})(h.default);x.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(M){var T=M.ops[M.ops.length-1];return T==null?!1:T.insert!=null?typeof T.insert=="string"&&T.insert.endsWith(` 5837`):T.attributes!=null?Object.keys(T.attributes).some(function(L){return o.default.query(L,o.default.Scope.BLOCK)!=null}):!1}function _(M){var T=M.reduce(function(D,P){return D+=P.delete||0,D},0),L=M.length()-T;return b(M)&&(L-=1),L}r.default=x,r.getLastChangeIndex=_}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var s=(function(){function re(_e,Ee){for(var Ae=0;Ae<Ee.length;Ae++){var te=Ee[Ae];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(_e,te.key,te)}}
vendor: 57,734 bytes, lines 5837-5846
5837return function(_e,Ee,Ae){return Ee&&re(_e.prototype,Ee),Ae&&re(_e,Ae),_e}})(),a=function re(_e,Ee,Ae){_e===null&&(_e=Function.prototype);var te=Object.getOwnPropertyDescriptor(_e,Ee);if(te===void 0){var ve=Object.getPrototypeOf(_e);return ve===null?void 0:re(ve,Ee,Ae)}else{if("value"in te)return te.value;var we=te.get;return we===void 0?void 0:we.call(Ae)}},o=i(3),l=F(o),u=i(2),d=F(u),h=i(8),f=F(h),p=i(23),g=F(p),A=i(34),x=F(A),b=i(59),_=F(b),M=i(60),T=F(M),L=i(28),D=F(L),P=i(61),O=F(P);function F(re){return re&&re.__esModule?re:{default:re}}function U(re,_e){if(!(re instanceof _e))throw new TypeError("Cannot call a class as a function")}function B(re,_e){if(!re)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _e&&(typeof _e=="object"||typeof _e=="function")?_e:re}function z(re,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _e);re.prototype=Object.create(_e&&_e.prototype,{constructor:{value:re,enumerable:!1,writable:!0,configurable:!0}}),_e&&(Object.setPrototypeOf?Object.setPrototypeOf(re,_e):re.__proto__=_e)}var H=[!1,"center","right","justify"],X=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],W=[!1,"serif","monospace"],J=["1","2","3",!1],ee=["small",!1,"large","huge"],ae=(function(re){z(_e,re);function _e(Ee,Ae){U(this,_e);var te=B(this,(_e.__proto__||Object.getPrototypeOf(_e)).call(this,Ee,Ae)),ve=function we(Ue){if(!document.body.contains(Ee.root))return document.body.removeEventListener("click",we);te.tooltip!=null&&!te.tooltip.root.contains(Ue.target)&&document.activeElement!==te.tooltip.textbox&&!te.quill.hasFocus()&&te.tooltip.hide(),te.pickers!=null&&te.pickers.forEach(function(ze){ze.container.contains(Ue.target)||ze.close()})};return Ee.emitter.listenDOM("click",document.body,ve),te}return s(_e,[{key:"addModule",value:function(Ae){var te=a(_e.prototype.__proto__||Object.getPrototypeOf(_e.prototype),"addModule",this).call(this,Ae);return Ae==="toolbar"&&this.extendToolbar(te),te}},{key:"buildButtons",value:function(Ae,te){Ae.forEach(function(ve){var we=ve.getAttribute("class")||"";we.split(/\s+/).forEach(function(Ue){if(Ue.startsWith("ql-")&&(Ue=Ue.slice(3),te[Ue]!=null))if(Ue==="direction")ve.innerHTML=te[Ue][""]+te[Ue].rtl;else if(typeof te[Ue]=="string")ve.innerHTML=te[Ue];else{var ze=ve.value||"";ze!=null&&te[Ue][ze]&&(ve.innerHTML=te[Ue][ze])}})})}},{key:"buildPickers",value:function(Ae,te){var ve=this;this.pickers=Ae.map(function(Ue){if(Ue.classList.contains("ql-align"))return Ue.querySelector("option")==null&&Y(Ue,H),new T.default(Ue,te.align);if(Ue.classList.contains("ql-background")||Ue.classList.contains("ql-color")){var ze=Ue.classList.contains("ql-background")?"background":"color";return Ue.querySelector("option")==null&&Y(Ue,X,ze==="background"?"#ffffff":"#000000"),new _.default(Ue,te[ze])}else return Ue.querySelector("option")==null&&(Ue.classList.contains("ql-font")?Y(Ue,W):Ue.classList.contains("ql-header")?Y(Ue,J):Ue.classList.contains("ql-size")&&Y(Ue,ee)),new D.default(Ue)});var we=function(){ve.pickers.forEach(function(ze){ze.update()})};this.quill.on(f.default.events.EDITOR_CHANGE,we)}}]),_e})(x.default);ae.DEFAULTS=(0,l.default)(!0,{},x.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var _e=this,Ee=this.container.querySelector("input.ql-image[type=file]");Ee==null&&(Ee=document.createElement("input"),Ee.setAttribute("type","file"),Ee.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Ee.classList.add("ql-image"),Ee.addEventListener("change",function(){if(Ee.files!=null&&Ee.files[0]!=null){var Ae=new FileReader;Ae.onload=function(te){var ve=_e.quill.getSelection(!0);_e.quill.updateContents(new d.default().retain(ve.index).delete(ve.length).insert({image:te.target.result}),f.default.sources.USER),_e.quill.setSelection(ve.index+1,f.default.sources.SILENT),Ee.value=""},Ae.readAsDataURL(Ee.files[0])}}),this.container.appendChild(Ee)),Ee.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var le=(function(re){z(_e,re);function _e(Ee,Ae){U(this,_e);var te=B(this,(_e.__proto__||Object.getPrototypeOf(_e)).call(this,Ee,Ae));return te.textbox=te.root.querySelector('input[type="text"]'),te.listen(),te}return s(_e,[{key:"listen",value:function(){var Ae=this;this.textbox.addEventListener("keydown",function(te){g.default.match(te,"enter")?(Ae.save(),te.preventDefault()):g.default.match(te,"escape")&&(Ae.cancel(),te.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),te!=null?this.textbox.value=te:Ae!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+Ae)||""),this.root.setAttribute("data-mode",Ae)}},{key:"restoreFocus",value:function(){var Ae=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=Ae}},{key:"save",value:function(){var Ae=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var te=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",Ae,f.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",Ae,f.default.sources.USER)),this.quill.root.scrollTop=te;break}case"video":Ae=Z(Ae);case"formula":{if(!Ae)break;var ve=this.quill.getSelection(!0);if(ve!=null){var we=ve.index+ve.length;this.quill.insertEmbed(we,this.root.getAttribute("data-mode"),Ae,f.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(we+1," ",f.default.sources.USER),this.quill.setSelection(we+2,f.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),_e})(O.default);function Z(re){var _e=re.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||re.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return _e?(_e[1]||"https")+"://www.youtube.com/embed/"+_e[2]+"?showinfo=0":(_e=re.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(_e[1]||"https")+"://player.vimeo.com/video/"+_e[2]+"/":re}function Y(re,_e){var Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;_e.forEach(function(Ae){var te=document.createElement("option");Ae===Ee?te.setAttribute("selected","selected"):te.setAttribute("value",Ae),re.appendChild(te)})}r.BaseTooltip=le,r.default=ae}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function a(){this.head=this.tail=null,this.length=0}return a.prototype.append=function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];this.insertBefore(o[0],null),o.length>1&&this.append.apply(this,o.slice(1))},a.prototype.contains=function(o){for(var l,u=this.iterator();l=u();)if(l===o)return!0;return!1},a.prototype.insertBefore=function(o,l){o&&(o.next=l,l!=null?(o.prev=l.prev,l.prev!=null&&(l.prev.next=o),l.prev=o,l===this.head&&(this.head=o)):this.tail!=null?(this.tail.next=o,o.prev=this.tail,this.tail=o):(o.prev=null,this.head=this.tail=o),this.length+=1)},a.prototype.offset=function(o){for(var l=0,u=this.head;u!=null;){if(u===o)return l;l+=u.length(),u=u.next}return-1},a.prototype.remove=function(o){this.contains(o)&&(o.prev!=null&&(o.prev.next=o.next),o.next!=null&&(o.next.prev=o.prev),o===this.head&&(this.head=o.next),o===this.tail&&(this.tail=o.prev),this.length-=1)},a.prototype.iterator=function(o){return o===void 0&&(o=this.head),function(){var l=o;return o!=null&&(o=o.next),l}},a.prototype.find=function(o,l){l===void 0&&(l=!1);for(var u,d=this.iterator();u=d();){var h=u.length();if(o<h||l&&o===h&&(u.next==null||u.next.length()!==0))return[u,o];o-=h}return[null,0]},a.prototype.forEach=function(o){for(var l,u=this.iterator();l=u();)o(l)},a.prototype.forEachAt=function(o,l,u){if(!(l<=0))for(var d=this.find(o),h=d[0],f=d[1],p,g=o-f,A=this.iterator(h);(p=A())&&g<o+l;){var x=p.length();o>g?u(p,o-g,Math.min(l,g+x-o)):u(p,0,Math.min(x,o+l-g)),g+=x}},a.prototype.map=function(o){return this.reduce(function(l,u){return l.push(o(u)),l},[])},a.prototype.reduce=function(o,l){for(var u,d=this.iterator();u=d();)l=o(l,u);return l},a})();r.default=s}),(function(t,r,i){var s=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,p){f.__proto__=p}||function(f,p){for(var g in p)p.hasOwnProperty(g)&&(f[g]=p[g])};return function(f,p){h(f,p);function g(){this.constructor=f}f.prototype=p===null?Object.create(p):(g.prototype=p.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(17),o=i(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},u=100,d=(function(h){s(f,h);function f(p){var g=h.call(this,p)||this;return g.scroll=g,g.observer=new MutationObserver(function(A){g.update(A)}),g.observer.observe(g.domNode,l),g.attach(),g}return f.prototype.detach=function(){h.prototype.detach.call(this),this.observer.disconnect()},f.prototype.deleteAt=function(p,g){this.update(),p===0&&g===this.length()?this.children.forEach(function(A){A.remove()}):h.prototype.deleteAt.call(this,p,g)},f.prototype.formatAt=function(p,g,A,x){this.update(),h.prototype.formatAt.call(this,p,g,A,x)},f.prototype.insertAt=function(p,g,A){this.update(),h.prototype.insertAt.call(this,p,g,A)},f.prototype.optimize=function(p,g){var A=this;p===void 0&&(p=[]),g===void 0&&(g={}),h.prototype.optimize.call(this,g);for(var x=[].slice.call(this.observer.takeRecords());x.length>0;)p.push(x.pop());for(var b=function(L,D){D===void 0&&(D=!0),!(L==null||L===A)&&L.domNode.parentNode!=null&&(L.domNode[o.DATA_KEY].mutations==null&&(L.domNode[o.DATA_KEY].mutations=[]),D&&b(L.parent))},_=function(L){L.domNode[o.DATA_KEY]==null||L.domNode[o.DATA_KEY].mutations==null||(L instanceof a.default&&L.children.forEach(_),L.optimize(g))},M=p,T=0;M.length>0;T+=1){if(T>=u)throw new Error("[Parchment] Maximum optimize iterations reached");for(M.forEach(function(L){var D=o.find(L.target,!0);D!=null&&(D.domNode===L.target&&(L.type==="childList"?(b(o.find(L.previousSibling,!1)),[].forEach.call(L.addedNodes,function(P){var O=o.find(P,!1);b(O,!1),O instanceof a.default&&O.children.forEach(function(F){b(F,!1)})})):L.type==="attributes"&&b(D.prev)),b(D))}),this.children.forEach(_),M=[].slice.call(this.observer.takeRecords()),x=M.slice();x.length>0;)p.push(x.pop())}},f.prototype.update=function(p,g){var A=this;g===void 0&&(g={}),p=p||this.observer.takeRecords(),p.map(function(x){var b=o.find(x.target,!0);return b==null?null:b.domNode[o.DATA_KEY].mutations==null?(b.domNode[o.DATA_KEY].mutations=[x],b):(b.domNode[o.DATA_KEY].mutations.push(x),null)}).forEach(function(x){x==null||x===A||x.domNode[o.DATA_KEY]==null||x.update(x.domNode[o.DATA_KEY].mutations||[],g)}),this.domNode[o.DATA_KEY].mutations!=null&&h.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,g),this.optimize(p,g)},f.blotName="scroll",f.defaultChild="block",f.scope=o.Scope.BLOCK_BLOT,f.tagName="DIV",f})(a.default);r.default=d}),(function(t,r,i){var s=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var p in f)f.hasOwnProperty(p)&&(h[p]=f[p])};return function(h,f){d(h,f);function p(){this.constructor=h}h.prototype=f===null?Object.create(f):(p.prototype=f.prototype,new p)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(18),o=i(1);function l(d,h){if(Object.keys(d).length!==Object.keys(h).length)return!1;for(var f in d)if(d[f]!==h[f])return!1;return!0}var u=(function(d){s(h,d);function h(){return d!==null&&d.apply(this,arguments)||this}return h.formats=function(f){if(f.tagName!==h.tagName)return d.formats.call(this,f)},h.prototype.format=function(f,p){var g=this;f===this.statics.blotName&&!p?(this.children.forEach(function(A){A instanceof a.default||(A=A.wrap(h.blotName,!0)),g.attributes.copy(A)}),this.unwrap()):d.prototype.format.call(this,f,p)},h.prototype.formatAt=function(f,p,g,A){if(this.formats()[g]!=null||o.query(g,o.Scope.ATTRIBUTE)){var x=this.isolate(f,p);x.format(g,A)}else d.prototype.formatAt.call(this,f,p,g,A)},h.prototype.optimize=function(f){d.prototype.optimize.call(this,f);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var g=this.next;g instanceof h&&g.prev===this&&l(p,g.formats())&&(g.moveChildren(this),g.remove())},h.blotName="inline",h.scope=o.Scope.INLINE_BLOT,h.tagName="SPAN",h})(a.default);r.default=u}),(function(t,r,i){var s=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var f in h)h.hasOwnProperty(f)&&(d[f]=h[f])};return function(d,h){u(d,h);function f(){this.constructor=d}d.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(18),o=i(1),l=(function(u){s(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.formats=function(h){var f=o.query(d.blotName).tagName;if(h.tagName!==f)return u.formats.call(this,h)},d.prototype.format=function(h,f){o.query(h,o.Scope.BLOCK)!=null&&(h===this.statics.blotName&&!f?this.replaceWith(d.blotName):u.prototype.format.call(this,h,f))},d.prototype.formatAt=function(h,f,p,g){o.query(p,o.Scope.BLOCK)!=null?this.format(p,g):u.prototype.formatAt.call(this,h,f,p,g)},d.prototype.insertAt=function(h,f,p){if(p==null||o.query(f,o.Scope.INLINE)!=null)u.prototype.insertAt.call(this,h,f,p);else{var g=this.split(h),A=o.create(f,p);g.parent.insertBefore(A,g)}},d.prototype.update=function(h,f){navigator.userAgent.match(/Trident/)?this.build():u.prototype.update.call(this,h,f)},d.blotName="block",d.scope=o.Scope.BLOCK_BLOT,d.tagName="P",d})(a.default);r.default=l}),(function(t,r,i){var s=this&&this.__extends||(function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var h in d)d.hasOwnProperty(h)&&(u[h]=d[h])};return function(u,d){l(u,d);function h(){this.constructor=u}u.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(19),o=(function(l){s(u,l);function u(){return l!==null&&l.apply(this,arguments)||this}return u.formats=function(d){},u.prototype.format=function(d,h){l.prototype.formatAt.call(this,0,this.length(),d,h)},u.prototype.formatAt=function(d,h,f,p){d===0&&h===this.length()?this.format(f,p):l.prototype.formatAt.call(this,d,h,f,p)},u.prototype.formats=function(){return this.statics.formats(this.domNode)},u})(a.default);r.default=o}),(function(t,r,i){var s=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var f in h)h.hasOwnProperty(f)&&(d[f]=h[f])};return function(d,h){u(d,h);function f(){this.constructor=d}d.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})();Object.defineProperty(r,"__esModule",{value:!0});var a=i(19),o=i(1),l=(function(u){s(d,u);function d(h){var f=u.call(this,h)||this;return f.text=f.statics.value(f.domNode),f}return d.create=function(h){return document.createTextNode(h)},d.value=function(h){var f=h.data;return f.normalize&&(f=f.normalize()),f},d.prototype.deleteAt=function(h,f){this.domNode.data=this.text=this.text.slice(0,h)+this.text.slice(h+f)},d.prototype.index=function(h,f){return this.domNode===h?f:-1},d.prototype.insertAt=function(h,f,p){p==null?(this.text=this.text.slice(0,h)+f+this.text.slice(h),this.domNode.data=this.text):u.prototype.insertAt.call(this,h,f,p)},d.prototype.length=function(){return this.text.length},d.prototype.optimize=function(h){u.prototype.optimize.call(this,h),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof d&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},d.prototype.position=function(h,f){return[this.domNode,h]},d.prototype.split=function(h,f){if(f===void 0&&(f=!1),!f){if(h===0)return this;if(h===this.length())return this.next}var p=o.create(this.domNode.splitText(h));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},d.prototype.update=function(h,f){var p=this;h.some(function(g){return g.type==="characterData"&&g.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},d.prototype.value=function(){return this.text},d.blotName="text",d.scope=o.Scope.INLINE_BLOT,d})(a.default);r.default=l}),(function(t,r,i){var s=document.createElement("div");if(s.classList.toggle("test-class",!1),s.classList.contains("test-class")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(o,l){return arguments.length>1&&!this.contains(o)==!l?l:a.call(this,o)}}String.prototype.startsWith||(String.prototype.startsWith=function(o,l){return l=l||0,this.substr(l,o.length)===o}),String.prototype.endsWith||(String.prototype.endsWith=function(o,l){var u=this.toString();(typeof l!="number"||!isFinite(l)||Math.floor(l)!==l||l>u.length)&&(l=u.length),l-=o.length;var d=u.indexOf(o,l);return d!==-1&&d===l}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(l){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof l!="function")throw new TypeError("predicate must be a function");for(var u=Object(this),d=u.length>>>0,h=arguments[1],f,p=0;p<d;p++)if(f=u[p],l.call(h,f,p,u))return f}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})}),(function(t,r){var i=-1,s=1,a=0;function o(T,L,D){if(T==L)return T?[[a,T]]:[];(D<0||T.length<D)&&(D=null);var P=h(T,L),O=T.substring(0,P);T=T.substring(P),L=L.substring(P),P=f(T,L);var F=T.substring(T.length-P);T=T.substring(0,T.length-P),L=L.substring(0,L.length-P);var U=l(T,L);return O&&U.unshift([a,O]),F&&U.push([a,F]),g(U),D!=null&&(U=b(U,D)),U=_(U),U}function l(T,L){var D;if(!T)return[[s,L]];if(!L)return[[i,T]];var P=T.length>L.length?T:L,O=T.length>L.length?L:T,F=P.indexOf(O);if(F!=-1)return D=[[s,P.substring(0,F)],[a,O],[s,P.substring(F+O.length)]],T.length>L.length&&(D[0][0]=D[2][0]=i),D;if(O.length==1)return[[i,T],[s,L]];var U=p(T,L);if(U){var B=U[0],z=U[1],H=U[2],X=U[3],W=U[4],J=o(B,H),ee=o(z,X);return J.concat([[a,W]],ee)}return u(T,L)}function u(T,L){for(var D=T.length,P=L.length,O=Math.ceil((D+P)/2),F=O,U=2*O,B=new Array(U),z=new Array(U),H=0;H<U;H++)B[H]=-1,z[H]=-1;B[F+1]=0,z[F+1]=0;for(var X=D-P,W=X%2!=0,J=0,ee=0,ae=0,le=0,Z=0;Z<O;Z++){for(var Y=-Z+J;Y<=Z-ee;Y+=2){var re=F+Y,_e;Y==-Z||Y!=Z&&B[re-1]<B[re+1]?_e=B[re+1]:_e=B[re-1]+1;for(var Ee=_e-Y;_e<D&&Ee<P&&T.charAt(_e)==L.charAt(Ee);)_e++,Ee++;if(B[re]=_e,_e>D)ee+=2;else if(Ee>P)J+=2;else if(W){var Ae=F+X-Y;if(Ae>=0&&Ae<U&&z[Ae]!=-1){var te=D-z[Ae];if(_e>=te)return d(T,L,_e,Ee)}}}for(var ve=-Z+ae;ve<=Z-le;ve+=2){var Ae=F+ve,te;ve==-Z||ve!=Z&&z[Ae-1]<z[Ae+1]?te=z[Ae+1]:te=z[Ae-1]+1;for(var we=te-ve;te<D&&we<P&&T.charAt(D-te-1)==L.charAt(P-we-1);)te++,we++;if(z[Ae]=te,te>D)le+=2;else if(we>P)ae+=2;else if(!W){var re=F+X-ve;if(re>=0&&re<U&&B[re]!=-1){var _e=B[re],Ee=F+_e-re;if(te=D-te,_e>=te)return d(T,L,_e,Ee)}}}}return[[i,T],[s,L]]}function d(T,L,D,P){var O=T.substring(0,D),F=L.substring(0,P),U=T.substring(D),B=L.substring(P),z=o(O,F),H=o(U,B);return z.concat(H)}function h(T,L){if(!T||!L||T.charAt(0)!=L.charAt(0))return 0;for(var D=0,P=Math.min(T.length,L.length),O=P,F=0;D<O;)T.substring(F,O)==L.substring(F,O)?(D=O,F=D):P=O,O=Math.floor((P-D)/2+D);return O}function f(T,L){if(!T||!L||T.charAt(T.length-1)!=L.charAt(L.length-1))return 0;for(var D=0,P=Math.min(T.length,L.length),O=P,F=0;D<O;)T.substring(T.length-O,T.length-F)==L.substring(L.length-O,L.length-F)?(D=O,F=D):P=O,O=Math.floor((P-D)/2+D);return O}function p(T,L){var D=T.length>L.length?T:L,P=T.length>L.length?L:T;if(D.length<4||P.length*2<D.length)return null;function O(ee,ae,le){for(var Z=ee.substring(le,le+Math.floor(ee.length/4)),Y=-1,re="",_e,Ee,Ae,te;(Y=ae.indexOf(Z,Y+1))!=-1;){var ve=h(ee.substring(le),ae.substring(Y)),we=f(ee.substring(0,le),ae.substring(0,Y));re.length<we+ve&&(re=ae.substring(Y-we,Y)+ae.substring(Y,Y+ve),_e=ee.substring(0,le-we),Ee=ee.substring(le+ve),Ae=ae.substring(0,Y-we),te=ae.substring(Y+ve))}return re.length*2>=ee.length?[_e,Ee,Ae,te,re]:null}var F=O(D,P,Math.ceil(D.length/4)),U=O(D,P,Math.ceil(D.length/2)),B;if(!F&&!U)return null;U?F?B=F[4].length>U[4].length?F:U:B=U:B=F;var z,H,X,W;T.length>L.length?(z=B[0],H=B[1],X=B[2],W=B[3]):(X=B[0],W=B[1],z=B[2],H=B[3]);var J=B[4];return[z,H,X,W,J]}function g(T){T.push([a,""]);for(var L=0,D=0,P=0,O="",F="",U;L<T.length;)switch(T[L][0]){case s:P++,F+=T[L][1],L++;break;case i:D++,O+=T[L][1],L++;break;case a:D+P>1?(D!==0&&P!==0&&(U=h(F,O),U!==0&&(L-D-P>0&&T[L-D-P-1][0]==a?T[L-D-P-1][1]+=F.substring(0,U):(T.splice(0,0,[a,F.substring(0,U)]),L++),F=F.substring(U),O=O.substring(U)),U=f(F,O),U!==0&&(T[L][1]=F.substring(F.length-U)+T[L][1],F=F.substring(0,F.length-U),O=O.substring(0,O.length-U))),D===0?T.splice(L-P,D+P,[s,F]):P===0?T.splice(L-D,D+P,[i,O]):T.splice(L-D-P,D+P,[i,O],[s,F]),L=L-D-P+(D?1:0)+(P?1:0)+1):L!==0&&T[L-1][0]==a?(T[L-1][1]+=T[L][1],T.splice(L,1)):L++,P=0,D=0,O="",F="";break}T[T.length-1][1]===""&&T.pop();var B=!1;for(L=1;L<T.length-1;)T[L-1][0]==a&&T[L+1][0]==a&&(T[L][1].substring(T[L][1].length-T[L-1][1].length)==T[L-1][1]?(T[L][1]=T[L-1][1]+T[L][1].substring(0,T[L][1].length-T[L-1][1].length),T[L+1][1]=T[L-1][1]+T[L+1][1],T.splice(L-1,1),B=!0):T[L][1].substring(0,T[L+1][1].length)==T[L+1][1]&&(T[L-1][1]+=T[L+1][1],T[L][1]=T[L][1].substring(T[L+1][1].length)+T[L+1][1],T.splice(L+1,1),B=!0)),L++;B&&g(T)}var A=o;A.INSERT=s,A.DELETE=i,A.EQUAL=a,t.exports=A;function x(T,L){if(L===0)return[a,T];for(var D=0,P=0;P<T.length;P++){var O=T[P];if(O[0]===i||O[0]===a){var F=D+O[1].length;if(L===F)return[P+1,T];if(L<F){T=T.slice();var U=L-D,B=[O[0],O[1].slice(0,U)],z=[O[0],O[1].slice(U)];return T.splice(P,1,B,z),[P+1,T]}else D=F}}throw new Error("cursor_pos is out of bounds!")}function b(T,L){var D=x(T,L),P=D[1],O=D[0],F=P[O],U=P[O+1];if(F==null)return T;if(F[0]!==a)return T;if(U!=null&&F[1]+U[1]===U[1]+F[1])return P.splice(O,2,U,F),M(P,O,2);if(U!=null&&U[1].indexOf(F[1])===0){P.splice(O,2,[U[0],F[1]],[0,F[1]]);var B=U[1].slice(F[1].length);return B.length>0&&P.splice(O+2,0,[U[0],B]),M(P,O,3)}else return T}function _(T){for(var L=!1,D=function(U){return U.charCodeAt(0)>=56320&&U.charCodeAt(0)<=57343},P=function(U){return U.charCodeAt(U.length-1)>=55296&&U.charCodeAt(U.length-1)<=56319},O=2;O<T.length;O+=1)T[O-2][0]===a&&P(T[O-2][1])&&T[O-1][0]===i&&D(T[O-1][1])&&T[O][0]===s&&D(T[O][1])&&(L=!0,T[O-1][1]=T[O-2][1].slice(-1)+T[O-1][1],T[O][1]=T[O-2][1].slice(-1)+T[O][1],T[O-2][1]=T[O-2][1].slice(0,-1));if(!L)return T;for(var F=[],O=0;O<T.length;O+=1)T[O][1].length>0&&F.push(T[O]);return F}function M(T,L,D){for(var P=L+D-1;P>=0&&P>=L-1;P--)if(P+1<T.length){var O=T[P],F=T[P+1];O[0]===F[1]&&T.splice(P,2,[O[0],O[1]+F[1]])}return T}}),(function(t,r){r=t.exports=typeof Object.keys=="function"?Object.keys:i,r.shim=i;function i(s){var a=[];for(var o in s)a.push(o);return a}}),(function(t,r){var i=(function(){return Object.prototype.toString.call(arguments)})()=="[object Arguments]";r=t.exports=i?s:a,r.supported=s;function s(o){return Object.prototype.toString.call(o)=="[object Arguments]"}r.unsupported=a;function a(o){return o&&typeof o=="object"&&typeof o.length=="number"&&Object.prototype.hasOwnProperty.call(o,"callee")&&!Object.prototype.propertyIsEnumerable.call(o,"callee")||!1}}),(function(t,r){var i=Object.prototype.hasOwnProperty,s="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(s=!1));function o(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function l(){this._events=new a,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],h,f;if(this._eventsCount===0)return d;for(f in h=this._events)i.call(h,f)&&d.push(s?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},l.prototype.listeners=function(d,h){var f=s?s+d:d,p=this._events[f];if(h)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var g=0,A=p.length,x=new Array(A);g<A;g++)x[g]=p[g].fn;return x},l.prototype.emit=function(d,h,f,p,g,A){var x=s?s+d:d;if(!this._events[x])return!1;var b=this._events[x],_=arguments.length,M,T;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),_){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,h),!0;case 3:return b.fn.call(b.context,h,f),!0;case 4:return b.fn.call(b.context,h,f,p),!0;case 5:return b.fn.call(b.context,h,f,p,g),!0;case 6:return b.fn.call(b.context,h,f,p,g,A),!0}for(T=1,M=new Array(_-1);T<_;T++)M[T-1]=arguments[T];b.fn.apply(b.context,M)}else{var L=b.length,D;for(T=0;T<L;T++)switch(b[T].once&&this.removeListener(d,b[T].fn,void 0,!0),_){case 1:b[T].fn.call(b[T].context);break;case 2:b[T].fn.call(b[T].context,h);break;case 3:b[T].fn.call(b[T].context,h,f);break;case 4:b[T].fn.call(b[T].context,h,f,p);break;default:if(!M)for(D=1,M=new Array(_-1);D<_;D++)M[D-1]=arguments[D];b[T].fn.apply(b[T].context,M)}}return!0},l.prototype.on=function(d,h,f){var p=new o(h,f||this),g=s?s+d:d;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],p]:this._events[g].push(p):(this._events[g]=p,this._eventsCount++),this},l.prototype.once=function(d,h,f){var p=new o(h,f||this,!0),g=s?s+d:d;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],p]:this._events[g].push(p):(this._events[g]=p,this._eventsCount++),this},l.prototype.removeListener=function(d,h,f,p){var g=s?s+d:d;if(!this._events[g])return this;if(!h)return--this._eventsCount===0?this._events=new a:delete this._events[g],this;var A=this._events[g];if(A.fn)A.fn===h&&(!p||A.once)&&(!f||A.context===f)&&(--this._eventsCount===0?this._events=new a:delete this._events[g]);else{for(var x=0,b=[],_=A.length;x<_;x++)(A[x].fn!==h||p&&!A[x].once||f&&A[x].context!==f)&&b.push(A[x]);b.length?this._events[g]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new a:delete this._events[g]}return this},l.prototype.removeAllListeners=function(d){var h;return d?(h=s?s+d:d,this._events[h]&&(--this._eventsCount===0?this._events=new a:delete this._events[h])):(this._events=new a,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prototype.setMaxListeners=function(){return this},l.prefixed=s,l.EventEmitter=l,typeof t<"u"&&(t.exports=l)}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ze){return typeof Ze}:function(Ze){return Ze&&typeof Symbol=="function"&&Ze.constructor===Symbol&&Ze!==Symbol.prototype?"symbol":typeof Ze},a=(function(){function Ze(Ye,ft){var At=[],Ce=!0,Se=!1,qe=void 0;try{for(var pt=Ye[Symbol.iterator](),Te;!(Ce=(Te=pt.next()).done)&&(At.push(Te.value),!(ft&&At.length===ft));Ce=!0);}catch(oe){Se=!0,qe=oe}finally{try{!Ce&&pt.return&&pt.return()}finally{if(Se)throw qe}}return At}return function(Ye,ft){if(Array.isArray(Ye))return Ye;if(Symbol.iterator in Object(Ye))return Ze(Ye,ft);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function Ze(Ye,ft){for(var At=0;At<ft.length;At++){var Ce=ft[At];Ce.enumerable=Ce.enumerable||!1,Ce.configurable=!0,"value"in Ce&&(Ce.writable=!0),Object.defineProperty(Ye,Ce.key,Ce)}}return function(Ye,ft,At){return ft&&Ze(Ye.prototype,ft),At&&Ze(Ye,At),Ye}})(),l=i(3),u=z(l),d=i(2),h=z(d),f=i(0),p=z(f),g=i(5),A=z(g),x=i(10),b=z(x),_=i(9),M=z(_),T=i(36),L=i(37),D=i(13),P=z(D),O=i(26),F=i(38),U=i(39),B=i(40);function z(Ze){return Ze&&Ze.__esModule?Ze:{default:Ze}}function H(Ze,Ye,ft){return Ye in Ze?Object.defineProperty(Ze,Ye,{value:ft,enumerable:!0,configurable:!0,writable:!0}):Ze[Ye]=ft,Ze}function X(Ze,Ye){if(!(Ze instanceof Ye))throw new TypeError("Cannot call a class as a function")}function W(Ze,Ye){if(!Ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ye&&(typeof Ye=="object"||typeof Ye=="function")?Ye:Ze}function J(Ze,Ye){if(typeof Ye!="function"&&Ye!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Ye);Ze.prototype=Object.create(Ye&&Ye.prototype,{constructor:{value:Ze,enumerable:!1,writable:!0,configurable:!0}}),Ye&&(Object.setPrototypeOf?Object.setPrototypeOf(Ze,Ye):Ze.__proto__=Ye)}var ee=(0,b.default)("quill:clipboard"),ae="__ql-matcher",le=[[Node.TEXT_NODE,Fe],[Node.TEXT_NODE,dt],["br",yt],[Node.ELEMENT_NODE,dt],[Node.ELEMENT_NODE,ze],[Node.ELEMENT_NODE,St],[Node.ELEMENT_NODE,Ue],[Node.ELEMENT_NODE,kt],["li",bt],["b",we.bind(we,"bold")],["i",we.bind(we,"italic")],["style",mt]],Z=[T.AlignAttribute,F.DirectionAttribute].reduce(function(Ze,Ye){return Ze[Ye.keyName]=Ye,Ze},{}),Y=[T.AlignStyle,L.BackgroundStyle,O.ColorStyle,F.DirectionStyle,U.FontStyle,B.SizeStyle].reduce(function(Ze,Ye){return Ze[Ye.keyName]=Ye,Ze},{}),re=(function(Ze){J(Ye,Ze);function Ye(ft,At){X(this,Ye);var Ce=W(this,(Ye.__proto__||Object.getPrototypeOf(Ye)).call(this,ft,At));return Ce.quill.root.addEventListener("paste",Ce.onPaste.bind(Ce)),Ce.container=Ce.quill.addContainer("ql-clipboard"),Ce.container.setAttribute("contenteditable",!0),Ce.container.setAttribute("tabindex",-1),Ce.matchers=[],le.concat(Ce.options.matchers).forEach(function(Se){var qe=a(Se,2),pt=qe[0],Te=qe[1];!At.matchVisual&&Te===St||Ce.addMatcher(pt,Te)}),Ce}return o(Ye,[{key:"addMatcher",value:function(At,Ce){this.matchers.push([At,Ce])}},{key:"convert",value:function(At){if(typeof At=="string")return this.container.innerHTML=At.replace(/\>\r?\n +\</g,"><"),this.convert();var Ce=this.quill.getFormat(this.quill.selection.savedRange.index);if(Ce[P.default.blotName]){var Se=this.container.innerText;return this.container.innerHTML="",new h.default().insert(Se,H({},P.default.blotName,Ce[P.default.blotName]))}var qe=this.prepareMatching(),pt=a(qe,2),Te=pt[0],oe=pt[1],ge=ve(this.container,Te,oe);return Ae(ge,` 5838`)&&ge.ops[ge.ops.length-1].attributes==null&&(ge=ge.compose(new h.default().retain(ge.length()-1).delete(1))),ee.log("convert",this.container.innerHTML,ge),this.container.innerHTML="",ge}},{key:"dangerouslyPasteHTML",value:function(At,Ce){var Se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.default.sources.API;if(typeof At=="string")this.quill.setContents(this.convert(At),Ce),this.quill.setSelection(0,A.default.sources.SILENT);else{var qe=this.convert(Ce);this.quill.updateContents(new h.default().retain(At).concat(qe),Se),this.quill.setSelection(At+qe.length(),A.default.sources.SILENT)}}},{key:"onPaste",value:function(At){var Ce=this;if(!(At.defaultPrevented||!this.quill.isEnabled())){var Se=this.quill.getSelection(),qe=new h.default().retain(Se.index),pt=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(A.default.sources.SILENT),setTimeout(function(){qe=qe.concat(Ce.convert()).delete(Se.length),Ce.quill.updateContents(qe,A.default.sources.USER),Ce.quill.setSelection(qe.length()-Se.length,A.default.sources.SILENT),Ce.quill.scrollingContainer.scrollTop=pt,Ce.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var At=this,Ce=[],Se=[];return this.matchers.forEach(function(qe){var pt=a(qe,2),Te=pt[0],oe=pt[1];switch(Te){case Node.TEXT_NODE:Se.push(oe);break;case Node.ELEMENT_NODE:Ce.push(oe);break;default:[].forEach.call(At.container.querySelectorAll(Te),function(ge){ge[ae]=ge[ae]||[],ge[ae].push(oe)});break}}),[Ce,Se]}}]),Ye})(M.default);re.DEFAULTS={matchers:[],matchVisual:!0};function _e(Ze,Ye,ft){return(typeof Ye>"u"?"undefined":s(Ye))==="object"?Object.keys(Ye).reduce(function(At,Ce){return _e(At,Ce,Ye[Ce])},Ze):Ze.reduce(function(At,Ce){return Ce.attributes&&Ce.attributes[Ye]?At.push(Ce):At.insert(Ce.insert,(0,u.default)({},H({},Ye,ft),Ce.attributes))},new h.default)}function Ee(Ze){if(Ze.nodeType!==Node.ELEMENT_NODE)return{};var Ye="__ql-computed-style";return Ze[Ye]||(Ze[Ye]=window.getComputedStyle(Ze))}function Ae(Ze,Ye){for(var ft="",At=Ze.ops.length-1;At>=0&&ft.length<Ye.length;--At){var Ce=Ze.ops[At];if(typeof Ce.insert!="string")break;ft=Ce.insert+ft}return ft.slice(-1*Ye.length)===Ye}function te(Ze){if(Ze.childNodes.length===0)return!1;var Ye=Ee(Ze);return["block","list-item"].indexOf(Ye.display)>-1}function ve(Ze,Ye,ft){return Ze.nodeType===Ze.TEXT_NODE?ft.reduce(function(At,Ce){return Ce(Ze,At)},new h.default):Ze.nodeType===Ze.ELEMENT_NODE?[].reduce.call(Ze.childNodes||[],function(At,Ce){var Se=ve(Ce,Ye,ft);return Ce.nodeType===Ze.ELEMENT_NODE&&(Se=Ye.reduce(function(qe,pt){return pt(Ce,qe)},Se),Se=(Ce[ae]||[]).reduce(function(qe,pt){return pt(Ce,qe)},Se)),At.concat(Se)},new h.default):new h.default}function we(Ze,Ye,ft){return _e(ft,Ze,!0)}function Ue(Ze,Ye){var ft=p.default.Attributor.Attribute.keys(Ze),At=p.default.Attributor.Class.keys(Ze),Ce=p.default.Attributor.Style.keys(Ze),Se={};return ft.concat(At).concat(Ce).forEach(function(qe){var pt=p.default.query(qe,p.default.Scope.ATTRIBUTE);pt!=null&&(Se[pt.attrName]=pt.value(Ze),Se[pt.attrName])||(pt=Z[qe],pt!=null&&(pt.attrName===qe||pt.keyName===qe)&&(Se[pt.attrName]=pt.value(Ze)||void 0),pt=Y[qe],pt!=null&&(pt.attrName===qe||pt.keyName===qe)&&(pt=Y[qe],Se[pt.attrName]=pt.value(Ze)||void 0))}),Object.keys(Se).length>0&&(Ye=_e(Ye,Se)),Ye}function ze(Ze,Ye){var ft=p.default.query(Ze);if(ft==null)return Ye;if(ft.prototype instanceof p.default.Embed){var At={},Ce=ft.value(Ze);Ce!=null&&(At[ft.blotName]=Ce,Ye=new h.default().insert(At,ft.formats(Ze)))}else typeof ft.formats=="function"&&(Ye=_e(Ye,ft.blotName,ft.formats(Ze)));return Ye}function yt(Ze,Ye){return Ae(Ye,` 5839`)||Ye.insert(` 5840`),Ye}function mt(){return new h.default}function bt(Ze,Ye){var ft=p.default.query(Ze);if(ft==null||ft.blotName!=="list-item"||!Ae(Ye,` 5841`))return Ye;for(var At=-1,Ce=Ze.parentNode;!Ce.classList.contains("ql-clipboard");)(p.default.query(Ce)||{}).blotName==="list"&&(At+=1),Ce=Ce.parentNode;return At<=0?Ye:Ye.compose(new h.default().retain(Ye.length()-1).retain(1,{indent:At}))}function dt(Ze,Ye){return Ae(Ye,` 5842`)||(te(Ze)||Ye.length()>0&&Ze.nextSibling&&te(Ze.nextSibling))&&Ye.insert(` 5843`),Ye}function St(Ze,Ye){if(te(Ze)&&Ze.nextElementSibling!=null&&!Ae(Ye,` 5844 5845`)){var ft=Ze.offsetHeight+parseFloat(Ee(Ze).marginTop)+parseFloat(Ee(Ze).marginBottom);Ze.nextElementSibling.offsetTop>Ze.offsetTop+ft*1.5&&Ye.insert(` 5846`)}return Ye}function kt(Ze,Ye){var ft={},At=Ze.style||{};return At.fontStyle&&Ee(Ze).fontStyle==="italic"&&(ft.italic=!0),At.fontWeight&&(Ee(Ze).fontWeight.startsWith("bold")||parseInt(Ee(Ze).fontWeight)>=700)&&(ft.bold=!0),Object.keys(ft).length>0&&(Ye=_e(Ye,ft)),parseFloat(At.textIndent||0)>0&&(Ye=new h.default().insert(" ").concat(Ye)),Ye}function Fe(Ze,Ye){var ft=Ze.data;if(Ze.parentNode.tagName==="O:P")return Ye.insert(ft.trim());if(ft.trim().length===0&&Ze.parentNode.classList.contains("ql-clipboard"))return Ye;if(!Ee(Ze.parentNode).whiteSpace.startsWith("pre")){var At=function(Se,qe){return qe=qe.replace(/[^\u00a0]/g,""),qe.length<1&&Se?" ":qe};ft=ft.replace(/\r\n/g," ").replace(/\n/g," "),ft=ft.replace(/\s\s+/g,At.bind(At,!0)),(Ze.previousSibling==null&&te(Ze.parentNode)||Ze.previousSibling!=null&&te(Ze.previousSibling))&&(ft=ft.replace(/^\s+/,At.bind(At,!1))),(Ze.nextSibling==null&&te(Ze.parentNode)||Ze.nextSibling!=null&&te(Ze.nextSibling))&&(ft=ft.replace(/\s+$/,At.bind(At,!1)))}return Ye.insert(ft)}r.default=re,r.matchAttributor=Ue,r.matchBlot=ze,r.matchNewline=dt,r.matchSpacing=St,r.matchText=Fe}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function g(A,x){for(var b=0;b<x.length;b++){var _=x[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(A,_.key,_)}}return function(A,x,b){return x&&g(A.prototype,x),b&&g(A,b),A}})(),a=function g(A,x,b){A===null&&(A=Function.prototype);var _=Object.getOwnPropertyDescriptor(A,x);if(_===void 0){var M=Object.getPrototypeOf(A);return M===null?void 0:g(M,x,b)}else{if("value"in _)return _.value;var T=_.get;return T===void 0?void 0:T.call(b)}},o=i(6),l=u(o);function u(g){return g&&g.__esModule?g:{default:g}}function d(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function h(g,A){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:g}function f(g,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);g.prototype=Object.create(A&&A.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(g,A):g.__proto__=A)}var p=(function(g){f(A,g);function A(){return d(this,A),h(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return s(A,[{key:"optimize",value:function(b){a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(A.__proto__||Object.getPrototypeOf(A),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),A})(l.default);p.blotName="bold",p.tagName=["STRONG","B"],r.default=p}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var s=(function(){function B(z,H){var X=[],W=!0,J=!1,ee=void 0;try{for(var ae=z[Symbol.iterator](),le;!(W=(le=ae.next()).done)&&(X.push(le.value),!(H&&X.length===H));W=!0);}catch(Z){J=!0,ee=Z}finally{try{!W&&ae.return&&ae.return()}finally{if(J)throw ee}}return X}return function(z,H){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return B(z,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),a=(function(){function B(z,H){for(var X=0;X<H.length;X++){var W=H[X];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(z,W.key,W)}}return function(z,H,X){return H&&B(z.prototype,H),X&&B(z,X),z}})(),o=i(2),l=b(o),u=i(0),d=b(u),h=i(5),f=b(h),p=i(10),g=b(p),A=i(9),x=b(A);function b(B){return B&&B.__esModule?B:{default:B}}function _(B,z,H){return z in B?Object.defineProperty(B,z,{value:H,enumerable:!0,configurable:!0,writable:!0}):B[z]=H,B}function M(B,z){if(!(B instanceof z))throw new TypeError("Cannot call a class as a function")}function T(B,z){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:B}function L(B,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);B.prototype=Object.create(z&&z.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf(B,z):B.__proto__=z)}var D=(0,g.default)("quill:toolbar"),P=(function(B){L(z,B);function z(H,X){M(this,z);var W=T(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,H,X));if(Array.isArray(W.options.container)){var J=document.createElement("div");F(J,W.options.container),H.container.parentNode.insertBefore(J,H.container),W.container=J}else typeof W.options.container=="string"?W.container=document.querySelector(W.options.container):W.container=W.options.container;if(!(W.container instanceof HTMLElement)){var ee;return ee=D.error("Container required for toolbar",W.options),T(W,ee)}return W.container.classList.add("ql-toolbar"),W.controls=[],W.handlers={},Object.keys(W.options.handlers).forEach(function(ae){W.addHandler(ae,W.options.handlers[ae])}),[].forEach.call(W.container.querySelectorAll("button, select"),function(ae){W.attach(ae)}),W.quill.on(f.default.events.EDITOR_CHANGE,function(ae,le){ae===f.default.events.SELECTION_CHANGE&&W.update(le)}),W.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){var ae=W.quill.selection.getRange(),le=s(ae,1),Z=le[0];W.update(Z)}),W}return a(z,[{key:"addHandler",value:function(X,W){this.handlers[X]=W}},{key:"attach",value:function(X){var W=this,J=[].find.call(X.classList,function(ae){return ae.indexOf("ql-")===0});if(J){if(J=J.slice(3),X.tagName==="BUTTON"&&X.setAttribute("type","button"),this.handlers[J]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[J]==null){D.warn("ignoring attaching to disabled format",J,X);return}if(d.default.query(J)==null){D.warn("ignoring attaching to nonexistent format",J,X);return}}var ee=X.tagName==="SELECT"?"change":"click";X.addEventListener(ee,function(ae){var le=void 0;if(X.tagName==="SELECT"){if(X.selectedIndex<0)return;var Z=X.options[X.selectedIndex];Z.hasAttribute("selected")?le=!1:le=Z.value||!1}else X.classList.contains("ql-active")?le=!1:le=X.value||!X.hasAttribute("value"),ae.preventDefault();W.quill.focus();var Y=W.quill.selection.getRange(),re=s(Y,1),_e=re[0];if(W.handlers[J]!=null)W.handlers[J].call(W,le);else if(d.default.query(J).prototype instanceof d.default.Embed){if(le=prompt("Enter "+J),!le)return;W.quill.updateContents(new l.default().retain(_e.index).delete(_e.length).insert(_({},J,le)),f.default.sources.USER)}else W.quill.format(J,le,f.default.sources.USER);W.update(_e)}),this.controls.push([J,X])}}},{key:"update",value:function(X){var W=X==null?{}:this.quill.getFormat(X);this.controls.forEach(function(J){var ee=s(J,2),ae=ee[0],le=ee[1];if(le.tagName==="SELECT"){var Z=void 0;if(X==null)Z=null;else if(W[ae]==null)Z=le.querySelector("option[selected]");else if(!Array.isArray(W[ae])){var Y=W[ae];typeof Y=="string"&&(Y=Y.replace(/\"/g,'\\"')),Z=le.querySelector('option[value="'+Y+'"]')}Z==null?(le.value="",le.selectedIndex=-1):Z.selected=!0}else if(X==null)le.classList.remove("ql-active");else if(le.hasAttribute("value")){var re=W[ae]===le.getAttribute("value")||W[ae]!=null&&W[ae].toString()===le.getAttribute("value")||W[ae]==null&&!le.getAttribute("value");le.classList.toggle("ql-active",re)}else le.classList.toggle("ql-active",W[ae]!=null)})}}]),z})(x.default);P.DEFAULTS={};function O(B,z,H){var X=document.createElement("button");X.setAttribute("type","button"),X.classList.add("ql-"+z),H!=null&&(X.value=H),B.appendChild(X)}function F(B,z){Array.isArray(z[0])||(z=[z]),z.forEach(function(H){var X=document.createElement("span");X.classList.add("ql-formats"),H.forEach(function(W){if(typeof W=="string")O(X,W);else{var J=Object.keys(W)[0],ee=W[J];Array.isArray(ee)?U(X,J,ee):O(X,J,ee)}}),B.appendChild(X)})}function U(B,z,H){var X=document.createElement("select");X.classList.add("ql-"+z),H.forEach(function(W){var J=document.createElement("option");W!==!1?J.setAttribute("value",W):J.setAttribute("selected","selected"),X.appendChild(J)}),B.appendChild(X)}P.DEFAULTS={container:null,handlers:{clean:function(){var z=this,H=this.quill.getSelection();if(H!=null)if(H.length==0){var X=this.quill.getFormat();Object.keys(X).forEach(function(W){d.default.query(W,d.default.Scope.INLINE)!=null&&z.quill.format(W,!1)})}else this.quill.removeFormat(H,f.default.sources.USER)},direction:function(z){var H=this.quill.getFormat().align;z==="rtl"&&H==null?this.quill.format("align","right",f.default.sources.USER):!z&&H==="right"&&this.quill.format("align",!1,f.default.sources.USER),this.quill.format("direction",z,f.default.sources.USER)},indent:function(z){var H=this.quill.getSelection(),X=this.quill.getFormat(H),W=parseInt(X.indent||0);if(z==="+1"||z==="-1"){var J=z==="+1"?1:-1;X.direction==="rtl"&&(J*=-1),this.quill.format("indent",W+J,f.default.sources.USER)}},link:function(z){z===!0&&(z=prompt("Enter link URL:")),this.quill.format("link",z,f.default.sources.USER)},list:function(z){var H=this.quill.getSelection(),X=this.quill.getFormat(H);z==="check"?X.list==="checked"||X.list==="unchecked"?this.quill.format("list",!1,f.default.sources.USER):this.quill.format("list","unchecked",f.default.sources.USER):this.quill.format("list",z,f.default.sources.USER)}}},r.default=P,r.addControls=F}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function g(A,x){for(var b=0;b<x.length;b++){var _=x[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(A,_.key,_)}}return function(A,x,b){return x&&g(A.prototype,x),b&&g(A,b),A}})(),a=function g(A,x,b){A===null&&(A=Function.prototype);var _=Object.getOwnPropertyDescriptor(A,x);if(_===void 0){var M=Object.getPrototypeOf(A);return M===null?void 0:g(M,x,b)}else{if("value"in _)return _.value;var T=_.get;return T===void 0?void 0:T.call(b)}},o=i(28),l=u(o);function u(g){return g&&g.__esModule?g:{default:g}}function d(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function h(g,A){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:g}function f(g,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);g.prototype=Object.create(A&&A.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(g,A):g.__proto__=A)}var p=(function(g){f(A,g);function A(x,b){d(this,A);var _=h(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,x));return _.label.innerHTML=b,_.container.classList.add("ql-color-picker"),[].slice.call(_.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(M){M.classList.add("ql-primary")}),_}return s(A,[{key:"buildItem",value:function(b){var _=a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"buildItem",this).call(this,b);return _.style.backgroundColor=b.getAttribute("value")||"",_}},{key:"selectItem",value:function(b,_){a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"selectItem",this).call(this,b,_);var M=this.label.querySelector(".ql-color-label"),T=b&&b.getAttribute("data-value")||"";M&&(M.tagName==="line"?M.style.stroke=T:M.style.fill=T)}}]),A})(l.default);r.default=p}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function g(A,x){for(var b=0;b<x.length;b++){var _=x[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(A,_.key,_)}}return function(A,x,b){return x&&g(A.prototype,x),b&&g(A,b),A}})(),a=function g(A,x,b){A===null&&(A=Function.prototype);var _=Object.getOwnPropertyDescriptor(A,x);if(_===void 0){var M=Object.getPrototypeOf(A);return M===null?void 0:g(M,x,b)}else{if("value"in _)return _.value;var T=_.get;return T===void 0?void 0:T.call(b)}},o=i(28),l=u(o);function u(g){return g&&g.__esModule?g:{default:g}}function d(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function h(g,A){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:g}function f(g,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);g.prototype=Object.create(A&&A.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(g,A):g.__proto__=A)}var p=(function(g){f(A,g);function A(x,b){d(this,A);var _=h(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,x));return _.container.classList.add("ql-icon-picker"),[].forEach.call(_.container.querySelectorAll(".ql-picker-item"),function(M){M.innerHTML=b[M.getAttribute("data-value")||""]}),_.defaultItem=_.container.querySelector(".ql-selected"),_.selectItem(_.defaultItem),_}return s(A,[{key:"selectItem",value:function(b,_){a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"selectItem",this).call(this,b,_),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),A})(l.default);r.default=p}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function l(u,d){for(var h=0;h<d.length;h++){var f=d[h];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,d,h){return d&&l(u.prototype,d),h&&l(u,h),u}})();function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=(function(){function l(u,d){var h=this;a(this,l),this.quill=u,this.boundsContainer=d||document.body,this.root=u.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){h.root.style.marginTop=-1*h.quill.root.scrollTop+"px"}),this.hide()}return s(l,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(d){var h=d.left+d.width/2-this.root.offsetWidth/2,f=d.bottom+this.quill.root.scrollTop;this.root.style.left=h+"px",this.root.style.top=f+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),g=this.root.getBoundingClientRect(),A=0;if(g.right>p.right&&(A=p.right-g.right,this.root.style.left=h+A+"px"),g.left<p.left&&(A=p.left-g.left,this.root.style.left=h+A+"px"),g.bottom>p.bottom){var x=g.bottom-g.top,b=d.bottom-d.top+x;this.root.style.top=f-b+"px",this.root.classList.add("ql-flip")}return A}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),l})();r.default=o}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function U(B,z){var H=[],X=!0,W=!1,J=void 0;try{for(var ee=B[Symbol.iterator](),ae;!(X=(ae=ee.next()).done)&&(H.push(ae.value),!(z&&H.length===z));X=!0);}catch(le){W=!0,J=le}finally{try{!X&&ee.return&&ee.return()}finally{if(W)throw J}}return H}return function(B,z){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return U(B,z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),a=function U(B,z,H){B===null&&(B=Function.prototype);var X=Object.getOwnPropertyDescriptor(B,z);if(X===void 0){var W=Object.getPrototypeOf(B);return W===null?void 0:U(W,z,H)}else{if("value"in X)return X.value;var J=X.get;return J===void 0?void 0:J.call(H)}},o=(function(){function U(B,z){for(var H=0;H<z.length;H++){var X=z[H];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(B,X.key,X)}}return function(B,z,H){return z&&U(B.prototype,z),H&&U(B,H),B}})(),l=i(3),u=M(l),d=i(8),h=M(d),f=i(43),p=M(f),g=i(27),A=M(g),x=i(15),b=i(41),_=M(b);function M(U){return U&&U.__esModule?U:{default:U}}function T(U,B){if(!(U instanceof B))throw new TypeError("Cannot call a class as a function")}function L(U,B){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B&&(typeof B=="object"||typeof B=="function")?B:U}function D(U,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);U.prototype=Object.create(B&&B.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(U,B):U.__proto__=B)}var P=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],O=(function(U){D(B,U);function B(z,H){T(this,B),H.modules.toolbar!=null&&H.modules.toolbar.container==null&&(H.modules.toolbar.container=P);var X=L(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,z,H));return X.quill.container.classList.add("ql-snow"),X}return o(B,[{key:"extendToolbar",value:function(H){H.container.classList.add("ql-snow"),this.buildButtons([].slice.call(H.container.querySelectorAll("button")),_.default),this.buildPickers([].slice.call(H.container.querySelectorAll("select")),_.default),this.tooltip=new F(this.quill,this.options.bounds),H.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(X,W){H.handlers.link.call(H,!W.format.link)})}}]),B})(p.default);O.DEFAULTS=(0,u.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(B){if(B){var z=this.quill.getSelection();if(z==null||z.length==0)return;var H=this.quill.getText(z);/^\S+@\S+\.\S+$/.test(H)&&H.indexOf("mailto:")!==0&&(H="mailto:"+H);var X=this.quill.theme.tooltip;X.edit("link",H)}else this.quill.format("link",!1)}}}}});var F=(function(U){D(B,U);function B(z,H){T(this,B);var X=L(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,z,H));return X.preview=X.root.querySelector("a.ql-preview"),X}return o(B,[{key:"listen",value:function(){var H=this;a(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(X){H.root.classList.contains("ql-editing")?H.save():H.edit("link",H.preview.textContent),X.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(X){if(H.linkRange!=null){var W=H.linkRange;H.restoreFocus(),H.quill.formatText(W,"link",!1,h.default.sources.USER),delete H.linkRange}X.preventDefault(),H.hide()}),this.quill.on(h.default.events.SELECTION_CHANGE,function(X,W,J){if(X!=null){if(X.length===0&&J===h.default.sources.USER){var ee=H.quill.scroll.descendant(A.default,X.index),ae=s(ee,2),le=ae[0],Z=ae[1];if(le!=null){H.linkRange=new x.Range(X.index-Z,le.length());var Y=A.default.formats(le.domNode);H.preview.textContent=Y,H.preview.setAttribute("href",Y),H.show(),H.position(H.quill.getBounds(H.linkRange));return}}else delete H.linkRange;H.hide()}})}},{key:"show",value:function(){a(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),B})(f.BaseTooltip);F.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),r.default=O}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(29),a=Ce(s),o=i(36),l=i(38),u=i(64),d=i(65),h=Ce(d),f=i(66),p=Ce(f),g=i(67),A=Ce(g),x=i(37),b=i(26),_=i(39),M=i(40),T=i(56),L=Ce(T),D=i(68),P=Ce(D),O=i(27),F=Ce(O),U=i(69),B=Ce(U),z=i(70),H=Ce(z),X=i(71),W=Ce(X),J=i(72),ee=Ce(J),ae=i(73),le=Ce(ae),Z=i(13),Y=Ce(Z),re=i(74),_e=Ce(re),Ee=i(75),Ae=Ce(Ee),te=i(57),ve=Ce(te),we=i(41),Ue=Ce(we),ze=i(28),yt=Ce(ze),mt=i(59),bt=Ce(mt),dt=i(60),St=Ce(dt),kt=i(61),Fe=Ce(kt),Ze=i(108),Ye=Ce(Ze),ft=i(62),At=Ce(ft);function Ce(Se){return Se&&Se.__esModule?Se:{default:Se}}a.default.register({"attributors/attribute/direction":l.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":x.BackgroundClass,"attributors/class/color":b.ColorClass,"attributors/class/direction":l.DirectionClass,"attributors/class/font":_.FontClass,"attributors/class/size":M.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":x.BackgroundStyle,"attributors/style/color":b.ColorStyle,"attributors/style/direction":l.DirectionStyle,"attributors/style/font":_.FontStyle,"attributors/style/size":M.SizeStyle},!0),a.default.register({"formats/align":o.AlignClass,"formats/direction":l.DirectionClass,"formats/indent":u.IndentClass,"formats/background":x.BackgroundStyle,"formats/color":b.ColorStyle,"formats/font":_.FontClass,"formats/size":M.SizeClass,"formats/blockquote":h.default,"formats/code-block":Y.default,"formats/header":p.default,"formats/list":A.default,"formats/bold":L.default,"formats/code":Z.Code,"formats/italic":P.default,"formats/link":F.default,"formats/script":B.default,"formats/strike":H.default,"formats/underline":W.default,"formats/image":ee.default,"formats/video":le.default,"formats/list/item":g.ListItem,"modules/formula":_e.default,"modules/syntax":Ae.default,"modules/toolbar":ve.default,"themes/bubble":Ye.default,"themes/snow":At.default,"ui/icons":Ue.default,"ui/picker":yt.default,"ui/icon-picker":St.default,"ui/color-picker":bt.default,"ui/tooltip":Fe.default},!0),r.default=a.default}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var s=(function(){function A(x,b){for(var _=0;_<b.length;_++){var M=b[_];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,b,_){return b&&A(x.prototype,b),_&&A(x,_),x}})(),a=function A(x,b,_){x===null&&(x=Function.prototype);var M=Object.getOwnPropertyDescriptor(x,b);if(M===void 0){var T=Object.getPrototypeOf(x);return T===null?void 0:A(T,b,_)}else{if("value"in M)return M.value;var L=M.get;return L===void 0?void 0:L.call(_)}},o=i(0),l=u(o);
5846function u(A){return A&&A.__esModule?A:{default:A}}function d(A,x){if(!(A instanceof x))throw new TypeError("Cannot call a class as a function")}function h(A,x){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:A}function f(A,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);A.prototype=Object.create(x&&x.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(A,x):A.__proto__=x)}var p=(function(A){f(x,A);function x(){return d(this,x),h(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"add",value:function(_,M){if(M==="+1"||M==="-1"){var T=this.value(_)||0;M=M==="+1"?T+1:T-1}return M===0?(this.remove(_),!0):a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"add",this).call(this,_,M)}},{key:"canAdd",value:function(_,M){return a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,_,M)||a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,_,parseInt(M))}},{key:"value",value:function(_){return parseInt(a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,_))||void 0}}]),x})(l.default.Attributor.Class),g=new p("indent","ql-indent",{scope:l.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=g}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(4),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function l(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}function u(f,p){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:f}function d(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);f.prototype=Object.create(p&&p.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(f,p):f.__proto__=p)}var h=(function(f){d(p,f);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(a.default);h.blotName="blockquote",h.tagName="blockquote",r.default=h}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function p(g,A){for(var x=0;x<A.length;x++){var b=A[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(g,b.key,b)}}return function(g,A,x){return A&&p(g.prototype,A),x&&p(g,x),g}})(),a=i(4),o=l(a);function l(p){return p&&p.__esModule?p:{default:p}}function u(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")}function d(p,g){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:p}function h(p,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);p.prototype=Object.create(g&&g.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(p,g):p.__proto__=g)}var f=(function(p){h(g,p);function g(){return u(this,g),d(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,null,[{key:"formats",value:function(x){return this.tagName.indexOf(x.tagName)+1}}]),g})(o.default);f.blotName="header",f.tagName=["H1","H2","H3","H4","H5","H6"],r.default=f}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var s=(function(){function T(L,D){for(var P=0;P<D.length;P++){var O=D[P];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(L,O.key,O)}}return function(L,D,P){return D&&T(L.prototype,D),P&&T(L,P),L}})(),a=function T(L,D,P){L===null&&(L=Function.prototype);var O=Object.getOwnPropertyDescriptor(L,D);if(O===void 0){var F=Object.getPrototypeOf(L);return F===null?void 0:T(F,D,P)}else{if("value"in O)return O.value;var U=O.get;return U===void 0?void 0:U.call(P)}},o=i(0),l=p(o),u=i(4),d=p(u),h=i(25),f=p(h);
vendor: 14,177 bytes, line 5846
5846function p(T){return T&&T.__esModule?T:{default:T}}function g(T,L,D){return L in T?Object.defineProperty(T,L,{value:D,enumerable:!0,configurable:!0,writable:!0}):T[L]=D,T}function A(T,L){if(!(T instanceof L))throw new TypeError("Cannot call a class as a function")}function x(T,L){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:T}function b(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(T,L):T.__proto__=L)}var _=(function(T){b(L,T);function L(){return A(this,L),x(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return s(L,[{key:"format",value:function(P,O){P===M.blotName&&!O?this.replaceWith(l.default.create(this.statics.scope)):a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"format",this).call(this,P,O)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(P,O){return this.parent.isolate(this.offset(this.parent),this.length()),P===this.parent.statics.blotName?(this.parent.replaceWith(P,O),this):(this.parent.unwrap(),a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"replaceWith",this).call(this,P,O))}}],[{key:"formats",value:function(P){return P.tagName===this.tagName?void 0:a(L.__proto__||Object.getPrototypeOf(L),"formats",this).call(this,P)}}]),L})(d.default);_.blotName="list-item",_.tagName="LI";var M=(function(T){b(L,T),s(L,null,[{key:"create",value:function(P){var O=P==="ordered"?"OL":"UL",F=a(L.__proto__||Object.getPrototypeOf(L),"create",this).call(this,O);return(P==="checked"||P==="unchecked")&&F.setAttribute("data-checked",P==="checked"),F}},{key:"formats",value:function(P){if(P.tagName==="OL")return"ordered";if(P.tagName==="UL")return P.hasAttribute("data-checked")?P.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function L(D){A(this,L);var P=x(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,D)),O=function(U){if(U.target.parentNode===D){var B=P.statics.formats(D),z=l.default.find(U.target);B==="checked"?z.format("list","unchecked"):B==="unchecked"&&z.format("list","checked")}};return D.addEventListener("touchstart",O),D.addEventListener("mousedown",O),P}return s(L,[{key:"format",value:function(P,O){this.children.length>0&&this.children.tail.format(P,O)}},{key:"formats",value:function(){return g({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(P,O){if(P instanceof _)a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,P,O);else{var F=O==null?this.length():O.offset(this),U=this.split(F);U.parent.insertBefore(P,U)}}},{key:"optimize",value:function(P){a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,P);var O=this.next;O!=null&&O.prev===this&&O.statics.blotName===this.statics.blotName&&O.domNode.tagName===this.domNode.tagName&&O.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(O.moveChildren(this),O.remove())}},{key:"replace",value:function(P){if(P.statics.blotName!==this.statics.blotName){var O=l.default.create(this.statics.defaultChild);P.moveChildren(O),this.appendChild(O)}a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"replace",this).call(this,P)}}]),L})(f.default);M.blotName="list",M.scope=l.default.Scope.BLOCK_BLOT,M.tagName=["OL","UL"],M.defaultChild="list-item",M.allowedChildren=[_],r.ListItem=_,r.default=M}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(56),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function l(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}function u(f,p){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:f}function d(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);f.prototype=Object.create(p&&p.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(f,p):f.__proto__=p)}var h=(function(f){d(p,f);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(a.default);h.blotName="italic",h.tagName=["EM","I"],r.default=h}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function g(A,x){for(var b=0;b<x.length;b++){var _=x[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(A,_.key,_)}}return function(A,x,b){return x&&g(A.prototype,x),b&&g(A,b),A}})(),a=function g(A,x,b){A===null&&(A=Function.prototype);var _=Object.getOwnPropertyDescriptor(A,x);if(_===void 0){var M=Object.getPrototypeOf(A);return M===null?void 0:g(M,x,b)}else{if("value"in _)return _.value;var T=_.get;return T===void 0?void 0:T.call(b)}},o=i(6),l=u(o);function u(g){return g&&g.__esModule?g:{default:g}}function d(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function h(g,A){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:g}function f(g,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);g.prototype=Object.create(A&&A.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(g,A):g.__proto__=A)}var p=(function(g){f(A,g);function A(){return d(this,A),h(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return s(A,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):a(A.__proto__||Object.getPrototypeOf(A),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),A})(l.default);p.blotName="script",p.tagName=["SUB","SUP"],r.default=p}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(6),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function l(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}function u(f,p){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:f}function d(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);f.prototype=Object.create(p&&p.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(f,p):f.__proto__=p)}var h=(function(f){d(p,f);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(a.default);h.blotName="strike",h.tagName="S",r.default=h}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(6),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function l(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}function u(f,p){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:f}function d(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);f.prototype=Object.create(p&&p.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(f,p):f.__proto__=p)}var h=(function(f){d(p,f);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(a.default);h.blotName="underline",h.tagName="U",r.default=h}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function x(b,_){for(var M=0;M<_.length;M++){var T=_[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,_,M){return _&&x(b.prototype,_),M&&x(b,M),b}})(),a=function x(b,_,M){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,_);if(T===void 0){var L=Object.getPrototypeOf(b);return L===null?void 0:x(L,_,M)}else{if("value"in T)return T.value;var D=T.get;return D===void 0?void 0:D.call(M)}},o=i(0),l=d(o),u=i(27);function d(x){return x&&x.__esModule?x:{default:x}}function h(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function f(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var g=["alt","height","width"],A=(function(x){p(b,x);function b(){return h(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"format",value:function(M,T){g.indexOf(M)>-1?T?this.domNode.setAttribute(M,T):this.domNode.removeAttribute(M):a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,M,T)}}],[{key:"create",value:function(M){var T=a(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,M);return typeof M=="string"&&T.setAttribute("src",this.sanitize(M)),T}},{key:"formats",value:function(M){return g.reduce(function(T,L){return M.hasAttribute(L)&&(T[L]=M.getAttribute(L)),T},{})}},{key:"match",value:function(M){return/\.(jpe?g|gif|png)$/.test(M)||/^data:image\/.+;base64/.test(M)}},{key:"sanitize",value:function(M){return(0,u.sanitize)(M,["http","https","data"])?M:"//:0"}},{key:"value",value:function(M){return M.getAttribute("src")}}]),b})(l.default.Embed);A.blotName="image",A.tagName="IMG",r.default=A}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=(function(){function x(b,_){for(var M=0;M<_.length;M++){var T=_[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,_,M){return _&&x(b.prototype,_),M&&x(b,M),b}})(),a=function x(b,_,M){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,_);if(T===void 0){var L=Object.getPrototypeOf(b);return L===null?void 0:x(L,_,M)}else{if("value"in T)return T.value;var D=T.get;return D===void 0?void 0:D.call(M)}},o=i(4),l=i(27),u=d(l);function d(x){return x&&x.__esModule?x:{default:x}}function h(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function f(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var g=["height","width"],A=(function(x){p(b,x);function b(){return h(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"format",value:function(M,T){g.indexOf(M)>-1?T?this.domNode.setAttribute(M,T):this.domNode.removeAttribute(M):a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,M,T)}}],[{key:"create",value:function(M){var T=a(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,M);return T.setAttribute("frameborder","0"),T.setAttribute("allowfullscreen",!0),T.setAttribute("src",this.sanitize(M)),T}},{key:"formats",value:function(M){return g.reduce(function(T,L){return M.hasAttribute(L)&&(T[L]=M.getAttribute(L)),T},{})}},{key:"sanitize",value:function(M){return u.default.sanitize(M)}},{key:"value",value:function(M){return M.getAttribute("src")}}]),b})(o.BlockEmbed);A.blotName="video",A.className="ql-video",A.tagName="IFRAME",r.default=A}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var s=(function(){function M(T,L){for(var D=0;D<L.length;D++){var P=L[D];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(T,P.key,P)}}return function(T,L,D){return L&&M(T.prototype,L),D&&M(T,D),T}})(),a=function M(T,L,D){T===null&&(T=Function.prototype);var P=Object.getOwnPropertyDescriptor(T,L);if(P===void 0){var O=Object.getPrototypeOf(T);return O===null?void 0:M(O,L,D)}else{if("value"in P)return P.value;var F=P.get;return F===void 0?void 0:F.call(D)}},o=i(35),l=p(o),u=i(5),d=p(u),h=i(9),f=p(h);function p(M){return M&&M.__esModule?M:{default:M}}function g(M,T){if(!(M instanceof T))throw new TypeError("Cannot call a class as a function")}function A(M,T){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:M}function x(M,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);M.prototype=Object.create(T&&T.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(M,T):M.__proto__=T)}var b=(function(M){x(T,M);function T(){return g(this,T),A(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return s(T,null,[{key:"create",value:function(D){var P=a(T.__proto__||Object.getPrototypeOf(T),"create",this).call(this,D);
5846return typeof D=="string"&&(window.katex.render(D,P,{throwOnError:!1,errorColor:"#f00"}),P.setAttribute("data-value",D)),P}},{key:"value",value:function(D){return D.getAttribute("data-value")}}]),T})(l.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var _=(function(M){x(T,M),s(T,null,[{key:"register",value:function(){d.default.register(b,!0)}}]);function T(){g(this,T);var L=A(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return L}return T})(f.default);r.FormulaBlot=b,r.default=_}),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var s=(function(){function D(P,O){for(var F=0;F<O.length;F++){var U=O[F];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(P,U.key,U)}}return function(P,O,F){return O&&D(P.prototype,O),F&&D(P,F),P}})(),a=function D(P,O,F){P===null&&(P=Function.prototype);var U=Object.getOwnPropertyDescriptor(P,O);if(U===void 0){var B=Object.getPrototypeOf(P);return B===null?void 0:D(B,O,F)}else{if("value"in U)return U.value;var z=U.get;return z===void 0?void 0:z.call(F)}},o=i(0),l=A(o),u=i(5),d=A(u),h=i(9),f=A(h),p=i(13),g=A(p);function A(D){return D&&D.__esModule?D:{default:D}}function x(D,P){if(!(D instanceof P))throw new TypeError("Cannot call a class as a function")}function b(D,P){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:D}function _(D,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);D.prototype=Object.create(P&&P.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(D,P):D.__proto__=P)}var M=(function(D){_(P,D);function P(){return x(this,P),b(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return s(P,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,F)}},{key:"highlight",value:function(F){var U=this.domNode.textContent;this.cachedText!==U&&((U.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=F(U),this.domNode.normalize(),this.attach()),this.cachedText=U)}}]),P})(g.default);M.className="ql-syntax";var T=new l.default.Attributor.Class("token","hljs",{scope:l.default.Scope.INLINE}),L=(function(D){_(P,D),s(P,null,[{key:"register",value:function(){d.default.register(T,!0),d.default.register(M,!0)}}]);function P(O,F){x(this,P);var U=b(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,O,F));if(typeof U.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var B=null;return U.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(B),B=setTimeout(function(){U.highlight(),B=null},U.options.interval)}),U.highlight(),U}return s(P,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(d.default.sources.USER);var U=this.quill.getSelection();this.quill.scroll.descendants(M).forEach(function(B){B.highlight(F.options.highlight)}),this.quill.update(d.default.sources.SILENT),U!=null&&this.quill.setSelection(U,d.default.sources.SILENT)}}}]),P})(f.default);L.DEFAULTS={highlight:(function(){return window.hljs==null?null:function(D){var P=window.hljs.highlightAuto(D);return P.value}})(),interval:1e3},r.CodeBlock=M,r.CodeToken=T,r.default=L}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18">
5846 <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'}),(function(t,r){t.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.
5846177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'}),(function(t,r){t.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'}),(function(t,r){t.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'}),(function(t,r){t.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'}),(function(t,r){t.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'}
vendor: 9,143 bytes, line 5846
5846),(function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var s=function P(O,F,U){O===null&&(O=Function.prototype);var B=Object.getOwnPropertyDescriptor(O,F);if(B===void 0){var z=Object.getPrototypeOf(O);return z===null?void 0:P(z,F,U)}else{if("value"in B)return B.value;var H=B.get;return H===void 0?void 0:H.call(U)}},a=(function(){function P(O,F){for(var U=0;U<F.length;U++){var B=F[U];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(O,B.key,B)}}return function(O,F,U){return F&&P(O.prototype,F),U&&P(O,U),O}})(),o=i(3),l=x(o),u=i(8),d=x(u),h=i(43),f=x(h),p=i(15),g=i(41),A=x(g);function x(P){return P&&P.__esModule?P:{default:P}}function b(P,O){if(!(P instanceof O))throw new TypeError("Cannot call a class as a function")}function _(P,O){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:P}function M(P,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);P.prototype=Object.create(O&&O.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(P,O):P.__proto__=O)}var T=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],L=(function(P){M(O,P);function O(F,U){b(this,O),U.modules.toolbar!=null&&U.modules.toolbar.container==null&&(U.modules.toolbar.container=T);var B=_(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,U));return B.quill.container.classList.add("ql-bubble"),B}return a(O,[{key:"extendToolbar",value:function(U){this.tooltip=new D(this.quill,this.options.bounds),this.tooltip.root.appendChild(U.container),this.buildButtons([].slice.call(U.container.querySelectorAll("button")),A.default),this.buildPickers([].slice.call(U.container.querySelectorAll("select")),A.default)}}]),O})(f.default);L.DEFAULTS=(0,l.default)(!0,{},f.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(O){O?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var D=(function(P){M(O,P);function O(F,U){b(this,O);var B=_(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,U));return B.quill.on(d.default.events.EDITOR_CHANGE,function(z,H,X,W){if(z===d.default.events.SELECTION_CHANGE)if(H!=null&&H.length>0&&W===d.default.sources.USER){B.show(),B.root.style.left="0px",B.root.style.width="",B.root.style.width=B.root.offsetWidth+"px";var J=B.quill.getLines(H.index,H.length);if(J.length===1)B.position(B.quill.getBounds(H));else{var ee=J[J.length-1],ae=B.quill.getIndex(ee),le=Math.min(ee.length()-1,H.index+H.length-ae),Z=B.quill.getBounds(new p.Range(ae,le));B.position(Z)}}else document.activeElement!==B.textbox&&B.quill.hasFocus()&&B.hide()}),B}return a(O,[{key:"listen",value:function(){var U=this;s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){U.root.classList.remove("ql-editing")}),this.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!U.root.classList.contains("ql-hidden")){var B=U.quill.getSelection();B!=null&&U.position(U.quill.getBounds(B))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(U){var B=s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"position",this).call(this,U),z=this.root.querySelector(".ql-tooltip-arrow");if(z.style.marginLeft="",B===0)return B;z.style.marginLeft=-1*B-z.offsetWidth/2+"px"}}]),O})(h.BaseTooltip);D.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),r.BubbleTooltip=D,r.default=L}),(function(t,r,i){t.exports=i(63)})]).default})})(H6)),H6.exports}var Nf,aie;function a0t(){if(aie)return Nf;aie=1;var n=Nf&&Nf.__extends||(function(){var d=function(h,f){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,g){p.__proto__=g}||function(p,g){for(var A in g)g.hasOwnProperty(A)&&(p[A]=g[A])},d(h,f)};return function(h,f){d(h,f);function p(){this.constructor=h}h.prototype=f===null?Object.create(f):(p.prototype=f.prototype,new p)}})(),e=Nf&&Nf.__assign||function(){return e=Object.assign||function(d){for(var h,f=1,p=arguments.length;f<p;f++){h=arguments[f];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(d[g]=h[g])}return d},e.apply(this,arguments)},t=Nf&&Nf.__spreadArrays||function(){for(var d=0,h=0,f=arguments.length;h<f;h++)d+=arguments[h].length;for(var p=Array(d),g=0,h=0;h<f;h++)for(var A=arguments[h],x=0,b=A.length;x<b;x++,g++)p[g]=A[x];return p},r=Nf&&Nf.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},i=r(f_()),s=r(YU()),a=r(r0t()),o=r(s0t()),l=(function(d){n(h,d);function h(f){var p=d.call(this,f)||this;p.dirtyProps=["modules","formats","bounds","theme","children"],p.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],p.state={generation:0},p.selection=null,p.onEditorChange=function(A,x,b,_){var M,T,L,D;A==="text-change"?(T=(M=p).onEditorChangeText)===null||T===void 0||T.call(M,p.editor.root.innerHTML,x,_,p.unprivilegedEditor):A==="selection-change"&&((D=(L=p).onEditorChangeSelection)===null||D===void 0||D.call(L,x,_,p.unprivilegedEditor))};var g=p.isControlled()?f.value:f.defaultValue;return p.value=g??"",p}return h.prototype.validateProps=function(f){var p;if(i.default.Children.count(f.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(i.default.Children.count(f.children)){var g=i.default.Children.only(f.children);if(((p=g)===null||p===void 0?void 0:p.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&f.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")},h.prototype.shouldComponentUpdate=function(f,p){var g=this,A;if(this.validateProps(f),!this.editor||this.state.generation!==p.generation)return!0;if("value"in f){var x=this.getEditorContents(),b=(A=f.value,A??"");this.isEqualValue(b,x)||this.setEditorContents(this.editor,b)}return f.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,f.readOnly),t(this.cleanProps,this.dirtyProps).some(function(_){return!a.default(f[_],g.props[_])})},h.prototype.shouldComponentRegenerate=function(f){var p=this;return this.dirtyProps.some(function(g){return!a.default(f[g],p.props[g])})},h.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},h.prototype.componentWillUnmount=function(){this.destroyEditor()},h.prototype.componentDidUpdate=function(f,p){var g=this;if(this.editor&&this.shouldComponentRegenerate(f)){var A=this.editor.getContents(),x=this.editor.getSelection();this.regenerationSnapshot={delta:A,selection:x},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==p.generation){var b=this.regenerationSnapshot,A=b.delta,_=b.selection;delete this.regenerationSnapshot,this.instantiateEditor();var M=this.editor;M.setContents(A),u(function(){return g.setEditorSelection(M,_)})}},h.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},h.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},h.prototype.isControlled=function(){return"value"in this.props},h.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},h.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},h.prototype.createEditor=function(f,p){var g=new o.default(f,p);return p.tabIndex!=null&&this.setEditorTabIndex(g,p.tabIndex),this.hookEditor(g),g},h.prototype.hookEditor=function(f){this.unprivilegedEditor=this.makeUnprivilegedEditor(f),f.on("editor-change",this.onEditorChange)},h.prototype.unhookEditor=function(f){f.off("editor-change",this.onEditorChange)},h.prototype.getEditorContents=function(){return this.value},h.prototype.getEditorSelection=function(){return this.selection},h.prototype.isDelta=function(f){return f&&f.ops},h.prototype.isEqualValue=function(f,p){return this.isDelta(f)&&this.isDelta(p)?a.default(f.ops,p.ops):a.default(f,p)},h.prototype.setEditorContents=function(f,p){var g=this;this.value=p;var A=this.getEditorSelection();typeof p=="string"?f.setContents(f.clipboard.convert(p)):f.setContents(p),u(function(){return g.setE
5846ditorSelection(f,A)})},h.prototype.setEditorSelection=function(f,p){if(this.selection=p,p){var g=f.getLength();p.index=Math.max(0,Math.min(p.index,g-1)),p.length=Math.max(0,Math.min(p.length,g-1-p.index)),f.setSelection(p)}},h.prototype.setEditorTabIndex=function(f,p){var g,A;!((A=(g=f)===null||g===void 0?void 0:g.scroll)===null||A===void 0)&&A.domNode&&(f.scroll.domNode.tabIndex=p)},h.prototype.setEditorReadOnly=function(f,p){p?f.disable():f.enable()},h.prototype.makeUnprivilegedEditor=function(f){var p=f;return{getHTML:function(){return p.root.innerHTML},getLength:p.getLength.bind(p),getText:p.getText.bind(p),getContents:p.getContents.bind(p),getSelection:p.getSelection.bind(p),getBounds:p.getBounds.bind(p)}},h.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var f=s.default.findDOMNode(this.editingArea);if(!f)throw new Error("Cannot find element for editing area");if(f.nodeType===3)throw new Error("Editing area cannot be a text node");return f},h.prototype.renderEditingArea=function(){var f=this,p=this.props,g=p.children,A=p.preserveWhitespace,x=this.state.generation,b={key:x,ref:function(_){f.editingArea=_}};return i.default.Children.count(g)?i.default.cloneElement(i.default.Children.only(g),b):A?i.default.createElement("pre",e({},b)):i.default.createElement("div",e({},b))},h.prototype.render=function(){var f;return i.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(f=this.props.className,f??""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},h.prototype.onEditorChangeText=function(f,p,g,A){var x,b;if(this.editor){var _=this.isDelta(this.value)?A.getContents():A.getHTML();_!==this.getEditorContents()&&(this.lastDeltaChangeSet=p,this.value=_,(b=(x=this.props).onChange)===null||b===void 0||b.call(x,f,p,g,A))}},h.prototype.onEditorChangeSelection=function(f,p,g){var A,x,b,_,M,T;if(this.editor){var L=this.getEditorSelection(),D=!L&&f,P=L&&!f;a.default(f,L)||(this.selection=f,(x=(A=this.props).onChangeSelection)===null||x===void 0||x.call(A,f,p,g),D?(_=(b=this.props).onFocus)===null||_===void 0||_.call(b,f,p,g):P&&((T=(M=this.props).onBlur)===null||T===void 0||T.call(M,L,p,g)))}},h.prototype.focus=function(){this.editor&&this.editor.focus()},h.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},h.displayName="React Quill",h.Quill=o.default,h.defaultProps={theme:"snow",modules:{},readOnly:!1},h})(i.default.Component);function u(d){Promise.resolve().then(d)}return Nf=l,Nf}var o0t=a0t();const l0t=F1(o0t),c0t=({onClose:n,adDescription:e,keywords:t,groupText:r,url:i,tierProEnabled:s})=>{const[a,o]=G.useState(""),l=G.useRef(null),[u,d]=G.useState(!1),[h,f]=G.useState(!1),p=ro(),g=_=>{o(_)},A=_=>{l.current&&!l.current.contains(_.target)&&n()};G.useEffect(()=>(o(e),document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}),[]);const x=()=>{const _=new Blob([a],{type:"text/html"}),M=new ClipboardItem({"text/html":_});navigator.clipboard.write([M]).then(()=>{alert("Text copied to clipboard")}).catch(T=>{console.error("Failed to copy text: ",T)})},b=async()=>{if(f(!0),s){try{const _=await BSe({adDescription:e,keywords:t,groupText:r});_&&o(_)}catch(_){window.alert("Error: "+(_.message||"Something went wrong"))}f(!1),d(!0)}else window.confirm("Your current plan does not include this feature. Would you like to upgrade to Pro?")&&p("/#pricing"),f(!1)};return Vl.createPortal(c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-40 backdrop-blur-sm transition-opacity duration-300 animate-fadein",children:c.jsxs("div",{ref:l,className:"relative bg-white dark:bg-[#18181b] border border-indigo-100 dark:border-gray-700 rounded-2xl shadow-2xl p-6 w-full max-w-2xl mx-4 animate-scalein",style:{boxShadow:"0 6px 32px 0 rgba(16,30,54,0.08)"},children:[c.jsx("button",{className:"absolute top-3 right-3 p-2 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-yellow-200 hover:text-yellow-700 transition-colors duration-200 shadow-sm",onClick:n,"aria-label":"Close",children:c.jsx("svg",{width:"20",height:"20",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),c.jsx(l0t,{className:`w-full h-80 p-2 rounded-xl border transition-all duration-300 ${u?"ring-2 ring-yellow-300 dark:ring-yellow-500 bg-yellow-50 dark:bg-yellow-900/10":"border-gray-200 dark:border-gray-700"}`,value:a,onChange:g,style:{color:"white",minHeight:400,paddingBottom:50},theme:"snow"}),c.jsx("div",{className:"mt-6 flex flex-col sm:flex-row gap-3 justify-end items-center",children:u?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"flex-1 flex items-center justify-center min-w-[7rem] font-semibold text-white bg-gradient-to-r from-green-500 to-green-600 shadow-md ring-1 ring-inset ring-green-300 py-2.5 px-5 rounded-xl hover:from-green-600 hover:to-lime-600 hover:ring-green-400 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-green-500 animate-fadein-btn",onClick:x,children:"Copy"}),c.jsx("button",{className:"flex-1 flex items-center justify-center min-w-[7rem] font-semibold text-white bg-gradient-to-r from-yellow-500 to-yellow-600 shadow-md ring-1 ring-inset ring-yellow-300 py-2.5 px-5 rounded-xl hover:from-yellow-600 hover:to-yellow-600 hover:ring-yellow-400 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-yellow-500 animate-fadein-btn",onClick:()=>window.open(i,"_blank"),children:"Share"})]}):c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",disabled:h,onClick:b,className:"flex-1 flex items-center justify-center min-w-[8rem] font-semibold text-gray-900 bg-gradient-to-r from-yellow-200 via-yellow-400 to-yellow-300 shadow-lg ring-1 ring-inset ring-yellow-300 py-2.5 px-5 rounded-xl hover:from-yellow-300 hover:to-yellow-200 hover:ring-yellow-400 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-yellow-500 disabled:opacity-60 disabled:cursor-not-allowed animate-fadein-btn",children:h?c.jsxs(c.Fragment,{children:[c.jsx(loe,{className:"inline-block mr-2 animate-spin"}),"Generating..."]}):"Generate AI Post"}),c.jsx("button",{type:"button",disabled:h,onClick:()=>window.open(i,"_blank"),className:"flex-1 flex items-center justify-center min-w-[7rem] font-semibold text-white bg-gradient-to-r from-indigo-500 to-blue-600 shadow-md ring-1 ring-inset ring-indigo-300 py-2.5 px-5 rounded-xl hover:from-indigo-600 hover:to-blue-700 hover:ring-indigo-400 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 disabled:opacity-60 disabled:cursor-not-allowed animate-fadein-btn",children:"Visit Group"})]})})]})}),document.body)},u0t=({onClose:n,onSend:e})=>{const[t,r]=G.useState(""),i=G.useRef(null),[s,a]=G.useState(!1),o=p=>{r(p.target.value)},l=p=>{i.current&&!i.current.contains(p.target)&&n()},[u,d]=G.useState(0);G.useEffect(()=>(document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}),[]);const h=async()=>{a(!0);const p=`${u}`;
5846try{e(p,t)}catch(g){window.alert("Error: "+(g.message||"Something went wrong"))}a(!1)},f=p=>{p>u?d(p):d(0)};return Vl.createPortal(c.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 flex justify-center items-center",children:c.jsxs("div",{className:"bg-white dark:bg-gray-300 p-4 rounded shadow-lg lg:w-1/2 md:w-2/3 sm:w-3/4",children:[c.jsx("div",{className:"flex justify-end",children:c.jsx("button",{className:"mx-2 h-6 w-6 bg-gray-600 font-bold text-white rounded hover:bg-gray-700",onClick:n,children:"x"})}),c.jsx("h2",{className:"text-lg font-medium mb-4",children:"Feedback"}),c.jsx("p",{className:"text-sm",children:"Would you like to leave a feedback about Spread-Out AI? Help us improving this awesome tool."}),c.jsx("br",{}),c.jsx("div",{children:c.jsx("div",{className:"rating-container",children:Array.from({length:5},(p,g)=>g+1).map(p=>c.jsx("span",{onClick:()=>f(p),className:`star ${u>=p?"active":""}`,children:"â "},p))})}),c.jsx("br",{}),c.jsxs("div",{className:"mt-4",children:[c.jsx("label",{htmlFor:"comment",className:"block text-sm font-medium mb-1",children:"Comment"}),c.jsx("textarea",{id:"comment",rows:5,value:t,onChange:o,className:"w-full rounded border-gray-300 px-4 py-2 text-gray-700 focus:outline outline-offset-2 outline-indigo-600"})]}),c.jsx("div",{className:"mt-4 flex justify-end",children:c.jsx("button",{type:"button",disabled:s||!u,onClick:h,className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded",children:s?"Loading...":"Submit Feedback"})})]})}),document.body)};function d0t(n){return It({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"title",attr:{},child:[]},{tag:"path",attr:{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"}}]})(n)}function h0t(n){return It({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"title",attr:{},child:[]},{tag:"path",attr:{d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"}}]})(n)}const f0t=({isOpen:n,onClose:e,searchQuery:t,searchResultsRef:r})=>{const[i,s]=G.useState(null),[a,o]=G.useState("initial"),[l,u]=G.useState(!1),[d,h]=G.useState(!1),f=cl(TSe);let p="";if(r&&r.current){const b=r.current.querySelectorAll("[data-group-result]");p=b.length?`${b.length}`:""}const g="https://spreadout.ai/assets/logo-CCollTJG.png",A=p&&t?`ð Spread Out AI was very useful today, finding (${p}) groups for me and helping me share ${t}. Try it now at https://spreadout.ai #SpreadOutAI #AI #SocialMediaTools`:t?`ð Spread Out AI helped me discover new opportunities for: "${t}". Try it now at https://spreadout.ai #SpreadOutAI #AI #SocialMediaTools`:"ð Discover how to boost your reach with Spread Out AI! Unleash the power of AI-driven social media strategies and go viral. Try it now at https://spreadout.ai #SpreadOutAI #AI #SocialMediaTools",x=async b=>{s(b),o("sharing");try{let _="";if(b==="facebook")_=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent("https://spreadout.ai")}"e=${encodeURIComponent(A)}`;else if(b==="linkedin")_=`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent("https://spreadout.ai")}&title=${encodeURIComponent(A)}`;else if(b==="x")_=`https://x.com/intent/tweet?text=${encodeURIComponent(A)}`;else if(b==="instagram"){const M=`instagram://share?text=${encodeURIComponent(A)}`,T=navigator.userAgent||navigator.vendor;if(/android|iphone|ipad|ipod/i.test(T))window.open(M,"_blank");else try{await navigator.clipboard.writeText(A),u(!0),alert("Instagram does not support direct sharing from desktop browsers. The message has been copied to your clipboard. Open Instagram and paste it as your post or story caption!")}catch{u(!0),alert(`Instagram does not support direct sharing from desktop browsers. Please copy and paste the following text manually: 5847`+A)}}else if(b==="tiktok"){const M=navigator.userAgent||navigator.vendor;if(/android|iphone|ipad|ipod/i.test(M))window.open("snssdk1128://","_blank");else try{await navigator.clipboard.writeText(A),h(!0),alert("TikTok does not support direct sharing from desktop browsers. The message has been copied to your clipboard. Open TikTok and paste it as your video description!")}catch{h(!0),alert(`TikTok does not support direct sharing from desktop browsers. Please copy and paste the following text manually: 5848`+A)}}_&&window.open(_,"_blank","noopener,noreferrer"),await f({socialPlatform:b}),o("success")}catch{o("error"),alert("Failed to share. Please try again.")}};return c.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:c.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-lg w-full overflow-hidden",children:[c.jsxs("div",{className:"flex justify-between items-center p-4 border-b border-gray-200 dark:border-gray-700",children:[c.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:"Share Your Results"}),c.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 dark:hover:text-gray-300",children:c.jsx(iw,{})})]}),c.jsx("div",{className:"p-6",children:a==="success"?c.jsxs("div",{className:"text-center py-8",children:[c.jsx("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100 dark:bg-green-900",children:c.jsx("svg",{className:"h-6 w-6 text-green-600 dark:text-green-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),c.jsx("h3",{className:"mt-4 text-lg font-medium text-gray-900 dark:text-white",children:"Thanks for sharing!"}),c.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"You can now close this popup to continue searching."}),c.jsx("div",{className:"mt-6",children:c.jsx("button",{onClick:e,className:"inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm",children:"Continue"})})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 mb-6",children:[c.jsx("img",{src:g,alt:"Spread Out AI Logo",className:"w-24 h-24 rounded-lg shadow-md"}),c.jsx("div",{className:"text-xl font-bold text-gray-900 dark:text-white text-center",children:"Spread Out AI"}),c.jsxs("div",{className:"text-base text-gray-600 dark:text-gray-300 text-center max-w-md",children:["Share your search results with your friends ð",c.jsx("br",{})]})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-4",children:[c.jsxs("button",{onClick:()=>x("facebook"),disabled:a==="sharing",className:`flex flex-col items-center justify-center p-4 rounded-lg border ${i==="facebook"?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:[c.jsx(y1,{className:"h-8 w-8 text-blue-600 mb-2"}),c.jsx("span",{className:"text-sm font-medium",children:"Facebook"})]}),c.jsxs("button",{onClick:()=>x("linkedin"),disabled:a==="sharing",className:`flex flex-col items-center justify-center p-4 rounded-lg border ${i==="linkedin"?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:[c.jsx(Ay,{className:"h-8 w-8 text-blue-600 mb-2"}),c.jsx("span",{className:"text-sm font-medium",children:"LinkedIn"})]}),c.jsxs("button",{onClick:()=>x("x"),disabled:a==="sharing",className:`flex flex-col items-center justify-center p-4 rounded-lg border ${i==="x"?"border-gray-900 bg-gray-100 dark:bg-gray-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:[c.jsx(h0t,{className:"h-8 w-8 text-black dark:text-white mb-2"}),c.jsx("span",{className:"text-sm font-medium",children:"X.com"})]}),c.jsxs("button",{onClick:()=>x("instagram"),disabled:a==="sharing",className:`flex flex-col items-center justify-center p-4 rounded-lg border ${i==="instagram"?"border-pink-500 bg-pink-50 dark:bg-pink-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:[c.jsx(x_,{className:"h-8 w-8 text-pink-500 mb-2"}),c.jsx("span",{className:"text-sm font-medium",children:"Instagram"})]}),c.jsxs("button",{onClick:()=>x("tiktok"),disabled:a==="sharing",className:`flex flex-col items-center justify-center p-4 rounded-lg border ${i==="tiktok"?"border-black bg-gray-100 dark:bg-gray-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:[c.jsx(d0t,{className:"h-8 w-8 text-black dark:text-white mb-2"}),c.jsx("span",{className:"text-sm font-medium",children:"TikTok"})]})]}),a==="sharing"&&c.jsxs("div",{className:"text-center py-2",children:[c.jsx("div",{className:"animate-spin inline-block h-6 w-6 border-t-2 border-indigo-500 rounded-full"}),c.jsxs("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:["Sharing to ",i,"..."]})]}),l&&c.jsxs("div",{className:"text-center py-2",children:[c.jsx("button",{onClick:()=>window.open("https://instagram.com/","_blank","noopener,noreferrer"),className:"mt-2 px-4 py-2 bg-pink-500 text-white rounded hover:bg-pink-600",children:"Open Instagram.com"}),c.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"The message is copied to your clipboard. Paste it as your post or story caption!"})]}),d&&c.jsxs("div",{className:"text-center py-2",children:[c.jsx("button",{onClick:()=>window.open("https://www.tiktok.com/upload","_blank","noopener,noreferrer"),className:"mt-2 px-4 py-2 bg-black text-white rounded hover:bg-gray-800",children:"Open TikTok.com"}),c.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"The message is copied to your clipboard. Paste it as your video description!"})]}),a==="error"&&c.jsx("div",{className:"text-center py-2 text-red-500 dark:text-red-400",children:c.jsxs("p",{className:"text-sm",children:["There was an error sharing to ",i,". Please try again."]})}),c.jsx("div",{className:"text-center mt-4",children:c.jsx("button",{onClick:e,className:"text-sm text-gray-500 dark:text-gray-400 hover:underline",children:"Not now"})})]})})]})})},p0t={"internet forums":"internet-forums","internet-forums":"internet-forums",internet:"internet-forums",forums:"internet-forums",forum:"internet-forums","x.com":"twitter",x:"twitter",twitter:"twitter",facebook:"facebook",linkedin:"linkedin",telegram:"telegram",discord:"discord",whatsapp:"whatsapp",youtube:"youtube"};function oie(n){const e=String(n||"").trim().toLowerCase();return p0t[e]||e.replace(/\s+/g,"-")}function m0t(){const{data:n,isLoading:e,refetch:t,isRefetching:r}=Ma(),i=hi(),[s,a]=G.useState(!1),[o,l]=G.useState(!1),[u,d]=G.useState(""),h=G.useRef(null);return G.useLayoutEffect(()=>{!e&&(n!=null&&n.closed)&&!s&&!r&&(window.confirm(i("Your account has been closed. Would you like to re-open it?"))?xae({closed:!1}
5848).then(()=>{a(!0),alert(i("Account re-opened successfully.")),t()}):fM())},[n,e,s,r]),c.jsxs(pl,{children:[n!=null&&n.closed?c.jsx("div",{className:"flex items-center justify-center h-screen",children:c.jsx(Hf,{})}):c.jsxs(j1,{children:[c.jsx(D_,{tag:i("AI"),eyebrow:i("Community discovery"),title:i("Find where your audience"),accent:i("already hangs out."),subtitle:i("Describe what you want to promote. AI finds the groups and communities that fit, and tailors your message to each one.")}),c.jsx("div",{className:"ws-stagger mt-8 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[i("Choose the platforms"),i("Paste your content"),i("AI finds matching groups"),i("Adapt and share your post")].map((f,p)=>c.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-white/[0.08] bg-white/[0.03] px-4 py-3.5",children:[c.jsx("span",{className:"ws-mono grid h-8 w-8 shrink-0 place-items-center rounded-full bg-[rgba(207,255,5,.12)] text-xs font-bold text-[var(--lp-lime)] ring-1 ring-[rgba(207,255,5,.3)]",children:p+1}),c.jsx("span",{className:"text-sm font-semibold text-white/85",children:f})]},f))}),c.jsx("div",{className:"mt-8",children:c.jsx(g0t,{handleCreateTask:a4e,handleCreateSubtask:l4e,handleFeedbackSend:s4e,setIsSharePopupOpen:l,setCurrentSearchQuery:d})})]}),c.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50",children:(!(n!=null&&n.subscriptionPlan)||n.subscriptionPlan===$v.FREE)&&c.jsx(Dq,{})}),o&&c.jsx(f0t,{isOpen:o,onClose:()=>l(!1),searchQuery:u,searchResultsRef:h})]})}function g0t({handleCreateTask:n,handleCreateSubtask:e,handleFeedbackSend:t,setIsSharePopupOpen:r,setCurrentSearchQuery:i}){const s=hi(),[a,o]=G.useState([]),[l,u]=G.useState(!1),[d,h]=G.useState(""),[f,p]=G.useState(!1),[g,A]=G.useState(null),[x,b]=G.useState(!1),[_,M]=G.useState(!1),{data:T,isLoading:L,refetch:D,isRefetching:P}=Ma(),O=ro(),[F,U]=G.useState(""),[B,z]=G.useState([]);G.useRef(null);const{data:H}=Qr(Mae),{googleSearch:X}=Dft(),W=async()=>{const Ye=await localStorage.getItem("logoutUserInput");Ye&&U(Ye)},[J,ee]=G.useState([]),ae=Ye=>{ee(Ye),o(Ye)};G.useEffect(()=>{(async()=>{var ft;if(l&&d){p(!0);try{const At=((ft=d.split(",").pop())==null?void 0:ft.trim())||d,Ce=await USe({country:At}),Se=(T==null?void 0:T.subscriptionPlan)!==null&&(T==null?void 0:T.subscriptionPlan)!==$v.FREE,qe=[{value:"facebook",label:s("Facebook Groups"),color:"#1877F2",enabled:!0},{value:"linkedin",label:s("LinkedIn Groups"),color:"#0077B6",enabled:!0},{value:"internet-forums",label:s("Internet Forums"),color:"#7f7f7f",enabled:!0},{value:"discord",label:s("Discord Channels"),color:"#5865F2",enabled:Se},{value:"telegram",label:s("Telegram Groups"),color:"#0088cc",enabled:Se},{value:"twitter",label:s("Twitter Accounts"),color:"#0019A8",enabled:Se},{value:"whatsapp",label:s("Whatsapp Groups"),color:"#25D366",enabled:Se}],pt=Ce.map(Te=>qe.find(oe=>oe.value===Te.value)||null).filter(Boolean);ee(pt),o(pt)}catch{}finally{p(!1)}}})()},[l,d,T]),_||(W(),M(!0));const le=async()=>{try{if(a.length===0)alert(s("Please choose at least one social media source"));else{const Ye=F,ft="",At=JSON.stringify(a),Se=await n({description:Ye,socialMedias:At,searchKeywords:ft,location:d});A(Se);const qe=document.getElementById("gallery-container");qe&&qe.scrollIntoView({behavior:"smooth"}),U(""),await we(Se),O("/history")}}catch(Ye){window.alert(s("Error: ")+(Ye.message||s("Something went wrong")))}},[Z,Y]=G.useState(0),[re,_e]=G.useState(1),{data:Ee,isLoading:Ae}=Qr(Eae,{skip:Z});G.useEffect(()=>{Y((re-1)*2),(()=>{var qe,pt;const ft=window.location.hash,At=new URLSearchParams(ft.slice(1)),Ce=At.get("access_token"),Se=At.get("error");Ce?(qe=window.opener)==null||qe.postMessage({accessToken:Ce},window.location.origin):Se&&((pt=window.opener)==null||pt.postMessage({error:Se},window.location.origin))})(),(async()=>{const ft=(Ee==null?void 0:Ee.tasks)||[],At=H||[];let Ce=ft.map(Se=>{const qe=Se,pt={task:qe,subtasks:[]};return At.forEach(Te=>{Te.taskId===qe.id&&pt.subtasks.push(Te)}),pt});z(Ce)})()},[Ee,H,re]);const te=async(Ye,ft)=>{try{return await jSe({description:Ye,keywords:ft,location:d})}catch{return window.alert(s("The server is not available now. Please try again later.")),b(!1),null}},ve=async(Ye,ft)=>{try{return await ISe({description:Ye,keywords:ft,location:d})}catch{return window.alert(s("The server is not available now. Please try again later.")),b(!1),null}},we=async Ye=>{var At,Ce;let ft=!1;if((T==null?void 0:T.credits)!==void 0&&T.credits!==null&&T.credits<=0){window.alert(s("Your account ran out of credits")),ft||(await xS({id:Ye.id}),ft=!0);return}else if((T==null?void 0:T.subscriptionStatus)==="past_due"){window.alert(s("Your Account is Past Due! Please Update your Payment Information"));return}else if(!((T==null?void 0:T.credits)!==void 0&&(T==null?void 0:T.credits)>0&&(!(T!=null&&T.subscriptionStatus)||(T==null?void 0:T.subscriptionStatus)==="active"))){window.alert(s("Issue with account status or credits."));return}b(!0);try{const Se=await te(Ye.description,"2");if(!Se){b(!1);return}const qe=Se;let pt=null;const Te=Array.isArray(J)&&J.length===1&&((At=J[0])==null?void 0:At.value)==="linkedin";Te||(pt=await ve(Ye.description,"2"));const oe=pt,ge=qe+(oe?", "+oe:"");let Ne=null,ke=null,Xe=null,et=null,Qe=null,lt=null,tt=null,Ft=null,Mt=null,Nt=null,Je=null,fn=null,Tn=null,nt=null,Kt=null,Lt=null,cn=d.toLowerCase().split(",")[0]||"";const dn=JSON.parse(Ye.socialMedias||"[]");if(dn.some(m=>m.value==="internet-forums")){Ne=await X(`${qe} ${cn} forum`,"b52afa94bd5454a53",d);const m=oe?await X(`${oe} ${cn} forum`,"b52afa94bd5454a53",d):null;ke=[...Ne||[],...m||[]]}if(dn.some(m=>m.value==="facebook")){Xe=await X(`${qe} ${cn} "members"`,"e53f076afae7d474a",d);const m=oe?await X(`${oe} ${cn} "members"`,"e53f076afae7d474a",d):null;et=[...Xe||[],...m||[]]}if(dn.some(m=>m.value==="linkedin")&&(Qe=await xne(`site:www.linkedin.com/groups/ ${qe} ${cn}`),lt=Qe?[...Qe]:[]),dn.some(m=>m.value==="telegram")){tt=await X(`${qe} ${cn}`,"c3544d9134f7240a0",d);const m=oe?await X(`${oe} ${cn}`,"c3544d9134f7240a0",d):null;Ft=[...tt||[],...m||[]]}if(dn.some(m=>m.value==="twitter")){Mt=await X(`${qe} ${cn}`,"e1e95562921fe4519",d);const m=oe?await X(`${oe} ${cn}`,"e1e95562921fe4519",d):null;Nt=[...Mt||[],...m||[]]}if(dn.some(m=>m.value==="discord")){Je=await X(`${qe} ${cn}`,"e757a61e3e4b145f4",d);const m=oe?await X(`${oe} ${cn}`,"e757a61e3e4b145f4",d):null;fn=[...Je||[],...m||[]]}if(dn.some(m=>m.value==="whatsapp")){Kt=await X(`${qe} ${cn}`,"9277207f1a2574b20",d);const m=oe?await X(`${oe} ${cn}`,"9277207f1a2574b20",d):null;Lt=[...Kt||[],...m||[]]}const Bt=(ke||[]).map(m=>({id:m.id,title:m.title,snippet:m.snippet})),Ht=(et||[]).map(m=>({id:m.id,title:m.title,snippet:m.snippet})),qt=(lt||[]).map(m=>({id:m.id,title:m.title,snippet:m.snippet,link:m.link,thumbnail:m.thumbnail})),Fn=(Ft||[]).map(m=>({id:m.id,title:m.title,snippet:m.snippet})),xe=(Nt||[]).map(m=>({id:m.id,title:m.title,snippet:m.snippet})),Oe=(fn||[]).map(m=>({id:m.id,title:m.title,snippet:m.snippet})),Ge=(Lt||[]).map(m=>({id:m.id,title:m.title,snippet:m.snippet})),$e=(Tn||[]).map(m=>({id:m.id,title:m.title,snippet:m.snippet}));if(Te)(lt||[]).map(async m=>{const be={title:m.title||"LinkedIn Group",image:m.thumbnail||"/linkedin-placeholder.png",taskId:Ye.id,url:m.link,description:m.snippet,socialMedias:"linkedin",members:"1000",engagement:"90",createdAt:new Date,posted:!1};be.url&&be.url!=="#"&&await e(be)}),await ze({id:Ye.id,description:Ye.description,socialMedias:Ye.socialMedias,searchKeywords:ge}),i(Ye.description),r(!0);
5848else{const m=await RX({task:Ye,location:d,internetResults:JSON.stringify(Bt),linkedinResults:JSON.stringify(qt),facebookResults:JSON.stringify(Ht),telegramResults:JSON.stringify(Fn),twitterResults:JSON.stringify(xe),discordResults:JSON.stringify(Oe),whatsappResults:JSON.stringify(Ge),youtubeResults:JSON.stringify($e)});let be=!1;if(m&&m.subtasks&&m.subtasks.length>0){const en=m.subtasks;await ze({id:Ye.id,description:Ye.description,socialMedias:Ye.socialMedias,searchKeywords:ge});for(const on of en){const tn=oie(on.platform);if(Array.isArray(on.communities))for(const Qt of on.communities){const{id:Pt,members:bn,engagement:wn}=Qt;let zn=null,Un=tn||"";if(tn==="facebook"?zn=(et||[]).find(_n=>_n.id===Pt)||null:tn==="linkedin"?zn=(lt||[]).find(_n=>_n.id===Pt)||null:tn==="telegram"?zn=(Ft||[]).find(_n=>_n.id===Pt)||null:tn==="twitter"?zn=(Nt||[]).find(_n=>_n.id===Pt)||null:tn==="discord"?zn=(fn||[]).find(_n=>_n.id===Pt)||null:tn==="whatsapp"?zn=(Lt||[]).find(_n=>_n.id===Pt)||null:tn==="youtube"?zn=(nt||[]).find(_n=>_n.id===Pt)||null:tn==="internet-forums"&&(zn=(ke||[]).find(_n=>_n.id===Pt&&_n.link&&!_n.link.includes("facebook.com"))||null),zn){be=!0,Un=tn||Un;let _n=zn.link;_n&&(_n.includes("disboard")&&(_n=_n.replace("server/","server/join/")),_n.includes("gruposwhats.app")&&(_n=_n.replace("group/","join-group/")));const xr={title:zn.title||`${Un} Group/Community`,image:zn.thumbnail||(Un==="linkedin"?"/linkedin-placeholder.png":"/image-placeholder.jpg"),taskId:Ye.id,url:_n,description:zn.snippet,socialMedias:Un,members:String(bn||"1000"),engagement:Un==="linkedin"?(Math.floor(Math.random()*21)+75).toString():String(wn||"0"),createdAt:new Date,posted:!1};xr.url&&xr.url!=="#"&&await e(xr)}}}}if(be)i(Ye.description),r(!0);else{console.log("No results found. Retrying with broader keywords...");const en=await te(Ye.description,"1");if(en){let on=[],tn=[],Qt=[],Pt=[],bn=[],wn=[],zn=[];const Un=JSON.parse(Ye.socialMedias||"[]"),_n=en;Un.some(He=>He.value==="internet-forums")&&(on=await X(`${_n} forum`,"b52afa94bd5454a53",d)||[]),Un.some(He=>He.value==="facebook")&&(tn=await X(`${_n} "members"`,"e53f076afae7d474a",d)||[]),Un.some(He=>He.value==="linkedin")&&(Qt=await xne(`site:www.linkedin.com/groups/ ${_n}`)||[]),Un.some(He=>He.value==="telegram")&&(Pt=await X(`${_n}`,"c3544d9134f7240a0",d)||[]),Un.some(He=>He.value==="twitter")&&(bn=await X(`${_n}`,"e1e95562921fe4519",d)||[]),Un.some(He=>He.value==="discord")&&(wn=await X(`${_n}`,"e757a61e3e4b145f4",d)||[]),Un.some(He=>He.value==="whatsapp")&&(zn=await X(`${_n}`,"9277207f1a2574b20",d)||[]);const xr=on.map(He=>({id:He.id,title:He.title,snippet:He.snippet})),Ir=tn.map(He=>({id:He.id,title:He.title,snippet:He.snippet})),is=Qt.map(He=>({id:He.id,title:He.title,snippet:He.snippet,link:He.link,thumbnail:He.thumbnail})),si=Pt.map(He=>({id:He.id,title:He.title,snippet:He.snippet})),vr=bn.map(He=>({id:He.id,title:He.title,snippet:He.snippet})),Yi=wn.map(He=>({id:He.id,title:He.title,snippet:He.snippet})),Vi=zn.map(He=>({id:He.id,title:He.title,snippet:He.snippet})),Pe=await RX({task:Ye,location:d,internetResults:JSON.stringify(xr),linkedinResults:JSON.stringify(is),facebookResults:JSON.stringify(Ir),telegramResults:JSON.stringify(si),twitterResults:JSON.stringify(vr),discordResults:JSON.stringify(Yi),whatsappResults:JSON.stringify(Vi),youtubeResults:"[]"});if(Pe&&Pe.subtasks&&Pe.subtasks.length>0)for(const He of Pe.subtasks){const ce=oie(He.platform);if(Array.isArray(He.communities))for(const at of He.communities){const{id:vt,members:vn,engagement:Rn}=at;let ln=null;if(ce==="facebook"?ln=tn.find(kn=>kn.id===vt)||null:ce==="linkedin"?ln=Qt.find(kn=>kn.id===vt)||null:ce==="telegram"?ln=Pt.find(kn=>kn.id===vt)||null:ce==="twitter"?ln=bn.find(kn=>kn.id===vt)||null:ce==="discord"?ln=wn.find(kn=>kn.id===vt)||null:ce==="whatsapp"?ln=zn.find(kn=>kn.id===vt)||null:ce==="internet-forums"&&(ln=on.find(kn=>kn.id===vt&&kn.link&&!kn.link.includes("facebook.com"))||null),ln){be=!0;const kn={title:ln.title||`${ce} Group/Community`,image:ln.thumbnail||(ce==="linkedin"?"/linkedin-placeholder.png":"/image-placeholder.jpg"),taskId:Ye.id,url:ln.link,description:ln.snippet,socialMedias:ce,members:vn||"1000",engagement:ce==="linkedin"?(Math.floor(Math.random()*21)+75).toString():Rn,createdAt:new Date,posted:!1};kn.url&&kn.url!=="#"&&await e(kn)}}}}be?(i(Ye.description),r(!0)):(alert(s("No results were found even with broader search. Please try again by changing the description or location.")),ft||(await xS({id:Ye.id}),ft=!0))}}}catch(Se){const qe=Array.isArray(J)&&J.length===1&&((Ce=J[0])==null?void 0:Ce.value)==="linkedin";let pt=!0;J.map(Te=>{Te.value!=="Linkedin"&&(pt=!1)}),qe?(window.alert(s("The server is not available now. Please try again later.")),console.error("Error in handleGeneratePlan:",Se),ft||(await xS({id:Ye.id}),ft=!0)):pt&&(window.alert(s("The server is not available now. Please try again later.")),console.error("Error in handleGeneratePlan:",Se),ft||(await xS({id:Ye.id}),ft=!0))}finally{b(!1)}},Ue=G.useRef(null);G.useEffect(()=>{g&&Ue.current&&Ue.current.scrollIntoView({behavior:"smooth"})},[g]);const ze=async Ye=>{await o4e(Ye)},[yt,mt]=G.useState(!1),[bt,dt]=G.useState(!1),St=()=>{mt(!1)},kt=(Ye,ft)=>{const At={stars:String(Ye),comment:ft};try{t(At),alert(s("Feedback submitted successfully!")),mt(!1)}catch(Ce){window.alert(s("Error: ")+(Ce.message||s("Something went wrong")))}};(T==null?void 0:T.subscriptionPlan)!==null&&(T==null||T.subscriptionPlan,$v.FREE);const Fe=G.useRef(null);G.useEffect(()=>{x&&Fe.current&&Fe.current.scrollIntoView({behavior:"smooth",block:"start"})},[x]);const Ze=Ye=>{h(Ye)};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"ws-glass ws-enter rounded-[28px] p-6 sm:p-8",style:{position:"relative",zIndex:bt?50:10},children:[c.jsxs("h3",{className:"ws-display mb-1.5 flex items-center text-xl font-bold text-white",children:[c.jsx("svg",{className:"w-6 h-6 mr-2 text-emerald-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M7 4V2a1 1 0 011-1h8a1 1 0 011 1v2m0 0V1h2a2 2 0 012 2v18a2 2 0 01-2 2H4a2 2 0 01-2-2V3a2 2 0 012-2h2v3m0 0h8M5 21V7a1 1 0 011-1h12a1 1 0 011 1v14M9 7v10m6-10v10"})}),s("Social Media Platforms")]}),c.jsx("p",{className:"ws-muted mb-5 text-sm",children:s("Select platforms where you want to spread your content")}),c.jsx(Lft,{childToParent:ae,isDisabled:l,value:a,onMenuOpen:()=>dt(!0),onMenuClose:()=>dt(!1)})]}),c.jsxs("div",{className:"ws-glass ws-enter rounded-[28px] p-6 sm:p-8",style:{position:"relative",zIndex:0,animationDelay:".06s"},children:[c.jsxs("h3",{className:"ws-display mb-1.5 flex items-center text-xl font-bold text-white",children:[c.jsxs("svg",{className:"w-6 h-6 mr-2 text-violet-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("Location & Recommendations")]}),c.jsx("p",{className:"ws-muted mb-5 text-sm",children:s("Target specific regions and get AI recommendations")}),c.jsxs("div",{className:"space-y-4",children:[c.jsx(Gft,{onLocationChange:Ze}),c.jsx(Oft,{checked:l,onChange:u,disabled:!d,loading:f}),(!(T!=null&&T.subscriptionPlan)||(T==null?void 0:T.subscriptionPlan)===$v.FREE)&&c.jsx("div",{className:"mt-3 rounded-2xl border border-amber-400/25 bg-amber-400/[0.06] p-4",children:c.jsxs("div",{className:"flex items-start",children:[c.jsx("svg",{className:"h-5 w-5 mr-3 text-amber-500 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:c.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:s("Upgrade for Full Access")}),c.jsxs("p",{className:"text-sm text-amber-700 dark:text-amber-300 mt-1",children:[s("Upgrade to")," ",c.jsx("a",{href:"/pricing",className:"font-medium text-emerald-600 dark:text-emerald-400 hover:underline",children:s("Premium or Pro")})," ",s("for access to all platforms and unlimited searches.")]})]})]})})]})]}),c.jsxs("div",{ref:Fe,className:"ws-glass ws-enter rounded-[28px] p-6 sm:p-8",style:{animationDelay:".12s"},children:[c.jsxs("h3",{className:"ws-display mb-1.5 flex items-center text-xl font-bold text-white",children:[c.jsx("svg",{className:"w-6 h-6 mr-2 text-cyan-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),s("Content Description")]}),c.jsx("p",{className:"ws-muted mb-5 text-sm",children:s("Paste your content to be analyzed by AI")}),c.jsx("textarea",{className:"w-full resize-none rounded-[22px] border border-white/10 bg-black/40 px-6 py-4 text-lg text-white placeholder-white/30 outline-none transition-colors focus:border-[rgba(207,255,5,.6)] focus:ring-0",style:{height:200,minHeight:180},name:"prompt",id:"prompt",rows:6,placeholder:s("Paste here the description of your event | post | product | business..."),value:F,onChange:Ye=>U(Ye.currentTarget.value),required:!0}),c.jsx("div",{className:"mt-6",children:Ae||x?c.jsx("div",{className:"rounded-full border border-[rgba(207,255,5,.3)] bg-[rgba(207,255,5,.06)] px-6 py-4",children:c.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[c.jsx(loe,{className:"animate-spin text-emerald-600 dark:text-emerald-400 text-xl"}),c.jsx("span",{className:"text-emerald-700 dark:text-emerald-300 font-medium",children:s("AI is analyzing your content...")})]})}):c.jsxs("button",{type:"button",disabled:x,onClick:le,className:"ws-btn ws-btn-primary w-full !h-14 text-base",children:[c.jsx("span",{className:"ws-shine"}),c.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s("Start AI Search")]})})]}),c.jsx("div",{id:"results",className:"results animate-fade-in-up"}),yt&&c.jsx(u0t,{onClose:St,onSend:(Ye,ft)=>kt(Number(Ye),ft)})]})}const dS=()=>c.jsxs("div",{className:"subtask-card-container is-loading",children:[c.jsx("h2",{className:"subtask-title"}),c.jsx("table",{className:"subtask-table",children:c.jsxs("tbody",{children:[c.jsx("tr",{children:c.jsx("td",{className:"subtask-label text-gray-500 dark:text-white"})}),c.jsx("tr",{children:c.jsx("td",{className:"subtask-label"})}),c.jsx("tr",{children:c.jsx("td",{className:"subtask-label"})}),c.jsx("tr",{children:c.jsx("td",{className:"subtask-label"})}),c.jsx("tr",{children:c.jsx("td",{className:"subtask-label"})}),c.jsx("tr",{children:c.jsx("td",{className:"subtask-label"})})]})})]}),A0t=()=>{const[n,e]=G.useState([]),[t,r]=G.useState(1),[i,s]=G.useState(0),{data:a,isLoading:o}=Qr(Eae,{skip:i}),{data:l}=Qr(Mae),u=G.useRef(null),[d,h]=G.useState(null);return G.useEffect(()=>{s((t-1)*10)},[t]),G.useEffect(()=>{if(a&&l){const f=(a==null?void 0:a.tasks)||[],p=l||[];let g=f.map(A=>{const x=A,b={task:x,subtasks:[]};return p.forEach(_=>{_.taskId===x.id&&b.subtasks.push(_)}),b});e(g)}},[a,l]),c.jsx(pl,{children:c.jsxs("div",{className:"p-4",children:[c.jsx("div",{className:"flex justify-center items-center mb-6",children:c.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"Search History"})}),o&&c.jsx("div",{className:"flex justify-center items-center h-64",children:c.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-blue-500"})}),c.jsx("div",{id:"results",className:"results animate-fade-in-up mt-10",children:n&&n.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"space-y-8",children:n.map((f,p)=>c.jsxs("div",{className:"animate-fade-in",style:{animationDelay:`${p*150}ms`},ref:f.task.id===(d==null?void 0:d.id)?u:null,children:[c.jsxs("div",{className:"border-b border-gray-100 dark:border-gray-700",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"flex items-center space-x-3",children:c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 transition-colors duration-300",children:new Date(f.task.createdAt).toLocaleStr
5848ing()})}),c.jsx("button",{onClick:()=>{confirm("Are you sure you want to delete this search?")&&(f4e({taskId:f.task.id}),xS({id:f.task.id}))},className:"p-1.5 rounded-md bg-red-50 text-red-500 dark:bg-red-900/20 dark:text-red-400 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors duration-300",children:c.jsx(Ev,{})})]}),c.jsx(x0t,{id:f.task.id,isDone:f.task.isDone,description:f.task.description,socialMedias:f.task.socialMedias,location:f.task.location},f.task.id)]}),o&&f.task.id===(d==null?void 0:d.id)?c.jsxs("div",{id:"gallery-container",className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:[c.jsx(dS,{}),c.jsx(dS,{}),c.jsx(dS,{}),c.jsx(dS,{}),c.jsx(dS,{})]}):c.jsx(v0t,{task:f.task,subtasks:f.subtasks},"result"+f.task.id)]},f.task.id))}),c.jsxs("div",{className:"flex justify-center items-center mb-6",children:[c.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white transition-colors duration-300"}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("button",{onClick:()=>r(Math.max(1,t-1)),disabled:t<=1,className:"p-2 rounded-md bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 disabled:opacity-50 transition-colors duration-300",children:"<"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("span",{className:"text-md mr-2 text-gray-700 dark:text-gray-300 transition-colors duration-300",children:"Page"}),c.jsx("input",{type:"number",value:t,min:1,max:(a==null?void 0:a.totalPages)||1,onChange:f=>{r(parseInt(f.currentTarget.value))},className:"w-12 rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-2 py-1 text-center font-medium outline-none transition focus:border-green-500 focus:ring-2 focus:ring-green-200 dark:focus:ring-green-900 transition-colors duration-300"}),c.jsxs("span",{className:"text-md ml-2 text-gray-700 dark:text-gray-300 transition-colors duration-300",children:[" of ",(a==null?void 0:a.totalPages)||1]})]}),c.jsx("button",{onClick:()=>r(Math.min((a==null?void 0:a.totalPages)||1,t+1)),disabled:t>=((a==null?void 0:a.totalPages)||1),className:"p-2 rounded-md bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 disabled:opacity-50 transition-colors duration-300",children:">"})]})]})]})})]})})};function x0t({id:n,isDone:e,description:t,socialMedias:r,location:i}){const[s,a]=G.useState(!1),o=(()=>{try{return JSON.parse(r)}catch{return[]}})();return c.jsxs("div",{className:"glassmorphism-card p-4 rounded-lg w-full",children:[c.jsxs("div",{className:"flex justify-between items-start",children:[c.jsx("h2",{className:"text-lg font-bold text-gray-800 dark:text-white",children:"Ad Prompt"}),c.jsx("button",{onClick:()=>a(!s),className:"text-sm text-blue-500 hover:underline",children:s?"Collapse":"Expand"})]}),c.jsx("div",{className:`mt-2 text-sm text-gray-600 dark:text-gray-300 overflow-hidden transition-all duration-500 ${s?"max-h-full":"max-h-12"}`,style:{whiteSpace:"pre-wrap"},children:t}),c.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[i&&c.jsxs("div",{className:"flex items-center text-sm text-gray-500 dark:text-gray-400",children:[c.jsx("span",{className:"mr-2",children:"ð"}),c.jsx("span",{children:i})]}),c.jsx("div",{className:"flex items-center gap-2",children:o.map((l,u)=>c.jsx("span",{style:{backgroundColor:l.color},className:"text-white px-2 py-1 rounded-full text-xs",children:l.label},u))})]})]})}function v0t({task:n,subtasks:e}){return c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-4 p-4",children:e.map(t=>c.jsx(y0t,{task:n,title:t.title,image:t.image,url:t.url,icon:t.socialMedias,description:t.description,members:t.members,engagement:t.engagement,createdAt:t.createdAt.toString()},t.id))})}function y0t({task:n,title:e,image:t,url:r,icon:i,description:s,members:a,engagement:o,createdAt:l}){const[u,d]=G.useState(!1),{data:h}=Ma(),f=(h==null?void 0:h.subscriptionPlan)!=="free"&&(h==null?void 0:h.subscriptionPlan)!==null,p=()=>d(!0),g=()=>d(!1),A={facebook:c.jsx(y1,{className:"w-6 h-6",color:"#1877F2"}),linkedin:c.jsx(Ay,{className:"w-6 h-6",color:"#0077B6"}),discord:c.jsx(eEe,{className:"w-6 h-6",color:"#5865F2"}),telegram:c.jsx(tEe,{className:"w-6 h-6",color:"#0088cc"}),twitter:c.jsx(MB,{className:"w-6 h-6",color:"#1DA1F2"}),whatsapp:c.jsx(nEe,{className:"w-6 h-6",color:"#25D366"})};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"subtask-card-container glassmorphism-card transform transition-all duration-300 hover:scale-105",children:[c.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"block",children:c.jsx("img",{src:t,alt:e,className:"w-full h-32 object-cover rounded-t-lg",onError:x=>{const b=x.target;b.onerror=null,b.src="/image-placeholder.jpg"}})}),c.jsxs("div",{className:"p-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"text-lg font-bold text-gray-800 dark:text-white truncate",children:c.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:e})}),A[i]]}),c.jsx("div",{className:"mt-2 flex items-center justify-between text-sm text-gray-600 dark:text-gray-400",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:"Match:"}),c.jsx("div",{className:"w-24 bg-gray-200 dark:bg-gray-700 rounded-full h-2.5",children:c.jsx("div",{className:"bg-green-400 h-2.5 rounded-full",style:{width:`${o}%`}})}),c.jsxs("span",{className:"font-semibold",children:[o,"%"]})]})}),c.jsx("div",{className:"mt-4",children:c.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300 h-20 overflow-y-auto",dangerouslySetInnerHTML:{__html:s}})}),c.jsx("div",{className:"mt-4",children:c.jsxs("button",{className:"w-full bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 roun
5848ded-lg transition-colors duration-300",onClick:p,children:["Spread Out ",c.jsx("span",{"aria-hidden":"true",children:"â"})]})})]})]}),u&&c.jsx(c0t,{onClose:g,adDescription:n.description,keywords:n.searchKeywords||"",groupText:s,url:r,tierProEnabled:f})]})}const b0t=()=>c.jsx(pl,{children:c.jsx("div",{className:"p-4",children:c.jsx("div",{className:"flex justify-center items-center mb-6",children:c.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"My Posts"})})})}),w0t=async n=>{if(!n)return"";if(typeof window<"u"&&window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1")return n;try{if((await fetch(n,{method:"HEAD"})).ok)return n}catch{}if(n.includes("https://spread-out-server.fly.dev")){const e=n.replace("https://spread-out-server.fly.dev","http://localhost:3001");try{if((await fetch(e,{method:"HEAD"})).ok)return e}catch{}}return n},_0t=({src:n,alt:e,className:t,slideNumber:r,onError:i})=>{const[s,a]=G.useState(n),[o,l]=G.useState(!0),[u,d]=G.useState(!1);return G.useEffect(()=>{let h=!0;return(async()=>{l(!0),d(!1);try{const p=await w0t(n);h&&a(p)}catch{h&&a(n)}finally{h&&l(!1)}})(),()=>{h=!1}},[n]),o?c.jsx("div",{className:`${t} flex items-center justify-center bg-[#0F121A] min-h-[320px]`,children:c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#CFFF05]"})}):u||!s?c.jsxs("div",{className:`${t} flex flex-col items-center justify-center bg-gradient-to-br from-[#0F121A] to-[#1A1E29] border border-gray-800 p-8 min-h-[340px] text-center`,children:[c.jsx("div",{className:"w-14 h-14 rounded-2xl bg-[#CFFF05]/10 text-[#CFFF05] flex items-center justify-center mb-3",children:c.jsx(RB,{size:24})}),c.jsx("p",{className:"text-sm font-bold text-gray-200 mb-1",children:e||`Slide ${r||1}`}),c.jsx("p",{className:"text-xs text-gray-400 max-w-xs",children:"Slide asset generated for this post"})]}):c.jsx("img",{src:s,alt:e,className:t,onError:()=>{console.warn("Image failed to load in carousel:",s),d(!0),i&&i()}})},lie=({images:n})=>{const[e,t]=G.useState(0),[r,i]=G.useState(new Set),s=(n||[]).filter(d=>typeof d=="string"&&d.trim().length>0),a=s.filter(d=>!r.has(d)),o=a.length>0?a:s;if(G.useEffect(()=>{e>=o.length&&o.length>0&&t(Math.max(0,o.length-1))},[o.length,e]),!n||n.length===0||o.length===0)return null;const l=()=>{const h=e===0?o.length-1:e-1;t(h)},u=()=>{const h=e===o.length-1?0:e+1;t(h)};return c.jsxs("div",{className:"relative w-full bg-[#0B0D13] rounded-2xl overflow-hidden shadow-2xl border border-gray-100/10",children:[c.jsx("div",{className:"overflow-hidden w-full aspect-[4/5] relative",children:c.jsx("div",{className:"flex h-full transition-transform duration-500 ease-in-out",style:{transform:`translateX(-${e*100}%)`},children:o.map((d,h)=>c.jsxs("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center bg-black relative overflow-hidden",children:[c.jsx("div",{className:"absolute inset-0 bg-cover bg-center blur-2xl opacity-25 scale-110",style:{backgroundImage:`url(${d})`}}),c.jsx(_0t,{src:d,alt:`Slide ${h+1}`,slideNumber:h+1,className:"relative z-10 w-full h-full object-contain",onError:()=>{i(f=>{const p=new Set(f);return p.add(d),p})}})]},`${d}-${h}`))})}),o.length>1&&c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:l,className:"absolute top-1/2 left-3 transform -translate-y-1/2 bg-black/75 hover:bg-black text-white p-2.5 rounded-full transition-all shadow-lg hover:scale-110 z-20 backdrop-blur-sm border border-white/10","aria-label":"Previous slide",children:c.jsx(oEe,{size:13})}),c.jsx("button",{onClick:u,className:"absolute top-1/2 right-3 transform -translate-y-1/2 bg-black/75 hover:bg-black text-white p-2.5 rounded-full transition-all shadow-lg hover:scale-110 z-20 backdrop-blur-sm border border-white/10","aria-label":"Next slide",children:c.jsx(uoe,{size:13})}),c.jsx("div",{className:"absolute bottom-3 left-1/2 transform -translate-x-1/2 flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-black/60 backdrop-blur-md border border-white/10 z-20",children:o.map((d,h)=>c.jsx("button",{onClick:()=>t(h),className:`h-1.5 rounded-full transition-all duration-300 ${e===h?"bg-[#CFFF05] w-5":"bg-white/40 hover:bg-white/70 w-1.5"}`,"aria-label":`Go to slide ${h+1}`},h))})]})]})};
5848function HU(n){if(!n||typeof n!="string"||!n.startsWith("http"))return!1;try{const e=new URL(n),t=e.hostname.toLowerCase().replace(/^www\./,""),r=e.pathname;if(r==="/"||r==="")return!1;if(t.includes("instagram.com"))return/\/(p|reel|reels|tv)\/[a-zA-Z0-9_-]+/i.test(r);if(t.includes("tiktok.com"))return/\/(video|photo)\/\d+/i.test(r);if(t.includes("twitter.com")||t.includes("x.com"))return/\/status\/\d+/i.test(r);if(t.includes("youtu.be"))return r.replace(/^\/+/,"").length>=6;if(t.includes("youtube.com")){if(r.includes("/shorts/")){const s=r.split("/shorts/")[1];return!!(s&&s.length>=6)}return e.searchParams.has("v")&&!!e.searchParams.get("v")}return t.includes("facebook.com")?/\/(posts|videos|reel)\/|fbid=/i.test(r+e.search):t.includes("linkedin.com")?/\/(feed\/update|activity|posts)\//i.test(r):t.includes("threads.net")?/\/post\/[a-zA-Z0-9_-]+/i.test(r):t.includes("pinterest.com")?/\/pin\/\d+/i.test(r):!(r.split("/").filter(Boolean).length<=1&&!e.search)}catch{return!1}}function S0t(n,e){if(!n)return null;const t=n.platformPostUrl||n.postUrl||n.liveUrl||n.url||null,r=String(n.platform||"").toLowerCase();if(t&&HU(t))return t;const i=String(n.platformPostId||"");if(r.includes("tiktok")){const s=i.match(/\b\d{15,}\b/);if(s){let a="";if(!a&&t){const l=t.match(/tiktok\.com\/@([^/?#]+)/i);l&&(a=l[1])}return`https://www.tiktok.com/${a?a.startsWith("@")?a:`@${a}`:"@user"}/video/${s[0]}`}}if(r.includes("twitter")||r==="x"||r==="x.com"){const s=i.match(/\b\d{10,}\b/);if(s)return`https://x.com/i/status/${s[0]}`}return r.includes("youtube")&&i&&!i.includes("http")&&i.length>=8&&i.length<=20?`https://www.youtube.com/watch?v=${i}`:r.includes("instagram")&&i&&/^[a-zA-Z0-9_-]{10,13}$/.test(i)?`https://www.instagram.com/p/${i}/`:null}function T0t(n,e){const t=(n||"").toLowerCase();return t.includes("instagram.com")?"instagram":t.includes("tiktok.com")?"tiktok":t.includes("twitter.com")||t.includes("x.com")?"twitter":t.includes("youtube.com")||t.includes("youtu.be")?"youtube":t.includes("facebook.com")?"facebook":t.includes("linkedin.com")?"linkedin":t.includes("pinterest.com")?"pinterest":t.includes("reddit.com")?"reddit":t.includes("threads.net")?"threads":"general"}async function WU(n,e){try{await g4e({name:n,props:e})}catch(t){console.warn(`[Analytics:track] Failed to track "${n}":`,t)}}const E0t=n=>{if(!n)return{};if(typeof n=="object")return n;try{return JSON.parse(n)||{}}catch{return{}}},C0t=({videoUrl:n,index:e,execution:t,post:r,isLongVideo:i,isTextImage:s})=>{var T;const a=i||(r==null?void 0:r.isLongVideo)||!1,[o,l]=G.useState(n),[u,d]=G.useState(!0),[h,f]=G.useState(!1);G.useEffect(()=>{(async()=>{d(!0),f(!1);try{const D=await M0t(n);l(D)}catch{l(n)}finally{d(!1)}})()},[n]);let p;try{p=new URL(n)}catch{return c.jsx("div",{className:"flex items-center justify-center p-4 bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 rounded-lg",children:c.jsxs("p",{className:"text-red-700 dark:text-red-400 text-sm",children:["Invalid video URL: ",n]})},e)}const g=p.searchParams.get("edited")==="true",A=p.searchParams.get("narration")==="true",x=p.searchParams.get("captions")==="true",b=p.searchParams.get("music")==="true",_=p.searchParams.get("audio"),M=p.searchParams.get("videoCount");return u?c.jsx("div",{className:"flex items-center justify-center p-4 bg-gray-100 dark:bg-gray-800 w-full min-h-[300px]",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-emerald-500 mx-auto mb-2"}),c.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"Resolving video URL..."})]})}):h?c.jsxs("div",{className:`w-full flex flex-col items-center justify-center bg-[#12151C] border border-gray-800 p-8 rounded-lg text-center ${a?"aspect-video":"aspect-[9/16]"}`,children:[c.jsx("div",{className:"w-12 h-12 rounded-full bg-blue-500/10 text-blue-400 flex items-center justify-center mb-3",children:c.jsx(PB,{className:"w-6 h-6"})}),c.jsx("h4",{className:"text-sm font-bold text-gray-200 mb-1",children:"Generated Video Post"}),c.jsx("p",{className:"text-xs text-gray-400 max-w-xs mb-3",children:"Video is ready for publishing or can be re-generated."})]}):c.jsxs("div",{className:"relative",children:[g&&c.jsxs("div",{className:"absolute top-2 left-2 z-10 flex flex-wrap gap-1",children:[c.jsx("span",{className:"bg-green-500 text-white px-2 py-1 rounded-full text-xs font-medium",children:"⨠Edited"}),A&&c.jsx("span",{className:"bg-blue-500 text-white px-2 py-1 rounded-full text-xs font-medium",children:"ð¤ Voice"}),x&&c.jsx("span",{className:"bg-purple-500 text-white px-2 py-1 rounded-full text-xs font-medium",children:"ð Captions"}),b&&c.jsx("span",{className:"bg-pink-500 text-white px-2 py-1 rounded-full text-xs font-medium",children:"ðµ Music"}),M&&parseInt(M)>1&&c.jsxs("span",{className:"bg-orange-500 text-white px-2 py-1 rounded-full text-xs font-medium",children:["ð¹ ",M," Videos"]})]}),c.jsxs("video",{controls:!0,className:`w-full h-auto max-h-[80vh] object-contain bg-black rounded-lg ${a?"aspect-video":"aspect-[9/16]"}`,poster:(T=r.imageUrls)!=null&&T[0]?r.imageUrls[0]:void 0,playsInl
5848ine:!0,preload:"metadata",onError:()=>{console.warn("Video failed to load:",o),f(!0)},children:[c.jsx("source",{src:o,type:"video/mp4"}),"Your browser does not support the video tag."]}),A&&_&&c.jsx("div",{className:"absolute bottom-2 right-2 z-10",children:c.jsxs("div",{className:"bg-black bg-opacity-75 rounded-lg p-2",children:[c.jsx("p",{className:"text-white text-xs mb-1",children:"Narration Audio:"}),c.jsxs("audio",{controls:!0,className:"w-32",children:[c.jsx("source",{src:decodeURIComponent(_),type:"audio/mpeg"}),"Your browser does not support the audio tag."]})]})}),c.jsx("div",{className:"absolute top-2 right-2 z-10",children:c.jsx("button",{onClick:()=>{WU("video_exported",{executionId:t.id,index:e});const L=document.createElement("a");L.href=o,L.download=`video-${t.id}-${e+1}.mp4`,document.body.appendChild(L),L.click(),document.body.removeChild(L)},className:"bg-blue-500 hover:bg-blue-600 text-white p-2 rounded-full shadow-lg transition-colors duration-300",title:"Download Video",children:c.jsx(cEe,{className:"w-4 h-4"})})}),g&&c.jsx("div",{className:"absolute bottom-2 left-2 z-10",children:c.jsx("div",{className:"bg-black bg-opacity-75 rounded-lg p-2",children:c.jsxs("p",{className:"text-white text-xs",children:["Processed: ",[A&&"Voice",x&&"Captions",b&&"Music",M&&parseInt(M)>1&&`${M} Videos`].filter(Boolean).join(" ⢠")]})})})]})},cie=n=>{const e=n.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|shorts\/))([\w-]{11})/);return e?`https://img.youtube.com/vi/${e[1]}/hqdefault.jpg`:null},ixe=(n,e)=>{const t=n.toLowerCase();return t.includes("instagram.com")||e==="instagram"?{name:"Instagram",color:"#E4405F",icon:c.jsx(x_,{className:"w-4 h-4"})}:t.includes("twitter.com")||t.includes("x.com")||e==="twitter"||e==="x"?{name:"X / Twitter",color:"#1DA1F2",icon:c.jsx(MB,{className:"w-4 h-4"})}:t.includes("tiktok.com")||e==="tiktok"?{name:"TikTok",color:"#000000",icon:c.jsx(pT,{className:"w-4 h-4"})}:t.includes("youtube.com")||t.includes("youtu.be")||e==="youtube"?{name:"YouTube",color:"#FF0000",icon:c.jsx(mT,{className:"w-4 h-4"})}:t.includes("linkedin.com")||e==="linkedin"?{name:"LinkedIn",color:"#0A66C2",icon:c.jsx(Ay,{className:"w-4 h-4"})}:t.includes("facebook.com")||e==="facebook"?{name:"Facebook",color:"#1877F2",icon:c.jsx(y1,{className:"w-4 h-4"})}:t.includes("reddit.com")||e==="reddit"?{name:"Reddit",color:"#FF4500",icon:c.jsx(coe,{className:"w-4 h-4"})}:{name:"Social Post",color:"#10B981",icon:c.jsx(xM,{className:"w-3.5 h-3.5"})}},N0t=({url:n,caption:e,fallbackImage:t,platform:r})=>{const[i,s]=G.useState({image:t||cie(n)||null,title:null,publisher:null}),[a,o]=G.useState(!0),[l,u]=G.useState(!1),d=ixe(n,r);G.useEffect(()=>{let f=!1;return n&&(async()=>{var A,x;const g=cie(n);if(g){f||(s(b=>({...b,image:g,publisher:"YouTube"})),o(!1));return}try{o(!0);const b=await fetch(`https://api.microlink.io?url=${encodeURIComponent(n)}`);if(b.ok){const _=await b.json();if(!f&&(_!=null&&_.data)){const M=((A=_.data.image)==null?void 0:A.url)||((x=_.data.screenshot)==null?void 0:x.url)||t||null;s({image:M,title:_.data.title||null,publisher:_.data.publisher||d.name})}}}catch(b){console.warn("Failed to fetch post URL metadata:",b)}finally{f||o(!1)}})(),()=>{f=!0}},[n,t]);const h=!l&&(i.image||t);return c.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"group relative block w-full bg-black/5 dark:bg-black/40 overflow-hidden cursor-pointer transition-all duration-300",title:`Open ${d.name} post in new tab`,children:h?c.jsxs("div",{className:"relative w-full aspect-[4/5] sm:aspect-square max-h-[480px] bg-black overflow-hidden flex items-center justify-center",children:[c.jsx("img",{src:h,alt:i.title||"Post media preview",onError:()=>u(!0),className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 ease-out"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-black/20 pointer-events-none"}),c.jsxs("div",{className:"absolute top-3 left-3 z-10 flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-bold text-white shadow-lg backdrop-blur-md",style:{backgroundColor:`${d.color}EE`},children:[d.icon,c.jsx("span",{children:d.name})]}),c.jsx("div",{className:"absolute top-3 right-3 z-10 w-7 h-7 rounded-full bg-black/60 backdrop-blur-md text-white flex items-center justify-center text-xs opacity-90 group-hover:opacity-100 group-hover:scale-110 transition-all shadow-md",children:c.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}),c.jsxs("div",{className:"absolute bottom-3 inset-x-3 z-10 flex items-center justify-between p-2.5 rounded-xl bg-black/75 backdrop-blur-md border border-white/10 text-white group-hover:border-[#CFFF05]/50 transition-colors",children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden mr-2",children:[c.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),c.jsx("p",{className:"text-xs font-medium truncate",children:i.title||`View live on ${d.name}`})]}),c.jsxs("div",{className:"flex items-center gap-1 text-[11px] font-bold text-[#CFFF05] uppercase tracking-wider flex-shrink-0 group-hover:translate-x-0.5 transition-transform",children:[c.jsx("span",{children:"Open"}),c.jsx("span",{children:"â"})]})]})]}):c.jsxs("div",{className:"relative w-full p-8 min-h-[220px] flex flex-col items-center justify-center text-center bg-gradient-to-br from-gray-900 via-[#151921] to-[#0F121A] border-y border-gray-800 group-hover:border-emerald-500/30 transition-all",children:[c.jsx("div",{className:"w-14 h-14 roun
5848ded-2xl flex items-center justify-center text-white mb-3 shadow-lg group-hover:scale-110 transition-transform",style:{backgroundColor:d.color},children:d.icon}),c.jsx("h4",{className:"text-sm font-bold text-white mb-1",children:i.title||`Published on ${d.name}`}),c.jsxs("p",{className:"text-xs text-gray-400 max-w-xs mb-4",children:["Click anywhere on this card to view the live post on ",d.name]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-[#CFFF05] text-[#0F121A] text-xs font-black shadow-lg shadow-[#CFFF05]/20 group-hover:scale-105 transition-all",children:[c.jsx("span",{children:"Open Post"}),c.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})})},M0t=async n=>{if(window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1")return n;try{if((await fetch(n,{method:"HEAD"})).ok)return n}catch{}if(n.includes("https://spread-out-server.fly.dev")){const e=n.replace("https://spread-out-server.fly.dev","http://localhost:3001");try{if((await fetch(e,{method:"HEAD"})).ok)return e}catch{}}return n};function k0t(){const{data:n}=Ma(),e=po();ro();const[t,r]=G.useState(!1),[i,s]=G.useState(null),[a,o]=G.useState([]),[l,u]=G.useState(!1),d=G.useRef(null),h=cl(HSe),[f,p]=G.useState(null),[g,A]=G.useState(null),[x,b]=G.useState(null),[_,M]=G.useState(null),[T,L]=G.useState({}),D=cl(bae),P=async(Ee,Ae)=>{if(!(!Ee||!Ae))try{await D({postId:Ee,text:Ae})}catch(te){console.error("Failed to update post text",te)}},O=cl(yae),F=cl(wae),U=cl(t4e),B=cl(n4e),z=Ee=>{if(Ee.status!=="failed"||!Ee.result)return!1;const Ae=Ee.result.includes("https://replicate.delivery/")&&Ee.result.includes(".mp4"),te=Ee.result.includes("Avatar video")||Ee.result.includes("avatar video")||Ee.result.includes("completed successfully")||Ee.result.includes("generated successfully");return Ae&&te};G.useEffect(()=>{r(!0);const Ae=new URLSearchParams(e.search).get("id");Ae&&s(Ae)},[e]);const{data:H,isLoading:X,refetch:W}=Qr(hM,{executionId:i||void 0});G.useEffect(()=>{if(!i)return;const Ee=H==null?void 0:H.find(te=>te.id===i);return!!Ee&&["processing","queued","running","pending","generating"].includes(Ee.status)?d.current=setInterval(()=>{W()},3e3):d.current&&clearInterval(d.current),()=>{d.current&&clearInterval(d.current)}},[i,H,W]);const{data:J}=Qr(_B,{includeUnscheduled:!0,executionId:i||void 0}),{data:ee}=Qr(P8),ae=jn.useMemo(()=>H?H.map(Ee=>{let Ae={};try{Ae=typeof Ee.result=="string"?JSON.parse(Ee.result):Ee.result||{}}catch{Ae={}}const te=Ae==null?void 0:Ae.postId;let ve=[];return Array.isArray(J)&&(te&&(ve=J.filter(we=>we.id===te)),ve.length===0&&(Ee.status==="posted"||Ee.status==="completed"||Ee.status==="succeeded")&&(ve=J.filter(we=>we.workflowId===Ee.workflowId))),{execution:Ee,workflow:Ee.workflow,posts:ve}}).filter(Ee=>Ee.workflow):[],[H,J]),le=i?ae.filter(Ee=>Ee.execution.id===i):ae,Z=async Ee=>{if(confirm("Are you sure you want to delete this execution? This action cannot be undone.")){p(Ee);try{await O({id:Ee}),window.location.reload()}catch(Ae){alert("Error deleting execution: "+(Ae.message||"Something went wrong"))}finally{p(null)}}},Y=async()=>{if(a.length!==0&&confirm(`Are you sure you want to delete ${a.length} executions? This action cannot be undone.`)){u(!0);try{await h({ids:a}),window.location.reload()}catch(Ee){alert("Error deleting executions: "+(Ee.message||"Something went wrong"))}finally{u(!1)}}};if(X&&!H)return c.jsx(pl,{children:c.jsx("div",{className:"flex justify-center items-center h-64",children:c.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-[#CFFF05]"})})});const re=(Ee,Ae)=>{let te=[],ve="";try{const we=JSON.parse(Ee.result||"{}");we.imageUrls&&(te=we.imageUrls),we.text&&(ve=we.text)}catch{}return c.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-xl border border-gray-200 dark:border-gray-700 overflow-hidden",style:{animation:"fadeSlideIn 0.4s ease both"},children:[c.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white",children:(Ae==null?void 0:Ae.name)||"Post"}),c.jsxs("span",{className:"flex items-center gap-2 px-3 py-1 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300 rounded-full text-sm font-semibold",children:[c.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-400 animate-pulse"}),"Processingâ¦"]})]})}),c.jsxs("div",{className:"p-6 flex flex-col items-center gap-6",children:[c.jsxs("div",{className:"w-full max-w-md",children:[c.jsx("div",{className:"h-2 bg-gray-100 dark:bg-gray-700 rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-gradient-to-r from-[#CFFF05] via-yellow-300 to-[#CFFF05] rounded-full animate-pulse",style:{width:"60%"}})}),c.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-3",children:"⨠Your post is being generated. This page refreshes automatically."})]}),te.length>0&&c.jsx("div",{className:"w-full max-w-md",children:c.jsx(lie,{images:te})}),ve&&c.jsx("div",{className:"w-full max-w-md bg-gray-50 dark:bg-gray-700/50 rounded-xl p-4",children:c.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-line",children:ve})})]})]},Ee.id)},_e=Ee=>{var ge,Ne;const{execution:Ae,workflow:te,posts:ve}=Ee,we=te.schedule?JSON.parse(te.schedule):{},Ue=GS(te.socialMedias);let ze={};try{Ae.result&&(ze=typeof Ae.result=="string"?JSON.parse(Ae.result):Ae.result)}catch{ze={text:Ae.result}}const yt=(ve||[]).filter(ke=>ke.workflowId===(te==null?void 0:te.id));let mt=null;ze.postId&&(mt=(ve||[]).find(ke=>ke.id===ze.postId)||(J==null?void 0:J.find(ke=>ke.id===ze.postId)));const bt=Ae.status==="completed"||Ae.status==="succeeded"||Ae.status==="posted";if(!mt&&bt){const ke=new Date(Ae.createdAt).getTime(),Xe=[...yt].sort((et,Qe)=>Math.abs(new Date(et.createdAt).getTime()-ke)-Math.abs(new Date(Qe.createdAt).getTime()-ke));Xe.length>0&&Math.abs(new Date(Xe[0].createdAt).getTime()-ke)<1800*1e3&&(mt=Xe[0])}const dt=mt,St=bt?yt.find(ke=>ke.imageUrls&&ke.imageUrls.length>0||ke.videoUrls&&ke.videoUrls.length>0):null;let kt=[];if(te!=null&&te.mediaFiles)try{const ke=typeof te.mediaFiles=="string"?JSON.parse(te.mediaFiles):te.mediaFiles;Array.isArray(ke)&&(kt=ke.map(Xe=>(Xe==null?void 0:Xe.url)||(typeof Xe=="string"?Xe:null)).filter(
5848Boolean))}catch{}const Fe=(te==null?void 0:te.type)==="video"||(te==null?void 0:te.type)==="long-video"||(()=>{try{const ke=typeof(te==null?void 0:te.options)=="string"?JSON.parse(te.options):te==null?void 0:te.options;return(ke==null?void 0:ke.workflowType)==="video"||(ke==null?void 0:ke.workflowType)==="long-video"}catch{return!1}})(),Ze=dt!=null&&dt.imageUrls&&dt.imageUrls.length>0?dt.imageUrls:ze.imageUrls&&Array.isArray(ze.imageUrls)&&ze.imageUrls.length>0?ze.imageUrls:ze.imageUrl&&typeof ze.imageUrl=="string"?[ze.imageUrl]:St!=null&&St.imageUrls&&St.imageUrls.length>0?St.imageUrls:[],Ye=dt!=null&&dt.videoUrls&&dt.videoUrls.length>0?dt.videoUrls:ze.videoUrls&&Array.isArray(ze.videoUrls)&&ze.videoUrls.length>0?ze.videoUrls:ze.finalVideoUrl&&typeof ze.finalVideoUrl=="string"?[ze.finalVideoUrl]:ze.videoUrl&&typeof ze.videoUrl=="string"?[ze.videoUrl]:St!=null&&St.videoUrls&&St.videoUrls.length>0?St.videoUrls:[],ft=ke=>!ke||typeof ke!="string"?!1:/instagram\.com|twitter\.com|x\.com|tiktok\.com|youtube\.com|youtu\.be|facebook\.com|linkedin\.com|reddit\.com|threads\.net|pinterest\.com/i.test(ke),At=Ze.filter(ke=>typeof ke=="string"&&!ft(ke)),Ce=Ye.filter(ke=>typeof ke=="string"&&!ft(ke));let qe=T[Ae.id]??((dt==null?void 0:dt.text)||ze.text||"");if(typeof qe=="string"&&(qe.trim().startsWith("{")||qe.trim().startsWith("[")))try{const ke=JSON.parse(qe);ke.text&&(qe=ke.text)}catch{}const pt=Ae.status==="posted"?!0:Ae.status==="failed"||Ae.status==="cancelled"||!Ae.status||Ae.status==="running"||Ae.status==="processing"||Ae.status==="pending"||Ae.status==="queued"||Ae.status==="generating"?!1:Ce.length>0||At.length>0||ze.postId||ze.postUrl||dt?!0:Ae.status==="completed"||Ae.status==="succeeded"||Ae.status==="scheduled",Te=!pt&&Ae.status!=="failed"&&Ae.status!=="posted"&&Ae.status!=="cancelled"&&Ae.status!=="completed"&&Ae.status!=="succeeded",oe=(()=>{const ke=[],Xe=new Set,et=new Set,Qe=(Ft,Mt,Nt,Je)=>{if(!Mt&&!Nt)return;const fn=S0t({platform:Ft,postUrl:Mt,platformPostUrl:Mt,platformPostId:Nt,url:Mt})||(Mt&&HU(Mt)?Mt:null);if(!fn||!HU(fn)||et.has(fn))return;const Tn=(Ft||T0t(fn)||"general").toLowerCase();Xe.has(Tn)||(Xe.add(Tn),et.add(fn),ke.push({platform:Tn,url:fn,label:Je}))},lt=[dt,bt?St:null].filter(Boolean);for(const Ft of lt)if(Ft!=null&&Ft.socialMedia){let Mt=[];if(Array.isArray(Ft.socialMedia))Mt=Ft.socialMedia;else if(typeof Ft.socialMedia=="string")try{const Nt=JSON.parse(Ft.socialMedia);Mt=Array.isArray(Nt)?Nt:[Nt]}catch{}else typeof Ft.socialMedia=="object"&&(Mt=[Ft.socialMedia]);for(const Nt of Mt){if(!Nt)continue;const Je=Nt.value||Nt.platform||Nt.provider||Nt.label,fn=Nt.postUrl||Nt.liveUrl||Nt.url||Nt.permalink||Nt.platformPostUrl;Qe(Je,fn,Nt.platformPostId,Nt.label)}}const tt=[ze==null?void 0:ze.platformResults,ze==null?void 0:ze.postResults,ze==null?void 0:ze.publishedPosts,ze==null?void 0:ze.results];for(const Ft of tt)if(Array.isArray(Ft))for(const Mt of Ft){if(!Mt)continue;const Nt=Mt.platform||Mt.provider,Je=Mt.postUrl||Mt.platformPostUrl||Mt.url||Mt.permalink;Qe(Nt,Je,Mt.platformPostId)}return ze!=null&&ze.postUrl&&Qe(void 0,ze.postUrl),ze!=null&&ze.liveUrl&&Qe(void 0,ze.liveUrl),ke})();return(ge=oe[0])!=null&&ge.url,c.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-xl border border-gray-200 dark:border-gray-700 overflow-hidden",children:[c.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:c.jsxs("div",{className:"flex justify-between items-start",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsx("input",{type:"checkbox",className:"w-5 h-5 rounded border-gray-300 text-red-500 focus:ring-red-500",checked:a.includes(Ae.id),onChange:ke=>{ke.target.checked?o(Xe=>[...Xe,Ae.id]):o(Xe=>Xe.filter(et=>et!==Ae.id))}}),c.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white m-0",children:te.name})]}),c.jsx("div",{className:"flex items-center gap-2 mb-3",children:Ue.map(ke=>V6(ke,"text-xs font-medium"))}),c.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),c.jsx("span",{children:(()=>{const ke=Gb(te.schedule);return ke?`Posts ${ke.day.charAt(0).toUpperCase()+ke.day.slice(1)} · ${ke.time}`:we.automationType==="auto-pilot"||we.automationType==="auto"?"Recurring schedule":"Not scheduled"})()})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:`w-2 h-2 rounded-full ${Ae.status==="posted"?"bg-green-500":Te?"bg-amber-500 animate-pulse":Ae.status==="failed"?"bg-red-500":"bg-blue-500"}`}),c.jsx("span",{className:"capitalize font-medium",children:Ae.status==="posted"?"Posted":Ae.status==="failed"?"Failed":Te?"Generating...":Ae.status==="completed"||pt?Gb(te.schedule)?"Scheduled":"Ready":Ae.status})]})]})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:new Date(Ae.createdAt).toLocaleDateString()}),c.jsx("div",{className:"text-xs text-gray-400 dark:text-gray-500",children:new Date(Ae.createdAt).toLocaleTimeString()})]}),c.jsx("button",{onClick:()=>Z(Ae.id),disabled:f===Ae.id,className:"p-2 rounded-full bg-red-100 text-red-500 hover:bg-red-200 dark:bg-red-900/20 dark:text-red-400 dark:hover:bg-red-900/30 transition-colors duration-300",title:"Delete execution",children:f===Ae.id?c.jsx(Hf,{}):c.jsx(Ev,{})})]})]})}),te.userId===(n==null?void 0:n.id)&&Ae.status!=="posted"&&Ae.status!=="failed"&&!Te&&pt&&!((Ne=E0t(te.options))!=null&&Ne.isAutoPilotChild)&&c.jsxs("div",{className:"ws border-b border-white/[0.06] px-6 py-5",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(sI,{className:"text-[var(--lp-lime)]"}),c.jsx("h4",{className:"text-base font-bold text-white",children:Gb(te.schedule)?"Scheduled post":"Schedule this post"})]}),c.jsx("div",{className:"max-w-md",children:c.jsx(ZAe,{workflow:te,onDone:()=>W()},String(te.schedule))})]}),Ae.status==="posted"&&c.jsxs("div",{className:"px-6 py-3 bg-emerald-500/10 dark:bg-emerald-500/15 border-b border-emerald-500/20 flex flex-col sm:flex-row items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2 text-emerald-700 dark:text-emerald-400",children:[c.jsxs("span",{className:"flex h-2.5 w-2.5 relative",children:[c.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),c.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-emerald-500"})]}),c.jsx("span",{className:"text-xs font-black uppercase tracking-wider",children:"Live on Social Media"})]}),oe.length>0&&c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:oe.map((ke,Xe)=>{const et=ixe(ke.url,ke.platform);return c.jsxs("a",{href:ke.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-3 py-1 bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold rounded-lg shadow-sm transition-all hover:scale-105",title:`Open on ${et.name}`,children:[c.jsx("span",{children:et.name}),c.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]},Xe)})})]}),c.jsxs("div",{className:"p-6 flex items-center justify-center",children:[c.jsxs("div",{className:`bg-white dark:bg-gray-900 rounded-xl shadow-lg border border-gray-100 dark:border-gray-700 overflow-hidden w-full mx-auto ${Ae.status==="posted"&&oe.length>1?"max-w-4xl":(te==null?void 0:te.type)==="long-video"||(()=>{var ke;try{return((ke=typeof(te==null?void 0:te.options)=="string"?JSON.parse(te.options):te==null?void 0:te.options)==null?void 0:ke.workflowType)==="long-video"}catch{return!1}})()?"max-w-2xl":"max-w-md"}`,children:[c.jsxs("div",{className:"flex items-center p-4 border-b border-gray-100 dark:border-gray-700",children:[c.jsx("div",{className:"w-10 h-10 bg-gradient-to-r from-blue-500 to-purple-500 rounded-full flex items-center justify-center",children:c.jsx("span",{className:"text-white text-sm font-bold",children:"AI"})}),c.jsxs("div",{className:"ml-3",children:[c.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Spread Out AI"}),c.jsxs("div",{className:"flex items-center text-sm text-gray-500 dark:text-gray-400 gap-1",children:[c.jsx(sI,{}),c.jsxs("span",{children:[Ae.status==="posted"?"Posted":Ae.status==="failed"?"Failed":Te?"Generating...":Ae.status==="completed"||pt?"Scheduled":Ae.status," ⢠",new Date(Ae.createdAt).toLocaleDateString()]})]})]})]}),Te&&c.jsxs("div",{className:"p-8 bg-gray-50/80 dark:bg-[#151921]/80 border-b border-gray-100 dark:border-gray-800 text-center flex flex-col items-center justify-center min-h-[260px]",children:[c.jsx("div",{className:"w-12 h-12 rounded-full border-4 border-amber-500/20 border-t-amber-500 dark:border-[#CFFF05]/20 dark:border-t-[#CFFF05] animate-spin mb
5848-4"}),c.jsx("h4",{className:"text-sm font-bold text-gray-900 dark:text-white mb-1",children:(te==null?void 0:te.type)==="text-image"?"Rendering Infographics & Images...":"Rendering Video & Audio..."}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 max-w-xs",children:"AI is generating and assembling your post assets. This preview will update automatically once completed."})]}),Te?null:Ae.status==="posted"?oe.length>0?c.jsx("div",{className:`p-4 bg-gray-50/50 dark:bg-[#12161f]/50 border-b border-gray-100 dark:border-gray-800 ${oe.length>1?"grid grid-cols-1 md:grid-cols-2 gap-4":"flex flex-col"}`,children:oe.map((ke,Xe)=>c.jsx("div",{className:"rounded-xl overflow-hidden shadow-sm border border-gray-200 dark:border-gray-700/80 bg-black/40",children:c.jsx(N0t,{url:ke.url,caption:qe,fallbackImage:At[0]||kt[0],platform:ke.platform})},Xe))}):c.jsxs("div",{className:"p-6 bg-gray-50/70 dark:bg-[#151921]/70 border-b border-gray-100 dark:border-gray-800 text-center",children:[c.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-emerald-500/10 text-emerald-500 flex items-center justify-center mb-3",children:c.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),c.jsx("h4",{className:"text-sm font-bold text-gray-900 dark:text-white mb-1",children:"Post Live on Social Channels"}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:"Media was published and server storage was cleaned up."})]}):(Fe||Ce.length>0)&&Ce.length>0?c.jsx("div",{className:"relative",children:Ce.slice(0,1).map((ke,Xe)=>ke.startsWith("UGC_PROCESSING_ASYNC:")?c.jsx("div",{className:"flex items-center justify-center p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-yellow-600 mx-auto mb-2"}),c.jsx("p",{className:"text-yellow-700 font-medium",children:"UGC Video Processing..."}),c.jsx("p",{className:"text-yellow-600 text-sm",children:"Check execution status for updates"})]})},Xe):c.jsx(C0t,{videoUrl:ke,index:Xe,execution:Ae,post:dt||{id:ze.postId,text:qe,imageUrls:At,videoUrls:Ce},isTextImage:(te==null?void 0:te.type)==="text-image",isLongVideo:(te==null?void 0:te.type)==="long-video"||(()=>{var et;try{return((et=typeof(te==null?void 0:te.options)=="string"?JSON.parse(te.options):te==null?void 0:te.options)==null?void 0:et.workflowType)==="long-video"}catch{return!1}})()},Xe))}):At.length>0?c.jsx("div",{className:"relative",children:c.jsx(lie,{images:At})}):null,c.jsxs("div",{className:"p-4",children:[c.jsx("textarea",{className:"w-full text-gray-900 dark:text-white text-sm leading-relaxed mb-4 bg-transparent border border-gray-200 dark:border-gray-700 rounded-lg p-2 focus:ring-2 focus:ring-blue-500 focus:outline-none resize-none",rows:4,value:qe,onChange:ke=>L({...T,[Ae.id]:ke.target.value}),onBlur:()=>{const ke=(dt==null?void 0:dt.id)||ze.postId;ke&&T[Ae.id]!==void 0&&P(ke,T[Ae.id])}}),c.jsx("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 dark:border-gray-700",children:c.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${Ae.status==="posted"?"bg-green-100 text-green-800 dark:bg-green-900/20 dark:text-green-300":Ae.status==="failed"?"bg-red-100 text-red-800 dark:bg-red-900/20 dark:text-red-300":"bg-blue-100 text-blue-800 dark:bg-blue-900/20 dark:text-blue-300"}`,children:Ae.status==="posted"?"Posted":Ae.status==="failed"?"Failed":"Scheduled"})})]})]}),(Ae.status==="scheduled"||Ae.status==="completed"||Ae.status==="succeeded")&&c.jsx("button",{onClick:async()=>{A(Ae.id);try{await F({executionId:Ae.id}),window.location.reload()}catch(ke){alert("Error posting manually: "+(ke.message||"Something went wrong"))}finally{A(null)}},disabled:g===Ae.id,className:"ml-4 p-2 rounded-full bg-green-100 text-green-500 hover:bg-green-200 dark:bg-green-900/20 dark:text-green-400 dark:hover:bg-green-900/30 transition-colors duration-300",title:"Post Now",children:g===Ae.id?c.jsx(Hf,{}):"Post Now"}),z(Ae)&&c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:async()=>{M(Ae.id);try{await B({executionId:Ae.id}),window.location.reload()}catch(ke){alert("Error completing full UGC workflow: "+(ke.message||"Something went wrong"))}finally{M(null)}},disabled:_===Ae.id||x===Ae.id,className:"p-2 rounded-full bg-green-100 text-green-600 hover:bg-green-200 dark:bg-green-900/20 dark:text-green-400 dark:hover:bg-green-900/30 transition-colors duration-300",title:"Complete Full UGC Video (with B-roll, captions, music, etc.)",children:_===Ae.id?c.jsx(Hf,{}):"ð¬ Complete Video"}),c.jsx("button",{onClick:async()=>{b(Ae.id);try{let ke="";if(Ae.result&&Ae.result.includes("https://replicate.delivery/")){const Xe=Ae.result.match(/(https:\/\/replicate\.delivery\/[^ \n"]+\.mp4)/);Xe&&(ke=Xe[1])}await U({executionId:Ae.id,avatarVideoUrl:ke}),window.location.reload()}catch(ke){alert("Error completing UGC with avatar: "+(ke.message||"Something went wrong"))}finally{b(null)}},disabled:x===Ae.id||_===Ae.id,className:"p-2 rounded-full bg-blue-100 text-blue-500 hover:bg-blue-200 dark:bg-blue-900/20 dark:text-blue-400 dark:hover:bg-blue-900/30 transition-colors duration-300",title:"Use Avatar Video Only (skip B-roll and effects)",children:x===Ae.id?c.jsx(Hf,{}):"ð¹ Avatar Only"})]})]})]},Ae.id)};return c.jsxs(pl,{children:[c.jsx("style",{children:` 5849 @keyframes fadeSlideIn { 5850 from { opacity: 0; transform: translateY(16px); } 5851 to { opacity: 1; transform: translateY(0); } 5852 } 5853 `}),c.jsxs("div",{className:"p-4",style:{opacity:t?1:0,transition:"opacity 0.4s ease"},children:[c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>window.history.back(),className:"p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600",children:c.jsx(rEe,{})}),c.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:i?"Post Detail":"Posts"})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[i&&c.jsx("button",{onClick:()=>{s(null),window.history.pushState({},"","/executions")},className:"px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600",children:"View All Posts"}),!i&&le.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:()=>{a.length===le.length?o([]):o(le.map(Ee=>Ee.execution.id))},className:"px-4 py-2 bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.length===le.length?"Deselect All":"Select All"}),a.length>0&&c.jsxs("button",{onClick:Y,disabled:l,className:"flex items-center gap-2 px-4 py-2 bg-red-100 text-red-600 dark:bg-red-900/30 dark:text-red-400 rounded-lg hover:bg-red-200 dark:hover:bg-red-900/50 transition-colors",children:[l?c.jsx(Hf,{}):c.jsx(Ev,{}),"Delete Selected (",a.length,")"]})]})]})]}),i&&le.length===0&&!X&&(()=>{const Ee=H==null?void 0:H.find(Ae=>Ae.id===i);return Ee&&Ee.status==="processing"?re(Ee,Ee.workflow):Ee?c.jsx("div",{className:"flex justify-center items-center h-64",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-[#CFFF05] mx-auto mb-4"}),c.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Loading postâ¦"}),c.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-2",children:"This page will refresh automatically."})]})}):c.jsx("div",{className:"flex justify-center items-center h-64",children:c.jsxs("div",{className:"text-center max-w-md",children:[c.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"This post isnât available"}),c.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-2",children:"It may have been deleted, or it belongs to another account. Sign in with the account that created it to see it."})]})})})(),le.length===0&&!i?c.jsx("div",{className:"flex justify-center items-center h-64",children:c.jsxs("div",{className:"text-center",children:[c.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"No Posts Found"}),c.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-2",children:"No posts have been published to social media yet."})]})}):c.jsx("div",{className:"space-y-6",children:le.map(Ee=>Ee.execution.status==="processing"?re(Ee.execution,Ee.workflow):_e(Ee))})]})]})}
5853const R0t="spreadout:mcpAuthorize";function WN({children:n}){return c.jsxs("div",{className:"ws relative flex min-h-screen items-center justify-center overflow-hidden px-4 py-12",children:[c.jsx("div",{className:"pointer-events-none absolute -top-40 left-1/2 h-80 w-[40rem] -translate-x-1/2 rounded-full bg-[rgba(207,255,5,.1)] blur-3xl","aria-hidden":!0}),c.jsx("div",{className:"ws-glass ws-enter relative w-full max-w-md rounded-[28px] p-7 sm:p-9",children:n})]})}function P0t(){jB();const{t:n}=Kr(),e=po(),t=ro(),{data:r,isLoading:i}=Ma(),s=G.useMemo(()=>Object.fromEntries(new URLSearchParams(e.search)),[e.search]),{data:a,isLoading:o,error:l}=Qr(C4e,s,{enabled:!!r,retry:!1}),[u,d]=G.useState(null),[h,f]=G.useState(null);G.useEffect(()=>{if(!i&&!r)try{sessionStorage.setItem(R0t,e.search)}catch{}},[i,r,e.search]);const p=async _=>{var M;d(_?"approve":"deny"),f(null);try{const T=await ESe({...s,approve:_});window.location.assign(T.redirectTo)}catch(T){f(((M=T==null?void 0:T.data)==null?void 0:M.message)||(T==null?void 0:T.message)||n("Something went wrong. Try again.")),d(null)}},g=c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("img",{src:V1,alt:"",className:"h-9 w-9 rounded-xl"}),c.jsx("span",{className:"ws-mono text-[11px] uppercase tracking-[0.16em] text-[#e9ffa1]",children:"Spread Out AI"})]});if(i||r&&o)return c.jsxs(WN,{children:[g,c.jsx("div",{className:"ws-skeleton mt-8 h-8 w-3/4 rounded-xl"}),c.jsx("div",{className:"ws-skeleton mt-4 h-40 rounded-2xl"})]});if(!r)return c.jsxs(WN,{children:[g,c.jsx("h1",{className:"ws-display mt-7 text-2xl font-bold text-white",children:n("Sign in to connect your AI agent")}),c.jsx("p",{className:"ws-muted mt-2 text-sm",children:n("An AI agent wants to use your Spread Out account. Sign in first, then you can approve or decline.")}),c.jsxs("div",{className:"mt-8 flex flex-col gap-2.5",children:[c.jsx("button",{onClick:()=>t("/login"),className:"ws-btn ws-btn-primary",children:n("Sign in")}),c.jsx("button",{onClick:()=>t("/signup"),className:"ws-btn ws-btn-ghost",children:n("Create an account")}
5853)]})]});const A=a;if(l||!(A!=null&&A.ok))return c.jsxs(WN,{children:[g,c.jsx("div",{className:"mt-7 grid h-12 w-12 place-items-center rounded-2xl bg-red-500/10 ring-1 ring-red-500/30",children:c.jsx(iI,{className:"h-6 w-6 text-red-300"})}),c.jsx("h1",{className:"ws-display mt-5 text-2xl font-bold text-white",children:n("This connection can't continue")}),c.jsx("p",{className:"ws-muted mt-2 text-sm",children:(A==null?void 0:A.error)||(l==null?void 0:l.message)||n("The link is incomplete. Start the connection again from your AI agent.")})]});const b=A.scope==="spreadout:read"?[{icon:c.jsx(WTe,{}),text:n("See your workflows, posts, analytics and credits")}]:[{icon:c.jsx(j8,{}),text:n("Generate weekly plans, videos, carousels and posts (uses your credits)")},{icon:c.jsx(roe,{}),text:n("Schedule and publish posts to your connected accounts")},{icon:c.jsx(X4,{}),text:n("Manage comment auto-replies and keyword DMs")},{icon:c.jsx($Te,{}),text:n("Read your analytics, credits and account details")}];return c.jsxs(WN,{children:[g,c.jsx("h1",{className:"ws-display mt-7 text-2xl font-bold leading-tight text-white",children:n("{app} wants to use your Spread Out account",{app:A.clientName})}),c.jsx("p",{className:"ws-muted mt-2 text-sm",children:n("Signed in as {email}",{email:r.email||r.username||""})}),c.jsxs("div",{className:"mt-7 space-y-2.5",children:[c.jsx("div",{className:"ws-kicker !text-[10px]",children:n("It will be able to")}),b.map((_,M)=>c.jsxs("div",{className:"flex items-start gap-3 rounded-2xl border border-white/[0.07] bg-white/[0.02] p-3.5 text-sm text-white/85",children:[c.jsx("span",{className:"mt-0.5 text-[18px] text-[var(--lp-lime)]",children:_.icon}),c.jsx("span",{children:_.text})]},M))]}),c.jsxs("div",{className:"mt-5 flex items-start gap-2.5 text-xs text-white/50",children:[c.jsx(QTe,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsx("span",{children:n("You can disconnect it any time in Account settings. You will be sent back to {host}.",{host:A.redirectHost})})]}),h&&c.jsx("div",{className:"mt-5 rounded-2xl border border-red-400/25 bg-red-500/10 px-4 py-3 text-sm text-red-200",children:h}),c.jsxs("div",{className:"mt-8 flex flex-col-reverse gap-2.5 sm:flex-row",children:[c.jsx("button",{onClick:()=>p(!1),disabled:!!u,className:"ws-btn ws-btn-ghost sm:flex-1",children:n(u==="deny"?"Cancellingâ¦":"Cancel")}),c.jsx("button",{onClick:()=>p(!0),disabled:!!u,className:"ws-btn ws-btn-primary sm:flex-1",children:n(u==="approve"?"Connectingâ¦":"Allow access")})]})]})}const p8="w-full min-w-0 rounded-full border border-white/10 bg-white/[0.03] px-4 py-2.5 text-sm text-white placeholder-white/30 outline-none transition-colors focus:border-[rgba(207,255,5,.6)] focus:ring-0",sxe="w-full min-w-0 resize-y rounded-2xl border border-white/10 bg-white/[0.03] px-4 py-3 text-sm leading-relaxed text-white placeholder-white/30 outline-none transition-colors focus:border-[rgba(207,255,5,.6)] focus:ring-0",Bm="inline-flex h-8 items-center gap-1.5 rounded-full border border-white/12 bg-white/[0.04] px-3 text-xs font-semibold text-white/85 transition-colors hover:bg-white/[0.08] hover:text-white disabled:opacity-50",axe={instagram:{label:"Instagram",Icon:Py,tint:"linear-gradient(135deg,#f58529,#dd2a7b 50%,#8134af)"},facebook:{label:"Facebook",Icon:zT,tint:"#1877f2"},linkedin:{label:"LinkedIn",Icon:GT,tint:"#0a66c2"},threads:{label:"Threads",Icon:O_,tint:"#101010"}};function oxe({platform:n,size:e="sm"}){const t=axe[n];if(!t)return null;const r=e==="md"?"h-8 w-8":"h-5 w-5";return c.jsx("span",{className:`grid ${r} shrink-0 place-items-center rounded-full text-white ring-2 ring-[#07080d]`,style:{background:t.tint},title:t.label,children:c.jsx(t.Icon,{className:e==="md"?"h-4 w-4":"h-2.5 w-2.5"})})}function yP({account:n,size:e=44}){const[t,r]=G.useState(!1),i=(n.displayName||n.username||"?").trim().charAt(0).toUpperCase();return c.jsxs("span",{className:"relative inline-block shrink-0",style:{width:e,height:e},children:[n.imageUrl&&!t?c.jsx("img",{src:n.imageUrl,alt:"",onError:()=>r(!0),className:"h-full w-full rounded-full object-cover ring-1 ring-white/10"}):c.jsx("span",{className:"grid h-full w-full place-items-center rounded-full bg-white/[0.06] text-sm font-bold text-white/80 ring-1 ring-white/10",children:i}),c.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:c.jsx(oxe,{platform:n.platform})})]})}const m8=n=>n.displayName||(n.username?`@${n.username}`:"");function W6({on:n,disabled:e,onChange:t,label:r,busy:i}){return c.jsx("button",{type:"button",role:"switch","aria-checked":n,"aria-label":r,disabled:e||i,onClick:()=>t(!n),className:`relative inline-flex h-7 w-12 shrink-0 items-center rounded-full transition-colors duration-300 disabled:cursor-not-allowed disabled:opacity-50 ${n?"bg-[#cfff05] shadow-[0_0_18px_rgba(207,255,5,.45)]":"bg-white/10 ring-1 ring-white/15"}`,children:c.jsx("span",{className:`inline-block h-5 w-5 rounded-full shadow transition-transform duration-300 ease-[
5853cubic-bezier(.22,1,.36,1)] ${n?"translate-x-6 bg-[#05060a]":"translate-x-1 bg-white"} ${i?"animate-pulse":""}`})})}function Z5({value:n,options:e,onChange:t,label:r}){return c.jsx("div",{className:"inline-flex max-w-full flex-wrap gap-1 rounded-full bg-white/[0.04] p-1 ring-1 ring-white/[0.08]",role:"radiogroup","aria-label":r,children:e.map(i=>c.jsx("button",{type:"button",role:"radio","aria-checked":n===i.id,onClick:()=>t(i.id),className:`inline-flex items-center gap-1.5 rounded-full px-3.5 py-1.5 text-[13px] font-semibold transition-all duration-300 ${n===i.id?"bg-[var(--lp-lime)] text-black shadow-[0_0_18px_rgba(207,255,5,.3)]":"text-white/60 hover:text-white"}`,children:i.label},i.id))})}function uie({values:n,onChange:e,placeholder:t,max:r=20,maxLen:i=60,upper:s=!0}){const[a,o]=G.useState(""),l=d=>{const h=d.split(",").map(p=>p.trim()).filter(Boolean).map(p=>(s?p.toUpperCase():p).slice(0,i)),f=[...n];for(const p of h)!f.some(g=>g.toLowerCase()===p.toLowerCase())&&f.length<r&&f.push(p);e(f),o("")},u=d=>{(d.key==="Enter"||d.key===","||d.key==="Tab"&&a.trim())&&a.trim()?(d.preventDefault(),l(a)):d.key==="Backspace"&&!a&&n.length&&e(n.slice(0,-1))};return c.jsxs("div",{className:"flex min-h-[46px] flex-wrap items-center gap-1.5 rounded-[22px] border border-white/10 bg-white/[0.03] px-2.5 py-2 transition-colors focus-within:border-[rgba(207,255,5,.6)]",children:[n.map(d=>c.jsxs("span",{className:"ws-mono inline-flex items-center gap-1.5 rounded-full bg-[rgba(207,255,5,.12)] py-1 pl-2.5 pr-1.5 text-[12px] font-bold text-[#e9ffa1] ring-1 ring-[rgba(207,255,5,.3)]",children:[d,c.jsx("button",{type:"button",onClick:()=>e(n.filter(h=>h!==d)),className:"grid h-4 w-4 place-items-center rounded-full text-[#e9ffa1]/70 hover:bg-white/10 hover:text-white","aria-label":`Remove ${d}`,children:c.jsx(iw,{className:"h-2 w-2"})})]},d)),c.jsx("input",{value:a,onChange:d=>o(d.target.value),onKeyDown:u,onBlur:()=>a.trim()&&l(a),placeholder:n.length>=r?"":t,disabled:n.length>=r,className:"min-w-[120px] flex-1 border-0 bg-transparent p-1 text-sm text-white placeholder-white/30 shadow-none outline-none focus:border-0 focus:outline-none focus:ring-0"})]})}function lxe({open:n,onClose:e,title:t,subtitle:r,children:i,footer:s,wide:a=!1}){const{t:o}=Kr();return n?Vl.createPortal(c.jsx("div",{className:"ws inset-0 z-[100] flex items-end justify-end backdrop-blur-sm sm:items-stretch",style:{position:"fixed",background:"rgba(0,0,0,.65)"},onClick:e,children:c.jsxs("div",{className:`ws-glass flex max-h-[92vh] w-full flex-col overflow-hidden rounded-t-[28px] !bg-[#0a0c12]/95 sm:m-3 sm:max-h-none sm:rounded-[28px] ${a?"sm:max-w-3xl":"sm:max-w-xl"}`,style:{animation:"ws-enter .45s cubic-bezier(.22,1,.36,1) both"},onClick:l=>l.stopPropagation(),role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-white/[0.06] p-5 sm:p-6",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h3",{className:"ws-display text-xl font-bold text-white",children:t}),r&&c.jsx("p",{className:"ws-muted mt-1 text-sm",children:r})]}),c.jsx("button",{onClick:e,"aria-label":o("Close"),className:"grid h-9 w-9 shrink-0 place-items-center rounded-full bg-white/[0.05] text-white/70 hover:text-white",children:c.jsx(iw,{className:"h-3.5 w-3.5"})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-5 sm:p-6",children:i}),s&&c.jsx("div",{className:"border-t border-white/[0.06] p-4 sm:px-6",children:s})]})}),document.body):null}function Od({label:n,hint:e,children:t,right:r}){return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-end justify-between gap-3",children:[c.jsx("div",{className:"text-[13px] font-semibold text-white/85",children:n}),r]}),t,e&&c.jsx("div",{className:"ws-muted text-xs leading-relaxed",children:e})]})}function my({children:n}){return n?c.jsx("div",{className:"rounded-2xl border border-red-400/25 bg-red-500/10 px-4 py-3 text-sm text-red-200",children:n}):null}function WT(n,e,t){if(!n)return"";const r=(new Date(n).getTime()-Date.now())/1e3,i=Math.abs(r);if(i<45)return t("just now");const s=new Intl.RelativeTimeFormat(e,{numeric:"auto"});return i<3600?s.format(Math.round(r/60),"minute"):i<86400?s.format(Math.round(r/3600),"hour"):s.format(Math.round(r/86400),"day")}const XT=(n,e)=>{var t;return((t=n==null?void 0:n.data)==null?void 0:t.message)||(n==null?void 0:n.message)||e},L0t=[{id:"friendly",label:Le("Friendly"),sample:Le("So glad this helped! The full checklist is on our site, link in bio.")}
5853,{id:"professional",label:Le("Professional"),sample:Le("Thank you. Yes, it works with Shopify and WooCommerce. Send us a DM if you want a walkthrough.")},{id:"playful",label:Le("Playful"),sample:Le("Our coffee machine agrees with you. Round two drops Friday.")},{id:"short",label:Le("Short & sweet"),sample:Le("Glad you liked it!")}],O0t=[Le("Thanks {name}! Really glad you liked it."),Le("Appreciate you, {name}! More coming this week.")],D0t=(n,e)=>({accountId:n.id,platform:n.platform,enabled:!1,enabledAt:null,mode:"ai",tone:"friendly",instructions:"",templates:O0t.map(t=>e(t)),skipReplied:!0,skipLowSignal:!0,dailyCap:50,pausedReason:null,lastCheckedAt:null}),XN=n=>JSON.stringify([n.mode,n.tone,n.instructions,n.templates,n.skipReplied,n.skipLowSignal,n.dailyCap]);function j0t({account:n,rule:e,cost:t}){const{t:r,locale:i}=Kr();return n.authStatus!=="active"?c.jsx("span",{className:"text-amber-300",children:r("Login expired · reconnect this account in Channels")}):n.canComment?e!=null&&e.enabled?e.pausedReason==="credits"?c.jsx("span",{className:"text-amber-300",children:r("Paused · out of credits, resumes after a top-up")}):e.pausedReason==="permission"?c.jsx("span",{className:"text-amber-300",children:r("Paused · the network refused our reply. Reconnect the account, then switch this back on.")}):c.jsxs("span",{className:"inline-flex items-center gap-2 text-[#e9ffa1]",children:[c.jsx("span",{className:"ws-pulse-dot h-2 w-2 rounded-full bg-[var(--lp-lime)]"}),e.lastCheckedAt?r("Live · checked {when}",{when:WT(e.lastCheckedAt,i,r)}):r("Live · first check within 5 minutes")]}):c.jsx("span",{className:"text-white/45",children:r("Off · {cost} credits per reply when on",{cost:t})}):c.jsx("span",{className:"text-amber-300",children:r("No comment access · reconnect this account to allow replies")})}function I0t({account:n,rule:e,cost:t,onSaved:r,index:i}){var P;const{t:s}=Kr(),a=G.useMemo(()=>e||D0t(n,s),[e,n,s]),[o,l]=G.useState(a),[u,d]=G.useState(!!(e!=null&&e.enabled)),[h,f]=G.useState(null),[p,g]=G.useState(null),[A,x]=G.useState(0);G.useEffect(()=>{l(O=>XN(O)===XN(a)?a:{...O,enabled:a.enabled,pausedReason:a.pausedReason,lastCheckedAt:a.lastCheckedAt})},[a]);const b=XN(o)!==XN(a),_=n.authStatus!=="active"||!n.canComment,M=O=>l(F=>({...F,...O})),T=async(O,F)=>{f(F),g(null);try{await MSe({...o,templates:o.templates.filter(U=>U.trim()),accountId:n.id,enabled:O}),O&&d(!0),x(Date.now()),r()}catch(U){g(XT(U,s("Could not save. Try again.")))}finally{f(null)}},L=!!o.pausedReason,D=o.enabled&&!L;return c.jsxs("div",{className:`ws-enter rounded-[24px] border transition-colors duration-300 ${D?"border-[rgba(207,255,5,.28)] bg-[rgba(207,255,5,.03)]":"border-white/[0.08] bg-white/[0.02]"}`,style:{animationDelay:`${.05*i}s`},children:[c.jsxs("div",{className:"flex items-center gap-4 p-4 sm:p-5",children:[c.jsx(yP,{account:n}),c.jsxs("button",{type:"button",onClick:()=>d(O=>!O),className:"min-w-0 flex-1 text-left",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[c.jsx("span",{className:"truncate text-[15px] font-bold text-white",children:m8(n)}),c.jsxs("span",{className:"ws-mono text-[11px] text-white/40",children:[(P=axe[n.platform])==null?void 0:P.label," · ",s("{n} posts watched",{n:n.watchedPosts})]})]}),c.jsx("div",{className:"mt-1 text-[12.5px]",children:c.jsx(j0t,{account:n,rule:e?{...e,enabled:o.enabled}:null,cost:t})})]}),c.jsx("button",{type:"button",onClick:()=>d(O=>!O),className:"hidden h-9 w-9 place-items-center rounded-full text-white/50 hover:bg-white/[0.05] hover:text-white sm:grid","aria-label":s("Settings"),children:c.jsx(soe,{className:`h-4 w-4 transition-transform duration-300 ${u?"rotate-180":""}`})}),c.jsx(W6,{on:o.enabled&&!L,busy:h==="toggle",disabled:_&&!o.enabled,label:s("Auto-reply on {account}",{account:m8(n)}),onChange:O=>T(O,"toggle")})]}),p&&c.jsx("div",{className:"px-4 pb-4 sm:px-5",children:c.jsx(my,{children:p})}),u&&c.jsxs("div",{className:"space-y-6 border-t border-white/[0.06] p-4 sm:p-6",children:[c.jsx(Od,{label:s("How should replies be written?"),children:c.jsx(Z5,{label:s("Reply mode"),value:o.mode,onCh
5853ange:O=>M({mode:O}),options:[{id:"ai",label:c.jsxs(c.Fragment,{children:[c.jsx(j8,{className:"h-4 w-4"})," ",s("AI-written")]})},{id:"manual",label:c.jsxs(c.Fragment,{children:[c.jsx(ooe,{className:"h-4 w-4"})," ",s("My own replies")]})}]})}),o.mode==="ai"?c.jsxs(c.Fragment,{children:[c.jsx(Od,{label:s("Tone"),children:c.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:L0t.map(O=>c.jsxs("button",{type:"button",onClick:()=>M({tone:O.id}),"aria-pressed":o.tone===O.id,className:`rounded-2xl border p-3.5 text-left transition-all duration-300 ${o.tone===O.id?"border-[rgba(207,255,5,.45)] bg-[rgba(207,255,5,.06)]":"border-white/[0.08] bg-white/[0.02] hover:border-white/20"}`,children:[c.jsx("div",{className:`text-[13px] font-bold ${o.tone===O.id?"text-[#e9ffa1]":"text-white"}`,children:s(O.label)}),c.jsxs("div",{className:"ws-muted mt-1 text-[12px] italic leading-snug",children:["â",s(O.sample),"â"]})]},O.id))})}),c.jsx(Od,{label:s("Anything the AI should know?"),hint:s("The AI reads the post caption and the comment, answers in the commenter's language, and never invents prices, links or promises. Spam and abuse are left unanswered."),right:c.jsxs("span",{className:"ws-mono text-[11px] text-white/35",children:[o.instructions.length,"/600"]}),children:c.jsx("textarea",{rows:3,maxLength:600,value:o.instructions,onChange:O=>M({instructions:O.target.value}),className:sxe,placeholder:s('e.g. We ship to the EU only. Point pricing questions to the link in bio. Sign off as "Ana".')})})]}):c.jsx(Od,{label:s("Your replies"),hint:s("{name} becomes the commenter's name. Replies rotate so the same text never goes out twice in a row."),right:c.jsxs("span",{className:"ws-mono text-[11px] text-white/35",children:[o.templates.length,"/5"]}),children:c.jsxs("div",{className:"space-y-2",children:[o.templates.map((O,F)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:O,maxLength:500,className:p8,placeholder:s("Thanks {name}! Really glad you liked it."),onChange:U=>M({templates:o.templates.map((B,z)=>z===F?U.target.value:B)})}),c.jsx("button",{type:"button",onClick:()=>M({templates:o.templates.map((U,B)=>B===F?`${U.trimEnd()} {name}`.trim():U)}),className:`${Bm} shrink-0`,title:s("Insert the commenter's name"),children:"{name}"}),c.jsx("button",{type:"button",onClick:()=>M({templates:o.templates.filter((U,B)=>B!==F)}),className:"grid h-9 w-9 shrink-0 place-items-center rounded-full text-white/45 hover:bg-white/[0.06] hover:text-red-300","aria-label":s("Remove"),children:c.jsx(I8,{className:"h-4 w-4"})})]},F)),o.templates.length<5&&c.jsxs("button",{type:"button",onClick:()=>M({templates:[...o.templates,""]}),className:Bm,children:[c.jsx(rw,{className:"h-3.5 w-3.5"})," ",s("Add another reply")]})]})}),c.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[c.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-3 rounded-2xl border border-white/[0.08] bg-white/[0.02] p-3.5",children:[c.jsxs("span",{children:[c.jsx("span",{className:"block text-[13px] font-semibold text-white",children:s("Skip comments you already answered")}),c.jsx("span",{className:"ws-muted block text-[11.5px]",children:s("Including replies you wrote yourself")})]}),c.jsx(W6,{on:o.skipReplied,onChange:O=>M({skipReplied:O}),label:s("Skip comments you already answered")})]}),c.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-3 rounded-2xl border border-white/[0.08] bg-white/[0.02] p-3.5",children:[c.jsxs("span",{children:[c.jsx("span",{className:"block text-[13px] font-semibold text-white",children:s("Skip emoji-only comments")}),c.jsx("span",{className:"ws-muted block text-[11.5px]",children:s("And comments that only tag friends")})]}),c.jsx(W6,{on:o.skipLowSignal,onChange:O=>M({skipLowSignal:O}),label:s("Skip emoji-only comments")})]})]}),c.jsx(Od,{label:s("Daily limit"),hint:s("At most {credits} credits a day on this account.",{credits:o.dailyCap*t}),children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("input",{type:"number",min:1,max:500,value:o.dailyCap,className:`${p8} !w-28 text-center`,onChange:O=>M({dailyCap:Math.max(1,Math.min(500,Number(O.target.value)||1))})}),c.jsx("span",{className:"ws-muted text-sm",children:s("replies per day")})]})}),c.jsxs("div",{className:"flex flex-col-reverse items-stretch gap-3 border-t border-white/[0.06] pt-5 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx("p",{className:"ws-muted text-xs",children:s("Only comments written after you switch this on get a reply. {cost} credits each.",{cost:t})}),c.jsxs("div",{className:"flex items-center gap-2.5",children:[A>0&&!b&&Date.now()-A<4e3&&c.jsx("span",{className:"ws-mono text-[11px] text-[#e9ffa1]",children:s("Saved")}),o.enabled?c.jsx("button",{type:"button",disabled:!b||!!h,onClick:()=>T(!0,"save"),className:"ws-btn ws-btn-primary !h-11 !px-6 text-sm",children:s(h==="save"?"Savingâ¦":"Save changes")}
5853):c.jsx("button",{type:"button",disabled:!!h||_,onClick:()=>T(!0,"save"),className:"ws-btn ws-btn-primary !h-11 !px-6 text-sm",children:s(h==="save"?"Savingâ¦":"Save & switch on")})]})]})]})]})}function F0t({accounts:n,rules:e,cost:t,onChanged:r}){const{t:i}=Kr();return c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"ws-muted mb-5 max-w-2xl text-sm",children:i("Spread Out checks the posts it published for new comments every few minutes and replies as you. Works on Instagram, Facebook, LinkedIn and Threads.")}),n.map((s,a)=>c.jsx(I0t,{index:a,account:s,rule:e.find(o=>o.accountId===s.id)||null,cost:t,onSaved:r},s.id))]})}function U0t({accountId:n,value:e,onPick:t}){const{t:r}=Kr(),[i,s]=G.useState([]),[a,o]=G.useState(null),[l,u]=G.useState(!1),[d,h]=G.useState(null),f=async p=>{u(!0),h(null);try{const g=await kSe({accountId:n,after:p});s(A=>p?[...A,...g.posts]:g.posts),o(g.nextCursor)}catch(g){h(XT(g,r("Could not load your posts.")))}finally{u(!1)}};return G.useEffect(()=>{s([]),f()},[n]),c.jsxs("div",{className:"space-y-3",children:[c.jsx(my,{children:d}),c.jsxs("div",{className:"grid max-h-[300px] grid-cols-3 gap-2 overflow-y-auto pr-1 sm:grid-cols-4",children:[i.map(p=>c.jsxs("button",{type:"button",onClick:()=>t(p),title:p.caption||"",className:`group relative aspect-square overflow-hidden rounded-xl ring-2 transition-all ${e===p.id?"ring-[var(--lp-lime)]":"ring-transparent hover:ring-white/30"}`,children:[p.previewUrl?c.jsx("img",{src:p.previewUrl,alt:"",className:"h-full w-full object-cover",loading:"lazy"}):c.jsx("span",{className:"grid h-full w-full place-items-center bg-white/[0.05] p-2 text-[10px] text-white/50",children:(p.caption||"").slice(0,60)}),e===p.id&&c.jsx("span",{className:"absolute right-1.5 top-1.5 grid h-6 w-6 place-items-center rounded-full bg-[var(--lp-lime)] text-black",children:c.jsx(ioe,{className:"h-3.5 w-3.5"})})]},p.id)),l&&Array.from({length:i.length?4:8}).map((p,g)=>c.jsx("div",{className:"ws-skeleton aspect-square rounded-xl"},`s${g}`))]}),a&&!l&&c.jsx("button",{type:"button",onClick:()=>f(a),className:Bm,children:r("Load more posts")}),!l&&!i.length&&!d&&c.jsx("p",{className:"ws-muted text-sm",children:r("No posts found on this account yet.")})]})}function B0t({form:n,account:e}){const{t}=Kr(),r=e!=null&&e.username?`@${e.username}`:t("you"),i=n.keywords[0]||t("LINK");return c.jsxs("div",{className:"rounded-[24px] border border-white/[0.08] bg-[#05060a] p-4",children:[c.jsxs("div",{className:"ws-kicker mb-3 flex items-center gap-2",children:[c.jsx(Py,{className:"h-3.5 w-3.5"})," ",t("Preview")]}),c.jsxs("div",{className:"space-y-3 text-[13px]",children:[c.jsxs("div",{className:"flex gap-2.5",children:[c.jsx("span",{className:"h-7 w-7 shrink-0 rounded-full bg-gradient-to-br from-pink-400 to-amber-300"}),c.jsxs("div",{children:[c.jsx("b",{className:"text-white",children:"maria.lopes"})," ",c.jsx("span",{className:"text-white/80",children:t("Can you send me the {word}?",{word:i.toLowerCase()})})]})]}),n.replyPublicly&&n.publicReplies.some(s=>s.trim())&&c.jsxs("div",{className:"ml-9 flex gap-2.5",children:[e?c.jsx(yP,{account:e,size:24}):c.jsx("span",{className:"h-6 w-6 rounded-full bg-white/10"}),c.jsxs("div",{children:[c.jsx("b",{className:"text-white",children:r.replace(/^@/,"")})," ",c.jsxs("span",{className:"text-white/80",children:["@maria.lopes ",n.publicReplies.find(s=>s.trim())]})]})]}),c.jsxs("div",{className:"mt-4 border-t border-white/[0.06] pt-3",children:[c.jsx("div",{className:"ws-mono mb-2 text-[10.5px] uppercase tracking-widest text-white/35",children:t("Direct message")}),c.jsx("div",{className:"ml-auto w-fit max-w-[85%] whitespace-pre-wrap rounded-[18px] rounded-br-md bg-gradient-to-br from-[#7b5cff] to-[#d633c4] px-3.5 py-2.5 text-white",children:n.dmMessage.trim()||t("Your DM appears here.")})]})]})]})}const die=(n,e,t)=>({accountId:(n==null?void 0:n.accountId)||e,name:(n==null?void 0:n.name)||"",postScope:(n==null?void 0:n.trigger.postScope)||"any",platformPostId:(n==null?void 0:n.trigger.platformPostId)||"",postPermalink:(n==null?void 0:n.trigger.postPermalink)||"",keywords:(n==null?void 0:n.trigger.keywords)||[],matchMode:(n==null?void 0:n.trigger.matchMode)||"word",excludeKeywords:(n==null?void 0:n.trigger.excludeKeywords)||[],replyPublicly:n?n.actions.publicReplies.length>0:!0,publicReplies:n!=null&&n.actions.publicReplies.length?n.actions.publicReplies:[t("Sent you a DM ð©"),t("Check your DMs!")],dmMessage:(n==null?void 0:n.actions.dmMessage)||""});function V0t({open:n,onClose:e,automation:t,accounts:r,onSaved:i,cost:s}){const{t:a}=Kr(),[o,l]=G.useState(()=>{var F;return die(t,((F=r[0])==null?void 0:F.id)||"",a)}),[u,d]=G.useState([]),[h,f]=G.useState(!1),[p,g]=G.useState(!1),[A,x]=G.useState(null),[b,_]=G.useState(!1);G.useEffect(()=>{var U;if(!n)return;const F=die(t,((U=r[0])==null?void 0:U.id)||"",a);l(F),x(null),_(!!F.excludeKeywords.length||F.matchMode!=="word")},[n,t]);const M=async(F,U)=>{if(F){f(!0);try{d((await DSe({accountId:F,existing:U})).suggestions||[])}catch{d([])}finally{f(!1)}}};G.useEffect(()=>{n&&M(o.accountId,o.keywords)},[n,o.accountId]);const T=F=>l(U=>({...U,...F}
5853)),L=r.find(F=>F.id===o.accountId),D=u.filter(F=>!o.keywords.some(U=>U.toLowerCase()===F.toLowerCase())),P=s*(1+(o.replyPublicly&&o.publicReplies.some(F=>F.trim())?1:0)),O=async()=>{g(!0),x(null);try{await RSe({id:t==null?void 0:t.id,accountId:o.accountId,name:o.name||(o.keywords[0]?a("{word} â DM",{word:o.keywords[0]}):a("Every comment â DM")),postScope:o.postScope,platformPostId:o.postScope==="specific"?o.platformPostId:void 0,postPermalink:o.postScope==="specific"?o.postPermalink:void 0,keywords:o.keywords,matchMode:o.matchMode,excludeKeywords:o.excludeKeywords,publicReplies:o.replyPublicly?o.publicReplies.filter(F=>F.trim()):[],dmMessage:o.dmMessage}),i(),e()}catch(F){x(XT(F,a("Could not save the automation.")))}finally{g(!1)}};return c.jsx(lxe,{open:n,onClose:e,wide:!0,title:a(t?"Edit automation":"New keyword automation"),subtitle:a("When someone comments a trigger word, they get your DM automatically."),footer:c.jsxs("div",{className:"flex flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx("span",{className:"ws-mono text-[11px] text-white/45",children:a("{credits} credits per trigger",{credits:P})}),c.jsxs("div",{className:"flex gap-2.5",children:[c.jsx("button",{type:"button",onClick:e,className:"ws-btn ws-btn-ghost !h-11 !px-5 text-sm",children:a("Cancel")}),c.jsx("button",{type:"button",onClick:O,disabled:p||!o.dmMessage.trim()||o.postScope==="specific"&&!o.platformPostId,className:"ws-btn ws-btn-primary !h-11 !px-6 text-sm",children:a(p?"Savingâ¦":t?"Save changes":"Create automation")})]})]}),children:c.jsxs("div",{className:"grid gap-8 lg:grid-cols-[minmax(0,1fr)_260px]",children:[c.jsxs("div",{className:"space-y-7",children:[r.length>1&&!t&&c.jsx(Od,{label:a("Instagram account"),children:c.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(F=>c.jsxs("button",{type:"button",onClick:()=>T({accountId:F.id,platformPostId:"",postPermalink:""}),className:`flex items-center gap-2.5 rounded-full border py-1.5 pl-1.5 pr-4 text-sm font-semibold transition-colors ${o.accountId===F.id?"border-[rgba(207,255,5,.5)] bg-[rgba(207,255,5,.07)] text-white":"border-white/10 text-white/65 hover:text-white"}`,children:[c.jsx(yP,{account:F,size:28})," ",m8(F)]},F.id))})}),c.jsxs(Od,{label:c.jsxs(c.Fragment,{children:["1 · ",a("Trigger words")]}),hint:o.keywords.length?a("Press Enter after each word. Up to 20."):a("No words = every new comment triggers the DM."),children:[c.jsx(uie,{values:o.keywords,onChange:F=>T({keywords:F}),placeholder:a("Type a word like LINK and press Enter")}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[c.jsxs("span",{className:"ws-kicker mr-1 inline-flex items-center gap-1.5 !text-[10px]",children:[c.jsx(j8,{className:"h-3.5 w-3.5 text-[var(--lp-lime)]"})," ",a("Suggestions")]}),h&&!D.length&&Array.from({length:5}).map((F,U)=>c.jsx("span",{className:"ws-skeleton h-7 w-16 rounded-full"},U)),D.map(F=>c.jsxs("button",{type:"button",onClick:()=>T({keywords:[...o.keywords,F].slice(0,20)}),className:"ws-mono inline-flex h-7 items-center gap-1 rounded-full border border-dashed border-white/20 px-2.5 text-[11.5px] font-bold text-white/70 transition-colors hover:border-[rgba(207,255,5,.6)] hover:text-[#e9ffa1]",children:[c.jsx(rw,{className:"h-3 w-3"})," ",F]},F)),c.jsx("button",{type:"button",onClick:()=>M(o.accountId,o.keywords),disabled:h,className:"grid h-7 w-7 place-items-center rounded-full text-white/45 hover:bg-white/[0.06] hover:text-white","aria-label":a("More suggestions"),children:c.jsx(zTe,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`})})]})]}),c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>_(F=>!F),className:"inline-flex items-center gap-1.5 text-[13px] font-semibold text-white/60 hover:text-white",children:[c.jsx(soe,{className:`h-4 w-4 transition-transform ${b?"rotate-180":""}`})," ",a("Matching options")]}),b&&c.jsxs("div",{className:"mt-4 space-y-5 rounded-2xl border border-white/[0.06] bg-white/[0.015] p-4",children:[c.jsx(Od,{label:a("How words match"),hint:o.matchMode==="word"?a('"link" matches "send the link" but not "linked".'):o.matchMode==="contains"?a('"link" also matches "linked" and "linkedin".'):a("The whole comment must be exactly the word."),children:c.jsx(Z5,{label:a("How words match"),value:o.matchMode,onChange:F=>T({matchMode:F}),options:[{id:"word",label:a("Whole word")},{id:"contains",label:a("Contains")},{id:"exact",label:a("Exact comment")}]})}),c.jsx(Od,{label:a("Ignore comments containing"),hint:a('Useful for "unsubscribe", "stop" or competitor names.'),children:c.jsx(uie,{values:o.excludeKeywords,onChange:F=>T({excludeKeywords:F}),placeholder:a("Type a word and press Enter")})})]})]}),c.jsxs(Od,{label:c.jsxs(c.Fragment,{children:["2 · ",a("Which posts?")]}),children:[c.jsx(Z5,{label:a("Which posts?"),value:o.postScope,onCh
5853ange:F=>T({postScope:F}),options:[{id:"any",label:a("All my posts")},{id:"specific",label:a("One specific post")}]}),o.postScope==="specific"&&o.accountId&&c.jsx("div",{className:"mt-3",children:c.jsx(U0t,{accountId:o.accountId,value:o.platformPostId,onPick:F=>T({platformPostId:F.id,postPermalink:F.permalink||""})})})]}),c.jsx(Od,{label:c.jsxs(c.Fragment,{children:["3 · ",a("The DM they receive")]}),right:c.jsxs("span",{className:`ws-mono text-[11px] ${o.dmMessage.length>950?"text-amber-300":"text-white/35"}`,children:[o.dmMessage.length,"/1000"]}),hint:a("Put the link or whatever you promised right here. It goes out automatically when the comment matches."),children:c.jsx("textarea",{rows:4,maxLength:1e3,value:o.dmMessage,onChange:F=>T({dmMessage:F.target.value}),className:sxe,placeholder:a("Here's the guide you asked for: https://⦠Let me know what you think!")})}),c.jsx(Od,{label:c.jsxs(c.Fragment,{children:["4 · ",a("Public reply under the comment")]}),hint:o.replyPublicly?a("One is picked at random each time. It shows others the DM is real."):a("Only the DM is sent."),right:c.jsx("button",{type:"button",role:"switch","aria-checked":o.replyPublicly,onClick:()=>T({replyPublicly:!o.replyPublicly}),className:`ws-mono rounded-full px-2.5 py-1 text-[10.5px] font-bold uppercase tracking-widest ring-1 transition-colors ${o.replyPublicly?"bg-[rgba(207,255,5,.12)] text-[#e9ffa1] ring-[rgba(207,255,5,.3)]":"text-white/45 ring-white/15"}`,children:o.replyPublicly?a("On"):a("Off")}),children:o.replyPublicly&&c.jsxs("div",{className:"space-y-2",children:[o.publicReplies.map((F,U)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:F,maxLength:500,className:p8,placeholder:a("Sent you a DM ð©"),onChange:B=>T({publicReplies:o.publicReplies.map((z,H)=>H===U?B.target.value:z)})}),c.jsx("button",{type:"button",onClick:()=>T({publicReplies:o.publicReplies.filter((B,z)=>z!==U)}),className:"grid h-9 w-9 shrink-0 place-items-center rounded-full text-white/45 hover:bg-white/[0.06] hover:text-red-300","aria-label":a("Remove"),children:c.jsx(I8,{className:"h-4 w-4"})})]},U)),o.publicReplies.length<5&&c.jsxs("button",{type:"button",onClick:()=>T({publicReplies:[...o.publicReplies,""]}),className:Bm,children:[c.jsx(rw,{className:"h-3.5 w-3.5"})," ",a("Add a variation")]})]})}),c.jsx(Od,{label:a("Name"),hint:a("Only you see this."),children:c.jsx("input",{value:o.name,maxLength:100,onChange:F=>T({name:F.target.value}),className:p8,placeholder:o.keywords[0]?a("{word} â DM",{word:o.keywords[0]}):a("Every comment â DM")})}),c.jsx(my,{children:A})]}),c.jsxs("div",{className:"lg:sticky lg:top-0 lg:self-start",children:[c.jsx(B0t,{form:o,account:L}),c.jsx("p",{className:"ws-muted mt-3 text-xs leading-relaxed",children:a("Each trigger costs {cost} credits for the DM, plus {cost} for the public reply. Comments from your own account never trigger it.",{cost:s})})]})]})})}function z0t({automation:n,onClose:e}){const{t,locale:r}=Kr(),[i,s]=G.useState({id:null,logs:[],hasMore:!1,loading:!1,error:null}),a=async l=>{if(n){s(u=>({...u,id:n.id,loading:!0,error:null}));try{const u=await OSe({id:n.id,accountId:n.accountId,skip:l});s(d=>({id:n.id,logs:l?[...d.logs,...u.logs]:u.logs,hasMore:u.hasMore,loading:!1,error:null}))}catch(u){s(d=>({...d,loading:!1,error:XT(u,t("Could not load the log."))}))}}};G.useEffect(()=>{n&&a(0)},[n==null?void 0:n.id]);const o=(l,u)=>c.jsx("span",{className:`ws-mono rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${l?"bg-[rgba(207,255,5,.12)] text-[#e9ffa1]":"bg-white/[0.05] text-white/45"}`,children:u});return c.jsxs(lxe,{open:!!n,onClose:()=>{e(),s({id:null,logs:[],hasMore:!1,loading:!1,error:null})},title:t("Delivery log"),subtitle:n==null?void 0:n.name,children:[c.jsx(my,{children:i.error}),c.jsxs("div",{className:"space-y-2.5",children:[i.logs.map(l=>c.jsxs("div",{className:"rounded-2xl border border-white/[0.07] bg-white/[0.02] p-3.5",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"truncate text-[13px] font-bold text-white",children:l.commenterName||t("Someone")}),c.jsx("span",{className:"ws-mono shrink-0 text-[11px] text-white/40",children:WT(l.createdAt,r,t)})]}),c.jsxs("p",{className:"mt-1 text-[13px] text-white/70",children:["â",l.commentText,"â"]}),c.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[l.status==="running"?o(!1,t("Sendingâ¦")):o(l.privateReplySent,l.privateReplySent?t("DM sent"):t("DM not sent")),l.publicReplyStatus!=="skipped"&&o(l.publicReplyStatus==="sent",l.publicReplyStatus==="sent"?t("Replied publicly"):t("Public reply failed")),l.credits>0&&c.jsxs("span",{className:"ws-mono ml-auto text-[11px] text-white/50",children:["â",l.credits," ",t("credits")]})]}),l.error&&c.jsx("p",{className:"mt-2 text-xs text-red-300",children:l.error})]},l.id)),i.loading&&Array.from({length:3}).map((l,u)=>c.jsx("div",{className:"ws-skeleton h-24 rounded-2xl"},u)),!i.loading&&!i.logs.length&&!i.error&&c.jsx("p",{className:"ws-muted py-10 text-center text-sm",children:t("Nothing triggered yet. Comment a trigger word from another account to test it.")}),i.hasMore&&!i.loading&&c.jsx("button",{onClick:()=>a(i.logs.length),className:Bm,children:t("Load more")})]})]})}function G0t({automation:n,account:e,onEdit:t,onLog:r,onChanged:i,index:s}){const{t:a,locale:o}=Kr(),[l,u]=G.useState(!1),[d,h]=G.useState(!1),[f,p]=G.useState(null),g=n.status==="active",A=async x=>{u(!0),p(null);try{await x(),i()}catch(b){p(XT(b,a("Something went wrong. Try again.")))}finally{u(!1)}};return c.jsxs("div",{className:`ws-enter flex flex-col rounded-[24px] border p-5 transition-colors duration-300 ${g?"border-[rgba(207,255,5,.28)] bg-[rgba(207,255,5,.03)]":"border-white/[0.08] bg-white/[0.02]"}`,style:{animationDelay:`${.05*s}s`},children:[c.jsxs("div",{className:"flex items-start gap-3",children:[e&&c.jsx(yP,{account:e,size:36}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-[15px] font-bold text-white",children:n.name}),c.jsxs("div",{className:"ws-mono mt-0.5 truncate text-[11px] text-white/45",children:[e?m8(e):""," · ",n.trigger.postScope==="any"?a("All posts"):a("One post")]})]}),c.jsx(W6,{on:g,busy:l,label:a("Automation on"),onChange:x=>A(()=>PSe({id:n.id,accountId:n.accountId,status:x?"active":"paused"}))})]}),n.pausedReason==="credits"&&c.jsx("div",{className:"mt-3 rounded-xl bg-amber-400/10 px-3 py-2 text-xs text-amber-200",children:a("Paused: out of credits. Turns back on after a to
5853p-up.")}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-1.5",children:[n.trigger.keywords.length?n.trigger.keywords.slice(0,8).map(x=>c.jsx("span",{className:"ws-mono rounded-full bg-[rgba(207,255,5,.1)] px-2.5 py-1 text-[11px] font-bold text-[#e9ffa1] ring-1 ring-[rgba(207,255,5,.25)]",children:x},x)):c.jsx("span",{className:"ws-mono rounded-full bg-white/[0.05] px-2.5 py-1 text-[11px] text-white/60",children:a("Any comment")}),n.trigger.keywords.length>8&&c.jsxs("span",{className:"ws-mono px-1 py-1 text-[11px] text-white/45",children:["+",n.trigger.keywords.length-8]})]}),c.jsxs("div",{className:"mt-4 space-y-2 text-[13px]",children:[c.jsxs("div",{className:"flex gap-2 text-white/75",children:[c.jsx(aoe,{className:"mt-0.5 h-4 w-4 shrink-0 text-white/40"}),c.jsx("span",{className:"line-clamp-2",children:n.actions.dmMessage})]}),n.actions.publicReplies.length>0&&c.jsxs("div",{className:"flex gap-2 text-white/55",children:[c.jsx(noe,{className:"mt-0.5 h-4 w-4 shrink-0 text-white/35"}),c.jsx("span",{className:"truncate",children:n.actions.publicReplies.join(" · ")})]})]}),c.jsx("div",{className:"mt-5 grid grid-cols-3 gap-2 rounded-2xl bg-white/[0.025] p-3 text-center",children:[[a("Triggered"),n.stats.triggered],[a("Sent"),n.stats.succeeded],[a("Failed"),n.stats.failed]].map(([x,b])=>c.jsxs("div",{children:[c.jsx("div",{className:"ws-display text-lg font-bold tabular-nums text-white",children:b}),c.jsx("div",{className:"ws-mono text-[10px] uppercase tracking-wider text-white/40",children:x})]},String(x)))}),n.stats.lastError&&c.jsxs("p",{className:"mt-2 line-clamp-2 text-xs text-red-300/90",children:[a("Last error"),": ",n.stats.lastError]}),c.jsx(my,{children:f}),c.jsxs("div",{className:"mt-auto flex items-center gap-1.5 pt-4",children:[c.jsxs("button",{onClick:t,className:Bm,children:[c.jsx(ooe,{className:"h-3.5 w-3.5"})," ",a("Edit")]}),c.jsxs("button",{onClick:r,className:Bm,children:[c.jsx(YTe,{className:"h-3.5 w-3.5"})," ",a("Log")]}),c.jsx("span",{className:"ws-mono ml-auto mr-1 hidden text-[10.5px] text-white/35 sm:inline",children:n.stats.lastRunAt?WT(n.stats.lastRunAt,o,a):""}),d?c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("button",{onClick:()=>A(()=>LSe({id:n.id,accountId:n.accountId})),disabled:l,className:`${Bm} !border-red-400/40 !text-red-200`,children:a("Delete")}),c.jsx("button",{onClick:()=>h(!1),className:Bm,children:a("Keep")})]}):c.jsx("button",{onClick:()=>h(!0),className:"grid h-8 w-8 place-items-center rounded-full text-white/40 hover:bg-white/[0.06] hover:text-red-300","aria-label":a("Delete"),children:c.jsx(I8,{className:"h-4 w-4"})})]})]})}function q0t({accounts:n,automations:e,error:t,cost:r,onChanged:i}){const{t:s}=Kr(),a=n.filter(f=>f.platform==="instagram"),[o,l]=G.useState({open:!1,automation:null}),[u,d]=G.useState(null),h=a.filter(f=>f.authStatus==="active"&&f.canMessage);return a.length?c.jsxs("div",{children:[c.jsxs("div",{className:"mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx("p",{className:"ws-muted max-w-xl text-sm",children:s('Someone comments a word like "LINK" and gets your message in their DMs. Perfect for guides, discount codes and links. Instagram only.')}),c.jsxs("button",{onClick:()=>l({open:!0,automation:null}),disabled:!h.length,className:"ws-btn ws-btn-primary !h-11 shrink-0 !px-5 text-sm",children:[c.jsx(rw,{className:"h-4 w-4"})," ",s("New automation")]})]}),!h.length&&c.jsx("div",{className:"mb-5",children:c.jsx(my,{children:s("Your Instagram account has no message access yet. Reconnect it from Channels to allow DMs.")})}),t&&c.jsx("div",{className:"mb-5",children:c.jsx(my,{children:t})}),e.length?c.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.map((f,p)=>c.jsx(G0t,{index:p,automation:f,account:n.find(g=>g.id===f.accountId),onEdit:()=>l({open:!0,automation:f}),onLog:()=>d(f),onChanged:i},f.id))}):c.jsxs("div",{className:"ws-glass rounded-[28px] p-6 sm:p-10",children:[c.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:[{icon:c.jsx(HTe,{className:"h-5 w-5"}),title:s("They comment"),body:s("âLINK please!â on any post, or one you pick.")},{icon:c.jsx(noe,{className:"h-5 w-5"}),title:s("You reply publicly"),body:s("âSent you a DM ð©â shows others it works.")},{icon:c.jsx(qTe,{className:"h-5 w-5"}),title:s("The DM lands"),body:s("Your link, guide or code, sent instantly.")}].map((f,p)=>c.jsxs("div",{className:"rounded-2xl border border-white/[0.07] bg-white/[0.02] p-5",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-xl bg-[rgba(207,255,5,.1)] text-[var(--lp-lime)] ring-1 ring-[rgba(207,255,5,.25)]",children:f.icon}),c.jsxs("span",{className:"ws-mono text-[11px] text-white/35",children:["0",p+1]})]}),c.jsx("div",{className:"mt-4 font-bold text-white",children:f.title}),c.jsx("div",{className:"ws-muted mt-1 text-sm",children:f.body})]},p))}),c.jsx("div",{className:"mt-8 flex justify-center",children:c.jsxs("button",{onClick:()=>l({open:!0,automation:null}),disabled:!h.length,className:"ws-btn ws-btn-primary",children:[c.jsx("span",{className:"ws-shine"}),c.jsx(rw,{className:"h-4 w-4"})," ",s("Create your first automation")]})})]}),c.jsx(V0t,{open:o.open,automation:o.automation,accounts:o.automation?a:h,cost:r,onClose:()=>l({open:!1,automation:null}),onSaved:i}),c.jsx(z0t,{automation:u,onClose:()=>d(null)})]}):c.jsx(q5,{icon:c.jsx(Py,{}),title:s("Connect an Instagram account"),body:s("Keyword DMs work with Instagram Business and Creator accounts. Connect one from Channels in the sidebar.")})}function $0t({items:n}){const{t:e,locale:t}=Kr(),[r,i]=G.useState("all"),s=G.useMemo(()=>n.filter(o=>r==="all"?!0:r==="dms"?o.kind==="dm":r==="replies"?o.kind!=="dm":o.status!=="sent"),[n,r]),a=o=>o.kind==="dm"?e("DM"):o.kind==="automation_reply"?e("Keyword reply"):e("Auto-reply");return c.jsxs("div",{children:[c.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-1.5",children:e("Activity")}),c.jsx("h2",{className:"ws-display text-xl font-bold text-white sm:text-2xl",children:e("Every reply and DM, as it happens")})]}),c.jsx(Z5,{label:e("Filter activity"),value:r,onChange:i,options:[{id:"all",label:e("All")},{id:"replies",label:e("Replies")},{id:"dms",label:e("DMs")},{id:"issues",label:e("Issues")}]})]}),s.length?c.jsx("ul",{className:"divide-y divide-white/[0.05] overflow-hidden rounded-[24px] border border-white/[0.07] bg-white/[0.015]",children:s.map(o=>c.jsxs("li",{className:"flex gap-3.5 p-4 sm:p-5",children:[c.jsx(o
5853xe,{platform:o.platform,size:"md"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[c.jsx("span",{className:"text-[13.5px] font-bold text-white",children:o.commenterName||e("Someone")}),c.jsx("span",{className:`ws-mono rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${o.kind==="dm"?"bg-[#a78bfa]/15 text-[#c4b5fd]":"bg-white/[0.06] text-white/60"}`,children:a(o)}),o.status==="failed"&&c.jsx("span",{className:"ws-mono rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-300",children:e("Failed")}),o.status==="skipped"&&c.jsx("span",{className:"ws-mono rounded-full bg-white/[0.04] px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-white/40",children:e("Skipped")}),c.jsx("span",{className:"ws-mono ml-auto text-[11px] text-white/35",children:WT(o.createdAt,t,e)})]}),o.commentText&&c.jsxs("p",{className:"mt-1.5 line-clamp-2 text-[13px] text-white/60",children:["â",o.commentText,"â"]}),o.replyText&&c.jsx("p",{className:`mt-2 line-clamp-3 rounded-2xl rounded-tl-md px-3.5 py-2 text-[13px] ${o.status==="sent"?"bg-[rgba(207,255,5,.07)] text-[#f1ffc4]":"bg-white/[0.04] text-white/55"}`,children:o.replyText}),o.error&&o.status!=="sent"&&c.jsx("p",{className:"mt-1.5 text-xs text-white/45",children:e(o.error)}),c.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[o.credits>0&&c.jsxs("span",{className:"ws-mono text-[11px] text-white/45",children:["â",o.credits," ",e("credits")]}),o.postUrl&&c.jsxs("a",{href:o.postUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[11.5px] font-semibold text-white/50 hover:text-[#e9ffa1]",children:[e("View post")," ",c.jsx(GTe,{className:"h-3 w-3"})]})]})]})]},o.id))}):c.jsxs("div",{className:"rounded-[24px] border border-dashed border-white/10 px-6 py-12 text-center",children:[c.jsx(X4,{className:"mx-auto h-8 w-8 text-white/25"}),c.jsx("p",{className:"ws-muted mt-3 text-sm",children:n.length?e("Nothing here for this filter."):e("Replies and DMs show up here as soon as they go out.")})]})]})}function hie(){return c.jsxs(j1,{wide:!0,children:[c.jsx("div",{className:"ws-skeleton h-8 w-48 rounded-full"}),c.jsx("div",{className:"ws-skeleton mt-6 h-14 w-full max-w-xl rounded-2xl"}),c.jsx("div",{className:"mt-10 grid grid-cols-2 gap-3 lg:grid-cols-4",children:Array.from({length:4}).map((n,e)=>c.jsx("div",{className:"ws-skeleton h-28 rounded-[22px]"},e))}),c.jsx("div",{className:"ws-skeleton mt-8 h-72 rounded-[28px]"})]})}function H0t(){var g,A,x,b,_,M,T,L;const{t:n,locale:e}=Kr(),t=ro(),{data:r,isLoading:i,error:s,refetch:a}=Qr(M4e,void 0,{refetchInterval:3e4}),o=r,[l,u]=G.useState("replies"),d=G.useMemo(()=>[...((o==null?void 0:o.rules)||[]).filter(P=>P.enabled).map(P=>P.pausedReason),...((o==null?void 0:o.automations)||[]).map(P=>P.pausedReason)].includes("credits")?"credits":null,[o]);if(i)return c.jsx(pl,{children:c.jsx(hie,{})});if(s&&!o)return c.jsx(pl,{children:c.jsx(j1,{children:c.jsx(q5,{icon:c.jsx(iI,{className:"text-red-300"}),title:n("This page could not load"),body:s==null?void 0:s.message,action:c.jsx("button",{onClick:()=>a(),className:"ws-btn ws-btn-ghost",children:n("Try again")})})})});if(!o)return c.jsx(pl,{children:c.jsx(hie,{})});const h=o.costPerAction,f=o.rules.filter(D=>D.enabled&&!D.pausedReason).reduce((D,P)=>{var O;return D+(((O=o.accounts.find(F=>F.id===P.accountId))==null?void 0:O.watchedPosts)||0)},0),p=(((g=o.stats)==null?void 0:g.activeRules)||0)+(((A=o.stats)==null?void 0:A.activeAutomations)||0);return c.jsx(pl,{children:c.jsxs(j1,{wide:!0,children:[c.jsx(D_,{eyebrow:n("Comments & Directs"),title:n("Answer every comment,"),accent:n("even while you sleep."),subtitle:n("Auto-reply to comments on Instagram, Facebook, LinkedIn and Threads, and DM anyone who comments a trigger word on Instagram."),actions:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"ws-mono inline-flex items-center gap-2 rounded-full bg-white/[0.05] px-3.5 py-2 text-[11px] text-white/70 ring-1 ring-white/10",children:p?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"ws-pulse-dot h-2 w-2 rounded-full bg-[var(--lp-lime)]"}),f?n("Watching {n} posts",{n:f}):n("Live"),o.lastCheckedAt?` · ${WT(o.lastCheckedAt,e,n)}`:""]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-white/30"}),n("Nothing switched on yet")]})}),c.jsx("span",{className:"ws-mono inline-flex items-center gap-2 rounded-full bg-[rgba(207,255,5,.07)] px-3.5 py-2 text-[11px] text-[#e9ffa1] ring-1 ring-[rgba(207,255,5,.22)]",children:n("{cost} credits per reply or DM",{cost:h})})]})}
5853),d&&c.jsxs("div",{className:"ws-enter mt-8 flex flex-col gap-4 rounded-[24px] border border-amber-300/25 bg-amber-400/[0.07] p-5 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(iI,{className:"mt-0.5 h-5 w-5 shrink-0 text-amber-300"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-bold text-white",children:n("Paused: you are out of credits")}),c.jsx("div",{className:"ws-muted mt-0.5 text-sm",children:n("Replies and DMs stopped so nothing goes out unpaid. Everything switches back on by itself after you top up.")})]})]}),c.jsx("button",{onClick:()=>t("/pricing"),className:"ws-btn ws-btn-primary !h-11 shrink-0 !px-5 text-sm",children:n("Top up credits")})]}),!o.available||!o.accounts.length?c.jsx("div",{className:"mt-10",children:c.jsx(q5,{icon:c.jsx(X4,{}),title:n("Connect a social account first"),body:n("Comments & Directs works with Instagram, Facebook, LinkedIn and Threads accounts connected in Channels (left sidebar)."),action:c.jsx("button",{onClick:()=>t("/ai-automator"),className:"ws-btn ws-btn-primary",children:n("Go to Automate")})})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ws-stagger mt-10 grid grid-cols-2 gap-3 lg:grid-cols-4",children:[c.jsx(Um,{label:n("Replies · 7 days"),value:((x=o.stats)==null?void 0:x.replies)??0,highlight:(((b=o.stats)==null?void 0:b.replies)||0)>0}),c.jsx(Um,{label:n("DMs · 7 days"),value:((_=o.stats)==null?void 0:_.dms)??0}),c.jsx(Um,{label:n("Credits used · 7 days"),value:((M=o.stats)==null?void 0:M.credits)??0,foot:n("{n} left",{n:o.isAdmin?"â":o.credits})}),c.jsx(Um,{label:n("Running now"),value:p,foot:n("{r} auto-reply · {a} keyword",{r:((T=o.stats)==null?void 0:T.activeRules)||0,a:((L=o.stats)==null?void 0:L.activeAutomations)||0})})]}),c.jsxs(Fu,{className:"mt-8",delay:.1,children:[c.jsxs("div",{className:"mb-7 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx(Z5,{label:n("Section"),value:l,onChange:u,options:[{id:"replies",label:c.jsxs(c.Fragment,{children:[c.jsx(X4,{className:"h-4 w-4"})," ",n("Auto-replies")]})},{id:"dms",label:c.jsxs(c.Fragment,{children:[c.jsx(aoe,{className:"h-4 w-4"})," ",n("Keyword â DM")]})}]}),c.jsx("span",{className:"ws-mono text-[11px] text-white/40",children:n(l==="replies"?"Instagram · Facebook · LinkedIn · Threads":"Instagram only")})]}),l==="replies"?c.jsx(F0t,{accounts:o.accounts,rules:o.rules,cost:h,onChanged:()=>a()}):c.jsx(q0t,{accounts:o.accounts,automations:o.automations,error:o.automationsError,cost:h,onChanged:()=>a()})]}),c.jsx(Fu,{className:"mt-8",delay:.16,children:c.jsx($0t,{items:o.activity})})]})]})})}function W0t({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const cxe=G.forwardRef(W0t);function X0t({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const uxe=G.forwardRef(X0t);function Y0t({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}))}const Q0t=G.forwardRef(Y0t);function K0t({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"}))}const dxe=G.forwardRef(K0t);function Z0t({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.
5853123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"}))}const J0t=G.forwardRef(Z0t);function emt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const tmt=G.forwardRef(emt);function nmt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"}))}const rmt=G.forwardRef(nmt);function imt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const hxe=G.forwardRef(imt);function smt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const fie=G.forwardRef(smt);function amt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const omt=G.forwardRef(amt);function lmt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32
58530 0 1 12 3Z"}))}const cmt=G.forwardRef(lmt);function umt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"}))}const dmt=G.forwardRef(umt);function hmt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const fmt=G.forwardRef(hmt);function pmt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 18.75h-9m9 0a3 3 0 0 1 3 3h-15a3 3 0 0 1 3-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 0 1-.982-3.172M9.497 14.25a7.454 7.454 0 0 0 .981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 0 0 7.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 0 0 2.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 0 1 2.916.52 6.003 6.003 0 0 1-5.395 4.972m0 0a6.726 6.726 0 0 1-2.749 1.35m0 0a6.772 6.772 0 0 1-3.044 0"}))}const mmt=G.forwardRef(pmt);function gmt({title:n,titleId:e,...t},r){return G.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),n?G.createElement("title",{id:e},n):null,G.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const Amt=G.forwardRef(gmt),m1=(n,e="en-US")=>{const t=Number(n||0);return new Intl.NumberFormat(e,{notation:t>=1e4?"compact":"standard",maximumFractionDigits:1}).format(t)},c$=(n,e,t)=>{if(!n)return"";const r=new Date(n),i=new Date,s=Math.floor((i.getTime()-r.getTime())/1e3),a=new Intl.RelativeTimeFormat(e,{numeric:"auto",style:"short"});return s<60?t("Just now"):s<3600?a.format(-Math.floor(s/60),"minute"):s<86400?a.format(-Math.floor(s/3600),"hour"):s<604800?a.format(-Math.floor(s/86400),"day"):r.toLocaleDateString(e,{month:"short",day:"numeric",year:r.getFullYear()!==i.getFullYear()?"numeric":void 0})},bP={instagram:{Icon:Py,tint:"linear-gradient(135deg,#f58529,#dd2a7b 50%,#8134af)",name:"Instagram"},facebook:{Icon:zT,tint:"#1877f2",name:"Facebook"},"x.com":{Icon:D1,tint:"#111",name:"X"},twitter:{Icon:D1,tint:"#111",name:"X"},tiktok:{Icon:XR,tint:"linear-gradient(135deg,#25f4ee,#000 50%,#fe2c55)",name:"TikTok"},youtube:{Icon:YR,tint:"#ff0033",name:"YouTube"},linkedin:{Icon:GT,tint:"#0a66c2",name:"LinkedIn"},threads:{Icon:O_,tint:"#111",name:"Threads"},reddit:{Icon:Mit,tint:"#ff4500",name:"Reddit"}};function fxe({platform:n,size:e="md"}){const t=bP[(n||"").toLowerCase()],r=e==="sm"?"h-7 w-7 text-[13px] rounded-lg":"h-10 w-10 text-[17px] rounded-xl";if(!t)return c.jsx("span",{className:`grid ${r} place-items-center bg-white/10 text-white`,children:c.jsx(hxe,{className:"h-4 w-4"})});const{Icon:i,tint:s}=t;return c.jsx("span",{className:`grid ${r} shrink-0 place-items-center text-white ring-1 ring-white/10`,style:{background:s},children:c.jsx(i,{})})}const pie="border-0 bg-transparent p-0 text-[13px] font-semibold text-white shadow-none outline-none focus:border-0 focus:outline-none focus:ring-0",xmt=[{id:"recent",name:Le("Most recent")},{id:"views",name:Le("Most viewed")},{id:"likes",name:Le("Most liked")},{id:"comments",name:Le("Most commented")},{id:"shares",name:Le("Most shared")}];function vmt(n,e=1100){const[t,r]=G.useState(0),i=G.useRef(0);return G.useEffect(()=>{var d;const s=Number(n||0);if((d=window.matchMedia)!=null&&d.call(window,"(prefers-reduced-motion: reduce)").matches){r(s),i.current=s;return}const a=performance.now(),o=i.current;let l;const u=h=>{const f=Math.min(1,(h-a)/e),p=1-Math.pow(1-f,4);r(o+(s-o)*p),f<1?l=requestAnimationFrame(u):i.current=s};return l=requestAnimationFrame(u),()=>cancelAnimationFrame(l)},[n,e]),t}const mie=[{id:"all",name:Le("All time"),days:0},{id:"7",name:Le("7 days"),days:7},{id:"30",name:Le("30 days"),days:30},{id:"90",name:Le("90 days"),days:90}],O4=n=>String(n||"").toLowerCase().replace(/^twitter$/,"x.com"),u$=n=>n.views?(n.likes+n.comments+n.shares+(n.saves||0))/n.views*100:null;function gie(n){var i,s,a,o,l;const e={totalPosts:0,totalViews:0,totalLikes:0,totalComments:0,totalShares:0,totalSaves:0,totalEngagement:0},t={},r={};for(const u of n){e.totalPosts+=1,e.totalViews+=u.views||0,e.totalLikes+=u.likes||0,e.totalComments+=u.comments||0,e.totalShares+=u.shares||0,e.totalSaves+=u.saves||0,e.totalEngagement+=u.engagementCount||0;const d=(i=u.platforms)!=null&&i.length?u.platforms:[{platform:u.platform,metrics:u.metrics||{}}];for(const h of d){const f=O4(h.platform),p=d.length===1&&!((s=h.metrics)!=null&&s.views)&&!((a=h.metrics)!=null&&a.likes)?u:h.metrics||{},g=t[f]||(t[f]={platform:f,displayName:((o=bP[f])==null?void 0:o.name)||h.displayName||f,posts:0,views:0,engagements:0});g.posts+=1,g.views+=p.views||0,g.engagements+=(p.likes||0)+(p.comments||0)+(p.shares||0)+(p.saves||0)}if(u.workflowId){const h=r[l=u.workflowId]||(r[l]={id:u.workflowId,name:u.workflowName,type:u.workflowType,posts:0,totalViews:0,totalEngagements:0});h.posts+=1,h.totalViews+=u.views||0,h.totalEngagements+=u.engagementCount||0}}return{summary:e,platforms:Object.values(t),workflows:Object.values(r)}}function ymt(){const n=ro(),{data:e}=Ma(),{t,locale:r}=Kr(),[i,s]=G.useState("all"),[a,o]=G.useState("all"),[l,u]=G.useState("all"),[d,h]=G.useState("recent"),{data:f,isLoading:p,error:g,refetch:A}=Qr(DX,{limit:500});G.useEffect(()=>{if(!(f!=null&&f.syncing))return;const we=setInterval(()=>A(),4e3);return()=>clearInterval(we)},[f==null?void 0:f.syncing,A]);const x=cl(zSe),[b,_]=G.useState(!1),[M,T]=G.useState(null),[L,D]=G.useState(!1),P=
5853async()=>{try{_(!0),T(null),await x({force:!1}),await A()}catch(we){T((we==null?void 0:we.message)||t("Failed to unlock Post Analytics"))}finally{_(!1)}},O=async()=>{D(!0);try{await DX({limit:500,forceRefresh:!0}),await A()}finally{D(!1)}},F=(f==null?void 0:f.posts)||[],U=G.useMemo(()=>{const we=mie.find(ze=>ze.id===l),Ue=we!=null&&we.days?Date.now()-we.days*864e5:0;return F.filter(ze=>(i==="all"||(ze.platforms||[{platform:ze.platform}]).some(yt=>O4(yt.platform)===O4(i)))&&(a==="all"||ze.workflowId===a)&&(!Ue||new Date(ze.publishedAt).getTime()>=Ue))},[F,i,a,l]),B=G.useMemo(()=>[...U].sort((we,Ue)=>{switch(d){case"views":return(Ue.views||0)-(we.views||0);case"likes":return(Ue.likes||0)-(we.likes||0);case"comments":return(Ue.comments||0)-(we.comments||0);case"shares":return(Ue.shares||0)-(we.shares||0);default:return new Date(Ue.publishedAt).getTime()-new Date(we.publishedAt).getTime()}}),[U,d]),{summary:z,platforms:H,workflows:X}=G.useMemo(()=>gie(U),[U]),W=G.useMemo(()=>gie(F).workflows.sort((we,Ue)=>(we.name||"").localeCompare(Ue.name||"")),[F]),J=G.useMemo(()=>{const we=new Set;return F.forEach(Ue=>(Ue.platforms||[{platform:Ue.platform}]).forEach(ze=>we.add(O4(ze.platform)))),[...we].filter(Boolean)},[F]),ee=G.useMemo(()=>[...U].filter(we=>we.hasAnalytics).sort((we,Ue)=>(Ue.views||0)-(we.views||0)||(Ue.engagementCount||0)-(we.engagementCount||0))[0],[U]),ae=(e==null?void 0:e.credits)??0,le=(f==null?void 0:f.creditCost)||10,Z=(e==null?void 0:e.isAdmin)||ae>=le,Y=!p&&!!(f!=null&&f.isUnlockRequired)&&!(e!=null&&e.isAdmin),re=i!=="all"||a!=="all"||l!=="all",_e=()=>{s("all"),o("all"),u("all")};if(p)return c.jsx(pl,{children:c.jsx(Cmt,{})});if(Y)return c.jsx(pl,{children:c.jsx(Emt,{creditCost:le,userCredits:ae,hasEnoughCredits:Z,isUnlocking:b,unlockError:M,onUnlock:P,onTopUp:()=>n("/pricing"),onBack:()=>n("/ai-automator")})});if(g&&!f)return c.jsx(pl,{children:c.jsxs("div",{className:"mx-auto max-w-xl px-4 py-24 text-center ws-enter",children:[c.jsx("div",{className:"mx-auto grid h-16 w-16 place-items-center rounded-2xl bg-red-500/10 ring-1 ring-red-500/30",children:c.jsx(fie,{className:"h-8 w-8 text-red-400"})}),c.jsx("h2",{className:"ws-display mt-6 text-3xl font-bold text-white",children:t("Analytics could not load")}),c.jsx("p",{className:"ws-muted mt-3",children:g.message||t("An unexpected error occurred.")}),c.jsx("button",{onClick:()=>A(),className:"ws-btn ws-btn-ghost mt-8",children:t("Try again")})]})});const Ee=(f==null?void 0:f.syncing)||L,Ae=!!(f!=null&&f.lastSyncedAt)&&Date.now()-new Date(f.lastSyncedAt).getTime()<600*1e3,te=u$({views:z.totalViews,likes:z.totalLikes,comments:z.totalComments,shares:z.totalShares,saves:z.totalSaves}),ve=F.length>0&&!F.some(we=>we.hasAnalytics);return c.jsx(pl,{children:c.jsx("div",{className:"relative z-10 px-4 pb-24 pt-10 sm:px-6 lg:px-8 lg:pt-16",children:c.jsxs("div",{className:"mx-auto max-w-6xl",children:[c.jsxs("header",{className:"ws-enter flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between",children:[c.jsxs("div",{children:[c.jsxs("span",{className:"ws-mono inline-flex items-center gap-2 rounded-full border border-[rgba(207,255,5,.22)] bg-[rgba(207,255,5,.07)] py-1.5 pl-1.5 pr-3.5 text-[11px] uppercase tracking-[0.14em] text-[#e9ffa1]",children:[c.jsx("b",{className:"rounded-full bg-[var(--lp-lime)] px-2 py-0.5 text-black",children:t("PRO")}),t("Post analytics")]}),c.jsxs("h1",{className:"ws-display mt-5 text-4xl font-bold leading-[1.02] text-white sm:text-5xl",children:[t("How your posts")," ",c.jsx("span",{className:"ws-gradient-text",children:t("are performing.")})]}),c.jsx("p",{className:"ws-muted mt-3 max-w-xl text-base sm:text-lg",children:t("Every post SpreadOut published, with live reach and engagement from each network.")})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[c.jsx("span",{className:"ws-mono inline-flex items-center gap-2 rounded-full bg-white/[0.05] px-3.5 py-2 text-[11px] text-white/70 ring-1 ring-white/10",children:Ee?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-white/20 border-t-[var(--lp-lime)]"})," ",t("Updating numbersâ¦")]}):f!=null&&f.lastSyncedAt?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"ws-pulse-dot h-2 w-2 rounded-full bg-[var(--lp-lime)]"})," ",t("Updated {when}",{when:c$(f.lastSyncedAt,r,t)})]}):c.jsxs(c.Fragment,{children:[c.jsx(tmt,{className:"h-3.5 w-3.5"})," ",t("Not synced yet")]})}),c.jsxs("button",{onClick:O,disabled:Ee||Ae,className:"ws-btn ws-btn-ghost !h-11 !px-5 text-sm",title:t(Ae?"Numbers were refreshed less than 10 minutes ago":"Pull the latest metrics from every network"),children:[c.jsx(cxe,{className:`h-4 w-4 ${Ee?"animate-spin":""}`}),t("Refresh")]})]})]}),c.jsx("div",{className:"ws-glass ws-enter z-30 mt-10 rounded-[24px] !bg-[#0a0c12]/90 p-2.5 lg:sticky lg:top-3",style:{animationDelay:".08s"},children:c.jsxs("div",{className:"flex flex-col gap-2.5 lg:flex-row lg:items-center",children:[c.jsx("div",{className:"grid grid-cols-4 roun
5853ded-full bg-white/[0.04] p-1 ring-1 ring-white/[0.08] lg:w-[340px]",role:"radiogroup","aria-label":t("Period"),children:mie.map(we=>c.jsx("button",{role:"radio","aria-checked":l===we.id,onClick:()=>u(we.id),className:`rounded-full py-2 text-[12px] font-bold transition-all ${l===we.id?"bg-[var(--lp-lime)] text-black":"text-white/60 hover:text-white"}`,children:t(we.name)},we.id))}),c.jsx("div",{className:"-mx-1 flex flex-1 gap-1 overflow-x-auto px-1 [scrollbar-width:none]",children:["all",...J].map(we=>{const Ue=i===we,ze=bP[we];return c.jsxs("button",{onClick:()=>s(we),className:`flex shrink-0 items-center gap-2 rounded-full px-3.5 py-2 text-[13px] font-semibold transition-all duration-300 ${Ue?"bg-white text-black":"text-white/60 hover:bg-white/[0.06] hover:text-white"}`,children:[ze&&c.jsx(ze.Icon,{className:"h-3.5 w-3.5"}),we==="all"?t("All platforms"):(ze==null?void 0:ze.name)||we]},we)})}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[W.length>1&&c.jsx(Aie,{icon:cmt,label:t("Workflow"),children:c.jsxs("select",{value:a,onChange:we=>o(we.target.value),className:`${pie} max-w-[180px] truncate pr-7`,children:[c.jsx("option",{value:"all",children:t("All workflows")}),W.map(we=>c.jsx("option",{value:we.id,children:we.name},we.id))]})}),c.jsx(Aie,{icon:Q0t,label:t("Sort by"),children:c.jsx("select",{value:d,onChange:we=>h(we.target.value),className:`${pie} pr-7`,children:xmt.map(we=>c.jsx("option",{value:we.id,children:t(we.name)},we.id))})}),re&&c.jsxs("button",{onClick:_e,className:"flex h-10 items-center gap-1.5 rounded-full px-3 text-[13px] font-semibold text-white/60 transition-colors hover:bg-white/[0.06] hover:text-white",children:[c.jsx(Amt,{className:"h-4 w-4"})," ",t("Clear")]})]})]})}),(f==null?void 0:f.apiError)&&!Ee&&c.jsxs("div",{className:"ws-enter mt-5 flex items-center gap-3 rounded-2xl border border-amber-400/25 bg-amber-400/[0.07] px-5 py-3.5 text-sm text-amber-200",children:[c.jsx(fie,{className:"h-5 w-5 shrink-0 text-amber-400"}),t("Live analytics are temporarily unavailable, showing the latest cached data.")]}),ve&&c.jsxs("div",{className:"ws-enter mt-5 flex items-center gap-3 rounded-2xl border border-white/10 bg-white/[0.03] px-5 py-3.5 text-sm text-white/70",children:[c.jsx("span",{className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-white/15 border-t-[var(--lp-lime)]"}),t("Collecting numbers from your networks. The first sync can take a couple of minutes; this page updates by itself.")]}),U.length===0?c.jsx(Tmt,{filtersActive:re,onClear:_e,onCreate:()=>n("/ai-automator")}):c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"ws-stagger mt-8 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",children:[c.jsx(Q2,{label:t("Views"),value:z.totalViews,icon:omt}),c.jsx(Q2,{label:t("Likes"),value:z.totalLikes,icon:dmt}),c.jsx(Q2,{label:t("Comments"),value:z.totalComments,icon:J0t}),c.jsx(Q2,{label:t("Shares"),value:z.totalShares,icon:fmt}),c.jsx(Q2,{label:t("Posts"),value:z.totalPosts,icon:hxe}),c.jsx(Q2,{label:t("Engagements"),value:z.totalEngagement,icon:rmt,highlight:!0,foot:te!==null?t("{rate}% of views",{rate:te.toLocaleString(r,{maximumFractionDigits:1})}):null})]}),c.jsxs("section",{className:"mt-6 grid gap-6 lg:grid-cols-2",children:[ee?c.jsx(bmt,{post:ee}):null,H.length>0&&c.jsx(_mt,{platforms:H,onPick:s,active:i})]}),X.length>1&&c.jsx("div",{className:"mt-6",children:c.jsx(Smt,{workflows:X,onPick:o,active:a})}),c.jsxs("section",{className:"mt-12",children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-1.5",children:t("Published")}),c.jsx("h2",{className:"ws-display text-2xl font-bold text-white sm:text-3xl",children:t("Your posts")})]}),c.jsx("span",{className:"ws-mono text-xs text-white/45",children:B.length===1?t("1 post"):t("{n} posts",{n:B.length})})]}),c.jsxs("div",{className:"ws-glass overflow-hidden rounded-[24px]",children:[c.jsxs("div",{className:"ws-mono hidden grid-cols-[minmax(0,1fr)_repeat(4,76px)_72px_44px] gap-2 border-b border-white/[0.06] px-5 py-3 text-[10px] uppercase tracking-[0.16em] text-white/40 lg:grid",children:[c.jsx("span",{children:t("Post")}),c.jsx("span",{className:"text-right",children:t("Views")}),c.jsx("span",{className:"text-right",children:t("Likes")}),c.jsx("span",{className:"text-right",children:t("Comments")}),c.jsx("span",{className:"text-right",children:t("Shares")}
5853),c.jsx("span",{className:"text-right",children:t("Eng.")}),c.jsx("span",{})]}),c.jsx("ul",{children:B.map(we=>c.jsx(wmt,{post:we},we.dbPostId))})]})]})]})]})})})}function Aie({icon:n,label:e,children:t}){return c.jsxs("label",{className:"flex h-10 items-center gap-2 rounded-full bg-white/[0.04] px-3.5 ring-1 ring-white/[0.08] transition-colors focus-within:ring-[rgba(207,255,5,.5)] hover:bg-white/[0.06]",title:e,children:[c.jsx(n,{className:"h-4 w-4 shrink-0 text-white/40"}),c.jsx("span",{className:"sr-only",children:e}),t]})}function pxe({post:n}){var t;const e=(t=n.platforms)!=null&&t.length?n.platforms:[{platform:n.platform}];return c.jsx("div",{className:"flex -space-x-2",children:e.slice(0,3).map((r,i)=>c.jsx("span",{className:"rounded-lg ring-2 ring-[#0b0d12]",children:c.jsx(fxe,{platform:O4(r.platform),size:"sm"})},i))})}function bmt({post:n}){const{t:e,locale:t}=Kr(),r=u$(n);return c.jsxs("div",{className:"ws-glass ws-enter relative overflow-hidden rounded-[28px] p-6 sm:p-7",style:{animationDelay:".1s"},children:[c.jsx("div",{className:"pointer-events-none absolute -right-16 -top-20 h-56 w-56 rounded-full bg-[rgba(207,255,5,.1)] blur-3xl","aria-hidden":!0}),c.jsxs("div",{className:"relative flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"ws-kicker mb-1.5",children:e("Top post")}),c.jsx("h3",{className:"ws-display text-xl font-bold text-white",children:e("Your best performer")})]}),c.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-xl bg-[var(--lp-lime)] text-black",children:c.jsx(mmt,{className:"h-5 w-5"})})]}),c.jsxs("div",{className:"relative mt-5 flex items-center gap-3",children:[c.jsx(pxe,{post:n}),c.jsxs("span",{className:"ws-mono text-[11px] text-white/50",children:[c$(n.publishedAt,t,e),n.workflowName?` · ${n.workflowName}`:""]})]}),c.jsx("p",{className:"relative mt-3 line-clamp-3 whitespace-pre-wrap text-sm leading-relaxed text-white/80",children:n.content||e("No caption")}),c.jsx("div",{className:"relative mt-5 grid grid-cols-4 gap-2",children:[[e("Views"),n.views],[e("Likes"),n.likes],[e("Comments"),n.comments],[e("Shares"),n.shares]].map(([i,s])=>c.jsxs("div",{className:"rounded-2xl bg-white/[0.04] px-3 py-3 ring-1 ring-white/[0.06]",children:[c.jsx("div",{className:"ws-display text-xl font-bold tabular-nums text-white",children:m1(s,t)}),c.jsx("div",{className:"mt-0.5 text-[11px] text-white/50",children:i})]},i))}),c.jsxs("div",{className:"relative mt-4 flex items-center justify-between gap-3",children:[r!==null?c.jsx("span",{className:"ws-mono text-xs text-[var(--lp-lime)]",children:e("{rate}% of views",{rate:r.toLocaleString(t,{maximumFractionDigits:1})})}):c.jsx("span",{}),n.postUrl&&c.jsxs("a",{href:n.postUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-bold text-[var(--lp-lime)] hover:underline",children:[e("Open the post")," ",c.jsx(uxe,{className:"h-4 w-4"})]})]})]})}function wmt({post:n}){const{t:e,locale:t}=Kr(),r=u$(n),i=s=>c.jsx("span",{className:`text-sm tabular-nums lg:text-right ${s?"font-semibold text-white":"text-white/30"}`,children:m1(s,t)});return c.jsx("li",{className:"border-b border-white/[0.06] px-5 py-4 transition-colors last:border-0 hover:bg-white/[0.02]",children:c.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-3 lg:grid-cols-[minmax(0,1fr)_repeat(4,76px)_72px_44px] lg:gap-2",children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[c.jsx(pxe,{post:n}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-white/85",children:n.content||c.jsx("span",{className:"italic text-white/35",children:e("No caption")})}),c.jsxs("div",{className:"ws-mono mt-1 flex flex-wrap items-center gap-x-2 text-[11px] text-white/45",children:[c.jsx("span",{title:n.publishedAt?new Date(n.publishedAt).toLocaleString(t):"",children:c$(n.publishedAt,t,e)}),n.workflowName&&c.jsxs("span",{className:"max-w-[220px] truncate",children:["· ",n.workflowName]}),!n.hasAnalytics&&c.jsxs("span",{className:"text-amber-300/90",children:["· ",e("Stats coming in")]})]})]})]}),n.postUrl?c.jsx("a",{href:n.postUrl,target:"_blank",rel:"noopener noreferrer",title:e("Open the post"),className:"order-none grid h-9 w-9 place-items-center rounded-full text-white/45 transition-colors hover:bg-white/[0.06] hover:text-[var(--lp-lime)] lg:order-last lg:justify-self-end",children:c.jsx(uxe,{className:"h-4 w-4"})}):c.jsx("span",{className:"lg:order-last"}
5853),c.jsxs("div",{className:"col-span-2 grid grid-cols-5 gap-2 rounded-xl bg-black/20 px-3 py-2 lg:col-span-1 lg:contents lg:bg-transparent lg:p-0",children:[[[e("Views"),n.views],[e("Likes"),n.likes],[e("Comments"),n.comments],[e("Shares"),n.shares]].map(([s,a])=>c.jsxs("div",{className:"flex flex-col lg:block lg:text-right",children:[c.jsx("span",{className:"text-[10px] text-white/40 lg:hidden",children:s}),i(a)]},s)),c.jsxs("div",{className:"flex flex-col lg:block lg:text-right",children:[c.jsx("span",{className:"text-[10px] text-white/40 lg:hidden",children:e("Eng.")}),c.jsx("span",{className:`text-sm tabular-nums lg:text-right ${r?"font-semibold text-[var(--lp-lime)]":"text-white/30"}`,children:r!==null?`${r.toLocaleString(t,{maximumFractionDigits:1})}%`:"â"})]})]})]})})}function Q2({label:n,value:e,icon:t,highlight:r=!1,foot:i=null}){const{locale:s}=Kr(),a=vmt(e);return c.jsxs("div",{className:`group relative overflow-hidden rounded-[22px] border p-5 transition-all duration-300 hover:-translate-y-0.5 ${r?"border-[rgba(207,255,5,.35)] bg-[rgba(207,255,5,.06)] shadow-[0_24px_60px_-30px_rgba(207,255,5,.6)]":"border-white/[0.08] bg-white/[0.028] hover:border-white/15"}`,children:[r&&c.jsx("div",{className:"pointer-events-none absolute -right-10 -top-10 h-28 w-28 rounded-full bg-[rgba(207,255,5,.25)] blur-2xl","aria-hidden":!0}),c.jsxs("div",{className:"relative flex items-center justify-between",children:[c.jsx("span",{className:`text-[13px] font-semibold ${r?"text-[#e9ffa1]":"text-white/55"}`,children:n}),c.jsx("span",{className:`grid h-8 w-8 place-items-center rounded-lg ${r?"bg-[var(--lp-lime)] text-black":"bg-white/[0.05] text-white/50 group-hover:text-white"}`,children:c.jsx(t,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"ws-display relative mt-4 text-3xl font-bold tabular-nums text-white",children:m1(Math.round(a),s)}),i&&c.jsx("div",{className:"ws-mono relative mt-1 text-[11px] text-[var(--lp-lime)]",children:i})]})}function _mt({platforms:n,onPick:e,active:t}){const{t:r,locale:i}=Kr(),s=[...n].sort((u,d)=>(d.engagements||0)-(u.engagements||0)),a=Math.max(1,...s.map(u=>u.engagements||0)),[o,l]=G.useState(!1);return G.useEffect(()=>{const u=requestAnimationFrame(()=>l(!0));return()=>cancelAnimationFrame(u)},[]),c.jsxs("div",{className:"ws-glass ws-enter rounded-[28px] p-6 sm:p-7",style:{animationDelay:".12s"},children:[c.jsx("div",{className:"ws-kicker mb-1.5",children:r("By network")}),c.jsx("h3",{className:"ws-display text-xl font-bold text-white",children:r("Where engagement comes from")}),c.jsx("ul",{className:"mt-6 space-y-4",children:s.map((u,d)=>{var p;const h=(u.platform||"").toLowerCase(),f=t===h;return c.jsx("li",{children:c.jsxs("button",{onClick:()=>e(f?"all":h),className:"group w-full text-left",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(fxe,{platform:u.platform,size:"sm"}),c.jsx("span",{className:`flex-1 truncate text-sm font-semibold ${f?"text-[var(--lp-lime)]":"text-white/85 group-hover:text-white"}`,children:u.displayName||((p=bP[h])==null?void 0:p.name)||u.platform}),c.jsx("span",{className:"ws-mono text-xs text-white/45",children:u.posts===1?r("1 post"):r("{n} posts",{n:m1(u.posts,i)})}),c.jsx("span",{className:"ws-display w-16 text-right text-sm font-bold tabular-nums text-white",children:m1(u.engagements,i)})]}),c.jsx("div",{className:"mt-2 h-1.5 overflow-hidden rounded-full bg-white/[0.06]",children:c.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-[#cfff05] via-[#7cf7c4] to-[#22d3ee] transition-[width] duration-1000 ease-[cubic-bezier(.22,1,.36,1)]",style:{width:o?`${Math.max(2,(u.engagements||0)/a*100)}%`:"0%",transitionDelay:`${d*80}ms`}})})]})},u.platform)})})]})}function Smt({workflows:n,onPick:e,active:t}){const{t:r,locale:i}=Kr(),s=[...n].sort((a,o)=>(o.totalEngagements||0)-(a.totalEngagements||0)).slice(0,5);return c.jsxs("div",{className:"ws-glass ws-enter overflow-hidden rounded-[28px]",style:{animationDelay:".18s"},children:[c.jsxs("div",{className:"px-6 pt-6 sm:px-7 sm:pt-7",children:[c.jsx("div",{className:"ws-kicker mb-1.5",children:r("Leaderboard")}),c.jsx("h3",{className:"ws-display text-xl font-bold text-white",children:r("Top workflows")})]}),c.jsx("div",{className:"mt-4 overflow-x-auto",children:c.jsxs("table",{className:"w-full min-w-[440px] text-left",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"ws-mono text-[10px] uppercase tracking-[0.18em] text-white/40",children:[c.jsx("th",{className:"px-6 py-2.5 font-medium sm:px-7",children:r("Workflow")}),c.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:r("Posts")}),c.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:r("
5853Views")}),c.jsx("th",{className:"px-6 py-2.5 text-right font-medium sm:px-7",children:r("Engagements")})]})}),c.jsx("tbody",{children:s.map((a,o)=>{const l=t===a.id;return c.jsxs("tr",{onClick:()=>e(l?"all":a.id),className:`cursor-pointer border-t border-white/[0.06] transition-colors ${l?"bg-[rgba(207,255,5,.06)]":"hover:bg-white/[0.03]"}`,title:r(l?"Show all workflows":"Show only this workflow"),children:[c.jsx("td",{className:"px-6 py-3.5 sm:px-7",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:`ws-mono grid h-7 w-7 shrink-0 place-items-center rounded-full text-[11px] font-bold ${o===0?"bg-[var(--lp-lime)] text-black":"bg-white/[0.06] text-white/60"}`,children:o+1}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"max-w-[220px] truncate text-sm font-semibold text-white",children:a.name}),a.type&&c.jsx("div",{className:"ws-mono mt-0.5 text-[10px] uppercase tracking-wider text-white/40",children:a.type})]})]})}),c.jsx("td",{className:"px-3 py-3.5 text-right text-sm tabular-nums text-white/60",children:m1(a.posts,i)}),c.jsx("td",{className:"px-3 py-3.5 text-right text-sm tabular-nums text-white/60",children:m1(a.totalViews,i)}),c.jsx("td",{className:"px-6 py-3.5 text-right text-sm font-bold tabular-nums text-white sm:px-7",children:m1(a.totalEngagements,i)})]},a.id)})})]})})]})}function Tmt({filtersActive:n,onClear:e,onCreate:t}){const r=hi();return c.jsxs("div",{className:"ws-glass ws-enter relative mt-8 overflow-hidden rounded-[28px] px-6 py-16 text-center sm:py-20",children:[c.jsx("div",{className:"pointer-events-none absolute -top-32 left-1/2 h-64 w-[30rem] -translate-x-1/2 rounded-full bg-[rgba(207,255,5,.1)] blur-3xl","aria-hidden":!0}),c.jsxs("div",{className:"relative mx-auto h-20 w-20",children:[c.jsx("div",{className:"ws-orbit absolute inset-0 rounded-full border border-dashed border-[rgba(207,255,5,.45)]"}),c.jsx("div",{className:"absolute inset-3 grid place-items-center rounded-full bg-white/[0.05] ring-1 ring-white/10",children:c.jsx(dxe,{className:"h-7 w-7 text-[var(--lp-lime)]"})})]}),c.jsx("h3",{className:"ws-display relative mt-6 text-2xl font-bold text-white sm:text-3xl",children:r(n?"No posts match these filters":"No published posts yet")}),c.jsx("p",{className:"ws-muted relative mx-auto mt-3 max-w-md",children:r(n?"Try another network, workflow or date range.":"Once SpreadOut publishes your first post, its views, likes and comments show up here.")}),c.jsx("div",{className:"relative mt-8 flex justify-center gap-3",children:n?c.jsx("button",{onClick:e,className:"ws-btn ws-btn-ghost",children:r("Clear filters")}):c.jsxs("button",{onClick:t,className:"ws-btn ws-btn-primary",children:[c.jsx("span",{className:"ws-shine"}),r("Plan my first week")," â"]})})]})}function yj({label:n,value:e,tone:t="text-white"}){return c.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] py-3 last:border-0",children:[c.jsx("span",{className:"text-sm text-white/60",children:n}),c.jsx("span",{className:`ws-display text-base font-bold tabular-nums ${t}`,children:e})]})}function Emt({creditCost:n,userCredits:e,hasEnoughCredits:t,isUnlocking:r,unlockError:i,onUnlock:s,onTopUp:a,onBack:o}){const{t:l,locale:u}=Kr(),d=Math.max(0,e-n),h=f=>l("{n} credits",{n:Number(f).toLocaleString(u)});return c.jsx("div",{className:"relative z-10 flex min-h-[calc(100dvh-65px)] items-center justify-center px-4 py-12",children:c.jsxs("div",{className:"ws-glass ws-enter relative w-full max-w-xl overflow-hidden rounded-[32px] p-7 text-center sm:p-10",children:[c.jsx("div",{className:"pointer-events-none absolute -top-40 left-1/2 h-80 w-[34rem] -translate-x-1/2 rounded-full bg-[rgba(207,255,5,.14)] blur-3xl","aria-hidden":!0}),c.jsxs("div",{className:"relative mx-auto h-24 w-24",children:[c.jsx("div",{className:"ws-orbit absolute inset-0 rounded-full border border-dashed border-[rgba(207,255,5,.45)]"}),c.jsx("div",{className:"ws-orbit rev absolute inset-2.5 rounded-full border border-white/10",children:c.jsx("span",{className:"absolute -top-1 left-1/2 h-2 w-2 -translate-x-1/2 roun
5853ded-full bg-[var(--lp-cyan)] shadow-[0_0_10px_rgba(34,211,238,.9)]"})}),c.jsx("div",{className:"absolute inset-6 grid place-items-center rounded-full bg-[var(--lp-lime)] text-black shadow-[0_0_40px_rgba(207,255,5,.5)]",children:c.jsx(dxe,{className:"h-6 w-6"})})]}),c.jsx("span",{className:"ws-mono relative mt-7 inline-flex rounded-full bg-[rgba(207,255,5,.1)] px-3 py-1 text-[11px] uppercase tracking-[0.16em] text-[var(--lp-lime)] ring-1 ring-[rgba(207,255,5,.3)]",children:l("{n} credits · 24 hours",{n})}),c.jsxs("h1",{className:"ws-display relative mt-4 text-3xl font-bold leading-tight text-white sm:text-4xl",children:[l("See what your posts")," ",c.jsx("span",{className:"ws-gradient-text",children:l("actually did.")})]}),c.jsx("p",{className:"ws-muted relative mx-auto mt-3 max-w-md",children:l("Views, likes, comments, shares and saves from every connected network, in one place.")}),c.jsxs("div",{className:"relative mt-8 rounded-2xl border border-white/[0.08] bg-black/30 px-5 py-2 text-left",children:[c.jsx(yj,{label:l("24-hour access"),value:h(n),tone:"text-amber-300"}),c.jsx(yj,{label:l("Your balance"),value:h(e)}),c.jsx(yj,{label:l("After unlocking"),value:h(d),tone:"text-[var(--lp-lime)]"})]}),c.jsx("p",{className:"relative mt-4 text-xs leading-relaxed text-white/45",children:l("One unlock gives you 24 hours of full access. Numbers refresh on their own every few hours, and refreshing, filtering and browsing are free.")}),i&&c.jsx("div",{className:"relative mt-5 rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-300",children:i}),c.jsxs("div",{className:"relative mt-8 flex flex-col-reverse justify-center gap-3 sm:flex-row",children:[c.jsx("button",{onClick:o,className:"ws-btn ws-btn-ghost",children:l("Back to Automate")}),t?c.jsxs("button",{onClick:s,disabled:r,className:"ws-btn ws-btn-primary",children:[c.jsx("span",{className:"ws-shine"}),r?c.jsxs(c.Fragment,{children:[c.jsx(cxe,{className:"h-5 w-5 animate-spin"})," ",l("Unlockingâ¦")]}):c.jsxs(c.Fragment,{children:[l("Unlock analytics")," ",c.jsxs("span",{className:"ws-mono text-xs opacity-70",children:["â",n]})]})]}):c.jsxs("button",{onClick:a,className:"ws-btn ws-btn-primary",children:[c.jsx("span",{className:"ws-shine"}),l("Top up credits")," â"]})]})]})})}function Cmt(){return c.jsx("div",{className:"relative z-10 px-4 pb-24 pt-10 sm:px-6 lg:px-8 lg:pt-16","aria-busy":"true",children:c.jsxs("div",{className:"mx-auto max-w-6xl",children:[c.jsx("div",{className:"ws-skeleton h-7 w-40 rounded-full"}),c.jsx("div",{className:"ws-skeleton mt-5 h-12 w-[min(560px,90%)] rounded-2xl"}),c.jsx("div",{className:"ws-skeleton mt-3 h-5 w-[min(420px,70%)] rounded-full"}),c.jsx("div",{className:"ws-skeleton mt-10 h-16 rounded-[24px]"}),c.jsx("div",{className:"mt-8 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",children:Array.from({length:6}).map((n,e)=>c.jsx("div",{className:"ws-skeleton h-[118px] rounded-[22px]",style:{animationDelay:`${e*.08}s`}},e))}),c.jsxs("div",{className:"mt-6 grid gap-6 xl:grid-cols-[1fr_1.15fr]",children:[c.jsx("div",{className:"ws-skeleton h-72 rounded-[28px]"}),c.jsx("div",{className:"ws-skeleton h-72 rounded-[28px]"})]}),c.jsx("div",{className:"ws-skeleton mt-12 h-96 rounded-[24px]"})]})})}const xie=Le("Current plan"),Nmt=(n,e)=>n.monthlyUsd===0?0:Math.round(n.monthlyUsd*(e==="yearly"?1-QR:1));function Mmt({value:n}){const e=G.useRef(null),t=G.useRef(n);return G.useEffect(()=>{const r=e.current;if(!r)return;const i={v:t.current},s=Si.to(i,{v:n,duration:.6,ease:"power3.out",onUpdate:()=>{r.textContent=`$${Math.round(i.v)}`}});return t.current=n,()=>{s.kill()}},[n]),c.jsxs("span",{ref:e,children:["$",n]})}function kmt({plan:n,billing:e,starterCredits:t,videoCost:r,onChoose:i,ctaLabel:s,disabled:a,loading:o}){const l=Ece(4),u=q8(.2),d=n.monthlyCredits??t,h=Math.floor(d/r),f=Math.floor(d/fc.textImageBase),p=Nmt(n,e),{t:g,locale:A}=Kr();return c.jsxs("div",{"data-reveal":!0,className:`relative ${n.popular?"lg:-mt-6 overflow-hidden rounded-[29px] p-px":""}`,children:[n.popular&&c.jsx("div",{className:"lp-border-spin pointer-events-none absolute left-1/2 top-1/2 aspect-square w-[160%] -translate-x-1/2 -translate-y-1/2 bg-[conic-gradient(#CFFF05,#22D3EE,#8B5CF6,#10B981,#CFFF05)]","aria-hidden":!0}),c.jsxs("div",{ref:l,className:`lp-card relative flex h-full flex-col p-8 ${n.popular?"!bg-[#0b
58530d12] !border-transparent":""}`,children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"lp-display text-2xl font-bold text-white",children:n.name}),n.popular&&c.jsx("span",{className:"rounded-full bg-[var(--lp-lime)] px-3 py-1 text-xs font-bold text-black",children:g("Most popular")})]}),c.jsx("p",{className:"mt-2 text-sm text-[var(--lp-muted)]",children:g(n.tagline)}),c.jsxs("div",{className:"mt-7 flex items-end gap-2",children:[c.jsx("span",{className:"lp-display text-6xl font-bold tracking-tight text-white",children:n.monthlyUsd===0?"$0":c.jsx(Mmt,{value:p})}),c.jsx("span",{className:"pb-2 text-sm text-[var(--lp-muted)]",children:n.monthlyUsd===0?g("forever"):g("/ month")})]}),c.jsx("div",{className:"mt-1 h-5 text-xs text-[var(--lp-muted)]",children:n.monthlyUsd>0&&e==="yearly"?g("Billed yearly · save ${n} a year",{n:Math.round(n.monthlyUsd*QR*12)}):n.monthlyUsd>0?g("Billed monthly"):""}),c.jsxs("div",{className:"mt-6 rounded-2xl border border-white/10 bg-white/[0.03] p-4",children:[c.jsx("div",{className:"lp-mono text-[11px] uppercase tracking-[0.18em] text-[var(--lp-lime)]",children:n.monthlyCredits?g("Every month"):g("To start")}),c.jsx("div",{className:"mt-1 text-lg font-semibold text-white",children:g("{n} credits",{n:d.toLocaleString(A)})}),c.jsxs("div",{className:"mt-1 text-sm text-[var(--lp-muted)]",children:["â ",g("{videos} short videos or {posts} image posts",{videos:h,posts:f})]})]}),c.jsx("ul",{className:"mt-6 flex-1 space-y-3 text-sm",children:n.highlights.map(x=>c.jsxs("li",{className:"flex gap-3 text-white/85",children:[c.jsx("span",{className:"mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full bg-[rgba(207,255,5,.14)] text-[11px] font-black text-[var(--lp-lime)]",children:"â"}),g(x)]},x))}),c.jsxs("button",{ref:u,onClick:i,disabled:a,className:`lp-btn mt-8 w-full ${n.popular?"lp-btn-primary":"lp-btn-ghost"} disabled:cursor-not-allowed disabled:opacity-60`,children:[n.popular&&c.jsx("span",{className:"lp-btn-shine"}),g(o?"Loadingâ¦":s)]})]})]})}function Rmt({videoCost:n,starterCredits:e}){const[t,r]=G.useState(3),[i,s]=G.useState(3),[a,o]=G.useState(1),[l,u]=G.useState(!1),d=l?E0.shortVideo:n,h=l?E0.textImage:fc.textImageBase+fc.perAiImage*4,f=l?E0.perMinute:fc.longVideoPerMinute,p=Math.round((t*d+i*h+a*f)*4.33),g=Bb.map(T=>({p:T,cap:T.monthlyCredits??e})),A=g.find(T=>T.p.monthlyCredits&&T.cap>=p)||g[g.length-1],x=Math.min(100,Math.round(p/A.cap*100)),{t:b,locale:_}=Kr(),M=({label:T,hint:L,value:D,set:P,max:O})=>c.jsxs("label",{className:"block",children:[c.jsxs("div",{className:"flex items-baseline justify-between",children:[c.jsx("span",{className:"font-semibold text-white",children:T}),c.jsxs("span",{className:"lp-display text-2xl font-bold text-[var(--lp-lime)]",children:[D,c.jsx("span",{className:"ml-1 text-sm font-normal text-[var(--lp-muted)]",children:b("/ week")})]})]}),c.jsx("div",{className:"text-xs text-[var(--lp-muted)]",children:L}),c.jsx("input",{type:"range",min:0,max:O,value:D,onChange:F=>P(Number(F.target.value)),className:"lp-range mt-3 w-full"})]});return c.jsxs("div",{"data-reveal":!0,className:"lp-glass grid gap-10 rounded-[32px] p-8 sm:p-10 lg:grid-cols-[1.1fr_0.9fr]",children:[c.jsxs("div",{className:"space-y-7",children:[c.jsx(M,{label:b("Short videos"),hint:b("{n} credits each",{n:d}),value:t,set:r,max:14}),c.jsx(M,{label:b("Carousel posts"),hint:l?b("{n} credits each",{n:h}):b("~{n} credits each with 4 AI images",{n:h}),value:i,set:s,max:14}),c.jsx(M,{label:b("Long videos (1 min)"),hint:b("{n} credits per minute",{n:f}),value:a,set:o,max:7}),c.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-2xl border border-white/10 bg-white/[0.03] p-4",children:[c.jsx("input",{type:"checkbox",checked:l,onChange:T=>u(T.target.checked),className:"mt-0.5 h-4 w-4 accent-[#cfff05]"}),c.jsxs("span",{children:[c.jsx("span",{className:"block font-semibold text-white",children:b("I use my own AI keys (BYOK)")}),c.jsx("span",{className:"block text-xs text-[var(--lp-muted)]",children:b("fal.ai, Replicate or Higgsfield bill you for images and video; SpreadOut charges a platform fee. Available on every plan.")}
5853)]})]})]}),c.jsxs("div",{className:"flex flex-col justify-between rounded-3xl border border-white/10 bg-black/30 p-7",children:[c.jsxs("div",{children:[c.jsx("div",{className:"lp-mono text-xs uppercase tracking-[0.2em] text-[var(--lp-muted)]",children:b("You need about")}),c.jsxs("div",{className:"lp-display mt-2 text-5xl font-bold text-white",children:[p.toLocaleString(_),c.jsx("span",{className:"ml-2 text-lg font-medium text-[var(--lp-muted)]",children:b("credits / month")})]}),c.jsx("div",{className:"mt-6 h-2 overflow-hidden rounded-full bg-white/10",children:c.jsx("div",{className:"h-full rounded-full bg-[var(--lp-lime)] transition-[width] duration-500",style:{width:`${x}%`}})}),c.jsx("div",{className:"mt-2 text-xs text-[var(--lp-muted)]",children:b("{pct}% of {plan}'s {n} monthly credits",{pct:x,plan:A.p.name,n:A.cap.toLocaleString(_)})})]}),c.jsxs("div",{className:"mt-8",children:[c.jsx("div",{className:"text-sm text-[var(--lp-muted)]",children:b("Best fit")}),c.jsx("div",{className:"lp-display text-3xl font-bold text-white",children:A.p.name}),p>(Bb[Bb.length-1].monthlyCredits||0)&&c.jsx("div",{className:"mt-1 text-xs text-amber-300",children:b("That's more than Pro includes. Talk to us about volume.")})]})]})]})}function Pmt(){const n=hi(),e=Array.from(new Set(Qee.map(r=>r.group))),t=({v:r})=>r===!0?c.jsx("span",{className:"text-[var(--lp-lime)]",children:"â"}):r===!1?c.jsx("span",{className:"text-white/20",children:"â"}):c.jsx("span",{className:"text-sm text-white/85",children:n(r)});return c.jsx("div",{"data-reveal":!0,className:"overflow-x-auto rounded-[28px] border border-white/10",children:c.jsxs("table",{className:"w-full min-w-[640px] text-left",children:[c.jsx("thead",{className:"sticky top-0 bg-[#0b0d12]",children:c.jsxs("tr",{children:[c.jsx("th",{className:"p-5 text-sm font-medium text-[var(--lp-muted)]",children:n("Compare plans")}),Bb.map(r=>c.jsx("th",{className:`p-5 text-center lp-display text-lg font-bold ${r.popular?"text-[var(--lp-lime)]":"text-white"}`,children:r.name},r.id))]})}),c.jsx("tbody",{children:e.map(r=>[c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"lp-mono border-t border-white/10 bg-white/[0.02] px-5 py-3 text-[11px] uppercase tracking-[0.2em] text-[var(--lp-muted)]",children:n(r)})},r),...Qee.filter(i=>i.group===r).map(i=>c.jsxs("tr",{className:"border-t border-white/5 transition-colors hover:bg-white/[0.02]",children:[c.jsx("td",{className:"p-5 text-sm text-white/80",children:n(i.label)}),i.values.map((s,a)=>c.jsx("td",{className:"p-5 text-center",children:c.jsx(t,{v:s})},a))]},i.label))])})]})})}function Lmt({starterCredits:n,adReward:e}){const[t,r]=G.useState(0),{t:i,locale:s}=Kr(),a=[{q:i("What are credits?"),a:i("Credits are spent per creation: a short video is {video} credits, a text + image post {post} credits (+{image} per AI image), long videos {long} credits per minute, an analytics sync {sync} and a community search {search}. Paid plans refill every month.",{video:fc.shortVideo,post:fc.textImageBase,image:fc.perAiImage,long:fc.longVideoPerMinute,sync:fc.analyticsSync,search:fc.groupSearch})},{q:i("Can I use my own AI provider keys?"),a:i("Yes, on every plan, Free included. Connect fal.ai, Replicate or Higgsfield in Account â AI providers and images and video bill to your provider account: a short video then costs {short} credits instead of {video}, long videos {min} credits per minute and text + image posts {post} credits. Voice-overs can use your own ElevenLabs voices at no extra credit cost.",{short:E0.shortVideo,video:fc.shortVideo,min:E0.perMinute,post:E0.textImage})},{q:i("Can I start for free?"),a:i("Yes. New accounts get {n} credits to try the autopilot, and you can earn {ad} more credits per rewarded ad.",{n:n.toLocaleString(s),ad:e})},{q:i("How does yearly billing work?"),a:i("Yearly plans cost {pct}% less than paying monthly, billed once a year. You get the same monthly credits.",{pct:Math.round(QR*100)})},{q:i("Can I cancel or change plans?"),a:i("Yes. Upgrade whenever you need more, and manage or cancel your subscription anytime from the billing portal. Your plan stays active until the end of the peri
5853od you paid for.")}];return c.jsx("div",{className:"divide-y divide-white/10 border-y border-white/10",children:a.map((o,l)=>{const u=t===l;return c.jsxs("div",{"data-reveal":!0,className:`lp-acc ${u?"is-open":""}`,children:[c.jsxs("button",{className:"flex w-full items-center justify-between gap-6 py-6 text-left",onClick:()=>r(u?null:l),"aria-expanded":u,children:[c.jsx("span",{className:`lp-display text-lg font-semibold sm:text-xl ${u?"text-white":"text-white/80"}`,children:o.q}),c.jsx("span",{className:`lp-acc-icon grid h-9 w-9 shrink-0 place-items-center rounded-full border text-lg ${u?"border-[var(--lp-lime)] bg-[var(--lp-lime)] text-black":"border-white/15 text-white"}`,children:"+"})]}),c.jsx("div",{className:"lp-acc-panel",children:c.jsx("div",{children:c.jsx("p",{className:"max-w-2xl pb-6 leading-relaxed text-[var(--lp-muted)]",children:o.a})})})]},o.q)})})}function Omt(){const n=G.useRef(null),{t:e,locale:t}=Kr();Sce(),Tce(n,[e]);const r=$8(),i=ro(),{data:s}=Ma(),a=!!s&&!!s.subscriptionStatus&&s.subscriptionStatus!=="deleted",{data:o,error:l}=Qr(Nae,{enabled:a}),{data:u}=Qr(SB),d=(u==null?void 0:u.starterCredits)??350,h=(u==null?void 0:u.videoCreditCost)??fc.shortVideo,f=(u==null?void 0:u.adCreditReward)??20,[p,g]=G.useState("yearly"),[A,x]=G.useState(!1);G.useEffect(()=>{WU("paywall_viewed",{platform:"web",variant:"web_v2"})},[]);const b=()=>{if(!s){i("/login");return}l&&console.error("Error fetching customer portal url"),o&&window.open(o,"_blank")};async function _(T){if(T.id===Vo.Free){r();return}const L=p==="yearly"?T.id===Vo.Premium?Vo.PremiumYearly:Vo.ProYearly:T.id;if(!s){i("/login");return}if(s.subscriptionPlan&&s.subscriptionPlan!==Vo.Free){b();return}try{x(!0),WU("purchase_started",{planId:L,billingCycle:p,variant:"web_v2",platform:"web"});const D=await h4e(L);if(D!=null&&D.sessionUrl)window.open(D.sessionUrl,"_self");else throw new Error("Error generating checkout session URL")}catch(D){console.error(D),x(!1)}}const M=T=>{if(T.id===Vo.Free)return Le(s?"Open Autopilot":"Start free");const L=s==null?void 0:s.subscriptionPlan;return L&&(L===T.id||L.startsWith(T.id))?xie:L&&L!==Vo.Free?Le("Manage subscription"):e("Get {plan}",{plan:T.name})};return c.jsxs("div",{ref:n,className:"lp min-h-screen overflow-x-clip",children:[c.jsx(mV,{}),c.jsxs("main",{children:[c.jsxs("section",{className:"relative overflow-hidden pb-20 pt-40 sm:pt-48",children:[c.jsx(Rce,{className:"opacity-80"}),c.jsx("div",{className:"lp-noise","aria-hidden":!0}),c.jsx("div",{className:"absolute inset-x-0 bottom-0 h-48 bg-gradient-to-t from-[var(--lp-bg)] to-transparent","aria-hidden":!0}),c.jsxs("div",{className:"lp-container relative text-center",children:[c.jsxs("span",{className:"lp-eyebrow",children:[c.jsx("b",{children:e("Pricing")})," ",e("Start free · cancel anytime")]}),c.jsxs("h1",{"data-split":!0,className:"lp-display mx-auto mt-8 max-w-4xl text-[clamp(2.6rem,6.6vw,5.6rem)] font-bold leading-[0.98] tracking-[-0.045em] text-white",children:[c.jsx(jf,{text:e("A full content team,")})," ",c.jsx(jf,{text:e("priced like a tool."),className:"lp-gw"})]}),c.jsx("p",{"data-reveal":!0,className:"mx-auto mt-7 max-w-2xl text-lg leading-relaxed text-[var(--lp-muted)] sm:text-xl",children:e("Strategy, videos, carousels and publishing in one plan. Start with {n} free credits and upgrade when the autopilot starts paying for itself.",{n:d.toLocaleString(t)})}),c.jsx("div",{"data-reveal":!0,className:"mt-10 inline-flex rounded-full border border-white/10 bg-white/[0.04] p-1.5",children:["monthly","yearly"].map(T=>c.jsxs("button",{onClick:()=>g(T),className:`relative rounded-full px-6 py-2.5 text-sm font-semibold transition-colors ${p===T?"text-black":"text-white/70 hover:text-white"}`,children:[p===T&&c.jsx("span",{className:"absolute inset-0 rounded-full bg-[var(--lp-lime)]",style:{zIndex:0}}),c.jsxs("span",{className:"relative z-10",children:[e(T==="monthly"?"Monthly":"Yearly"),T==="yearly"&&c.jsxs("span",{className:`ml-2 rounded-full px-2 py-0.5 text-[11px] ${p===T?"bg-black/15":"bg-[rgba(207,255,5,.15)] text-[var(--lp-lime)]"}`,children:["â",Math.round(QR*100),"%"]})]})]},T))})]})]}),c.jsxs("section",{className:"relative -mt-4 pb-28",children:[c.jsx("div",{className:"lp-container grid items-stretch gap-6 lg:grid-cols-3",children:Bb.map(T=>c.jsx(kmt,{plan:T,billing:p,starterCredits:d,videoCost:h,onChoose:()=>_(T),ctaLabel:M(T),loading:A&&T.id!==Vo.Free,disabled:A||M(T)===xie},T.id))}),c.jsx("p",{"data-reveal":!0,className:"mt-8 text-center text-sm text-[var(--lp-muted)]",children:e("Every plan includes the AI Creative Director and automatic brand-color sync.")})]}),c.jsx("section",{className:"py-24",children:c.jsxs("div",{className:"lp-container",children:[c.jsxs("div",{className:"mb-12 max-w-2xl",children:[c.jsx("span",{className:"lp-kicker",children:e("Plan your week")}),c.jsx("h2",{"data-split":!0,className:"lp-section-title mt-4 text-white",children:c.jsx(jf,{text:e("What will your content cost?")})}),c.jsx("p",{"data-reveal":!0,className:"mt-4 text-lg text-[var(--lp-muted)]",children:e("Move the sliders to your posting rhythm. We'll show the credits you need and the plan that fits.")})]}),c.jsx(Rmt,{videoCost:h,starterCredits:d})]})}),c.jsx("section",{className:"py-24",children:c.jsxs("div",{className:"lp-container",children:[c.jsxs("div",{className:"mb-12 max-w-2xl",children:[c.jsx("span",{className:"lp-kicker",children:e("Side by side")}),c.jsx("h2",{"data-split":!0,className:"lp-section-title mt-4 text-white",children:c.jsx(jf,{text:e("Everything in each plan.")}
5853)})]}),c.jsx(Pmt,{})]})}),c.jsx("section",{className:"py-24",children:c.jsxs("div",{className:"lp-container grid gap-14 lg:grid-cols-[0.8fr_1.2fr]",children:[c.jsxs("div",{className:"lg:sticky lg:top-32 lg:self-start",children:[c.jsx("span",{className:"lp-kicker",children:e("Billing FAQ")}),c.jsx("h2",{"data-split":!0,className:"lp-section-title mt-4 text-white",children:c.jsx(jf,{text:e("No fine print.")})}),c.jsxs("a",{"data-reveal":!0,href:"mailto:[email protected]",className:"lp-btn lp-btn-ghost mt-8 !h-11 text-sm",children:[e("Questions? Email us")," â"]})]}),c.jsx(Lmt,{starterCredits:d,adReward:f})]})}),c.jsxs("section",{className:"relative overflow-hidden py-32 text-center",children:[c.jsx("div",{className:"pointer-events-none absolute left-1/2 top-1/2 h-[700px] w-[700px] -translate-x-1/2 -translate-y-1/2 rounded-full opacity-60","aria-hidden":!0,style:{background:"conic-gradient(from 0deg, rgba(207,255,5,.35), rgba(34,211,238,.25), rgba(139,92,246,.3), rgba(207,255,5,.35))",filter:"blur(90px)",animation:"lp-spin 18s linear infinite"}}),c.jsxs("div",{className:"lp-container relative",children:[c.jsx("h2",{"data-split":!0,className:"lp-display mx-auto max-w-3xl text-[clamp(2.2rem,5.5vw,4.6rem)] font-bold leading-[1] tracking-[-0.04em] text-white",children:c.jsx(jf,{text:e("Put your content on autopilot today.")})}),c.jsxs("button",{"data-reveal":!0,onClick:()=>r(),className:"lp-btn lp-btn-primary mt-10",children:[c.jsx("span",{className:"lp-btn-shine"}),e(s?"Open Autopilot":"Start free")," â"]})]})]})]}),c.jsx(Lq,{footerNavigation:xy}),(!(s!=null&&s.subscriptionPlan)||s.subscriptionPlan===Vo.Free)&&c.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 flex w-full justify-center",children:c.jsx(Dq,{})})]})}function Dmt(){return c.jsx(pV,{children:c.jsx(Omt,{})})}const jmt=["instagram","facebook","tiktok","youtube","x","linkedin"],Imt=["text-image","carousel","video","long-video","podcast"],mxe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],Zn=(n,e={})=>({type:"string",description:n,...e}),Mf=(n,e={})=>({type:"integer",description:n,...e}),gA=n=>({type:"boolean",description:n}),K2={type:"array",items:{type:"string",enum:[...jmt]},description:"Target networks. Omit to use every connected account."},vie=Zn('IANA timezone of the creator, e.g. "Europe/Lisbon", or an offset like "+01:00". Defaults to the timezone of their last schedule, else UTC.'),yie=Zn("Day of the week",{enum:[...mxe]}),Fmt=Zn("Local time, 24-hour HH:MM",{pattern:"^\\d{2}:\\d{2}$"}),bie={type:"array",maxItems:5,description:'Up to 5 PDFs (20 MB each) used as source material: brochures, catalogues, articles, reports. Pass each as { "base64": "<file content>", "name": "file.pdf" } or { "url": "https://public/link.pdf" }.',items:{type:"object",properties:{base64:{type:"string",description:"The PDF file content, base64-encoded"},url:{type:"string",description:"Public http(s) link to the PDF"},name:{type:"string",description:"File name"}},additionalProperties:!1}},Fi=(n,e=[])=>({type:"object",properties:n,required:e,additionalProperties:!1}),Umt=[{name:"spreadout_get_account",title:"Account, credits & connected accounts",group:"Account",readOnly:!0,description:"Start here. Returns credits, plan, the connected social accounts (and whether any need to be reconnected), the credit price of each post type (lower when the user brings their own AI provider), and the default timezone.",inputSchema:Fi({})},{name:"spreadout_get_connect_link",title:"Link to connect a social account",group:"Account",description:"Returns a URL the user must open themselves to connect (or reconnect) a social account. Never open it on their behalf.",inputSchema:Fi({platform:Zn("Network to connect",{enum:["instagram","facebook","tiktok","youtube","twitter","linkedin","threads","pinterest","bluesky"]})},["platform"])},{name:"spreadout_get_job",title:"Background job status",group:"Account",readOnly:!0,description:"Status and result of background work started by another tool (weekly strategy, re-roll). Poll every 15-30 s until status is completed or failed.",inputSchema:Fi({job_id:Zn("Job id returned by the tool that started it")},["job_id"])},{name:"spreadout_generate_weekly_strategy",title:"Generate a weekly content plan",group:"Plan & generate",description:"Reads a website, blog or RSS feed and/
5853or PDFs and plans a varied week of posts (videos, carousels, images, podcasts) with day, time, format and caption for each. Costs 20 credits. Runs in the background (1-3 min): returns a job_id for spreadout_get_job. Review the plan with the user, then pass the job_id to spreadout_start_auto_pilot.",inputSchema:Fi({source_url:Zn("Website, product page, blog or RSS feed URL (optional when PDFs are given)"),pdfs:bie,notes:Zn("Extra context: product name, audience, goals, things to avoid"),content_mode:Zn("ai-generated = new content inspired by the source; original-only = only the source's own articles; mixed = both",{enum:["ai-generated","mixed","original-only"]}),product_type:Zn("What is being promoted",{enum:["software","physical"]})})},{name:"spreadout_create_post",title:"Generate one post",group:"Plan & generate",openWorld:!1,description:"Generates a single post (image post, carousel, short video, long video or podcast) as a draft: nothing is published. Costs credits (see spreadout_get_account). Returns an execution_id right away; generation takes 1-10 min, poll spreadout_get_execution. Then publish or schedule it. Videos open on a ~6 s real-world viral hook clip with an on-screen hook line from frame 0 (turn off with viral_hook=false; vox-style and app-demo never use one), then the narration with word-synced captions and motion graphics. Carousels are planned as one deck: cover hook, re-hook on slide 2, numbered one-idea slides (data slides only use numbers found in the source) and a final save/share CTA. Works the same with the user's own fal.ai / Replicate / Higgsfield keys (BYOK).",inputSchema:Fi({type:Zn("Post format",{enum:[...Imt]}),style:Zn("Content style for the format. text-image/carousel: quick-tip, storytelling, behind-scenes, fast-facts, product-plug. video: mini-explainer, fast-facts, vox-style, hook-tease, ai-voiceover-clips, product-plug, app-demo. long-video: explainer-video, vox-style, step-tutorial, top-list, brand-story, scripted-story, app-demo. podcast: podcast-discussion."),topic:Zn("What the post is about (product, offer, idea or article summary)"),source_url:Zn("Website or article to base it on (recommended)"),pdfs:bie,caption:Zn("Caption to use as-is; omit to let Spread Out write it"),language:Zn("Language of the post, e.g. English, Portuguese, Spanish"),platforms:K2,duration_seconds:Mf("Video length: 15-30 for video, 30-90 for long-video, 45-120 for podcast. With the viral hook on, its first ~6 s are the hook clip, so prefer 25-30 s for short videos",{minimum:15,maximum:120}),viral_hook:gA("video / long-video: open on a ~6 s viral hook clip (default true)"),format:Zn("text-image / carousel slide shape (default portrait 4:5)",{enum:["portrait","square"]}),voice_gender:Zn("Narrator / avatar voice",{enum:["Female","Male"]}),ai_images:gA("text-image / carousel: generate AI images (5 credits each) instead of free stock images"),number_of_images:Mf("text-image / carousel: number of images (carousel defaults to 6)",{minimum:1,maximum:10}),captions:gA("Burn subtitles into videos (default true)"),product_type:Zn("What is being promoted",{enum:["software","physical"]})},["type","topic"])},{name:"spreadout_write_caption",title:"Write a caption",group:"Plan & generate",readOnly:!1,description:"Writes a ready-to-post social caption (with hashtags) in a given style and language. Free. Nothing is saved.",inputSchema:Fi({topic:Zn("Product, offer or idea"),details:Zn("Key facts to mention"),url:Zn("Link to reference"),style:Zn("Caption style",{enum:["quick-tip","storytelling","behind-scenes","fast-facts","product-plug"]}),language:Zn("e.g. English")},["topic"])},{name:"spreadout_list_posts",title:"List generated posts",group:"Posts & publishing",readOnly:!0,description:"Recent generations (newest first) with status, caption preview, media count, schedule and publish state.",inputSchema:Fi({status:Zn("Filter",{enum:["all","generating","ready","published","failed"]}),limit:Mf("Max results (default 20)",{minimum:1,maximum:100})})},{name:"spreadout_get_execution",title:"Post / generation details",group:"Posts & publishing",readOnly:!0,description:"One generation: status (queued, processing, completed, failed), caption, image and video URLs, schedule, where it was published and any publish error.",inputSchema:Fi({execution_id:Zn("E
5853xecution id")},["execution_id"])},{name:"spreadout_edit_caption",title:"Edit a caption",group:"Posts & publishing",description:"Replaces the caption of a generated post before it is published.",inputSchema:Fi({execution_id:Zn("Execution id"),caption:Zn("New caption")},["execution_id","caption"])},{name:"spreadout_publish_post",title:"Publish now",group:"Posts & publishing",openWorld:!0,description:"Publishes a completed post right now to the user's connected accounts. Only call after the user explicitly approves this post. Accounts whose login expired are skipped and reported.",inputSchema:Fi({execution_id:Zn("Execution id of a completed generation"),platforms:K2},["execution_id"])},{name:"spreadout_schedule_post",title:"Schedule a post",group:"Posts & publishing",openWorld:!0,description:"Schedules a completed post for the next occurrence of a weekday and time in the creator's timezone. Replaces any existing schedule. Only call after the user approves.",inputSchema:Fi({execution_id:Zn("Execution id"),day:yie,time:Fmt,timezone:vie,platforms:K2},["execution_id","day","time"])},{name:"spreadout_unschedule_post",title:"Cancel a scheduled post",group:"Posts & publishing",description:"Removes the schedule of a post so it is not published. The post itself is kept.",inputSchema:Fi({execution_id:Zn("Execution id")},["execution_id"])},{name:"spreadout_regenerate_post",title:"Regenerate a post",group:"Posts & publishing",description:"Generates the post again from scratch with the same settings (charges credits again). Returns the new execution_id.",inputSchema:Fi({execution_id:Zn("Execution id to regenerate")},["execution_id"])},{name:"spreadout_delete_post",title:"Delete a post",group:"Posts & publishing",destructive:!0,description:"Deletes a generated post and its media. Does not remove it from social networks if already published.",inputSchema:Fi({execution_id:Zn("Execution id")},["execution_id"])},{name:"spreadout_start_auto_pilot",title:"Start Auto-Pilot from a plan",group:"Auto-Pilot",openWorld:!0,description:"Turns a completed weekly strategy (job_id from spreadout_generate_weekly_strategy) into an Auto-Pilot: every planned post starts generating now and is published automatically on its day and time, and a fresh plan is made each week. Charges each post's credits as it generates (the total is returned before anything starts if credits are short). Only call after the user approves the plan.",inputSchema:Fi({job_id:Zn("Completed weekly strategy job id"),days:{type:"array",items:{type:"string",enum:[...mxe]},description:"Only these days of the plan (default: all)"},platforms:K2,timezone:vie,repeat_weekly:gA("Keep planning a new week automatically (default true). false = run this week only."),name:Zn("Name for the Auto-Pilot (default: the source site)")},["job_id"])},{name:"spreadout_list_auto_pilots",title:"List Auto-Pilots",group:"Auto-Pilot",readOnly:!0,description:"The user's Auto-Pilot campaigns with their weekly slots (day, time, format, status of each post).",inputSchema:Fi({})},{name:"spreadout_reroll_week",title:"Re-plan the coming week",group:"Auto-Pilot",description:"Throws away the upcoming posts of an Auto-Pilot and plans + generates a fresh week (charges credits for the new posts). Runs in the background: returns a job_id.",inputSchema:Fi({auto_pilot_id:Zn("Auto-Pilot (parent workflow) id")},["auto_pilot_id"])},{name:"spreadout_reroll_day",title:"Replace one day's post",group:"Auto-Pilot",description:"Plans and generates a new post for one day of an Auto-Pilot (charges credits). Returns the new execution_id.",inputSchema:Fi({auto_pilot_id:Zn("Auto-Pilot id"),day:yie},["auto_pilot_id","day"])},{name:"spreadout_stop_auto_pilot",title:"Stop an Auto-Pilot",group:"Auto-Pilot",destructive:!0,description:"Stops an Auto-Pilot and deletes its upcoming (unpublished) posts. Already-published posts stay on the networks.",inputSchema:Fi({auto_pilot_id:Zn("Auto-Pilot id")},["auto_pilot_id"])},{name:"spreadout_get_post_analytics",title:"Post analytics",group:"Analytics",readOnly:!0,description:"Views, likes, comments, shares and engagement for published posts, with totals per platform and per campaign. Numbers refresh in the background every few hours. If analytics are locked, says so (see spreadout_unlock_post_analytics).",inputSchema:Fi({platform:Zn("Filter by network, e.g. instagram"),days:Mf("Only posts from the last N days",{minimum:1,maximum:365}),limit:Mf("Max posts listed (default 25)",{minimum:1,maximum:200})})},{name:"spreadout_unlock_post_analytics",title:"Unlock analytics (24 h)",group:"Analytics",description:"Unlocks Post Analytics for 24 hours for 10 credits. Ask the user first.",inputSchema:Fi({})},{name:"spreadout_get_comments_center",title:"Comments & Directs overview",group:"Comments & DMs",readOnly:!0,description:"Auto-reply settings per account (Instagram, Facebook, LinkedIn, Threads), Instagram keyword â DM automations with their stats, recent replies/DMs and credits used. Available on every plan; each reply or DM costs 10 credits.",inputSchema:Fi({})},{name:"spreadout_set_auto_reply",title:"Configure comment auto-replies",group:"Comments & DMs",openWorld:!0,description:"Turns automatic replies to new comments on or off for one connected account, with AI-written replies (tone + instructions) or the user's own rotating templates. Only comments written after it is switched on are answered; 10 credits per reply.",inputSchema:Fi({account_id:Zn("Account id from spreadout_get_comments_center"),enabled:gA("On or off"),mode:Zn("ai = AI writes each reply; manual = rotate the templates",{enum:["ai","manual"]}),tone:Zn("AI tone",{enum:["friendly","professional","playful","short"]}),instructions:Zn('Extra rules for the AI (max 600 chars), e.g. "We ship to the EU only"'),templates:{type:"array",items:{type:"string"},maxItems:5,description:"Manual replies; {name} becomes the commenter's name"},skip_already_answered:gA("Skip comments the account already replied to (default true)"),skip_emoji_only:gA("Skip emoji-only / tag-only comments (default true)"),daily_limit:Mf("Max replies per day on this account (default 50)",{minimum:1,maximum:500})},["account_id"])},{name:"spreadout_suggest_trigger_keywords",title:"Suggest DM trigger words",group:"Comments & DMs",description:"Suggests trigger keywords for an Instagram comment â DM automation, based on the account's captions.",inputSchema:Fi({account_id:Zn("Instagram account id"),existing:{type:"array",items:{type:"string"},description:"Keywords already chosen"}},["account_id"])},{name:"spreadout_list_instagram_posts",title:"List Instagram posts",group:"Comments & DMs",readOnly:!0,description:"Instagram posts of an account, to target one post with a keyword automation.",inputSchema:Fi({account_id:Zn("Instagram account id"),cursor:Zn("Pagination cursor from a previous call")},["account_id"])},{name:"spreadout_save_dm_automation",title:"Create / edit a keyword â DM automation",group:"Comments & DMs",openWorld:!0,description:"Instagram only. When a new comment matches a trigger word, the commenter gets the DM (and optionally a public reply). 10 credits per DM + 10 per public reply. Pass automation_id to edit.",inputSchema:Fi({automation_id:Zn("E
5853xisting automation to edit"),account_id:Zn("Instagram account id"),name:Zn("Name (only the user sees it)"),keywords:{type:"array",items:{type:"string"},maxItems:20,description:"Trigger words; empty = every new comment"},match_mode:Zn("word = whole word, contains = substring, exact = whole comment",{enum:["word","contains","exact"]}),exclude_keywords:{type:"array",items:{type:"string"},maxItems:20},post_id:Zn("Only this Instagram post (from spreadout_list_instagram_posts); omit for all posts"),dm_message:Zn("The DM text (max 1000 chars): the link, guide or code you promised"),public_replies:{type:"array",items:{type:"string"},maxItems:5,description:"Public replies under the comment, one picked at random; empty = DM only"}},["account_id","dm_message"])},{name:"spreadout_set_dm_automation_status",title:"Pause / resume a DM automation",group:"Comments & DMs",description:"Pauses or resumes an Instagram keyword â DM automation.",inputSchema:Fi({automation_id:Zn("Automation id"),account_id:Zn("Instagram account id"),active:gA("true = resume, false = pause")},["automation_id","account_id","active"])},{name:"spreadout_delete_dm_automation",title:"Delete a DM automation",group:"Comments & DMs",destructive:!0,description:"Deletes an Instagram keyword â DM automation.",inputSchema:Fi({automation_id:Zn("Automation id"),account_id:Zn("Instagram account id")},["automation_id","account_id"])},{name:"spreadout_get_dm_automation_log",title:"DM automation log",group:"Comments & DMs",readOnly:!0,description:"Who triggered an automation, whether the DM and public reply went out, and credits charged.",inputSchema:Fi({automation_id:Zn("Automation id"),account_id:Zn("Instagram account id"),skip:Mf("Offset for paging",{minimum:0})},["automation_id","account_id"])},{name:"spreadout_list_blog_syncs",title:"List blog / RSS syncs",group:"Blog / RSS",readOnly:!0,description:"Blogs and RSS feeds being watched: every new article becomes a post automatically.",inputSchema:Fi({})},{name:"spreadout_start_blog_sync",title:"Auto-post new blog articles",group:"Blog / RSS",openWorld:!0,description:"Watches a blog / RSS feed: each new article is turned into a post and published to the chosen accounts (credits per post). Ask the user first.",inputSchema:Fi({feed_url:Zn("Blog or RSS feed URL"),platforms:K2,type:Zn("Post format for new articles",{enum:["text-image","carousel","video"]}),language:Zn("e.g. English")},["feed_url"])},{name:"spreadout_stop_blog_sync",title:"Stop a blog / RSS sync",group:"Blog / RSS",destructive:!0,description:"Stops watching a blog / RSS feed.",inputSchema:Fi({subscription_id:Zn("Id from spreadout_list_blog_syncs")},["subscription_id"])},{name:"spreadout_search_groups",title:"Find communities to post in",group:"Communities",description:"Finds Facebook groups, LinkedIn groups, Telegram/Discord/WhatsApp communities, X communities and forums that match a product or ad, with member counts and an engagement score. Costs 20 credits (only charged when communities are found). Runs in the background (1-2 min): returns a job_id for spreadout_get_job. Results also appear on the Group Search page.",inputSchema:Fi({description:Zn("The product, offer or ad to find communities for (the more specific, the better)"),location:Zn('City / country to prioritise, e.g. "Lisbon, Portugal" (optional)'),platforms:{type:"array",items:{type:"string",enum:["facebook","linkedin","telegram","twitter","discord","whatsapp","internet-forums"]},description:"Where to search (default: facebook, linkedin, internet-forums)"}},["description"])},{name:"spreadout_list_group_searches",title:"Past community searches",group:"Communities",readOnly:!0,description:"Recent community searches with the groups found (link, platform, members, engagement, whether the user marked it as posted).",inputSchema:Fi({limit:Mf("Number of searches (default 5)",{minimum:1,maximum:20})})},{name:"spreadout_search_viral_videos",title:"Find viral reference videos",group:"Viral references",readOnly:!0,description:"Searches YouTube for high-performing short videos on a topic, scored for viral
5853ity, to use as a creative reference.",inputSchema:Fi({query:Zn("Topic or niche"),limit:Mf("Max results (default 10)",{minimum:1,maximum:25}),days:Mf("Only videos from the last N days",{minimum:1,maximum:365})},["query"])},{name:"spreadout_create_post_from_viral_video",title:"Generate a post inspired by a viral video",group:"Viral references",description:"Analyses a reference video's hook and structure and generates an ORIGINAL short video for the user's product in that format (draft, not published; costs video credits). Returns an execution_id.",inputSchema:Fi({video_id:Zn("YouTube video id from spreadout_search_viral_videos"),topic:Zn("Product or idea the new video is about"),details:Zn("Product description / key points"),url:Zn("Product URL"),language:Zn("e.g. English"),duration_seconds:Mf("15-60",{minimum:15,maximum:60}),voice_gender:Zn("Narrator voice",{enum:["Female","Male"]}),platforms:K2},["video_id","topic"])}],Bmt=[{name:"weekly_autopilot",title:"Plan a week and put it on Auto-Pilot",description:"Turn a website or blog into a week of posts, review the plan, then let Spread Out generate and publish it every week.",arguments:[{name:"source_url",description:"Website, product page, blog or RSS feed",required:!0},{name:"notes",description:"Audience, goals, things to avoid",required:!1}]},{name:"single_post",title:"Create one post",description:"Generate one post (image, carousel, short or long video, podcast), review it, then publish or schedule it.",arguments:[{name:"topic",description:"What the post is about",required:!0},{name:"format",description:"text-image, carousel, video, long-video or podcast",required:!1}]},{name:"comment_engagement",title:"Set up comment replies and ke
5853yword DMs",description:'Configure automatic replies to comments and Instagram "comment a word, get a DM" automations.',arguments:[{name:"goal",description:'e.g. "send my free guide to anyone who comments GUIDE"',required:!1}]}],wie=[{id:"Account",label:Le("Account")},{id:"Plan & generate",label:Le("Plan & generate")},{id:"Posts & publishing",label:Le("Posts & publishing")},{id:"Auto-Pilot",label:Le("Auto-Pilot")},{id:"Analytics",label:Le("Analytics")},{id:"Comments & DMs",label:Le("Comments & DMs")},{id:"Blog / RSS",label:Le("Blog / RSS")},{id:"Communities",label:Le("Communities")},{id:"Viral references",label:Le("Viral references")}],Vmt=[{uri:"spreadout://account",label:Le("Credits, plan, connected accounts, prices")},{uri:"spreadout://auto-pilots",label:Le("Auto-Pilot campaigns and their weekly slots")},{uri:"spreadout://recent-posts",label:Le("The 20 most recent generations")}];function zmt(n){var e,t;return n.enum?n.enum.join(" | "):n.type==="array"?`${(e=n.items)!=null&&e.enum?`(${n.items.enum.join(" | ")})`:((t=n.items)==null?void 0:t.type)||"any"}[]`:n.type}function _ie(){const{data:n}=Ma(),e=hi(),[t,r]=G.useState("claude"),[i,s]=G.useState("all"),[a,o]=G.useState(""),[l,u]=G.useState(null),d=`${(Zi.apiUrl||"https://spread-out-server.fly.dev").replace(/\/$/,"")}/api/mcp`,h=(A,x)=>{navigator.clipboard.writeText(A),u(x),d0.success(e("Copied to clipboard.")),setTimeout(()=>u(null),2200)},f={claude:{label:"Claude",steps:e("In Claude (web or desktop): Settings â Connectors â Add custom connector. Paste the server URL, then sign in to Spread Out when asked.")},chatgpt:{label:"ChatGPT",steps:e("In ChatGPT: Settings â Apps & Connectors â Advanced â turn on Developer mode, then Create a connector with the server URL. Sign in to Spread Out when asked.")},"claude-code":{label:"Claude Code",steps:e("Run this in your terminal, then type /mcp in Claude Code to sign in:"),code:`claude mcp add --transport http spreadout ${d}`},cursor:{label:"Cursor",steps:e("Add this to your Cursor MCP settings. Cursor opens the Spread Out sign-in the first time."),code:JSON.stringify({mcpServers:{spreadout:{url:d}}},null,2)},vscode:{label:"VS Code",steps:e("Add this to your workspace, then start the server from the MCP view. VS Code opens the Spread Out sign-in."),code:JSON.stringify({servers:{spreadout:{type:"http",url:d}}},null,2)},python:{label:"Python",steps:e("With a personal token from Account settings (pip install mcp):"),code:`import asyncio 5854from mcp import ClientSession 5855from mcp.client.streamable_http import streamablehttp_client 5856 5857async def main(): 5858 headers = {"Authorization": "Bearer YOUR_TOKEN"} 5859 async with streamablehttp_client("${d}", headers=headers) as (read, write, _): 5860 async with ClientSession(read, write) as session: 5861 await session.initialize() 5862 account = await session.call_tool("spreadout_get_account", {}) 5863 print(account.content[0].text) 5864 5865asyncio.run(main())`}},p=G.useMemo(()=>Umt.filter(A=>{if(i!=="all"&&A.group!==i)return!1;const x=a.trim().toLowerCase();return!x||A.name.includes(x)||A.title.toLowerCase().includes(x)||A.description.toLowerCase().includes(x)}),[i,a]),g=f[t];return c.jsx(pV,{children:c.jsxs("div",{className:"lp ws min-h-screen overflow-x-clip",children:[c.jsx(mV,{}),c.jsxs("div",{className:"ws-backdrop","aria-hidden":!0,children:[c.jsx("div",{className:"ws-blob a"}),c.jsx("div",{className:"ws-blob b"}),c.jsx("div",{className:"ws-blob c"})]}),c.jsxs("div",{className:"relative z-10 mx-auto max-w-6xl space-y-14 px-4 pb-24 pt-36 sm:px-6",children:[c.jsx(D_,{tag:"MCP",eyebrow:e("Developer docs · OAuth 2.1"),title:e("Connect AI agents to"),accent:"Spread Out.",subtitle:e("Let Claude, ChatGPT, Cursor or your own agents plan a week of content, generate videos and carousels, publish and schedule posts, read analytics and manage comment replies, with the user's own account and credits."),actions:n?c.jsxs(ru,{to:"/account",search:{tab:"agents"},className:"ws-btn ws-btn-primary !h-11 !px-5 text-sm",children:[c.jsx("span",{className:"ws-shine"}),e("Manage connected agents")," â"]}):c.jsx(ru,{to:"/login",className:"ws-btn ws-btn-ghost !h-11 !px-5 text-sm",children:e("Sign in to connect")})}
5865),c.jsxs("div",{className:"ws-glass space-y-6 rounded-[28px] p-6 sm:p-8",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"ws-display text-xl font-bold text-white",children:e("Connect in a minute")}),c.jsx("p",{className:"mt-1 text-sm text-white/55",children:e("Most agents sign in with OAuth: paste the server URL, approve access on Spread Out, done. No token to copy.")})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-2xl border border-[rgba(207,255,5,.3)] bg-[rgba(207,255,5,.05)] p-3",children:[c.jsx("span",{className:"ws-mono truncate text-[13px] text-[#e9ffa1]",children:d}),c.jsx("button",{onClick:()=>h(d,"url"),className:"shrink-0 rounded-full bg-[var(--lp-lime)] px-3 py-1.5 text-xs font-bold text-black",children:e(l==="url"?"Copied":"Copy")})]}),c.jsx("div",{className:"flex max-w-full gap-1 overflow-x-auto rounded-full border border-white/10 bg-white/[0.03] p-1 [scrollbar-width:none]",children:Object.keys(f).map(A=>c.jsx("button",{onClick:()=>r(A),className:`shrink-0 whitespace-nowrap rounded-full px-3.5 py-1.5 text-xs font-bold transition-all ${t===A?"bg-[#CFFF05] text-[#0F121A]":"text-white/60 hover:text-white"}`,children:f[A].label},A))}),c.jsx("p",{className:"text-sm text-white/70",children:g.steps}),g.code&&c.jsxs("div",{className:"relative overflow-x-auto rounded-2xl border border-white/10 bg-black/50 p-5",children:[c.jsx("button",{onClick:()=>
5865h(g.code,t),className:"absolute right-4 top-4 rounded-lg bg-white/10 px-3 py-1.5 text-xs font-bold text-white hover:bg-white/20",children:l===t?`â ${e("Copied")}`:e("Copy")}),c.jsx("pre",{className:"ws-mono pr-20 text-xs leading-relaxed text-[#e9ffa1]",children:g.code})]})]}),c.jsxs("div",{className:"space-y-5",children:[c.jsx("h2",{className:"ws-display text-2xl font-bold text-white sm:text-3xl",children:e("How it works")}),c.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[{k:e("Streamable HTTP"),v:d,d:e("MCP protocol 2025-06-18 (2025-03-26 and 2024-11-05 also accepted). Legacy SSE clients can use /api/mcp/sse.")},{k:e("OAuth 2.1 + PKCE"),v:"/.well-known/oauth-protected-resource",d:e("Discovery (RFC 9728 / 8414), dynamic client registration, S256 PKCE, rotating refresh tokens. Users approve each agent and can disconnect it any time.")},{k:e("Credits & safety"),v:e("Same rules as the app"),d:e("Generation runs in the background and returns an id to poll. Nothing is published unless the agent calls publish or schedule; read-only tokens can never spend credits.")}].map(A=>c.jsxs("div",{className:"ws-card space-y-3 rounded-[22px] p-6",children:[c.jsx("div",{className:"ws-kicker",children:A.k}),c.jsx("div",{className:"ws-mono break-all rounded-xl border border-white/10 bg-black/50 p-2.5 text-xs text-[#e9ffa1]",children:A.v}),c.jsx("p",{className:"text-xs leading-relaxed text-white/55",children:A.d})]},A.k))})]}),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-col justify-between gap-4 sm:flex-row sm:items-end",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"ws-display text-2xl font-bold text-white sm:text-3xl",children:[e("MCP tools reference")," (",p.length,")"]}),c.jsx("p",{className:"text-sm text-white/55",children:e("Every tool an agent can call. Descriptions are shown as agents see them.")})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx("input",{type:"text",placeholder:e("Search tools..."),value:a,onChange:A=>o(A.target.value),className:"rounded-full border border-white/10 bg-white/[0.03] px-4 py-2.5 text-xs text-white placeholder-white/35 focus:border-[#CFFF05] focus:outline-none focus:ring-0"}),c.jsxs("select",{value:i,onChange:A=>s(A.target.value),className:"rounded-full border border-white/10 bg-white/[0.03] px-4 py-2.5 pr-8 text-xs text-white/80 focus:border-[#CFFF05] focus:outline-none focus:ring-0",children:[c.jsx("option",{value:"all",children:e("All categories")}),wie.map(A=>c.jsx("option",{value:A.id,children:e(A.label)},A.id))]})]})]}),c.jsx("div",{className:"grid grid-cols-1 gap-4",children:p.map(A=>{var _;const x=Object.entries(A.inputSchema.properties||{}),b=new Set(A.inputSchema.required||[]);return c.jsxs("div",{className:"ws-card space-y-4 rounded-[22px] p-6",children:[c.jsxs("div",{className:"flex flex-col justify-between gap-2 sm:flex-row sm:items-center",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[c.jsx("span",{className:"ws-mono text-[15px] font-bold text-[#CFFF05]",children:A.name}),c.jsx("span",{className:"rounded-md border border-white/10 bg-white/5 px-2.5 py-0.5 text-xs text-white/70",children:e(((_=wie.find(M=>M.id===A.group))==null?void 0:_.label)||A.group)}
5865),A.readOnly&&c.jsx("span",{className:"rounded-md bg-sky-400/10 px-2 py-0.5 text-[11px] font-bold text-sky-300",children:e("read-only")}),A.destructive&&c.jsx("span",{className:"rounded-md bg-red-400/10 px-2 py-0.5 text-[11px] font-bold text-red-300",children:e("destructive")}),A.openWorld&&c.jsx("span",{className:"rounded-md bg-amber-400/10 px-2 py-0.5 text-[11px] font-bold text-amber-300",children:e("publishes / sends")})]}),c.jsx("button",{onClick:()=>h(A.name,A.name),className:"ws-mono w-fit text-xs text-white/45 hover:text-white",children:l===A.name?`â ${e("Copied")}`:e("Copy name")})]}),c.jsx("div",{className:"text-sm font-semibold text-white",children:A.title}),c.jsx("p",{className:"text-sm leading-relaxed text-white/65",children:A.description}),x.length>0&&c.jsxs("div",{className:"space-y-2 border-t border-white/[0.06] pt-3",children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-white/45",children:e("Parameters")}),c.jsx("div",{className:"grid grid-cols-1 gap-2 text-xs",children:x.map(([M,T])=>c.jsxs("div",{className:"flex flex-col gap-1.5 rounded-lg border border-white/[0.06] bg-black/50 p-2.5 sm:flex-row sm:items-baseline sm:gap-2",children:[c.jsxs("span",{className:"ws-mono font-bold text-cyan-300",children:[M,b.has(M)&&c.jsx("span",{className:"ml-1 font-sans text-red-300",children:"*"})]}),c.jsx("span",{className:"ws-mono text-purple-300",children:zmt(T)}),c.jsx("span",{className:"text-white/50 sm:ml-auto sm:text-right",children:T.description})]},M))})]})]},A.name)})})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-8 border-t border-white/10 pt-6 md:grid-cols-2",children:[c.jsxs("div",{className:"ws-glass space-y-4 rounded-[28px] p-6 sm:p-8",children:[c.jsx("div",{className:"ws-kicker",children:e("MCP resources")}),c.jsx("ul",{className:"space-y-2 text-xs",children:Vmt.map(A=>c.jsxs("li",{className:"rounded-xl border border-white/10 bg-black/50 p-2.5",children:[c.jsx("span",{className:"ws-mono text-[#e9ffa1]",children:A.uri})," · ",c.jsx("span",{className:"text-white/55",children:e(A.label)})]},A.uri))})]}),c.jsxs("div",{className:"ws-glass space-y-4 rounded-[28px] p-6 sm:p-8",children:[c.jsx("div",{className:"ws-kicker",children:e("MCP prompts")}),c.jsx("ul",{className:"space-y-2 text-xs",children:Bmt.map(A=>c.jsxs("li",{className:"rounded-xl border border-white/10 bg-black/50 p-2.5",children:[c.jsx("span",{className:"ws-mono text-cyan-300",children:A.name})," · ",c.jsx("span",{className:"text-white/55",children:A.description})]},A.name))})]})]})]}),c.jsx(Lq,{footerNavigation:xy})]})})}function wP({footerNavigation:n}){return c.jsx("div",{className:"mx-auto mt-6 max-w-7xl px-6 lg:px-8 dark:bg-boxdark-2",children:c.jsxs("footer",{"aria-labelledby":"footer-heading",className:"relative border-t border-gray-900/10 dark:border-gray-200/10 py-24 sm:mt-32",children:[c.jsx("h2",{id:"footer-heading",className:"sr-only",children:"Footer"}),c.jsxs("div",{className:"flex items-start justify-center mt-10 gap-20",children:[c.jsxs("div",{className:"w-64 md:mx-0 mx-auto text-center md:text-left",children:[c.jsxs("a",{"aria-current":"page",className:"flex gap-2 justify-center md:justify-start items-center",href:"/#",children:[c.jsx("img",{alt:"Spread Out logo",fetchPriority:"high",width:"24",height:"24",decoding:"async","data-nimg":"1",className:"w-6 h-6",src:V1,style:{color:"transparent"}}),c.jsx("strong",{className:"font-extrabold tracking-tight text-base md:text-lg",children:"Spread Out"})]}),c.jsx("p",{className:"mt-3 text-sm text-base-content/80",children:"AI powered social media group search and description enhancer your ads."}),c.jsx("p",{className:"mt-3 text-sm text-base-content/60",children:"Copyright © 2024 - All rights reserved"})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold leading-6 text-gray-900 dark:text-white",children:"Links"}),c.jsx("ul",{role:"list",className:"mt-6 space-y-4",children:n.app.map(e=>c.jsx("li",{children:c.jsx("a",{href:e.href,className:"text-sm leading-6 text-gray-600 hover:text-gray-900 dark:text-white",children:e.name})},e.name))})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold leading-6 text-gray-900 dark:text-white",children:"Legal"}),c.jsx("ul",{role:"list",className:"mt-6 space-y-4",children:n.company.map(e=>c.jsx("li",{children:c.jsx("a",{href:e.href,className:"text-sm leading-6 text-gray-600 hover:text-gray-900 dark:text-white",children:e.name})},e.name))})]})]})]})})}const Gmt=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:c.jsxs("div",{className:"space-y-8 bg-white dark:bg-gray-900 rounded-lg shadow-sm p-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white border-b border-gray-200 dark:border-gray-700 pb-4 mb-6",children:"Terms of Service"}),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"1. Acceptance of Terms"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:'By accessing and using the Spread Out AI services ("Services"), you accept and agree to be bound by these terms and conditions ("Terms"). If you do not agree to these Terms, you should not access or use the Services.'})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"2. Description of Service"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Spread Out AI is an AI-powered service designed to help users discover public and free social media communities where they can post their ads, messages, or any text content they wish to
5865share. Spread Out AI merely provides a tool for finding these communities and is not responsible for the content that users post."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"3. Modifications to Terms of Use and Service"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Spread Out AI reserves the right, at its sole discretion, to modify or replace these Terms at any time. Continued use of the Services after any such changes will constitute acceptance of the new Terms. Spread Out AI also reserves the right to modify, suspend, or discontinue the Services with or without notice at any time and without any liability to you."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"4. User Conduct"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"You agree to use the Services only for lawful purposes. You are solely responsible for ensuring that your posts and activities within the communities found via Spread Out AI comply with all applicable laws, rules, and regulations. Spread Out AI disclaims any responsibility for the content you post or for any consequences that may arise from your posts."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"5. Disclaimer of Warranties"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:'The Services are provided on an "as is" and "as available" basis. Spread Out AI expressly disclaims all warranties of any kind, whether express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, title, and non-infringement. We do not guarantee that the Services will meet your specific requirements or that the results will be accurate or reliable.'})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"6. Limitation of Liability"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"In no event shall Spread Out AI, nor its directors, employees, agents, partners, suppliers, or content providers, be liable under contract, tort, strict liability, negligence, or any other legal or equitable theory with respect to the Services for any direct, indirect, incidental, special, punitive, or consequential damages, including, but not limited to, loss of profits, data, or other intangibles, even if Spread Out AI has been advised of the possibility of such damages."})]})]})]}),c.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",children:c.jsx("p",{children:"Last Updated: March 17, 2025"})})]})}),c.jsx(wP,{footerNavigation:xy})]}),qmt=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:c.jsxs("div",{className:"space-y-8 bg-white dark:bg-gray-900 rounded-lg shadow-sm p-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white border-b border-gray-200 dark:border-gray-700 pb-4 mb-6",children:"Privacy Policy"}),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"1. Collection of Information"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"We collect information you provide directly to us when you use our Services. This may include data such as your search queries and preferences when using Spread Out AI."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"2. Use of Information"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"The information we collect is used to provide, maintain, and improve our Services. Spread Out AI will not share your personal data with third parties without your prior consent, except as necessary to provide and improve the Services or as required by law."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"3. Changes to Our Privacy Policy"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Spread Out AI reserves the right to update this Privacy Policy at any time. Any changes will be effective immediately upon posting of the revised Privacy Policy."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"4. Payment Information"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"When you make a purchase through our mobile application, your payment is processed by the App Store (for iOS users) or Google Play (for Android users). We do not collect, store, or process your payment information such as credit card details. All payment transactions are encrypted and processed through Apple's or Google's secure payment systems."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"5. Apple Pay and Google Pay"}),c.jsxs("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:["For users who choose to use Apple Pay or Google Pay, all payment information is handled directly by Apple or Google. We do not receive, collect, or store your payment information. Apple's privacy practices for Apple Pay can be found in Apple's Privacy Policy at ",c.jsx("a",{href:"https://www.apple.com/legal/privacy/en-ww/",className:"text-blue-600 hover:text-blue-800 hover:underline transition-colors",children:"https://www.apple.com/legal/privacy/en-ww/"}),". Google's privacy practices for Google Pay can be found in Google's Privacy Policy at ",c.jsx("a",{href:"https://policies.google.com/privacy",className:"text-blue-600 hover:text-blue-800 hover:underline transition-colors",children:"https://policies.google.com/privacy"}),"."]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"6. Data Retention"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"We retain your personal information only for as long as necessary to fulfill the purposes for which we collected it, including for the purposes of satisfying any legal, accounting, or reporting requirements. To determine the appropriate retention period for personal data, we consider the amount, nature, and sensitivity of the personal data, the potential risk of harm from unauthorized use or disclosure of your personal data, the purposes for which we process your personal data, and the applicable legal requirements."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"7. Your Rights"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Depending on your location, you may have certain rights regarding your personal information, such as the right to access, correct, delete, or restrict processing of your personal information. If you wish to exercise any of these rights, please contact us at [email protected]."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"8. Contact Us"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"If you have any questions about this Privacy Policy, please contact us at [email protected]."})]})]})]}),c.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",children:c.jsx("p",{children:"Last Updated: March 17, 2025"})})]})}),c.jsx(wP,{footerNavigation:xy})]}),$mt=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:c.jsxs("div",{className:"space-y-8 bg-white dark:bg-gray-900 rounded-lg shadow-sm p-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white border-b border-gray-200 dark:border-gray-700 pb-4 mb-6",children:"Terms of Use"}),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"1. App Usage"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Spread Out AI is designed to help users discover public and free social media communities where they can post their ads, messages, or content. By using our app, you agree to use it only for its intended purpose and in compliance with all applicable laws and regulations."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"2. User Content"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"You are solely responsible for any content you create, share, or post using our app. You agree not to use Spread Out AI to create or distribute content that is illegal, harmful, threatening, abusive, harassing, defamatory, or otherwise objectionable. We reserve the right to remove any content that violates these terms."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"3. Subscription and Billing"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Our app offers subscription plans that automatically renew unless canceled at least 24 hours before the end of the current period. Payment will be charged to your Ap
5865ple ID account at the confirmation of purchase. Subscriptions may be managed by the user and auto-renewal may be turned off by going to the user's Account Settings after purchase. Any unused portion of a free trial period, if offered, will be forfeited when the user purchases a subscription."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"4. In-App Purchases"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Spread Out AI offers in-app purchases for premium features and subscription plans. All purchases are final and non-refundable, except as required by law. We are not responsible for any unauthorized purchases made through your account. It is your responsibility to maintain the security of your account and payment information."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"5. App Store Compliance"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"When you download our app from the Apple App Store or Google Play Store, you agree to comply with their respective terms of service. We reserve the right to modify the app at any time, including updates that may change or remove certain features or functionality."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"6. Intellectual Property"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"All content, features, and functionality of the Spread Out AI app, including but not limited to text, graphics, logos, icons, and software, are the exclusive property of Spread Out AI and are protected by copyright, trademark, and other intellectual property laws. You may not reproduce, distribute, modify, create derivative works of, publicly display, or exploit any content from our app without our prior written consent."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"7. Limitation of Liability"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"To the maximum extent permitted by law, Spread Out AI shall not be liable for any indirect, incidental, special, consequential, or punitive damages, including but not limited to loss of profits, data, or use, arising out of or in any way connected with the use of our app."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"8. Termination"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"We reserve the right to terminate or suspend your access to our app immediately, without prior notice or liability, for any reason, including but not limited to a breach of these Terms of Use. Upon termination, your right to use the app will immediately cease."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"9. Changes to Terms"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"We reserve the right to modify these Terms of Use at any time. If we make changes, we will provide notice by updating the date at the bottom of these terms and, in some cases, we may provide additional notice. Your continued use of the app after such changes constitutes your acceptance of the new Terms of Use."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:"10. Contact Information"}),c.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"If you have any questions about these Terms of Use, please contact us at [email protected]."})]})]})]}),c.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",children:c.jsx("p",{children:"Last Updated: March 18, 2025"})})]})}),c.jsx(wP,{footerNavigation:xy})]});function Hmt(){const[n,e]=G.useState("loading"),t=ro(),r=po();return G.useEffect(()=>{function i(){return setTimeout(()=>{t("/account")},4e3)}
5865const s=new URLSearchParams(r.search),a=s.get("success");return s.get("canceled")?e("canceled"):a?e("paid"):t("/account"),i(),()=>{clearTimeout(i())}},[r]),c.jsx("div",{className:"flex min-h-full flex-col justify-center mt-10 sm:px-6 lg:px-8",children:c.jsx("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:c.jsxs("div",{className:"py-8 px-4 shadow-xl ring-1 ring-gray-900/10 dark:ring-gray-100/10 sm:rounded-lg sm:px-10",children:[c.jsx("h1",{children:n==="paid"?"𥳠Payment Successful!":n==="canceled"?"ð¢ Payment Canceled":n==="error"&&"ð Payment Error"}),n!=="loading"&&c.jsxs("span",{className:"text-center",children:["You are being redirected to your account page... ",c.jsx("br",{})]})]})})})}function Wmt({user:n}){const e=ro();G.useEffect(()=>{n.isAdmin||e("/")},[n,e])}function vg({user:n,children:e}){Wmt({user:n}),jB();const[t,r]=G.useState(!1),i=po();G.useEffect(()=>{r(!1)},[i.pathname]);const{data:s}=Qr(Cae,void 0,{enabled:!!n.isAdmin}),a=(s==null?void 0:s.unreadCount)||0,o=[{label:"Insights",items:[{to:"/admin",label:"Overview",icon:c.jsx(jq,{}),end:!0},{to:"/admin/funnel",label:"Funnel",icon:c.jsx(M4,{})}]},{label:"Content",items:[{to:"/admin/workflows",label:"Workflows",icon:c.jsx(hy,{})},{to:"/admin/tasks",label:"Group searches",icon:c.jsx(ZR,{})}]},{label:"People",items:[{to:"/admin/users",label:"Users",icon:c.jsx(Zu,{})},{to:"/admin/messages",label:"Inbox",icon:c.jsx(Bq,{}),count:a},{to:"/admin/email-templates",label:"Email campaigns",icon:c.jsx(Gv,{})}]}];return n.isAdmin?c.jsxs("div",{className:"ws adm",children:[c.jsxs("div",{className:"ws-backdrop","aria-hidden":!0,children:[c.jsx("div",{className:"ws-blob a"}),c.jsx("div",{className:"ws-blob b"}),c.jsx("div",{className:"ws-blob c"})]}),t&&c.jsx("div",{className:"adm-overlay lg:hidden",onClick:()=>r(!1)}),c.jsxs("aside",{className:`adm-side ${t?"open":""}`,children:[c.jsxs("div",{className:"flex items-center justify-between px-5 pb-2 pt-5",children:[c.jsxs(Ks,{to:"/admin",className:"flex items-center gap-2.5",children:[c.jsx("img",{src:V1,alt:"",className:"h-9 w-9 rounded-xl"}),c.jsxs("div",{className:"leading-tight",children:[c.jsx("div",{className:"ws-display text-[15px] font-bold text-white",children:"SpreadOut"}),c.jsx("div",{className:"ws-mono text-[10px] uppercase tracking-[0.2em] text-[var(--lp-lime)]",children:"Admin"})]})]}),c.jsx("span",{className:"lg:hidden",children:c.jsx("button",{className:"adm-btn sm icon",onClick:()=>r(!1),"aria-label":"Close menu",children:c.jsx(JR,{})})})]}),c.jsx("nav",{className:"flex-1 overflow-y-auto px-3 pb-4",children:o.map(l=>c.jsxs("div",{children:[c.jsx("div",{className:"adm-nav-label",children:l.label}),l.items.map(u=>c.jsxs(lse,{to:u.to,end:u.end,className:({isActive:d})=>`adm-nav-link ${d?"active":""}`,children:[c.jsx("span",{className:"text-[17px]",children:u.icon}),u.label,!!u.count&&c.jsx("span",{className:"adm-count",children:u.count})]},u.to))]},l.label))}),c.jsxs("div",{className:"border-t border-white/[0.06] p-3",children:[c.jsxs(Ks,{to:"/ai-automator",className:"adm-nav-link",children:[c.jsx(Fq,{className:"text-[17px]"}),"Back to the app"]}),c.jsxs("div",{className:"mt-2 flex items-center gap-3 rounded-2xl bg-white/[0.03] px-3 py-2.5",children:[c.jsx("div",{className:"grid h-8 w-8 place-items-center rounded-full bg-[rgba(207,255,5,.14)] text-xs font-bold text-[var(--lp-lime)]",children:(n.username||n.email||"A").slice(0,1).toUpperCase()}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-[13px] font-semibold text-white",children:n.username||"Admin"}),c.jsx("div",{className:"truncate text-[11px] text-white/45",children:n.email})]})]})]})]}),c.jsxs("div",{className:"adm-main",children:[c.jsxs("div",{className:"adm-topbar flex items-center justify-between px-4 py-3 lg:hidden",children:[c.jsx("button",{className:"adm-btn sm icon",onClick:()=>r(!0),"aria-label":"Open menu",children:c.jsx(Sat,{})}),c.jsxs("div",{className:"ws-display text-sm font-bold text-white",children:["SpreadOut ",c.jsx("span",{className:"text-[var(--lp-lime)]",children:"Admin"})]}),c.jsx("span",{className:"w-8"})]}),c.jsx("main",{className:"relative z-10 mx-auto max-w-[1400px] px-4 pb-24 pt-8 sm:px-6 lg:px-10 lg:pt-10",children:e})]})]}):null}
5865function yg({kicker:n,title:e,subtitle:t,actions:r}){return c.jsxs("header",{className:"ws-enter mb-8 flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[n&&c.jsx("div",{className:"ws-kicker mb-2",children:n}),c.jsx("h1",{className:"ws-display text-3xl font-bold leading-tight text-white sm:text-4xl",children:e}),t&&c.jsx("p",{className:"ws-muted mt-2 max-w-2xl text-[15px]",children:t})]}),r&&c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r})]})}function Tc({title:n,kicker:e,subtitle:t,right:r,children:i,className:s="",pad:a=!0}){return c.jsxs("section",{className:`ws-glass ws-enter overflow-hidden rounded-[24px] ${s}`,children:[(n||r)&&c.jsxs("div",{className:"flex flex-col gap-3 border-b border-white/[0.06] px-5 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[c.jsxs("div",{className:"min-w-0",children:[e&&c.jsx("div",{className:"ws-kicker mb-1",children:e}),n&&c.jsx("h2",{className:"ws-display text-lg font-bold text-white",children:n}),t&&c.jsx("p",{className:"ws-muted mt-0.5 text-[13px]",children:t})]}),r&&c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r})]}),c.jsx("div",{className:a?"p-5 sm:p-6":"",children:i})]})}function vs({label:n,value:e,foot:t,icon:r,tone:i="neutral",loading:s=!1}){const a={neutral:"text-white",lime:"text-[var(--lp-lime)]",ok:"text-emerald-300",bad:"text-rose-300",warn:"text-amber-300",info:"text-cyan-300",violet:"text-violet-300"};return c.jsxs("div",{className:"ws-card relative overflow-hidden p-5",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-[12.5px] font-semibold text-white/55",children:n}),r&&c.jsx("span",{className:`text-base ${a[i]}`,children:r})]}),c.jsx("div",{className:`ws-display mt-3 text-[28px] font-bold leading-none tabular-nums ${a[i]}`,children:s?c.jsx("span",{className:"ws-skeleton inline-block h-7 w-20 rounded-lg align-middle"}):e}),t&&c.jsx("div",{className:"mt-2 text-[12px] text-white/45",children:t})]})}function Wi({tone:n="neutral",dot:e=!1,children:t,title:r}){return c.jsxs("span",{className:`adm-chip ${n==="neutral"?"":n}`,title:r,children:[e&&c.jsx("span",{className:"dot"}),t]})}const Xmt={completed:"ok",posted:"lime",published:"lime",active:"ok",sent:"ok",failed:"bad",cancelled:"neutral",canceled:"neutral",deleted:"neutral",error:"bad",processing:"info",running:"info",generating:"info",queued:"warn",pending:"warn",scheduled:"violet",dry_run:"warn",past_due:"warn"};function N0({status:n}){const e=String(n||"unknown").toLowerCase(),t=Xmt[e]||"neutral";return c.jsx(Wi,{tone:t,dot:!0,children:e.replace(/_/g," ")})}function cg({value:n,onChange:e,options:t}){return c.jsx("div",{className:"adm-seg",children:t.map(r=>c.jsxs("button",{type:"button",className:r.value===n?"on":"",onClick:()=>e(r.value),children:[r.icon,r.label]},String(r.value)))})}function _P({value:n,onChange:e,placeholder:t,className:r=""}){return c.jsxs("label",{className:`adm-field ${r}`,children:[c.jsx(wAe,{}),c.jsx("input",{value:n,onChange:i=>e(i.target.value),placeholder:t}),n&&c.jsx("button",{type:"button",onClick:()=>e(""),className:"text-white/40 hover:text-white","aria-label":"Clear",children:c.jsx(JR,{})})]})}function J5({value:n,onChange:e,options:t,className:r="",label:i}){return c.jsxs("label",{className:`adm-field relative ${r}`,children:[i&&c.jsx("span",{className:"text-[12px] font-semibold text-white/45",children:i}),c.jsx("select",{value:String(n),onChange:s=>{const a=s.target.value,o=t.find(l=>String(l.value)===a);e(o?o.value:a)},children:t.map(s=>c.jsx("option",{value:String(s.value),children:s.label},String(s.value)))}),c.jsx("span",{className:"pointer-events-none absolute right-3 text-[10px] text-white/40",children:"â¼"})]})}function d$(n,e=300){const[t,r]=G.useState(n);return G.useEffect(()=>{const i=setTimeout(()=>r(n),e);return()=>clearTimeout(i)},[n,e]),t}function h$({page:n,totalPages:e,total:t,pageSize:r,onPage:i,noun:s="items"}){const a=G.useMemo(()=>{const u=[],d=Math.max(0,Math.min(n-2,e-5));for(let h=d;h<Math.min(e,d+5);h++)u.push(h);return u},[n,e]),o=t===0?0:n*r+1,l=t!=null?Math.min((n+1)*r,t):(n+1)*r;return c.jsxs("div",{className:"flex flex-col items-center justify-between gap-3 border-t border-white/[0.06] px-5 py-4 sm:flex-row",children:[c.jsx("div",{className:"text-[12.5px] text-white/50",children:t!=null?c.jsxs(c.Fragment,{children:["Showing ",c.jsxs("b",{className:"text-white",children:[o,"â",l]})," of ",c.jsx("b",{className:"text-white",children:t.toLocaleStr
5865ing()})," ",s]}):c.jsxs(c.Fragment,{children:["Page ",n+1," of ",e]})}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{className:"adm-btn sm icon",disabled:n===0,onClick:()=>i(n-1),"aria-label":"Previous page",children:c.jsx(gAe,{})}),a.map(u=>c.jsx("button",{onClick:()=>i(u),className:`adm-btn sm min-w-[32px] !px-2 ${u===n?"primary":""}`,children:u+1},u)),c.jsx("button",{className:"adm-btn sm icon",disabled:n>=e-1,onClick:()=>i(n+1),"aria-label":"Next page",children:c.jsx(AAe,{})})]})]})}function Ec({icon:n,title:e,body:t,action:r}){return c.jsxs("div",{className:"flex flex-col items-center px-6 py-16 text-center",children:[c.jsx("div",{className:"grid h-14 w-14 place-items-center rounded-2xl bg-white/[0.05] text-2xl text-[var(--lp-lime)] ring-1 ring-white/10",children:n}),c.jsx("h3",{className:"ws-display mt-5 text-lg font-bold text-white",children:e}),t&&c.jsx("p",{className:"ws-muted mt-1.5 max-w-sm text-sm",children:t}),r&&c.jsx("div",{className:"mt-5",children:r})]})}function Ly({message:n,onRetry:e}){return c.jsxs("div",{className:"flex flex-col items-center px-6 py-14 text-center",children:[c.jsx(Iq,{className:"text-3xl text-rose-300"}),c.jsx("p",{className:"mt-3 text-sm text-rose-200",children:n}),e&&c.jsx("button",{className:"adm-btn sm mt-4",onClick:e,children:"Try again"})]})}function Oy({rows:n=6,cols:e=5}){return c.jsx("div",{className:"space-y-3 p-5",children:Array.from({length:n}).map((t,r)=>c.jsx("div",{className:"flex gap-4",children:Array.from({length:e}).map((i,s)=>c.jsx("div",{className:"ws-skeleton h-5 flex-1 rounded-lg",style:{opacity:1-r*.1}},s))},r))})}function h_({text:n,label:e}){const[t,r]=G.useState(!1);return c.jsxs("button",{type:"button",title:"Copy",onClick:i=>{i.stopPropagation(),navigator.clipboard.writeText(n),r(!0),setTimeout(()=>r(!1),1500)},className:"inline-flex items-center gap-1 text-[11px] text-white/45 transition hover:text-white",children:[t?c.jsx(Uq,{className:"text-emerald-300"}):c.jsx(Aat,{}),e]})}function f$({open:n,onClose:e,title:t,subtitle:r,children:i,footer:s}){return G.useEffect(()=>{if(!n)return;const a=l=>{l.key==="Escape"&&e()};document.addEventListener("keydown",a);const o=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",a),document.body.style.overflow=o}},[n,e]),n?Vl.createPortal(c.jsxs("div",{className:"ws",children:[c.jsx("div",{className:"adm-overlay",onClick:e}),c.jsxs("aside",{className:"adm-drawer",role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-white/[0.07] px-6 py-5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"ws-display truncate text-xl font-bold text-white",children:t}),r&&c.jsx("div",{className:"mt-1 text-[13px] text-white/50",children:r})]}),c.jsx("button",{className:"adm-btn sm icon shrink-0",onClick:e,"aria-label":"Close",children:c.jsx(JR,{})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:i}),s&&c.jsx("div",{className:"border-t border-white/[0.07] px-6 py-4",children:s})]})]}),document.body):null}function Sie({open:n,title:e,body:t,confirmLabel:r="Confirm",danger:i=!1,busy:s=!1,onConfirm:a,onCancel:o}){return n?Vl.createPortal(c.jsxs("div",{className:"ws",children:[c.jsx("div",{className:"adm-overlay",style:{zIndex:70},onClick:o}),c.jsxs("div",{className:"adm-dialog",style:{zIndex:71},role:"alertdialog","aria-modal":"true",children:[c.jsxs("div",{className:"p-6",children:[c.jsx("h3",{className:"ws-display text-lg font-bold text-white",children:e}),t&&c.jsx("div",{className:"ws-muted mt-2 text-sm leading-relaxed",children:t})]}),c.jsxs("div",{className:"flex justify-end gap-2 border-t border-white/[0.07] px-6 py-4",children:[c.jsx("button",{className:"adm-btn",onClick:o,disabled:s,children:"Cancel"}),c.jsx("button",{className:`adm-btn ${i?"danger":"primary"}`,onClick:a,disabled:s,children:s?"Workingâ¦":r})]})]})]}),document.body):null}function SP(){const[n,e]=G.useState(null);return G.useEffect(()=>{if(!n)return;const t=setTimeout(()=>e(null),3200);return()=>clearTimeout(t)},[n]),{show:(t,r=!0)=>e({text:t,ok:r}),node:n?Vl.createPortal(c.jsx("div",{className:"ws",children:c.jsxs("div",{className:"adm-toast",children:[n.ok?c.jsx(I1,{className:"text-emerald-300"}):c.jsx(Iq,{className:"text-rose-300"}),c.jsx("span",{className:"text-white",children:n.text})]})}),document.body):null}}const Yd=(n,e=!1)=>
5865{if(!n)return"â";const t=new Date(n);return Number.isNaN(t.getTime())?"â":t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric",...e?{hour:"2-digit",minute:"2-digit"}:{}})},Ym=n=>{if(!n)return"â";const e=Math.round((Date.now()-new Date(n).getTime())/1e3);if(e<60)return"just now";const t=Math.round(e/60);if(t<60)return`${t}m ago`;const r=Math.round(t/60);if(r<24)return`${r}h ago`;const i=Math.round(r/24);return i<30?`${i}d ago`:Yd(n)},Ymt=[{value:7,label:"7 days"},{value:30,label:"30 days"},{value:90,label:"90 days"},{value:365,label:"All time"}],bj=[{value:"welcome",label:"Welcome"},{value:"activation_nudge",label:"Activation nudge (24h)"},{value:"first_video_followup",label:"First-video follow-up"},{value:"founder_email",label:"Founder email (day 3)"},{value:"out_of_credits",label:"Out of credits"},{value:"day7_winback",label:"Day 7 win-back"},{value:"day14_winback",label:"Day 14 win-back"}];function Qmt({user:n}){var p,g,A,x;const[e,t]=G.useState(30),[r,i]=G.useState("generations"),{data:s,isLoading:a,isFetching:o,refetch:l}=Qr(kae,{days:e}),{data:u}=Qr(F4e),d=s||{},h=d.generationMetrics||{},f=a;return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"Insights",title:"Overview",subtitle:c.jsxs(c.Fragment,{children:["How SpreadOut is doing: sign-ups, generations, revenue and email health.",d.excludedAccountsCount?c.jsxs(c.Fragment,{children:[" Test and owner accounts (",d.excludedAccountsCount,") are excluded."]}):null]}),actions:c.jsxs(c.Fragment,{children:[c.jsx(cg,{value:e,onChange:t,options:Ymt}),c.jsx("button",{className:"adm-btn icon",onClick:()=>l(),"aria-label":"Refresh",children:c.jsx(Xm,{className:o?"animate-spin":""})})]})}),c.jsxs("div",{className:"ws-stagger grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",children:[c.jsx(vs,{label:"Sign-ups",value:(d.totalSignups??0).toLocaleString(),foot:`last ${e===365?"year":`${e} days`}`,icon:c.jsx(Zu,{}),loading:f}),c.jsx(vs,{label:"Activated",value:`${d.signupToActivatedConversionRate??0}%`,foot:"made a first generation",icon:c.jsx(jq,{}),tone:"ok",loading:f}),c.jsx(vs,{label:"Free â paid",value:`${d.signupToPaidConversionRate??0}%`,foot:`${d.totalPaidUsers??0} paying customers`,icon:c.jsx(Mat,{}),tone:"lime",loading:f}),c.jsx(vs,{label:"Revenue",value:`$${(d.totalRevenue??0).toLocaleString()}`,foot:"web + in-app",icon:c.jsx(SU,{}),loading:f}),c.jsx(vs,{label:"Generations",value:(h.totalGenerations??0).toLocaleString(),foot:`${h.successRate??0}% succeeded`,icon:c.jsx(e8,{}),tone:"info",loading:f}),c.jsx(vs,{label:"Email engine",value:(p=d.emailStats)!=null&&p.isDryRun?"Dry run":"Live",foot:`${((g=d.emailStats)==null?void 0:g.sentToday)??0} / ${((A=d.emailStats)==null?void 0:A.dailyCap)??50} sent today`,icon:c.jsx(Gv,{}),tone:(x=d.emailStats)!=null&&x.isDryRun?"warn":"ok",loading:f})]}),c.jsxs("div",{className:"mt-6 grid gap-6 xl:grid-cols-[1.4fr_1fr]",children:[c.jsx(Kmt,{steps:d.steps||[],loading:f}),c.jsx(Zmt,{weekly:(u==null?void 0:u.weeklyStats)||[]})]}),c.jsx("div",{className:"mt-6 grid grid-cols-2 gap-3 lg:grid-cols-4",children:[{to:"/admin/workflows",icon:c.jsx(hy,{}),label:"Workflows",sub:"See what was generated"},{to:"/admin/users",icon:c.jsx(Zu,{}),label:"Users",sub:"Credits, plans, accounts"},{to:"/admin/messages",icon:c.jsx(Bq,{}),label:"Inbox",sub:"Feedback & cancellations"},{to:"/admin/email-templates",icon:c.jsx(Gv,{}),label:"Email campaigns",sub:"Compose & send"}].map(b=>c.jsxs(Ks,{to:b.to,className:"ws-card adm-card-hover group flex items-center gap-3 p-4",children:[c.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-xl bg-white/[0.05] text-lg text-[var(--lp-lime)]",children:b.icon}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block text-[14px] font-bold text-white",children:b.label}),c.jsx("span",{className:"block truncate text-[12px] text-white/45",children:b.sub})]}),c.jsx(mAe,{className:"ml-auto text-white/30 transition group-hover:translate-x-1 group-hover:text-[var(--lp-lime)]"})]},b.to))}),c.jsx("div",{className:"mb-5 mt-10",children:c.jsx(cg,{value:r,onChange:i,options:[{value:"generations",label:"Generations",icon:c.jsx(vAe,{})},{value:"monetization",label:"Monetization",icon:c.jsx(SU,{})},{value:"emails",label:"Lifecycle emails",icon:c.jsx(Gv,{})}]})}),r==="generations"&&c.jsx(Jmt,{g:h,days:e,loading:f}),r==="monetization"&&c.jsx(egt,{f:d}),r==="emails"&&c.jsx(tgt,{f:d,user:n,onSent:()=>l()})]})}function Kmt({steps:n,loading:e}){var r;const t=((r=n[0])==null?void 0:r.uniqueUsers)||1;return c.jsx(Tc,{title:"Conversion funnel",subtitle:"Unique users reaching each step",right:c.jsxs(Ks,{to:"/admin/funnel",className:"adm-btn sm",children:["Full funnel ",c.jsx(mAe,{})]}),children:e?c.jsx("div",{className:"space-y-3",children:Array.from({length:6}).map((i,s)=>c.jsx("div",{className:"ws-skeleton h-6 rounded-lg"},s))}):n.length===0?c.jsx(Ec,{icon:c.jsx(M4,{}),title:"No events in this window"}):c.jsx("div",{className:"space-y-2.5",children:n.slice(0,8).map((i,s)=>c.jsxs("div",{className:"group relative",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between text-[12.5px]",children:[c.jsx("span",{className:"font-semibold text-white/85",children:i.name}),c.jsxs("span",{className:"adm-num text-white/55",children:[i.uniqueUsers.toLocaleStr
5865ing()," ",c.jsxs("span",{className:"text-white/35",children:["· ",i.overallConversion,"%"]})]})]}),c.jsx("div",{className:"h-2.5 overflow-hidden rounded-full bg-white/[0.05]",children:c.jsx("div",{className:"h-full rounded-full bg-[var(--lp-lime)]",style:{width:`${Math.max(2,i.uniqueUsers/t*100)}%`,opacity:1-s*.07}})})]},i.step))})})}function Zmt({weekly:n}){const e=[...n].reverse(),t=Math.max(1,...e.map(i=>i.userDelta||0)),r=n[0];return c.jsx(Tc,{title:"New users per day",subtitle:r?`${r.userCount.toLocaleString()} users total · ${r.paidUserCount.toLocaleString()} paying`:"Daily snapshot",children:e.length===0?c.jsx(Ec,{icon:c.jsx(Zu,{}),title:"No daily stats yet",body:"The daily stats job fills this in."}):c.jsx("div",{className:"flex h-48 items-end gap-[2px] pt-6",children:e.map(i=>{const s=i.userDelta||0;return c.jsxs("div",{className:"group relative flex h-full flex-1 flex-col items-center justify-end",children:[c.jsxs("div",{className:"pointer-events-none absolute -top-1 z-10 hidden -translate-y-full whitespace-nowrap rounded-lg border border-white/10 bg-[#0d1017] px-2.5 py-1.5 text-[11.5px] text-white shadow-xl group-hover:block",children:[c.jsx("b",{children:s})," new · ",Yd(i.date)]}),c.jsx("div",{className:"w-full max-w-[34px] rounded-t-[4px] bg-[var(--lp-lime)] transition-opacity group-hover:opacity-80",style:{height:`${Math.max(2,s/t*100)}%`}}),c.jsx("span",{className:"mt-2 text-[10.5px] text-white/40",children:new Date(i.date).toLocaleDateString(void 0,{weekday:"short"})})]},i.id)})})})}function Jmt({g:n,days:e,loading:t}){const[r,i]=G.useState(""),s=n.distribution||{},a=(n.topGeneratingUsers||[]).filter(o=>!r||`${o.email} ${o.username}`.toLowerCase().includes(r.toLowerCase())).slice(0,25);return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"ws-stagger grid grid-cols-2 gap-3 lg:grid-cols-4",children:[c.jsx(vs,{label:"Generations",value:(n.totalGenerations??0).toLocaleString(),foot:`${n.processingGenerations??0} running now · ${n.allTimeTotalGenerations??0} all-time`,icon:c.jsx(e8,{}),loading:t}),c.jsx(vs,{label:"Completed",value:(n.completedGenerations??0).toLocaleString(),foot:`${n.successRate??0}% success · ${n.allTimeCompletedGenerations??0} all-time`,icon:c.jsx(I1,{}),tone:"ok",loading:t}),c.jsx(vs,{label:"Failed",value:(n.failedGenerations??0).toLocaleString(),foot:`${n.failureRate??0}% failure · ${n.allTimeFailedGenerations??0} all-time`,icon:c.jsx(hat,{}),tone:"bad",loading:t}),c.jsx(vs,{label:"Workflows created",value:(n.totalWorkflows??0).toLocaleString(),foot:`${n.avgGenerationsPerUser??0} generations per active creator`,icon:c.jsx(hy,{}),tone:"info",loading:t})]}),c.jsx(Tc,{title:"How much people create",subtitle:`Users by number of generations · ${n.avgCompletedPerUser??0} completed per creator on average`,children:c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-5",children:[["Never",s.zeroGenerations,"signed up, no runs"],["Once",s.oneGeneration,"tried it"],["2â5",s.twoToFiveGenerations,"casual"],["6â10",s.sixToTenGenerations,"regular"],["10+",s.moreThanTenGenerations,"power users"]].map(([o,l,u])=>c.jsxs("div",{className:"ws-card p-4 text-center",children:[c.jsx("div",{className:"text-[12px] font-semibold text-white/50",children:o}),c.jsx("div",{className:"ws-display mt-1 text-2xl font-bold text-white",children:l??0}),c.jsx("div",{className:"text-[11px] text-white/40",children:u})]},o))})}),c.jsx(Tc,{pad:!1,title:"Top creators",subtitle:`Generations per user · ${e===365?"all time":`last ${e} days`}`,right:c.jsx(_P,{value:r,onChange:i,placeholder:"Find a userâ¦",className:"w-64"}),children:a.length===0?c.jsx(Ec,{icon:c.jsx(Zu,{}),title:"No creators found"}):c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"adm-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"User"}),c.jsx("th",{children:"Plan"}),c.jsx("th",{children:"Runs"}),c.jsx("th",{children:"Completed"}),c.jsx("th",{children:"Failed"}),c.jsx("th",{children:"Success"}),c.jsx("th",{children:"Workflows"}),c.jsx("th",{children:"Joined"})]})}),c.jsx("tbody",{children:a.map(o=>c.jsxs("tr",{children:[c.jsxs("td",{className:"max-w-[240px]",children:[c.jsx("div",{className:"truncate font-semibold text-white",children:o.email}),c.jsxs("div",{className:"truncate text-[12px] text-white/40",children:["@",o.username]})]}),c.jsx("td",{children:c.jsx(Wi,{tone:o.subscriptionStatus==="active"?"lime":"neutral",children:o.subscriptionPlan||"free"})}),c.jsx("td",{className:"adm-num font-semibold text-white",children:o.totalGenerations}),c.jsx("td",{className:"adm-num text-emerald-300",children:o.completedGenerations}),c.jsx("td",{className:`adm-num ${o.failedGenerations?"text-rose-300":"text-white/40"}`,children:o.failedGenerations}),c.jsx("td",{children:c.jsxs(Wi,{tone:o.successRate>=80?"ok":o.successRate>=50?"warn":"bad",children:[o.successRate,"%"]})}),c.jsx("td",{className:"adm-num text-white/60",children:o.workflowsCount}),c.jsx("td",{className:"whitespace-nowrap text-white/50",children:Yd(o.createdAt)})]},o.userId))})]})})})]})}function egt({f:n}){const e=n.unitEconomics||{},t=n.configOverview,r=(e.netMargin??0)>=0;return c.jsxs("div",{className:"space-y-6",children:[c.jsx(Tc,{title:"Paywall A/B test",subtitle:"Even split by user. Consumable starter pack vs monthly Creator pass.",right:c.jsx(Wi,{tone:"lime",dot:!0,children:"Running"}),children:(n.variants||[]).length===0?c.jsx(Ec,{icon:c.jsx(Oat,{}),title:"No paywall views yet"}):c.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:(n.variants||[]).map(i=>c.jsxs("div",{className:"ws-card p-5",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-[12px] text-white/45",children:i.variant==="pack_focus"?"Variant A · one-off pack":"Variant B · subscription"}),c.jsx("div",{className:"ws-display text-lg font-bold text-white",children:i.name})]}),c.jsxs("span",{className:"ws-display text-2xl font-bold text-[var(--lp-lime)]",children:[i.conversionRate,"%"]})]}),c.jsx("div",{className:"mt-4 grid grid-cols-4 gap-2 text-center",children:[["Views",i.paywallViews],["Checkouts",i.purchasesStarted],["Purchases",i.purchasesCompleted],["Revenue",`$${i.revenue}`]].map(([s,a])=>c.jsxs("div",{className:"rounded-xl bg-white/[0.035] py-2.5",children:[c.jsx("div",{className:"text-[10.5px] text-white/45",children:s}),c.jsx("div",{className:"adm-num mt-0.5 font-semibold text-white",children:a})]},s))})]},i.variant))})}
5865),c.jsx(Tc,{title:"Ads vs compute cost",subtitle:"Do free users who watch rewarded ads pay for their own generations?",right:c.jsx(Wi,{tone:r?"ok":"bad",dot:!0,children:r?"Margin positive":"Margin negative"}),children:c.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[c.jsx(vs,{label:"Rewarded ads watched",value:(e.totalAdViews??0).toLocaleString(),foot:"verified callbacks",icon:c.jsx(Fat,{})}),c.jsx(vs,{label:"Estimated ad revenue",value:`$${e.estimatedAdRevenue??0}`,foot:"at ~$25 eCPM",icon:c.jsx(SU,{}),tone:"ok"}),c.jsx(vs,{label:"Videos completed",value:(e.completedGenerations??0).toLocaleString(),foot:`${e.totalGenerations??0} attempted`,icon:c.jsx(I1,{})}),c.jsx(vs,{label:"Estimated compute cost",value:`$${e.estimatedGenerationCost??0}`,foot:`net margin $${e.netMargin??0}`,icon:c.jsx(vAe,{}),tone:"warn"})]})}),t&&c.jsxs(Tc,{title:"Pricing & remote config",subtitle:"Live values the apps read at runtime",children:[c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-5",children:[["Starter credits",t.starterCredits],["Video cost",`${t.videoCreditCost} credits`],["Ad reward",`+${t.adCreditReward} credits`],["Daily ad cap",`${t.dailyAdCap} ads`],["Free watermark",t.watermarkEnabledFree?"On":"Off"]].map(([i,s])=>c.jsxs("div",{className:"ws-card p-4",children:[c.jsx("div",{className:"text-[12px] text-white/45",children:i}),c.jsx("div",{className:"ws-display mt-1 text-lg font-bold text-white",children:s})]},i))}),c.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:(t.pricingTiers||[]).map(i=>c.jsxs("div",{className:`ws-card p-4 ${i.popular?"!border-[rgba(207,255,5,.4)]":""}`,children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-[13px] font-bold text-white",children:i.name}),i.popular&&c.jsx(Wi,{tone:"lime",children:"Popular"})]}),c.jsxs("div",{className:"ws-display mt-2 text-xl font-bold text-white",children:[i.price,c.jsxs("span",{className:"text-[12px] font-normal text-white/40",children:["/",i.period]})]}),c.jsxs("div",{className:"text-[12px] text-[var(--lp-lime)]",children:[Number(i.credits).toLocaleString()," credits"]})]},i.id))})]})]})}function tgt({f:n,user:e,onSent:t}){const r=n.emailStats||{},[i,s]=G.useState("welcome"),[a,o]=G.useState(!1),l=SP(),u=async()=>{var d;o(!0);try{const h=await p4e({template:i});l.show(`Sent â${(d=bj.find(f=>f.value===i))==null?void 0:d.label}â to ${h.targetEmail||e.email}`),t()}catch(h){l.show(h.message||"Could not send the test email",!1)}finally{o(!1)}};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[c.jsx(vs,{label:"Automation",value:r.jobsEnabled?"Enabled":"Disabled",icon:c.jsx(Jk,{}),tone:r.jobsEnabled?"ok":"bad"}),c.jsx(vs,{label:"Mode",value:r.isDryRun?"Dry run":"Live",foot:r.isDryRun?"logged, not sent":"emails go out",icon:c.jsx(Gv,{}),tone:r.isDryRun?"warn":"ok"}),c.jsx(vs,{label:"Sent in window",value:(r.totalSent??0).toLocaleString(),foot:`${r.sentToday??0} today · cap ${r.dailyCap??50}`,icon:c.jsx(OA,{})}),c.jsx(vs,{label:"Dry-run logs",value:(r.totalDryRun??0).toLocaleString(),icon:c.jsx(jq,{}),tone:"warn"})]}),c.jsx(Tc,{title:"Send yourself a test",subtitle:`Any lifecycle email, delivered to ${e.email}`,children:c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[c.jsx(J5,{value:i,onChange:s,options:bj,className:"flex-1"}),c.jsxs("button",{className:"adm-btn primary",onClick:u,disabled:a,children:[c.jsx(OA,{})," ",a?"Sendingâ¦":"Send test"]})]})}),c.jsx(Tc,{pad:!1,title:"Recent deliveries",subtitle:"Latest lifecycle emails, newest first",children:(r.recentLogs||[]).length===0?c.jsx(Ec,{icon:c.jsx(Gv,{}),title:"No emails sent in this window"}):c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"adm-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Recipient"}),c.jsx("th",{children:"Email"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"When"})]})}),c.jsx("tbody",{children:r.recentLogs.map(d=>{var h;return c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-[260px] truncate text-white/80",children:d.email}),c.jsx("td",{className:"text-white",children:((h=bj.find(f=>f.value===d.template))==null?void 0:h.label)||d.template}),c.jsx("td",{children:c.jsx(N0,{status:d.status})}),c.jsx("td",{className:"whitespace-nowrap text-white/50",children:Yd(d.sentAt,!0)})]},d.id)})})]})})}),l.node]})}const gxe=[{value:"free",label:"Free"},{value:"premium",label:"Premium"},{value:"pro",label:"Pro"},{value:"premium-tier-yearly",label:"Premium · yearly"},{value:"pro-tier-yearly",label:"Pro · yearly"}],XU=n=>{var e;return((e=gxe.find(t=>t.value===n))==null?void 0:e.label)||n||"Free"},ngt=n=>n.subscriptionStatus==="active"&&n.subscriptionPlan&&n.subscriptionPlan!=="free";function rgt({user:n}){const[e,t]=G.useState(0),[r,i]=G.useState(""),[s,a]=G.useState("all"),[o,l]=G.useState("all"),[u,d]=G.useState(null),h=d$(r),f=SP(),p=s==="all"?void 0:[s],{data:g,isLoading:A,isFetching:x,error:b,refetch:_}=Qr(_4e,{skip:e*10,emailContains:h.trim()||void 0,isAdmin:o==="admins"?!0:void 0,subscriptionStatus:p}),M=(g==null?void 0:g.users)||[],T=Math.max(1,(g==null?void 0:g.totalPages)||1),L=g==null?void 0:g.totalUsers,D=async(P,O)=>{try{await Aae({id:P.id,data:{credits:Math.max(0,(P.credits||0)+O)}}),f.show(`${O>0?"Added":"Removed"} ${Math.abs(O)} credits for ${P.email||P.username}`),_()}catch(F){f.show(F.message||"Could not update credits",!1)}};return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"People",title:"Users",subtitle:"Find any account, adjust credits and plans, and see what each person has generated.",actions:c.jsxs("button",{className:"adm-btn",onClick:()=>_(),children:[c.jsx(Xm,{className:x?"animate-spin":""})," Refresh"]})}
5865),c.jsxs("div",{className:"ws-enter mb-5 flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[c.jsx(cg,{value:s,onChange:P=>{a(P),t(0)},options:[{value:"all",label:"Everyone"},{value:"active",label:"Subscribed"},{value:"past_due",label:"Past due"},{value:"cancel_at_period_end",label:"Cancelling"},{value:"deleted",label:"Ended"}]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(_P,{value:r,onChange:P=>{i(P),t(0)},placeholder:"Search by emailâ¦",className:"w-full sm:w-72"}),c.jsx(J5,{value:o,onChange:P=>{l(P),t(0)},options:[{value:"all",label:"All roles"},{value:"admins",label:"Admins only"}]})]})]}),c.jsxs(Tc,{pad:!1,title:L!=null?`${L.toLocaleString()} ${L===1?"account":"accounts"}`:"Accounts",subtitle:"Sorted by most recently active",children:[A?c.jsx(Oy,{rows:8,cols:6}):b?c.jsx(Ly,{message:`Could not load users: ${b.message}`,onRetry:()=>_()}):M.length===0?c.jsx(Ec,{icon:c.jsx(Zu,{}),title:"No users match",body:"Try another email or filter."}):c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"adm-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"User"}),c.jsx("th",{children:"Plan"}),c.jsx("th",{children:"Credits"}),c.jsx("th",{children:"Generated"}),c.jsx("th",{children:"Joined"}),c.jsx("th",{children:"Last active"})]})}),c.jsx("tbody",{children:M.map(P=>{var O,F;return c.jsxs("tr",{className:"clickable",onClick:()=>d(P.id),children:[c.jsx("td",{className:"max-w-[300px]",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-full text-[13px] font-bold ${ngt(P)?"bg-[rgba(207,255,5,.15)] text-[var(--lp-lime)]":"bg-white/[0.06] text-white/70"}`,children:(P.email||P.username||"?").slice(0,1).toUpperCase()}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 truncate font-semibold text-white",children:[c.jsx("span",{className:"truncate",children:P.email||P.username||P.id}),P.isAdmin&&c.jsx(Jk,{className:"shrink-0 text-[var(--lp-lime)]",title:"Admin"})]}),c.jsxs("div",{className:"truncate text-[12px] text-white/40",children:[P.username?`@${P.username}`:P.id.slice(0,8),P.closed?" · deactivated":""]})]})]})}),c.jsx("td",{children:c.jsxs("div",{className:"flex flex-col items-start gap-1",children:[c.jsx("span",{className:"text-[13px] font-semibold text-white/85",children:XU(P.subscriptionPlan)}),P.subscriptionStatus&&c.jsx(N0,{status:P.subscriptionStatus})]})}),c.jsx("td",{onClick:U=>U.stopPropagation(),children:c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{className:"adm-btn sm icon",onClick:()=>D(P,-100),title:"Remove 100 credits",children:c.jsx(Cat,{})}),c.jsx("span",{className:"adm-num min-w-[64px] text-center font-semibold text-white",children:(P.credits??0).toLocaleString()}),c.jsx("button",{className:"adm-btn sm icon",onClick:()=>D(P,100),title:"Add 100 credits",children:c.jsx(Rat,{})})]})}),c.jsxs("td",{className:"text-[12.5px] text-white/60",children:[c.jsx("span",{className:"adm-num text-white",children:((O=P._count)==null?void 0:O.executions)??0})," runs · ",c.jsx("span",{className:"adm-num",children:((F=P._count)==null?void 0:F.workflows)??0})," workflows"]}),c.jsx("td",{className:"whitespace-nowrap text-white/55",children:Yd(P.createdAt)}),c.jsx("td",{className:"whitespace-nowrap text-white/55",children:Ym(P.lastActiveTimestamp)})]},P.id)})})]})}),!A&&M.length>0&&c.jsx(h$,{page:e,totalPages:T,total:L,pageSize:10,onPage:t,noun:"users"})]}),c.jsx(igt,{userId:u,currentAdminId:n.id,onClose:()=>d(null),onChanged:(P,O=!0)=>{f.show(P,O),_()}}),f.node]})}function igt({userId:n,currentAdminId:e,onClose:t,onChanged:r}){var x,b,_,M,T,L,D;const{data:i,isLoading:s,refetch:a}=Qr(D4e,{userId:n||""},{enabled:!!n}),[o,l]=G.useState(""),[u,d]=G.useState(null),[h,f]=G.useState(!1),p=i,g=p==null?void 0:p.user,A=async(P,O)=>{if(g){f(!0);try{await Aae({id:g.id,data:P}),r(O),a()}catch(F){r(F.message||"Update failed",!1)}finally{f(!1),d(null)}}};return c.jsxs(f$,{open:!!n,onClose:()=>{l(""),t()},title:(g==null?void 0:g.email)||(g==null?void 0:g.username)||"User",subtitle:g&&c.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[g.username&&c.jsxs("span",{children:["@",g.username]}),c.jsx("span",{className:"ws-mono text-[11px]",children:g.id}),c.jsx(h_,{text:g.id})]}
5865),children:[s||!g?c.jsx(Oy,{rows:8,cols:2}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Wi,{tone:g.subscriptionPlan&&g.subscriptionPlan!=="free"?"lime":"neutral",children:XU(g.subscriptionPlan)}),g.subscriptionStatus&&c.jsx(N0,{status:g.subscriptionStatus}),g.isAdmin&&c.jsxs(Wi,{tone:"lime",children:[c.jsx(Jk,{})," Admin"]}),g.isEmailVerified?c.jsx(Wi,{tone:"ok",children:"Email verified"}):c.jsx(Wi,{tone:"warn",children:"Email not verified"}),g.byokEnabled&&c.jsx(Wi,{tone:"info",children:"Own AI keys"}),g.closed&&c.jsx(Wi,{tone:"bad",children:"Deactivated"})]}),c.jsx("div",{className:"grid grid-cols-3 gap-2",children:[["Credits",(x=g.credits)==null?void 0:x.toLocaleString()],["Workflows",(b=g._count)==null?void 0:b.workflows],["Runs",(_=g._count)==null?void 0:_.executions],["Posts",(M=g._count)==null?void 0:M.posts],["Group searches",(T=g._count)==null?void 0:T.tasks],["Connected accounts",(L=g._count)==null?void 0:L.socialMediaConnections]].map(([P,O])=>c.jsxs("div",{className:"ws-card p-3.5",children:[c.jsx("div",{className:"text-[11.5px] text-white/45",children:P}),c.jsx("div",{className:"ws-display mt-1 text-xl font-bold text-white",children:O??0})]},P))}),Object.keys(p.executionStatus||{}).length>0&&c.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(p.executionStatus).map(([P,O])=>c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx(N0,{status:P}),c.jsx("span",{className:"adm-num text-[12px] text-white/60",children:O})]},P))}),c.jsx("div",{className:"ws-card divide-y divide-white/[0.06] text-[13px]",children:[["Joined",Yd(g.createdAt,!0)],["Last active",Ym(g.lastActiveTimestamp)],["Paid on",g.datePaid?Yd(g.datePaid):"â"],["Renews / expires",g.subscriptionExpiresAt?Yd(g.subscriptionExpiresAt):"â"],["Payment customer",g.paymentProcessorUserId||"â"],["Referrals",g.referralCount??0]].map(([P,O])=>c.jsxs("div",{className:"flex justify-between gap-4 px-4 py-2.5",children:[c.jsx("span",{className:"text-white/45",children:P}),c.jsx("span",{className:"truncate text-right text-white/85",children:O})]},P))}),c.jsxs("section",{children:[c.jsx("div",{className:"ws-kicker mb-3",children:"Credits"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[[-500,-100,100,500,1e3].map(P=>c.jsx("button",{className:"adm-btn sm",disabled:h,onClick:()=>A({credits:Math.max(0,(g.credits||0)+P)},`${P>0?"Added":"Removed"} ${Math.abs(P)} credits`),children:P>0?`+${P}`:P},P)),c.jsxs("label",{className:"adm-field h-8 w-36",children:[c.jsx(xat,{}),c.jsx("input",{type:"number",min:0,placeholder:"Set exact",value:o,onChange:P=>l(P.target.value)})]}),c.jsx("button",{className:"adm-btn sm primary",disabled:h||o==="",onClick:()=>{A({credits:Math.max(0,Number(o))},`Credits set to ${Number(o)}`),l("")},children:"Set"})]})]}),c.jsxs("section",{children:[c.jsx("div",{className:"ws-kicker mb-3",children:"Plan & access"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(J5,{value:g.subscriptionPlan||"free",onChange:P=>A({subscriptionPlan:P,subscriptionStatus:P==="free"?"deleted":"active"},`Plan changed to ${XU(P)}`),options:gxe}),c.jsxs("button",{className:"adm-btn sm",disabled:h||g.id===e,onClick:()=>d("admin"),title:g.id===e?"You cannot change your own admin role":"",children:[c.jsx(Jk,{})," ",g.isAdmin?"Remove admin":"Make admin"]})]})]}),((D=p.recentWorkflows)==null?void 0:D.length)>0&&c.jsxs("section",{children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[c.jsx("div",{className:"ws-kicker",children:"Recent workflows"}),c.jsx(Ks,{to:`/admin/workflows?user=${g.id}`,className:"text-[12px] text-[var(--lp-lime)] hover:underline",children:"See all with media â"})]}),c.jsx("div",{className:"space-y-1.5",children:p.recentWorkflows.map(P=>{var O;return c.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-white/[0.03] px-3.5 py-2.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-[13px] font-semibold text-white",children:P.name}),c.jsxs("div",{className:"text-[11.5px] text-white/40",children:[P.type," · ",Ym(P.createdAt)]})]}),(O=P.executions)!=null&&O[0]?c.jsx(N0,{status:P.executions[0].status}):c.jsx("span",{className:"text-[12px] text-white/35",children:"Not run"})]},P.id)})})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs(Ks,{to:`/admin/workflows?user=${g.id}`,className:"adm-btn sm",children:[c.jsx(hy,{})," Workflows"]}),c.jsxs(Ks,{to:`/admin/users/${g.id}/tasks`,className:"adm-btn sm",children:[c.jsx(ZR,{})," Group searches"]})]}),c.jsxs("section",{className:"rounded-2xl border border-rose-500/20 bg-rose-500/[0.04] p-4",children:[c.jsx("div",{className:"text-[13px] font-semibold text-rose-200",children:"Danger zone"}),c.jsx("p",{className:"mt-1 text-[12.5px] text-white/50",children:"Deleting removes the account and everything it created: workflows, runs, posts and files."}),c.jsxs("button",{className:"adm-btn sm danger mt-3",disabled:h||g.id===e,onClick:()=>d("delete"),children:[c.jsx(jat,{})," Delete account"]})]})]}),c.jsx(Sie,{open:u==="admin",title:g!=null&&g.isAdmin?"Remove admin access?":"Give admin access?",body:g!=null&&g.isAdmin?`${g==null?void 0:g.email} will lose access to this panel.`:`${g==null?void 0:g.email} will be able to see every user and change credits, plans and accounts.`,confirmLabel:g!=null&&g.isAdmin?"Remove admin":"Make admin",busy:h,onCancel:()=>d(null),onConfirm:()=>A({isAdmin:!g.isAdmin},g.isAdmin?"Admin access removed":"Admin access granted")}),c.jsx(Sie,{open:u==="delete",danger:!0,title:"Delete this account permanently?",body:c.jsxs(c.Fragment,{children:["All of ",c.jsx("b",{className:"text-white",children:(g==null?void 0:g.email)||(g==null?void 0:g.username)}),"âs workflows, runs, posts and files will be deleted. This cannot be undone."]}),confirmLabel:"Delete account",busy:h,onCancel:()=>d(null),onConfirm:async()=>{f(!0);
5865try{await bSe({id:g.id}),r(`Deleted ${g.email||g.username}`),d(null),t()}catch(P){r(P.message||"Delete failed",!1),d(null)}finally{f(!1)}}})]})}function p$(n){if(!n)return[];try{const e=JSON.parse(n);if(Array.isArray(e))return e.map(String)}catch{}return n.replace(/[\[\]"']/g,"").split(/[,;]/).map(e=>e.trim()).filter(Boolean)}function Axe(n){var e,t;return((e=n.searchKeywords)==null?void 0:e.trim())||((t=n.description)==null?void 0:t.trim())||"Untitled search"}function xxe({g:n}){const e=p$(n.socialMedias)[0]||n.socialMedias;return c.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",className:"ws-card adm-card-hover flex gap-3.5 p-3.5",children:[c.jsx("div",{className:"h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-white/[0.05]",children:n.image?c.jsx("img",{src:n.image,alt:"",loading:"lazy",className:"h-full w-full object-cover",onError:t=>{t.target.style.display="none"}}):c.jsx("div",{className:"grid h-full place-items-center text-white/30",children:c.jsx(Zu,{})})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("div",{className:"line-clamp-2 text-[13.5px] font-semibold leading-snug text-white",children:n.title||n.url}),c.jsx(Zk,{className:"mt-0.5 shrink-0 text-white/35"})]}),n.description&&c.jsx("p",{className:"mt-1 line-clamp-2 text-[12px] leading-relaxed text-white/50",children:n.description}),c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[e&&c.jsx(Wi,{children:e}),n.members&&c.jsxs(Wi,{tone:"info",children:[c.jsx(Zu,{})," ",n.members]}),n.engagement&&c.jsx(Wi,{children:n.engagement}),n.posted&&c.jsx(Wi,{tone:"lime",children:"Posted"})]})]})]})}function vxe({search:n,onClose:e}){var r;if(!n)return null;const t=n.subtasks||[];return c.jsxs(f$,{open:!!n,onClose:e,title:Axe(n),subtitle:c.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(N0,{status:n.isDone?"completed":"pending"}),((r=n.user)==null?void 0:r.email)&&c.jsx("span",{children:n.user.email}),c.jsxs("span",{children:["· ",Yd(n.createdAt,!0)]})]}),children:[c.jsxs("div",{className:"mb-5 space-y-3",children:[n.description&&n.description!==n.searchKeywords&&c.jsx("p",{className:"text-[13.5px] leading-relaxed text-white/75",children:n.description}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p$(n.socialMedias).map(i=>c.jsx(Wi,{children:i},i)),n.location&&c.jsxs(Wi,{tone:"info",children:[c.jsx(bAe,{})," ",n.location]}),c.jsx(h_,{text:n.id,label:"Search ID"})]})]}),c.jsxs("div",{className:"ws-kicker mb-3",children:[t.length," ",t.length===1?"group":"groups"," found"]}),t.length===0?c.jsx(Ec,{icon:c.jsx(Zu,{}),title:"No groups found",body:n.isDone?"This search finished without results.":"The search is still running."}):c.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:t.map(i=>c.jsx(xxe,{g:i},i.id))})]})}function sgt({user:n}){const[e,t]=G.useState(0),[r,i]=G.useState(""),[s,a]=G.useState("all"),[o,l]=G.useState(null),u=d$(r),d=15,{data:h,isLoading:f,isFetching:p,error:g,refetch:A}=Qr(L4e,{skip:e*d,take:d,search:u.trim()||void 0,isDone:s==="all"?void 0:s==="done",orderBy:{createdAt:"desc"}}),x=(h==null?void 0:h.tasks)||[],b=(h==null?void 0:h.totalTasks)??0,_=Math.max(1,(h==null?void 0:h.totalPages)??1),M=x.find(T=>T.id===o)||null;return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"Content",title:"Group searches",subtitle:"What users searched for, and the communities the search found for them.",actions:c.jsxs("button",{className:"adm-btn",onClick:()=>A(),children:[c.jsx(Xm,{className:p?"animate-spin":""})," Refresh"]})}),c.jsxs("div",{className:"ws-enter mb-5 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[c.jsx(cg,{value:s,onChange:T=>{a(T),t(0)},options:[{value:"all",label:"All"},{value:"done",label:"Finished"},{value:"pending",label:"Running"}]}),c.jsx(_P,{value:r,onChange:T=>{i(T),t(0)},placeholder:"Keywords, location, user emailâ¦",className:"w-full lg:w-80"})]}),c.jsxs(Tc,{pad:!1,children:[f?c.jsx(Oy,{rows:8,cols:5}):g?c.jsx(Ly,{message:`Could not load searches: ${g.message}`,onRetry:()=>A()}):x.length===0?c.jsx(Ec,{icon:c.jsx(ZR,{}),title:"No searches match",body:"Try other keywords or another filter."}):c.jsx(yxe,{searches:x,onOpen:l,showUser:!0}),!f&&x.length>0&&c.jsx(h$,{page:e,totalPages:_,total:b,pageSize:d,onPage:t,noun:"searches"})]}),c.jsx(vxe,{search:M,onClose:()=>l(null)})]})}function yxe({searches:n,onOpen:e,showUser:t=!1}){return c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"adm-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Search"}),c.jsx("th",{children:"Platforms"}),t&&c.jsx("th",{children:"User"}
5865),c.jsx("th",{children:"Groups found"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"When"})]})}),c.jsx("tbody",{children:n.map(r=>{var s,a,o;const i=(r.subtasks||[]).filter(l=>l.image).slice(0,3);return c.jsxs("tr",{className:"clickable",onClick:()=>e(r.id),children:[c.jsxs("td",{className:"max-w-[340px]",children:[c.jsx("div",{className:"truncate font-semibold text-white",children:Axe(r)}),r.location&&c.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-[12px] text-white/45",children:[c.jsx(bAe,{})," ",r.location]})]}),c.jsx("td",{children:c.jsx("div",{className:"flex flex-wrap gap-1",children:p$(r.socialMedias).slice(0,3).map(l=>c.jsx(Wi,{children:l},l))})}),t&&c.jsx("td",{className:"max-w-[200px] truncate text-white/65",children:((s=r.user)==null?void 0:s.email)||((a=r.user)==null?void 0:a.username)||"â"}),c.jsx("td",{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"flex -space-x-2",children:i.map(l=>c.jsx("img",{src:l.image,alt:"",className:"h-7 w-7 rounded-full object-cover ring-2 ring-[#07080d]",onError:u=>{u.target.style.display="none"}},l.id))}),c.jsx("span",{className:"adm-num font-semibold text-white",children:((o=r.subtasks)==null?void 0:o.length)??0})]})}),c.jsx("td",{children:c.jsx(N0,{status:r.isDone?"completed":"pending"})}),c.jsx("td",{className:"whitespace-nowrap text-white/50",children:Ym(r.createdAt)})]},r.id)})})]})})}function agt({src:n,className:e=""}){const t=G.useRef(null),[r,i]=G.useState(!1);return c.jsxs("div",{className:`relative h-full w-full ${e}`,onMouseEnter:()=>{var s;(s=t.current)==null||s.play().then(()=>i(!0)).catch(()=>{})},onMouseLeave:()=>{t.current&&(t.current.pause(),t.current.currentTime=.1),i(!1)},children:[c.jsx("video",{ref:t,src:`${n}#t=0.1`,muted:!0,playsInline:!0,loop:!0,preload:"metadata",className:"h-full w-full object-cover"}),!r&&c.jsx("div",{className:"adm-thumb-play",children:c.jsx("span",{className:"grid h-11 w-11 place-items-center rounded-full bg-black/55 text-white ring-1 ring-white/25 backdrop-blur",children:c.jsx(kat,{className:"ml-0.5"})})})]})}function bxe({videos:n,images:e,placeholder:t}){if(n.length)return c.jsx(agt,{src:n[0]});if(e.length===1)return c.jsx("img",{src:e[0],alt:"",loading:"lazy",className:"h-full w-full object-cover"});if(e.length>1){const r=e.slice(0,4);return c.jsx("div",{className:`grid h-full w-full gap-0.5 ${r.length===2?"grid-cols-2":"grid-cols-2 grid-rows-2"}`,children:r.map((i,s)=>c.jsxs("div",{className:`relative overflow-hidden ${r.length===3&&s===0?"row-span-2":""}`,children:[c.jsx("img",{src:i,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),s===3&&e.length>4&&c.jsxs("div",{className:"absolute inset-0 grid place-items-center bg-black/55 text-sm font-bold text-white",children:["+",e.length-4]})]},i))})}return c.jsx("div",{className:"grid h-full w-full place-items-center text-white/25",children:t||c.jsx(yAe,{className:"text-3xl"})})}function wxe({videos:n,images:e,vertical:t=!0}){const[r,i]=G.useState(null);return c.jsxs("div",{className:"space-y-3",children:[n.map(s=>c.jsxs("div",{className:`adm-media contain ${t?"mx-auto max-w-[340px]":""}`,children:[c.jsx("video",{src:s,controls:!0,playsInline:!0,preload:"metadata",className:"max-h-[560px] w-full"}),c.jsxs("div",{className:"flex justify-end gap-3 border-t border-white/[0.06] bg-black/40 px-3 py-2",children:[c.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-white/55 hover:text-white",children:[c.jsx(Zk,{})," Open"]}),c.jsxs("a",{href:s,download:!0,className:"inline-flex items-center gap-1 text-[11px] text-white/55 hover:text-white",children:[c.jsx(vat,{})," Download"]})]})]},s)),e.length>0&&c.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:e.map((s,a)=>c.jsxs("button",{type:"button",onClick:()=>i(a),className:"adm-media adm-card-hover aspect-[4/5]",children:[c.jsx("img",{src:s,alt:`Slide ${a+1}`,loading:"lazy"}),c.jsx("span",{className:"absolute bottom-1.5 left-1.5 rounded-md bg-black/60 px-1.5 py-0.5 font-mono text-[10px] text-white/80",children:a+1})]},s))}),r!=null&&c.jsx(ogt,{images:e,index:r,onIndex:i,onClose:()=>i(null)})]})}function ogt({images:n,index:e,onIndex:t,onClose:r}){return G.useEffect(()=>{const i=s=>{s.key==="Escape"&&r(),s.key==="ArrowRight"&&t((e+1)%n.length),s.key==="ArrowLeft"&&t((e-1+n.length)%n.length)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,n.length,t,r]),Vl.createPortal(c.jsxs("div",{className:"ws",children:[c.jsx("div",{className:"adm-overlay",style:{zIndex:90,background:"rgba(0,0,0,.88)"},onClick:r}),c.jsx("div",{className:"fixed inset-0 z-[91] flex items-center justify-center p-6",onClick:r,children:c.jsx("img",{src:n[e],alt:"",className:"max-h-[88vh] max-w-[92vw] rounded-2xl object-contain shadow-2xl",onClick:i=>i.stopPropagation()})}),c.jsxs("div",{className:"fixed left-1/2 top-5 z-[92] -translate-x-1/2 roun
5865ded-full bg-black/60 px-3 py-1 font-mono text-xs text-white/80",children:[e+1," / ",n.length]}),c.jsx("button",{className:"adm-btn icon fixed right-5 top-5 z-[92]",onClick:r,"aria-label":"Close",children:c.jsx(JR,{})}),n.length>1&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"adm-btn icon fixed left-5 top-1/2 z-[92] -translate-y-1/2",onClick:()=>t((e-1+n.length)%n.length),"aria-label":"Previous",children:c.jsx(gAe,{})}),c.jsx("button",{className:"adm-btn icon fixed right-5 top-1/2 z-[92] -translate-y-1/2",onClick:()=>t((e+1)%n.length),"aria-label":"Next",children:c.jsx(AAe,{})})]})]}),document.body)}const g8=n=>typeof n=="string"&&/^(https?:)?\/\//i.test(n.trim()),lgt=n=>/\.(mp4|webm|mov|m4v)(\?|#|$)/i.test(n)||/\/video[s]?\//i.test(n),cgt=n=>/\.(jpe?g|png|webp|gif|avif)(\?|#|$)/i.test(n),Tie=n=>[...new Set(n.filter(Boolean))];function Gp(n){return n?typeof n=="string"?g8(n)?[n]:[]:Array.isArray(n)?n.flatMap(e=>typeof e=="string"?g8(e)?[e]:[]:Gp(e==null?void 0:e.url)):[]:[]}function ugt(n){return!n||typeof n!="object"?[]:(Array.isArray(n)?n.map(t=>[(t==null?void 0:t.platform)||(t==null?void 0:t.name),t]):Object.entries(n)).filter(([t])=>!!t).map(([t,r])=>({platform:String(t),ok:r===!0||(r==null?void 0:r.success)===!0||(r==null?void 0:r.status)==="success"||(r==null?void 0:r.status)==="published"||!!(r!=null&&r.url)&&!(r!=null&&r.error),url:(r==null?void 0:r.url)||(r==null?void 0:r.postUrl)||(r==null?void 0:r.permalink),error:r!=null&&r.error?String(r.error):void 0}))}function m$(n,e){const t={videos:[],images:[],platforms:[]},r=(n||"").trim();let i=null;if(r.startsWith("{")||r.startsWith("["))try{i=JSON.parse(r)}catch{i=null}if(i&&typeof i=="object"&&!Array.isArray(i)){const s=[...Gp(i.videoUrls),...Gp(i.finalVideoUrl),...Gp(i.videoUrl),...Gp(i.renderedVideoUrl)],a=[...Gp(i.imageUrls),...Gp(i.images),...Gp(i.sceneImageUrl)];t.videos=s,t.images=a,g8(i.audioUrl)&&(t.audio=String(i.audioUrl));const o=typeof i.text=="string"?i.text.trim():"";/^error[:\s]/i.test(o)||i.error?t.error=String(i.error||o).replace(/^error:\s*/i,""):o&&(t.caption=o),typeof i.step=="string"&&(t.note=i.step),t.liveUrl=i.liveUrl||i.postUrl||void 0,t.publishedAt=i.publishedAt||void 0,i.publishError&&(t.publishError=String(i.publishError)),t.platforms=ugt(i.platformResults)}else g8(r)?(cgt(r)&&!lgt(r)?t.images:t.videos).push(r):r&&(/^error[:\s]|failed|timed out/i.test(r)?t.error=r.replace(/^error:\s*/i,""):t.note=r);return e&&(t.videos.push(...Gp(e.videoUrls)),t.images.push(...Gp(e.imageUrls)),!t.caption&&e.text&&(t.caption=e.text)),t.error&&(t.error=hgt(t.error)),t.videos=Tie(t.videos),t.images=Tie(t.images).filter(s=>!t.videos.includes(s)),t}function eT(n){return n.videos.length>0||n.images.length>0}const dgt=[[/WORKFLOW_CANCELLED/,"Stopped before it finished (cancelled, or replaced by a newer run)."],[/Insufficient credits/i,"The user ran out of credits."],[/timed out|timeout/i,"Took too long and was stopped (timeout)."],[/GPU (render )?servers? (are )?(currently )?(unavailable|offline)/i,"No GPU server was available to render it."]];function hgt(n){for(const[e,t]of dgt)if(e.test(n))return t;return n}const X6={video:{label:"Short video",icon:c.jsx(Vat,{}),wide:!1},"long-video":{label:"Long video",icon:c.jsx(bat,{}),wide:!0},"text-image":{label:"Carousel / post",icon:c.jsx(yAe,{}),wide:!1},"podcast-video":{label:"Podcast",icon:c.jsx(Eat,{}),wide:!0}},D4=n=>X6[n||""]||{label:n||"Workflow",icon:c.jsx(hy,{}),wide:!1},A8=n=>{if(!n)return{};if(typeof n=="object")return n;try{const e=JSON.parse(n);return typeof e=="string"?JSON.parse(e):e}catch{return{}}},tT=n=>n?n.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()):"";function _xe(n,e){var i;let t;try{t=(i=JSON.parse(n.result||"{}"))==null?void 0:i.postId}catch{}const r=(e.posts||[]).find(s=>s.id===t)||null;return m$(n.result,r)}function Sxe(n){for(const t of n.executions||[]){const r=_xe(t,n);if(eT(r))return{view:r,exec:t}}const e=(n.posts||[])[0];return e?{view:m$(null,e),exec:(n.executions||[])[0]||null}:{view:null,exec:(n.executions||[])[0]||null}}function fgt({user:n}){var J,ee;const[e,t]=G.useState(0),[r,i]=G.useState(24),[s,a]=G.useState(""),[o,l]=G.useState("all"),[u,d]=G.useState("all"),[h,f]=G.useState("grid"),[p,g]=G.useState(null),A=d$(s),[x,b]=D2e(),_=x.get("user")||void 0,{data:M,isLoading:T,isFetching:L,error:D,refetch:P}=Qr(O4e,{skip:e*r,take:r,search:A.trim()||void 0,type:o!=="all"?o:void 0,status:u!=="all"?u:void 0,userId:_,orderBy:{createdAt:"desc"}}),O=(M==null?void 0:M.workflows)||[],F=(M==null?void 0:M.totalWorkflows)??0,U=Math.max(1,(M==null?void 0:M.totalPages)??1),B=(M==null?void 0:M.statusCounts)||{},z=(M==null?void 0:M.typeCounts)||{},H=Object.values(z).reduce((ae,le)=>ae+le,0),X=O.find(ae=>ae.id===p)||null,W=ae=>le=>{ae(le),t(0)};return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"Content",title:"Workflows",subtitle:"Everything users generated: the videos, carousels and captions themselves, with where and when they were published.",actions:c.jsxs("button",{className:"adm-btn",onClick:()=>P(),children:[c.jsx(Xm,{className:L?"animate-spin":""})," Refresh"]})}),c.jsxs("div",{className:"ws-stagger mb-6 grid grid-cols-2 gap-3 lg:grid-cols-5",children:[c.jsx(vs,{label:"Workflows",value:H.toLocaleStr
5865ing(),icon:c.jsx(hy,{}),tone:"lime",loading:T}),c.jsx(vs,{label:"Completed",value:(B.completed||0).toLocaleString(),icon:c.jsx(I1,{}),tone:"ok",loading:T}),c.jsx(vs,{label:"Published",value:(B.posted||0).toLocaleString(),icon:c.jsx(OA,{}),tone:"lime",loading:T}),c.jsx(vs,{label:"In progress",value:((B.processing||0)+(B.queued||0)+(B.running||0)).toLocaleString(),icon:c.jsx(xAe,{}),tone:"info",loading:T}),c.jsx(vs,{label:"Failed",value:(B.failed||0).toLocaleString(),icon:c.jsx(Iq,{}),tone:"bad",loading:T})]}),_&&c.jsxs("div",{className:"ws-enter mb-4 flex items-center gap-2 text-[13px] text-white/60",children:["Showing one userâs workflows",(ee=(J=O[0])==null?void 0:J.user)!=null&&ee.email?c.jsxs(c.Fragment,{children:[" · ",c.jsx("b",{className:"text-white",children:O[0].user.email})]}):null,c.jsx("button",{className:"adm-btn sm",onClick:()=>{x.delete("user"),b(x),t(0)},children:"Show everyone"})]}),c.jsxs("div",{className:"ws-enter mb-5 flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[c.jsx(cg,{value:o,onChange:W(l),options:[{value:"all",label:`All ${H?`· ${H}`:""}`},...Object.keys(X6).filter(ae=>z[ae]).map(ae=>({value:ae,label:`${X6[ae].label} · ${z[ae]}`,icon:X6[ae].icon}))]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(_P,{value:s,onChange:W(a),placeholder:"Name, user email, IDâ¦",className:"w-full sm:w-72"}),c.jsx(J5,{value:u,onChange:W(d),options:[{value:"all",label:"Any status"},{value:"completed",label:"Completed"},{value:"posted",label:"Published"},{value:"processing",label:"Processing"},{value:"queued",label:"Queued"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}]}),c.jsxs("div",{className:"adm-seg",children:[c.jsx("button",{className:h==="grid"?"on":"",onClick:()=>f("grid"),"aria-label":"Grid view",children:c.jsx(wat,{})}),c.jsx("button",{className:h==="list"?"on":"",onClick:()=>f("list"),"aria-label":"List view",children:c.jsx(_at,{})})]})]})]}),c.jsxs(Tc,{pad:!1,children:[T?c.jsx(Oy,{rows:6,cols:4}):D?c.jsx(Ly,{message:`Could not load workflows: ${D.message}`,onRetry:()=>P()}):O.length===0?c.jsx(Ec,{icon:c.jsx(hy,{}),title:"No workflows match",body:A||o!=="all"||u!=="all"?"Try a different search or filter.":"Nothing has been generated yet."}):h==="grid"?c.jsx("div",{className:"ws-stagger grid grid-cols-1 gap-4 p-4 sm:grid-cols-2 sm:p-5 lg:grid-cols-3 2xl:grid-cols-4",children:O.map(ae=>c.jsx(pgt,{wf:ae,onOpen:()=>g(ae.id)},ae.id))}):c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"adm-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{}),c.jsx("th",{children:"Workflow"}),c.jsx("th",{children:"Type"}),c.jsx("th",{children:"User"}),c.jsx("th",{children:"Latest run"}),c.jsx("th",{children:"Runs"}),c.jsx("th",{children:"Created"})]})}),c.jsx("tbody",{children:O.map(ae=>{var re,_e,Ee;const{view:le,exec:Z}=Sxe(ae),Y=A8(ae.options);return c.jsxs("tr",{className:"clickable",onClick:()=>g(ae.id),children:[c.jsx("td",{className:"w-[72px]",children:c.jsx("div",{className:"adm-media h-14 w-14 rounded-xl",children:c.jsx(bxe,{videos:(le==null?void 0:le.videos)||[],images:(le==null?void 0:le.images)||[],placeholder:D4(ae.type).icon})})}),c.jsxs("td",{className:"max-w-[280px]",children:[c.jsx("div",{className:"truncate font-semibold text-white",children:ae.name||"Untitled"}),c.jsx("div",{className:"truncate text-[12px] text-white/45",children:tT(Y.workflowSubType||Y.contentStyle)||"â"})]}),c.jsx("td",{children:c.jsxs(Wi,{children:[D4(ae.type).icon,D4(ae.type).label]})}),c.jsx("td",{className:"max-w-[200px] truncate text-white/70",children:((re=ae.user)==null?void 0:re.email)||((_e=ae.user)==null?void 0:_e.username)||"â"}),c.jsx("td",{children:Z?c.jsx(N0,{status:Z.status}):c.jsx("span",{className:"text-white/35",children:"Never run"})}),c.jsx("td",{className:"adm-num",children:((Ee=ae.executions)==null?void 0:Ee.length)||0}),c.jsx("td",{className:"whitespace-nowrap text-white/50",children:Ym(ae.createdAt)})]},ae.id)})})]})}),!T&&!D&&O.length>0&&c.jsxs("div",{className:"flex flex-col items-center justify-between sm:flex-row",children:[c.jsx("div",{className:"px-5 pt-4 sm:pt-0",children:c.jsx(J5,{value:r,onChange:ae=>{i(Number(ae)),t(0)},options:[{value:12,label:"12 per page"},{value:24,label:"24 per page"},{value:48,label:"48 per page"}]})}),c.jsx("div",{className:"flex-1",children:c.jsx(h$,{page:e,totalPages:U,total:F,pageSize:r,onPage:t,noun:"workflows"})})]})]}),c.jsx(mgt,{wf:X,onClose:()=>g(null)})]})}function pgt({wf:n,onOpen:e}){var a,o;const{view:t,exec:r}=Sxe(n),i=D4(n.type),s=A8(n.options);return c.jsxs("button",{type:"button",onClick:e,className:"ws-card adm-card-hover group flex flex-col overflow-hidden text-left",children:[c.jsxs("div",{className:"relative aspect-[4/3] bg-black/40",children:[c.jsx(bxe,{videos:(t==null?void 0:t.videos)||[],images:(t==null?void 0:t.images)||[],placeholder:c.jsx("span",{className:"text-4xl",children:i.icon})}),c.jsx("div",{className:"absolute left-3 top-3 flex gap-1.5",children:r&&c.jsx(N0,{status:r.status})}),(t==null?void 0:t.error)&&!eT(t)&&c.jsx("div",{className:"absolute inset-x-3 bottom-3 rounded-xl bg-rose-950/80 px-3 py-2 text-[11.5px] leading-snug text-rose-200 ring-1 ring-rose-500/30 line-clamp-3",children:t.error})]}),c.jsxs("div",{className:"flex flex-1 flex-col gap-2 p-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-[14px] font-bold text-white",children:n.name||"Untitled"}),c.jsx("div",{className:"truncate text-[12px] text-white/45",children:((a=n.user)==null?void 0:a.email)||((o=n.user)==null?void 0:o.username)||"â"})]}),c.jsx("span",{className:"shrink-0 text-lg text-white/35",children:i.icon})]}),(t==null?void 0:t.caption)&&c.jsx("p",{className:"line-clamp-2 text-[12.5px] leading-relaxed text-white/60",children:t.caption}),c.jsxs("div",{className:"mt-auto flex flex-wrap items-center gap-1.5 pt-1",children:[(s.workflowSubType||s.contentStyle)&&c.jsx(Wi,{children:tT(s.workflowSubType||s.contentStyle)}),s.isAutoPilotChild&&c.jsx(Wi,{tone:"violet",children:"Auto-Pilot"}),c.jsx("span",{className:"ml-auto text-[11.5px] text-white/40",children:Ym(n.createdAt)})]})]})]})}function mgt({wf:n,onClose:e}){var o,l,u;const[t,r]=G.useState("runs"),i=G.useMemo(()=>A8(n==null?void 0:n.options),[n]),s=G.useMemo(()=>A8(n==null?void 0:n.schedule),[n]);if(!n)return null;const a=D4(n.type);return c.jsxs(f$,{open:!!n,onClose:()=>{r("runs"),e()},title:n.name||"Untitled workflow",subtitle:c.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs(Wi,{children:[a.icon,a.label]}),(i.workflowSubType||i.contentStyle)&&c.jsx(Wi,{children:tT(i.workflowSubType||i.contentStyle)}),c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(Bat,{})," ",((o=n.user)==null?void 0:o.email)||((l=n.user)==null?void 0:l.username)||"â"]}
5865),c.jsxs("span",{children:["· created ",Yd(n.createdAt,!0)]})]}),children:[c.jsx("div",{className:"mb-5",children:c.jsx(cg,{value:t,onChange:r,options:[{value:"runs",label:`Runs · ${((u=n.executions)==null?void 0:u.length)||0}`,icon:c.jsx(e8,{})},{value:"settings",label:"Settings",icon:c.jsx(Pat,{})}]})}),t==="runs"?(n.executions||[]).length===0&&!(n.posts||[]).length?c.jsx(Ec,{icon:c.jsx(e8,{}),title:"Never run",body:"This workflow has no generations yet."}):c.jsxs("div",{className:"space-y-5",children:[(n.executions||[]).map(d=>c.jsx(ggt,{ex:d,wf:n,wide:a.wide},d.id)),c.jsx(Agt,{wf:n,wide:a.wide})]}):c.jsx(xgt,{wf:n,opts:i,schedule:s})]})}function ggt({ex:n,wf:e,wide:t}){const r=_xe(n,e);return c.jsxs("div",{className:"ws-card p-4",children:[c.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(N0,{status:n.status}),c.jsx("span",{className:"text-[12px] text-white/50",children:Yd(n.createdAt,!0)})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(h_,{text:n.id,label:"ID"}),c.jsxs(Ks,{to:`/executions?id=${n.id}`,className:"inline-flex items-center gap-1 text-[11px] text-white/45 hover:text-white",children:[c.jsx(Zk,{})," In app"]})]})]}),eT(r)&&c.jsx(wxe,{videos:r.videos,images:r.images,vertical:!t}),r.audio&&c.jsx("audio",{src:r.audio,controls:!0,className:"mt-3 w-full"}),r.error&&c.jsxs("div",{className:"mt-3 rounded-xl border border-rose-500/25 bg-rose-500/[0.07] px-3.5 py-3 text-[13px] text-rose-200",children:[c.jsx("b",{className:"mr-1",children:"Failed:"}),r.error]}),!r.error&&r.note&&!eT(r)&&c.jsx("div",{className:"mt-1 rounded-xl bg-white/[0.04] px-3.5 py-3 text-[13px] text-white/65",children:r.note}),r.caption&&c.jsxs("div",{className:"mt-3 rounded-xl bg-white/[0.035] p-3.5",children:[c.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[c.jsx("span",{className:"ws-kicker !text-[10px] !text-white/40",children:"Caption"}),c.jsx(h_,{text:r.caption,label:"Copy"})]}),c.jsx("p",{className:"whitespace-pre-line text-[13px] leading-relaxed text-white/80",children:r.caption})]}),(r.liveUrl||r.publishError||r.platforms.length>0)&&c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[r.liveUrl&&c.jsxs("a",{href:r.liveUrl,target:"_blank",rel:"noreferrer",className:"adm-btn sm primary",children:[c.jsx(Zk,{})," View live post"]}),r.publishedAt&&c.jsxs("span",{className:"text-[12px] text-white/50",children:["Published ",Yd(r.publishedAt,!0)]}),r.platforms.map(i=>c.jsx(Wi,{tone:i.ok?"ok":"bad",title:i.error,children:i.platform},i.platform)),r.publishError&&c.jsxs("span",{className:"w-full text-[12px] text-amber-200/90",children:["Publishing problem: ",r.publishError]})]})]})}function Agt({wf:n,wide:e}){const t=new Set((n.executions||[]).map(i=>{var s;try{return(s=JSON.parse(i.result||"{}"))==null?void 0:s.postId}catch{return null}}).filter(Boolean)),r=(n.posts||[]).filter(i=>!t.has(i.id));return r.length?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"ws-kicker pt-2",children:"Earlier output"}),r.map(i=>{const s=m$(null,i);return c.jsxs("div",{className:"ws-card p-4",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(Wi,{children:"Post"}),c.jsx("span",{className:"text-[12px] text-white/50",children:Yd(i.createdAt,!0)})]}),eT(s)&&c.jsx(wxe,{videos:s.videos,images:s.images,vertical:!e}),s.caption&&c.jsx("p",{className:"mt-3 whitespace-pre-line rounded-xl bg-white/[0.035] p-3.5 text-[13px] leading-relaxed text-white/80",children:s.caption})]},i.id)})]}):null}function xgt({wf:n,opts:e,schedule:t}){var l;const[r,i]=G.useState(!1),s=e.creativeBrief||null,a=[["Product / source",e.productUrl||e.sourceUrl||e.rssItemLink],["Product name",e.productName],["Language",e.language],["Style",tT(e.workflowSubType||e.contentStyle)],["Duration",e.videoGenerationLimit||e.duration?`${e.videoGenerationLimit||e.duration}s`:void 0],["Images",e.numberOfImages?`${e.numberOfImages} · ${tT(e.imageGenerationOption)}
5865`:void 0],["Voice",[e.voiceGender,e.voiceType].filter(Boolean).join(" · ")||void 0],["Platforms",n.socialMedias],["Schedule",(l=t==null?void 0:t.days)!=null&&l.length?`${t.days.join(", ")}${t.times?` at ${Object.values(t.times).join(", ")}`:""}`:void 0]],o=[["Viral hook",!!e.enableViralHook],["Avatar",!!e.enableAvatar],["Captions",e.enableCaptions!==!1],["Music",!!e.enableBackgroundMusic],["Auto-Pilot",!!e.isAutoPilotChild],["No credits",!!e.isAdSupported]];return c.jsxs("div",{className:"space-y-5",children:[c.jsx("div",{className:"ws-card divide-y divide-white/[0.06]",children:a.filter(([,u])=>u).map(([u,d])=>c.jsxs("div",{className:"flex items-start justify-between gap-4 px-4 py-3 text-[13px]",children:[c.jsx("span",{className:"shrink-0 text-white/45",children:u}),c.jsx("span",{className:"min-w-0 break-words text-right text-white/85",children:String(d).startsWith("http")?c.jsx("a",{href:String(d),target:"_blank",rel:"noreferrer",className:"text-[var(--lp-lime)] hover:underline",children:String(d)}):String(d)})]},u))}),c.jsx("div",{className:"flex flex-wrap gap-2",children:o.map(([u,d])=>c.jsxs(Wi,{tone:d?"lime":"neutral",children:[d?"â":"â"," ",u]},u))}),s&&c.jsxs("div",{className:"ws-card space-y-2 p-4 text-[13px]",children:[c.jsx("div",{className:"ws-kicker mb-1",children:"Creative brief"}),s.formatLabel&&c.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[c.jsx(Wi,{tone:"violet",children:s.formatLabel}),s.pillarLabel&&c.jsx(Wi,{children:s.pillarLabel}),s.openerLabel&&c.jsx(Wi,{tone:"info",children:s.openerLabel})]}),s.anchor&&c.jsxs("p",{children:[c.jsx("span",{className:"text-white/45",children:"Anchor · "}),c.jsx("span",{className:"text-white/85",children:s.anchor})]}),s.hook&&c.jsxs("p",{children:[c.jsx("span",{className:"text-white/45",children:"Hook · "}),c.jsxs("span",{className:"text-white/85",children:["â",s.hook,"â"]})]}),s.concept&&c.jsxs("p",{children:[c.jsx("span",{className:"text-white/45",children:"Concept · "}),c.jsx("span",{className:"text-white/75",children:s.concept})]})]}),(e.postDescription||n.description)&&c.jsxs("div",{className:"ws-card p-4",children:[c.jsx("div",{className:"ws-kicker mb-2 !text-white/40",children:"Planned caption"}),c.jsx("p",{className:"whitespace-pre-line text-[13px] leading-relaxed text-white/75",children:e.postDescription||n.description})]}),c.jsxs("div",{children:[c.jsxs("button",{className:"adm-btn sm",onClick:()=>i(!r),children:[c.jsx(gat,{})," ",r?"Hide":"Show"," raw settings"]}),r&&c.jsxs("div",{className:"mt-3 rounded-2xl border border-white/[0.07] bg-black/40",children:[c.jsxs("div",{className:"flex justify-between px-4 py-2",children:[c.jsx("span",{className:"ws-mono text-[11px] text-white/40",children:"workflow.options"}),c.jsx(h_,{text:JSON.stringify(e,null,2),label:"Copy JSON"})]}),c.jsx("pre",{className:"max-h-80 overflow-auto px-4 pb-4 text-[11.5px] leading-relaxed text-white/70",children:JSON.stringify(e,null,2)})]})]}),c.jsxs("div",{className:"flex items-center gap-2 text-[12px] text-white/40",children:[c.jsx(pat,{})," Workflow ID ",c.jsx("span",{className:"ws-mono",children:n.id}),c.jsx(h_,{text:n.id})]})]})}function vgt({user:n}){var d,h,f,p;const{userId:e=""}=ese(),{data:t,isLoading:r,error:i,refetch:s}=Qr(P4e,{userId:e},{enabled:!!e}),a=t||[],[o,l]=G.useState(null),u=((h=(d=a[0])==null?void 0:d.user)==null?void 0:h.email)||((p=(f=a[0])==null?void 0:f.user)==null?void 0:p.username)||"this user";return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"People · Group searches",title:`Searches by ${u}`,subtitle:`${a.length} ${a.length===1?"search":"searches"}, newest first.`,actions:c.jsxs(Ks,{to:"/admin/users",className:"adm-btn",children:[c.jsx(Fq,{})," All users"]})}),c.jsx(Tc,{pad:!1,children:r?c.jsx(Oy,{rows:6,cols:4}):i?c.jsx(Ly,{message:`Could not load searches: ${i.message}`,onRetry:()=>s()}):a.length===0?c.jsx(Ec,{icon:c.jsx(ZR,{}),title:"No group searches yet"}):c.jsx(yxe,{searches:a,onOpen:l})}),c.jsx(vxe,{search:a.find(g=>g.id===o)||null,onClose:()=>l(null)})]})}function ygt({user:n}){const{userId:e,taskId:t=""}=ese(),{data:r,isLoading:i,error:s,refetch:a}=Qr(I4e,{taskId:t},{enabled:!!t}),o=r||[];return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"Group search",title:"Groups foun
5865d",subtitle:`${o.length} ${o.length===1?"community":"communities"} for this search.`,actions:c.jsxs(Ks,{to:e?`/admin/users/${e}/tasks`:"/admin/tasks",className:"adm-btn",children:[c.jsx(Fq,{})," Back to searches"]})}),c.jsx(Tc,{children:i?c.jsx(Oy,{rows:5,cols:2}):s?c.jsx(Ly,{message:`Could not load groups: ${s.message}`,onRetry:()=>a()}):o.length===0?c.jsx(Ec,{icon:c.jsx(Zu,{}),title:"No groups found for this search"}):c.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:o.map(l=>c.jsx(xxe,{g:l},l.id))})})]})}const bgt=[{value:7,label:"7 days"},{value:30,label:"30 days"},{value:90,label:"90 days"},{value:365,label:"All time"}];function wgt({user:n}){var A,x,b;const[e,t]=G.useState(30),[r,i]=G.useState("chart"),{data:s,isLoading:a,isFetching:o,error:l,refetch:u}=Qr(kae,{days:e}),d=s||{},h=d.steps||[],f=((A=h[0])==null?void 0:A.uniqueUsers)||1,p=h.slice(1).reduce((_,M)=>!_||M.dropoffFromPrevious>_.dropoffFromPrevious?M:_,null),g=p?h.indexOf(p):-1;return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"Insights",title:"Conversion funnel",subtitle:"How far people get, from first visit to paying â and where they drop off.",actions:c.jsxs(c.Fragment,{children:[c.jsx(cg,{value:e,onChange:t,options:bgt}),c.jsx("button",{className:"adm-btn icon",onClick:()=>u(),"aria-label":"Refresh",children:c.jsx(Xm,{className:o?"animate-spin":""})})]})}),c.jsxs("div",{className:"ws-stagger mb-6 grid grid-cols-2 gap-3 lg:grid-cols-4",children:[c.jsx(vs,{label:"Entered the funnel",value:(((x=h[0])==null?void 0:x.uniqueUsers)??0).toLocaleString(),foot:(b=h[0])==null?void 0:b.name,icon:c.jsx(Zu,{}),loading:a}),c.jsx(vs,{label:"Activated",value:`${d.signupToActivatedConversionRate??0}%`,foot:"of sign-ups made a generation",icon:c.jsx(M4,{}),tone:"ok",loading:a}),c.jsx(vs,{label:"Became paying",value:`${d.signupToPaidConversionRate??0}%`,foot:`${d.totalPaidUsers??0} customers`,icon:c.jsx(M4,{}),tone:"lime",loading:a}),c.jsx(vs,{label:"Biggest drop-off",value:p?`${p.dropoffFromPrevious}%`:"â",foot:p?`before â${p.name}â`:"no data yet",icon:c.jsx(Iat,{}),tone:"bad",loading:a})]}),c.jsx(Tc,{title:`${h.length} steps`,subtitle:"Unique users per step; the percentage on the right is of everyone who entered.",right:c.jsx(cg,{value:r,onChange:i,options:[{value:"chart",label:"Chart"},{value:"table",label:"Table"}]}),children:a?c.jsx("div",{className:"space-y-4",children:Array.from({length:8}).map((_,M)=>c.jsx("div",{className:"ws-skeleton h-8 rounded-xl"},M))}):l?c.jsx(Ly,{message:"Could not load the funnel.",onRetry:()=>u()}):h.length===0?c.jsx(Ec,{icon:c.jsx(M4,{}),title:"No events in this window",body:"Pick a longer window."}):r==="chart"?c.jsx("div",{children:h.map((_,M)=>c.jsxs("div",{children:[M>0&&c.jsxs("div",{className:"flex items-center gap-2 py-1.5 pl-1 text-[11.5px]",children:[c.jsx(fat,{className:"text-white/25"}),c.jsxs("span",{className:M===g?"font-semibold text-rose-300":"text-white/40",children:[_.conversionFromPrevious,"% continued",_.dropoffFromPrevious>0?` · ${_.dropoffFromPrevious}% dropped`:"",M===g?" â biggest leak":""]})]}),c.jsxs("div",{className:"group relative",children:[c.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-3 text-[13px]",children:[c.jsxs("span",{className:"font-semibold text-white",children:[c.jsx("span",{className:"adm-num mr-2 text-white/35",children:String(M+1).padStart(2,"0")}),_.name]}),c.jsxs("span",{className:"adm-num shrink-0 text-white/60",children:[_.uniqueUsers.toLocaleString()," users · ",c.jsxs("span",{className:"text-white",children:[_.overallConversion,"%"]})]})]}),c.jsx("div",{className:"h-3.5 overflow-hidden rounded-full bg-white/[0.05]",title:`${_.name}: ${_.uniqueUsers} users, ${_.count} events`,children:c.jsx("div",{className:"h-full rounded-full bg-[var(--lp-lime)] transition-all duration-700",style:{width:`${Math.max(1.5,_.uniqueUsers/f*100)}%`}})})]})]},_.step))}):c.jsx("div",{className:"-mx-5 overflow-x-auto sm:-mx-6",children:c.jsxs("table",{className:"adm-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"#"}),c.jsx("th",{children:"Step"}),c.jsx("th",{children:"Users"}),c.jsx("th",{children:"Events"}),c.jsx("th",{children:"Continued"}),c.jsx("th",{children:"Dropped"}),c.jsx("th",{children:"Of total"})]})}),c.jsx("tbody",{children:h.map((_,M)=>c.jsxs("tr",{children:[c.jsx("td",{className:"adm-num text-white/40",children:M+1}),c.jsx("td",{className:"font-semibold text-white",children:_.name}),c.jsx("td",{className:"adm-num text-white",children:_.uniqueUsers.toLocaleStr
5865ing()}),c.jsx("td",{className:"adm-num text-white/55",children:_.count.toLocaleString()}),c.jsx("td",{children:M===0?"â":c.jsxs(Wi,{tone:_.conversionFromPrevious>=70?"ok":_.conversionFromPrevious>=40?"warn":"bad",children:[_.conversionFromPrevious,"%"]})}),c.jsx("td",{className:"adm-num text-white/55",children:M===0?"â":`${_.dropoffFromPrevious}%`}),c.jsxs("td",{className:"adm-num font-semibold text-[var(--lp-lime)]",children:[_.overallConversion,"%"]})]},_.step))})]})})})]})}const _gt=()=>c.jsxs("div",{children:[c.jsxs("header",{className:"notFound",children:[c.jsx("h1",{children:"404"}),c.jsx("h1",{children:"Page not found"})]}),c.jsx(wP,{footerNavigation:xy})]}),wj=n=>(n==null?void 0:n.email)||(n==null?void 0:n.username)||"Unknown user";function Eie({n}){return c.jsx("span",{className:"inline-flex gap-0.5 text-[var(--lp-lime)]",children:Array.from({length:5}).map((e,t)=>c.jsx(EU,{className:t<n?"fill-current":"opacity-25"},t))})}function Sgt({user:n}){const[e,t]=G.useState("messages"),{data:r,isLoading:i,isFetching:s,error:a,refetch:o}=Qr(Cae),l=SP(),u=r||{},d=u.messages||[],h=u.feedback||[],f=u.cancellations||[],p=h.length?h.reduce((A,x)=>A+Number(x.stars||0),0)/h.length:0,g=async A=>{try{await OX({id:A.id,isRead:!A.isRead}),o()}catch(x){l.show(x.message||"Could not update",!1)}};return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"People",title:"Inbox",subtitle:"What users told you: messages, ratings, and why people cancelled.",actions:c.jsxs("button",{className:"adm-btn",onClick:()=>o(),children:[c.jsx(Xm,{className:s?"animate-spin":""})," Refresh"]})}),c.jsx("div",{className:"ws-enter mb-5",children:c.jsx(cg,{value:e,onChange:t,options:[{value:"messages",label:`Messages${u.unreadCount?` · ${u.unreadCount} new`:""}`,icon:c.jsx(Tat,{})},{value:"feedback",label:`Feedback · ${h.length}`,icon:c.jsx(EU,{})},{value:"cancellations",label:`Cancellations · ${f.length}`,icon:c.jsx(ste,{})}]})}),c.jsx(Tc,{pad:!1,children:i?c.jsx(Oy,{rows:5,cols:3}):a?c.jsx(Ly,{message:`Could not load the inbox: ${a.message}`,onRetry:()=>o()}):e==="messages"?d.length===0?c.jsx(Ec,{icon:c.jsx(Bq,{}),title:"No messages",body:"Messages users send from the contact form show up here."}):c.jsx("ul",{className:"divide-y divide-white/[0.06]",children:d.map(A=>{var x;return c.jsxs("li",{className:`flex flex-col gap-3 px-5 py-4 sm:flex-row sm:items-start sm:justify-between ${A.isRead?"":"bg-[rgba(207,255,5,.03)]"}`,children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[!A.isRead&&c.jsx("span",{className:"h-2 w-2 rounded-full bg-[var(--lp-lime)]"}),c.jsx("span",{className:"font-semibold text-white",children:wj(A.user)}),c.jsx("span",{className:"text-[12px] text-white/40",children:Ym(A.createdAt)}),A.repliedAt&&c.jsx(Wi,{tone:"ok",children:"Replied"})]}),c.jsx("p",{className:"mt-1.5 whitespace-pre-line text-[13.5px] leading-relaxed text-white/75",children:A.content})]}),c.jsxs("div",{className:"flex shrink-0 gap-2",children:[((x=A.user)==null?void 0:x.email)&&c.jsxs("a",{className:"adm-btn sm",href:`mailto:${A.user.email}?subject=${encodeURIComponent("Re: your message to SpreadOut")}`,onClick:()=>OX({id:A.id,isRead:!0,replied:!0}).then(()=>o()),children:[c.jsx(Gv,{})," Reply"]}),c.jsxs("button",{className:"adm-btn sm",onClick:()=>g(A),children:[c.jsx(Uq,{})," ",A.isRead?"Mark unread":"Mark read"]})]})]},A.id)})}):e==="feedback"?h.length===0?c.jsx(Ec,{icon:c.jsx(EU,{}),title:"No feedback yet"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-3 border-b border-white/[0.06] px-5 py-4",children:[c.jsx("span",{className:"ws-display text-2xl font-bold text-white",children:p.toFixed(1)}),c.jsx(Eie,{n:Math.round(p)}),c.jsxs("span",{className:"text-[12.5px] text-white/45",children:["average of ",h.length," ",h.length===1?"rating":"ratings"]})]}),c.jsx("ul",{className:"divide-y divide-white/[0.06]",children:h.map(A=>c.jsxs("li",{className:"px-5 py-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Eie,{n:Number(A.stars||0)}),c.jsx("span",{className:"font-semibold text-white",children:wj(A.user)}),c.jsx("span",{className:"text-[12px] text-white/40",children:Ym(A.createdAt)})]}),A.comment&&c.jsx("p",{className:"mt-1.5 text-[13.5px] leading-relaxed text-white/75",children:A.comment})]},A.id))})]}):f.length===0?c.jsx(Ec,{icon:c.jsx(ste,{}),title:"No cancellations",body:"When a subscriber cancels, their reasons appear here."}):c.jsx("ul",{className:"divide-y divide-white/[0.06]",children:f.map(A=>{var x;return c.jsxs("li",{className:"px-5 py-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"font-semibold text-white",children:wj(A.user)}),((x=A.user)==null?void 0:x.subscriptionPlan)&&c.jsx(Wi,{children:A.user.subscriptionPlan}),c.jsx("span",{className:"text-[12px] text-white/40",children:Ym(A.createdAt)})]}),c.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[(A.reasons||[]).map(b=>c.jsx(Wi,{tone:"warn",children:b},b)),!(A.reasons||[]).length&&!A.otherReason&&c.jsx("span",{className:"text-[13px] text-white/40",children:"No reason given"})]}),A.otherReason&&c.jsxs("p",{className:"mt-2 text-[13.5px] leading-relaxed text-white/75",children:["â",A.otherReason,"â"]}
5865)]},A.id)})})}),l.node]})}function Cie(n){const e=n.bonusCredits??300,t=n.loginUrl||"https://spreadout.ai/ai-automator",r=n.ctaText||"Start Creating with +300 Credits â";return`<!DOCTYPE html> 5866<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> 5867<head> 5868 <meta charset="utf-8"> 5869 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 5870 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 5871 <title>Welcome to Spread Out AI</title> 5872 <!--[if mso]> 5873 <noscript> 5874 <xml> 5875 <o:OfficeDocumentSettings> 5876 <o:PixelsPerInch>96</o:PixelsPerInch> 5877 </o:OfficeDocumentSettings> 5878 </xml> 5879 </noscript> 5880 <![endif]--> 5881 <style type="text/css"> 5882 body, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } 5883 table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; } 5884 img { -ms-interpolation-mode: bicubic; border: 0; outline: none; text-decoration: none; } 5885 body { margin: 0; padding: 0; width: 100% !important; background-color: #0B0E14; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: #FFFFFF; } 5886 a { color: #CFFF05; text-decoration: none; } 5887 @media only screen and (max-width: 620px) { 5888 .container { width: 100% !important; max-width: 100% !important; padding: 16px !important; } 5889 .hero-title { font-size: 28px !important; line-height: 34px !important; } 5890 .feature-col { display: block !important; width: 100% !important; margin-bottom: 12px !important; } 5891 } 5892 </style> 5893</head> 5894<body style="margin: 0; padding: 0; background-color: #0B0E14; -webkit-font-smoothing: antialiased;"> 5895 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #0B0E14; min-height: 100vh;"> 5896 <tr> 5897 <td align="center" style="padding: 40px 16px 60px 16px;"> 5898 <!-- CONTAINER --> 5899 <table border="0" cellpadding="0" cellspacing="0" width="100%" class="container" style="max-width: 600px; background-color: #12161F; border-radius: 24px; border: 1px solid #232A38; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5);"> 5900 5901 <!-- TOP ACCENT BAR --> 5902 <tr> 5903 <td height="4" style="background: linear-gradient(90deg, #CFFF05 0%, #10B981 100%); line-height: 4px; font-size: 4px;"> </td> 5904 </tr> 5905 5906 <!-- HEADER / LOGO --> 5907 <tr> 5908 <td align="center" style="padding: 36px 32px 24px 32px;"> 5909 <table border="0" cellpadding="0" cellspacing="0"> 5910 <tr> 5911 <td align="center"> 5912 <div style="display: inline-block; background-color: rgba(207, 255, 5, 0.1); border: 1px solid rgba(207, 255, 5, 0.3); border-radius: 16px; padding: 10px 18px;"> 5913 <span style="color: #CFFF05; font-size: 20px; font-weight: 900; letter-spacing: -0.5px; text-transform: uppercase;">Spread Out<span style="color: #FFFFFF;"> AI</span></span> 5914 </div> 5915 </td> 5916 </tr> 5917 </table> 5918 </td> 5919 </tr> 5920 5921 <!-- HERO SECTION --> 5922 <tr> 5923 <td align="center" style="padding: 0 36px 16px 36px;"> 5924 <div style="display: inline-block; background-color: rgba(207, 255, 5, 0.12); border: 1px solid rgba(207, 255, 5, 0.3); border-radius: 100px; padding: 6px 16px; margin-bottom: 16px;"> 5925 <span style="color: #CFFF05; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;">ð Welcome Aboard</span> 5926 </div> 5927 <h1 class="hero-title" style="margin: 0 0 16px 0; color: #FFFFFF; font-size: 32px; font-weight: 900; line-height: 40px; letter-spacing: -0.8px;"> 5928 Welcome to Spread Out AI! 5929 </h1> 5930 <p style="margin: 0; color: #94A3B8; font-size: 16px; line-height: 26px; font-weight: 400;"> 5931 Hey <strong style="color: #FFFFFF;">{{name}}</strong>, congratulations on joining the premier AI-powered social media automation platform! We are thrilled to have you with us. 5932 </p> 5933 </td> 5934 </tr> 5935 5936 <!-- BONUS CREDITS CARD --> 5937 <tr> 5938 <td style="padding: 16px 32px 24px 32px;"> 5939 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="background: linear-gradient(135deg, rgba(207, 255, 5, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%); border: 1px solid rgba(207, 255, 5, 0.4); border-radius: 20px; padding: 24px; text-align: center;"> 5940 <tr> 5941 <td> 5942 <div style="font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: #CFFF05; margin-bottom: 6px;"> 5943 ð Exclusive New Joiner Gift 5944 </div> 5945 <div style="font-size: 38px; font-weight: 900; color: #FFFFFF; line-height: 44px; margin-bottom: 8px;"> 5946 +${e} Free Credits 5947 </div> 5948 <p style="margin: 0; color: #CBD5E1; font-size: 14px; line-height: 22px;"> 5949 We've credited your account with <strong>+${e} bonus credits</strong> so you can test out our automated video generator, infographics, and scheduled posting right away! 5950 </p> 5951 </td> 5952 </tr> 5953 </table> 5954 </td> 5955 </tr> 5956 5957 <!-- WHAT YOU CAN CREATE SECTION --> 5958 <tr> 5959 <td style="padding: 8px 32px 28px 32px;"> 5960 <h3 style="margin: 0 0 16px 0; color: #FFFFFF; font-size: 17px; font-weight: 800; letter-spacing: -0.3px;"> 5961 ð What you can build in 60 seconds: 5962 </h3> 5963 5964 <!-- FEATURE ITEM 1 --> 5965 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #1A1F2C; border: 1px solid #283142; border-radius: 14px; margin-bottom: 10px; padding: 14px 18px;"> 5966 <tr> 5967 <td width="36" valign="top" style="padding-top: 2px;"> 5968 <div style="width: 28px; height: 28px; border-radius: 8px; background-color: rgba(168, 85, 247, 0.2); text-align: center; line-height: 28px; font-size: 15px;">ð¬</div> 5969 </td> 5970 <td style="padding-left: 12px;"> 5971 <div style="font-size: 14px; font-weight: 700; color: #FFFFFF; margin-bottom: 2px;">Viral Vertical Videos & Shorts</div> 5972 <div style="font-size: 13px; color: #94A3B8; line-height: 18px;">AI voice narration, synced b-roll, and animated word-by-word captions tailored for TikTok, Reels, and Shorts.</div> 5973 </td> 5974 </tr> 5975 </table> 5976 5977 <!-- FEATURE ITEM 2 --> 5978 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #1A1F2C; border: 1px solid #283142; border-radius: 14px; margin-bottom: 10px; padding: 14px 18px;"> 5979 <tr> 5980 <td width="36" valign="top" style="padding-top: 2px;"> 5981 <div style="width: 28px; height: 28px; border-radius: 8px; background-color: rgba(16, 185, 129, 0.2); text-align: center; line-height: 28px; font-size: 15px;">ð¼ï¸</div> 5982 </td> 5983 <td style="padding-left: 12px;"> 5984 <div style="font-size: 14px; font-weight: 700; color: #FFFFFF; margin-bottom: 2px;">Social Carousels & Infographics</div> 5985 <div style="font-size: 13px; color: #94A3B8; line-height: 18px;">Stunning visual slide decks and editorial graphics rendered in ultra-sharp resolution.</div> 5986 </td> 5987 </tr> 5988 </table> 5989 5990 <!-- FEATURE ITEM 3 --> 5991 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #1A1F2C; border: 1px solid #283142; border-radius: 14px; padding: 14px 18px;"> 5992 <tr> 5993 <td width="36" valign="top" style="padding-top: 2px;"> 5994 <div style="width: 28px; height: 28px; border-radius: 8px; background-color: rgba(59, 130, 246, 0.2); text-align: center; line-height: 28px; font-size: 15px;">ð¤</div> 5995 </td> 5996 <td style="padding-left: 12px;"> 5997 <div style="font-size: 14px; font-weight: 700; color: #FFFFFF; margin-bottom: 2px;">Full Auto-Pilot Publishing</div> 5998 <div style="font-size: 13px; color: #94A3B8; line-height: 18px;">Set your weekly posting calendar once and let Spread Out AI research, generate, and publish automatically.</div> 5999 </td> 6000 </tr> 6001 </table> 6002 </td> 6003 </tr> 6004 6005 <!-- CTA BUTTON --> 6006 <tr> 6007 <td align="center" style="padding: 0 32px 36px 32px;"> 6008 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 6009 <tr> 6010 <td align="center"> 6011 <a href="${t}" target="_blank" style="display: block; width: 100%; max-width: 440px; background-color: #CFFF05; color: #0F121A; font-size: 16px; font-weight: 900; text-align: center; text-decoration: none; padding: 18px 24px; border-radius: 14px; letter-spacing: -0.3px; box-shadow: 0 10px 25px rgba(207, 255, 5, 0.35); text-transform: uppercase;"> 6012 ${r} 6013 </a> 6014 </td> 6015 </tr> 6016 </table> 6017 </td> 6018 </tr> 6019 6020 <!-- QUICK START STEPS --> 6021 <tr> 6022 <td style="padding: 0 32px 32px 32px;"> 6023 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #0E1118; border-radius: 16px; padding: 20px; border: 1px solid #1C2330;"> 6024 <tr> 6025 <td> 6026 <div style="font-size: 13px; font-weight: 800; color: #E2E8F0; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;"> 6027 ð¡ Quick Onboarding Checklist: 6028 </div> 6029 <div style="font-size: 13px; color: #94A3B8; line-height: 22px;"> 6030 1. Connect your social channels (Instagram, TikTok, YouTube, X, LinkedIn)<br> 6031 2. Choose your niche and content topics in <strong>AI Automator</strong><br> 6032 3. Click <strong>Generate Weekly Strategy</strong> or create your first video with your free credits! 6033 </div> 6034 </td> 6035 </tr> 6036 </table> 6037 </td> 6038 </tr> 6039 6040 <!-- FOOTER --> 6041 <tr> 6042 <td style="padding: 24px 32px 36px 32px; background-color: #0B0E14; border-top: 1px solid #1C2330; text-align: center;"> 6043 <p style="margin: 0 0 10px 0; color: #64748B; font-size: 13px; line-height: 20px;"> 6044 Have questions or need help? Reply directly to this email at <
6044a href="mailto:[email protected]" style="color: #CFFF05;">[email protected]</a>. 6045 </p> 6046 <p style="margin: 0; color: #475569; font-size: 12px;"> 6047 © ${new Date().getFullYear()} Spread Out AI. All rights reserved. 6048 </p> 6049 </td> 6050 </tr> 6051 6052 </table> 6053 <!-- /CONTAINER --> 6054 </td> 6055 </tr> 6056 </table> 6057</body> 6058</html>`}const _j=[{id:"welcome-300-credits",name:"ð Welcome & +300 Free Credits",category:"welcome",description:"Congratulate new joiners, introduce core capabilities, and reward them with +300 credits for free testing.",badge:"Recommended for New Joiners",defaultSubject:"ð Welcome to Spread Out AI! Here is +300 Free Credits to start creating",defaultBonusCredits:300,defaultHtml:Cie({bonusCredits:300,ctaText:"Start Creating with +300 Free Credits â"}),defaultText:`Hey {{name}}, 6059 6060Welcome to Spread Out AI! Congratulations on joining the premier AI-powered social media automation platform. 6061 6062ð EXCLUSIVE NEW JOINER GIFT: 6063We have added +300 Free Credits to your account so you can test out our automated video generator, infographics, and scheduled posting right away! 6064 6065ð What you can build: 6066- Viral Vertical Videos & Shorts (AI voices, b-roll, animated captions) 6067- Social Carousels & Infographics 6068- Full Auto-Pilot Publishing (Set once, generate & publish weekly) 6069 6070Start creating now: https://spreadout.ai/ai-automator 6071 6072Best regards, 6073The Spread Out AI Team`},{id:"product-update-engine",name:"ð New Features: Enhanced Video & Infographics",category:"update",description:"Spotlight the latest platform upgrades: Playwright Infographics, 60fps Hyperframes render engine, and Auto-Pilot.",badge:"Product Announcement",defaultSubject:"ð New on Spread Out AI: Enhanced AI Video & Infographics Engine",defaultBonusCredits:100,defaultHtml:`<!DOCTYPE html> 6074<html> 6075<head> 6076 <meta charset="utf-8"> 6077 <style> 6078 body { margin: 0; padding: 0; background-color: #0B0E14; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #FFFFFF; } 6079 a { color: #CFFF05; text-decoration: none; } 6080 </style> 6081</head> 6082<body style="margin: 0; padding: 0; background-color: #0B0E14;"> 6083 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="min-height: 100vh;"> 6084 <tr> 6085 <td align="center" style="padding: 40px 16px 60px 16px;"> 6086 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px; background-color: #12161F; border-radius: 24px; border: 1px solid #232A38; overflow: hidden;"> 6087 <tr> 6088 <td height="4" style="background: linear-gradient(90deg, #CFFF05 0%, #3B82F6 100%);"> </td> 6089 </tr> 6090 <tr> 6091 <td align="center" style="padding: 36px 32px 24px 32px;"> 6092 <div style="display: inline-block; background-color: rgba(207, 255, 5, 0.1); border: 1px solid rgba(207, 255, 5, 0.3); border-radius: 16px; padding: 10px 18px;"> 6093 <span style="color: #CFFF05; font-size: 20px; font-weight: 900; letter-spacing: -0.5px; text-transform: uppercase;">Spread Out<span style="color: #FFFFFF;"> AI</span></span> 6094 </div> 6095 </td> 6096 </tr> 6097 <tr> 6098 <td style="padding: 0 36px 24px 36px; text-align: center;"> 6099 <div style="display: inline-block; background-color: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); border-radius: 100px; padding: 6px 16px; margin-bottom: 16px;"> 6100 <span style="color: #60A5FA; font-size: 12px; font-weight: 800; text-transform: uppercase;">â¡ Major Engine Upgrade</span> 6101 </div> 6102 <h1 style="margin: 0 0 16px 0; color: #FFFFFF; font-size: 30px; font-weight: 900; line-height: 38px;"> 6103 Create Content 10x Faster 6104 </h1> 6105 <p style="margin: 0; color: #94A3B8; font-size: 16px; line-height: 26px;"> 6106 Hey <strong style="color: #FFFFFF;">{{name}}</strong>, we just rolled out powerful new generation capabilities to accelerate your social media growth. 6107 </p> 6108 </td> 6109 </tr> 6110 <tr> 6111 <td style="padding: 0 32px 32px 32px;"> 6112 <div style="background-color: #1A1F2C; border: 1px solid #283142; border-radius: 16px; padding: 20px; margin-bottom: 12px;"> 6113 <div style="font-size: 15px; font-weight: 800; color: #CFFF05; margin-bottom: 4px;">ð¼ï¸ High-Res Playwright Infographics</div> 6114 <div style="font-size: 13px; color: #94A3B8; line-height: 20px;">Crisp editorial cards and multi-slide carousels rendered on dedicated GPU servers with dynamic layouts.</div> 6115 </div> 6116 <div style="background-color: #1A1F2C; border: 1px solid #283142; border-radius: 16px; padding: 20px;"> 6117 <div style="font-size: 15px; font-weight: 800; color: #60A5FA; margin-bottom: 4px;">ð¬ 60fps Hyperframes Render Engine</div> 6118 <div style="font-size: 13px; color: #94A3B8; line-height: 20px;">Smoother animations, synced music, and studio-grade audio processing for all vertical shorts.</div> 6119 </div> 6120 </td> 6121 </tr> 6122 <tr> 6123 <td align="center" style="padding: 0 32px 36px 32px;"> 6124 <a href="https://spreadout.ai/ai-automator" target="_blank" style="display: block; width: 100%; max-width: 440px; background-color: #CFFF05; color: #0F121A; font-size: 16px; font-weight: 900; text-align: center; text-decoration: none; padding: 18px 24px; border-radius: 14px; text-transform: uppercase;"> 6125 Try New Features Now â 6126 </a> 6127 </td> 6128 </tr> 6129 <tr> 6130 <td style="padding: 24px 32px; background-color: #0B0E14; border-top: 1px solid #1C2330; text-align: center; color: #475569; font-size: 12px;"> 6131 © ${new Date().getFullYear()} Spread Out AI. All rights reserved. 6132 </td> 6133 </tr> 6134 </table> 6135 </td> 6136 </tr> 6137 </table> 6138</body> 6139</html>`,defaultText:`Hey {{name}}, 6140 6141We just launched major updates on Spread Out AI: 6142- High-Res Playwright Infographics & Carousels 6143- 60fps Hyperframes Video Engine 6144 6145Try the new features: https://spreadout.ai/ai-automator 6146 6147The Spread Out AI Team`},{id:"special-credit-reward",name:"â¡ Credit Refill & Reward Giveaway",category:"promo",description:"Reward your users with extra credits to boost engagement and re-ignite workflow runs.",badge:"Engagement Boost",defaultSubject:"ð Surprise! Enjoy +{{bonusCredits}} Free Credits on Spread Out AI",defaultBonusCredits:300,defaultHtml:Cie({bonusCredits:300,ctaText:"Use Your +300 Credits Now â"}),defaultText:`Hey {{name}}, 6148 6149Surprise! We have just credited your account with +{{bonusCredits}} free credits on Spread Out AI! 6150 6151Log in to generate your next viral post: https://spreadout.ai/ai-automator 6152 6153The Spread Out AI Team`}];function Tgt({user:n}){const e=SP(),[t,r]=G.useState("welcome-300-credits"),i=G.useMemo(()=>_j.find(Fe=>Fe.id===t)||_j[0],[t]),[s,a]=G.useState(i.defaultSubject),[o,l]=G.useState(i.defaultHtml),[u,d]=G.useState(i.defaultText),[h,f]=G.useState(i.defaultBonusCredits),[p,g]=G.useState(!0);G.useEffect(()=>{a(i.defaultSubject),l(i.defaultHtml),d(i.defaultText),f(i.defaultBonusCredits)},[t]);
6153const[A,x]=G.useState("new-joiners"),[b,_]=G.useState([]),[M,T]=G.useState(""),[L,D]=G.useState(7),[P,O]=G.useState(""),[F,U]=G.useState("all"),[B,z]=G.useState("desktop"),[H,X]=G.useState("visual"),W=cl(d4e),[J,ee]=G.useState(!1),[ae,le]=G.useState(!1),[Z,Y]=G.useState(null),[re,_e]=G.useState("idle"),{data:Ee,isLoading:Ae,refetch:te}=Qr(j4e,{search:P,filter:F}),ve=(Ee==null?void 0:Ee.users)||[],we=(Ee==null?void 0:Ee.totalUsers)||0,Ue=(Ee==null?void 0:Ee.newJoiners7dCount)||0,ze=G.useMemo(()=>A==="all"?we:A==="new-joiners"?Ue:A==="selected"?b.length:A==="custom"?M.split(/[\n,;]+/).map(Fe=>Fe.trim()).filter(Fe=>Fe.includes("@")).length:0,[A,we,Ue,b,M]),yt=()=>{b.length===ve.length?_([]):_(ve.map(Fe=>Fe.id))},mt=Fe=>{_(Ze=>Ze.includes(Fe)?Ze.filter(Ye=>Ye!==Fe):[...Ze,Fe])},bt=(Fe,Ze)=>{a(Ye=>`${Ye} {{${Fe}}}`)},dt=G.useMemo(()=>{var Ye;let Fe=o||"";const Ze={name:n.username||((Ye=n.email)==null?void 0:Ye.split("@")[0])||"Alex (Creator)",email:n.email||"[email protected]",credits:String((n.credits||60)+(p?h:0)),bonusCredits:String(h||300),loginUrl:"https://spreadout.ai/ai-automator",appName:"Spread Out AI"};for(const[ft,At]of Object.entries(Ze)){const Ce=new RegExp(`{{\\s*${ft}\\s*}}`,"gi");Fe=Fe.replace(Ce,At)}return Fe},[o,h,p,n]),St=async()=>{if(!n.email){e.show("Your admin account needs an email to receive tests",!1);return}_e("sending");try{await W({subject:`[TEST] ${s}`,htmlBody:o,textBody:u,customEmails:[n.email],addCreditsAmount:0,templateKey:i.id}),_e("success"),setTimeout(()=>_e("idle"),3e3)}catch(Fe){console.error(Fe),_e("error"),e.show(`Test email failed: ${Fe.message||"Error"}`,!1),setTimeout(()=>_e("idle"),3e3)}},kt=async()=>{ee(!0),Y(null);try{const Fe={subject:s,htmlBody:o,textBody:u,addCreditsAmount:p?Number(h):0,templateKey:i.id};if(A==="all")Fe.sendToAll=!0;else if(A==="new-joiners")Fe.sendToNewJoiners=!0,Fe.newJoinerDays=L;else if(A==="selected"){if(b.length===0)throw new Error("Please select at least one user from the table.");Fe.recipientUserIds=b}else if(A==="custom"){const Ye=M.split(/[\n,;]+/).map(ft=>ft.trim()).filter(ft=>ft.includes("@"));if(Ye.length===0)throw new Error("Please enter at least one valid email address.");Fe.customEmails=Ye}const Ze=await W(Fe);Y(Ze),te()}catch(Fe){e.show(`Campaign not sent: ${Fe.message||"Failed to dispatch emails"}`,!1)}finally{ee(!1)}};return c.jsxs(vg,{user:n,children:[c.jsx(yg,{kicker:"People",title:"Email campaigns",subtitle:"Pick a template, choose who gets it, optionally grant bonus credits, preview it live and send.",actions:c.jsxs("button",{onClick:St,disabled:re==="sending",className:"adm-btn",children:[re==="sending"?c.jsx(Xm,{className:"animate-spin"}):re==="success"?c.jsx(Uq,{className:"text-emerald-300"}):c.jsx(OA,{}),re==="success"?"Test sent":"Send test to me"]})}),c.jsxs("div",{className:"flex flex-col gap-6 pb-16",children:[c.jsxs("div",{className:"ws-stagger grid grid-cols-2 gap-3 lg:grid-cols-4",children:[c.jsx(vs,{label:"Users you can reach",value:we.toLocaleString(),icon:c.jsx(Zu,{})}),c.jsx(vs,{label:"Joined in the last 7 days",value:Ue.toLocaleString(),icon:c.jsx(TU,{}),tone:"lime"}),c.jsx(vs,{label:"Selected template",value:c.jsx("span",{className:"text-lg",children:i.name}),icon:c.jsx(ate,{})}),c.jsx(vs,{label:"Will receive this",value:ze.toLocaleString(),foot:p?`+${h} credits each`:"no credits",icon:c.jsx(OA,{}),tone:"info"})]}),c.jsxs("div",{children:[c.jsx("div",{className:"flex items-center justify-between mb-3",children:c.jsxs("h2",{className:"text-sm font-black uppercase tracking-wider text-gray-400 flex items-center gap-2",children:[c.jsx(ate,{className:"w-4 h-4 text-[#CFFF05]"}),c.jsx("span",{children:"Select Email Template"})]})}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:_j.map(Fe=>{const Ze=Fe.id===t;return c.jsxs("div",{onClick:()=>r(Fe.id),className:`cursor-pointer rounded-2xl p-5 border transition-all duration-200 flex flex-col justify-between ${Ze?"bg-[#161B26] border-[#CFFF05] shadow-[0_0_25px_-5px_rgba(207,255,5,0.2)]":"bg-[#12161F] border-gray-800 hover:border-gray-700 hover:bg-[#161A24]"}`,children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:`text-[10px] font-black uppercase tracking-wider px-2.5 py-0.5 rounded-full ${Ze?"bg-[#CFFF05]/20 text-[#CFFF05] border border-[#CFFF05]/40":"bg-gray-800 text-gray-400"}`,children:Fe.badge}),Ze&&c.jsx(I1,{className:"w-4 h-4 text-[#CFFF05]"})]}),c.jsx("h3",{className:"text-base font-bold text-white mb-1.5",children:Fe.name}),c.jsx("p",{className:"text-xs text-gray-400 line-clamp-2 leading-relaxed",children:Fe.description})]}),c.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-800/80 flex items-center justify-between text-xs",children:[c.jsx("span",{className:"text-gray-400",children:"Bonus Credits:"}),c.jsxs("span",{className:"font-black text-[#CFFF05]",children:["+",Fe.defaultBonusCredits]})]})]},Fe.id)})})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6",children:[c.jsxs("div",{className:"lg:col-span-7 flex flex-col gap-6",children:[c.jsxs("div",{className:"bg-[#12161F] border border-gray-800 rounded-3xl p-6",children:[c.jsxs("h3",{className:"text-sm font-black uppercase tracking-wider text-white mb-4 flex items-center gap-2",children:[c.jsx(Zu,{className:"w-4 h-4 text-[#CFFF05]"}),c.jsx("span",{children:"1. Target Audience"})]}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2.5 mb-4",children:[c.jsxs("button",{type:"button",onClick:()=>x("new-joiners"),className:`p-3 rounded-2xl border text-left flex flex-col justify-between transition-all ${A==="new-joiners"?"bg-[#CFFF05]/10 border-[#CFFF05] text-white":"bg-[#161B26] border-gray-800 text-gray-400 hover:border-gray-700"}`,children:[c.jsx("span",{className:"text-xs font-bold text-white",children:"ð New Joiners"}),c.jsxs("span",{className:"text-[11px] text-[#CFFF05] font-black mt-1",children:[Ue," users (7d)"]})]}),c.jsxs("button",{type:"button",onClick:()=>x("selected"),className:`p-3 rounded-2xl border text-left flex flex-col justify-between transition-all ${A==="selected"?"bg-[#CFFF05]/10 border-[#CFFF05] text-white":"bg-[#161B26] border-gray-800 text-gray-400 hover:border-gray-700"}`,children:[c.jsx("span",{className:"text-xs font-bold text-white",children:"ð¥ Selected Users"}),c.jsxs("span",{className:"text-[11px] text-[#CFFF05] font-black mt-1",children:[b.length," chosen"]})]}),c.jsxs("button",{type:"button",onClick:()=>x("all"),className:`p-3 rounded-2xl border text-left flex flex-col justify-between transition-all ${A==="all"?"bg-[#CFFF05]/10 border-[#CFFF05] text-white":"bg-[#161B26] border-gray-800 text-gray-400 hover:border-gray-700"}`,children:[c.jsx("span",{className:"text-xs font-bold text-white",children:"ð All Users"}),c.jsxs("span",{className:"text-[11px] text-[#CFFF05] font-black mt-1",children:[we," users"]})]}),c.jsxs("button",{type:"button",onClick:()=>x("custom"),className:`p-3 rounded-2xl border text-left flex flex-col justify-between transition-all ${A==="custom"?"bg-[#CFFF05]/10 border-[#CFFF05] text-white":"bg-[#161B26] border-gray-800 text-gray-400 hover:border-gray-700"}`,children:[c.jsx("span",{className:"text-xs font-bold text-white",children:"âï¸ Custom List"}),c.jsx("span",{className:"text-[11px] text-gray-400 mt-1",children:"Enter emails"})]})]}),A==="new-joiners"&&c.jsxs("div",{className:"flex items-center gap-3 bg-[#161B26] border border-gray-800 rounded-2xl p-3 text-xs text-gray-300",children:[c.jsx("span",{children:"Filter users who joined in the last:"}),c.jsxs("select",{value:L,onChange:Fe=>D(Number(Fe.target.value)),className:"bg-[#0B0E14] border border-gray-700 rounded-lg px-2.5 py-1 text-white font-bold text-xs focus:outline-none focus:border-[#CFFF05]",children:[c.jsx("option",{value:1,children:"24 Hours"}),c.jsx("option",{value:3,children:"3 Days"}),c.jsx("option",{value:7,children:"7 Days"}),c.jsx("option",{value:14,children:"14 Days"}),c.jsx("option",{value:30,children:"30 Days"})]})]}),A==="custom"&&c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-bold text-gray-400 mb-1",children:"Recipient Emails (comma or newline separated):"}),c.jsx("textarea",{rows:3,value:M,onChange:Fe=>T(Fe.target.value),placeholder:"[email protected], [email protected]",className:"w-full bg-[#0B0E14] border border-gray-800 rounded-2xl p-3 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-[#CFFF05]"})]})]}),c.jsxs("div",{className:"bg-[#12161F] border border-gray-800 rounded-3xl p-6",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-10 h-10 rounded-2xl bg-[#CFFF05]/10 border border-[#CFFF05]/30 flex items-center justify-center text-[#CFFF05] shrink-0",children:c.jsx(TU,{className:"w-5 h-5"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-black text-white",children:"Automated Credits Grant"}),c.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Automatically increase recipient user accounts with bonus credits in database upon sending."})]})]}),c.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:p,onChange:Fe=>g(Fe.target.checked),className:"sr-only peer"}),c.jsx("div",{className:"w-11 h-6 bg-gray-800 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[#CFFF05]"})]})]}),p&&c.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-800 flex items-center gap-3",children:[c.jsx("label",{className:"text-xs font-bold text-gray-300",children:"Credits to add per user:"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"number",min:0,step:50,value:h,onChange:Fe=>f(Number(Fe.target.value)),className:"w-28 bg-[#0B0E14] border border-gray-700 rounded-xl px-3 py-1.5 text-sm font-black text-[#CFFF05] focus:outline-none focus:border-[#CFFF05]"}),c.jsx("span",{className:"text-xs text-gray-400",children:"credits"})]})]})]}),c.jsxs("div",{className:"bg-[#12161F] border border-gray-800 rounded-3xl p-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("h3",{className:"text-sm font-black uppercase tracking-wider text-white flex items-center gap-2",children:[c.jsx(ite,{className:"w-4 h-4 text-[#CFFF05]"}),c.jsx("span",{children:"2. Email Subject & Content"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-[10px] text-gray-500",children:"Insert token:"}),["name","bonusCredits","credits"].map(Fe=>c.jsxs("button",{type:"button",onClick:()=>bt(Fe),className:"px-2 py-0.5 rounded-md bg-gray-800 hover:bg-gray-700 text-gray-300 text-[10px] font-mono border border-gray-700",children:["+",`{{${Fe}}}`]},Fe))]})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"block text-xs font-bold text-gray-400 mb-1.5",children:"Subject Line"}),c.jsx("input",{type:"text",value:s,onChange:Fe=>a(Fe.target.value),className:"w-full bg-[#0B0E14] border border-gray-800 rounded-2xl px-4 py-3 text-sm text-white font-medium focus:outline-none focus:border-[#CFFF05]"})]}),c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("label",{className:"text-xs font-bold text-gray-400",children:"Template HTML Source Code"}),c.jsxs("div",{className:"flex items-center gap-1 bg-[#0B0E14] p-1 rounded-xl border border-gray-800 text-xs",children:[c.jsx("button",{type:"button",onClick:()=>X("visual"),className:`px-3 py-1 rounded-lg font-bold transition-all ${H==="visual"?"bg-[#CFFF05] text-[#0F121A]":"text-gray-400 hover:text-white"}`,children:"Visual Preview"}),c.jsx("button",{type:"button",onClick:()=>X("code"),className:`px-3 py-1 rounded-lg font-bold transition-all ${H==="code"?"bg-[#CFFF05] text-[#0F121A]":"text-gray-400 hover:text-white"}`,children:"HTML Code"})]})]}),H==="code"?c.jsx("textarea",{rows:14,value:o,onChange:Fe=>l(Fe.target.value),className:"w-full bg-[#0B0E14] border border-gray-800 rounded-2xl p-4 font-mono text-xs text-emerald-400 focus:outline-none focus:border-[#CFFF05]"}):c.jsxs("div",{className:"bg-[#0B0E14] border border-gray-800 rounded-2xl p-4 text-xs text-gray-400",children:[c.jsx("p",{className:"mb-2 font-medium text-gray-300",children:"Live HTML markup is configured and styled for maximum email client compatibility (Gmail, Apple Mail, Outlook)."}),c.jsxs("p",{children:["Check the ",c.jsx("strong",{children:"Live Preview"})," panel on the right to inspect desktop and mobile responsive layout in real-time."]})]})]}),c.jsxs("div",{className:"flex items-center justify-between bg-[#12161F] border border-gray-800 rounded-3xl p-6",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-gray-400",children:"Ready to broadcast:"}),c.jsxs("div",{className:"text-base font-bold text-white",children:["Targeting ",c.jsx("span",{className:"text-[#CFFF05] font-black",children:ze})," recipients",p&&c.jsxs("span",{children:[" (+",h," credits each)"]}
6153)]})]}),c.jsxs("button",{onClick:()=>le(!0),disabled:ze===0,className:"px-8 py-4 rounded-2xl bg-[#CFFF05] hover:bg-[#b8e604] text-[#0F121A] font-black text-sm uppercase tracking-wider flex items-center gap-2 shadow-[0_0_25px_-5px_rgba(207,255,5,0.4)] transition-all disabled:opacity-50 hover:scale-105",children:[c.jsx(OA,{className:"w-4 h-4"}),c.jsx("span",{children:"Launch Email Campaign"})]})]})]}),c.jsx("div",{className:"lg:col-span-5 flex flex-col gap-4",children:c.jsxs("div",{className:"bg-[#12161F] border border-gray-800 rounded-3xl p-6 sticky top-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(yat,{className:"w-4 h-4 text-[#CFFF05]"}),c.jsx("h3",{className:"text-sm font-black uppercase tracking-wider text-white",children:"Live Email Preview"})]}),c.jsxs("div",{className:"flex items-center gap-1 bg-[#0B0E14] p-1 rounded-xl border border-gray-800",children:[c.jsx("button",{type:"button",onClick:()=>z("desktop"),className:`p-1.5 rounded-lg text-xs transition-all ${B==="desktop"?"bg-[#CFFF05] text-[#0F121A]":"text-gray-400 hover:text-white"}`,title:"Desktop View (600px)",children:c.jsx(Nat,{className:"w-4 h-4"})}),c.jsx("button",{type:"button",onClick:()=>z("mobile"),className:`p-1.5 rounded-lg text-xs transition-all ${B==="mobile"?"bg-[#CFFF05] text-[#0F121A]":"text-gray-400 hover:text-white"}`,title:"Mobile View (375px)",children:c.jsx(Dat,{className:"w-4 h-4"})}),c.jsx("button",{type:"button",onClick:()=>z("text"),className:`p-1.5 rounded-lg text-xs transition-all ${B==="text"?"bg-[#CFFF05] text-[#0F121A]":"text-gray-400 hover:text-white"}`,title:"Plain Text View",children:c.jsx(ite,{className:"w-4 h-4"})})]})]}),c.jsxs("div",{className:"bg-[#0B0E14] border border-gray-800 rounded-2xl p-3 mb-4",children:[c.jsx("div",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-wider",children:"Subject"}),c.jsx("div",{className:"text-xs font-bold text-white truncate mt-0.5",children:s.replace(/{{\s*bonusCredits\s*}}/gi,String(h))}),c.jsxs("div",{className:"text-[10px] text-gray-400 mt-1 flex items-center justify-between",children:[c.jsx("span",{children:"From: Spread Out AI <[email protected]>"}),c.jsxs("span",{children:["To: ",n.email||"[email protected]"]})]})]}),B==="text"?c.jsx("div",{className:"bg-[#0B0E14] border border-gray-800 rounded-2xl p-4 font-mono text-xs text-gray-300 whitespace-pre-wrap max-h-[600px] overflow-y-auto",children:u}):c.jsxs("div",{className:`mx-auto bg-black rounded-2xl overflow-hidden border border-gray-800 transition-all duration-300 shadow-2xl ${B==="mobile"?"max-w-[375px]":"w-full"}`,children:[c.jsxs("div",{className:"bg-[#1A1D24] px-4 py-2 flex items-center gap-1.5 border-b border-gray-800",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),c.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500/80"}),c.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-500/80"}),c.jsx("span",{className:"text-[10px] text-gray-400 ml-2 font-mono",children:B==="mobile"?"iPhone (375px)":"Mail Client (600px)"})]}),c.jsx("iframe",{title:"Email Live Preview",srcDoc:dt,className:"w-full h-[540px] border-none bg-[#0B0E14]",sandbox:"allow-same-origin"})]})]})})]}),c.jsxs("div",{className:"bg-[#12161F] border border-gray-800 rounded-3xl p-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-6",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-lg font-black text-white flex items-center gap-2",children:[c.jsx(Zu,{className:"w-5 h-5 text-[#CFFF05]"}),c.jsx("span",{children:"User Directory & Recipient Picker"})]}),c.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Search and select specific users to send this template or award credits."})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsxs("div",{className:"relative",children:[c.jsx(wAe,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-500 w-3.5 h-3.5"}),c.jsx("input",{type:"text",value:P,onChange:Fe=>O(Fe.target.value),placeholder:"Search by email...",className:"bg-[#0B0E14] border border-gray-800 rounded-xl pl-9 pr-4 py-2 text-xs text-white focus:outline-none focus:border-[#CFFF05] w-52"})]}),c.jsxs("select",{value:F,onChange:Fe=>U(Fe.target.value),className:"bg-[#0B0E14] border border-gray-800 rounded-xl px-3 py-2 text-xs text-gray-300 font-bold focus:outline-none focus:border-[#CFFF05]",children:[c.jsx("option",{value:"all",children:"All Users"}),c.jsx("option",{value:"new-joiners-7d",children:"New Joiners (7 Days)"}),c.jsx("option",{value:"new-joiners-24h",children:"New Joiners (24 Hours)"}),c.jsx("option",{value:"free-plan",children:"Free Plan Users"}),c.jsx("option",{value:"pro-plan",children:"Pro Plan Users"})]}),c.jsx("button",{type:"button",onClick:yt,className:"px-3 py-2 rounded-xl bg-gray-800 hover:bg-gray-700 text-xs font-bold text-white border border-gray-700 transition-all",children:b.length===ve.length?"Deselect All":"Select All Filtered"})]})]}),Ae?c.jsx("div",{className:"py-12 flex justify-center items-center",children:c.jsx(Xm,{className:"w-6 h-6 animate-spin text-[#CFFF05]"})}):ve.length===0?c.jsx("div",{className:"py-12 text-center text-xs text-gray-500",children:"No users found matching your filters."}):c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-gray-800 text-gray-400 font-bold uppercase tracking-wider text-[10px]",children:[c.jsx("th",{className:"p-3 w-10",children:c.jsx("input",{type:"checkbox",checked:ve.length>0&&b.length===ve.length,onChange:yt,className:"rounded border-gray-700 bg-gray-900 text-[#CFFF05] focus:ring-[#CFFF05]"})}),c.jsx("th",{className:"p-3",children:"User"}),c.jsx("th",{className:"p-3",children:"Joined Date"}),c.jsx("th",{className:"p-3",children:"Current Credits"}),c.jsx("th",{className:"p-3",children:"Tier"}),c.jsx("th",{className:"p-3",children:"Generations"}),c.jsx("th",{className:"p-3 text-right",children:"Action"})]})}),c.jsx("tbody",{className:"divide-y divide-gray-800/60",children:ve.map(Fe=>{const Ze=b.includes(Fe.id);return c.jsxs("tr",{onClick:()=>
6153mt(Fe.id),className:`cursor-pointer transition-colors ${Ze?"bg-[#CFFF05]/5":"hover:bg-gray-800/30"}`,children:[c.jsx("td",{className:"p-3",onClick:Ye=>Ye.stopPropagation(),children:c.jsx("input",{type:"checkbox",checked:Ze,onChange:()=>mt(Fe.id),className:"rounded border-gray-700 bg-gray-900 text-[#CFFF05] focus:ring-[#CFFF05]"})}),c.jsxs("td",{className:"p-3",children:[c.jsx("div",{className:"font-bold text-white",children:Fe.email}),c.jsx("div",{className:"text-[11px] text-gray-500 font-mono",children:Fe.username})]}),c.jsx("td",{className:"p-3 text-gray-400",children:new Date(Fe.createdAt).toLocaleDateString()}),c.jsx("td",{className:"p-3",children:c.jsx("span",{className:"font-mono font-bold text-[#CFFF05]",children:Fe.credits||0})}),c.jsx("td",{className:"p-3",children:c.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase ${Fe.subscriptionPlan==="pro"?"bg-purple-500/20 text-purple-400 border border-purple-500/30":"bg-gray-800 text-gray-400"}`,children:Fe.subscriptionPlan||"free"})}),c.jsxs("td",{className:"p-3 text-gray-400",children:[Fe.executionsCount||0," posts"]}),c.jsx("td",{className:"p-3 text-right",onClick:Ye=>Ye.stopPropagation(),children:c.jsx("button",{type:"button",onClick:()=>{_([Fe.id]),x("selected")},className:"px-2.5 py-1 rounded-lg bg-gray-800 hover:bg-gray-700 text-gray-300 text-[11px] font-bold transition-all",children:"Select Target"})})]},Fe.id)})})]})})]})]}),ae&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm",children:c.jsxs("div",{className:"bg-[#12161F] border border-gray-800 rounded-3xl p-6 sm:p-8 max-w-lg w-full shadow-2xl relative",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("h3",{className:"text-lg font-black text-white flex items-center gap-2",children:[c.jsx(OA,{className:"w-5 h-5 text-[#CFFF05]"}),c.jsx("span",{children:"Confirm Email Campaign Dispatch"})]}),c.jsx("button",{onClick:()=>le(!1),className:"text-gray-400 hover:text-white text-lg font-bold",children:"â"})]}),Z?c.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[c.jsxs("div",{className:`p-4 rounded-2xl border flex items-center gap-3 ${Z.success?"bg-emerald-500/10 border-emerald-500/30 text-emerald-400":"bg-red-500/10 border-red-500/30 text-red-400"}`,children:[c.jsx(I1,{className:"w-6 h-6 shrink-0"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-bold text-sm",children:"Campaign Execution Completed"}),c.jsxs("div",{className:"text-xs mt-0.5",children:["Successfully sent: ",c.jsx("strong",{children:Z.totalSent})," | Failed:"," ",c.jsx("strong",{children:Z.totalFailed}),Z.creditsAwardedPerUser>0&&c.jsxs("span",{children:[" | +",Z.creditsAwardedPerUser," credits awarded to each user"]})]})]})]}),c.jsx("button",{type:"button",onClick:()=>{le(!1),Y(null)},className:"w-full py-3 bg-gray-800 hover:bg-gray-700 text-white font-bold text-sm rounded-xl transition-all",children:"Close"})]}):c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"bg-[#0B0E14] border border-gray-800 rounded-2xl p-4 text-xs space-y-2",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-gray-400",children:"Template:"}),c.jsx("span",{className:"text-white font-bold",children:i.name})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-gray-400",children:"Target Audience:"}),c.jsxs("span",{className:"text-[#CFFF05] font-bold capitalize",children:[A," (",ze," users)"]})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-gray-400",children:"Credit Giveaway:"}),c.jsx("span",{className:"text-white font-bold",children:p?`+${h} Credits per user`:"None"})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-gray-400",children:"Subject:"}),c.jsx("span",{className:"text-white font-medium truncate max-w-[260px]",children:s})]})]}),c.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[c.jsx("button",{type:"button",onClick:()=>le(!1),disabled:J,className:"flex-1 py-3 bg-gray-800 hover:bg-gray-700 text-gray-300 font-bold text-xs rounded-xl transition-all",children:"Cancel"}),c.jsx("button",{type:"button",onClick:kt,disabled:J||ze===0,className:"flex-1 py-3 bg-[#CFFF05] hover:bg-[#b8e604] text-[#0F121A] font-black text-xs uppercase tracking-wider rounded-xl flex items-center justify-center gap-2 shadow-lg transition-all disabled:opacity-50",children:J?c.jsxs(c.Fragment,{children:[c.jsx(Xm,{className:"w-4 h-4 animate-spin"}),c.jsx("span",{children:"Sending Emails..."})]}):c.jsxs(c.Fragment,{children:[c.jsx(OA,{className:"w-4 h-4"}),c.jsx("span",{children:"Confirm & Send Now"})]})})]})]})]})}),e.node]})}const Nie="wasp-oauth-callback-wrapper";function Egt(){const{error:n,user:e}=Cgt();return e!=null?c.jsx(sse,{to:"/ai-automator",replace:!0}):n?c.jsx(Z4,{className:Nie,children:c.jsx(Joe,{children:n})}):c.jsx(Z4,{className:Nie,children:c.jsx(GCe,{children:"Please wait a moment while we log you in."})})}function Cgt(){const{data:n,isLoading:e}=Ma(),[t,r]=G.useState(!0),[i,s]=G.useState(null),a=po();async function o(){try{r(!0);const d=new URLSearchParams(a.search).get("error");
6153if(d!==null){s(d);return}const h=a.hash.slice(1),f=await Ngt({code:h});if(!Mgt(f)){s("Unable to login with the OAuth provider.");return}await Kse(f.data.sessionId)}catch(u){console.error(u),s("Unable to login with the OAuth provider.")}finally{r(!1)}}const l=G.useRef(!0);return G.useEffect(()=>{l.current&&(l.current=!1,o())},[]),{user:n,error:i,isCallbackLoading:t,isUserLoading:e}}async function Ngt(n){return op.post("/auth/exchange-code",n)}function Mgt(n){return n.data&&typeof n.data.sessionId=="string"}function kgt(){const n=ise();return console.error(n),c.jsx(Z4,{children:c.jsx("div",{children:"There was an error rendering this page. Check the browser console for more information."})})}const Rgt={LandingPageRoute:sst,LoginRoute:Mce,SignupRoute:ast,RequestPasswordResetRoute:Gst,PasswordResetRoute:qst,EmailVerificationRoute:$st,AccountRoute:Ha(lat),LeaderboardRoute:Ha(cat),ReferralsRoute:Ha(Gat),AiAutomatorRoute:Ha(cct),TestTailoredAdVideoRoute:Ha(uct),WorkflowsRoute:Ha(wct),GroupSearchRoute:Ha(m0t),HistoryRoute:Ha(A0t),PostsRoute:Ha(b0t),ExecutionsRoute:Ha(k0t),McpAuthorizeRoute:P0t,CommentsDirectsRoute:Ha(H0t),PostAnalyticsRoute:Ha(ymt),PricingPageRoute:Dmt,DocsPageRoute:_ie,DocsMcpPageRoute:_ie,TosPageRoute:Gmt,PrivacyPolicyPageRoute:qmt,TermsOfUsePageRoute:$mt,CheckoutRoute:Ha(Hmt),AdminRoute:Ha(Qmt),AdminUsersRoute:Ha(rgt),AdminAllTasksRoute:Ha(sgt),AdminWorkflowsRoute:Ha(fgt),UserTasksRoute:Ha(vgt),UserTaskSubtasksRoute:Ha(ygt),AdminFunnelRoute:Ha(wgt),NotFoundRoute:_gt,AdminMessagesRoute:Ha(Sgt),AdminEmailTemplatesRoute:Ha(Tgt)},Pgt=[{path:"/oauth/callback",Component:Egt}],Lgt=Object.entries(H4).map(([n,e])=>({path:e.to,Component:Rgt[n]})),Ogt=y2e([{path:"/",element:c.jsx(jCe,{}),ErrorBoundary:kgt,children:[...Pgt,...Lgt]}]),Dgt=c.jsx(N2e,{router:Ogt});jgt();async function jgt(){o3e(),await Igt()}async function Igt(){const n=await yB;pve.createRoot(document.getElementById("root")).render(c.jsx(jn.StrictMode,{children:c.jsx(Fve,{client:n,children:Dgt})}))}
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.